/* Barah Mahine Ghar · shared theme for the inner pages.
   Loaded after each page's own <style>, so it re-points the old palette
   variables at the classroom-wall palette the home page uses, and swaps the
   thin navy grids for outlined, offset-shadow tiles. Page scripts are untouched. */

:root {
  /* the old names, re-pointed. Text-carrying stops stay contrast-safe on paper. */
  --navy: #1A1A1A; --navy-light: #3A3A36; --ink: #1A1A1A;
  --teal: #0A7F96; --teal-dark: #0A6577; --teal-light: #0EC0E2;
  --seafoam: #FFD337; --seafoam-tint: #EAF8FC;
  --cream: #FFFDF6; --paper: #FFFFFF; --gold: #FF9629;
  --muted: #55554E; --grid: #E4E1D6; --track: #ECE9DF;
  --s1: #0A7F96; --s2: #EF5879;

  /* the wall */
  --cyan: #0EC0E2; --yellow: #FFD337; --lime: #B7C930; --orange: #FF9629;
  --pink: #EF5879; --red: #E15344; --night: #1A1A1A; --wall: #FFFDF6;
  --radius: 14px;
  --lift: 0 4px 0 var(--night);
  --page: var(--cyan);
}
body[data-page="values"]     { --page: var(--pink); }
body[data-page="norms"]      { --page: var(--cyan); }
body[data-page="seating"]    { --page: var(--lime); }
body[data-page="procedures"] { --page: var(--orange); }
body[data-page="rewards"]    { --page: var(--yellow); }
body[data-page="showcase"]   { --page: var(--red); }
body[data-page="parents"]    { --page: var(--lime); }

