/* ============================================================
   schoolcare-gds.css
   A GOV.UK Design System–style component library for
   schoolcare.cloud. Built to be reused across every page —
   not just the homepage.

   Modelled closely on design-system.service.gov.uk:
   restrained colour, no gradients or shadows-as-decoration,
   flat rectangular components, a visible high-contrast focus
   state, and a plain system typeface (GDS Transport is licensed
   to UK government services only, so we use their own public
   fallback stack: arial / helvetica).
   ============================================================ */

/* ── 1. TOKENS ───────────────────────────────────────────── */
:root {
  /* Colour */
  --sc-black:        #0b0c0c;
  --sc-white:        #ffffff;
  --sc-blue:         #1d70b8;   /* links, primary actions */
  --sc-blue-dark:    #003078;
  --sc-dark-grey:    #505a5f;
  --sc-mid-grey:     #b1b4b6;
  --sc-light-grey:   #f3f2f1;
  --sc-green:        #00703c;   /* start / confirm actions */
  --sc-green-dark:   #002d18;
  --sc-red:          #d4351c;
  --sc-yellow:       #ffdd00;   /* focus state only */
  --sc-purple:       #4c2c92;

  /* Type */
  --sc-font: arial, "Helvetica Neue", helvetica, sans-serif;

  /* Layout */
  --sc-max-width: 960px;
  --sc-gutter: 20px;
  --sc-border: 1px solid var(--sc-mid-grey);
}

/* ── 2. RESET & BASE ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--sc-font);
  font-size: 1.1875rem;         /* 19px, GOV.UK desktop body size */
  line-height: 1.31579;
  color: var(--sc-black);
  background: var(--sc-white);
}
@media (max-width: 640px) {
  body { font-size: 1rem; line-height: 1.25; }  /* 16px mobile */
}
img { max-width: 100%; display: block; }
a { color: var(--sc-blue); }
a:visited { color: var(--sc-purple); }
a:hover { color: var(--sc-blue-dark); }
a:active { color: var(--sc-black); }

/* GOV.UK's signature accessible focus state — black text on
   yellow, with a black underline "shadow". Applied globally. */
a:focus, button:focus, input:focus, select:focus, textarea:focus,
summary:focus, [tabindex]:focus {
  outline: 3px solid transparent;
  background-color: var(--sc-yellow);
  box-shadow: 0 -2px var(--sc-yellow), 0 4px var(--sc-black);
  text-decoration: none;
  color: var(--sc-black);
}

/* Skip link */
.sc-skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 10000;
  background: var(--sc-yellow); color: var(--sc-black);
  padding: 10px 16px; font-weight: 700;
}
.sc-skip-link:focus { left: 8px; top: 8px; }

/* ── 3. LAYOUT ───────────────────────────────────────────── */
.sc-width-container {
  max-width: var(--sc-max-width);
  margin: 0 auto;
  padding: 0 var(--sc-gutter);
}
.sc-main-wrapper { padding: 40px 0; }
@media (max-width: 640px) { .sc-main-wrapper { padding: 24px 0; } }

.sc-grid-row { display: flex; flex-wrap: wrap; margin: 0 -15px; }
.sc-grid-row > [class*="sc-grid-column"] { padding: 0 15px; }
.sc-grid-column-one-third   { width: 33.3333%; }
.sc-grid-column-two-thirds  { width: 66.6666%; }
.sc-grid-column-one-half    { width: 50%; }
.sc-grid-column-one-quarter { width: 25%; }
.sc-grid-column-full        { width: 100%; }
@media (max-width: 768px) {
  .sc-grid-row > [class*="sc-grid-column"] { width: 100%; margin-bottom: 24px; }
  .sc-grid-row > [class*="sc-grid-column"]:last-child { margin-bottom: 0; }
}

