/* World Dental Alliance — revamp
   Palette: porcelain, enamel, charcoal ink, seal gold.
   Gold is reserved for marks of certification (pins, emblem, audit checks). */

@font-face { font-family: "Spectral"; font-style: normal; font-weight: 400; font-display: swap; src: url("../fonts/spectral-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Spectral"; font-style: normal; font-weight: 500; font-display: swap; src: url("../fonts/spectral-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Albert Sans"; font-style: normal; font-weight: 100 900; font-display: swap; src: url("../fonts/albert-sans-latin-wght-normal.woff2") format("woff2-variations"), url("../fonts/albert-sans-latin-wght-normal.woff2") format("woff2"); }

:root {
  --porcelain: #ffffff;
  --enamel: #f2f4f2;
  --ink: #1c2226;
  --slate: #5a6368;
  --gold: #c9a65f;
  --gold-deep: #7d6228;
  --line: #dce0dd;
  --dot: #c9d0cc;

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans: "Albert Sans", "Helvetica Neue", Arial, system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.65rem;
  --step-3: clamp(1.75rem, 1.4rem + 1.4vw, 2.1rem);
  --step-4: clamp(2.1rem, 1.6rem + 2.2vw, 2.75rem);
  --step-5: clamp(2.5rem, 1.7rem + 3.6vw, 4.25rem);

  --container: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --radius: 3px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-padding-top: 96px; }

body {
  margin: 0;
  background: var(--porcelain);
  color: var(--ink);
  font: 400 var(--step-0)/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, svg { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { text-decoration-color: var(--gold); }

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

h1, h2, h3 { font-family: var(--serif); font-weight: 500; line-height: 1.12; letter-spacing: -0.01em; margin: 0; text-wrap: balance; }
h1 { font-size: var(--step-5); letter-spacing: -0.02em; }
h2 { font-size: var(--step-4); }
h3 { font-size: var(--step-2); line-height: 1.2; }
p { margin: 0 0 1em; text-wrap: pretty; }
p:last-child { margin-bottom: 0; }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }

.skip-link {
  position: fixed; left: 12px; top: 10px; z-index: 50;
  padding: 10px 14px; background: var(--ink); color: var(--porcelain);
  transform: translateY(-160%);
}
.skip-link:focus { transform: none; }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

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

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: saturate(1.4) blur(8px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 88px; }
.brand { display: inline-flex; flex: none; }
.brand img { height: 60px; width: auto; }

.site-nav { display: flex; align-items: center; gap: 30px; }
.site-nav ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.site-nav ul a { font-size: 0.95rem; font-weight: 500; text-decoration: none; padding-block: 6px; }
.site-nav ul a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.site-nav ul a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 0.45em; }

.nav-toggle {
  display: none; align-items: center; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--porcelain); color: var(--ink); font: 500 0.95rem var(--sans); cursor: pointer;
}
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
  display: block; width: 18px; height: 1.5px; background: currentColor; position: relative; transition: transform 0.2s ease;
}
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -6px; }
.nav-toggle-bars::after { top: 6px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 12px 22px;
  border: 1px solid var(--ink); border-radius: var(--radius);
  background: var(--ink); color: var(--porcelain);
  font: 600 0.95rem/1.2 var(--sans); text-decoration: none; cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: #2c353a; text-decoration: none; }
.btn-outline { background: transparent; color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--porcelain); }
.btn-small { min-height: 40px; padding: 9px 16px; font-size: 0.9rem; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

.text-link { color: var(--gold-deep); font-weight: 600; text-decoration: underline; text-decoration-color: rgba(125, 98, 40, 0.35); }
.text-link:hover { text-decoration-color: var(--gold-deep); }


/* ---------- Home hero ---------- */

.hero { padding-block: clamp(48px, 7vw, 88px) clamp(40px, 5vw, 64px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 8fr) minmax(0, 4fr); gap: 24px 56px; align-items: end; }
.hero h1 { max-width: 20ch; }
.hero-aside .lead { margin-bottom: 24px; }
.lead { font-size: var(--step-1); line-height: 1.5; color: var(--slate); max-width: 34em; }

.hero-map { margin-top: clamp(36px, 5vw, 60px); }

/* ---------- World map ---------- */

.map { position: relative; aspect-ratio: 1000 / 423; }
.map > img { width: 100%; height: 100%; }
.map-dots { fill: none; stroke: var(--dot); stroke-width: 3.5; stroke-linecap: round; }

.pin {
  position: absolute; left: var(--x); top: var(--y);
  width: 30px; height: 30px; margin: -15px 0 0 -15px;
  display: grid; place-items: center;
  text-decoration: none; color: var(--ink);
}
.pin::before {
  content: ""; width: 11px; height: 11px; border-radius: 50%;
  background: var(--gold); box-shadow: 0 0 0 2px var(--porcelain), 0 0 0 3px var(--gold-deep);
  transition: transform 0.15s ease;
}
.pin:hover::before, .pin:focus-visible::before, .pin.is-active::before { transform: scale(1.35); background: var(--gold-deep); }
.pin:focus-visible { outline: none; }
.pin-label {
  position: absolute; bottom: calc(100% - 2px); left: 50%; transform: translateX(-50%);
  padding: 5px 9px; border-radius: var(--radius);
  background: var(--ink); color: var(--porcelain);
  font: 500 0.8rem/1.2 var(--sans); white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.15s ease;
}
.pin:hover .pin-label, .pin:focus-visible .pin-label, .pin.is-active .pin-label { opacity: 1; }
.pin:hover, .pin:focus-visible { z-index: 2; }

/* The one orchestrated moment: pins settle onto the map on first view. */
@media (prefers-reduced-motion: no-preference) {
  .map-intro .pin::before { animation: pin-in 0.5s cubic-bezier(0.2, 0.8, 0.3, 1.2) both; animation-delay: calc(0.25s + var(--i, 0) * 0.09s); }
}
@keyframes pin-in { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.legend { display: flex; flex-wrap: wrap; gap: 8px 32px; margin: 22px 0 0; padding: 20px 0 0; border-top: 1px solid var(--line); list-style: none; }
.legend a { display: inline-flex; align-items: baseline; gap: 8px; text-decoration: none; font-weight: 500; }
.legend a:hover .legend-name { text-decoration: underline; text-decoration-color: var(--gold); }
.legend-count { color: var(--slate); font-size: var(--step--1); font-weight: 400; }

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

.section { padding-block: clamp(56px, 8vw, 104px); }
.section-tint { background: var(--enamel); }
.section.section-ruled { padding-top: 0; }
.section-ruled > .container { border-top: 1px solid var(--line); padding-top: clamp(56px, 8vw, 104px); }
.section-head { max-width: 40rem; margin-bottom: clamp(28px, 4vw, 48px); }
.section-head p { margin-top: 16px; color: var(--slate); }

.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 32px 72px; align-items: start; }
.split-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.prose { max-width: 40rem; }
.prose p { color: var(--ink); }
.prose h2 + p, .prose h3 + p { margin-top: 16px; }

.duo { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 72px; }
.duo h2 { font-size: var(--step-3); margin-bottom: 16px; }
.duo p { color: var(--slate); }
.duo .text-link { display: inline-block; margin-top: 14px; }

/* Audit / seal panel */
.seal-panel {
  position: relative; overflow: hidden;
  padding: clamp(28px, 4vw, 48px);
  background: var(--porcelain); border: 1px solid var(--line); border-radius: var(--radius);
}
.seal-panel::after {
  content: ""; position: absolute; right: -40px; bottom: -48px; width: 260px; height: 248px;
  background: url("../img/wda-emblem-gold.png") no-repeat center / contain;
  opacity: 0.09; pointer-events: none;
}
.seal-panel h2, .seal-panel h3 { font-size: var(--step-3); }
.seal-panel > p { color: var(--slate); margin-top: 14px; max-width: 34rem; }

.criteria { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 32px; margin: 28px 0 0; padding: 0; list-style: none; position: relative; z-index: 1; }
.criteria li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; font-weight: 500; }
.criteria li span { display: block; color: var(--slate); font-weight: 400; font-size: var(--step--1); margin-top: 2px; }
.check { width: 22px; height: 22px; margin-top: 2px; color: var(--gold-deep); }

