/* 388MR Residents Hub — Theme A: Modern Clean
   Light, airy, white/soft grey, teal accent, all sans-serif, card grid. */

@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-500.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Outfit";
  src: url("fonts/outfit-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --bg: #f5f6f8;
  --paper: #ffffff;
  --ink: #16181d;
  --muted: #5a6270;
  --line: #e6e8ee;
  --line-strong: #d3d7e0;
  --accent: #0e7c7b;
  --accent-deep: #0a5f5e;
  --accent-soft: #e7f4f4;
  --header-bg: rgba(255, 255, 255, 0.9);
  --footer-bg: #eef0f4;
  --footer-ink: #3a414c;
  --footer-muted: #6a7380;
  --emergency-bg: #fff6f4;
  --emergency-line: #f3d4ce;
  --emergency-accent: #c43722;
  --focus: #0e7c7b;
  --font: "Outfit", "Segoe UI", system-ui, sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --btn-radius: 8px;
  --max: 72rem;
  --gutter: clamp(1.25rem, 4.5vw, 2.5rem);
  --header-h: 4rem;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.04), 0 8px 24px rgba(16, 24, 40, 0.05);
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 5.25rem;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; }

a { color: var(--accent-deep); text-underline-offset: 0.15em; }
a:hover { color: var(--ink); }

:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 100;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  font-weight: 600;
}
.skip-link:focus { top: 0.75rem; color: #fff; }

.wrap {
  width: min(var(--max), 100%);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: inherit;
  min-width: 0;
}

.brand-mark {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
  line-height: 1;
  padding: 0.4rem 0.45rem;
  border-radius: 6px;
}

.brand-name {
  font-family: var(--font);
  font-weight: 600;
  font-size: 1.02rem;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--ink);
}

.nav-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  cursor: pointer;
}
.nav-toggle svg { display: block; }

.site-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: none;
  gap: 0.1rem 0.2rem;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.92rem;
  padding: 0.4rem 0.7rem;
  display: inline-block;
  border-radius: 8px;
}
.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--accent-deep);
  background: var(--accent-soft);
}

@media (max-width: 879px) {
  .site-nav.is-open ul {
    display: flex;
    flex-direction: column;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    padding: 0.5rem var(--gutter) 1rem;
  }
  .site-nav.is-open a { padding: 0.7rem 0.5rem; font-size: 1.05rem; }
}

@media (min-width: 880px) {
  .nav-toggle { display: none; }
  .site-nav ul { display: flex; }
}

/* Hero */
.hero {
  padding: clamp(2.5rem, 6vw, 4.25rem) 0 1.5rem;
}

.hero-kicker {
  margin: 0 0 0.85rem;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

.hero h1 {
  margin: 0 0 0.9rem;
  font-family: var(--font);
  font-weight: 650;
  font-size: clamp(2.15rem, 5.6vw, 3.5rem);
  line-height: 1.08;
  letter-spacing: -0.035em;
  color: var(--ink);
}

.hero-lede {
  margin: 0;
  max-width: 38rem;
  font-size: 1.125rem;
  color: var(--muted);
  line-height: 1.6;
}

.rule {
  width: 2.5rem;
  height: 3px;
  background: var(--accent);
  border: 0;
  border-radius: 2px;
  margin: 1.4rem 0 0;
}

/* Emergency */
.emergency {
  margin: 1.5rem 0 0.75rem;
  background: var(--emergency-bg);
  border: 1px solid var(--emergency-line);
  border-radius: var(--radius);
  padding: 1.15rem 1.25rem 1.2rem 1.55rem;
  display: grid;
  gap: 0.35rem 1.5rem;
  position: relative;
}
.emergency::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--emergency-accent);
}

@media (min-width: 720px) {
  .emergency {
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 1.2rem 1.75rem 1.2rem 1.85rem;
  }
}