/* ── 4. TYPE SCALE ───────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-family: var(--sc-font);
  font-weight: 700;
  color: var(--sc-black);
  margin: 0 0 20px;
  line-height: 1.15;
}
.sc-heading-xl  { font-size: 3rem;      line-height: 1.0416667; }   /* 48px */
.sc-heading-l   { font-size: 2.25rem;   line-height: 1.1111111; }   /* 36px */
.sc-heading-m   { font-size: 1.5rem;    line-height: 1.25; }        /* 24px */
.sc-heading-s   { font-size: 1.1875rem; line-height: 1.31579; }     /* 19px */
@media (max-width: 640px) {
  .sc-heading-xl { font-size: 2rem; }
  .sc-heading-l  { font-size: 1.5rem; }
  .sc-heading-m  { font-size: 1.25rem; }
}
.sc-body-l  { font-size: 1.375rem; line-height: 1.3636; font-weight: 400; }
.sc-body-s  { font-size: 1rem; line-height: 1.25; }
.sc-caption { display: block; font-size: 1rem; font-weight: 400; color: var(--sc-dark-grey); margin-bottom: 5px; }
p { margin: 0 0 20px; max-width: 42em; }
ul, ol { margin: 0 0 20px; padding-left: 20px; }
li { margin-bottom: 5px; }

/* ── 5. HEADER ───────────────────────────────────────────── */
.sc-header {
  background: var(--sc-black);
  border-bottom: 10px solid var(--sc-blue);
}
.sc-header__inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px var(--sc-gutter);
  max-width: var(--sc-max-width); margin: 0 auto;
}
.sc-header__logo { display: flex; align-items: baseline; gap: 10px; text-decoration: none; }
.sc-header__logotype {
  font-size: 1.375rem; font-weight: 700; color: var(--sc-white);
  letter-spacing: -0.01em;
}
.sc-header__logotype:hover { color: var(--sc-white); }
.sc-header__tag {
  font-size: 0.875rem; font-weight: 400; color: var(--sc-white);
  border: 1px solid rgba(255,255,255,0.6); border-radius: 3px;
  padding: 1px 7px;
}
.sc-header__links { display: flex; align-items: center; gap: 4px; }
.sc-header__link {
  color: var(--sc-white); font-size: 0.9375rem; font-weight: 400;
  padding: 8px 10px; text-decoration: none;
}
.sc-header__link:visited { color: var(--sc-white); }
.sc-header__link:hover { text-decoration: underline; }
.sc-header__cta {
  background: var(--sc-white); color: var(--sc-black) !important;
  font-weight: 700; padding: 8px 14px; margin-left: 6px;
  text-decoration: none !important;
}
.sc-header__cta:hover { background: var(--sc-light-grey); }
.sc-header__toggle {
  display: none; background: none; border: 2px solid var(--sc-white);
  color: var(--sc-white); font-family: var(--sc-font); font-weight: 700;
  font-size: 0.9375rem; padding: 6px 12px; cursor: pointer;
}

/* Service navigation — flat, no dropdowns */
.sc-service-nav {
  background: var(--sc-white); border-bottom: 1px solid var(--sc-mid-grey);
}
.sc-service-nav__inner {
  max-width: var(--sc-max-width); margin: 0 auto; padding: 0 var(--sc-gutter);
  display: flex; flex-wrap: wrap;
}
.sc-service-nav__link {
  display: block; padding: 14px 16px; font-weight: 700; font-size: 1rem;
  color: var(--sc-black); text-decoration: none; border-bottom: 4px solid transparent;
}
.sc-service-nav__link:visited { color: var(--sc-black); }
.sc-service-nav__link:hover { border-bottom-color: var(--sc-mid-grey); }
.sc-service-nav__link--active { border-bottom-color: var(--sc-blue); }

@media (max-width: 768px) {
  .sc-header__toggle { display: block; }
  .sc-header__links { display: none; }
  .sc-header__links.sc-open {
    display: flex; flex-direction: column; align-items: flex-start;
    position: absolute; top: 100%; left: 0; right: 0; z-index: 100;
    background: var(--sc-black); padding: 8px var(--sc-gutter) 16px;
  }
  .sc-header__inner { position: relative; flex-wrap: wrap; }
  .sc-service-nav__inner { flex-direction: column; }
  .sc-service-nav__link { border-bottom: 1px solid var(--sc-light-grey); }
}

/* Phase banner — the classic GOV.UK "this is a new service" strip */
.sc-phase-banner {
  border-bottom: var(--sc-border);
  padding: 10px 0;
}
.sc-phase-banner__inner {
  max-width: var(--sc-max-width); margin: 0 auto; padding: 0 var(--sc-gutter);
  display: flex; align-items: center; gap: 10px; font-size: 1rem;
}
.sc-tag {
  display: inline-block; text-transform: uppercase; letter-spacing: 0.05em;
  font-weight: 700; font-size: 0.75rem; padding: 4px 8px;
  background: var(--sc-blue); color: var(--sc-white);
}

