/* esolresources: a light, book-like site. Source Sans 3 throughout: a clear humanist sans, like the British Council worksheets. */
:root {
  color-scheme: light;
  --paper: #fbfaf6;
  --white: #ffffff;
  --ink: #1d2320;
  --muted: #5d6661;
  --line: #e2e0d8;
  --green: #1f5a4a;
  --green-soft: #e8f0ec;
  --gold: #d9a531;
  --gold-soft: #fbf1d9;
  --good: #2e7d32; --good-soft: #e5f3e5;
  --bad: #b3261e; --bad-soft: #fbe6e3;
  --serif: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --sans: "Source Sans 3", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-weight: 400; font-size: 1.08rem; line-height: 1.6; }
.wrap { max-width: 68rem; margin: 0 auto; padding-left: max(18px, env(safe-area-inset-left, 0px)); padding-right: max(18px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--serif); font-weight: 700; line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -0.015em; }
p { margin: 0; }
strong, b { font-weight: 600; }
a { color: var(--green); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }
button { font: inherit; }

/* Header */
.site-head { background: var(--white); border-bottom: 1px solid var(--line); }
.site-head .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.6rem 2rem; padding-block: 1.1rem; }
.brand { font-family: var(--serif); font-size: 1.45rem; font-weight: 800; color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.brand span { color: var(--green); font-weight: 400; }
.nav { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.2rem 1.6rem; font-size: 0.95rem; }
.nav a { color: var(--ink); text-decoration: none; padding-block: 0.2rem; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--line); }
.nav a[aria-current="page"] { border-bottom-color: var(--gold); font-weight: 600; }

/* Page intro */
.page-intro { padding-block: 3.5rem 2.5rem; display: grid; gap: 1rem; }
.kicker { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.12em; color: var(--green); font-weight: 600; }
.page-intro h1 { font-size: clamp(2.1rem, 5vw, 3.3rem); max-width: 20ch; }
.page-intro .lede { font-size: 1.2rem; color: var(--muted); max-width: 40rem; }
.page-intro .intro-note { font-size: 1rem; color: var(--muted); max-width: 40rem; padding-left: 0.9rem; border-left: 3px solid var(--gold); }

section { padding-block: 2.5rem; }
.rule { border-top: 1px solid var(--line); }
h2.sec { font-size: clamp(1.5rem, 3vw, 1.9rem); margin-bottom: 0.6rem; }
.sec-lede { color: var(--muted); max-width: 42rem; margin-bottom: 1.6rem; }

