/* Public site layout (templates/site/base.html): landing, About us, Contact us, Blog, legal pages,
   signed-out page. No Figma frames: built from design system parts with the auth pages' navy look.
   Shared pieces come from static/design/components.css; this file lays them out. Prefix site-.
   The footer has its own file (site/footer.css) because old pages include it too. */

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

html { scroll-behavior: smooth; }

body.site {
  margin: 0;
  font-family: var(--fds-font-sans);
  background: var(--fds-page-bg);
  color: var(--fds-text-label);
}

:where(.site) h1, :where(.site) h2, :where(.site) h3, :where(.site) p { margin: 0; }
:where(.site) img { max-width: 100%; height: auto; }

.site-main { flex: 1; }

.site-container {
  width: 100%;
  max-width: var(--fds-container-xl);
  margin: 0 auto;
  padding: 0 32px;
}

.site-narrow { max-width: calc(var(--fds-container-md) + 64px); }
.site-narrow-sm { max-width: calc(var(--fds-container-sm) + 64px); }

.site-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.site-skip {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 100;
  padding: 8px 12px;
  border-radius: var(--fds-radius-md);
  background: var(--fds-primary);
  color: var(--fds-white);
  font-weight: 600;
  text-decoration: none;
}

.site-skip:focus { top: 12px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--fds-white);
  border-bottom: 1px solid var(--fds-slate-200);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  height: 72px;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--fds-text-heading);
  text-decoration: none;
}

/* Same mark as the auth pages (auth-brand-mark), 40px here. */
.site-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: var(--fds-radius-pill);
  background: var(--fds-navy-logo);
  color: var(--fds-white);
}

.site-brand-name {
  font-size: 18px;
  line-height: 20px;
  font-weight: 500;
}

.site-brand-name em { display: block; font-style: italic; }

.site-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
}

.site-nav a {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--fds-gray-800);
  text-decoration: none;
}

.site-nav a:hover,
.site-nav a[aria-current="page"] { color: var(--fds-primary); }

.site-header-actions { display: flex; gap: 8px; }

/* ---------- Page hero (navy title band) ---------- */
.site-hero {
  padding: 56px 0;
  background: var(--fds-navy-hero);
  color: var(--fds-white);
}

.site-hero-inner {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.site-hero-title {
  font-size: 36px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.site-hero-sub {
  font-size: 16px;
  line-height: 24px;
  color: rgba(255, 255, 255, 0.8);
}

.site-hero-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
}

.site-hero-back:hover { color: var(--fds-white); }

/* ---------- Page body ---------- */
.site-page { padding: 48px 0 80px; }

.site-stack { display: flex; flex-direction: column; gap: 24px; }

.site-card {
  padding: 32px;
  background: var(--fds-surface);
  border: 1px solid var(--fds-border-card);
  border-radius: var(--fds-radius-xl);
  box-shadow: var(--fds-shadow-card);
}

.site-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.site-note {
  font-size: 14px;
  line-height: 20px;
  color: var(--fds-text-muted);
}

/* ---------- Feature cards (landing, About us) ---------- */
.site-features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-features-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.site-feature {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px;
  background: var(--fds-surface);
  border: 1px solid var(--fds-border-card);
  border-radius: var(--fds-radius-xl);
  box-shadow: var(--fds-shadow-card);
}

/* Teal round icon, as on the auth hero (auth-feature-icon). */
.site-feature-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: var(--fds-radius-pill);
  background: var(--fds-teal-500);
  color: var(--fds-white);
}

.site-feature h3 {
  font-size: 16px;
  line-height: 24px;
  font-weight: 600;
  color: var(--fds-text-heading);
}

.site-feature p {
  font-size: 14px;
  line-height: 20px;
  color: var(--fds-text-secondary);
}

/* ---------- About us: founder ---------- */
.site-founder {
  display: flex;
  align-items: flex-start;
  gap: 24px;
}

.site-founder img {
  flex-shrink: 0;
  width: 96px;
  height: 96px;
  border-radius: var(--fds-radius-pill);
  object-fit: cover;
  object-position: 50% 15%; /* the face sits high in the photo */
}

.site-founder h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
  color: var(--fds-text-heading);
}

.site-founder-role {
  margin-top: 2px;
  font-size: 14px;
  line-height: 20px;
  color: var(--fds-text-muted);
}

.site-founder-bio {
  margin-top: 12px;
  font-size: 16px;
  line-height: 26px;
  color: var(--fds-text-secondary);
}

/* ---------- Blog list ---------- */
.site-posts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-post {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  height: 100%;
  transition: box-shadow 0.15s ease;
}

.site-post:hover { box-shadow: var(--fds-shadow-raised); }

.site-post-date {
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  color: var(--fds-text-muted);
}

.site-post h2 {
  font-size: 20px;
  line-height: 28px;
  font-weight: 600;
}