/* Ruled list (articles, objectives) */
.ruled { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.ruled > li { border-bottom: 1px solid var(--line); }
.ruled-link { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr) auto; gap: 8px 40px; align-items: baseline; padding: 26px 0; text-decoration: none; }
.ruled-link h3 { font-size: var(--step-2); }
.ruled-link p { color: var(--slate); margin: 0; }
.ruled-link .go { color: var(--gold-deep); font-weight: 600; font-size: 0.95rem; white-space: nowrap; }
.ruled-link:hover h3 { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }

.ruled-plain > li { padding: 20px 0; font-size: var(--step-1); font-family: var(--serif); line-height: 1.4; }

/* CTA band */
.cta-band { background: var(--enamel); }
.cta-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px 48px; align-items: center; padding-block: clamp(48px, 6vw, 72px); }
.cta-inner h2 { font-size: var(--step-4); }
.cta-inner p { color: var(--slate); margin-top: 12px; max-width: 34rem; }

/* ---------- Inner page hero ---------- */

.page-hero { background: var(--enamel); padding-block: clamp(48px, 7vw, 88px) clamp(40px, 5vw, 64px); }
.page-hero h1 { font-size: var(--step-5); max-width: 18ch; }
.page-hero .lead { margin-top: 20px; }
.page-hero .lead + .lead { margin-top: 10px; }
.page-hero .actions { margin-top: 28px; }
.crumb { display: inline-block; margin-bottom: 20px; color: var(--slate); font-size: 0.95rem; font-weight: 500; text-decoration: none; }
.crumb:hover { color: var(--ink); text-decoration: underline; }
.crumb::before { content: "‹"; margin-right: 8px; }

