.layout-container {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

main[role="main"] {
  flex: 1 0 auto;
}

.container {
  max-width: 1320px;
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-2);
}

.site-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  /*padding-block: var(--space-4);*/
	padding-top: var(--space-4);
}

@media (min-width: 900px) {
  .site-content.has-sidebar {
    grid-template-columns: 0.4fr 2fr;
  }
}

/* Sidebar comes after the content in markup (so screen readers/keyboard
   users reach the main content first), but displays on the left. */
.layout-sidebar-first {
  order: -1;
  min-width:250px;
}

/* Sidebar menu, styled after the News+ Lite theme's ul.menu blocks. */
.layout-sidebar-first .block {
  padding: 0 0 40px;
}

.layout-sidebar-first .block-title {
  padding-bottom: 6px;
  margin-bottom: 8px;
  font-size: 18px;
  font-weight: bold;
  text-transform: uppercase;
  border-bottom: 1px solid;
  border-bottom-color: #0b1f3a;
}

.layout-sidebar-first ul.menu {
  margin: 0;
  padding: 0;
  list-style: none;
}

.layout-sidebar-first ul.menu li {
  margin: 0;
  padding: 0;
  position: relative;
  list-style: none;
  display: flex;
  flex-wrap: wrap;
}

.layout-sidebar-first ul.menu li a {
  padding: 4px 10px 4px 25px;
  line-height: 150%;
  display: block;
  position: relative;
  flex: 1 1 auto;
  color: var(--color-text);
  text-decoration: none;
}

.layout-sidebar-first ul.menu li > ul {
  flex-basis: 100%;
}

.layout-sidebar-first ul.menu li a:hover {
  text-decoration: none;
  color: #ffffff;
  background-color: var(--color-accent);
}

.layout-sidebar-first ul.menu li a.is-active {
  font-weight: bold;
}

/* The branch of the menu you are in stays open (pinned), no hover needed.
   Applies to every level that is on the active trail. */
.layout-sidebar-first ul.menu li.menu-item--active-trail > ul {
  display: block;
}

.layout-sidebar-first ul.menu li.is-open > ul {
  display: block;
}

.layout-sidebar-first ul.menu li.menu-item--active-trail > .menu-toggle::after,
.layout-sidebar-first ul.menu li.is-open > .menu-toggle::after {
  transform: rotate(-135deg);
}

/* Menu arrows. News+ Lite uses FontAwesome chevrons (f105 / f107); here we
   draw equivalent CSS chevrons so no icon font is needed. Every item gets a
   right-pointing chevron; expanded submenu items point downwards instead. */
.layout-sidebar-first ul.menu li > a:before {
  content: "";
  position: absolute;
  left: 8px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-top: 2px solid var(--color-text);
  border-right: 2px solid var(--color-text);
  transform: translateY(-50%) rotate(45deg);
  -webkit-transition: left 0.2s ease-in-out;
  -moz-transition: left 0.2s ease-in-out;
  -o-transition: left 0.2s ease-in-out;
  transition: left 0.2s ease-in-out;
}

.layout-sidebar-first nav ul.menu li > a:hover:before {
  left: 13px;
  border-color: #ffffff;
}

.layout-sidebar-first nav ul.menu ul.menu li > a:hover:before {
  left: 28px;
  border-color: #ffffff;
}

/* Sidebar submenus. Nested levels are collapsed by default and revealed by
   hovering (or focusing) the parent item, or by the pinned active branch.
   The .is-open class is toggled by js/sidebar-menu.js on the toggle button. */
.layout-sidebar-first ul.menu ul.menu {
  display: none;
}

.layout-sidebar-first ul.menu li:hover > ul,
.layout-sidebar-first ul.menu li:focus-within > ul {
  display: block;
}

.layout-sidebar-first ul.menu ul.menu li a {
  padding-left: 40px;
}

.layout-sidebar-first ul.menu ul.menu li > a:before {
  left: 23px;
}

/* Parent items with submenus get a down arrow on the right side of the
   row. The link already flexes to fill the row; the toggle sits at the
   right edge, vertically centred against the text. */
