/* ============================================================
   Purna Foundation — layout
   Site header, mobile drawer, footer.
   ============================================================ */

/* ---- Header ---------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: box-shadow 0.3s var(--ease), border-color 0.3s var(--ease);
}
.site-header.is-scrolled {
  box-shadow: 0 2px 14px rgba(16, 24, 40, 0.09);
  border-bottom-color: var(--line);
}

.header__inner {
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  min-height: var(--header-h);
}

/* Brand */
.brand {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
  text-decoration: none;
  margin-inline-end: auto;
  flex: none;
}
.brand__mark {
  width: 46px; height: 46px;
  flex: none;
  border-radius: 50%;
  overflow: hidden;
  background: var(--navy);
  display: grid;
  place-items: center;
}
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
/* Logo file not supplied yet — fall back to a monogram so the
   header never renders broken. */
.brand__mark.is-missing img { display: none; }
.brand__mark.is-missing::after {
  content: 'PF';
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: #fff;
  letter-spacing: 0.02em;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.15; }
.brand__name {
  font-family: var(--font-display);
  font-size: 1.02rem;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: -0.005em;
}
.brand__tag {
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--green);
}
[data-lang='hi'] .brand__name { font-family: var(--font-deva); font-weight: 800; text-transform: none; font-size: 0.98rem; }

/* Primary navigation */
.nav__list { display: flex; align-items: center; gap: var(--sp-1); }
.nav__link {
  display: block;
  padding: 0.55rem 0.85rem;
  border-radius: var(--r-pill);
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--navy);
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.2s var(--ease), color 0.2s var(--ease);
}
.nav__link:hover { background: var(--navy-soft); color: var(--navy); }
.nav__link.is-active { color: var(--saffron-dark); }
.nav__link.is-active::after {
  content: '';
  display: block;
  height: 2px;
  width: 18px;
  margin: 3px auto 0;
  border-radius: 2px;
  background: var(--saffron);
}

.header__actions { display: flex; align-items: center; gap: var(--sp-3); flex: none; }
.header__donate { display: none; }

.nav-toggle {
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: var(--r-md);
  color: var(--navy);
  background: var(--navy-soft);
}
.nav-toggle .nav-toggle__close { display: none; }
body.nav-open .nav-toggle .nav-toggle__open { display: none; }
body.nav-open .nav-toggle .nav-toggle__close { display: block; }

/* Mobile drawer (below 960px) */
@media (max-width: 959px) {
  .nav {
    position: fixed;
    inset: var(--header-h) 0 auto 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--sh-lg);
    padding: var(--sp-4) var(--gutter) var(--sp-6);
    transform: translateY(-12px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0.28s;
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .nav__list { flex-direction: column; align-items: stretch; gap: 2px; }
  .nav__link { padding: 0.85rem var(--sp-4); font-size: var(--fs-md); border-radius: var(--r-md); }
  .nav__link.is-active::after { margin-inline: 0; }
  .nav__cta { margin-top: var(--sp-4); }
  .nav__cta .btn { width: 100%; }

  body.nav-open { overflow: hidden; }

  .nav-scrim {
    position: fixed;
    inset: 0;
    background: rgba(14, 27, 54, 0.45);
    z-index: 99;
    animation: fade-in 0.25s var(--ease);
  }
}

@media (min-width: 960px) {
  .nav-toggle { display: none; }
  .nav-scrim { display: none !important; }
  .nav__cta { display: none; }
  .header__donate { display: inline-flex; }
}

/* The wordmark plus the language toggle plus the menu button do not
   fit across a 390px viewport at full size — scale the brand down so
   the header never forces a horizontal scrollbar. */
@media (max-width: 520px) {
  .header__inner { gap: var(--sp-3); }
  .brand { gap: var(--sp-2); }
  .brand__mark { width: 38px; height: 38px; }
  .brand__mark.is-missing::after { font-size: 0.85rem; }
  .brand__name { font-size: 0.82rem; }
  [data-lang='hi'] .brand__name { font-size: 0.8rem; }
  .brand__tag { font-size: 0.52rem; letter-spacing: 0.1em; }
  .header__actions { gap: var(--sp-2); }
  .lang-toggle button { padding: 0.3rem 0.5rem; }
  .nav-toggle { width: 38px; height: 38px; }
}

@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---- Footer ---------------------------------------------- */
.site-footer {
  background: var(--navy-deep);
  color: rgba(255, 255, 255, 0.75);
  padding-top: var(--sp-8);
  position: relative;
  overflow: hidden;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--saffron) 0%, var(--saffron) 33%, #fff 33%, #fff 66%, var(--green) 66%);
  opacity: 0.9;
}

.footer__grid {
  display: grid;
  gap: var(--sp-6);
  grid-template-columns: 1fr;
}
@media (min-width: 640px) { .footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .footer__grid { grid-template-columns: 1.6fr 1fr 1fr 1.4fr; } }

.footer__brand { display: flex; align-items: center; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.footer__brand .brand__name { color: #fff; }
.footer__brand .brand__mark { background: rgba(255, 255, 255, 0.1); }
.footer__about { font-size: var(--fs-sm); line-height: 1.75; max-width: 34ch; }

.footer__heading {
  color: #fff;
  font-size: var(--fs-xs);
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: var(--sp-4);
}
.footer__heading::after {
  content: '';
  display: block;
  width: 26px; height: 2px;
  background: var(--saffron);
  margin-top: var(--sp-2);
}

.footer__links li + li { margin-top: var(--sp-2); }
.footer__links a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
  font-size: var(--fs-sm);
  transition: color 0.2s var(--ease), padding-inline-start 0.2s var(--ease);
}
.footer__links a:hover { color: var(--saffron); padding-inline-start: 4px; }

.footer__contact li {
  display: flex;
  gap: var(--sp-3);
  font-size: var(--fs-sm);
  line-height: 1.6;
}
.footer__contact li + li { margin-top: var(--sp-4); }
.footer__contact svg { color: var(--saffron); flex: none; margin-top: 3px; }
.footer__contact a { color: rgba(255, 255, 255, 0.75); text-decoration: none; word-break: break-word; }
.footer__contact a:hover { color: var(--saffron); }

/* Two offices under one pin icon */
.footer__offices { display: block; }
.footer__offices-name {
  display: block;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 600;
  margin-bottom: 2px;
}
.footer__office { display: block; }
.footer__office + .footer__office { margin-top: 2px; }

.footer__social { display: flex; gap: var(--sp-3); margin-top: var(--sp-5); }
.footer__social a {
  display: grid;
  place-items: center;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
  transition: background-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.footer__social a:hover { background: var(--saffron); transform: translateY(-3px); }

.footer__bottom {
  margin-top: var(--sp-7);
  padding-block: var(--sp-5);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
  align-items: center;
  text-align: center;
  font-size: var(--fs-xs);
}
@media (min-width: 768px) {
  .footer__bottom { flex-direction: row; justify-content: space-between; text-align: start; }
}
.footer__reg { color: rgba(255, 255, 255, 0.55); }
.footer__reg strong { color: var(--saffron); font-weight: 700; }
