/* Spelly — the site chrome: the top bar and the footer, in the landing's design.
 *
 * WHY THIS FILE EXISTS (21-09-26). spelly.net has carried the green v2 design
 * since 11-09-26, but only the 15 landing pages. The blog, the Help Centre and
 * the comparison articles still wore the 30-08-26 menu (nav.css, a mega menu
 * with emoji dropdowns and a dark-mode moon) and three DIFFERENT footers: a
 * two-line strip on the blog, a one-line row of links on help, and a six-column
 * block on the articles. A reader who followed a link from the homepage landed
 * on what looked like another product.
 *
 * WHAT IT IS. The nav and footer rules of landing-v2.css, renamed with an `sc-`
 * prefix and given their own tokens, so they can be dropped onto a page that
 * already has its own :root, its own .nav, .brand, .wrap, .foot and its own
 * body background WITHOUT either side touching the other. Nothing here styles
 * page content; every page keeps the CSS it had.
 *
 * KEEP IT IN STEP WITH landing-v2.css. If the landing's bar or footer changes,
 * change it here too, or the site splits in two again. The markup lives in
 * scripts/site_chrome.py, which writes it into every page; edit it there and
 * rerun, never by hand in 69 files.
 *
 * NO DARK MODE ON PURPOSE. The landing has none (not even prefers-color-scheme),
 * so the old moon toggle on the blog and help made those two surfaces the only
 * dark pages on the site. theme-dark.css and nav.js went with it.
 */

/* Tokens are scoped to the chrome, never :root: the article pages define
   --ink, --surface and --stroke with different values for their own content. */
.sc-nav, .sc-foot {
  --sc-ink: #1F1145;
  --sc-tint: #FFF9E5;
  --sc-coin: #FFC42D;
  --sc-grass: #3DD068;
  --sc-stroke: 3px;
  --sc-display: 'Baloo 2', system-ui, sans-serif;
}

.sc-wrap { width: min(1120px, 100% - 40px); margin-inline: auto }

/* The brand tile: the app mark, same file and cache-buster as the landing. */
.sc-tile {
  display: inline-grid; place-items: center; width: 44px; height: 44px; flex: none;
  border-radius: 12px; background: var(--sc-grass) url(/spelly-mark.png?v=3) center/cover no-repeat;
  color: transparent; font-size: 0; line-height: 1;
}

/* ── the bar ─────────────────────────────────────────────────────────────── */
.sc-nav {
  position: sticky; top: 0; z-index: 50;
  background: var(--sc-tint); border-bottom: var(--sc-stroke) solid var(--sc-ink);
  font-family: var(--sc-display); font-weight: 800; color: var(--sc-ink);
}
/* The same 1120px wrap as the landing, so the logo does not jump sideways when a
   reader crosses from spelly.net to /blog. */
.sc-nav .sc-wrap { display: flex; align-items: center; gap: 14px; min-height: 72px }
.sc-brand {
  display: flex; align-items: center; gap: 10px; margin-inline-end: auto;
  text-decoration: none; font-family: var(--sc-display); font-weight: 800; font-size: 28px; color: var(--sc-ink);
}
.sc-brand:hover { color: var(--sc-ink); text-decoration: none }
/* "Blog" / "Help" beside the word mark, so a reader knows which surface they are on. */
.sc-brand .sc-tag {
  font-size: 15px; font-weight: 800; padding: 3px 10px; border-radius: 999px;
  background: var(--sc-coin); border: 2px solid var(--sc-ink); line-height: 1.3;
}
/* gap 2, not the landing's 4: French ("Commencer gratuitement" plus the Aide
   chip) was 8px over the 1120px wrap, and 7 gaps buy back 14. */
