/* WEBRULES1 (Greg, 20 Nov 2026) — THE website style. Every "ruled" page (test/webrules.json) takes its fonts,
   colours, spacing and building blocks from this one file and sets none of its own. The rules in words:
   Notion "Website rules — layout, spacing, fonts, colours". The checks: test/webrules1.test.mjs (the page
   files) and test/webrules1.browser.mjs (what a phone and a computer actually show). */

:root {
  /* colours — these and no others */
  --bsw-blue: #0E76BC;      /* buttons, links, card top bar */
  --bsw-blue-d: #0A5488;    /* lead words on a white card */
  --bsw-ink: #3E3E3E;       /* body text on a white card */
  --bsw-soft: #6B6B6B;      /* hints and small print */
  --bsw-white: #FFFFFF;     /* text on a photo or blue panel */
  --bsw-good: #1B7A4F;      /* "yes", ticks, places left */
  --bsw-ground: #F2F5F7;    /* behind a card */
  --bsw-line: #DDE3E7;      /* thin lines */
  --bsw-yes-bg: #EEF7F1;    /* the "yes" notice */
  /* fonts */
  --bsw-display: "Bebas", "Bebas Neue", Impact, sans-serif;
  --bsw-body: "Raleway", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  /* spacing — 8, 16, 24, 32, 48 */
  --s1: 8px; --s2: 16px; --s3: 24px; --s4: 32px; --s5: 48px;
  --bsw-radius: 26px;
}

/* ── the page body ───────────────────────────────────────────────────────────────────────────── */
body.bsw-ruled #wsite-content.bsw-main {
  background: url("/uploads/2/5/7/3/25738155/background-images/646507619.png") center top / cover no-repeat, var(--bsw-blue);
  padding: var(--s4) var(--s2) var(--s5);
  font-family: var(--bsw-body); color: var(--bsw-ink);
}
body.bsw-ruled .bsw-col { max-width: 720px; margin: 0 auto; display: flex; flex-direction: column; gap: var(--s4); }
@media (min-width: 768px) {
  body.bsw-ruled #wsite-content.bsw-main { padding: var(--s5) var(--s3) var(--s5); }
  body.bsw-ruled .bsw-col { gap: var(--s5); }
}

/* ── headings: Bebas Neue, italic, capitals, a clear gap between words (Greg 20 Nov: one space too tight, three too wide) ───────────────────────── */
body.bsw-ruled .bsw-h1, body.bsw-ruled .bsw-h2, body.bsw-ruled .bsw-h3,
body.bsw-ruled .bswim-chooser .bs-q, body.bsw-ruled .bswim-chooser .bs-code {
  font-family: var(--bsw-display) !important; font-style: italic !important; font-weight: normal;
  text-transform: uppercase; letter-spacing: 0 !important; word-spacing: 0.2em !important; line-height: 1.02;
}
body.bsw-ruled .bsw-h1 { font-size: 2.6rem; color: var(--bsw-white); text-align: center; margin: 0; }
body.bsw-ruled .bsw-h2 { font-size: 2rem; color: var(--bsw-ink); text-align: center; margin: 0 0 var(--s2); }
body.bsw-ruled .bsw-h3 { font-size: 1.6rem; color: var(--bsw-ink); margin: 0 0 var(--s1); }
@media (min-width: 768px) { body.bsw-ruled .bsw-h1 { font-size: 3.2rem; } }

/* ── body text: Raleway ──────────────────────────────────────────────────────────────────────── */
/* Greg 20 Nov 2026: the smallest text anywhere is 20% bigger than before — 1.25rem (20px) is the minimum */
body.bsw-ruled .bsw-main p, body.bsw-ruled .bsw-main li { font-family: var(--bsw-body); font-size: 1.25rem; line-height: 1.55; font-style: normal; }
body.bsw-ruled .bsw-main p { margin: 0 0 var(--s2); }
body.bsw-ruled .bsw-main p:last-child { margin-bottom: 0; }
body.bsw-ruled .bsw-lead { color: var(--bsw-blue-d); font-weight: 700; }
body.bsw-ruled .bsw-small { color: var(--bsw-soft); }
body.bsw-ruled .bsw-label { font-family: var(--bsw-body); font-weight: 700; font-size: 1.25rem; letter-spacing: .08em; text-transform: uppercase; color: var(--bsw-soft); margin: 0 0 var(--s1); }
body.bsw-ruled .bsw-list { margin: 0; padding: 0 0 0 1.2em; text-align: left; }
body.bsw-ruled .bsw-list li { margin: 0 0 var(--s1); color: var(--bsw-ink); }
body.bsw-ruled .bsw-list li:last-child { margin-bottom: 0; }
body.bsw-ruled .bsw-list + p, body.bsw-ruled .bsw-list + .bsw-quote { margin-top: var(--s2); }
body.bsw-ruled .bsw-main a:not(.bsw-btn) { color: var(--bsw-blue); text-decoration: underline; }