/* ── 6. HERO / START PAGE PATTERN ────────────────────────── */
.sc-hero { padding: 48px 0 40px; border-bottom: var(--sc-border); }
.sc-hero h1 { margin-bottom: 16px; }
.sc-hero__lead {
  font-size: 1.375rem; line-height: 1.4; color: var(--sc-dark-grey);
  max-width: 40em; margin-bottom: 32px;
}
.sc-hero__list { max-width: 40em; }

/* ── 7. BUTTONS ──────────────────────────────────────────── */
.sc-button {
  font-family: var(--sc-font);
  display: inline-block;
  font-size: 1.1875rem; font-weight: 700; line-height: 1;
  padding: 12px 14px 14px;
  border: 2px solid transparent; border-radius: 0;
  cursor: pointer; text-decoration: none; text-align: center;
  color: var(--sc-white); background: var(--sc-green);
  box-shadow: 0 2px 0 var(--sc-green-dark);
}
.sc-button:visited { color: var(--sc-white); }
.sc-button:hover { background: #005a30; }
.sc-button:active { top: 2px; position: relative; box-shadow: none; }
.sc-button--start {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 1.375rem;
}
.sc-button--start svg { width: 18px; height: 19px; fill: var(--sc-white); }
.sc-button--secondary { background: var(--sc-light-grey); color: var(--sc-black); box-shadow: 0 2px 0 #929191; }
.sc-button--secondary:visited { color: var(--sc-black); }
.sc-button--secondary:hover { background: #dbdad9; }
.sc-button--inverse { background: var(--sc-white); color: var(--sc-black); box-shadow: 0 2px 0 var(--sc-mid-grey); }
.sc-button--inverse:visited { color: var(--sc-black); }

/* ── 8. LINK LIST / TOPIC GRID (replaces card-grid features) */
.sc-link-list { border-top: var(--sc-border); }
.sc-link-list__item {
  border-bottom: var(--sc-border);
  padding: 20px 0;
}
.sc-link-list__item h3 { margin-bottom: 6px; font-size: 1.1875rem; }
.sc-link-list__item h3 a { text-decoration: none; }
.sc-link-list__item h3 a:hover { text-decoration: underline; }
.sc-link-list__item p { margin: 0; color: var(--sc-dark-grey); font-size: 1rem; max-width: 100%; }

/* ── 9. ACCORDION (school types) ─────────────────────────── */
.sc-accordion__section { border-bottom: var(--sc-border); }
.sc-accordion__section:first-child { border-top: var(--sc-border); }
.sc-accordion__header {
  width: 100%; text-align: left; background: none; border: none;
  cursor: pointer; padding: 18px 0; display: flex; align-items: center;
  justify-content: space-between; gap: 16px; font-family: var(--sc-font);
}
.sc-accordion__header-text { font-size: 1.1875rem; font-weight: 700; color: var(--sc-black); }
.sc-accordion__icon {
  flex-shrink: 0; width: 24px; height: 24px; border: 2px solid var(--sc-blue);
  border-radius: 50%; position: relative;
}
.sc-accordion__icon::before, .sc-accordion__icon::after {
  content: ''; position: absolute; background: var(--sc-blue);
}
.sc-accordion__icon::before { top: 50%; left: 5px; right: 5px; height: 2px; transform: translateY(-1px); }
.sc-accordion__icon::after { left: 50%; top: 5px; bottom: 5px; width: 2px; transform: translateX(-1px); transition: opacity 0.1s; }
.sc-accordion__section--open .sc-accordion__icon::after { opacity: 0; }
.sc-accordion__panel { display: none; padding-bottom: 24px; }
.sc-accordion__section--open .sc-accordion__panel { display: block; }
.sc-accordion__panel p { color: var(--sc-dark-grey); }

/* ── 10. INSET TEXT (testimonials) ───────────────────────── */
.sc-inset-text {
  border-left: 5px solid var(--sc-mid-grey);
  padding: 8px 0 8px 20px;
  margin: 0 0 20px;
  color: var(--sc-dark-grey);
}
.sc-inset-text cite { display: block; font-style: normal; font-size: 0.9375rem; margin-top: 8px; color: var(--sc-black); font-weight: 700; }

/* ── 11. TRUST STRIP (logos, motion kept per brief) ──────── */
.sc-trust-strip { background: var(--sc-light-grey); border-top: var(--sc-border); border-bottom: var(--sc-border); overflow: hidden; }
.sc-trust-strip__track-wrap { overflow: hidden; padding: 18px 0; }
.sc-trust-strip__track { display: flex; align-items: center; gap: 8px; width: max-content; animation: sc-trust-scroll 26s linear infinite; }
.sc-trust-strip__track:hover { animation-play-state: paused; }
@keyframes sc-trust-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.sc-trust-strip__pill { display: flex; align-items: center; justify-content: center; padding: 0 26px; height: 56px; flex-shrink: 0; }
.sc-trust-strip__pill img { height: 32px; width: auto; max-width: 140px; object-fit: contain; filter: grayscale(100%); opacity: 0.7; }
@media (prefers-reduced-motion: reduce) {
  .sc-trust-strip__track { animation: none; flex-wrap: wrap; }
}

/* ── 12. CARDS (blog / content preview — flat, bordered) ─── */
.sc-card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 20px; }
.sc-card {
  display: block; text-decoration: none; color: inherit;
  border: var(--sc-border); background: var(--sc-white);
}
.sc-card__image { width: 100%; aspect-ratio: 16/10; overflow: hidden; background: var(--sc-light-grey); }
.sc-card__image img { width: 100%; height: 100%; object-fit: cover; }
.sc-card__body { padding: 16px; }
.sc-card__title { font-size: 1.1875rem; font-weight: 700; margin-bottom: 6px; color: var(--sc-black); }
.sc-card:hover .sc-card__title { text-decoration: underline; }
.sc-card__meta { font-size: 0.9375rem; color: var(--sc-dark-grey); margin: 0; }

/* ── 13. TAGS / STATUS ───────────────────────────────────── */
.sc-status-tag {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 0.9375rem; padding: 6px 12px; border: var(--sc-border);
  text-decoration: none; color: var(--sc-black);
}
.sc-status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--sc-mid-grey); flex-shrink: 0; }

