:root {
  color-scheme: light;
  --ink: #193831;
  --body: #30483e;
  --muted: #52665d;
  --green: #185643;
  --paper: #f6f8f2;
  --white: #fff;
  --line: #dce5d9;
  --lime: #def28f;
  --yellow: #ffdc70;
  --round: 22px;
  font-family: "Trebuchet MS", system-ui, sans-serif;
  color: var(--body);
  background: var(--paper);
  font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; line-height: 1.65; overflow-wrap: anywhere; }
img { max-width: 100%; height: auto; vertical-align: middle; }
a { color: #155a45; text-underline-offset: .18em; }
a:hover { color: #113b31; }
a:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid #916100;
  outline-offset: 4px;
}
h1, h2, h3, h4, h5 { color: var(--ink); line-height: 1.16; margin: 0 0 .65em; text-wrap: balance; }
h1 { font-weight: 850; font-size: clamp(2rem, 5vw, 3.7rem); letter-spacing: -.045em; }
h2 { font-size: clamp(1.4rem, 3vw, 2.05rem); letter-spacing: -.035em; margin-top: 1.35em; }
h3 { font-size: clamp(1.16rem, 2.35vw, 1.6rem); letter-spacing: -.025em; margin-top: 1em; }
h4 { font-size: 1.1rem; margin-top: 1em; }
h5 { font-size: 1rem; }
p, ul, ol { margin: 0 0 1.05em; }
ul, ol { padding-inline-start: 1.4em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 1.9rem 0; }
button { font: inherit; color: inherit; cursor: pointer; }
.shell { width: min(calc(100% - 40px), 1000px); margin-inline: auto; }

.skip { position: fixed; top: 0; left: 1rem; z-index: 4; padding: .7rem; background: white; transform: translateY(-120%); }
.skip:focus { transform: translateY(0); }
.site-header { background: #fff; border-bottom: 1px solid var(--line); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: 1rem; }
.brand { display: inline-flex; flex: none; align-items: center; color: var(--ink); text-decoration: none; }
.site-logo { display: block; width: 48px; height: 48px; border-radius: 12px; object-fit: cover; }
.brand-icon { display: grid; place-items: center; width: 39px; height: 39px; border-radius: 12px; background: var(--green); color: var(--lime); font-size: 1.6rem; }
.brand-accent { color: #2d6b53; }
.site-search { position: relative; flex: 1 1 18rem; width: min(50vw, 500px); max-width: 50%; }
.site-search input[type="search"] { width: 100%; min-height: 42px; padding: .6rem 2.8rem .6rem .85rem; border: 1px solid #aebfb7; border-radius: 11px; background: #f8fbf7; color: var(--ink); font: inherit; }
.site-search button { position: absolute; top: 50%; right: .35rem; display: grid; place-items: center; width: 34px; height: 34px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: var(--green); transform: translateY(-50%); }
.site-search button:hover { background: #e7f3db; }
.site-search svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.visually-hidden { position: absolute!important; width: 1px!important; height: 1px!important; padding: 0!important; margin: -1px!important; overflow: hidden!important; clip: rect(0,0,0,0)!important; white-space: nowrap!important; border: 0!important; }
.site-nav { display: flex; flex: none; flex-wrap: nowrap; gap: .08rem; }
.site-nav a { border-radius: 9px; color: var(--ink); font-size: .88rem; font-weight: 750; padding: .55rem .72rem; text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current], .site-nav .section-active { background: #e7f3db; }
.nav-toggle { display: none; flex: none; width: 42px; height: 42px; padding: 9px; border: 1px solid #aebfb7; border-radius: 10px; background: #fff; }
.nav-toggle span { display: block; height: 2px; margin: 4px 0; border-radius: 2px; background: var(--ink); }
main.shell { padding-top: clamp(1.15rem, 4vw, 2.65rem); }
.hero { overflow: hidden; display: grid; align-items: center; padding: clamp(1.45rem, 5.6vw, 4rem); border-radius: 30px; background: #e6f2d5; }
.home-hero { grid-template-columns: 1.5fr 1fr; color: #edf8e8; background: #173b35; min-height: 390px; gap: 1.4rem; }
.home-hero h1 { color: white; font-size: clamp(2.6rem, 7.4vw, 4.8rem); }
.home-hero h1 em { color: var(--lime); font-style: normal; }
.hero-copy p:not(.eyebrow) { max-width: 48ch; font-size: clamp(1rem, 1.8vw, 1.15rem); }
.eyebrow { color: var(--lime); font-size: .77rem; letter-spacing: .14em; font-weight: 800; margin-bottom: 1rem; }
.hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; }
.button, .bluebutton, .button6 {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 43px;
  margin: .2rem .2rem .2rem 0; padding: .42rem .88rem; border: 1px solid transparent;
  border-radius: 10px; background: var(--green); color: white !important; text-decoration: none; font-size: .92rem; font-weight: 750;
}
.button:hover, .bluebutton:hover, .button6:hover { background: #103e31; }
.button.primary { background: var(--lime); color: var(--ink) !important; }
.button.primary:hover { background: #eff8b9; }
.button.secondary { background: transparent; color: var(--ink) !important; border-color: #587268; }
.library-list { display: grid; gap: 1.25rem; margin: 1.5rem 0 3rem; }
.library-book { display: grid; grid-template-columns: minmax(130px, 190px) 1fr; gap: 1.5rem; align-items: start; padding: 1.25rem; border: 1px solid #cfdccd; border-radius: 14px; background: white; box-shadow: var(--shadow); }
.library-book img { width: 100%; max-height: 250px; object-fit: contain; border-radius: 8px; background: #f4f7f2; }
.library-book h2 { margin-top: 0; }
.library-author { font-weight: 700; color: #476158; }
.library-message { padding: 1rem; border-radius: 10px; background: #edf4e7; }
.library-error,.ebook-availability { color: #8b251d; background: #fff1f0; }
.ebook-availability { padding: .75rem 1rem; border-left: 4px solid #b42318; }
@media(max-width:600px){.library-book{grid-template-columns:1fr}.library-book img{max-width:220px;margin:auto}}
.home-hero .button.secondary { color: white !important; border-color: #90a9a1; }
.home-hero .button.secondary:hover { background: #2b5149; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 270px; }
.mascot { display: grid; place-items: center; width: min(80%, 265px); aspect-ratio: 1; border-radius: 50%; background: #fff; box-shadow: 0 0 0 13px #42645a, 0 0 0 14px #668477; overflow: hidden; }
.mascot img { width: 80%; height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.symbol { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 16px; position: absolute; z-index: 1; color: var(--ink); background: var(--yellow); font-size: 2rem; font-weight: 800; transform: rotate(-10deg); }
.multiply { inset: 8% auto auto 0; }
.plus { inset: 5% 0 auto auto; background: #c9e896; transform: rotate(10deg); }
.divide { inset: auto 1% 1% auto; background: #c7e8ec; }
.inner-hero { grid-template-columns: minmax(0,1fr) auto; gap: 1rem; min-height: 190px; margin-bottom: 1.5rem; }
.inner-hero p { margin-bottom: 0; max-width: 56ch; }
.inner-hero > span { font-size: clamp(2.2rem,9vw,5rem); color: #386450; background: #f6f9e8; border-radius: 21px; display: grid; place-items: center; width: 1.45em; height: 1.45em; transform: rotate(8deg); }
.explore { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); margin-block: 1rem 2.4rem; gap: .8rem; }
.explore a { background: white; border: 1px solid var(--line); display: grid; align-content: start; gap: .2rem; min-width: 0; padding: 1rem; border-radius: 16px; text-decoration: none; color: var(--ink); }
.explore a:hover { border-color: #628775; background: #f7fcf1; }
.tile-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: #e5f5d5; margin-bottom: .3rem; }
.explore a:nth-child(2) .tile-icon { background: #fff0c4; }
.explore a:nth-child(3) .tile-icon { background: #d9eeef; }
.explore a:nth-child(4) .tile-icon { background: #f1e6f8; }
.explore small { color: var(--muted); line-height: 1.4; }
.section-heading { margin: 1.6rem 0 .8rem; }
.breadcrumb { margin-bottom: 1rem; font-size: .88rem; color: var(--muted); display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; }
.breadcrumb-home { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 7px; color: var(--green); }
.breadcrumb-home:hover { background: #e7f3db; }
.breadcrumb-home svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

.content { width: min(100%, 760px); margin-inline: auto; }
body[class="page-home"] .content, .page-math .content:has(.book-grid), .page-articles .content:has(.story-card) { width: 100%; }
.content:not(:has(.story-card, .book-grid)) { border: 1px solid var(--line); border-radius: var(--round); background: white; padding: clamp(1rem,3.2vw,2.25rem); }
.content > div { max-width: 100% !important; }
.content > header:empty { display: none; }
.story-card { display: flow-root; margin: 0 0 .85rem; border: 1px solid var(--line); border-radius: var(--round); background: #fff; padding: clamp(1rem,3.2vw,1.75rem); }
.story-card > h3:first-child, .story-card > h4:first-child, .book-card h3 { margin-top: 0; }
.story-card > p, .story-card > ul, .story-card > ol { max-width: 72ch; }
.story-card img { border-radius: 10px; }
.book-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.book-card { border: 1px solid var(--line); border-radius: var(--round); padding: 1rem; background: white; min-width: 0; display: grid; grid-template-columns: minmax(0,.68fr) minmax(0,1.32fr); grid-template-rows: auto 1fr; gap: .4rem 1rem; }
.book-card-cover { grid-row: 1 / 3; align-self: start; background: #edf4e9; border-radius: 13px; padding: .6rem; display: grid; place-items: center; }
.book-card-cover img { border-radius: 4px; width: 100% !important; max-width: 160px; }
.book-card-title, .book-card-info { min-width: 0; }
.book-card-title :is(h2,h3,h4,h5) { margin: 0 0 .25rem; font-size: 1.22rem; }
.book-card-info { font-size: .94rem; }
.book-card-info p { margin-bottom: .7em; }
.book-card-info .button6 { margin-top: .4rem; }
.book-detail img, .content #content img { border-radius: 6px; }
.content iframe { display: block; border: 0; border-radius: 13px; width: 100% !important; max-width: 680px; height: auto !important; aspect-ratio: 16/9; margin: .8rem auto 1.25rem; background: #eef2e8; }
.content iframe.calendar { min-height: 420px; }
.content [style*="float"] { max-width: min(48%, 260px) !important; }
.content img[align="right"] { float: right; max-width: min(43%,220px); margin: .1rem 0 .6rem 1rem; }
.content img[align="left"] { float: left; max-width: min(43%,220px); margin: .1rem 1rem .6rem 0; }
.w3-row { display: flow-root; }
.w3-row:has(> .w3-half), .w3-row:has(> .w3-quarter) { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; }
.w3-row:has(> .w3-quarter) { grid-template-columns: repeat(4,minmax(0,1fr)); margin-block: 1rem; }
.w3-row > :is(.w3-half,.w3-quarter) { float: none !important; width: auto !important; min-width: 0; max-width: 100%; }
.w3-row > .w3-quarter { padding: .65rem !important; border-radius: 12px; border: 1px solid var(--line); background: white; text-align: center; }
.w3-row > .w3-quarter img { width: auto !important; max-height: 155px; }
.w3-center, [align="center"] { text-align: center; }
.content .w3-row img.fa { width: 44px !important; margin: .2rem; }
.red, .bred { color: #a72e30; }
.bred { font-weight: 800; }
.bubble { padding: .8rem 1rem; background: #eff5e8; border-radius: 12px; }
.missing-photo { display: block; padding: .65rem; background: #eef3ec; border-radius: 10px; color: var(--muted); }
.table-scroll { overflow-x: auto; max-width: 100%; margin: .85rem 0; }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { border-bottom: 1px solid var(--line); padding: .65rem; }
th { background: #e7f2e3; color: var(--ink); }
.media-carousel { margin: 2rem auto; max-width: 760px; padding: clamp(.85rem, 3vw, 1.5rem); background: #fff; border: 1px solid var(--line); border-radius: var(--round); }
.media-carousel h2 { margin-top: 0; }
.media-carousel img { display: block; width: 100% !important; aspect-ratio: 3 / 2; object-fit: contain; border-radius: 13px; background: #f3f6ed; }
.carousel-controls { display: flex; justify-content: center; flex-wrap: wrap; gap: .32rem; margin-top: .9rem; }
.carousel-controls button { width: 38px; min-height: 40px; background: #edf4e7; border: 1px solid #cfdccd; border-radius: 9px; }
.carousel-controls button[aria-current="true"] { background: var(--green); color: white; }
.carousel-controls button[data-step] { font-size: 1.3rem; }
.site-footer { margin-block: 2rem 0; padding: 1.2rem .3rem; border-top: 1px solid var(--line); color: var(--muted); font-size: .85rem; }
.site-footer p { margin-bottom: .55rem; }
.site-footer:first-line { color: var(--ink); }
.site-footer a { margin-inline: .12em; }
#main [id] { scroll-margin-top: 1.5rem; }

@media (max-width: 1050px) {
  .header-inner { display: grid; grid-template-columns: auto minmax(0,1fr) auto; gap: .6rem; padding-block: .65rem; }
  .site-logo { width: 42px; height: 42px; border-radius: 10px; }
  .site-search { width: min(100%,50vw); max-width: 50vw; justify-self: center; }
  .nav-toggle { display: block; }
  .site-nav { display: none; grid-column: 1 / -1; flex-direction: column; width: 100%; padding-top: .3rem; border-top: 1px solid var(--line); }
  .header-inner.nav-open .site-nav { display: flex; }
  .site-nav a { width: 100%; padding: .65rem .75rem; }
}

@media (max-width: 760px) {
  .shell { width: min(calc(100% - 28px),1000px); }
  .home-hero { min-height: 0; grid-template-columns: minmax(0,1.6fr) minmax(0,1fr); }
  .hero-art { min-height: 170px; }
  .symbol { width: 36px; height: 36px; font-size: 1.35rem; border-radius: 10px; }
  .explore { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .book-grid { grid-template-columns: 1fr; }
}
@media (max-width: 485px) {
  .site-nav a { padding: .42rem .47rem; font-size: .83rem; }
  .home-hero { grid-template-columns: 1fr; gap: .35rem; }
  .hero-art { min-height: 142px; width: min(76%,230px); margin: .85rem auto 0; }
  .mascot { width: 122px; box-shadow: 0 0 0 8px #42645a, 0 0 0 9px #668477; }
  .hero-actions { gap: .38rem; }
  .w3-row:has(> .w3-half) { grid-template-columns: 1fr; }
  .w3-row:has(> .w3-quarter) { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .book-card { grid-template-columns: minmax(0,.55fr) minmax(0,1.45fr); }
}