.sc-links { display: none; gap: 2px }
.sc-links a {
  font-family: var(--sc-display); font-weight: 800; font-size: 16px; text-decoration: none;
  color: var(--sc-ink); padding: 8px 10px; border-radius: 999px; white-space: nowrap;
}
.sc-links a:hover { background: rgba(31, 17, 69, .1); color: var(--sc-ink); text-decoration: none }
.sc-links a[aria-current="page"] { background: rgba(31, 17, 69, .1) }
/* 1120px, not the landing's 960: a sub-page bar also carries the surface chip
   (Blog / Help / Compare), and in Hebrew and Arabic the eight labels are wider.
   Measured at every width from 320 to 1600 on all five languages. */
@media (min-width: 1200px) { .sc-links { display: flex } }

.sc-lang { position: relative; flex: none }
.sc-lang summary {
  list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
  white-space: nowrap; min-height: 40px; padding: 0 14px; border-radius: 999px;
  border: var(--sc-stroke) solid var(--sc-ink); background: #fff;
  font-family: var(--sc-display); font-weight: 800; font-size: 15px; color: var(--sc-ink);
  box-shadow: 0 3px 0 var(--sc-ink);
}
.sc-lang summary::-webkit-details-marker { display: none }
.sc-lang-menu {
  position: absolute; inset-inline-end: 0; top: calc(100% + 10px); width: 220px; z-index: 70;
  background: #fff; border: var(--sc-stroke) solid var(--sc-ink); border-radius: 18px;
  box-shadow: 0 6px 0 var(--sc-ink); padding: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 2px;
}
.sc-lang-menu a {
  text-decoration: none; font-family: var(--sc-display); font-weight: 600; font-size: 14px;
  color: var(--sc-ink); padding: 6px 8px; border-radius: 8px;
}
.sc-lang-menu a:hover { background: var(--sc-tint); color: var(--sc-ink); text-decoration: none }

