/* ==============================================
   NAV — PropComm Classic (Simplified Floating)
   Using 16px Spacing System
   ============================================== */

.site-header {
  position: fixed;
  top: var(--sp-6) !important;
  left: 0;
  right: 0;
  /* Floating pill on tablet + desktop (phone overrides to full-width). */
  max-width: 922px;
  width: 80vw;
  margin: 0 auto;
  z-index: 300;
  border-radius: 4px;
  background: white;
  transition: border-radius 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* When the menu is open, square off the bar's bottom corners so it connects
   flush with the panel and the separator line sits on a clean seam. */
.site-header:has(.nav-btn[aria-expanded="true"]) {
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

/* 74px = bar height. Every block's nav compensation (hero-block top:-74px,
   dark-nav margin-top:-74px) assumes exactly this offset at every viewport. */
.site-wrapper {
  padding-top: 74px;
}

.site-header__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 74px;
  padding: 0 var(--sp-6);
  gap: var(--sp-4);
}

/* ── Logo / Branding ── */
.site-branding {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.site-branding > a {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  text-decoration: none;
}

.site-title {
  font-size: 1rem;
  font-weight: 400;
  font-family: var(--font-primary);
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--color-primary-green);
  white-space: nowrap;
}

.site-description {
  display: none;
}

.custom-logo {
  height: 40px;
  width: auto;
  flex-shrink: 0;
  filter: invert(1);
}

/* ── Menu button ── */
.nav-btn {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-direction: row;
  width: auto;
  height: 44px;
  padding: 0;
  gap: var(--sp-2);
  border: none;
  background: transparent;
  cursor: pointer;
  color: var(--color-primary-green);
  flex-shrink: 0;
  font-family: var(--font-secondary);
}

/* Keyboard focus — visible ring without affecting mouse users. */
.nav-btn:focus-visible,
.nav-col__item a:focus-visible,
.nav-footer__line:focus-visible,
a.nav-footer__mark:focus-visible {
  outline: 2px solid var(--color-primary-green);
  outline-offset: 3px;
  border-radius: 2px;
}

.icon-hamburger {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 22px;
}

.icon-hamburger__line {
  display: block;
  height: 1.5px;
  width: 100%;
  background: currentColor;
  border-radius: 1px;
  transform-origin: center;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

/* Hamburger → X morph — lines are 1.5px tall with a 6px gap, so each moves
   (6 + 1.5) / 2 = 3.75px to cross exactly at center. */
.nav-btn[aria-expanded="true"] .icon-hamburger__line:first-child {
  transform: translateY(3.75px) rotate(45deg);
}

.nav-btn[aria-expanded="true"] .icon-hamburger__line:last-child {
  transform: translateY(-3.75px) rotate(-45deg);
}

/* ── Menu panel (expanding dropdown) ── */
.nav-panel {
  /* Anchored flush to the bar's bottom edge — it always sits directly below
     the bar regardless of the navbar's height/position. */
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  width: auto;
  margin: 0;
  background: white;
  border-radius: 0px 0px 4px 4px;
  padding: 0;
  opacity: 0;
  pointer-events: none;
  /* Height is animated by GSAP (0 ↔ auto); only opacity transitions in CSS.
     max-height caps it on short viewports (landscape phones/tablets) so the
     panel scrolls internally instead of running off-screen. */
  transition: opacity 0.3s ease;
  height: 0;
  max-height: calc(100vh - 130px);
  max-height: calc(100dvh - 130px);
  overflow: hidden;
  overflow-y: auto;
}

.nav-panel:not([hidden]) {
  opacity: 1;
  pointer-events: auto;
}

/* Separator line between the navbar and the panel. Driven by the .is-line-in
   class (not the [hidden] state) so JS can slide it out *before* the panel
   collapses on close. Draws in from the left, retracts to the right. */
.nav-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--color-primary-green);
  opacity: 0.3;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-panel.is-line-in::before {
  transform: scaleX(1);
  transform-origin: left center;
  transition-delay: 0.08s;
}

@media (prefers-reduced-motion: reduce) {
  .nav-panel::before { transition: none; }
}

.nav-panel[hidden] {
  display: block !important;
}


/* ── Menu list ── */
.panel-list {
  list-style: none;
  margin: 0;
  padding: var(--sp-8);
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
  font-family: var(--font-secondary);
}

/* ── Menu columns ──
   A row of columns. Each column = one heading (non-clickable title) with its
   links stacked underneath. align-items:start keeps every heading on the same
   top line regardless of how many links each column holds. Columns wrap to new
   rows on narrow screens. Add links/headings freely — nothing is hardcoded. */
.panel-list--nav {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  gap: var(--sp-10) var(--sp-8);
  padding: var(--sp-8);
  font-family: var(--font-secondary);
}

.nav-col {
  display: flex;
  flex-direction: column;
  gap: var(--sp-5);
  flex: 1 1 200px;
  min-width: 160px;
}

.nav-col__label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-green-40, #5c7a52);
  font-family: var(--font-primary, 'ConcretteXL', Georgia, serif);
  padding-bottom: var(--sp-2);
}

