/* =========================================================================
   BoomReader UK — shared site styles (header, navigation, footer)
   Page sections keep their own styles inside each page file.
   ========================================================================= */

:root {
  --site-indigo: #212771;
  --site-raspberry: #bf3765;
  --site-raspberry-dark: #9c2a50;
  --site-green: #667f1c;
  --site-green-dark: #536816;
  --site-ink: #2f3437;
  --site-text: #4a4f52;
  --site-indigo-dark: #161a52;
  --site-header-h: 76px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--site-header-h) + 12px);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
/* the BoomWriter header is taller (it has the "Back to BoomReader" strip), so leave more room
   for it when the page scrolls to a link or a focused field (WCAG 2.4.11) */
html:has(.site-header--bw) { scroll-padding-top: calc(var(--site-header-h) + 52px); }
/* "Pause animations" in the footer (site.js): stops every looping animation (WCAG 2.2.2) */
html.br-still *, html.br-still *::before, html.br-still *::after { animation-play-state: paused !important; }

body {
  margin: 0;
  background: #fff;
  color: var(--site-text);
  font-family: "Red Hat Display", "Segoe UI", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  padding: 12px 20px; border-radius: 0 0 12px 0;
  background: var(--site-indigo); color: #fff; font-weight: 700; text-decoration: none;
}
.skip-link:focus { left: 0; }
#main[tabindex="-1"]:focus { outline: none; }

