/* =====================================================================
   METTA FOUNDATIONS - GLOBAL STYLES
   Fonts, colours and spacing are defined once in :root below.
   Change a value there and the whole site updates.
   ===================================================================== */

:root {
  /* Fonts (loaded from Google Fonts in each page <head>) */
  --font-heading: "Fredoka", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;

  /* Type scale (fluid: scales smoothly from phone to desktop) */
  --fs-body: 1.0625rem;
  --fs-small: 0.9375rem;
  --fs-h1: clamp(2.1rem, 1.5rem + 3vw, 3.5rem);
  --fs-h2: clamp(1.6rem, 1.3rem + 1.5vw, 2.25rem);
  --fs-h3: clamp(1.2rem, 1.1rem + 0.5vw, 1.4rem);

  /* Colours */
  --ink: #16253b;
  --muted: #475a70;
  --teal: #0d7a6b;
  --teal-dark: #0a5c51;
  --sun: #ffc93c;
  --sun-soft: #fff4d1;
  --sky: #e8f3f6;
  --coral: #e4572e;
  --paper: #ffffff;
  --line: #d6e2e8;

  /* Layout */
  --container: 70rem;
  --gutter: clamp(1rem, 4vw, 2rem);
  --section-y: clamp(3rem, 7vw, 5.5rem);
  --radius: 14px;
  --radius-lg: 24px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: 1.65;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal-dark); text-underline-offset: 0.18em; }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--coral); outline-offset: 3px; border-radius: 4px; }

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: 1.2;
  margin: 0 0 0.6em;
  color: var(--ink);
  letter-spacing: 0;
}
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
p { margin: 0 0 1.1em; }
ul, ol { padding-left: 1.25rem; margin: 0 0 1.1em; }
li { margin-bottom: 0.35em; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: #fff; padding: 0.6rem 1rem; border-radius: var(--radius); z-index: 100; }
.skip-link:focus { top: 0.75rem; color: #fff; }
.icon { width: 1.5rem; height: 1.5rem; flex: none; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  font: 600 1rem/1.2 var(--font-heading);
  padding: 0.85rem 1.4rem; min-height: 3rem;
  border-radius: var(--radius); border: 2px solid transparent;
  text-decoration: none; cursor: pointer;
  background: var(--teal); color: #fff;
}
.btn:hover { background: var(--teal-dark); color: #fff; }
.btn-sun { background: var(--sun); color: var(--ink); }
.btn-sun:hover { background: #ffd86b; color: var(--ink); }
.btn-outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---------- Header & navigation ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--paper); border-bottom: 1px solid var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 4.25rem; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: 0.65rem; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; }
.brand-name { font-family: var(--font-heading); font-weight: 600; font-size: 1.25rem; }

.nav-toggle { width: 3rem; height: 3rem; border: 2px solid var(--ink); background: transparent; border-radius: var(--radius); cursor: pointer; display: grid; place-items: center; }
.bars, .bars::before, .bars::after { display: block; width: 1.3rem; height: 2px; background: var(--ink); border-radius: 2px; transition: transform 0.2s, opacity 0.2s; }
.bars { position: relative; }
.bars::before, .bars::after { content: ""; position: absolute; left: 0; }
.bars::before { top: -7px; }
.bars::after { top: 7px; }
.nav-open .bars { background: transparent; }
.nav-open .bars::before { top: 0; transform: rotate(45deg); }
.nav-open .bars::after { top: 0; transform: rotate(-45deg); }

/* Mobile / tablet: slide-down panel */
.site-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--paper); border-bottom: 1px solid var(--line); max-height: calc(100vh - 4.25rem); overflow-y: auto; padding: 0.5rem var(--gutter) 1.25rem; }
.nav-open .site-nav { display: block; }
.nav-list, .sub-menu { list-style: none; margin: 0; padding: 0; }
.nav-item { margin: 0; border-bottom: 1px solid var(--line); position: relative; }
.nav-link, .sub-menu a { display: block; padding: 0.85rem 0; color: var(--ink); text-decoration: none; font-weight: 600; }
.nav-link:hover, .sub-menu a:hover { color: var(--teal); }
.nav-item.is-active > .nav-link, .sub-menu a[aria-current="page"] { color: var(--teal-dark); box-shadow: inset 0 -3px 0 var(--sun); }
.sub-toggle { display: none; }
.sub-menu { padding: 0 0 0.6rem 1rem; }
.sub-menu a { font-weight: 400; padding: 0.55rem 0; }
.nav-item:last-child { border-bottom: 0; }
.nav-cta { background: var(--sun); color: var(--ink) !important; text-align: center; border-radius: var(--radius); margin-top: 0.75rem; font-family: var(--font-heading); box-shadow: none !important; }
.nav-cta:hover { background: #ffd86b; }

/* Desktop: horizontal bar with dropdown */
@media (min-width: 62em) {
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; border: 0; padding: 0; max-height: none; overflow: visible; background: transparent; }
  .nav-list { display: flex; align-items: center; gap: 0.25rem; }
  .nav-item { border: 0; display: flex; align-items: center; }
  .nav-link { padding: 0.6rem 0.8rem; border-radius: 10px; }
  .nav-item.is-active > .nav-link { box-shadow: none; background: var(--sky); }
  .nav-cta { margin: 0 0 0 0.5rem; padding: 0.6rem 1.1rem; }
  .sub-toggle { display: grid; place-items: center; width: 1.75rem; height: 2rem; margin-left: -0.5rem; border: 0; background: transparent; color: var(--ink); cursor: pointer; border-radius: 8px; }
  .sub-toggle .icon { width: 1rem; height: 1rem; transition: transform 0.2s; }
  .sub-open > .sub-toggle .icon, .has-sub:hover > .sub-toggle .icon { transform: rotate(180deg); }
  .sub-menu { display: none; position: absolute; top: 100%; left: 0; min-width: 16rem; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 0.5rem; z-index: 60; }
  .has-sub:hover > .sub-menu, .has-sub:focus-within > .sub-menu, .has-sub.sub-open > .sub-menu { display: block; }
  .sub-menu a { padding: 0.55rem 0.75rem; border-radius: 8px; box-shadow: none !important; }
  .sub-menu a:hover, .sub-menu a[aria-current="page"] { background: var(--sky); }
}

