/* ═══════════════════════════════════════════════════════════════
   LETLOU ENERGY — HEADER
   CSS-only responsive navigation — no JS required for toggle.
   Mobile menu uses the checkbox hack: a visually hidden
   <input type="checkbox"> toggled by a <label> (the hamburger).
   The navlinks panel is shown/hidden via :checked + sibling CSS.
   All colour and transition values from LetlouGlobal.css.
   ═══════════════════════════════════════════════════════════════ */

header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 clamp(1rem, 4vw, 2.5rem);
  height: 68px;
  background: color-mix(in srgb, white 97%, transparent);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 2px solid var(--color-amber);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-normal);
}

header.scrolled {
  box-shadow: var(--shadow-md);
}


/* ── Logo ── */
header .logo {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

header .logo img {
  height: 46px;
  width: auto;
  display: block;
}


/* ── Nav shell ── */
header nav.navbar {
  display: flex;
  align-items: center;
  gap: 0;
}

header .navlinks {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

header .nav-item {
  position: relative;
  padding: 0.45rem 0.85rem;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--color-navy);
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}

header .nav-item::after {
  content: "";
  position: absolute;
  bottom: 2px;
  left: 0.85rem;
  right: 0.85rem;
  height: 2px;
  background: var(--color-amber);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
  border-radius: 2px;
}

header .nav-item:hover {
  color: var(--color-amber);
  background: var(--color-amber-tint);
}

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

header .nav-item.active        { color: var(--color-amber); }
header .nav-item.active::after { transform: scaleX(1); }

/* Active page — set via aria-current="page" in HTML per page */
header .nav-item[aria-current="page"] {
  color: var(--color-amber);
}
header .nav-item[aria-current="page"]::after {
  transform: scaleX(1);
}

/* Focus-visible styles (keyboard navigation) */
header .nav-item:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}


/* ── CTA button ── */
header .nav-item.nav-cta {
  background: var(--color-amber);
  color: var(--color-navy);
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-sm);
  margin-left: 0.5rem;
  font-weight: 700;
}

header .nav-item.nav-cta::after { display: none; }

header .nav-item.nav-cta:hover {
  background: var(--color-amber-hover);
  color: var(--color-navy);
}

header .nav-item.nav-cta:focus-visible {
  outline: 2px solid var(--color-navy);
  outline-offset: 2px;
}


/* ═══════════════════════════════════════════════════════════════
   CSS-ONLY HAMBURGER — checkbox + label pattern
   The <input type="checkbox" class="nav-toggle"> is hidden
   visually but remains in the accessibility tree so keyboard
   users can toggle it. The <label class="hamburger"> acts as
   the visible button. :checked on the input opens .navlinks.
   ═══════════════════════════════════════════════════════════════ */

/* Hide the checkbox itself — visually and from pointer events,
   but keep it accessible (do NOT use display:none or visibility:hidden
   which would remove it from keyboard focus flow on some browsers). */
header .nav-toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

/* The label is the visible hamburger button */
header .hamburger {
  display: none;            /* hidden on desktop */
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  padding: 0;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
  color: var(--color-navy);
  border-radius: var(--radius-sm);
  transition: background var(--transition);
  user-select: none;
  /* label elements need explicit flex to honour width/height */
  flex-shrink: 0;
}

header .hamburger:hover {
  background: var(--color-amber-tint);
}

/* Focus ring — label gets :focus-within when its checkbox is focused */
header .nav-toggle:focus-visible ~ .hamburger,
header .hamburger:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}

/* ☰ / ✕ icon swap via content */
header .hamburger .icon-open  { display: inline; }
header .hamburger .icon-close { display: none; }

header .nav-toggle:checked ~ .hamburger .icon-open  { display: none; }
header .nav-toggle:checked ~ .hamburger .icon-close { display: inline; }


/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — mobile nav
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 900px) {
  header .hamburger { display: flex; }

  header .navlinks {
    /* Hidden by default — revealed when checkbox is :checked */
    display: none;
    position: fixed;
    top: var(--header-height, 68px);    /* token-driven: no hardcoded px */
    left: 0;
    right: 0;
    max-height: calc(100dvh - var(--header-height, 68px));
    overflow-y: auto;
    flex-direction: column;
    align-items: stretch;
    background: var(--color-white);
    border-bottom: 2px solid var(--color-amber);
    box-shadow: var(--shadow-lg);
    padding: 0.5rem 0 1.5rem;
    /* Prevent the open menu from being a stacking-context issue */
    z-index: 999;
  }

  /* Open state — checkbox checked reveals the menu */
  header .nav-toggle:checked ~ .navlinks,
  header .nav-toggle:checked ~ nav .navlinks {
    display: flex;
  }

  header .nav-item {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border-soft);
  }
}