/* ---------------- header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--site-indigo);
  box-shadow: 0 2px 14px rgba(20, 16, 70, 0.18);
}
.site-header__inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  max-width: 1280px; min-height: var(--site-header-h);
  margin: 0 auto; padding: 10px 22px;
}

.site-logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.site-logo img { display: block; height: 46px; width: auto; }
.site-logo__region {
  padding: 3px 11px 4px; border-radius: 999px;
  background: rgba(255, 255, 255, 0.18); border: 1px solid rgba(255, 255, 255, 0.45);
  color: #fff; font-size: 0.85rem; font-weight: 800;
}

.site-nav { display: flex; align-items: center; gap: 20px; }
.site-nav ul { display: flex; align-items: center; gap: 18px; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  position: relative; display: inline-block; padding: 6px 0;
  color: #fff; font-size: 0.98rem; font-weight: 700; text-decoration: none; white-space: nowrap;
}
.site-nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  border-radius: 3px; background: #ffc93c; transform: scaleX(0); transform-origin: left;
  transition: transform 180ms ease;
}
.site-nav a:hover::after,
.site-nav a[aria-current="page"]::after { transform: scaleX(1); }

.site-nav__cta {
  padding: 11px 20px !important; border-radius: 999px;
  background: var(--site-raspberry); color: #fff !important;
  font-weight: 800; white-space: nowrap;
  transition: background-color 160ms ease, transform 160ms ease;
}
.site-nav__cta::after { display: none; }
.site-nav__cta:hover { background: var(--site-raspberry-dark); transform: translateY(-2px); }

.site-header a:focus-visible,
.site-burger:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 6px; }

/* burger */
.site-burger {
  display: none; flex-direction: column; justify-content: center; gap: 5px;
  width: 46px; height: 42px; padding: 0 10px;
  border: 2px solid rgba(255, 255, 255, 0.5); border-radius: 12px;
  background: transparent; cursor: pointer;
}
.site-burger span { display: block; height: 3px; border-radius: 3px; background: #fff; transition: transform 200ms ease, opacity 160ms ease; }
.site-burger[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.site-burger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.site-burger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 979px) {
  .site-burger { display: flex; }
  .site-header__inner { position: relative; }
  .site-nav {
    position: absolute; left: 0; right: 0; top: 100%;
    display: none; flex-direction: column; align-items: stretch; gap: 8px;
    padding: 14px 24px 22px;
    background: var(--site-indigo);
    box-shadow: 0 14px 24px rgba(20, 16, 70, 0.25);
    /* the header is sticky, so a long menu scrolls inside itself; otherwise its last links
       can't be reached on short screens or when zoomed in (WCAG 1.4.10) */
    max-height: calc(100vh - var(--site-header-h)); max-height: calc(100dvh - var(--site-header-h));
    overflow-y: auto; overscroll-behavior: contain;
  }
  .site-header--bw .site-nav { max-height: calc(100vh - var(--site-header-h) - 40px); max-height: calc(100dvh - var(--site-header-h) - 40px); }
  .site-nav.is-open { display: flex; }
  /* open, it fills the screen below the header (the page doesn't show through underneath) */
  .site-nav { height: calc(100vh - var(--site-header-h)); height: calc(100dvh - var(--site-header-h)); padding-bottom: 40px; }
  .site-header--bw .site-nav { height: calc(100vh - var(--site-header-h) - 40px); height: calc(100dvh - var(--site-header-h) - 40px); }
  html.site-menu-open, html.site-menu-open body { overflow: hidden; }
  html.site-menu-open .site-help, html.site-menu-open .hw { display: none !important; }
  .site-nav > ul > li > a, .site-nav .site-drop__btn { font-size: 1.12rem; font-weight: 800; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 2px; }
  .site-nav li { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
  .site-nav a { padding: 13px 4px; font-size: 1.05rem; }
  .site-nav a::after { display: none; }
  .site-nav a[aria-current="page"] { color: #ffc93c; }

  /* on small screens the Explore group is shown open, not as a dropdown.
     These all use .site-nav so they beat the dropdown rules further down. */
  /* Product and Resources fold out: a tap on the row opens its links underneath */
  .site-nav .site-drop__btn {
    display: flex; justify-content: space-between; width: 100%; padding: 13px 4px;
    font-size: 1.05rem; text-align: left;
  }
  .site-nav .site-drop__btn::after { display: none; }
  .site-nav .site-drop__btn svg { width: 20px; height: 20px; }
  .site-nav .site-drop__btn.is-current { color: #ffc93c; }
  .site-nav .site-drop { border-bottom: 1px solid rgba(255, 255, 255, 0.18); }
  /* the open section: its row lights up and the arrow turns */
  .site-nav .site-drop__btn svg { transition: transform 180ms ease; }
  .site-nav .site-drop__btn[aria-expanded="true"] { color: #ffc93c; }
  .site-nav .site-drop__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
  .site-nav .site-drop__panel[hidden] { display: none; }
  /* its links: white cards, one per group, each with a clear heading, and every link with its
     picture and a line saying what it is (as in the desktop menu), so they're easy to scan */
  .site-nav .site-drop__panel {
    display: grid; gap: 12px; position: static; width: auto; max-width: none; margin: 2px 0 16px; padding: 0;
    border: 0; border-radius: 0; background: transparent; box-shadow: none; opacity: 1; visibility: visible; animation: site-fold 180ms ease;
  }
  .site-nav .site-drop__panel::before { display: none; }
  .site-nav .site-drop__col { display: grid; gap: 12px; }
  .site-nav .site-drop__group, .site-nav .site-drop__panel--simple { padding: 6px; border-radius: 18px; background: #fff; }
  .site-nav .site-drop__panel--simple { gap: 0; }
  .site-nav .site-drop__label { display: block; margin: 8px 10px 4px; color: var(--site-raspberry-dark); font-size: 0.86rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
  .site-nav .site-drop__group + .site-drop__group { margin-top: 0; }
  .site-nav .site-drop__panel a {
    display: grid !important; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 12px; padding: 9px 10px !important;
    border: 0; border-radius: 12px; background: transparent; transform: none; color: var(--site-indigo);
  }
  .site-nav .site-drop__panel a + a { border-top: 1px solid #eceef4; border-radius: 0 0 12px 12px; }
  .site-nav .site-drop__panel a:hover, .site-nav .site-drop__panel a:focus-visible { background: #f3f4fa; transform: none; }
  .site-nav .site-drop__panel a:focus-visible { outline: 3px solid var(--site-indigo); outline-offset: -3px; }
  .site-nav .site-drop__panel a[aria-current="page"] { background: #fff4d6; }
  .site-nav .site-drop__panel a[aria-current="page"] strong { color: var(--site-indigo); }
  .site-nav .site-drop__icon { display: grid; width: 38px; height: 38px; border-radius: 12px; }
  .site-nav .site-drop__icon svg { width: 21px; height: 21px; }
  .site-nav .site-drop__panel strong { display: block; color: var(--site-indigo) !important; font-size: 1rem !important; font-weight: 800 !important; line-height: 1.25; }
  .site-nav .site-drop__panel small { display: block; margin-top: 1px; color: #5d636a; font-size: 0.86rem; font-weight: 600; line-height: 1.3; }

  /* Log in and Sign up, written out (the header has only their icons on a phone) */
  .site-nav .site-nav__account { display: grid; gap: 12px; margin-top: 10px; }
  .site-nav__account-group { padding: 6px; border-radius: 18px; background: rgba(255, 255, 255, 0.1); }
  .site-nav__account-group p { margin: 8px 10px 4px; color: #ffc93c; font-size: 0.86rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase; }
  .site-nav .site-nav__account a { display: grid; grid-template-columns: 38px minmax(0, 1fr); align-items: center; gap: 12px; padding: 9px 10px; border-radius: 12px; color: #fff; font-size: 1rem; font-weight: 700; }
  .site-nav .site-nav__account a:hover, .site-nav .site-nav__account a:focus-visible { background: rgba(255, 255, 255, 0.12); }
  .site-nav .site-nav__account a::after { display: none; }
  .site-nav__account .site-login__icon { width: 38px; height: 38px; }
  .site-nav__account small { display: block; color: rgba(255, 255, 255, 0.78); font-size: 0.84rem; font-weight: 600; }
  .site-nav__cta { margin-top: 12px; text-align: center; }
}


/* ---------------- header actions + login menu ---------------- */
.site-actions { display: flex; align-items: center; gap: 10px; }

.site-login { position: relative; }
.site-login__btn {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 10px 18px;
  border: 2px solid rgba(255, 255, 255, 0.6); border-radius: 999px;
  background: transparent; color: #fff;
  font: 700 0.98rem/1.2 "Red Hat Display", "Segoe UI", Arial, sans-serif;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease, transform 160ms ease;
}
.site-login__btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.site-login__btn:hover { background: rgba(255, 255, 255, 0.16); border-color: #fff; transform: translateY(-1px); }
.site-login__btn[aria-expanded="true"] { background: #fff; border-color: #fff; color: var(--site-indigo); }

.site-login__panel {
  position: absolute; z-index: 120; top: calc(100% + 12px); right: 0;
  width: 300px; max-width: calc(100vw - 24px);
  padding: 16px 16px 14px;
  border-radius: 20px; background: #fff;
  box-shadow: 0 22px 48px rgba(20, 16, 70, 0.3);
  animation: site-login-in 180ms ease-out;
}
.site-login__panel[hidden] { display: none; }
.site-login__panel::before {
  content: ""; position: absolute; top: -7px; right: 28px;
  width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px; background: #fff;
}
@keyframes site-login-in { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .site-login__panel { animation: none; } }
/* on very short screens (or zoomed right in) the pop-out panels scroll rather than run off the bottom */
@media (max-height: 520px) {
  .site-login__panel { max-height: calc(100vh - var(--site-header-h) - 20px); overflow-y: auto; }
}
@media (max-height: 520px) and (min-width: 980px) {
  .site-drop__panel { max-height: calc(100vh - var(--site-header-h) - 20px); overflow-y: auto; }
}

.site-login__title { margin: 2px 2px 12px; color: var(--site-ink); font-size: 0.95rem; font-weight: 800; }
.site-login__opt {
  display: grid; grid-template-columns: 44px 1fr; gap: 12px; align-items: center;
  padding: 10px 10px; border-radius: 14px;
  color: var(--site-text); text-decoration: none;
  transition: background-color 150ms ease, transform 150ms ease;
}
.site-login__opt:hover { background: #f4f5f8; transform: translateX(2px); }
.site-login__opt strong { display: block; color: var(--site-ink); font-size: 0.98rem; }
.site-login__opt small { color: #646a71; font-size: 0.8rem; }
.site-login__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; }
.site-login__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-login__icon--teacher { background: #eef3e0; color: #536816; }
.site-login__icon--pupil { background: #e9ecf7; color: var(--site-indigo); }
.site-login__icon--parent { background: #fbe9ef; color: var(--site-raspberry-dark); }
.site-login__opt:focus-visible { outline: 3px solid var(--site-indigo); outline-offset: 2px; }
/* the header's white focus ring would vanish on the white pop-out panels (WCAG 2.4.7) */
.site-header .site-login__panel a:focus-visible { outline-color: var(--site-indigo); }
.site-login__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
@media (min-width: 980px) { .site-header .site-drop__panel a:focus-visible { outline-color: var(--site-indigo); } }

@media (max-width: 420px) {
  .site-header__inner { gap: 10px; padding: 10px 14px; }
  .site-logo img { height: 40px; }
  .site-logo__region { padding: 2px 9px 3px; font-size: 0.78rem; }
  .site-actions { gap: 6px; }
  .site-burger { width: 42px; padding: 0 9px; }
  .site-login__btn { padding: 10px 14px; }
  .site-login__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .site-login__btn svg { width: 20px; height: 20px; }
  .site-login__panel { right: -6px; width: 280px; }
}


/* ---------------- Explore dropdown in the main menu ---------------- */
.site-drop { position: relative; }
.site-drop__btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 0; border: 0; background: transparent;
  color: #fff; font: 700 0.98rem/1.2 "Red Hat Display", "Segoe UI", Arial, sans-serif;
  cursor: pointer;
}
.site-drop__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; transition: transform 180ms ease; }
.site-drop__btn[aria-expanded="true"] svg { transform: rotate(180deg); }
.site-drop__btn::after {
  content: ""; position: absolute; left: 0; right: 18px; bottom: 0; height: 3px;
  border-radius: 3px; background: #ffc93c; transform: scaleX(0); transform-origin: left;
  transition: transform 180ms ease;
}
.site-drop__btn:hover::after, .site-drop__btn.is-current::after, .site-drop__btn[aria-expanded="true"]::after { transform: scaleX(1); }
.site-drop__btn:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 6px; }

.site-drop__panel {
  position: absolute; z-index: 120; top: calc(100% + 14px); left: -14px;
  width: 320px; max-width: calc(100vw - 24px);
  padding: 12px; border-radius: 20px; background: #fff;
  box-shadow: 0 22px 48px rgba(20, 16, 70, 0.3);
  animation: site-login-in 180ms ease-out;
}
.site-drop__panel[hidden] { display: none; }
.site-drop__panel::before {
  content: ""; position: absolute; top: -7px; left: 30px;
  width: 14px; height: 14px; transform: rotate(45deg); border-radius: 3px; background: #fff;
}
.site-drop__panel a {
  display: grid; grid-template-columns: 40px 1fr; gap: 12px; align-items: center;
  padding: 10px; border-radius: 14px;
  color: var(--site-text); text-decoration: none;
  transition: background-color 150ms ease, transform 150ms ease;
}
.site-drop__panel a::after { display: none; }
.site-drop__panel a:hover { background: #f4f5f8; transform: translateX(2px); }
.site-drop__panel a[aria-current="page"] { background: #fbe9ef; }
.site-drop__panel strong { display: block; color: var(--site-ink); font-size: 0.98rem; }
/* menu text wraps inside its box (the top-level links don't) */
.site-nav .site-drop__panel a { white-space: normal; }
.site-drop__panel a > span:last-child { min-width: 0; }
/* the Resources menu: labelled groups in two columns */
.site-drop__label { margin: 4px 10px 2px; color: #646a71; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.site-drop__group + .site-drop__group { margin-top: 8px; }
@media (min-width: 980px) {
  .site-drop__panel--wide { width: 620px; left: -150px; }
  .site-drop__panel--wide::before { left: 164px; } /* the pointer still sits under "Resources" */
  .site-drop__panel--wide:not([hidden]) { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8px; }
}
.site-drop__panel small { color: #646a71; font-size: 0.8rem; line-height: 1.3; }
.site-drop__icon { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 13px; }
.site-drop__icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-drop__icon--writer { background: #fdeee2; color: #b74d06; }
.site-drop__icon--bass { background: #eef3e0; color: #536816; }
.site-drop__icon--video { background: #e9ecf7; color: var(--site-indigo); }
.site-drop__icon--res { background: #fbe9ef; color: var(--site-raspberry-dark); }

/* ---------------- footer ---------------- */
.site-footer {
  position: relative;
  padding: 78px 24px 0;
  background: linear-gradient(160deg, var(--site-raspberry) 0%, #7a2c63 50%, var(--site-indigo) 110%);
  color: #fff;
}
/* torn paper edge, matching the section edges on every page */
.site-footer::before {
  content: "";
  position: absolute; top: -1px; left: 0; right: 0; height: 34px;
  background: var(--footer-edge, #fff);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1440v10c-60 8-120 2-180 7s-120 12-180 8-120-14-180-11-120 15-180 13S600 6 540 8s-120 14-180 12S240 6 180 9 60 20 0 15z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 34' preserveAspectRatio='none'%3E%3Cpath d='M0 0h1440v10c-60 8-120 2-180 7s-120 12-180 8-120-14-180-11-120 15-180 13S600 6 540 8s-120 14-180 12S240 6 180 9 60 20 0 15z'/%3E%3C/svg%3E") no-repeat center / 100% 100%;
}

.site-footer__inner {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(4, minmax(0, 1fr)); gap: 36px;
  max-width: 1180px; margin: 0 auto;
}
.site-footer__brand img { display: block; height: 58px; width: auto; }
.site-footer__brand p { max-width: 30em; margin: 18px 0 0; color: rgba(255, 255, 255, 0.92); line-height: 1.65; }
.site-footer__trial {
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 22px; padding: 13px 26px;
  border-radius: 999px; background: #ffc93c; color: var(--site-indigo) !important;
  font-weight: 800; text-decoration: none !important;
  box-shadow: 0 10px 24px rgba(240, 164, 0, 0.3);
  transition: background-color 160ms ease, transform 160ms ease;
}
.site-footer__trial:hover { background: #ffd65a; transform: translateY(-2px); text-decoration: none !important; }

.site-footer h2 {
  margin: 0 0 16px; padding-bottom: 10px;
  border-bottom: 2px solid rgba(255, 255, 255, 0.22);
  color: #fff; font-size: 0.86rem; font-weight: 800;
  letter-spacing: 0.09em; text-transform: uppercase;
}
.site-footer .site-footer__h2--gap { margin-top: 26px; }
.site-footer ul { margin: 0; padding: 0; list-style: none; }
.site-footer li { margin: 10px 0; line-height: 1.4; }
.site-footer__col a {
  position: relative; display: inline-block;
  color: rgba(255, 255, 255, 0.9); text-decoration: none;
  transition: color 150ms ease, transform 150ms ease;
}
.site-footer__col a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -3px; height: 2px;
  border-radius: 2px; background: #ffc93c;
  transform: scaleX(0); transform-origin: left; transition: transform 180ms ease;
}
.site-footer__col a:hover { color: #fff; transform: translateX(3px); }
.site-footer__col a:hover::after { transform: scaleX(1); }
.site-footer a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 4px; }

.site-footer__base {
  position: relative; z-index: 1;
  max-width: 1180px; margin: 54px auto 0; padding: 22px 0 28px;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.72); font-size: 0.9rem; text-align: center;
}
.site-footer__base p { margin: 0; }
.site-footer__addr { margin-top: 6px !important; font-size: 0.84rem; opacity: 0.95; }
.site-footer__staff { margin-top: 6px !important; font-size: 0.8rem; opacity: 0.9; }
/* "Pause animations" (site.js): looks like the links beside it */
.site-footer__motion { padding: 0; border: 0; background: none; color: rgba(255, 255, 255, 0.9); font: inherit; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.site-footer__motion:hover { color: #fff; }
.site-footer__motion:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 4px; }

@media (max-width: 980px) {
  .site-footer__inner { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 34px; }
  .site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 560px) {
  .site-footer { padding: 60px 22px 0; }
  .site-footer::before { height: 22px; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 30px; }
  .site-footer__trial { width: 100%; justify-content: center; }
}

/* =========================================================================
   Cookie consent banner + in-player prompt
   ========================================================================= */
.br-consent {
  position: fixed; z-index: 300; left: 16px; right: 16px; bottom: 16px;
  max-width: 940px; margin: 0 auto;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 22px 50px rgba(20, 16, 70, 0.32);
  opacity: 0; transform: translateY(24px);
  transition: opacity 300ms ease, transform 300ms cubic-bezier(.2, .9, .3, 1);
}
.br-consent.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .br-consent { transition: none; } }
/* short screens / zoomed in: the banner scrolls so its buttons can always be reached (WCAG 1.4.10) */
.br-consent { max-height: calc(100vh - 32px); overflow-y: auto; }
.br-consent:focus { outline: none; }

.br-consent__inner {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 22px; align-items: center;
  padding: 22px 26px;
}
.br-consent h2 { margin: 0; color: var(--site-ink); font-size: 1.1rem; font-weight: 800; }
.br-consent p { margin: 6px 0 0; color: var(--site-text); font-size: 0.95rem; line-height: 1.5; }
.br-consent__links { font-size: 0.88rem !important; }
.br-consent__links a { color: var(--site-raspberry-dark); font-weight: 700; text-underline-offset: 3px; }

.br-consent__actions { display: flex; gap: 10px; }
.br-consent__btn {
  min-height: 46px; padding: 11px 22px;
  border: 2px solid transparent; border-radius: 999px;
  font: 700 0.98rem/1.2 "Red Hat Display", "Segoe UI", Arial, sans-serif;
  white-space: nowrap; cursor: pointer;
  transition: background-color 150ms ease, transform 150ms ease, border-color 150ms ease;
}
.br-consent__btn--yes { background: var(--site-green); border-color: var(--site-green); color: #fff; }
.br-consent__btn--yes:hover { background: var(--site-green-dark); border-color: var(--site-green-dark); transform: translateY(-2px); }
.br-consent__btn--no { background: #fff; border-color: #d8dbe4; color: var(--site-text); }
.br-consent__btn--no:hover { background: #f4f5f8; transform: translateY(-2px); }
.br-consent__btn:focus-visible { outline: 3px solid var(--site-indigo); outline-offset: 3px; }

@media (max-width: 720px) {
  .br-consent { left: 10px; right: 10px; bottom: 10px; border-radius: 18px; }
  .br-consent__inner { grid-template-columns: 1fr; gap: 16px; padding: 18px 18px 20px; }
  .br-consent__actions { flex-direction: column-reverse; }
  .br-consent__btn { width: 100%; }
}

/* prompt shown inside a video box before the player loads */
.br-consent-ask {
  position: absolute; inset: 0; z-index: 6;
  display: grid; place-items: center;
  padding: 18px;
  background: rgba(20, 16, 70, 0.88);
  backdrop-filter: blur(3px);
  text-align: center;
}
.br-consent-ask__inner { max-width: 380px; color: #fff; }
.br-consent-ask p { margin: 0 0 6px; font-size: 0.95rem; line-height: 1.45; }
.br-consent-ask__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin-top: 14px; }
.br-consent-ask__link { margin-top: 12px !important; font-size: 0.85rem; }
.br-consent-ask__link a { color: #ffc93c; font-weight: 700; text-underline-offset: 3px; }
/* on the dark video overlay the indigo focus ring would be invisible */
.br-consent-ask .br-consent__btn:focus-visible, .br-consent-ask a:focus-visible { outline-color: #ffc93c; }
.br-consent-ask a:focus-visible { outline: 3px solid #ffc93c; outline-offset: 3px; }
@media (max-width: 520px) {
  .br-consent-ask p { font-size: 0.88rem; }
  .br-consent-ask__actions { flex-direction: column; width: 100%; }
}

/* ---------------- UK additions: extra menu icons ---------------- */
.site-drop__icon--teacher { background: #eef3e0; color: #536816; }
.site-drop__icon--pupil { background: #e9ecf7; color: var(--site-indigo); }
.site-drop__icon--data { background: #e6f2f7; color: #1f6a8a; }
.site-drop__icon--guide { background: #fbe9ef; color: #9c2a50; }
.site-drop__icon--sync { background: #f1ecfa; color: #5b3aa6; }
.site-drop__icon--blog { background: #e9ecf7; color: var(--site-indigo); }
.site-drop__icon--trophy { background: #fff4d6; color: #9a6a00; }
.site-drop__icon--quest { background: #e3f6f8; color: #0a6a79; }
.site-drop__icon--faq { background: #eef3e0; color: #536816; }
.site-drop__btn.is-current::after { transform: scaleX(1); }
@media (min-width: 980px) and (max-width: 1140px) {
  .site-nav ul { gap: 14px; }
  .site-nav a, .site-drop__btn { font-size: 0.92rem; }
  .site-nav__cta { padding: 10px 16px !important; }
}

/* key documents in the footer */
.site-footer__all { font-weight: 800; color: #ffc93c !important; }
.site-footer__base a { color: rgba(255, 255, 255, 0.9); text-underline-offset: 3px; }
.site-footer__base a:hover { color: #fff; }

/* Footer blend (set by site.js from whatever sits above the footer):
   - a plain section: the torn edge takes that section's colour (--footer-edge)
   - a coloured call-to-action banner: no torn edge; the banner runs indigo to raspberry
     and the footer carries on from raspberry back to indigo, so they read as one piece */
.site-footer--blend { background: linear-gradient(180deg, #bf3765 0%, #7a2c63 38%, var(--site-indigo) 100%); }
.site-footer--blend::before { display: none; }
.cta-into-footer { background: radial-gradient(60% 50% at 50% 100%, rgba(255, 201, 60, 0.1), transparent 70%), linear-gradient(180deg, var(--site-indigo) 0%, #3a2a78 45%, #8e3067 82%, #bf3765 100%) !important; }
.site-footer--blend-bw { background: linear-gradient(180deg, #9a3d0b 0%, #5e2c4a 40%, var(--site-indigo) 100%); }
.cta-into-footer--bw { background: radial-gradient(60% 60% at 50% 0%, rgba(255, 201, 60, 0.12), transparent 70%), linear-gradient(180deg, #b04607 0%, #a8440a 55%, #9a3d0b 100%) !important; } /* darker top so white text passes 4.5:1 */

/* ---------------- BoomWriter section header ----------------
   Pages under /boomwriter use partials/header-boomwriter.html: BoomWriter's orange,
   its own tabs, and a strip with the way back to BoomReader. */
/* #c25408 (a shade darker than BoomWriter's #e0620b) so the white menu text passes contrast:
   white on #e0620b is 3.55:1, on #c25408 4.6:1 (WCAG 1.4.3) */
.site-header--bw { background: #c25408; box-shadow: 0 2px 14px rgba(120, 45, 0, 0.25); }
.site-header--bw .site-logo img { height: 44px; }
.site-switch { background: var(--site-indigo); color: rgba(255, 255, 255, 0.88); font-size: 0.86rem; }
.site-switch__inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1280px; margin: 0 auto; padding: 7px 22px; }
.site-switch strong { color: #fff; }
.site-switch a { flex: none; color: #ffc93c; font-weight: 800; text-decoration: none; }
.site-switch a:hover { text-decoration: underline; text-underline-offset: 3px; }
.site-switch a:focus-visible { outline: 3px solid #fff; outline-offset: 3px; border-radius: 4px; }
.site-header--bw .site-nav ul { gap: 16px; }
.site-header--bw .site-nav a::after { background: #fff; }
.site-header--bw .site-nav__cta { background: #fff; color: #b34d06 !important; }
.site-header--bw .site-nav__cta:hover { background: #fff1e6; }
.site-nav__back { display: none; }
.site-nav__account { display: none; }
@media (max-width: 1240px) { .site-header--bw .site-nav ul { gap: 12px; } .site-header--bw .site-nav a { font-size: 0.92rem; } }
@media (max-width: 979px) {
  .site-header--bw .site-nav { background: #a94606; }
  .site-header--bw .site-nav a[aria-current="page"] { color: #fff; text-decoration: underline; text-underline-offset: 5px; }
  .site-nav__back { display: block; }
  .site-nav__back a { color: #ffe27a !important; }
  .site-switch__inner span { display: none; }
  .site-switch__inner { justify-content: flex-end; }
}

/* Sign up (next to Login): filled so the two read as different actions */
.site-signup__btn { background: #ffc93c; border-color: #ffc93c; color: var(--site-indigo); text-decoration: none; }
.site-signup__btn:hover { background: #ffd65a; border-color: #ffd65a; }
.site-signup__btn[aria-expanded="true"] { background: #fff; border-color: #fff; color: var(--site-indigo); }
a.site-signup__btn { display: inline-flex; align-items: center; gap: 8px; }
.site-header--bw .site-signup__btn { background: #fff; border-color: #fff; color: #b34d06; }
.site-header--bw .site-signup__btn:hover { background: #fff1e6; border-color: #fff1e6; }

/* Login and Sign up keep their words on wide screens, and become icons (still named for
   screen readers) when the header gets crowded */
.site-logo { flex-shrink: 0; }
.site-login__btn { white-space: nowrap; }
@media (max-width: 1240px) {
  .site-header--bw .site-login__btn, .site-header--bw a.site-signup__btn { padding: 10px 12px; }
  .site-header--bw .site-login__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 1120px) {
  .site-login__btn { padding: 10px 12px; }
  .site-login__btn span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (min-width: 980px) and (max-width: 1100px) {
  .site-header--bw .site-nav__cta { display: none; }
}

@keyframes site-fold { from { transform: translateY(-4px); } to { transform: none; } }

@media (prefers-reduced-motion: reduce) { .site-nav .site-drop__panel { animation: none !important; } }

/* Help button (bottom right): opens our own help panel (help-widget.js), searching the Help Centre */
.site-help {
  position: fixed; z-index: 250; right: 18px; bottom: 18px;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px 12px 14px; border: 0; border-radius: 999px;
  background: var(--site-indigo); color: #fff;
  font: 800 0.98rem/1 "Red Hat Display", "Segoe UI", Arial, sans-serif;
  box-shadow: 0 12px 28px rgba(20, 16, 70, 0.35); cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease;
}
.site-help:hover { background: var(--site-raspberry); transform: translateY(-2px); }
.site-help:focus-visible { outline: 3px solid #ffc93c; outline-offset: 3px; }
.site-help svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-help[hidden] { display: none; }
@media (max-width: 600px) { .site-help { right: 12px; bottom: 12px; padding: 12px; } .site-help span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); } }
@media (prefers-reduced-motion: reduce) { .site-help { transition: none; } .site-help:hover { transform: none; } }
.site-help.is-open { background: var(--site-raspberry); }
.hw { position: fixed; z-index: 251; right: 18px; bottom: 80px; display: flex; flex-direction: column; width: min(390px, calc(100vw - 24px)); max-height: min(620px, calc(100vh - 110px)); overflow: hidden; border-radius: 22px; background: #fff; color: #2f3437; font-family: "Red Hat Display", "Segoe UI", Arial, sans-serif; box-shadow: 0 24px 60px rgba(20, 16, 70, 0.32); transform-origin: bottom right; animation: hw-in 180ms ease-out; }
.hw[hidden] { display: none; }
@keyframes hw-in { from { opacity: 0; transform: translateY(10px) scale(0.97); } }
.hw__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; padding: 18px 18px 14px; background: linear-gradient(160deg, var(--site-indigo) 0%, #3a3fa3 100%); color: #fff; }
.hw__kicker { margin: 0 0 2px; color: #ffc93c; font-size: 0.78rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.hw__head h2 { margin: 0; color: #fff; font-size: 1.3rem; font-weight: 800; }
.hw__close { flex: none; width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, 0.16); color: #fff; font-size: 1.5rem; line-height: 1; cursor: pointer; }
.hw__close:hover { background: rgba(255, 255, 255, 0.28); }
.hw__close:focus-visible, .hw a:focus-visible { outline: 3px solid #ffc93c; outline-offset: 2px; }
.hw__search { display: flex; align-items: center; gap: 8px; margin: -1px 0 0; padding: 12px 16px; border-bottom: 1px solid #eceef4; }
.hw__search svg { flex: none; width: 20px; height: 20px; fill: none; stroke: #6b7178; stroke-width: 2; stroke-linecap: round; }
.hw__search input { flex: 1; min-width: 0; padding: 10px 12px; border: 2px solid #e0e2ea; border-radius: 12px; font: inherit; font-size: 1rem; }
.hw__search input:focus { border-color: var(--site-indigo); outline: none; }
.hw__for { display: flex; gap: 6px; padding: 10px 16px 0; }
.hw__for a { padding: 5px 12px; border-radius: 999px; background: #f1f2f8; color: var(--site-indigo); font-size: 0.85rem; font-weight: 700; text-decoration: none; }
.hw__for a:hover { background: #e4e6f5; }
.hw__label { margin: 12px 16px 6px; color: #6b7178; font-size: 0.8rem; font-weight: 800; letter-spacing: 0.05em; text-transform: uppercase; }
.hw__label:empty { display: none; }
.hw__list { flex: 1; min-height: 60px; margin: 0; padding: 0 10px 8px; overflow: auto; list-style: none; }
.hw__list a { display: grid; gap: 2px; padding: 10px 10px; border-radius: 12px; color: inherit; text-decoration: none; }
.hw__list a:hover { background: #f6f7fb; }
.hw__list strong { color: var(--site-indigo); font-size: 0.98rem; line-height: 1.3; }
.hw__list span { font-size: 0.88rem; line-height: 1.4; }
.hw__list small { color: #6b7178; font-size: 0.78rem; font-weight: 600; }
.hw__empty { padding: 12px 10px; font-size: 0.92rem; line-height: 1.5; }
.hw__empty a, .hw__foot p a { color: var(--site-raspberry); font-weight: 700; }
.hw__foot { padding: 12px 16px 14px; border-top: 1px solid #eceef4; background: #fafafd; }
.hw__all { display: inline-block; margin-bottom: 6px; color: var(--site-indigo); font-weight: 800; text-decoration: none; }
.hw__foot p { margin: 0; font-size: 0.85rem; line-height: 1.5; }
.hw-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
@media (max-width: 600px) { .hw { right: 12px; bottom: 72px; } }
@media (prefers-reduced-motion: reduce) { .hw { animation: none; } }
@media print { .site-help, .hw { display: none !important; } }

/* "Not using Wonde?" note: schools can upload a CSV of teachers and pupils instead
   (homepage, Wonde page) */
.csv-note { display: flex; align-items: flex-start; gap: 14px; margin-top: 22px; padding: 16px 18px; border-left: 5px solid #bf3765; border-radius: 14px; background: #fbf1f4; text-align: left; }
.csv-note p { margin: 0 !important; font-size: 0.98rem; line-height: 1.55; }
.csv-note strong { color: #2f3437; }
.csv-note__icon { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: #fff; color: #bf3765; }
.csv-note__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* =========================================================================
   Announcements (admin → Website → Announcements): the banner under the
   navigation and the pop-up. Added to pages by the Worker; see announce.js.
   ========================================================================= */
.br-ann, .br-ann-pop__box { --ann-bg: var(--site-indigo); --ann-fg: #fff; --ann-link-bg: #fff; --ann-link-fg: var(--site-indigo); }
.br-ann--raspberry { --ann-bg: var(--site-raspberry); --ann-link-fg: var(--site-raspberry-dark); }
.br-ann--green { --ann-bg: var(--site-green-dark); --ann-link-fg: var(--site-green-dark); }
.br-ann--sun { --ann-bg: #ffc93c; --ann-fg: var(--site-ink); --ann-link-bg: var(--site-ink); --ann-link-fg: #fff; }
.br-ann--dark { --ann-bg: var(--site-ink); --ann-link-fg: var(--site-ink); }
.br-ann--banner { position: relative; z-index: 5; background: var(--ann-bg); color: var(--ann-fg); transition: opacity .25s, transform .25s; }
.br-ann--banner.is-closing { opacity: 0; transform: translateY(-8px); }
.br-ann__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px 14px; max-width: 1180px; margin: 0 auto; padding: 11px 52px 11px 20px; text-align: center; }
.br-ann__text { margin: 0; font-size: 0.98rem; line-height: 1.45; }
.br-ann__text strong { font-weight: 800; }
.br-ann__emoji { font-size: 1.3rem; line-height: 1; }
.br-ann__count { display: inline-block; margin-left: 8px; padding: 1px 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.2); font-size: 0.82rem; font-weight: 800; white-space: nowrap; }
.br-ann__count:empty { display: none; }
.br-ann--sun .br-ann__count { background: rgba(0, 0, 0, 0.08); }
.br-ann__link { display: inline-flex; align-items: center; padding: 6px 14px; border-radius: 999px; background: var(--ann-link-bg); color: var(--ann-link-fg); font-weight: 800; font-size: 0.9rem; text-decoration: none; white-space: nowrap; transition: transform .15s; }
.br-ann__link:hover { transform: translateY(-1px); }
.br-ann__link:focus-visible, .br-ann__x:focus-visible { outline: 3px solid currentColor; outline-offset: 2px; }
.br-ann__x { position: absolute; top: 50%; right: 12px; display: grid; place-items: center; width: 32px; height: 32px; margin-top: -16px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: inherit; font-size: 1.4rem; line-height: 1; cursor: pointer; opacity: 0.85; }
.br-ann__x:hover { background: rgba(255, 255, 255, 0.18); opacity: 1; }
.br-ann--sun .br-ann__x:hover { background: rgba(0, 0, 0, 0.08); }

.br-ann-pop { position: fixed; inset: 0; z-index: 300; display: grid; place-items: center; padding: 20px; }
.br-ann-pop[hidden] { display: none; }
.br-ann-pop__backdrop { position: absolute; inset: 0; background: rgba(20, 22, 50, 0.55); opacity: 0; transition: opacity .25s; }
.br-ann-pop__box { position: relative; width: min(460px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 22px; background: #fff; color: var(--site-text);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); opacity: 0; transform: translateY(14px) scale(0.97); transition: opacity .25s, transform .25s; outline: none; border-top: 8px solid var(--ann-bg); }
.br-ann-pop.is-open .br-ann-pop__backdrop { opacity: 1; }
.br-ann-pop.is-open .br-ann-pop__box { opacity: 1; transform: none; }
.br-ann-pop__img { display: block; width: 100%; max-height: 240px; object-fit: cover; }
.br-ann-pop__box.has-img { border-top: 0; }
.br-ann-pop__body { padding: 26px 28px 28px; text-align: center; }
.br-ann-pop__body h2 { margin: 6px 0 8px; color: var(--site-ink); font-size: 1.45rem; line-height: 1.25; }
.br-ann-pop__body p { margin: 0 0 12px; line-height: 1.55; }
.br-ann__emoji--big { display: block; font-size: 2.2rem; }
.br-ann-pop__body .br-ann__count { margin: 0 0 12px; background: color-mix(in srgb, var(--ann-bg) 14%, #fff); color: var(--site-ink); }
.br-ann-pop__actions { margin: 6px 0 0 !important; }
.br-ann__btn { padding: 12px 24px; background: var(--ann-bg); color: var(--ann-fg); font-size: 1rem; }
.br-ann--sun .br-ann__btn { background: #ffc93c; color: var(--site-ink); }
.br-ann-pop .br-ann__x { top: 12px; right: 12px; margin: 0; background: rgba(255, 255, 255, 0.9); color: var(--site-ink); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15); }
@media (max-width: 640px) {
  .br-ann__inner { justify-content: flex-start; padding: 10px 48px 10px 16px; text-align: left; }
  .br-ann__text { font-size: 0.92rem; }
  .br-ann-pop__body { padding: 22px 20px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .br-ann--banner, .br-ann-pop__backdrop, .br-ann-pop__box, .br-ann__link { transition: none; }
}