/* Short accent rule under each heading */
.nav-col__label::after {
  content: '';
  display: block;
  width: var(--sp-7, 32px);
  height: 1px;
  margin-top: var(--sp-4);
  background: var(--color-green-20);
}

.nav-col__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.nav-col__item {
  margin: 0;
}

.nav-col__item a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  padding: var(--sp-3) 0;
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.01em;
  color: var(--color-primary-green);
  text-decoration: none;
  font-family: var(--font-secondary);
  transition: color 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Underline that draws in from the left on hover */
.nav-col__item a::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: var(--sp-2);
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-col__item a:hover {
  transform: translateX(6px);
}

.nav-col__item a:hover::after {
  transform: scaleX(1);
}

.nav-col__item.is-current a::after {
  transform: scaleX(1);
  transform-origin: left center;
}

/* ── Staggered reveal when the panel opens ── */
.nav-col__label,
.nav-col__item {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-panel:not([hidden]) .nav-col__label,
.nav-panel:not([hidden]) .nav-col__item {
  opacity: 1;
  transform: translateY(0);
}

/* cascade: headings first, then each link in turn */
.nav-panel:not([hidden]) .nav-col__label        { transition-delay: 0.06s; }
.nav-panel:not([hidden]) .nav-col__item:nth-child(1) { transition-delay: 0.14s; }
.nav-panel:not([hidden]) .nav-col__item:nth-child(2) { transition-delay: 0.20s; }
.nav-panel:not([hidden]) .nav-col__item:nth-child(3) { transition-delay: 0.26s; }
.nav-panel:not([hidden]) .nav-col__item:nth-child(4) { transition-delay: 0.32s; }
.nav-panel:not([hidden]) .nav-col__item:nth-child(5) { transition-delay: 0.38s; }
.nav-panel:not([hidden]) .nav-col__item:nth-child(6) { transition-delay: 0.44s; }

@media (prefers-reduced-motion: reduce) {
  .nav-col__label,
  .nav-col__item { opacity: 1; transform: none; transition: none; }
  .nav-col__item a { transition: color 0.2s ease; }
  .nav-col__item a:hover { transform: none; }
}

/* ── Button label ── */
.nav-btn__label {
  display: block;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  line-height: 1;
}

/* ── Desktop adjustments ── */
@media (min-width: 768px) {
  .nav-btn {
    height: 38px;
  }

  .icon-hamburger {
    gap: 5px;
    width: 18px;
  }

  /* Smaller icon: gap 5px + 1.5px line → cross offset (5 + 1.5) / 2 = 3.25px. */
  .nav-btn[aria-expanded="true"] .icon-hamburger__line:first-child {
    transform: translateY(3.25px) rotate(45deg);
  }

  .nav-btn[aria-expanded="true"] .icon-hamburger__line:last-child {
    transform: translateY(-3.25px) rotate(-45deg);
  }
}

/* ── Nav footer / contact info ── */
.nav-footer {
  margin: var(--sp-4) var(--sp-8) var(--sp-8);
  padding: var(--sp-8);
  background: #DCE6D3;
  border-radius: 10px;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-10);
  font-family: var(--font-secondary);
}

/* Contact: stacked column of icon + value rows */
.nav-footer__contact {
  display: flex;
  flex-direction: column;
  gap: var(--sp-4);
}

.nav-footer__line {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  color: var(--color-primary-green);
}

.nav-footer__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-green-40, #5c7a52);
  transition: color 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.nav-footer__icon svg { width: 100%; height: 100%; display: block; }

.nav-footer__value {
  position: relative;
  width: fit-content;
  font-family: var(--font-secondary);
  font-size: 1.125rem;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--color-primary-green);
}

/* Underline-draw on the linked rows (phone / email) */
a.nav-footer__line .nav-footer__value::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

a.nav-footer__line:hover .nav-footer__value::after { transform: scaleX(1); }

