/* ============================================================
   MATI BHADRA SAGARA — LAYOUT
   css/layout.css

   Navigation + Footer — all breakpoints.
   Mobile-first: base = mobile (hamburger drawer).
   Desktop nav appears at min-width: 1025px.
   Consumes tokens from design-system.css only.
   ============================================================ */


/* ─────────────────────────────────────────────────────────────
   SKIP LINK (reused from design-system.css utility)
   Ensure it renders above nav (z-index: 200)
   ───────────────────────────────────────────────────────────── */

.skip-link {
  position: fixed;
  top: var(--space-3);
  left: var(--space-3);
  z-index: 200;
}


/* ─────────────────────────────────────────────────────────────
   TOP NAV — BASE (mobile + tablet, 0–1024px)
   ───────────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  height: var(--nav-height);          /* 4rem / 64px */
  background-color: var(--color-bg-primary);
  border-bottom: 1px solid var(--color-border-subtle);
  /* Subtle elevation to separate from page content */
  box-shadow: 0 1px 0 var(--color-border-subtle);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding-inline: var(--gutter);
  max-width: var(--container-nav);    /* 1536px */
  margin-inline: auto;
}

/* ── Logo ─────────────────────────────────────────────────── */

.nav__logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
  /* Tap target ≥ 44px */
  min-height: 44px;
}

.nav__logo-img {
  height: 2.75rem;     /* 44px — large enough for embedded text to be legible */
  width: auto;
}

@media (min-width: 769px) {
  .nav__logo-img {
    height: 3.25rem;   /* 52px — more breathing room in taller tablet nav */
  }
}

.nav__logo-name {
  font-family: var(--font-display);
  font-size: var(--type-size-nav);    /* 18px */
  font-weight: 400;
  color: var(--color-brand-rust);
  letter-spacing: 0;
  line-height: 1;
  /* Hide wordmark on small phones to save space */
  display: none;
}

@media (min-width: 480px) {
  .nav__logo-name {
    display: block;
  }
}

/* ── Desktop links (hidden on mobile/tablet) ──────────────── */

.nav__links {
  display: none;  /* shown at 1025px */
  list-style: none;
  gap: var(--space-7);          /* 40px between links */
  align-items: center;
  margin: 0;
  padding: 0;
}

.nav__link {
  font-family: var(--font-display);
  font-size: var(--type-size-nav);    /* 18px */
  font-weight: 400;
  color: var(--color-text-muted);
  letter-spacing: var(--type-ls-nav); /* -0.45px */
  text-decoration: none;
  padding-block: var(--space-2);
  position: relative;
  transition: color var(--transition-nav);
  white-space: nowrap;
}

.nav__link::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  right: 100%;         /* starts collapsed — expands to 100% when active */
  height: 2px;
  background-color: var(--color-brand-crimson);
  transition: right var(--transition-active);
}

.nav__link:hover {
  color: var(--color-brand-crimson);
}

.nav__link[aria-current="page"] {
  color: var(--color-brand-crimson);
}

.nav__link[aria-current="page"]::after {
  right: 0;             /* full-width underline on active */
}

/* ── VISIT button (desktop) ───────────────────────────────── */

.nav__cta {
  /* Hidden in hamburger drawer context; btn--primary styles apply */
  display: none;
}

/* ── Hamburger button ─────────────────────────────────────── */

.nav__hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;         /* minimum 44×44 tap target */
  height: 44px;
  padding: 0;
  background: none;
  border: none;
  cursor: pointer;
  flex-shrink: 0;
  /* Align bars visually */
  align-items: center;
}

.nav__hamburger-bar {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-brand-rust);
  border-radius: 1px;
  transition: transform var(--transition-drawer),
              opacity var(--transition-drawer),
              width var(--transition-drawer);
  transform-origin: center;
}

/* Animate hamburger → ✕ when open */
.nav__hamburger[aria-expanded="true"] .nav__hamburger-bar:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.nav__hamburger[aria-expanded="true"] .nav__hamburger-bar:nth-child(2) {
  opacity: 0;
  width: 0;
}

.nav__hamburger[aria-expanded="true"] .nav__hamburger-bar:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}