.sc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap;
  min-height: 44px; padding: 0 18px; border-radius: 999px; border: var(--sc-stroke) solid var(--sc-ink);
  font-family: var(--sc-display); font-weight: 800; font-size: 16px; text-decoration: none;
  background: var(--sc-ink); color: #fff; box-shadow: 0 5px 0 #0E0724;
  transition: transform .08s, box-shadow .08s;
}
.sc-btn:hover { color: #fff; text-decoration: none }
.sc-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #0E0724 }
.sc-nav .sc-btn { display: none; flex: none }
@media (min-width: 640px) { .sc-nav .sc-btn { display: inline-flex } }

/* ── the drawer, under 1200px ────────────────────────────────────────────── */
.sc-toggle {
  display: none; width: 44px; height: 44px; flex: none; padding: 0; place-items: center;
  border: var(--sc-stroke) solid var(--sc-ink); border-radius: 12px; background: #fff;
  box-shadow: 0 4px 0 var(--sc-ink); cursor: pointer;
}
.sc-toggle span {
  display: block; width: 20px; height: 3px; background: var(--sc-ink); border-radius: 2px;
  box-shadow: 0 -6px 0 var(--sc-ink), 0 6px 0 var(--sc-ink);
}
.sc-drawer { display: none }
@media (max-width: 1199px) {
  .sc-toggle { display: grid }
  .sc-drawer {
    display: none; position: absolute; left: 0; right: 0; top: 100%; z-index: 60;
    background: var(--sc-tint); border-bottom: var(--sc-stroke) solid var(--sc-ink);
    padding: 12px 18px 18px; max-height: calc(100vh - 72px); overflow-y: auto;
  }
  .sc-drawer.open { display: grid; gap: 4px }
  /* :not(.sc-btn) or this rule wins on specificity and paints the Start free
     button's label ink on ink, which is invisible. */
  .sc-drawer a:not(.sc-btn) {
    font-family: var(--sc-display); font-weight: 800; font-size: 18px; text-decoration: none;
    color: var(--sc-ink); padding: 12px 10px; border-radius: 12px;
  }
  .sc-drawer a:not(.sc-btn):hover { background: rgba(31, 17, 69, .08); color: var(--sc-ink); text-decoration: none }
  .sc-drawer .sc-btn { display: inline-flex; margin-top: 8px; justify-self: start }
}

/* ── the footer ──────────────────────────────────────────────────────────── */
.sc-foot {
  background: var(--sc-ink); color: #fff; padding: 56px 0 32px; margin-top: 60px;
  font-family: var(--sc-display); font-weight: 600; font-size: 17px; line-height: 1.5; text-align: start;
}
.sc-foot a { color: #fff; text-decoration: none; opacity: .85 }
.sc-foot a:hover { opacity: 1; color: #fff; text-decoration: underline }
.sc-foot p { margin: 0 }
.sc-foot ul { margin: 0; padding: 0; list-style: none }
.sc-foot h4 { font-family: var(--sc-display); font-weight: 800; font-size: 15px; margin: 0 0 10px; color: var(--sc-coin); line-height: 1.2 }
.sc-foot-top { display: grid; gap: 26px; margin-bottom: 36px }
@media (min-width: 800px) { .sc-foot-top { grid-template-columns: 1.2fr 2fr } }
.sc-foot-brand { display: flex; align-items: center; gap: 10px; font-family: var(--sc-display); font-weight: 800; font-size: 26px }
.sc-foot-blurb { margin-top: 12px; opacity: .85 }
.sc-foot-kicker {
  font-family: var(--sc-display); font-weight: 800; font-size: 13px; letter-spacing: .09em;
  text-transform: uppercase; color: var(--sc-coin); margin-top: 18px;
}
.sc-foot-langs { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 14px; margin: 12px 0 }
.sc-cols { display: grid; gap: 22px; grid-template-columns: repeat(2, 1fr) }
@media (min-width: 640px) { .sc-cols { grid-template-columns: repeat(3, 1fr) } }
@media (min-width: 960px) { .sc-cols { grid-template-columns: repeat(6, 1fr) } }
.sc-cols li { margin: 6px 0; font-size: 14px }
.sc-foot-about { grid-template-columns: 1fr }
.sc-foot-about ul { display: flex; flex-wrap: wrap; gap: 6px 18px }
.sc-legal { border-top: 1px solid rgba(255, 255, 255, .2); padding-top: 22px; font-size: 13px; opacity: .75; margin-top: 36px }

/* The real store artwork, as on the landing. Google's PNG carries a third of its
   own height as clear space, so it needs the taller box and a negative margin. */
.sc-badges { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 4px }
.sc-badge { display: inline-flex; align-items: center; line-height: 0 }
.sc-badge img { display: block; height: 35px; width: auto }
.sc-badge.is-gp img { height: 52px; margin-inline: -8px }
.sc-foot-chrome { margin-top: 10px; font-size: 14px }

/* Under 400px the brand, the chip, the language pill and the burger together
   ran past the edge (measured: 64px over at 320px). Everything steps down;
   nothing is dropped, so the reader still knows where they are. */
@media (max-width: 420px) {
  .sc-brand { font-size: 21px; gap: 7px }
  .sc-brand .sc-tag { font-size: 12px; padding: 2px 7px; border-width: 2px }
  .sc-tile { width: 36px; height: 36px; border-radius: 10px }
  .sc-nav .sc-wrap { gap: 8px; min-height: 64px }
  .sc-lang summary { padding: 0 10px; font-size: 14px; min-height: 38px }
  .sc-toggle { width: 40px; height: 40px }
}
/* The smallest phones still in use (320px): "Compare" and "مساعدة" are the
   widest chips and pushed the burger off the edge. */
@media (max-width: 360px) {
  .sc-brand { font-size: 19px; gap: 6px }
  .sc-brand .sc-tag { font-size: 11px; padding: 2px 6px }
  .sc-tile { width: 32px; height: 32px }
  .sc-nav .sc-wrap { gap: 6px; width: min(1120px, 100% - 24px) }
  .sc-lang summary { padding: 0 8px }
}

/* An anchor must clear the sticky bar. */
html { scroll-padding-top: 88px }
