/* =========================================================
   Gulmarg Snowline — layout.css
   Container, header, footer, mobile nav.
   Breakpoints: 640px / 900px / 1200px (mobile-first).
   ========================================================= */

/* ---------- Container ---------- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-md);
}

@media (min-width: 640px) {
  .container {
    padding-inline: var(--space-lg);
  }
}

main {
  display: block;
  min-height: 40vh;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--color-bg);
  border-bottom: 1px solid transparent;
  transition: box-shadow var(--transition-base), border-color var(--transition-base);
}

.site-header.is-scrolled {
  /* Deliberately stronger than --shadow-sm: a white header pinned over white
     page content is otherwise indistinguishable from the content itself. */
  box-shadow: 0 2px 10px rgba(15, 37, 64, 0.14), 0 1px 3px rgba(15, 37, 64, 0.1);
  border-bottom-color: var(--color-border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  min-height: var(--header-height);
}

.logo-link {
  display: inline-flex;
  align-items: center;
  flex-shrink: 0;
}

.logo-img {
  height: 40px;
  width: auto;
}

/* Nav toggle (mobile hamburger) */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

.nav-toggle-bar {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--navy);
  border-radius: var(--radius-full);
  transition: transform var(--transition-fast), opacity var(--transition-fast);
}

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

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

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

/* Nav panel — mobile: full-width dropdown, closed by default */
.site-nav {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
}

.nav-list {
  display: flex;
  flex-direction: column;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
  max-height: 0;
  overflow: hidden;
  transition: max-height var(--transition-base);
}

.nav-list.is-open {
  max-height: 400px;
}

.nav-list li {
  border-top: 1px solid var(--color-border);
}

.nav-list a {
  display: block;
  padding: var(--space-sm) var(--space-md);
  font-weight: 600;
  color: var(--color-text);
}

.nav-list a:hover,
.nav-list a:focus-visible {
  background: var(--color-surface);
  color: var(--color-primary);
}

@media (min-width: 900px) {
  .nav-toggle {
    display: none;
  }

  .site-nav {
    position: static;
  }

  .nav-list {
    flex-direction: row;
    align-items: center;
    gap: var(--space-lg);
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    max-height: none;
    overflow: visible;
  }

  .nav-list li {
    border-top: none;
  }

  .nav-list a {
    padding: var(--space-2xs) 0;
    position: relative;
  }

  .nav-list a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 100%;
    bottom: -4px;
    height: 2px;
    background: var(--color-primary);
    transition: right var(--transition-fast);
  }

  .nav-list a:hover::after,
  .nav-list a:focus-visible::after {
    right: 0;
  }

  .nav-list a:hover,
  .nav-list a:focus-visible {
    background: transparent;
    color: var(--color-primary);
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy);
  color: var(--white);
  margin-top: var(--space-3xl);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  padding-block: var(--space-2xl);
}

@media (min-width: 640px) {
  .footer-inner {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .footer-inner {
    grid-template-columns: 2fr 1fr 1fr 1.4fr;
    gap: var(--space-lg);
  }
}

.footer-brand {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--white);
  margin-bottom: var(--space-2xs);
}

.footer-tagline {
  color: rgba(255, 255, 255, 0.75);
  max-width: 40ch;
}

.footer-heading {
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgba(255, 255, 255, 0.6);
  margin-bottom: var(--space-sm);
}

.footer-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
}

.footer-list a,
.footer-list span {
  color: rgba(255, 255, 255, 0.9);
}

.footer-list a:hover,
.footer-list a:focus-visible {
  color: var(--blue);
}

.footer-contact li {
  line-height: var(--leading-relaxed);
}

.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.1);
  transition: background var(--transition-fast);
}

.footer-social a:hover,
.footer-social a:focus-visible {
  background: var(--blue);
}

.footer-social svg {
  width: 18px;
  height: 18px;
  fill: var(--white);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-block: var(--space-md);
  /* Extra clearance so the fixed floating buttons never sit over the copyright line at small widths */
  padding-bottom: calc(var(--space-md) + 64px);
}

@media (min-width: 640px) {
  .footer-bottom {
    padding-bottom: var(--space-md);
  }
}

.footer-bottom .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3xs) var(--space-md);
}

.footer-bottom p {
  font-size: var(--text-xs);
  color: rgba(255, 255, 255, 0.6);
}

.footer-credit a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer-credit a:hover,
.footer-credit a:focus-visible {
  color: var(--blue);
}
