/* SmileFacts — Dental Health Literacy Website
   Accessible, calm clinical aesthetic; mobile-first */

:root {
  --teal-900: #0b3d3a;
  --teal-800: #0f514c;
  --teal-700: #14665f;
  --teal-600: #1a7f76;
  --teal-500: #22a399;
  --teal-100: #e6f7f5;
  --teal-50: #f2fbfa;
  --coral: #e07a5f;
  --coral-dark: #c45d42;
  --gold: #e9b44c;
  --ink: #1a2332;
  --ink-soft: #3d4a5c;
  --muted: #5c6b7a;
  --line: #d7e2e8;
  --paper: #ffffff;
  --bg: #f6f9fb;
  --shadow: 0 8px 28px rgba(15, 81, 76, 0.08);
  --shadow-lg: 0 18px 50px rgba(15, 81, 76, 0.12);
  --radius: 16px;
  --radius-sm: 10px;
  --font: "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --max: 1100px;
  --header-h: 72px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  min-height: 100vh;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal-700);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--teal-500);
}

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

/* Skip link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--teal-800);
  color: #fff;
  padding: 0.75rem 1rem;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.85rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: var(--header-h);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  text-decoration: none;
  color: var(--ink);
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--teal-500), var(--teal-800));
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  box-shadow: 0 6px 16px rgba(26, 127, 118, 0.3);
}

.brand-text strong {
  display: block;
  font-size: 1.15rem;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.brand-text span {
  font-size: 0.78rem;
  color: var(--muted);
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
  align-items: center;
}

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.35rem 0.2rem;
}

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

.nav-cta {
  background: var(--teal-700);
  color: #fff !important;
  padding: 0.5rem 0.9rem !important;
  border-radius: 999px;
}

.nav-cta:hover {
  background: var(--teal-500);
  color: #fff !important;
}

/* Layout */
main {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

.hero {
  display: grid;
  gap: 1.5rem;
  padding: 1.5rem 0 2rem;
}

@media (min-width: 860px) {
  .hero {
    grid-template-columns: 1.2fr 0.9fr;
    align-items: center;
    gap: 2.5rem;
    padding: 2.25rem 0 2.75rem;
  }
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--teal-100);
  color: var(--teal-800);
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

h1 {
  font-size: clamp(1.85rem, 4vw, 2.75rem);
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin: 0 0 0.85rem;
  color: var(--teal-900);
}

.lead {
  font-size: 1.1rem;
  color: var(--ink-soft);
  margin: 0 0 1.35rem;
  max-width: 48ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border: none;
  border-radius: 999px;
  padding: 0.75rem 1.2rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--teal-700);
  color: #fff;
  box-shadow: 0 8px 20px rgba(20, 102, 95, 0.25);
}

.btn-primary:hover {
  background: var(--teal-500);
  color: #fff;
}

.btn-secondary {
  background: #fff;
  color: var(--teal-800);
  border: 1.5px solid var(--line);
}

.btn-secondary:hover {
  border-color: var(--teal-500);
  color: var(--teal-700);
}

.btn-ghost {
  background: transparent;
  color: var(--teal-700);
  border: 1.5px solid transparent;
}

.hero-card {
  background: linear-gradient(160deg, var(--teal-800), var(--teal-600));
  color: #fff;
  border-radius: calc(var(--radius) + 4px);
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-card::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  right: -40px;
  top: -40px;
}

.hero-card h2 {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  position: relative;
  z-index: 1;
}

.hero-card ol {
  margin: 0;
  padding-left: 1.2rem;
  position: relative;
  z-index: 1;
}

.hero-card li {
  margin-bottom: 0.55rem;
}

.hero-card li strong {
  color: #fff;
}

/* Sections */
.section {
  margin: 2.5rem 0;
}

.section-header {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
}

.section-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  letter-spacing: -0.02em;
  color: var(--teal-900);
}

.section-header p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 55ch;
}

/* Topic grid */
.topic-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

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

@media (min-width: 960px) {
  .topic-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.topic-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.2rem 1.1rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  text-decoration: none;
  color: inherit;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
  min-height: 100%;
}

.topic-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
  border-color: #b7d9d5;
  color: inherit;
}

.topic-emoji {
  font-size: 1.75rem;
  line-height: 1;
}

.topic-card h3 {
  margin: 0;
  font-size: 1.08rem;
  letter-spacing: -0.01em;
  color: var(--teal-900);
}

.topic-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  flex: 1;
}

.topic-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.25rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: var(--teal-50);
  color: var(--teal-800);
  border: 1px solid #cfe8e4;
}

.chip-soft {
  background: #fff7ea;
  color: #8a5a00;
  border-color: #f0dfb4;
}

/* Level cards */
.level-grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 800px) {
  .level-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.level-card {
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.level-card:hover {
  transform: translateY(-2px);
  border-color: var(--teal-500);
}

.level-card[aria-pressed="true"],
.level-card.is-active {
  border-color: var(--teal-600);
  background: linear-gradient(180deg, #fff, var(--teal-50));
  box-shadow: var(--shadow-lg);
}

.level-card .level-label {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--teal-800);
  margin-bottom: 0.25rem;
}

.level-card .level-short {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--coral-dark);
  margin-bottom: 0.5rem;
}

.level-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

/* Content panel */
.content-panel {
  margin-top: 1.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.4rem 1.35rem 1.5rem;
  box-shadow: var(--shadow);
}

.content-panel[hidden] {
  display: none;
}

.content-panel h2 {
  margin: 0 0 0.35rem;
  color: var(--teal-900);
}

.level-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--teal-100);
  color: var(--teal-800);
  font-weight: 700;
  font-size: 0.8rem;
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.overview {
  font-size: 1.05rem;
  color: var(--ink-soft);
  margin: 0 0 1.25rem;
}