/* ─────────────────────────────────────────────────────────────
   DRAWER OVERLAY — dark background behind open drawer
   ───────────────────────────────────────────────────────────── */

.nav__overlay {
  position: fixed;
  inset: 0;
  z-index: calc(var(--z-nav) + 1);   /* above nav bar */
  background-color: rgba(35, 26, 8, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
}

.nav__overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}


/* ─────────────────────────────────────────────────────────────
   DRAWER — slide-in panel from right
   ───────────────────────────────────────────────────────────── */

.nav__drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: calc(var(--z-nav) + 2);   /* above overlay */
  width: min(320px, 85vw);           /* never wider than 85% viewport */
  background-color: var(--color-bg-primary);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);       /* hidden: off-screen right */
  transition: transform 250ms cubic-bezier(0.4, 0, 0.2, 1);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.nav__drawer[aria-hidden="false"],
.nav__drawer.is-open {
  transform: translateX(0);
}

/* ── Drawer header (logo + close) ─────────────────────────── */

.nav__drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5);
  height: var(--nav-height);
  border-bottom: 1px solid var(--color-border-subtle);
  flex-shrink: 0;
}

.nav__drawer-logo {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
}

.nav__drawer-logo-img {
  height: 1.75rem;
  width: auto;
}

.nav__drawer-logo-name {
  font-family: var(--font-display);
  font-size: 1rem;          /* 16px inside drawer */
  font-weight: 400;
  color: var(--color-brand-rust);
}

.nav__drawer-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-brand-rust);
  flex-shrink: 0;
}

.nav__drawer-close svg {
  width: 20px;
  height: 20px;
}

.nav__drawer-close:hover {
  color: var(--color-cta);
}

/* ── Drawer nav links ─────────────────────────────────────── */

.nav__drawer-links {
  list-style: none;
  flex: 1;
  padding: var(--space-5) 0;
}

.nav__drawer-item {
  border-bottom: 1px solid var(--color-border-subtle);
}

.nav__drawer-link {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;            /* 48px touch target per WCAG 2.1 AA */
  padding-inline: var(--space-5);
  font-family: var(--font-display);
  font-size: 1.5rem;           /* 24px drawer links per spec */
  font-weight: 400;
  color: var(--color-text-primary);
  text-decoration: none;
  transition: color var(--transition-nav),
              background-color var(--transition-nav);
}

.nav__drawer-link:hover {
  color: var(--color-brand-crimson);
  background-color: rgba(147, 61, 4, 0.04);
}

.nav__drawer-link[aria-current="page"] {
  color: var(--color-brand-crimson);
}

/* ── Drawer CTA ───────────────────────────────────────────── */

.nav__drawer-cta {
  padding: var(--space-5);
  flex-shrink: 0;
}

.nav__drawer-cta .btn--primary {
  width: 100%;
  justify-content: center;
  text-align: center;
}


/* ─────────────────────────────────────────────────────────────
   BODY SCROLL LOCK (applied via JS when drawer is open)
   ───────────────────────────────────────────────────────────── */

body.nav-open {
  overflow: hidden;
}


/* ─────────────────────────────────────────────────────────────
   NAV — TABLET (769px+)
   Header height increases slightly; gutter widens.
   Hamburger stays; desktop links still hidden.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 769px) {
  .nav {
    height: var(--nav-height);        /* 5.25rem at 769px — token already updated by design-system.css */
  }
}


/* ─────────────────────────────────────────────────────────────
   NAV — DESKTOP (1025px+)
   Switch to inline layout; hide hamburger and drawer.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 1025px) {
  .nav__links {
    display: flex;
  }

  .nav__cta {
    display: flex;
  }

  .nav__hamburger {
    display: none;
  }

  /* Hide the drawer-related elements entirely */
  .nav__overlay,
  .nav__drawer {
    display: none;
  }

  .nav__logo-name {
    display: block;
  }

  /* Desktop inner has three zones: logo | links | cta */
  .nav__inner {
    gap: var(--space-8);
  }

  /* Links sit between logo and CTA */
  .nav__links {
    flex: 1;
    justify-content: flex-end;
    margin-inline-end: var(--space-7);
  }
}