/* Large screen: taller header */
@media (min-width: 1400px) {
  header {
    height: 76px;
    padding: 0 clamp(2rem, 5vw, 4rem);
  }

  header .logo img {
    height: 52px;
  }

  header .nav-item {
    font-size: 0.95rem;
    padding: 0.5rem 1rem;
  }

  header .nav-item.nav-cta {
    padding: 0.5rem 1.3rem;
  }
  /* Mobile nav top is now driven by var(--header-height) which updates
     to 76px at ≥1400px via LetlouGlobal.css :root override — no nested
     media query needed here. */
}

/* ═══════════════════════════════════════════════════════════════
   LETLOU ENERGY — GLOBAL SEARCH STYLES
   Append to LetlouHeader.css.
   Covers: nav search button + full search overlay UI.
   ═══════════════════════════════════════════════════════════════ */


/* ── Nav search button ──────────────────────────────────────── */
.nav-search-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  color: var(--color-navy);
  font-size: 0.88rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  flex-shrink: 0;
  margin-left: 0.25rem;
}

.nav-search-btn:hover {
  background: var(--color-amber-tint);
  color: var(--color-amber);
}

.nav-search-btn:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}

/* Search button is now a direct .navbar child, always visible on mobile.
   It sits between the search icon and hamburger — no order override needed. */
@media (max-width: 900px) {
  .nav-search-btn {
    margin-left: 0;
    margin-right: 0.25rem;
  }
}

.nav-search-btn i {
  pointer-events: none; /* This ensures the click always passes through to the <button> */
}
/* ── Search overlay shell ───────────────────────────────────── */
.gsearch-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none; /*Troubleshoot: Ai Studio recommends changing this to none because I could not interact with my website*/
  align-items: flex-start;
  justify-content: center;
  padding-top: clamp(4rem, 10vh, 8rem);
  padding-left: 1rem;
  padding-right: 1rem;
}

/* Ensure the backdrop covers properly */
.gsearch-backdrop {
  position: absolute;
  inset: 0;
  background: color-mix(in srgb, var(--color-navy-deep) 80%, transparent);
  backdrop-filter: blur(4px);
}

.gsearch-overlay.gsearch-overlay--open {
  display: flex !important; 
  opacity: 1;
}

.gsearch-panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--color-white);
  border-radius: var(--radius-md);
  box-shadow: 0 20px 60px color-mix(in srgb, var(--color-navy-deep) 25%, transparent);
  overflow: hidden;
  transform: translateY(-12px);
  opacity: 0;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.gsearch-overlay--open .gsearch-panel {
  transform: translateY(0);
  opacity: 1;
}


/* ── Input row ──────────────────────────────────────────────── */
.gsearch-input-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--color-border-soft);
}

.gsearch-icon {
  color: var(--color-text-hint);
  font-size: 0.9rem;
  flex-shrink: 0;
}

.gsearch-input {
  flex: 1;
  border: none;
  outline: none;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background: transparent;
}

.gsearch-input::placeholder { color: var(--color-text-hint); }

.gsearch-close {
  width: 30px;
  height: 30px;
  display: flex; 
  align-items: center;
  justify-content: center;
  border: none;
  background: var(--color-off-white);
  border-radius: var(--radius-sm);
  color: var(--color-text-hint);
  font-size: 0.78rem;
  cursor: pointer;
  flex-shrink: 0;
  transition: background var(--transition);
}

.gsearch-close:hover { background: var(--color-border-soft); }

.gsearch-close:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: 2px;
}


/* ── Results body ───────────────────────────────────────────── */
.gsearch-body {
  max-height: min(480px, 60vh);
  overflow-y: auto;
}

.gsearch-group-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-text-hint);
  background: var(--color-off-white);
  border-bottom: 1px solid var(--color-border-soft);
}

.gsearch-group-label i { color: var(--color-amber); font-size: 0.6rem; }


/* ── Individual result ──────────────────────────────────────── */
.gsearch-result {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  padding: 0.8rem 1rem;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  font-family: var(--font-body);
  border-bottom: 1px solid var(--color-border-soft);
  transition: background 0.12s;
}

.gsearch-result:last-child { border-bottom: none; }

.gsearch-result:hover,
.gsearch-result--active { background: var(--color-amber-tint); }

.gsearch-result:focus-visible {
  outline: 2px solid var(--color-amber);
  outline-offset: -2px;
}