/* The title link covers the whole card. */
.site-post h2 a { color: var(--fds-text-heading); text-decoration: none; }
.site-post h2 a::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.site-post h2 a:focus-visible { outline: none; }
.site-post:focus-within { outline: 2px solid var(--fds-primary); outline-offset: 2px; }

.site-post p {
  flex: 1;
  font-size: 15px;
  line-height: 24px;
  color: var(--fds-text-secondary);
}

.site-post-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  line-height: 20px;
  font-weight: 600;
  color: var(--fds-primary);
}

/* ---------- Article text (blog posts, legal pages) ---------- */
.site-prose {
  font-size: 16px;
  line-height: 1.7;
  color: var(--fds-slate-800);
  overflow-wrap: break-word;
}

.site-prose > :first-child { margin-top: 0; }
.site-prose > :last-child { margin-bottom: 0; }
.site-prose p, .site-prose ul, .site-prose ol { margin: 0 0 16px; }
.site-prose ul, .site-prose ol { padding-left: 24px; }
.site-prose li + li { margin-top: 4px; }

.site-prose h1, .site-prose h2, .site-prose h3, .site-prose h4 {
  margin: 32px 0 12px;
  line-height: 1.3;
  font-weight: 700;
  color: var(--fds-text-heading);
}

/* Some posts repeat their title as an <h1> in the body. */
.site-prose h1 { font-size: 28px; }
.site-prose h2 { font-size: 24px; }
.site-prose h3 { font-size: 20px; }
.site-prose h4 { font-size: 17px; }

.site-prose a { color: var(--fds-primary); font-weight: 500; }
.site-prose a:hover { color: var(--fds-primary-hover); }
.site-prose img { border-radius: var(--fds-radius-lg); }
.site-prose .text-muted { color: var(--fds-text-muted); }

.site-prose blockquote {
  margin: 16px 0;
  padding-left: 16px;
  border-left: 4px solid var(--fds-gray-200);
  color: var(--fds-text-secondary);
}

.site-prose code, .site-prose pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.9em;
  border-radius: var(--fds-radius-md);
  background: var(--fds-slate-100);
}

.site-prose code { padding: 2px 6px; }
.site-prose pre { margin: 0 0 16px; padding: 14px 16px; overflow-x: auto; }
.site-prose pre code { padding: 0; background: none; }

.site-prose table {
  display: block;
  width: 100%;
  margin: 0 0 16px;
  overflow-x: auto;
  border-collapse: collapse;
  font-size: 15px;
}

.site-prose th, .site-prose td {
  padding: 10px 12px;
  border: 1px solid var(--fds-gray-200);
  text-align: left;
}

.site-prose th { background: var(--fds-slate-50); font-weight: 600; }

.site-article-image {
  margin-bottom: 24px;
  overflow: hidden;
  border-radius: var(--fds-radius-xl);
  box-shadow: var(--fds-shadow-card);
}

.site-article-image img { display: block; width: 100%; }

.site-article-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid var(--fds-slate-200);
}

/* ---------- Contact form ---------- */
.site-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.site-form .fds-textarea { width: 100%; min-height: 160px; }

.site-form-actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

/* ---------- Status card (message sent, signed out) ---------- */
.site-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 560px;
  margin: 0 auto;
  padding: 48px 40px;
  text-align: center;
}

.site-status h1 {
  font-size: 24px;
  line-height: 32px;
  font-weight: 600;
  color: var(--fds-text-heading);
}

.site-status p {
  font-size: 16px;
  line-height: 24px;
  color: var(--fds-text-secondary);
}

.site-status .site-actions { justify-content: center; margin-top: 8px; }

/* ---------- Responsive (Figma breakpoints 1280 / 1024 / 768 / 640) ---------- */
@media (max-width: 1279.98px) {
  .site-features { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1023.98px) {
  .site-features-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 767.98px) {
  .site-nav { display: none; }
  .site-header-actions { margin-left: auto; }
  .site-hero { padding: 40px 0; }
  .site-hero-title { font-size: 30px; }
  .site-posts { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 639.98px) {
  .site-container { padding: 0 16px; }
  .site-header-inner { gap: 12px; height: 64px; }
  .site-brand-name { display: none; }
  .site-hero-title { font-size: 26px; }
  .site-page { padding: 32px 0 56px; }
  .site-card { padding: 24px 20px; }
  .site-features, .site-features-3 { grid-template-columns: minmax(0, 1fr); }
  .site-founder { flex-direction: column; gap: 16px; }
  .site-form-actions { flex-direction: column-reverse; }
  .site-form-actions .fds-btn, .site-status .fds-btn { width: 100%; }
  .site-status { padding: 32px 20px; }
}

@media print {
  .site-header, .site-skip { display: none; }
  .site-hero { padding: 0 0 16px; background: none; color: var(--fds-text-heading); }
  .site-hero-sub, .site-hero-back { color: var(--fds-text-muted); }
  body.site { background: var(--fds-white); }
  .site-card { border: 0; box-shadow: none; padding: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .site-post { transition: none; }
}