/* ─────────────────────────────────────────────────────────────
   PAGE BODY OFFSET
   Compensate for fixed nav so content is not hidden beneath it.
   ───────────────────────────────────────────────────────────── */

.page-body {
  padding-top: var(--nav-height);
}

/* Hero sections that want to sit flush under the nav
   (e.g. full-bleed photo heroes) use .page-body--hero instead */
.page-body--hero {
  padding-top: 0;
}


/* ─────────────────────────────────────────────────────────────
   FOOTER
   ───────────────────────────────────────────────────────────── */

.footer {
  background-color: var(--color-bg-secondary);
  padding-block: var(--space-9);          /* 64px top/bottom */
  padding-inline: var(--gutter);
}

.footer__inner {
  max-width: var(--container-max);        /* 1280px */
  margin-inline: auto;

  /* Mobile: single column */
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-9);                    /* 64px between columns on mobile too */
}

/* ── Footer columns ───────────────────────────────────────── */

.footer__col {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

/* ── Col 1: Brand ─────────────────────────────────────────── */

.footer__brand {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  width: fit-content;
}

.footer__logo-img {
  height: 2rem;
  width: auto;
}

/* Footer uses only the wordmark PNG — no logomark alongside it */
.footer__logo-wordmark {
  height: 1.75rem;  /* 28px — readable but compact for footer */
  width: auto;
}

.footer__tagline {
  font-family: var(--font-sans);
  font-size: var(--type-size-body-s);     /* 14px */
  color: var(--color-text-muted);
  line-height: 1.5;
  max-width: 28ch;
}

.footer__copyright {
  font-family: var(--font-sans);
  font-size: var(--type-size-fine);       /* 12px */
  letter-spacing: var(--type-ls-fine);
  color: var(--color-text-muted);
  margin-top: auto;                       /* push to bottom of column on desktop */
}

/* ── Col 2: Navigation ────────────────────────────────────── */

.footer__nav-heading,
.footer__location-heading {
  font-family: var(--font-sans);
  font-size: var(--type-size-eyebrow-m);  /* 12px */
  font-weight: 700;
  letter-spacing: var(--type-ls-eyebrow-m); /* 2.4px */
  text-transform: uppercase;
  color: var(--color-brand-rust);
}

.footer__nav-list {
  list-style: none;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.footer__link {
  font-family: var(--font-sans);
  font-size: var(--type-size-footer);     /* 14px */
  letter-spacing: var(--type-ls-footer);  /* 1.4px */
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.footer__link:hover {
  color: var(--color-brand-rust);
}

/* ── Col 3: Location ──────────────────────────────────────── */

.footer__address {
  font-family: var(--font-display);
  font-size: 1rem;                        /* 16px per spec */
  font-style: normal;
  color: var(--color-text-muted);
  line-height: 1.625;
}

.footer__contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__contact-item {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-sans);
  font-size: var(--type-size-footer);
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color var(--transition-fast);
  min-height: 44px;                       /* tap target */
}

.footer__contact-item:hover {
  color: var(--color-brand-rust);
}

.footer__contact-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ── Footer divider (tablet+ only) ───────────────────────── */

.footer__divider {
  display: none;
  grid-column: 1 / -1;
  border: none;
  border-top: 1px solid var(--color-border-subtle);
}


/* ─────────────────────────────────────────────────────────────
   FOOTER — TABLET (769px+)
   Switch to 3-column layout.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 769px) {
  .footer__inner {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-8);                  /* 48px column gap */
    align-items: start;
  }

  .footer__divider {
    display: block;
  }

  .footer__copyright {
    margin-top: var(--space-5);
  }
}


/* ─────────────────────────────────────────────────────────────
   FOOTER — DESKTOP (1025px+)
   Generous gutter; copyright pinned to bottom of col 1.
   ───────────────────────────────────────────────────────────── */

@media (min-width: 1025px) {
  .footer {
    padding-block: var(--space-9);
    padding-inline: var(--gutter);
  }

  .footer__inner {
    gap: var(--space-9);                  /* 64px column gap at desktop */
    align-items: start;
  }

  .footer__col:first-child {
    /* Col 1 height matches tallest sibling so copyright floats to bottom */
    height: 100%;
  }
}
