/* P-0215/P-0215.001: layout.css, page skeleton and chrome.
   Owns: .container and .container-narrow, skip link and visually hidden helpers,
   site header and brand and nav with its 820px breakpoint, sections, site footer,
   footer responsive rules. Cascade order: second of four. */

.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 20px;
}

.container-narrow { max-width: 760px; }

/* ---------- Accessibility helpers ---------- */

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  top: -48px; left: 16px;
  z-index: 100;
  padding: 10px 18px;
  background: var(--surface);
  color: var(--primary-ink);
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  font-weight: 600;
  transition: top 150ms ease;
}
.skip-link:focus { top: 12px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 253, 245, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
.site-header.is-scrolled {
  box-shadow: 0 1px 0 rgba(30, 27, 75, 0.08);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 6px 4px;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.3rem;
}

.brand-mark {
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  border: 2px solid var(--ink);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.site-nav {
  display: none;
}
.site-nav.open {
  display: block;
  position: absolute;
  top: 100%; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--shadow-color);
  padding: 16px 20px 24px;
}
.site-nav ul {
  list-style: none;
  margin: 0 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.site-nav ul a {
  display: block;
  min-height: 48px;
  padding: 12px 8px;
  text-decoration: none;
  font-weight: 600;
  color: var(--ink);
  border-radius: var(--radius-sm);
}
.site-nav ul a:hover { color: var(--primary-strong); background: #F5EFFF; }
.site-nav .btn { display: inline-flex; align-items: center; }

@media (min-width: 820px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open {
    display: flex;
    position: static;
    align-items: center;
    gap: 28px;
    background: none;
    border: 0;
    box-shadow: none;
    padding: 0;
  }
  .site-nav ul {
    flex-direction: row;
    gap: 24px;
    margin: 0;
  }
  .site-nav ul a {
    min-height: 44px;
    padding: 10px 4px;
  }
}

/* ---------- Sections ---------- */

.section {
  padding: calc(var(--space) * 6) 0;
  border-top: 1px solid var(--border);
}
.section-alt {
  background: var(--surface);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.section-lede {
  margin-bottom: calc(var(--space) * 5);
}

/* ---------- Footer ---------- */

.site-footer {
  background: var(--ink);
  color: #DDD8F7;
  padding: 48px 0 24px;
}

.footer-grid {
  display: grid;
  gap: 32px;
  padding-bottom: 32px;
  border-bottom: 1px solid #3B3572;
}

.footer-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.4rem;
  color: #fff;
  margin: 0;
}

.footer-brand .brand-mark { margin-bottom: 10px; }

.footer-tagline { color: #B7AEE8; margin: 4px 0 0; }

.footer-nav ul {
  list-style: none;
  margin: 0; padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.footer-groups {
  display: grid;
  gap: 24px;
}

.footer-group-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #B7AEE8;
  margin: 0 0 8px;
}

.footer-nav a {
  display: inline-block;
  min-height: 44px;
  padding: 10px 0;
  color: #DDD8F7;
  text-decoration: none;
  font-weight: 600;
}
.footer-nav a:hover { color: #fff; text-decoration: underline; }

.footer-legal {
  padding-top: 20px;
  font-size: 0.85rem;
  color: #9C93D6;
}
.footer-legal p { margin: 0; }


/* Responsive footer rules, split from the shared 700px block in P-0215.001. */
@media (min-width: 700px) {
  .footer-grid {
    grid-template-columns: 1fr auto;
    align-items: start;
  }
  .footer-nav ul { flex-direction: row; gap: 28px; }
  .footer-groups {
    grid-template-columns: auto auto;
    gap: 48px;
  }
}

@media (min-width: 900px) {
  .section { padding: calc(var(--space) * 10) 0; }
}