body {
  font-family: "Open Sans", system-ui, sans-serif;
  background-color: var(--wall);
  background-image: linear-gradient(rgb(14 192 226 / .1) 1px, transparent 1px), linear-gradient(90deg, rgb(14 192 226 / .1) 1px, transparent 1px);
  background-size: 28px 28px;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { letter-spacing: -.025em; text-wrap: balance; }
::selection { background: var(--cyan); color: var(--night); }
:focus-visible { outline: 3px solid var(--night); outline-offset: 3px; border-radius: 4px; }
a { text-underline-offset: .18em; }

/* ---- header: the taped strip, same as home ------------------------------ */
.site-bar {
  position: sticky; top: .75rem; z-index: 70; margin: .75rem clamp(.6rem, 3vw, 2.5rem) 0;
  display: flex; align-items: center; gap: 1rem; justify-content: space-between;
  height: 3.25rem; padding: 0 .5rem 0 1rem;
  background: var(--wall); border: 2.5px solid var(--night); border-radius: 999px;
  box-shadow: 0 3px 0 var(--night), 0 10px 24px rgb(26 26 26 / .14);
}
.site-bar__mark { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: .95rem; text-decoration: none; color: var(--night); white-space: nowrap; }
.site-bar__mark svg { width: 1.6rem; height: 1.6rem; flex: none; }
.site-bar__mark small { font-weight: 600; color: #3E3E3A; font-size: .85rem; }
.site-bar__right { display: flex; align-items: center; gap: .4rem; }
.plan { position: relative; }
.plan summary {
  list-style: none; cursor: pointer; white-space: nowrap; font-weight: 700; font-size: .9rem; padding: .55rem .9rem; border-radius: 999px;
  transition: background-color 150ms cubic-bezier(.23, 1, .32, 1);
}
.plan summary::-webkit-details-marker { display: none; }
.plan summary::after { content: ""; display: inline-block; width: .45rem; height: .45rem; margin-left: .45rem; border-right: 2.5px solid; border-bottom: 2.5px solid; transform: translateY(-.2rem) rotate(45deg); }
.plan[open] summary::after { transform: translateY(.05rem) rotate(-135deg); }
@media (hover: hover) and (pointer: fine) { .plan summary:hover { background: var(--yellow); } }
.plan ul {
  position: absolute; right: 0; top: calc(100% + .6rem); margin: 0; padding: .5rem; list-style: none; min-width: 15rem;
  background: var(--wall); border: 2.5px solid var(--night); border-radius: var(--radius); box-shadow: 0 4px 0 var(--night), 0 12px 28px rgb(26 26 26 / .14);
}
.plan li a { display: block; padding: .6rem .8rem; border-radius: 8px; text-decoration: none; color: var(--night); font-weight: 600; }
.plan li a[aria-current="page"] { background: var(--page); font-weight: 800; }
.plan li a:hover, .plan li a:focus-visible { background: var(--yellow); }
.btn {
  display: inline-flex; align-items: center; white-space: nowrap; font-weight: 800; text-decoration: none;
  color: var(--wall); background: var(--night); border: 2.5px solid var(--night); border-radius: 999px; padding: .55rem 1.1rem;
  transition: background-color 150ms cubic-bezier(.23, 1, .32, 1), color 150ms cubic-bezier(.23, 1, .32, 1), transform 120ms cubic-bezier(.23, 1, .32, 1);
}
.btn:active { transform: translateY(1px) scale(.98); }
@media (hover: hover) and (pointer: fine) { .btn:hover { background: var(--cyan); color: var(--night); } }

/* ---- page heroes: one colour per page ---------------------------------- */
.cp-pagehero, .md-hero {
  position: relative; margin: 1.5rem clamp(.6rem, 3vw, 2.5rem) 0; padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 3rem);
  background: var(--page); color: var(--night); border: 2.5px solid var(--night); border-radius: 22px; box-shadow: 0 6px 0 var(--night);
  overflow: hidden;
}
.md-hero { --page: var(--night); color: var(--wall); }
.cp-pagehero::after, .md-hero::after { /* a strip of tape */
  content: ""; position: absolute; top: -.4rem; right: 12%; width: 6rem; height: 1.6rem; background: rgb(255 253 246 / .7); transform: rotate(6deg);
}
.cp-pagehero .eyebrow, .md-hero .eyebrow {
  display: inline-block; color: var(--night); background: var(--wall); border: 2px solid var(--night); border-radius: 999px;
  padding: .3rem .8rem; font-size: .78rem; font-weight: 800; letter-spacing: .12em; transform: rotate(-1.5deg); margin-bottom: 1rem;
}
.cp-pagehero h1, .md-hero h1 { color: inherit; font-size: clamp(2.6rem, 1.4rem + 4.4vw, 5.2rem); line-height: .92; letter-spacing: -.045em; margin: 0; }
.cp-pagehero p.sub, .md-hero p { color: inherit; font-size: clamp(1rem, .95rem + .3vw, 1.2rem); font-weight: 600; margin-top: 1rem; max-width: 46ch; }
.md-hero p { color: #E9E6DC; }
.cp-back {
  display: inline-block; margin-top: 1.4rem; color: var(--night); background: var(--wall); border: 2px solid var(--night); border-bottom-width: 2px;
  border-radius: 999px; padding: .4rem .9rem; font-size: .85rem; font-weight: 800; box-shadow: 0 3px 0 var(--night);
}
.cp-back:hover { background: var(--yellow); }

/* ---- maths sub-navigation ---------------------------------------------- */
.md-sub { background: transparent; margin: 1rem clamp(.6rem, 3vw, 2.5rem) 0; padding: 0; gap: .5rem; }
.md-sub a {
  color: var(--night); background: var(--wall); border: 2px solid var(--night); font-size: .8rem; font-weight: 700; padding: .4rem .85rem;
}
.md-sub a:hover { background: var(--yellow); }
.md-sub a.active { background: var(--cyan); border-color: var(--night); color: var(--night); box-shadow: 0 3px 0 var(--night); }

/* ---- sections ---------------------------------------------------------- */
.cp-section, .md-section { border-bottom: 0; padding-left: clamp(1.25rem, 4vw, 3rem); padding-right: clamp(1.25rem, 4vw, 3rem); }
.cp-section h2, .md-section h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2.2rem); }
.cp-eyebrow, .eyebrow2, .cp-checklist-title { color: var(--teal-dark); font-weight: 800; }
.cp-note, .md-note { color: #55554E; }
.cp-caption { color: #55554E; }

/* outlined tiles: the shared surface */
.cp-value, .cp-proc, .cp-graphic, .cp-notice, .cp-chatwrap, .tile, .card, .panel, .gcard, details:not(.plan), .tbl-wrap {
  background: var(--paper); border: 2.5px solid var(--night) !important; border-radius: var(--radius) !important; box-shadow: var(--lift);
}

/* grids that used a 1px navy gap become separate tiles */
.cp-values, .cp-norms, .cp-procs { gap: clamp(1rem, 2vw, 1.5rem); background: none; border: 0; }

/* values */
.cp-value:nth-child(1) { background: #FFF1F4; }
.cp-value:nth-child(2) { background: #F6F9E3; }
.cp-value .chip { background: var(--pink); border: 2px solid var(--night); width: 16px; height: 16px; }
.cp-value:nth-child(2) .chip { background: var(--lime); }
.cp-vicon { stroke: var(--night); }
.cp-value p.def { color: #2E2E2A; }
.cp-break li { border-left: 0; border: 2px solid var(--night); border-radius: 10px; background: var(--paper); color: #2E2E2A; }

/* norms: loud tiles, the drawings in ink */
.cp-norm { color: var(--night); border: 2.5px solid var(--night); border-radius: var(--radius); box-shadow: var(--lift); }
.cp-norm:nth-child(6n+1) { background: var(--cyan); }
.cp-norm:nth-child(6n+2) { background: var(--pink); }
.cp-norm:nth-child(6n+3) { background: var(--lime); }
.cp-norm:nth-child(6n+4) { background: var(--orange); }
.cp-norm:nth-child(6n+5) { background: var(--yellow); }
.cp-norm:nth-child(6n+6) { background: var(--red); }
.cp-norm:nth-child(odd) { transform: rotate(-1deg); }
.cp-norm:nth-child(even) { transform: rotate(.8deg); }
.cp-norm .n { opacity: 1; font-size: 2.2rem; }
.cp-norm p { font-size: 1rem; font-weight: 800; }
.cp-illus { background: rgb(255 253 246 / .55); border-top: 2px solid var(--night); border-bottom: 2px solid var(--night); }
.cp-illus svg { stroke: var(--night); }
.cp-illus svg [fill="#fff"], .cp-illus svg [fill="#ffffff"] { fill: var(--night); }
.cp-norm .cp-caption { color: var(--night); font-size: .8rem; font-weight: 700; opacity: 1; }

/* seating */
.cp-points li { border: 2px solid var(--night); border-radius: 10px; box-shadow: 0 3px 0 var(--night); color: #2E2E2A; }
.cp-points li::before { color: var(--teal-dark); }
.cp-graphic svg [fill="#2d8b8b"] { fill: var(--cyan); }
.cp-graphic svg [fill="#1f6b6b"], .cp-graphic svg [stroke="#1f6b6b"] { fill: var(--teal-dark); }
.cp-graphic svg [stroke="#1f6b6b"] { fill: none; stroke: var(--teal-dark); }
.cp-legend i[style*="2d8b8b"] { background: var(--cyan) !important; }

/* procedures */
.cp-proc-head { color: var(--night); border-bottom: 2.5px solid var(--night); font-weight: 800; }
.cp-proc:nth-child(1) .cp-proc-head { background: var(--orange); }
.cp-proc:nth-child(2) .cp-proc-head { background: var(--cyan); }
.cp-proc:nth-child(3) .cp-proc-head { background: var(--lime); }
.cp-stage { background: #FFF6E5; border-bottom: 2px solid var(--night); }
.cp-floor { background: var(--night); }
.cp-proc ol { color: #2E2E2A; }

/* rewards */
.cp-addform input, .cp-chatform input, .tools input, .tools select { border: 2px solid var(--night) !important; border-radius: 999px !important; background: var(--paper); }
.cp-addform input:focus, .cp-chatform input:focus { outline: 3px solid var(--cyan); outline-offset: 1px; }
.cp-addform button, .cp-chatform button {
  background: var(--night); color: var(--wall); border: 2.5px solid var(--night); border-radius: 999px; font-weight: 800; box-shadow: 0 3px 0 rgb(26 26 26 / .35);
}
.cp-addform button:hover, .cp-chatform button:hover { background: var(--cyan); color: var(--night); }
.cp-row, .cp-wrow, .cp-steps li { border: 2px solid var(--night); border-radius: 12px; box-shadow: 0 3px 0 var(--night); }
.cp-row.top1 { background: #FFF6CC; border: 2.5px solid var(--night); }
.cp-row.top1 .cp-rank { color: var(--night); }
.cp-bar-wrap { background: var(--track); border: 1.5px solid var(--night); height: 10px; }
.cp-bar { background: var(--cyan); }
.cp-btns button, .cp-toolbar button { border: 2px solid var(--night); border-radius: 999px; font-weight: 800; }
.cp-btns button:hover { background: var(--yellow); border-color: var(--night); }
.cp-btns .p1, .cp-btns .p5 { color: var(--teal-dark); }
.cp-toolbar button:hover { background: var(--night); color: var(--wall); }
.cp-wbox { border: 2px solid var(--night); border-radius: 10px; }
.cp-wbox:hover { background: var(--yellow); border-color: var(--night); }
.cp-wbox.on { background: #FDE3DF; border-color: var(--night); }
.cp-noplay { background: var(--red); color: var(--night); border: 2.5px solid var(--night); border-radius: 12px; box-shadow: var(--lift); }
.cp-infobox { border-left: 0; border: 2px solid var(--night); border-radius: 12px; background: #FFF6CC; }
.cp-infobox:nth-child(2) { background: #FDE3DF; }
.cp-steps .s-num { background: var(--pink); color: var(--night); border: 2px solid var(--night); }
.cp-track-link { color: var(--teal-dark); border-bottom-color: currentColor; font-weight: 800; }

/* showcase + parents */
.cp-notice { border-left: 2.5px solid var(--night) !important; background: #FFF6CC; }
.cp-preview-banner { background: #FFF6CC; border: 2px solid var(--night); border-radius: 12px; color: #3A3016; }
.cp-lang { border: 2px solid var(--night); color: var(--night); font-weight: 700; }
.cp-lang.active { background: var(--night); color: var(--wall); }
.cp-msg.bot { background: #EAF8FC; color: #1A1A1A; border: 2px solid var(--night); }
.cp-msg.user { background: var(--night); }
.cp-msg.demo { border: 2px dashed var(--night); }
.cp-msg.demo .tag { background: var(--yellow); color: var(--night); }
.cp-chatform { background: #EAF8FC; border-top: 2px solid var(--night); }
.cp-checklist li { border: 2px solid var(--night); border-left: 2px solid var(--night); border-radius: 10px; }

/* maths dashboard */
.tile:nth-child(5n+1) { background: #EAF8FC; }
.tile:nth-child(5n+2) { background: #F6F9E3; }
.tile:nth-child(5n+3) { background: #FFF1F4; }
.tile:nth-child(5n+4) { background: #FFF6CC; }
.tile .value { color: var(--night); }
.card { border-left-width: 2.5px !important; }
.card:hover { transform: translateY(-2px); box-shadow: 0 6px 0 var(--night); background: #FFF6CC; }
.card.goal { background: #FFF1F4; }
th { background: #F4F1E6; color: #3E3E3A; }
.pill { border: 1.5px solid var(--night); color: var(--night); }
.countdown { color: var(--night); border: 2px solid var(--night); }
.gnums div { background: #F4F1E6; }
.gnums .moy { background: #FFE3EA; }
details:not(.plan) { margin-top: 12px; }
details:not(.plan)[open] summary { border-bottom: 2px solid var(--night); }
.lvl h4 { color: var(--teal-dark); }
#tip { background: var(--night); border: 2px solid var(--wall); }

/* ---- footer: the pink door, same as home ------------------------------- */
.foot {
  margin-top: clamp(2.5rem, 6vw, 4rem); background: var(--pink); color: var(--night); border-top: 2.5px solid var(--night);
  padding: 1.6rem clamp(1.25rem, 4vw, 3rem) calc(1.6rem + env(safe-area-inset-bottom));
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; font-size: .9rem; font-weight: 600;
}
.foot img { height: 1.1rem; width: auto; display: block; }
.foot__made { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.1rem; }
.foot__made span { max-width: 52ch; }
.foot__ask { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; }
.foot__ask a.addr { color: var(--night); font-weight: 700; overflow-wrap: anywhere; }

@media (max-width: 860px) {
  .site-bar { margin-inline: .6rem; padding-left: .8rem; }
  .site-bar__mark small { display: none; }
  .plan summary { padding: .5rem .6rem; }
  .cp-pagehero, .md-hero { margin-inline: .6rem; border-radius: 18px; }
  .md-sub { margin-inline: .6rem; }
  .cp-norm:nth-child(n) { transform: none; }
}
/* Below 520px the name and the two controls don't fit on one strip, so the
   house icon stands in for the name (screen readers still hear it). */
@media (max-width: 520px) {
  .site-bar__mark span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
}
@media (max-width: 400px) {
  .site-bar { gap: .5rem; }
  .btn { padding: .5rem .8rem; font-size: .9rem; }
}
/* The very narrowest phones keep the two controls; "The plan" still links home. */
@media (max-width: 300px) {
  .site-bar__mark { display: none; }
  .site-bar__right { margin-left: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .walk-in svg, .walk-out svg, .bob, .paperbit { animation: none !important; }
}
@media print {
  .site-bar, .foot__ask { display: none; }
  .cp-pagehero, .md-hero { box-shadow: none; }
}

/* ---------- audit fixes, November 2026 ---------------------------------- */

/* Keyboard users can jump past the bar to the page's content. */
.skip-link {
  position: absolute; left: .75rem; top: -4rem; z-index: 100;
  padding: .65rem 1.1rem; border-radius: 999px;
  background: var(--night); color: #fff; font-weight: 800; text-decoration: none;
}
.skip-link:focus { top: .75rem; }

/* Every control in the bar is at least 44px to tap. */
.site-bar__mark { flex: none; min-height: 44px; min-width: 44px; }
/* The maths pages draw every <details> as a white card; the bar's menu is not one. */
.site-bar .plan { background: none; border: 0; border-radius: 0; margin: 0; }
.site-bar .plan summary { justify-content: flex-start; gap: 0; flex-wrap: nowrap; border-bottom: 0; }
.plan summary { display: flex; align-items: center; min-height: 44px; }
.btn { min-height: 44px; }

/* Rewards: the points buttons are big enough to tap, and on a phone a
   group's row wraps instead of running off the screen. */
.cp-btns button { min-width: 44px; min-height: 44px; }
.cp-removebtn { min-width: 44px; min-height: 44px; border-radius: 999px; }
@media (max-width: 560px) {
  .cp-row { flex-wrap: wrap; row-gap: 10px; }
  .cp-row .cp-bar-wrap { order: 5; flex: 1 1 100%; }
  .cp-row .cp-btns { order: 6; flex: 1 1 100%; }
  .cp-row .cp-btns button { flex: 1; }
  .cp-wrow { flex-wrap: wrap; }
}

