/* Comuna1 nav · ported from primarie.css's mega-menu pattern
   ------------------------------------------------------------------
   primarie.css ships `.nav-item`, `.nav-trigger`, `.nav-dropdown`
   loaded only on primarie pages. Comuna1 reuses chrome.css's
   `.main-header` but does NOT load primarie.css. This file ports
   the primarie nav pattern onto `.nav-item > a` (the JS in
   /js/comuna-submenu.js wraps each direct `<a>` from `.main-nav`
   in a `.nav-item` div and appends a `.nav-submenu`). The trigger
   and dropdown specs mirror primarie.css §1 line-for-line so the
   two sections of the site look visually identical above the fold.
   The chrome `.main-nav > a` rules from chrome.css stop matching
   after the JS wrap (the link is no longer a direct child); those
   rules are re-applied here on the wrapped element. */


/* ============================================================
   0. LOCAL TOKEN · matches primarie.css local definition
   ============================================================ */

:root {
  --stone-hearth-hair: rgba(194, 181, 160, 0.22);
}


/* ============================================================
   1. NAV LAYOUT · stretches across the row, right-aligned
   ------------------------------------------------------------
   Same flex layout as primarie.css §1 .main-header .main-nav.
   ============================================================ */

.main-header .main-nav {
  display: flex;
  align-items: stretch;
  gap: 0;
  flex-grow: 1;
  justify-content: flex-end;
}


/* ============================================================
   2. WRAPPED TRIGGER LINK · clone of primarie .nav-trigger
   ============================================================ */

.main-header .main-nav .nav-item {
  position: relative;
  display: flex;
  align-items: center;
}

.main-header .main-nav .nav-item > a {
  display: inline-flex;
  align-items: center;
  padding: 28px 9px;
  font-size: 0.72rem;
  color: var(--essex);
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  transition: color 0.3s ease;
  text-decoration: none;
  font-weight: 400;
  letter-spacing: 0;
}

/* Single hairline INSIDE the trigger padding (same geometry as
   primarie.css .nav-trigger::after). bottom:16px places it inside
   the bottom padding, not below the link box, so the dropdown can
   sit flush at top:100% without a second visible hairline. */
.main-header .main-nav .nav-item > a::after {
  content: '';
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 16px;
  height: 1px;
  background: var(--rustic-taupe);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease, background 0.3s ease;
}

.main-header .main-nav .nav-item:hover > a {
  color: var(--rustic-taupe);
}

.main-header .main-nav .nav-item:hover > a::after {
  transform: scaleX(1);
}


/* ============================================================
   3. ACTIVE STATE · same effect as primarie .nav-item.is-active
   ------------------------------------------------------------
   On the current page, the hairline stays visible and switches
   colour from rustic-taupe to essex. The label becomes weight 500.
   ============================================================ */

.main-header .main-nav .nav-item.is-active > a {
  font-weight: 500;
  color: var(--essex);
}

.main-header .main-nav .nav-item.is-active > a::after {
  transform: scaleX(1);
  background: var(--essex);
}


/* ============================================================
   4. PRIMĂRIA PILL · institutional brand mark, no dropdown
   ============================================================ */

.main-header .main-nav .nav-item.is-primarie > a {
  font-weight: 600;
  border-right: 1px solid var(--stone-hearth-soft);
  padding-right: 22px;
  margin-right: 6px;
}


/* ============================================================
   5. DROPDOWN PANEL · single-column clone of primarie .nav-dropdown
   ------------------------------------------------------------
   border-top:none keeps the panel continuous with the nav-bar,
   eliminating the double-hairline issue.
   ============================================================ */

.main-header .main-nav .nav-submenu {
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--chantilly-pure);
  border: 1px solid var(--stone-hearth-hair);
  border-top: none;
  box-shadow: 0 14px 32px rgba(31, 45, 39, 0.08);
  padding: 24px 28px;
  min-width: 280px;
  max-width: 360px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.main-header .main-nav .nav-item:hover .nav-submenu,
.main-header .main-nav .nav-item:focus-within .nav-submenu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Right-aligned variant · added by JS when the default left-anchored
   dropdown would overflow the viewport. Keeps the trigger's right edge
   aligned with the dropdown's right edge. */
.main-header .main-nav .nav-submenu.nav-submenu-right {
  left: auto;
  right: 0;
}

