/* =============================================================================
   Site Header — two variants:
     • .site-header--transparent  → overlays hero on the homepage (no bg, light text)
     • .site-header--solid        → white background, dark text, used on every other page
   Layout: logo (left) — nav (center) — CTA (right). 66px content row.
   ============================================================================= */

.site-header {
    z-index: var(--z-header);
    padding-block: 1rem;
    background: transparent;
}

/* Transparent variant — sits ON TOP of the hero photo via `fixed` so it
   doesn't fight with .site-container's stacking context. */
.site-header--transparent {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: transparent;
}

/* Solid variant occupies layout flow so the page content sits below it. */
.site-header--solid {
    position: sticky;
    top: 0;
    background: var(--color-page-bg);
}

.site-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    min-height: var(--header-height);
}

/* ---- Logo --------------------------------------------------------------- */
.site-header__logo {
    flex: 0 0 auto;
}

.site-header__logo a {
    display: inline-block;
    line-height: 0;
}

.site-header__logo img,
.site-header__logo svg {
    height: 52px;
    width: auto;
    color: var(--color-brand);
}

/* Logo turns white on the transparent (homepage) variant.
   `filter: invert(1)` flips both the inline SVG and any raster custom-logo. */
.site-header--transparent .site-header__logo img,
.site-header--transparent .site-header__logo svg {
    filter: invert(1);
}

/* ---- Primary navigation ------------------------------------------------- */
.primary-navigation {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 29px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-menu > li {
    position: relative;
}

.primary-menu a {
    color: var(--color-black);
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: var(--fw-regular);
    line-height: var(--lh-snug);
    letter-spacing: var(--ls-snug);
    padding-block: var(--space-2);
    white-space: nowrap;
}

.primary-menu a:hover,
.primary-menu .current-menu-item > a {
    color: var(--color-brand);
}

/* Items with children get a caret. Sub-menus render on hover, top-aligned under the item. */
.primary-menu .menu-item-has-children > a::after {
    content: "";
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 8px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform var(--transition-fast);
}

.primary-menu .sub-menu {
    position: absolute;
    top: 150%;
    /* left: 50%; */
    /* transform: translateX(-50%) translateY(8px); */
    min-width: 240px;
    background: #F6F7F0;
    border: 0;
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.08);
    padding: var(--space-3) var(--space-4) var(--space-5);
    margin: 0;
    list-style: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity var(--transition-fast), transform var(--transition-fast), visibility var(--transition-fast);
    z-index: var(--z-overlay, 20);
}

/* Decorative sage square pinned to the dropdown's bottom-right corner. */
.primary-menu .sub-menu::after {
    content: "";
    position: absolute;
    right: 0;
    bottom: -12px;
    width: 22px;
    height: 22px;
    background: var(--color-brand);
}

/* Invisible hover bridge: fills the visual gap between the trigger item
   and the dropdown so the cursor never leaves the hover region while
   moving down. As a descendant of the parent `<li>`, hovering it still
   keeps the `:hover` chain alive. */
.primary-menu .sub-menu::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -28px;
    height: 28px;
    background: transparent;
}

