/* ═══════════════════════════════════════════════════════════
   DOORS Canada · site stylesheet
   For the BROWSING pages: home, Learn, Play, Download,
   Find a Class, About, Contact. Load doors-core.css first.

   Lessons and games do not use this file — they load
   css/lesson.css instead, which has the slim top bar.
   ═══════════════════════════════════════════════════════════ */

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-body);
}

a { color: var(--link); }
a:hover { color: var(--link-hover); }

/* ── Full site header: logo + nav links ── */
.site-nav {
  background: var(--bar);
  padding: 12px 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand-link {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  height: 60px;
  filter: brightness(0) invert(1);
}

.brand-text {
  font-family: var(--font-heading);
  font-size: 19px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.25;
}

.brand-tagline {
  font-weight: 700;
  font-size: 14px;
  color: var(--bar-accent-yellow);   /* encouragement yellow, matches the active-page underline */
}

.nav-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 24px;
}

.nav-link {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  padding: 10px 0;
}

.nav-link:hover { color: var(--bar-ink-white); }

/* The page the visitor is on right now */
.nav-link.here {
  color: var(--bar-ink-white);
  border-bottom: 3px solid var(--bar-accent-yellow);
}

/* ── Dark mode link ──
   A real <button>, styled as underlined text so it sits in the bar at the
   same weight as the nav links beside it. Plenty of people using this site
   are meeting the light/dark convention for the first time, so the words
   name what a click does rather than showing a sun or a moon.

   Both wordings ship in the markup and only one is ever shown, so the link
   always describes the next state and needs no separate on/off indicator.

   Every colour here is one of the two --bar-* values, which are declared
   once and never flipped, because the bar is dark in BOTH themes. That is
   why this component needs no [data-theme="dark"] rule of its own. */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 44px;          /* touch target — never take this below 44px */
  flex-shrink: 0;
  padding: 8px 2px;
  border: 0;
  background: transparent;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 16px;           /* the nav-link size — the floor in style.md */
  font-weight: 700;
  line-height: 1.2;
  color: var(--bar-ink-white);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.theme-toggle:hover { color: var(--bar-accent-yellow); }

/* Not a removal of the global focus ring — a recolour of it. The core
   ring is --blue, which is 2.24:1 against the green bar in light mode and
   too faint to find. Same 3px, same offset, in a colour the bar carries. */
.theme-toggle:focus-visible {
  outline: 3px solid var(--bar-accent-yellow);
  outline-offset: 2px;
}

/* The label swap. The head snippet sets data-theme before the first paint,
   so the correct wording is the one that renders — the other is never shown
   and, being display:none, is never read out either. */
.theme-toggle .theme-toggle-to-light { display: none; }
[data-theme="dark"] .theme-toggle .theme-toggle-to-dark  { display: none; }
[data-theme="dark"] .theme-toggle .theme-toggle-to-light { display: inline; }

/* ── Breadcrumbs: "Home › Learn" strip under the header.
      Every page except the homepage has one. The last item is
      the page you're on (not a link). ── */
.crumbs {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 10px 48px;
  font-family: var(--font-body);
  font-size: 19px;   /* Sylexiad runs small — keep crumbs comfortably readable */
}

.crumbs a {
  text-decoration: none;
  font-weight: 700;
}

.crumbs .crumb-sep { color: var(--mid); padding: 0 6px; }
.crumbs .crumb-here { color: var(--mid); font-weight: 700; }

/* ── Tags: small labels on cards saying what kind of thing it is
      (Lesson, Game, Printable) and what it's about (AI, Identity…).
      Labels only for now — they become filters when a section
      grows past ~6 items. ── */
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 4px 12px;
}

/* Type tags (what it is) */
.tag-lesson    { background: var(--chip-blue-bg);   color: var(--chip-blue-ink); }
.tag-game      { background: var(--chip-yellow-bg); color: var(--chip-amber-ink); }
.tag-printable { background: var(--chip-green-bg);  color: var(--chip-green-ink); }
.tag-slides    { background: var(--card-tint);      color: var(--green); }

/* Topic tags (what it's about) */
.tag-ai        { background: var(--p-purple); color: var(--purple); }
.tag-identity  { background: var(--chip-pink-bg);   color: var(--chip-pink-ink); }
.tag-passwords { background: var(--bg);       color: var(--mid); }