.main-header .main-nav .nav-submenu a {
  display: block;
  font-size: 0.84rem;
  color: var(--essex);
  padding: 8px 10px;
  margin: 0 -4px;
  letter-spacing: -0.005em;
  line-height: 1.35;
  border-left: 2px solid transparent;
  transition:
    background 0.3s ease,
    color 0.3s ease,
    border-color 0.3s ease,
    padding-left 0.3s ease;
  text-decoration: none;
  text-transform: none;
  font-weight: 400;
}

.main-header .main-nav .nav-submenu a:hover,
.main-header .main-nav .nav-submenu a:focus {
  background: rgba(194, 181, 160, 0.16);
  color: var(--essex);
  border-left-color: var(--rustic-taupe);
  padding-left: 14px;
  outline: none;
}

.main-header .main-nav .nav-submenu a[aria-current="page"],
.main-header .main-nav .nav-submenu a.is-current {
  background: rgba(194, 181, 160, 0.36);
  color: var(--essex);
  font-weight: 500;
  border-left-color: var(--essex);
  padding-left: 14px;
}

/* "În curând" entries · disabled link with a small tag at the end.
   The badge text is supplied via the .nav-submenu-soon-label CSS variable
   per-language (set in submenu builder JS via inline style on the link). */
.main-header .main-nav .nav-submenu a.is-soon {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.main-header .main-nav .nav-submenu a.is-soon::after {
  content: attr(data-soon-label);
  font-size: 0.56rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rustic-taupe);
  background: rgba(194, 181, 160, 0.20);
  border: 1px solid rgba(194, 181, 160, 0.35);
  padding: 2px 7px;
  white-space: nowrap;
  letter-spacing: 0.12em;
}
.main-header .main-nav .nav-submenu a.is-soon:hover {
  background: transparent;
  border-left-color: transparent;
  padding-left: 10px;
  color: var(--essex);
}

/* Mobile menu accordion · same disabled style on collapsible sub-items. */
.mobile-menu-items a.is-soon {
  pointer-events: none;
  cursor: not-allowed;
  opacity: 0.55;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.mobile-menu-items a.is-soon::after {
  content: attr(data-soon-label);
  font-size: 0.58rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--rustic-taupe);
  background: rgba(194, 181, 160, 0.20);
  border: 1px solid rgba(194, 181, 160, 0.35);
  padding: 2px 8px;
  white-space: nowrap;
}


/* ============================================================
   6. BACK LINK · editorial text-link replacing the boxed button
   ------------------------------------------------------------
   `.cat-back` / `.sub-back` strips on category and sub-sub pages
   render a button-style link via inline styles; override here
   with a quiet text-link in the site's editorial register
   (uppercase, letter-spaced, hairline underline on the bolded
   label on hover). `body` prefix bumps specificity above inline.
   ============================================================ */

body .cat-back,
body .sub-back {
  background: var(--edgecomb-light);
  padding: 56px 32px 88px;
  text-align: center;
}

body .cat-back a,
body .sub-back a {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
  padding: 6px 0;
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--text-soft);
  background: transparent;
  border: 0;
  text-decoration: none;
  font-weight: 400;
  transition: color 0.25s ease;
}

body .cat-back a:hover,
body .sub-back a:hover {
  background: transparent;
  color: var(--rustic-taupe);
}

body .cat-back a strong,
body .sub-back a strong {
  position: relative;
  color: var(--essex);
  font-weight: 500;
  padding-bottom: 2px;
  transition: color 0.25s ease;
}

body .cat-back a strong::after,
body .sub-back a strong::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--rustic-taupe);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.3s ease;
}

body .cat-back a:hover strong,
body .sub-back a:hover strong {
  color: var(--rustic-taupe);
}

body .cat-back a:hover strong::after,
body .sub-back a:hover strong::after {
  transform: scaleX(1);
}


/* ============================================================
   7. RESPONSIVE · same compact baseline as primarie @1180px
   ============================================================ */

@media (max-width: 1180px) {
  .main-header .main-nav .nav-item > a {
    padding: 26px 6px;
    font-size: 0.66rem;
  }
  .main-header .main-nav .nav-item > a::after {
    left: 6px;
    right: 6px;
    bottom: 14px;
  }
  .main-header .main-nav .nav-submenu {
    display: none;
  }
}

/* Mobile · hide desktop nav (override specificity from §2);
   responsive.css already shows the hamburger at this breakpoint. */
@media (max-width: 900px) {
  .main-header .main-nav { display: none; }
}