/* Values grid */
.values { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.values li { padding: 26px 24px 30px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1.2rem; line-height: 1.4; background: var(--porcelain); }

/* Beliefs */
.beliefs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 48px; }
.beliefs h3 { font-size: var(--step-2); margin-bottom: 14px; }
.beliefs p { color: var(--slate); }

/* Locations summary */
.places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 40px; margin: 0; padding: 0; list-style: none; }
.places a { display: flex; justify-content: space-between; gap: 16px; padding: 16px 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 500; }
.places a span { color: var(--slate); font-weight: 400; }
.places a:hover .place-name { text-decoration: underline; text-decoration-color: var(--gold); }

/* ---------- Directory ---------- */

.directory-tools { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 16px 32px; margin: 40px 0 28px; }
.search { display: grid; gap: 6px; width: min(420px, 100%); }
.search label { font-weight: 600; font-size: 0.95rem; }
.result-count { color: var(--slate); margin: 0; }

.locations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; }
.location {
  padding: 24px 24px 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--porcelain);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.location:target, .location.is-active { border-color: var(--gold); box-shadow: 0 0 0 2px var(--gold); }
.location h2 { font-size: var(--step-2); display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.location h2 small { font: 400 var(--step--1) var(--sans); color: var(--slate); }
.clinics { margin: 16px 0 0; padding: 0; list-style: none; }
.clinics li { padding: 12px 0; border-top: 1px solid var(--line); }
.clinics li[hidden] { display: none; }
.clinic-name { display: block; font-weight: 600; }
.clinic-link { font-size: var(--step--1); color: var(--gold-deep); }
.no-results { padding: 28px; border: 1px dashed var(--line); border-radius: var(--radius); color: var(--slate); }

.note { padding: 14px 18px; border-left: 3px solid var(--gold); background: var(--enamel); color: var(--slate); font-size: 0.95rem; }

/* ---------- Articles ---------- */

.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px 80px; align-items: start; }
.article-body { max-width: 42rem; font-family: var(--serif); font-size: 1.2rem; line-height: 1.72; }
.article-body h2 { font-size: var(--step-3); margin: 1.8em 0 0.6em; }
.article-body h2:first-child { margin-top: 0; }
.article-body ul { padding-left: 1.2em; margin: 0 0 1.2em; }
.article-body li { margin-bottom: 0.6em; padding-left: 0.3em; }
.article-body li::marker { color: var(--gold-deep); }
.article-body small { display: block; font-size: 0.92em; color: var(--slate); margin-top: 0.3em; }

.article-body .signs { margin: 0.8em 0 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.article-body .signs li { margin: 0; padding: 14px 0; border-bottom: 1px solid var(--line); font-family: var(--sans); font-size: var(--step-0); font-weight: 500; }

.aside { position: sticky; top: 112px; display: grid; gap: 28px; }
.aside h2 { font-size: var(--step-1); margin-bottom: 10px; }
.aside ul { margin: 0; padding: 0; list-style: none; }
.aside li a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); text-decoration: none; }
.aside li a:hover { text-decoration: underline; text-decoration-color: var(--gold); }
.disclaimer { padding: 18px 20px; background: var(--enamel); border-radius: var(--radius); color: var(--slate); font-size: 0.92rem; line-height: 1.55; }

/* ---------- Legal ---------- */