.emergency-number {
  font-family: var(--font);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 3.1rem);
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--emergency-accent);
  text-decoration: none;
}
.emergency-number:hover { color: #9b2b1a; }

.emergency h2 {
  margin: 0 0 0.3rem;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}
.emergency p { margin: 0; color: var(--muted); }

/* Sections */
.section {
  padding: clamp(1.85rem, 3.8vw, 3rem) 0;
  border-top: 1px solid var(--line);
}

.section-kicker {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 650;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

.section h2 {
  margin: 0 0 0.55rem;
  font-family: var(--font);
  font-size: clamp(1.45rem, 3vw, 1.85rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  color: var(--ink);
}

.section-intro {
  margin: 0 0 1.35rem;
  color: var(--muted);
  max-width: 44rem;
}

.note, .placeholder-note {
  margin: 0.75rem 0 0;
  font-size: 0.95rem;
  color: var(--muted);
  font-style: italic;
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}
@media (min-width: 640px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 960px) {
  .card-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .card-grid.cols-4 { grid-template-columns: repeat(2, 1fr); }
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.25rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-height: 100%;
  box-shadow: var(--shadow);
}
.card.is-placeholder {
  background: transparent;
  box-shadow: none;
  border-style: dashed;
  border-color: var(--line-strong);
}

.card-kicker {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.card h3 {
  margin: 0;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  line-height: 1.3;
}

.card p {
  margin: 0;
  color: var(--muted);
  flex: 1;
}

.card-actions { margin-top: 0.55rem; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.65rem;
  padding: 0.45rem 1rem;
  border-radius: var(--btn-radius);
  background: var(--accent);
  color: #fff;
  text-decoration: none;
  font-weight: 600;
  font-size: 0.92rem;
  border: 1px solid var(--accent);
}
.btn:hover {
  background: var(--accent-deep);
  border-color: var(--accent-deep);
  color: #fff;
}
.btn-quiet {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-strong);
}
.btn-quiet:hover {
  background: var(--paper);
  color: var(--accent-deep);
  border-color: var(--accent);
}

.placeholder-action {
  display: inline-flex;
  align-items: center;
  min-height: 2.65rem;
  padding: 0.4rem 1rem;
  border-radius: var(--btn-radius);
  border: 1px dashed var(--line-strong);
  color: var(--muted);
  font-weight: 500;
  font-size: 0.92rem;
}

.badge {
  display: inline-block;
  margin-right: 0.35rem;
  padding: 0.14rem 0.5rem;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent-deep);
  background: var(--accent-soft);
  vertical-align: middle;
}

.review {
  display: block;
  margin-top: 0.45rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.notice, .prose-block {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  box-shadow: var(--shadow);
}
.notice.is-example { border-left: 4px solid var(--line-strong); }
.notice h3, .prose-block h3 {
  margin: 0 0 0.35rem;
  font-family: var(--font);
  font-size: 1.15rem;
  font-weight: 650;
}
.notice .card-kicker { margin-bottom: 0.25rem; }
.notice p, .prose-block p { margin: 0; color: var(--muted); }

/* Contacts */
.contact-list { border-top: 1px solid var(--line); }
.contact-row {
  display: grid;
  gap: 0.2rem 1.5rem;
  padding: 0.95rem 0;
  border-bottom: 1px solid var(--line);
}
@media (min-width: 640px) {
  .contact-row { grid-template-columns: 11.5rem 1fr; align-items: baseline; }
}
.contact-label { font-weight: 650; font-size: 0.95rem; }
.contact-value { color: var(--muted); }
.contact-value a { font-weight: 600; }

/* FAQ */
.faq + .faq { border-top: 1px solid var(--line); }
.faq details { padding: 0.15rem 0; }
.faq summary {
  cursor: pointer;
  font-weight: 600;
  padding: 0.85rem 0;
  list-style: none;
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: baseline;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-weight: 500;
  font-size: 1.35rem;
  color: var(--accent);
  line-height: 1;
}
.faq details[open] summary::after { content: "–"; }
.faq .answer {
  margin: 0 0 1rem;
  color: var(--muted);
  max-width: 42rem;
}

.link-list { display: grid; gap: 1rem; }
.link-item p { margin: 0.2rem 0 0; color: var(--muted); }
.link-item a { font-weight: 600; }

/* Footer — stays light to match the airy theme */
.site-footer {
  background: var(--footer-bg);
  color: var(--footer-ink);
  padding: 2.25rem 0 2.5rem;
  margin-top: 0;
  border-top: 1px solid var(--line);
}
.site-footer .brand-mark {
  color: #fff;
  background: var(--accent);
  display: inline-block;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
}
.site-footer .brand-name {
  color: var(--ink);
  margin-top: 0.7rem;
}
.site-footer p { margin: 0.75rem 0 0; max-width: 46rem; color: var(--footer-muted); }
.site-footer .credit {
  margin-top: 1.25rem;
  font-size: 0.9rem;
  color: var(--footer-muted);
}

.page-404 { padding: 4.5rem 0 6rem; }
.page-404 h1 {
  font-family: var(--font);
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.75rem;
  letter-spacing: -0.03em;
}

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

.loading { padding: 4rem 0; color: var(--muted); }

.card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.6rem;
}
.card .badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-bottom: 0.15rem;
}
.card-actions .btn { white-space: nowrap; }
.contact-note {
  margin: 0.35rem 0 0;
  font-size: 0.92rem;
  color: var(--muted);
  font-style: italic;
}
.survey-card {
  display: inline-block;
  min-width: min(100%, 22rem);
  padding: 1.25rem 1.4rem 1.3rem;
}
.section:last-of-type { padding-bottom: clamp(2.25rem, 5vw, 3.5rem); }
.card-actions .review, .survey-card .review {
  flex-basis: 100%;
  width: 100%;
  margin-top: 0.15rem;
}
main { flex: 1 0 auto; }
.site-footer { flex-shrink: 0; }
.survey-card { min-width: min(100%, 24rem); }


/* Photo hero banner (front steps). Matches the approved preview. */
.hero-banner {
  position: relative;
  background-color: #0a5f5e;
  background-image: url("images/hero-1920x800.jpg");
  background-image: -webkit-image-set(
    url("images/hero-1920x800.webp") type("image/webp"),
    url("images/hero-1920x800.jpg") type("image/jpeg")
  );
  background-image: image-set(
    url("images/hero-1920x800.webp") type("image/webp"),
    url("images/hero-1920x800.jpg") type("image/jpeg")
  );
  background-position: center;
  background-size: cover;
  background-repeat: no-repeat;
  min-height: 28rem;
  color: #fff;
}
.hero-banner::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(10, 95, 94, 0.78) 0%,
    rgba(14, 124, 123, 0.52) 42%,
    rgba(14, 124, 123, 0.18) 100%
  );
  pointer-events: none;
}
.hero-banner .hero {
  position: relative;
  z-index: 1;
  padding: clamp(3.25rem, 8vw, 5.5rem) 0 clamp(2.5rem, 6vw, 4rem);
}
.hero-banner .hero-kicker { color: #d7f0ef; }
.hero-banner h1 { color: #fff; }
.hero-banner .hero-lede { color: rgba(255, 255, 255, 0.9); max-width: 36rem; }
.hero-banner .rule { background: #fff; }
@media (max-width: 700px) {
  .hero-banner {
    min-height: 20rem;
    background-image: url("images/hero-960x400.jpg");
    background-image: -webkit-image-set(
      url("images/hero-960x400.webp") type("image/webp"),
      url("images/hero-960x400.jpg") type("image/jpeg")
    );
    background-image: image-set(
      url("images/hero-960x400.webp") type("image/webp"),
      url("images/hero-960x400.jpg") type("image/jpeg")
    );
  }
  /* Stronger wash on small screens so wrapped title and lede stay readable
     over the full width, not only the left edge. */
  .hero-banner::after {
    background: linear-gradient(
      180deg,
      rgba(10, 95, 94, 0.78) 0%,
      rgba(14, 124, 123, 0.66) 55%,
      rgba(14, 124, 123, 0.55) 100%
    );
  }
  .hero-banner .hero-lede { color: #fff; }
}