/* ── Hero: big title + mascot. Every browsing page has one;
      inner pages use the shorter .hero.compact variant. ── */
.hero {
  background: var(--bg) url("../img/DOORS-slide-background.jpg") center bottom / cover no-repeat;
  padding: 72px 56px 60px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 48px;
  min-height: 360px;
}

.hero.compact {
  min-height: 240px;
  padding: 48px 56px 40px;
}

.hero-text {
  flex: 1;
  max-width: 640px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: clamp(44px, 6vw, 68px);
  font-weight: 700;
  color: var(--green);
  line-height: 1.05;
}

.hero-description {
  font-size: 26px;
  color: var(--hero-ink);
  margin-top: 18px;
  line-height: 1.6;
  max-width: 560px;
}

.hero-mascot {
  height: 300px;
  flex-shrink: 0;
  align-self: flex-end;
  margin-bottom: -60px;
  position: relative;
  z-index: 1;
}

.hero.compact .hero-mascot { height: 220px; margin-bottom: -40px; }

/* ── Section colours ──
   Every section owns one DOORS colour (see doors-core.css for
   what each colour means). Put the theme class on <body> and the
   page's hero band and title pick it up automatically. */
body.theme-learn .hero.compact    { background: var(--chip-blue-bg); }
body.theme-learn .hero-title      { color: var(--chip-blue-ink); }

body.theme-play .hero.compact     { background: var(--p-yellow); }
body.theme-play .hero-title       { color: var(--orange); }

body.theme-download .hero.compact { background: var(--p-green); }
body.theme-download .hero-title   { color: var(--green); }

body.theme-class .hero.compact    { background: var(--p-pink); }
body.theme-class .hero-title      { color: var(--pink); }

body.theme-about .hero.compact    { background: var(--p-purple); }
body.theme-about .hero-title      { color: var(--purple); }

/* ── Content cards (games, lessons, downloads, news) ── */
.cards-section {
  padding: 56px 48px 48px;
  background: var(--surface);
  max-width: 960px;
  margin: 0 auto;
}

/* A small Verdana heading above a card group, e.g. "New on the site" */
.cards-heading {
  font-family: var(--font-heading);
  font-size: 28px;
  font-weight: 700;
  color: var(--green);
  margin-bottom: 24px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 36px;
}

/* Ladder variant: one full-width card per rung, stacked vertically.
   Used for the homepage's Learn / Play / Download cards. */
.cards-ladder {
  grid-template-columns: 1fr;
  gap: 28px;
}

.game-card {
  text-decoration: none;
  display: block;
  border: 1px solid var(--line);
  border-radius: 20px;
  overflow: hidden;
  transition: box-shadow 0.15s ease;
  background: var(--surface);
}

.game-card:hover { box-shadow: 0 4px 20px var(--shadow); }

.card-header {
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
}

/* One class per brand colour, so cards can be varied deliberately */
.card-header-purple { background: var(--purple); }
.card-header-blue   { background: var(--blue); }
.card-header-green  { background: var(--green); }
.card-header-orange { background: var(--orange); }
.card-header-pink   { background: var(--pink); }

.card-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Card icons take their colour from the header they sit on. The SVGs
   use stroke="currentColor", so this is the single place the colour
   is decided, in both themes. */
.card-header-blue   .card-icon svg { color: var(--p-blue); }
.card-header-green  .card-icon svg { color: var(--p-green); }
.card-header-orange .card-icon svg { color: var(--p-yellow); }
.card-header-purple .card-icon svg { color: var(--p-purple); }
.card-header-pink   .card-icon svg { color: var(--p-pink); }

.card-title {
  font-family: var(--font-heading);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}

.card-body { padding: 22px 28px; }

.card-description {
  font-size: 23px;
  color: var(--mid);
  line-height: 1.6;
  margin-bottom: 14px;
}

.card-action {
  font-family: var(--font-heading);
  font-size: 16px;
  font-weight: 700;
  color: var(--blue);
}

/* Small tag on a card, e.g. "Added July 2026" */
.card-date {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--mid);
  background: var(--bg);
  border-radius: 999px;
  padding: 4px 12px;
  margin-bottom: 10px;
}