/* ── 1. page title panel ─────────────────────────────────────────────────────────────────────── */
body.bsw-ruled .bsw-panel {
  position: relative; z-index: 5;
  background: rgba(10, 84, 136, .55); border-radius: var(--bsw-radius); padding: var(--s3) var(--s2); text-align: center;
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
body.bsw-ruled .bsw-panel .bsw-sub { color: var(--bsw-white); font-size: 1.25rem; line-height: 1.5; margin: var(--s1) 0 0; text-align: center; }

/* ── 2. white card ───────────────────────────────────────────────────────────────────────────── */
body.bsw-ruled .bsw-card {
  background: var(--bsw-white); border-radius: var(--bsw-radius); padding: var(--s3); text-align: left; color: var(--bsw-ink);
  box-shadow: 0 6px 18px rgba(10, 84, 136, .18); border: 0;
}
@media (min-width: 768px) { body.bsw-ruled .bsw-card { padding: var(--s4); } }


/* ── 3. button ───────────────────────────────────────────────────────────────────────────────── */
body.bsw-ruled .bsw-btn {
  display: block; width: 100%; min-height: 52px; box-sizing: border-box; padding: 14px var(--s3); margin: var(--s2) 0 0;
  background: var(--bsw-blue); color: var(--bsw-white) !important; border: 0; border-radius: 999px;
  font-family: var(--bsw-body); font-weight: 700; font-size: 1.25rem; letter-spacing: .06em; text-transform: uppercase;
  text-align: center; text-decoration: none !important; cursor: pointer;
}
body.bsw-ruled .bsw-btn:hover { background: var(--bsw-blue-d); }
@media (min-width: 768px) { body.bsw-ruled .bsw-btn { max-width: 420px; margin-left: auto; margin-right: auto; } }

/* ── 4. the "yes" notice ─────────────────────────────────────────────────────────────────────── */
body.bsw-ruled .bsw-yes { background: var(--bsw-yes-bg); border-radius: 20px; padding: var(--s2); margin: var(--s2) 0 0; }
body.bsw-ruled .bsw-yes p { margin: 0 0 var(--s1); }
body.bsw-ruled .bsw-yes b { color: var(--bsw-good); }

/* a review quote: the one place italics are allowed */
body.bsw-ruled .bsw-quote { margin: var(--s2) 0 0; padding: 0 0 0 var(--s2); border-left: 4px solid var(--bsw-line); }
body.bsw-ruled .bsw-quote p { font-style: italic; color: var(--bsw-ink); }
body.bsw-ruled .bsw-quote cite { display: block; font-style: normal; color: var(--bsw-soft); font-size: 1.25rem; margin-top: var(--s1); }

/* ── the class chooser inside a ruled page: same fonts, colours and heading spacing ───────────── */
body.bsw-ruled .bswim-chooser { background: transparent !important; padding: 0 !important; margin: 0 !important; box-shadow: none !important; max-width: none !important; }
body.bsw-ruled .bswim-chooser .bs-panel { box-shadow: none !important; padding: 0 !important; border: 0 !important; background: transparent !important; }
body.bsw-ruled .bswim-chooser .bs-panel::before { display: none !important; }
body.bsw-ruled .bswim-chooser .bs-q { font-size: 1.9rem; color: var(--bsw-ink); margin: 0 0 var(--s1); }
body.bsw-ruled .bswim-chooser .bs-step { color: var(--bsw-soft); }
body.bsw-ruled .bswim-chooser .bs-hint, body.bsw-ruled .bswim-chooser .bs-opt span { color: var(--bsw-soft); }
body.bsw-ruled .bswim-chooser .bs-opt b { color: var(--bsw-ink); }
body.bsw-ruled .bswim-chooser .bs-cta { background: var(--bsw-blue); color: var(--bsw-white) !important; }

/* the one payments wording (scripts/webads4_payments.html, shared with unruled pages) dressed as a white card */
body.bsw-ruled .bsw4-card { max-width: none; margin: 0; padding: var(--s3); border-radius: var(--bsw-radius); }
@media (min-width: 768px) { body.bsw-ruled .bsw4-card { padding: var(--s4); } }
body.bsw-ruled .bsw4-card .bsw4-h { font-family: var(--bsw-display) !important; font-style: italic; text-transform: uppercase; letter-spacing: 0 !important;
  word-spacing: 0.2em !important; font-size: 2rem; color: var(--bsw-ink); text-align: center; margin: 0 0 var(--s2); line-height: 1.02; }
body.bsw-ruled .bsw4-card ul { margin: 0; padding: 0 0 0 1.2em; }
body.bsw-ruled .bsw4-card li { margin: 0 0 var(--s1); color: var(--bsw-ink); }
body.bsw-ruled .bsw4-card li b { color: var(--bsw-blue-d); }

/* the chooser's own text at the same 1.25rem minimum */
body.bsw-ruled .bswim-chooser .bs-step, body.bsw-ruled .bswim-chooser .bs-hint, body.bsw-ruled .bswim-chooser .bs-opt b,
body.bsw-ruled .bswim-chooser .bs-opt span, body.bsw-ruled .bswim-chooser .bs-crumb, body.bsw-ruled .bswim-chooser .bs-restart,
body.bsw-ruled .bswim-chooser .bs-cta, body.bsw-ruled .bswim-chooser .bs-name span, body.bsw-ruled .bswim-chooser .bs-name input,
body.bsw-ruled .bswim-chooser .bs-note, body.bsw-ruled .bswim-chooser .bs-kids, body.bsw-ruled .bswim-chooser p,
body.bsw-ruled .bswim-chooser .bs-opt em, body.bsw-ruled .bswim-chooser .bs-places, body.bsw-ruled .bswim-chooser .bs-codelabel,
body.bsw-ruled .bswim-chooser .bs-matters div, body.bsw-ruled .bs4-dummy { font-size: 1.25rem !important; line-height: 1.45; }
body.bsw-ruled .bsw4-card li, body.bsw-ruled .bsw4-card p { font-size: 1.25rem; line-height: 1.55; }

/* ── 5. a word you can tap: a small pop-up with a few short facts (Greg, 20 Nov 2026) ───────────────
   The box opens just under the word (js/bsw.js places it sideways so it stays on screen). */
body.bsw-ruled .bsw-tip { position: relative; display: inline; cursor: pointer; outline: none;
  border-bottom: 2px dotted currentColor; -webkit-tap-highlight-color: transparent; -webkit-user-select: none; user-select: none; }
body.bsw-ruled .bsw-tip:focus-visible { outline: 2px solid var(--bsw-blue); outline-offset: 2px; }
body.bsw-ruled .bsw-tip-box { display: none; position: absolute; z-index: 30; left: 0; top: calc(100% + 6px);
  width: min(300px, calc(100vw - 24px)); box-sizing: border-box; padding: var(--s2); background: var(--bsw-white); color: var(--bsw-ink);
  border-radius: 16px; box-shadow: 0 10px 28px rgba(10, 84, 136, .35); text-align: left; font-weight: normal; font-style: normal;
  font-family: var(--bsw-body); font-size: 1.25rem; line-height: 1.4; text-transform: none; letter-spacing: 0; white-space: normal; cursor: default; }
body.bsw-ruled .bsw-tip-box b { display: block; color: var(--bsw-blue-d); margin-bottom: var(--s1); }
body.bsw-ruled .bsw-tip-row { display: block; margin-top: var(--s1); }
body.bsw-ruled .bsw-tip.bsw-open .bsw-tip-box { display: block; }
@media (hover: hover) { body.bsw-ruled .bsw-tip:hover .bsw-tip-box { display: block; } }
body.bsw-ruled .bsw-card { position: relative; }
body.bsw-ruled .bsw-card:has(.bsw-open), body.bsw-ruled .bsw-card:hover { z-index: 10; }

/* WEBRULES3: a link to a page's class finder (#find-your-class) stops below the fixed top bar, so the first question shows */
body.bsw-ruled #find-your-class { scroll-margin-top: 120px; }

/* WEBRULES4: links inside the title panel are white (blue on the blue panel can't be read); the home page's sketch picture */
body.bsw-ruled .bsw-main .bsw-panel a:not(.bsw-btn) { color: var(--bsw-white); }
body.bsw-ruled .bsw-sign { display: block; width: 253px; max-width: 100%; height: auto; margin: var(--s2) 0 var(--s1); }
/* the home heading is long: a little smaller on a phone so the button and the Swim App link show above the cookie bar on a first visit */
@media (max-width: 767px) {
  body.bsw-ruled #wsite-content.bsw-main:has(#start) { padding-top: var(--s2); }
  body.bsw-ruled #start { padding: 20px var(--s2); }
  body.bsw-ruled #start .bsw-h1 { font-size: 2.3rem; line-height: 1.05; }
  body.bsw-ruled #start .bsw-sub { line-height: 1.35; margin-top: 10px; }
  body.bsw-ruled #start .bsw-btn { margin-top: 16px; letter-spacing: .02em; padding-left: 12px; padding-right: 12px; }
}

/* WEBRULES4 (Greg, 20 Nov 2026): a blue button gets lost on the blue title panel — there it is white with brand-blue words */
body.bsw-ruled .bsw-panel .bsw-btn { background: var(--bsw-white); color: var(--bsw-blue) !important; box-shadow: 0 4px 14px rgba(10, 84, 136, .35); }
body.bsw-ruled .bsw-panel .bsw-btn:hover { background: var(--bsw-ground); }

/* WEBRULES6: a picture inside a card (certificate, badges) — full card width at most, centred, rounded */
body.bsw-ruled .bsw-pic { display: block; max-width: 100%; height: auto; margin: var(--s2) auto 0; border-radius: 12px; }
/* a small heading after a list inside a card gets the section gap above it */
body.bsw-ruled .bsw-list + .bsw-h3 { margin-top: var(--s3); }