/* Home routes */
.routes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; }
@media (min-width: 560px) { .routes { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .routes { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.route { background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 1.5rem; display: flex; flex-direction: column; gap: 0.6rem; text-decoration: none; color: var(--ink); }
.route:hover { border-color: var(--green); }
.route h2 { font-size: 1.45rem; }
.route p { color: var(--muted); font-size: 0.97rem; }
.route .go { margin-top: auto; padding-top: 0.6rem; color: var(--green); font-weight: 600; }
.route .who { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }

.about { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr); gap: 2rem; }
.about .text { display: grid; gap: 1rem; max-width: 42rem; }
@media (max-width: 680px) { .about { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; } }

/* ESD goals */
.goals { display: grid; grid-template-columns: repeat(auto-fill, minmax(14.5rem, 1fr)); gap: 0.9rem; }
.goal { background: var(--white); border: 1px solid var(--line); border-radius: 4px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.goal .num { background: var(--c); color: #fff; padding: 0.7rem 1rem; display: flex; align-items: baseline; gap: 0.6rem; }
.goal .num b { font-family: var(--serif); font-size: 1.9rem; font-weight: 800; line-height: 1; }
.goal .num span { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.1em; opacity: 0.9; }
.goal .body { padding: 0.9rem 1rem 1rem; display: grid; gap: 0.35rem; }
.goal h3 { font-size: 1.08rem; }
.goal p { font-size: 0.88rem; color: var(--muted); }
.meta { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.4rem; }
.tag { font-size: 0.75rem; padding: 0.1rem 0.5rem; border-radius: 3px; background: var(--gold-soft); color: #5a4307; }
.tag.soon { background: transparent; border: 1px dashed var(--line); color: var(--muted); }

.notes { display: grid; grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); gap: 1.5rem; }
.notes h3 { font-size: 1.1rem; margin-bottom: 0.3rem; }
.notes p { color: var(--muted); font-size: 0.97rem; }

/* TBL cycle */
.cycle { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 4px; background: var(--white); overflow: hidden; counter-reset: stage; }
.cycle li { padding: 1.2rem; border-right: 1px solid var(--line); display: grid; gap: 0.3rem; align-content: start; counter-increment: stage; }
.cycle li:last-child { border-right: 0; }
.cycle li::before { content: "Stage " counter(stage); font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--green); font-weight: 600; }
.cycle h3 { font-size: 1.1rem; }
.cycle p { font-size: 0.92rem; color: var(--muted); }
@media (max-width: 760px) { .cycle li { border-right: 0; border-bottom: 1px solid var(--line); } .cycle li:last-child { border-bottom: 0; } }
.empty-note { background: var(--white); border: 1px dashed var(--line); border-radius: 4px; padding: 1.5rem; color: var(--muted); }

/* Footer */
.site-foot { border-top: 1px solid var(--line); background: var(--white); color: var(--muted); font-size: 0.88rem; }
.site-foot .wrap { padding-block: 1.6rem 2.4rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }

/* Practice tool */
.step { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; margin-bottom: 0.6rem; }
.choices { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1.8rem; }
.games { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.6rem; margin-bottom: 1.8rem; }
.choice { background: var(--white); color: var(--ink); border: 2px solid var(--line); border-radius: 6px; padding: 0.75rem 1.1rem; cursor: pointer; text-align: left; display: grid; gap: 0.1rem; min-width: 0; font-weight: 400; }
.choice strong { font-weight: 600; font-size: 1.05rem; }
.choice small { color: var(--muted); font-size: 0.85rem; }
.choice:hover { border-color: var(--green); }
.choice[aria-pressed="true"] { border-color: var(--green); background: var(--green-soft); }
.board { background: var(--white); border: 1px solid var(--line); border-radius: 6px; padding: 1.4rem; min-height: 16rem; display: grid; gap: 1rem; align-content: start; }
.board-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem; font-size: 0.92rem; color: var(--muted); }
.board-head b { color: var(--ink); }
.task { font-size: 1.12rem; }
.prompt { font-size: 1.45rem; font-weight: 400; }
.prompt .pic { font-size: 3rem; display: block; line-height: 1.1; }
.prompt.hint { font-size: 1.15rem; font-weight: 400; }
.gap { display: inline-block; min-width: 4.5rem; border-bottom: 3px solid var(--gold); }
.tiles { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.tile { background: var(--gold-soft); color: #4a3806; border: 2px solid var(--gold); border-radius: 6px; padding: 0.5rem 0.85rem; font-size: 1.12rem; font-weight: 600; cursor: pointer; min-width: 2.8rem; }
.tile:disabled { opacity: 0.3; cursor: default; }
.answer { min-height: 3.3rem; border: 2px dashed var(--line); border-radius: 6px; padding: 0.5rem 0.75rem; display: flex; align-items: center; font-size: 1.25rem; font-weight: 400; letter-spacing: 0.05em; }
.answer.words { letter-spacing: 0; }
.answer:empty::before { content: attr(data-empty); color: var(--muted); font-size: 1rem; letter-spacing: 0; }
.row { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.btn { border: 2px solid var(--green); background: var(--green); color: #fff; border-radius: 6px; padding: 0.5rem 1.1rem; font-weight: 600; cursor: pointer; }
.btn.plain { background: var(--white); color: var(--green); }
.opts { display: grid; gap: 0.5rem; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); }
.opt, .m { background: var(--white); color: var(--ink); border: 2px solid var(--line); border-radius: 6px; padding: 0.65rem 0.75rem; cursor: pointer; text-align: left; min-width: 0; font-weight: 400; }
.opt { font-size: 1.08rem; text-align: center; }
.opt:hover:not(:disabled), .m:hover:not(:disabled) { border-color: var(--green); }
.m.word { font-weight: 600; font-size: 1.05rem; }
.m.pic { font-size: 2rem; text-align: center; padding: 0.3rem; }
.m[aria-pressed="true"] { border-color: var(--gold); background: var(--gold-soft); }
.m:disabled, .opt:disabled { cursor: default; }
.right { background: var(--good-soft) !important; border-color: var(--good) !important; }
.wrong { background: var(--bad-soft) !important; border-color: var(--bad) !important; }
.match { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 0.75rem; }
.match .col { display: grid; gap: 0.5rem; align-content: start; }
.feedback { font-weight: 400; min-height: 1.5rem; }
.feedback.ok { color: var(--good); }
.feedback.no { color: var(--bad); }
.done { text-align: center; display: grid; gap: 0.8rem; justify-items: center; padding-block: 1.5rem; }
.done .big { font-family: var(--serif); font-size: 2rem; font-weight: 800; }
.idle { color: var(--muted); text-align: center; align-self: center; }

/* Menu button on small screens (made by the page script) */
.menu-btn { display: none; align-items: center; gap: 0.45rem; min-height: 44px; padding: 0 0.9rem; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--ink); font-weight: 600; cursor: pointer; }
@media (max-width: 640px) {
  .site-head .wrap { padding-block: 0.6rem; }
  .menu-btn { display: inline-flex; }
  .site-head nav { flex-basis: 100%; display: none; }
  .site-head.open nav { display: block; }
  .site-head .nav { flex-direction: column; gap: 0; font-size: 1.05rem; }
  .site-head .nav a { display: flex; align-items: center; min-height: 48px; border-bottom: 1px solid var(--line); }
  .site-head .nav li:last-child a { border-bottom: 0; }
  .site-head .nav a[aria-current="page"] { border-bottom-color: var(--line); box-shadow: inset 4px 0 0 var(--gold); padding-left: 0.8rem; }
}
/* Bigger tap areas for links that are buttons */
.crumbs button { min-height: 44px; padding: 0 0.15rem; }
.chip { min-height: 44px; }
/* Large text: let long words and buttons wrap instead of pushing the page sideways */
h1, h2, h3, strong, .btn { overflow-wrap: anywhere; }
.btn { max-width: 100%; white-space: normal; text-align: center; }
/* Focus rings only when someone is using the keyboard */
html[data-input="pointer"] :focus-visible:not(input):not(textarea):not(select) { outline: none; }

/* Community photos */
.hero { grid-template-columns: minmax(0, 1fr); align-items: center; gap: 2rem; }
.hero-text { display: grid; gap: 1rem; }
@media (min-width: 860px) { .hero { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 3rem; } }
.hero-photo, .page-banner, .photo-grid figure { margin: 0; }
.hero-photo img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: 6px; }
.route { overflow: hidden; }
.route-photo { display: block; width: calc(100% + 3rem); max-width: none; margin: -1.5rem -1.5rem 0.4rem; height: auto; aspect-ratio: 16 / 10; object-fit: cover; background: var(--line); }
.page-banner { margin-bottom: 2rem; }
.page-banner img { display: block; width: 100%; height: auto; aspect-ratio: 21 / 9; object-fit: cover; object-position: center 35%; border-radius: 6px; }
@media (max-width: 600px) { .page-banner img { aspect-ratio: 16 / 10; } }
.photo-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.1rem; }
@media (min-width: 520px) { .photo-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 860px) { .photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.photo-grid img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 30%; border-radius: 6px; background: var(--line); }
.photo-grid figcaption { font-size: 0.92rem; color: var(--muted); padding-top: 0.45rem; }

/* About photos */
.about-side { display: grid; gap: 1rem; align-content: start; }
.about-portrait, .about-photos figure { margin: 0; }
.about-portrait img { display: block; width: 100%; max-width: 15rem; height: auto; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 6px; }
.about-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.8rem; margin-top: 0.6rem; }
.about-photos img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; object-position: center 30%; border-radius: 6px; background: var(--line); }
@media (max-width: 680px) { .about-portrait img { max-width: 11rem; } }
.esd-photos { margin-top: 2rem; }