/* Brand / social marks — bigger, aligned right */
.nav-footer__marks {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  flex-shrink: 0;
}

.nav-footer__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
}

.nav-footer__mark img {
  width: 100%;
  height: 100%;
  display: block;
}

/* Links: subtle high-end hover (rotate + brighten) */
a.nav-footer__mark {
  opacity: 0.85;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

a.nav-footer__mark:hover {
  transform: rotate(-20deg);
}

/* Logomark: not a link, always at half opacity */
.nav-footer__mark--logo {
  opacity: 0.4;
  pointer-events: none;
}

/* ── Skip link ── */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--sp-4);
  background: var(--color-primary-green);
  color: #fff;
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  z-index: 9999;
  font-family: var(--font-secondary);
}

.skip-link:focus {
  top: var(--sp-3);
}

/* ── Tablet + phone: stack the contact container into a centered column ── */
@media (max-width: 900px) {
  .nav-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--sp-6);
  }

  .nav-footer__contact {
    align-items: center;
  }

  /* Icon on one row, value on the next — centered. */
  .nav-footer__line {
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
  }

  .nav-footer__marks {
    justify-content: center;
  }
}

/* ── Phone: full-width bar attached to the top, no radius, smaller logo ── */
@media (max-width: 600px) {
  .site-header {
    top: 0 !important;
    left: 0;
    right: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
  }

  /* Already flush at the top — keep every corner square, even when open. */
  .site-header:has(.nav-btn[aria-expanded="true"]) {
    border-radius: 0;
  }

  .nav-panel {
    /* Full-screen white sheet pinned below the bar — covers the page so nothing
       shows or scrolls behind it. Driven by opacity/visibility (see JS); the
       GSAP height tween is neutralised with height:auto so it can't fight the
       fixed top/bottom sizing. Scrolls internally if the menu is taller. */
    position: fixed;
    top: 74px;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    border-radius: 0;
    height: auto !important;
    max-height: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    /* Keep the menu bottom clear of the iOS home indicator. */
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }

  .nav-panel:not([hidden]) {
    visibility: visible;
  }

  /* Pin the separator line at the bar's bottom edge so it doesn't scroll away
     with the menu content (fixed keeps the full-width left/right stretch). */
  .nav-panel::before {
    position: fixed;
    top: 74px;
    z-index: 5;
  }

  .custom-logo {
    height: 26px;
  }

  /* While the menu is open, freeze the page so touch scrolls the panel. */
  body.nav-open {
    overflow: hidden;
  }

  /* Backdrop behind the menu: a viewport-filling white layer just under the
     nav's stacking level (header is z-index 300). Covers the page so nothing
     bleeds through if the fixed panel rubber-bands past its edge on overscroll. */
  body.nav-open::before {
    content: '';
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 299;
    pointer-events: none;
  }

  /* ── Single centered column on phone — no squeezed side-by-side wrap ── */
  .panel-list--nav {
    flex-direction: column;
    align-items: stretch;
    padding: var(--sp-6) var(--sp-5) var(--sp-5);
    gap: var(--sp-6);
    justify-content: flex-start;
  }

  .nav-col {
    flex: 0 0 auto;
    min-width: 0;
    width: 100%;
  }

  .nav-col {
    gap: var(--sp-3);
    align-items: center;
    text-align: center;
  }

  .nav-col__list {
    align-items: center;
  }

  .nav-col__label {
    padding-bottom: 0;
  }

  .nav-col__label::after {
    margin-top: var(--sp-3);
    margin-inline: auto;
  }

  .nav-col__item a {
    padding: var(--sp-2) 0;
    font-size: 1rem;
  }

  /* Stack the green container: contact block above, marks row below. Top margin
     auto pushes it to the bottom of the full-height sheet. */
  .nav-footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
    margin: auto var(--sp-5) var(--sp-5);
    /* Extra breathing room above and below the contact content. */
    padding: var(--sp-8) var(--sp-5);
    gap: var(--sp-5);
  }

  .nav-footer__contact {
    align-items: center;
    gap: var(--sp-4);
  }

  /* Icon on one row, value on the next — centered. */
  .nav-footer__line {
    flex-direction: column;
    align-items: center;
    gap: var(--sp-1);
  }

  /* All three marks stay on a single, centered row, with breathing room above. */
  .nav-footer__marks {
    justify-content: center;
    gap: var(--sp-4);
    flex-wrap: nowrap;
    padding-top: var(--sp-8);
  }

  .nav-footer__mark {
    width: 46px;
    height: 46px;
  }
}