/* Force the readable colour regardless of header variant (transparent vs solid). */
.primary-menu .sub-menu a,
.site-header--transparent .primary-menu .sub-menu a {
    display: block;
    padding: var(--space-2) 0;
    color: var(--color-ink, #1a1a1a);
    white-space: nowrap;
}

.primary-menu .sub-menu a:hover,
.site-header--transparent .primary-menu .sub-menu a:hover {
    background: transparent;
    color: var(--color-brand);
}

.primary-menu .menu-item-has-children:hover > .sub-menu,
.primary-menu .menu-item-has-children:focus-within > .sub-menu {
    opacity: 1;
    visibility: visible;
    /* transform: translateX(-50%) translateY(0); */
}

/* Transparent variant — over hero photo, so links go white. */
.site-header--transparent .primary-menu a {
    color: var(--color-white);
}

.site-header--transparent .primary-menu a:hover,
.site-header--transparent .primary-menu .current-menu-item > a {
    color: var(--color-brand-soft, #d6e1d3);
}

/* ---- Right cluster (CTA) ----------------------------------------------- */
.site-header__actions {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

/* CTA — base (solid header → dark filled button) */
.site-header__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 46px;
    padding-inline: 22px;
    border: 1px solid var(--color-ink, #1f2422);
    font-family: var(--font-display);
    font-size: var(--fs-md);
    font-weight: var(--fw-medium);
    line-height: 1;
    letter-spacing: var(--ls-snug);
    white-space: nowrap;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.site-header__cta:hover,
.site-header__cta:focus-visible {
    background: var(--color-brand);
    border-color: var(--color-brand);
    color: var(--color-white);
}

/* Transparent variant CTA — outlined white to sit on top of the hero photo. */
.site-header--transparent .site-header__cta {
    background: transparent;
    color: var(--color-white);
    border-color: var(--color-white);
}

.site-header--transparent .site-header__cta:hover,
.site-header--transparent .site-header__cta:focus-visible {
    background: var(--color-white);
    color: var(--color-ink, #1a1a1a);
    border-color: var(--color-white);
}

/* ---- Mobile menu toggle ------------------------------------------------ */
.menu-toggle {
    display: none;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    background: transparent;
    color: var(--color-gray-strong);
}

.site-header--transparent .menu-toggle {
    border-color: var(--color-white);
    color: var(--color-white);
}

.menu-toggle__bar,
.menu-toggle__bar::before,
.menu-toggle__bar::after {
    display: block;
    width: 20px;
    height: 2px;
    background: currentColor;
    border-radius: 2px;
    transition: transform var(--transition-fast), opacity var(--transition-fast);
}

.menu-toggle__bar { position: relative; }

.menu-toggle__bar::before,
.menu-toggle__bar::after {
    content: "";
    position: absolute;
    left: 0;
}

.menu-toggle__bar::before { top: -6px; }
.menu-toggle__bar::after  { top: 6px; }

.menu-toggle[aria-expanded="true"] .menu-toggle__bar           { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::before   { transform: translateY(6px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__bar::after    { transform: translateY(-6px) rotate(-45deg); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 1024px) {
    .site-header__cta { padding-inline: var(--space-4); }
    .primary-menu { gap: var(--space-5); }
}

/* The in-panel "×" button + logo strip + bottom CTA live in the header
   markup year-round but are hidden on desktop — only revealed when the
   nav switches to its full-screen mobile panel. */
.primary-navigation__top,
.primary-navigation__cta {
    display: none;
}

@media (max-width: 900px) {
    .menu-toggle { display: inline-flex; order: 3; }
    .site-header__cta { display: none; }

    .site-header__inner {
        justify-content: space-between;
    }

    /* Full-screen brand-green panel: logo + close on top, big menu list in
       the middle, CTA pinned to the bottom. */
    .primary-navigation {
        position: fixed;
        inset: 0;
        background: var(--color-brand);
        color: var(--color-white);
        padding: clamp(30px, 5vw, 32px);
        transform: translateX(100%);
        transition: transform var(--transition-base);
        z-index: calc(var(--z-overlay) + 10);
        flex-direction: column;
        justify-content: flex-start;
        gap: clamp(50px, 6vw, 48px);
        overflow-y: auto;
    }

    .primary-navigation[data-open="true"] { transform: translateX(0); }

    .primary-navigation__top {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
    }

    .primary-navigation__logo {
        display: inline-block;
        line-height: 0;
    }

    .primary-navigation__logo img,
    .primary-navigation__logo svg {
        height: 40px;
        width: auto;
        color: var(--color-white);
        /* Always render the panel logo white regardless of which variant the
           outer header uses (transparent/solid). */
        filter: brightness(0) invert(1);
    }

    .primary-navigation__close {
        width: 40px;
        height: 40px;
        border: 0;
        background: transparent;
        color: var(--color-white);
        cursor: pointer;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

    .primary-navigation__close svg {
        width: 26px;
        height: 26px;
    }

    /* Menu list: large white items, no underlines, generous spacing. */
    .primary-menu {
        flex-direction: column;
        align-items: flex-start;
        gap: clamp(14px, 3vw, 22px);
        width: 100%;
        margin: 0;
    }

    .primary-menu a {
        color: var(--color-white);
        font-family: var(--font-display);
        font-size: clamp(26px, 6vw, 34px);
        font-weight: var(--fw-regular);
        line-height: 1.1;
        letter-spacing: -0.4px;
        padding: 0;
        border: 0;
        width: auto;
    }

    .primary-menu a:hover,
    .primary-menu .current-menu-item > a {
        color: var(--color-brand-soft, #d6e1d3);
    }

    /* Hide the desktop caret hint on items with children; mobile sub-menus
       stay expanded inline. */
    .primary-menu .menu-item-has-children > a::after { display: none; }

    .primary-menu .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        border: 0;
        background: transparent;
        padding: 8px 0 0 var(--space-4);
        display: flex;
        flex-direction: column;
        gap: 10px;
        min-width: 0;
    }

    .primary-menu .sub-menu a {
        color: rgba(255, 255, 255, 0.85);
        font-size: clamp(18px, 4.5vw, 22px);
        padding: 0;
    }

    .primary-menu .sub-menu a:hover {
        background: transparent;
        color: var(--color-white);
    }

    /* Bottom CTA — pinned to the foot of the panel, outlined white. */
    .primary-navigation__cta {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 54px;
        width: 100%;
        margin-top: auto;
        padding-inline: 24px;
        background: transparent;
        color: var(--color-white);
        border: 1px solid var(--color-white);
        font-family: var(--font-display);
        font-size: var(--fs-md, 16px);
        font-weight: var(--fw-medium);
        line-height: 1;
        letter-spacing: var(--ls-snug);
        transition: background var(--transition-fast), color var(--transition-fast);
    }

    .primary-navigation__cta:hover,
    .primary-navigation__cta:focus-visible {
        background: var(--color-white);
        color: var(--color-brand);
    }

    /* While the panel is open the outer burger + logo go invisible — the
       panel's own × button and logo strip take over. The `has-overlay` class
       is added/removed on <body> by header.js. */
    body.has-overlay .site-header__actions .menu-toggle { display: none; }
    body.has-overlay .site-header__logo { visibility: hidden; }
}

/* =============================================================================
   PROJECT HEADER — secondary header used on /proiecte/<slug>/ and
   /proiecte/<slug>/<property>/ pages. Logo (left) — jumplinks (centre) —
   "Proiecte City Nord" button + click-dropdown (right).
   ============================================================================= */

.project-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header, 50);
    padding-block: 1rem;
    background: var(--color-page-bg, #fff);
}

.project-header__inner {
    display: flex;
    align-items: center;
    gap: var(--space-5);
    min-height: var(--header-height);
}

.project-header__logo {
    flex: 0 0 auto;
}

.project-header__logo a,
.project-header__logo .custom-logo-link {
    display: inline-block;
    line-height: 0;
}

.project-header__logo img,
.project-header__logo svg {
    height: 52px;
    width: auto;
    color: var(--color-brand);
}

/* ---- Jumplinks (centre) ------------------------------------------------ */
.project-header__nav {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: clamp(20px, 3vw, 48px);
}

.project-header__nav-link {
    color: var(--color-ink, #1a1a1a);
    font-family: var(--font-display);
    font-size: var(--fs-md, 15px);
    line-height: 1;
    letter-spacing: var(--ls-snug);
    white-space: nowrap;
    text-decoration: none;
    transition: color var(--transition-fast);
}

.project-header__nav-link:hover,
.project-header__nav-link:focus-visible {
    color: var(--color-brand);
}

/* ---- Right actions ----------------------------------------------------- */
.project-header__actions {
    flex: 0 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.project-header__projects {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    height: 46px;
    padding-inline: 22px;
    background: var(--color-white);
    color: var(--color-ink, #1a1a1a);
    border: 1px solid var(--color-ink, #1a1a1a);
    font-family: var(--font-display);
    font-size: var(--fs-md, 15px);
    font-weight: var(--fw-medium);
    line-height: 1;
    letter-spacing: var(--ls-snug);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.project-header__projects:hover,
.project-header__projects:focus-visible {
    background: var(--color-ink, #1a1a1a);
    border-color: var(--color-ink, #1a1a1a);
    color: var(--color-white);
}

/* Standalone icon button — same height/border as the text button, square. */
.project-header__projects-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    background: var(--color-white);
    color: var(--color-ink, #1a1a1a);
    border: 1px solid var(--color-ink, #1a1a1a);
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.project-header__projects-icon-btn:hover,
.project-header__projects-icon-btn:focus-visible {
    background: var(--color-ink, #1a1a1a);
    border-color: var(--color-ink, #1a1a1a);
    color: var(--color-white);
}

.project-header__projects-icon-btn svg {
    width: 25px;
    height: 25px;
    display: block;
	stroke-width: 2px;
}

/* Caret next to the label, rotates open when dropdown is expanded. */
.project-header__projects-caret {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 4px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: translateY(-2px) rotate(45deg);
    transition: transform var(--transition-fast);
}

.project-header__projects[aria-expanded="true"] .project-header__projects-caret {
    transform: translateY(2px) rotate(-135deg);
}

/* ---- Click-open dropdown (sage panel, slide-down animation) ------------ */
.project-header__dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 280px;
    background: var(--color-brand);
    color: var(--color-white);
    padding: var(--space-3) var(--space-4) var(--space-4);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.12);
    transform-origin: top right;
    transform: translateY(-8px) scaleY(0.95);
    opacity: 0;
    pointer-events: none;
    transition:
        opacity 220ms ease,
        transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: var(--z-overlay, 20);
}

/* When toggled open, drop the `hidden` attribute via JS and apply this state. */
.project-header__dropdown[data-open="true"] {
    opacity: 1;
    transform: translateY(0) scaleY(1);
    pointer-events: auto;
}

.project-header__dropdown ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.project-header__dropdown a {
    display: block;
    padding: var(--space-2) 0;
    color: var(--color-white);
    font-family: var(--font-display);
    font-size: var(--fs-md, 15px);
    text-decoration: none;
    transition: color var(--transition-fast);
    white-space: nowrap;
}

.project-header__dropdown a:hover,
.project-header__dropdown a:focus-visible {
    color: var(--color-brand-soft, #d6e1d3);
}

.project-header__dropdown-empty {
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
    font-size: var(--fs-sm, 13px);
}

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 900px) {
    .project-header__nav {
        display: none; /* hide jumplinks on small screens — they'd overflow */
    }
    /* On mobile keep only the icon trigger; the text button would crowd the row. */
    .project-header__projects { display: none; }
}