.gsearch-result__icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.78rem;
  flex-shrink: 0;
}

.gsearch-result__icon--news    { background: color-mix(in srgb, var(--color-amber) 12%, transparent); color: var(--color-amber); }
.gsearch-result__icon--project { background: color-mix(in srgb, var(--color-teal) 10%, transparent);  color: var(--color-teal); }

.gsearch-result__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
}

.gsearch-result__title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--color-navy);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.gsearch-result__meta {
  font-size: 0.72rem;
  color: var(--color-text-hint);
}

.gsearch-result__arrow {
  font-size: 0.7rem;
  color: var(--color-text-hint);
  flex-shrink: 0;
  opacity: 0;
  transition: opacity 0.12s, transform 0.12s;
}

.gsearch-result:hover .gsearch-result__arrow,
.gsearch-result--active .gsearch-result__arrow {
  opacity: 1;
  transform: translateX(3px);
}

mark.gsearch-hit {
  background: color-mix(in srgb, var(--color-amber) 30%, transparent);
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
}


/* ── Empty + idle states ────────────────────────────────────── */
.gsearch-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 2.5rem 1rem;
  color: var(--color-text-hint);
  font-size: 0.88rem;
}

.gsearch-empty i { font-size: 1.8rem; opacity: 0.3; }
.gsearch-empty p { margin: 0; }

.gsearch-idle {
  padding: 1.5rem 1rem;
  text-align: center;
}

.gsearch-idle-hint {
  font-size: 0.72rem;
  color: var(--color-text-hint);
  margin: 0;
}

kbd {
  display: inline-block;
  padding: 1px 5px;
  font-size: 0.68rem;
  font-family: var(--font-body);
  background: var(--color-off-white);
  border: 1px solid var(--color-border);
  border-radius: 3px;
  color: var(--color-text-mid);
}


/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
  .gsearch-panel { border-radius: var(--radius-sm); }
  .gsearch-overlay { padding-top: 3rem; }
}

@media (prefers-reduced-motion: reduce) {
  .gsearch-panel,
  .gsearch-backdrop,
  .gsearch-result__arrow { transition: none !important; }
}




/* ═══════════════════════════════════════════════════════════════
   LEGAL DROPDOWN
   ═══════════════════════════════════════════════════════════════ */

.nav-dropdown {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.nav-dropdown-toggle {
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.nav-dropdown-chevron {
  font-size: 0.65rem;
  transition: transform 0.2s ease;
}

.nav-dropdown-toggle[aria-expanded="true"] .nav-dropdown-chevron {
  transform: rotate(180deg);
}

/* Desktop panel — drops below toggle */
.nav-dropdown-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 180px;
  background: var(--color-white);
  border: 1px solid var(--color-border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 1200;
  overflow: hidden;
}

.nav-dropdown-panel[hidden] { display: none; }

.nav-dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--color-navy);
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-bottom: 1px solid var(--color-border-soft);
  width: 100%;
  cursor: pointer;
}

.nav-dropdown-item:last-child { border-bottom: none; }

.nav-dropdown-item:hover,
.nav-dropdown-item:focus-visible {
  background: var(--color-amber-tint);
  color: var(--color-amber);
  outline: none;
}

.nav-dropdown-item i {
  color: var(--color-amber);
  font-size: 0.82rem;
  width: 14px;
  text-align: center;
  flex-shrink: 0;
}

/* Button variant — matches anchor styles exactly */
.nav-dropdown-item--btn {
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border-soft);
  font-family: var(--font-body);
  text-align: left;
}

/* ── Mobile — expand inline within hamburger menu ──
   display:contents dissolves the wrapper so toggle and panel
   both become direct flex children of .navlinks.
   The panel uses position:static and sits naturally in the
   flow — it renders ABOVE the CTA because it comes before it
   in the DOM. The CTA stays at the bottom naturally. */
@media (max-width: 900px) {
  .nav-dropdown {
    display: contents;
  }

  .nav-dropdown-toggle {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--color-border-soft);
    width: 100%;
    justify-content: space-between;
  }

  .nav-dropdown-panel {
    position: static;
    box-shadow: none;
    border: none;
    border-radius: 0;
    background: var(--color-off-white);
    /* Ensure it's not clipped by parent overflow */
    overflow: visible;
  }

  .nav-dropdown-panel[hidden] { display: none; }

  .nav-dropdown-item {
    padding: 0.85rem 2rem;
    font-size: 0.88rem;
    border-bottom: 1px solid var(--color-border-soft);
  }
}