/* ── Download cards: like game cards but with real buttons ── */
.resource-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.btn {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
  text-align: center;
  border-radius: 999px;
  padding: 10px 20px;
  min-height: 44px;          /* touch target — keep at least 44px */
  border: 2px solid var(--green);
}

.btn-solid {
  background: var(--green);
  color: #fff;
}

.btn-solid:hover { background: var(--btn-solid-hover); color: #fff; }

.btn-outline {
  background: var(--surface);
  color: var(--green);
}

.btn-outline:hover { background: var(--p-green); color: var(--green); }

/* ── "New on the site" band: a soft encouragement-yellow wash
      that sets the newest additions apart from the section cards
      above. Wraps a normal .cards-section. ── */
.band-new {
  background: var(--chip-blue-bg);   /* pairs with --edge-blue below */
  border-top: 1px solid var(--edge-blue);
  border-bottom: 1px solid var(--edge-blue);
}

.band-new .cards-section { background: transparent; }
.band-new .cards-heading { color: #fff; }
.band-new .game-card { border-color: var(--edge-blue); }

/* ── News: dated announcements on the homepage ── */
.news-section {
  background: var(--bg);
  border-top: 1px solid var(--line);
  padding: 48px;
}

.news-inner { max-width: 960px; margin: 0 auto; }

.news-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 22px 28px;
  margin-bottom: 14px;
}

.news-date {
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--orange);
  margin-bottom: 6px;
}

.news-item h3 {
  font-family: var(--font-heading);
  font-size: 21px;
  color: var(--ink);
  margin-bottom: 6px;
}

.news-item p {
  font-size: 20px;
  color: var(--mid);
  line-height: 1.6;
}

/* ── Plain text pages (About, Contact, Find a Class) ── */
.page-content {
  max-width: 720px;
  margin: 0 auto;
  padding: 48px;
}

.page-content h2 {
  font-family: var(--font-heading);
  font-size: 30px;
  color: var(--green);
  margin: 32px 0 12px;
}

.page-content h2:first-child { margin-top: 0; }

.page-content p {
  font-size: 22px;
  color: var(--mid);
  line-height: 1.7;
  margin-bottom: 16px;
}

/* ── Bookmark tip (homepage helper bubble) ── */
#bookmark-tip {
  display: none;
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 100;
  flex-direction: column;
  align-items: flex-end;
}

#bookmark-tip.is-visible { display: flex; }

.bookmark-mascot {
  height: 80px;
  margin-bottom: -40px;
  margin-right: -8px;
  position: relative;
  z-index: 1;
  transform: scaleX(-1);
}

.bookmark-content {
  background: var(--green);
  color: #fff;
  padding: 18px 28px;
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 500px;
}

.bookmark-message {
  flex: 1;
  font-size: 18px;
  line-height: 1.5;
}

.bookmark-button {
  font-family: var(--font-heading);
  background: rgba(255, 255, 255, 0.2);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 8px 16px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  min-height: 36px;
}

/* ── Footer ── */
.site-footer {
  padding: 36px 48px;
  background: var(--bg);
  border-top: 1px solid var(--line);
}

.site-footer-text {
  max-width: 960px;
  margin: 0 auto;
  font-size: 20px;
  color: var(--mid);
  line-height: 1.6;
  text-align: center;
}

.footer-link {
  color: var(--blue);
  text-decoration: none;
  font-weight: 700;
}

/* ── Small screens ── */
@media (max-width: 700px) {
  .site-nav {
    padding: 10px 16px;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .brand-logo { height: 44px; }
  .brand-text { font-size: 16px; }
  .nav-links { gap: 4px 18px; }

  .hero,
  .hero.compact {
    flex-direction: column;
    align-items: stretch;
    padding: 36px 24px 0;
    gap: 0;
    min-height: 0;
  }

  .hero-text { max-width: 100%; }

  .hero-mascot,
  .hero.compact .hero-mascot {
    height: 170px;
    align-self: flex-end;
    margin-bottom: -36px;
  }

  .cards-section { padding: 48px 20px 32px; }
  .news-section { padding: 36px 20px; }
  .page-content { padding: 36px 24px; }
  .site-footer { padding: 28px 20px; }

  #bookmark-tip {
    left: 16px;
    right: 16px;
    transform: none;
  }
}