/* ── 14. FOOTER ──────────────────────────────────────────── */
.sc-footer { background: var(--sc-light-grey); border-top: 3px solid var(--sc-mid-grey); padding: 40px 0 24px; }
.sc-footer__grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--sc-mid-grey); }
@media (max-width: 768px) { .sc-footer__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .sc-footer__grid { grid-template-columns: 1fr; } }
.sc-footer__heading { font-size: 1rem; font-weight: 700; margin-bottom: 14px; }
.sc-footer__list a { display: block; font-size: 0.9375rem; color: var(--sc-black); margin-bottom: 10px; text-decoration: underline; }
.sc-footer__list a:hover { color: var(--sc-blue-dark); }
.sc-footer__brand p { font-size: 0.9375rem; color: var(--sc-dark-grey); max-width: 32em; }
.sc-footer__meta { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; font-size: 0.875rem; color: var(--sc-dark-grey); }
.sc-footer__meta a { color: var(--sc-dark-grey); }

/* ── 15. COOKIE BANNER (GOV.UK's actual pattern) ─────────── */
.sc-cookie-banner {
  display: none; background: var(--sc-light-grey); border-bottom: 4px solid var(--sc-blue);
  padding: 20px 0;
}
.sc-cookie-banner.sc-show { display: block; }
.sc-cookie-banner__message { max-width: var(--sc-max-width); margin: 0 auto; padding: 0 var(--sc-gutter); }
.sc-cookie-banner__message h2 { font-size: 1.1875rem; margin-bottom: 8px; }
.sc-cookie-banner__message p { font-size: 1rem; margin-bottom: 16px; }
.sc-cookie-banner__buttons { display: flex; gap: 10px; flex-wrap: wrap; }

/* ── 16. VISUALLY HIDDEN UTILITY ─────────────────────────── */
.sc-visually-hidden {
  position: absolute !important; width: 1px !important; height: 1px !important;
  margin: 0 !important; overflow: hidden !important; clip: rect(0 0 0 0) !important;
  white-space: nowrap !important;
}