/* ---------- Page hero (inner pages) ---------- */
.page-hero { background: var(--sky); padding-block: clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--line); }
.page-hero h1 { margin-bottom: 0.3em; }
.page-hero p { max-width: 40rem; color: var(--muted); font-size: 1.15rem; margin: 0; }
.crumbs { font-size: var(--fs-small); margin: 0 0 1rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.section-tint { background: var(--sky); }
.section-sun { background: var(--sun-soft); }
.section-head { max-width: 40rem; margin-bottom: 2rem; }
.section-head p { color: var(--muted); }
.prose { max-width: 44rem; }
.prose h2 { margin-top: 1.6em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose ul.ticks { list-style: none; padding: 0; }
.prose ul.ticks li { padding-left: 1.9rem; position: relative; }
.prose ul.ticks li::before { content: ""; position: absolute; left: 0; top: 0.5em; width: 1.05rem; height: 1.05rem; border-radius: 50%; background: var(--teal); }
.prose ul.ticks li::after { content: ""; position: absolute; left: 0.37rem; top: calc(0.5em + 0.2rem); width: 0.3rem; height: 0.5rem; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(40deg); }
.two-col { display: grid; gap: 2rem 3rem; grid-template-columns: 1fr; align-items: start; }
@media (min-width: 52em) { .two-col { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); } .two-col.even { grid-template-columns: 1fr 1fr; } }

/* ---------- Home hero: block tiles ---------- */
.hero { background: var(--sun-soft); padding-block: clamp(2.5rem, 7vw, 5.5rem); overflow: hidden; }
.hero-inner { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1fr; }
@media (min-width: 52em) { .hero-inner { grid-template-columns: 1.15fr 1fr; } }
.hero h1 { font-size: clamp(2.2rem, 1.4rem + 3.6vw, 4rem); max-width: 14em; }
.hero p { font-size: 1.2rem; max-width: 34rem; color: var(--muted); }
.tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(0.5rem, 2vw, 0.9rem); max-width: 26rem; margin-inline: auto; width: 100%; }
.tile { aspect-ratio: 1; border-radius: var(--radius-lg); display: grid; place-items: center; font-family: var(--font-heading); font-weight: 600; font-size: clamp(1rem, 0.7rem + 1.6vw, 1.5rem); color: var(--ink); padding: 0.25rem; text-align: center; }
.tile.t1 { background: var(--teal); color: #fff; border-radius: var(--radius-lg) var(--radius-lg) 4px var(--radius-lg); }
.tile.t2 { background: var(--sun); transform: rotate(-4deg); }
.tile.t3 { background: #fff; border: 2px solid var(--ink); }
.tile.t4 { background: var(--coral); color: #fff; transform: rotate(3deg); }
.tile.t5 { background: var(--sky); border-radius: 50%; }
.tile.t6 { background: var(--ink); color: var(--sun); border-radius: 4px var(--radius-lg) var(--radius-lg) var(--radius-lg); }
.tile.t7 { background: #fff; border: 2px solid var(--teal); color: var(--teal-dark); }
.tile.t8 { background: var(--sun); border-radius: var(--radius-lg) 4px var(--radius-lg) var(--radius-lg); }
.tile.t9 { background: var(--teal-dark); color: #fff; transform: rotate(-3deg); }

/* ---------- Cards & grids ---------- */
.grid { display: grid; gap: 1.1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 16.5rem), 1fr)); }
.card { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 1.5rem; display: flex; flex-direction: column; align-items: flex-start; }
.card h3 { margin-bottom: 0.4em; }
.card p { color: var(--muted); font-size: var(--fs-small); margin-bottom: 1rem; }
.card .badge { margin-top: auto; }
.card-link { text-decoration: none; color: inherit; transition: border-color 0.15s, background 0.15s; }
.card-link:hover { border-color: var(--teal); background: #fbfeff; color: inherit; }
.card-link:hover h3 { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; text-underline-offset: 4px; }
.card-icon { width: 3rem; height: 3rem; border-radius: 12px; display: grid; place-items: center; background: var(--sun); color: var(--ink); margin-bottom: 1rem; }
.card-icon.alt { background: var(--sky); color: var(--teal-dark); }
.card-icon .icon { width: 1.6rem; height: 1.6rem; }
.badge { display: inline-block; font: 600 0.85rem/1 var(--font-heading); padding: 0.4rem 0.7rem; border-radius: 999px; background: var(--sky); color: var(--teal-dark); }
.section-tint .card { border-color: transparent; }

.pillar { border-top: 4px solid var(--sun); padding-top: 1rem; }
.pillar:nth-child(2) { border-color: var(--teal); }
.pillar:nth-child(3) { border-color: var(--coral); }
.pillar p { color: var(--muted); }

/* ---------- Facts panel (dates, fees, ages) ---------- */
.facts { background: var(--sun-soft); border: 1.5px solid #f1dc9a; border-radius: var(--radius); padding: 1.4rem 1.5rem; }
.facts h2, .facts h3 { font-size: 1.25rem; margin-bottom: 0.8rem; }
.facts dl { margin: 0; display: grid; gap: 0.2rem 1rem; grid-template-columns: auto 1fr; }
.facts dt { font-weight: 700; }
.facts dd { margin: 0; }
.facts .btn { margin-top: 1.2rem; width: 100%; }

/* ---------- Fixed-ratio image slot ---------- */
.media { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--sky); margin: 0 0 1.5rem; }
.media img { width: 100%; height: 100%; object-fit: cover; }
.media figcaption { display: none; }

/* ---------- Call-to-action band ---------- */
.cta-band { background: var(--ink); color: #fff; padding-block: clamp(2.5rem, 6vw, 4rem); }
.cta-band h2 { color: #fff; margin-bottom: 0.4em; }
.cta-band p { color: #d5e0ea; max-width: 36rem; }
.cta-band a:not(.btn) { color: var(--sun); }
.cta-band .btn-outline { color: #fff; border-color: #fff; }
.cta-band .btn-outline:hover { background: #fff; color: var(--ink); }

/* ---------- Forms ---------- */
.form { display: grid; gap: 1.1rem; max-width: 36rem; }
.field label, .field legend { display: block; font-weight: 700; margin-bottom: 0.35rem; padding: 0; }
.field .hint { font-weight: 400; color: var(--muted); font-size: var(--fs-small); }
.field input, .field select, .field textarea {
  width: 100%; font: inherit; font-size: 1rem; /* 16px stops iOS zoom-on-focus */
  padding: 0.75rem 0.9rem; min-height: 3rem; color: var(--ink);
  background: #fff; border: 2px solid #9fb3c1; border-radius: var(--radius);
}
.field textarea { min-height: 8rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 3px solid var(--coral); outline-offset: 1px; border-color: var(--ink); }
.field fieldset { border: 0; padding: 0; margin: 0; }
.check { display: flex; gap: 0.7rem; align-items: flex-start; font-weight: 400; }
.check input { width: 1.25rem; height: 1.25rem; min-height: 0; margin-top: 0.25rem; flex: none; accent-color: var(--teal); }
.form-note { color: var(--teal-dark); font-weight: 600; margin: 0; min-height: 1.5em; }
.contact-list { list-style: none; padding: 0; }
.contact-list li { display: flex; gap: 0.75rem; align-items: center; }
.contact-list .icon { color: var(--teal); }

/* ---------- Footer ---------- */
.site-footer { background: var(--sky); border-top: 1px solid var(--line); padding-top: 3rem; }
.footer-grid { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 40em) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 62em) { .footer-grid { grid-template-columns: 1.4fr 1fr 1.2fr 1.3fr; } }
.footer-brand p { color: var(--muted); max-width: 20rem; margin-top: 0.8rem; }
.footer-h { font-size: 1.1rem; margin-bottom: 0.7rem; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 0.5rem; }
.site-footer a { color: var(--ink); }
.footer-bottom { margin-top: 2rem; padding-block: 1.25rem; border-top: 1px solid var(--line); font-size: var(--fs-small); color: var(--muted); }
.footer-bottom p { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
@media print { .site-header, .site-footer, .cta-band, .btn { display: none !important; } }