.legal-layout { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 40px 80px; align-items: start; }
.toc { position: sticky; top: 112px; }
.toc h2 { font: 600 0.95rem var(--sans); margin-bottom: 8px; }
.toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.toc li a { display: block; padding: 8px 0; border-bottom: 1px solid var(--line); color: var(--slate); text-decoration: none; font-size: 0.95rem; }
.toc li a:hover { color: var(--ink); }
.legal { max-width: 44rem; }
.legal h2 { font-size: var(--step-2); margin: 2em 0 0.7em; }
.legal h2:first-child { margin-top: 0; }
.legal p, .legal li { color: #333b40; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: 0.7em; }

/* ---------- Forms ---------- */

.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px 80px; align-items: start; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 24px; }
.field { display: grid; gap: 8px; align-content: start; }
.field-full { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: 0.95rem; }
.field .optional { color: var(--slate); font-weight: 400; }
input, select, textarea {
  width: 100%; min-height: 48px; padding: 11px 14px;
  border: 1px solid #b9c1bd; border-radius: var(--radius);
  background: var(--porcelain); color: var(--ink); font: inherit;
}
textarea { min-height: 150px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 15px) 21px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 40px; }
input:hover, select:hover, textarea:hover { border-color: var(--slate); }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 0; border-color: var(--gold-deep); }
[aria-invalid="true"] { border-color: #a33a2a; }
.field-error { color: #a33a2a; font-size: var(--step--1); }
.field-error:empty { display: none; }
.form-footer { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.form-footer p { color: var(--slate); font-size: var(--step--1); margin: 0; max-width: 28rem; }
.form-status { margin-top: 20px; }
.form-status:empty { display: none; }
.form-status.is-success { border-left-color: #3d7a55; color: var(--ink); }
.form-status.is-error { border-left-color: #a33a2a; color: var(--ink); }
.specify[hidden] { display: none; }

.contact-aside { display: grid; gap: 28px; padding-top: 4px; }
.contact-aside h2 { font-size: var(--step-1); margin-bottom: 8px; }
.contact-aside p { color: var(--slate); }

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

.site-footer { background: var(--ink); color: #c9cfcc; padding-block: 64px 32px; }
.footer-top { display: grid; grid-template-columns: minmax(0, 5fr) repeat(2, minmax(0, 2fr)); gap: 40px; padding-bottom: 40px; border-bottom: 1px solid #343d42; }
.footer-brand img { height: 64px; width: auto; }
.footer-brand p { margin-top: 20px; max-width: 26rem; color: #9aa3a0; }
.site-footer h2 { font: 600 0.95rem var(--sans); color: var(--porcelain); margin-bottom: 14px; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li a { display: inline-block; padding: 5px 0; text-decoration: none; }
.site-footer a:hover { color: var(--porcelain); text-decoration: underline; text-decoration-color: var(--gold); }
.footer-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 24px; padding-top: 24px; font-size: var(--step--1); color: #9aa3a0; }
.site-footer :focus-visible { outline-color: var(--gold); }

/* ---------- Responsive ---------- */

@media (max-width: 1020px) {
  .site-nav ul { gap: 20px; }
  .site-nav .btn { display: none; }
  .locations { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .values { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .article-layout, .contact-layout { grid-template-columns: minmax(0, 1fr); }
  .aside { position: static; }
  .legal-layout { grid-template-columns: minmax(0, 1fr); }
  .toc { position: static; }
}

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; padding: 8px var(--gutter) 24px; background: var(--porcelain); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; gap: 16px; }
  .site-nav.is-open { display: flex; }
  .site-nav ul { flex-direction: column; gap: 0; }
  .site-nav ul a { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
  .site-nav .btn { display: inline-flex; }
  .hero-grid, .split, .split-even, .duo, .cta-inner { grid-template-columns: minmax(0, 1fr); }
  .beliefs, .places { grid-template-columns: minmax(0, 1fr); }
  .ruled-link { grid-template-columns: minmax(0, 1fr); }
  .footer-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-brand { grid-column: 1 / -1; }
}

@media (max-width: 600px) {
  .brand img { height: 42px; }
  .header-inner { min-height: 68px; }
  .pin { width: 22px; height: 22px; margin: -11px 0 0 -11px; }
  .pin::before { width: 7px; height: 7px; box-shadow: 0 0 0 1.5px var(--porcelain), 0 0 0 2.5px var(--gold-deep); }
  .pin-label { display: none; }
  .legend { gap: 10px 24px; }
  .criteria, .form-grid, .locations, .values { grid-template-columns: minmax(0, 1fr); }
  .article-body { font-size: 1.125rem; }
}

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

@media print {
  .site-header, .site-footer, .cta-band, .nav-toggle, .aside, .toc { display: none; }
  .page-hero { background: none; padding-block: 0 24px; }
  body { font-size: 11pt; }
}

/* Small layout helpers */
.duo-stack { grid-template-columns: minmax(0, 1fr); gap: 48px; }
.panel-link { margin-top: 28px; position: relative; z-index: 1; }
.section-snug { padding-top: clamp(32px, 5vw, 56px); }
.directory-note { margin-top: 28px; }
.nowrap { white-space: nowrap; }
