/* Thai Children Foundation – site styles
   Colours come from the TCF logo. Change them in one place below. */

@font-face {
  font-family: "Montserrat";
  src: url("/fonts/montserrat-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --blue: #0071bc;        /* TCF blue (logo) */
  --blue-dark: #00548c;
  --blue-deep: #0b3553;
  --sky: #8ec5ea;         /* light blue (logo) */
  --sky-tint: #eef6fc;
  --accent: #c93a45;      /* Donate buttons */
  --accent-dark: #a82e38;
  --ink: #1f2d3a;
  --ink-soft: #4a5866;
  --line: #d9e3ec;
  --paper: #ffffff;
  --todo: #fff2a8;

  --font-head: "Montserrat", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans Thai", sans-serif;
  --radius: 10px;
  --wrap: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
}
img { max-width: 100%; height: auto; display: block; }
picture { display: contents; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--blue-dark); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; color: var(--blue-deep); margin: 1.6em 0 0.5em; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 700; margin-top: 0; }
h2 { font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; }
h3 { font-size: 1.25rem; font-weight: 650; }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }
.skip-link { position: absolute; left: -9999px; top: 0; background: var(--blue); color: #fff; padding: 8px 16px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }

/* ---- Preview bar (not shown on the live site) ---- */
.preview-bar { background: #fff8d6; border-bottom: 1px solid #ecd97a; font-size: 0.875rem; padding: 6px var(--gutter); text-align: center; }
.preview-note { display: block; color: #6b5a00; }
.pill { display: inline-block; background: #ffe169; color: #4a3d00; border-radius: 999px; padding: 0 10px; font-size: 0.8em; font-weight: 600; }
mark.todo { background: var(--todo); padding: 0 3px; border-radius: 3px; outline: 1px dashed #c9a800; }

/* ---- Buttons ---- */
.btn { display: inline-block; font-family: var(--font-head); font-weight: 650; font-size: 1rem; text-decoration: none; padding: 0.7em 1.4em; border-radius: 999px; border: 2px solid transparent; line-height: 1.2; transition: background-color .15s, color .15s; }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-dark); color: #fff; }
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-dark); color: #fff; }
.btn-light { background: #fff; color: var(--blue-deep); }
.btn-light:hover { background: var(--sky-tint); color: var(--blue-deep); }
.btn-ghost { border-color: #fff; color: #fff; }
.btn-ghost:hover { background: #fff; color: var(--blue-deep); }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 1.25rem; }
.link-arrow { font-weight: 600; text-decoration: none; }
.link-arrow::after { content: " →"; }
.link-arrow:hover { text-decoration: underline; }

/* ---- Header ---- */
.site-header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.brand img { width: 150px; height: auto; }
.site-nav ul { list-style: none; margin: 0; padding: 0; display: flex; align-items: center; gap: 4px; }
.site-nav a { display: block; padding: 8px 10px; font-family: var(--font-head); font-weight: 600; font-size: 0.93rem; color: var(--blue-deep); text-decoration: none; border-radius: 6px; }
.site-nav a:hover { background: var(--sky-tint); }
.site-nav a[aria-current="page"] { color: var(--blue); box-shadow: inset 0 -3px 0 var(--blue); border-radius: 0; }
.site-nav .nav-donate { margin-left: 8px; }
.site-nav .nav-donate a.btn { color: #fff; padding: 0.6em 1.3em; border-radius: 999px; box-shadow: none; }
.site-nav .nav-donate a.btn:hover { background: var(--accent-dark); }
.nav-toggle { display: none; align-items: center; gap: 8px; background: none; border: 2px solid var(--line); border-radius: 8px; padding: 8px 12px; font: 600 0.95rem var(--font-head); color: var(--blue-deep); cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 18px; height: 2px; background: currentColor; position: relative; }
.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; }

@media (max-width: 1000px) {
  .nav-toggle { display: inline-flex; }
  .site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 8px 20px rgba(11,53,83,.08); }
  .site-nav.is-open { display: block; }
  .site-nav ul { flex-direction: column; align-items: stretch; padding: 8px var(--gutter) 16px; gap: 0; }
  .site-nav a { padding: 12px 8px; border-bottom: 1px solid var(--line); border-radius: 0; }
  .site-nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--blue); }
  .site-nav .nav-donate { margin: 12px 0 0; }
  .site-nav .nav-donate a.btn { text-align: center; }
  .brand img { width: 128px; }
}

/* ---- Home hero ---- */
.hero { position: relative; color: #fff; background: var(--blue-deep); overflow: hidden; }
.hero-img, .hero picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 30% 40%; }
.hero::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(11,53,83,.92) 0%, rgba(11,53,83,.75) 45%, rgba(11,53,83,.2) 100%); }
.hero-inner { position: relative; z-index: 1; padding-top: clamp(56px, 10vw, 120px); padding-bottom: clamp(56px, 10vw, 120px); }
.hero h1 { color: #fff; max-width: 15ch; }
.hero .lead { max-width: 52ch; font-size: clamp(1.05rem, 1.8vw, 1.2rem); color: #e8f2fa; }
@media (max-width: 700px) { .hero::after { background: rgba(11,53,83,.82); } }

/* ---- Inner page header ---- */
.page-hero { position: relative; background: linear-gradient(135deg, var(--blue-deep), var(--blue)); color: #fff; overflow: hidden; }
.page-hero.has-image .page-hero-img, .page-hero.has-image picture img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: .25; }
.page-hero-inner { position: relative; padding-top: clamp(40px, 7vw, 72px); padding-bottom: clamp(40px, 7vw, 72px); }
.page-hero h1 { color: #fff; margin: 0; }
.page-hero .lead { margin: .75rem 0 0; max-width: 60ch; color: #e8f2fa; font-size: 1.15rem; }
.meta { font-size: .9rem; color: var(--ink-soft); margin: 0 0 .4rem; }
.meta-light, .meta-light a { color: #cfe5f5; }

/* ---- Sections ---- */
.section { padding: clamp(48px, 7vw, 80px) 0; }
.section-tint { background: var(--sky-tint); }
.section-title { margin-top: 0; }
.section-more { margin: 1.5rem 0 0; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card-img, .card picture img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.card-body { padding: 20px 22px 24px; }
.card h3 { margin: 0 0 .4rem; }
.card h3 a { color: var(--blue-deep); text-decoration: none; }
.card h3 a:hover { color: var(--blue); text-decoration: underline; }
.card p { margin: 0; color: var(--ink-soft); }
.card .meta { margin-bottom: .4rem; }

.stats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; }
.stat { background: #fff; border-radius: var(--radius); padding: 22px; border-top: 4px solid var(--blue); }
.stat-figure { display: block; font-family: var(--font-head); font-weight: 750; font-size: 2rem; color: var(--blue); line-height: 1.1; }
.stat-label { display: block; margin-top: 6px; color: var(--ink-soft); font-size: .97rem; }

/* ---- Body text ---- */
.content-wrap { padding-top: clamp(32px, 5vw, 56px); padding-bottom: clamp(48px, 7vw, 80px); }
.prose { max-width: 72ch; }
.prose > :first-child { margin-top: 0; }
.prose h2 { padding-top: .2em; }
.prose h3 { color: var(--blue); }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: .35em 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin: 2.5em 0; }
.prose blockquote { margin: 1.5em 0; padding: .5em 1.2em; border-left: 4px solid var(--sky); background: var(--sky-tint); }
.prose figure { margin: 1.5em 0; }
.prose figure img { border-radius: var(--radius); }
.prose figcaption { font-size: .9rem; color: var(--ink-soft); margin-top: .5em; }
.prose img { border-radius: var(--radius); margin: 1.2em 0; }
.prose .btn { margin: .25em .5em .25em 0; }
.table-scroll, .prose table { display: block; overflow-x: auto; }
.prose table { border-collapse: collapse; width: 100%; font-size: .93rem; margin: 1.5em 0; }
.prose th, .prose td { border: 1px solid var(--line); padding: 10px 12px; text-align: left; vertical-align: top; min-width: 140px; }
.prose th { background: var(--sky-tint); }

.callout { background: var(--sky-tint); border-radius: var(--radius); padding: 20px 24px; margin: 1.5em 0; }
.callout > :first-child { margin-top: 0; } .callout > :last-child { margin-bottom: 0; }

/* ---- Bands ---- */
.band-blue { background: var(--blue); color: #fff; }
.band-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; padding-top: 48px; padding-bottom: 48px; }
.band-blue h2 { color: #fff; margin: 0 0 .3em; }
.band-blue p { margin: 0; max-width: 55ch; color: #e8f2fa; }
.band .btn-row { margin: 0; }

/* ---- Footer ---- */
.site-footer { background: var(--blue-deep); color: #d5e5f2; font-size: .95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; padding-top: 48px; padding-bottom: 32px; }
.footer-logo { width: 48px; height: 48px; background: #fff; border-radius: 10px; padding: 4px; }
.footer-name { font-family: var(--font-head); font-weight: 700; color: #fff; font-size: 1.1rem; margin: 12px 0 4px; }
.footer-heading { font-size: 1rem; color: #fff; margin: 0 0 12px; }
.footer-links, .footer-social { list-style: none; margin: 0; padding: 0; }
.footer-links li, .footer-social li { margin: 0 0 6px; }
.footer-base { border-top: 1px solid rgba(255,255,255,.15); padding-top: 16px; padding-bottom: 24px; font-size: .875rem; }
.footer-base p { margin: 0; }

@media print {
  .site-header, .site-footer, .band, .preview-bar { display: none; }
  .page-hero { background: none; color: var(--ink); }
  .page-hero h1 { color: var(--ink); }
}

/* ---- Contact page ---- */
.contact-panel { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 2rem; }
.contact-item { background: var(--sky-tint); border-radius: var(--radius); padding: 22px 24px; }
.contact-item h2 { font-size: 1.15rem; margin: 0 0 .4rem; }
.contact-item h2:not(:first-child) { margin-top: 1.2rem; }
.contact-item p { margin: 0 0 .6rem; }
.contact-item address { font-style: normal; }