.layout-sidebar-first .menu-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 28px;
  padding: 0;
  margin-right: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--color-text);
  flex-shrink: 0;
}

.layout-sidebar-first .menu-toggle::after {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.2s ease;
}

.layout-sidebar-first li:hover > .menu-toggle::after,
.layout-sidebar-first li:focus-within > .menu-toggle::after {
  transform: rotate(-135deg);
}

.region-highlighted {
  width: 100%;
}

/* Search block in the sidebar, styled after News+ Lite: full-width grey
   input with a grey square icon button on the right. */
.layout-sidebar-first .block-search form {
  position: relative;
}

.layout-sidebar-first .block-search .form-item {
  margin: 0;
}

.layout-sidebar-first .block-search input.form-search {
  width: 100%;
  height: 43px;
  line-height: 1;
  padding: 10px 15px;
  font-size: 14px;
  color: #898989;
  background: #fff;
  outline: none;
  border: 2px solid #c5c5c5;
  border-radius: 0;
  -webkit-appearance: none;
}

.layout-sidebar-first .block-search input.form-search:focus {
  border-color: #c5c5c5;
}

.layout-sidebar-first .block-search .form-actions {
  position: absolute;
  top: 0;
  right: 0;
  margin: 0;
}

.layout-sidebar-first .block-search .form-actions:after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: #c5c5c5;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2.5' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 18px 18px;
}

.layout-sidebar-first .block-search .form-actions input {
  position: relative;
  z-index: 1;
  margin: 0;
  min-width: 0;
  height: 43px;
  padding: 13px 30px 12px;
  background-color: transparent;
  border: none;
  border-radius: 0;
  color: transparent;
  text-indent: -999999px;
  cursor: pointer;
}

.layout-sidebar-first .block-search .form-actions input:hover {
  background-color: transparent;
}

.card-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

@media (min-width: 600px) {
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 992px) {
  .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Views listings (Noutăți, Comunicate, Documente, etc.): the wrapper that
   holds the .views-row items becomes a responsive card grid, same rhythm as
   .card-grid. Views marks this container with the js-view-dom-id-* class in
   every display context (block vs. page). Two DOM shapes are supported:
   - rows as direct children (classic pagers),
   - rows nested in the views_infinite_scroll content wrapper.
   The :has() scope limits the grid to row-based views so table styles
   (DataTables) and simple content views keep full width instead of being
   squeezed into a grid cell. */
.views-element-container > div[class*="js-view-dom-id"]:has(> .views-row),
.views-element-container > div[class*="js-view-dom-id"] > .views-infinite-scroll-content-wrapper {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
}

@media (min-width: 600px) {
  .views-element-container > div[class*="js-view-dom-id"]:has(> .views-row),
  .views-element-container > div[class*="js-view-dom-id"] > .views-infinite-scroll-content-wrapper {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 992px) {
  .views-element-container > div[class*="js-view-dom-id"]:has(> .views-row),
  .views-element-container > div[class*="js-view-dom-id"] > .views-infinite-scroll-content-wrapper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Make each card fill its grid cell so cards in the same row have equal
   height (image-top, title, teaser, footer rhythm like gov.md). */
.views-element-container > div[class*="js-view-dom-id"] > .views-row,
.views-element-container > div[class*="js-view-dom-id"] > .views-infinite-scroll-content-wrapper > .views-row {
  display: flex;
  min-width: 0;
}

.views-element-container > div[class*="js-view-dom-id"] > .views-row > .card,
.views-element-container > div[class*="js-view-dom-id"] > .views-infinite-scroll-content-wrapper > .views-row > .card {
  flex: 1;
  width: 100%;
  min-width: 0;
}

/* The pager must never become a grid cell next to the cards: force it to span
   the full grid width so it always sits on its own row at the bottom of the
   listing. */
.views-element-container > div[class*="js-view-dom-id"]:has(> .views-row) > nav.pager {
  grid-column: 1 / -1;
  width: 100%;
}