.key-points {
  background: var(--teal-50);
  border: 1px solid #d4ebe8;
  border-radius: var(--radius-sm);
  padding: 1rem 1rem 1rem 1.1rem;
  margin: 0 0 1.5rem;
}

.key-points h3 {
  margin: 0 0 0.55rem;
  font-size: 1rem;
  color: var(--teal-800);
}

.key-points ul {
  margin: 0;
  padding-left: 1.15rem;
}

.key-points li {
  margin-bottom: 0.4rem;
}

/* Resources */
.resources h3 {
  margin: 0 0 0.85rem;
  color: var(--teal-900);
}

.resource-list {
  display: grid;
  gap: 0.85rem;
}

.resource {
  display: grid;
  gap: 0.35rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
}

.resource-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem 0.65rem;
}

.type-pill {
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: #eef2f6;
  color: var(--ink-soft);
}

.type-pill.video {
  background: #fdecea;
  color: #9b2c20;
}

.type-pill.pamphlet {
  background: #fff4e0;
  color: #8a5a00;
}

.type-pill.article {
  background: #e8f4ff;
  color: #0b4f8a;
}

.type-pill.journal {
  background: #efe8ff;
  color: #4b2d9b;
}

.resource h4 {
  margin: 0;
  font-size: 1.02rem;
}

.resource h4 a {
  text-decoration: none;
  color: var(--teal-800);
}

.resource h4 a:hover {
  text-decoration: underline;
  color: var(--teal-500);
}

.resource .source {
  font-size: 0.88rem;
  color: var(--muted);
  font-weight: 600;
}

.resource .note {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.94rem;
}

/* About / intervention pages */
.prose {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem 1.4rem;
  box-shadow: var(--shadow);
  max-width: 75ch;
}

.prose h1 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.prose h2 {
  margin-top: 1.75rem;
  color: var(--teal-800);
  font-size: 1.25rem;
}

.prose h3 {
  margin-top: 1.25rem;
  color: var(--teal-700);
}

.prose p,
.prose li {
  color: var(--ink-soft);
}

.prose ul {
  padding-left: 1.2rem;
}

.callout {
  border-left: 4px solid var(--teal-500);
  background: var(--teal-50);
  padding: 0.9rem 1rem;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 1.25rem 0;
}

.callout strong {
  color: var(--teal-900);
}

.pillars {
  display: grid;
  gap: 1rem;
  margin-top: 1.25rem;
}

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

.pillar {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem;
  box-shadow: var(--shadow);
}

.pillar h3 {
  margin: 0 0 0.5rem;
  color: var(--teal-800);
  font-size: 1.05rem;
}

.pillar p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 0.96rem;
}

/* Breadcrumb / topic page header */
.breadcrumb {
  font-size: 0.9rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.breadcrumb a {
  color: var(--teal-700);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

.topic-hero {
  margin-bottom: 1.5rem;
}

.topic-hero .emoji {
  font-size: 2.2rem;
}

.topic-hero h1 {
  margin-bottom: 0.5rem;
}

.topic-hero .summary {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.08rem;
  max-width: 60ch;
}

/* How levels work strip */
.levels-explainer {
  display: grid;
  gap: 0.85rem;
  margin: 1.5rem 0 0;
}

@media (min-width: 800px) {
  .levels-explainer {
    grid-template-columns: repeat(3, 1fr);
  }
}

.level-mini {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem;
}

.level-mini strong {
  display: block;
  color: var(--teal-800);
  margin-bottom: 0.3rem;
}

.level-mini span {
  color: var(--muted);
  font-size: 0.9rem;
}

/* Source trust bar */
.trust-bar {
  margin-top: 2.5rem;
  padding: 1.25rem;
  border-radius: var(--radius);
  background: #fff;
  border: 1px solid var(--line);
}

.trust-bar h2 {
  margin: 0 0 0.75rem;
  font-size: 1.1rem;
  color: var(--teal-900);
}

.trust-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.trust-logos span {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
}

/* Search */
.search-wrap {
  margin: 0 0 1.25rem;
}

.search-wrap label {
  display: block;
  font-weight: 700;
  font-size: 0.9rem;
  margin-bottom: 0.4rem;
  color: var(--ink-soft);
}

.search-wrap input {
  width: 100%;
  max-width: 420px;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  font: inherit;
  background: #fff;
}

.search-wrap input:focus {
  border-color: var(--teal-500);
  outline: none;
  box-shadow: 0 0 0 3px rgba(34, 163, 153, 0.2);
}

/* Empty state */
.empty-state {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
  background: #fff;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  background: #fff;
  margin-top: auto;
}

.footer-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem 2rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.footer-inner strong {
  color: var(--teal-800);
}

.footer-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  margin: 0.75rem 0 1rem;
}

.footer-nav a {
  text-decoration: none;
  font-weight: 600;
}

.disclaimer {
  border-top: 1px solid var(--line);
  padding-top: 0.9rem;
  line-height: 1.5;
}

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

.hidden {
  display: none !important;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 700;
  text-decoration: none;
  margin-bottom: 1rem;
}

/* Print */
@media print {
  .site-header,
  .site-footer,
  .hero-actions,
  .search-wrap {
    display: none;
  }

  body {
    background: #fff;
  }

  .content-panel,
  .topic-card,
  .prose {
    box-shadow: none;
    border-color: #ccc;
  }
}