/* ── 404 return block ──
   One clear action instead of three cards. The whole block is the target,
   so it is far past the 44px floor without needing a stated size. */
.home-return-wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 8px 48px 64px;
}

.home-return {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 28px 36px;
  border-radius: 24px;
  background: var(--green);
  text-decoration: none;
  transition: box-shadow 0.15s ease;
}

.home-return:hover { box-shadow: 0 4px 20px var(--shadow); }

.home-return-arrow {
  height: 120px;
  flex-shrink: 0;
  border-radius: 12px;
}

.home-return-text {
  font-family: var(--font-heading);
  font-size: 32px;
  font-weight: 700;
  line-height: 1.2;
  color: var(--bar-ink-white);
}

[data-theme="dark"] .home-return-text { color: var(--on-brand-ink); }

@media (max-width: 700px) {
  .home-return-wrap { padding: 8px 20px 48px; }
  .home-return { gap: 20px; padding: 22px 24px; }
  .home-return-arrow { height: 88px; }
  .home-return-text { font-size: 26px; }
}

/* ── Dark mode: text on brand fills ──
   The brand colours are light in dark mode, so white text on them
   would vanish. These are the only rules in this file that name a
   colour directly, because they exist only for one theme. */
[data-theme="dark"] .card-title,
[data-theme="dark"] .btn-solid,
[data-theme="dark"] .btn-solid:hover { color: var(--on-brand-ink); }

/* The homepage hero paints a near-white pastel illustration over var(--bg)
   with `cover`, and an image does not flip. Left alone, the two largest
   pieces of text on the front page land at 1.85:1 and 1.72:1 — invisible.

   Rather than drop the art, re-expose it for a dark ground. invert() alone
   is wrong: it takes the green band to magenta and the pink hands to green.
   hue-rotate(180deg) puts the hues back, brightness and saturate return the
   life the inversion costs, and `screen` against var(--bg) makes the now-
   black ground land on exactly #131519 — the same value as the page, so the
   band has no seam. Measured on the actual file: the lightest pixel behind
   the text goes #FFFFFF -> #461E38, taking the title to 7.52:1 and the
   description to 8.11:1. Both were under 2:1.

   The filter goes on a pseudo-element, not on .hero, because filter applies
   to an element's text and children too. isolation + z-index:-1 puts it
   above the hero's own background colour and below its content, which is
   also what gives `screen` var(--bg) to blend against.

   Scoped :not(.compact) because .hero.compact replaces `background`
   outright on every other page — only index.html carries this art. */
[data-theme="dark"] .hero:not(.compact) {
  background-image: none;
  position: relative;
  isolation: isolate;
}

[data-theme="dark"] .hero:not(.compact)::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: url("../img/DOORS-slide-background.jpg") center bottom / cover no-repeat;
  filter: invert(1) hue-rotate(180deg) brightness(2.2) saturate(1.6);
  mix-blend-mode: screen;
}

/* The compact hero is the same band without the art — on every page that
   carries a body.theme-* class. Those rules set the `background` SHORTHAND,
   which resets background-image to none as part of applying itself, so the
   illustration never reaches them and the rule above was scoped away from
   .compact for good reason.

   contact.html is the exception: it is the one browsing page with a compact
   hero and no theme class, so nothing overrides .hero's shorthand and the
   near-white art paints under a --green title at 1.85:1. This turns the art
   off there. It is a no-op everywhere else — the themed rules already
   resolve background-image to none, so this cannot change what they paint,
   in either direction. Light mode is untouched: the selector needs the dark
   attribute to match at all. */
[data-theme="dark"] .hero.compact { background-image: none; }

[data-theme="dark"] .card-icon { background: rgba(0, 0, 0, .16); }

/* The bookmark bubble is a --green fill with white text and a
   translucent white button on it. All three invert together. */
[data-theme="dark"] .bookmark-content { color: var(--on-brand-ink); }
[data-theme="dark"] .bookmark-button {
  background: rgba(0, 0, 0, .18);
  color: var(--on-brand-ink);
}

