/* Westlake direct appeal thermometers.
   Light-first: these pages are shown on classroom TVs and printed. */

:root {
  --brand: #00606c;
  --brand-dark: #00454e;
  --brand-bright: #54c0cc;
  --brand-wash: #e2f2f4;
  --mercury: #e46c18;
  --mercury-deep: #b8520d;
  --ink: #12262a;
  --ink-soft: #4d6469;
  --ink-faint: #7d9499;
  --page: #f1f7f8;
  --card: #ffffff;
  --rule: #d7e6e9;
  --shadow: 0 1px 2px rgba(0, 69, 78, .07), 0 8px 24px -12px rgba(0, 69, 78, .22);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue",
        Arial, "Noto Sans", "Liberation Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- masthead ---------- */

.masthead {
  background: var(--brand);
  color: #fff;
  padding: 22px 0;
}

.masthead .wrap {
  display: flex;
  align-items: center;
}

.masthead-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.masthead-logo {
  display: block;
  width: auto;
  height: 42px;
  flex: 0 0 auto;
}

.masthead h1 {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
}

.masthead p {
  margin: 0;
  color: #a8dde4;
  font-size: .9rem;
}

.masthead a { color: #fff; }

/* ---------- school-wide hero ---------- */

.hero {
  background: var(--card);
  border-bottom: 1px solid var(--rule);
  padding: 36px 0 40px;
}

.hero .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 40px;
  align-items: center;
}

.hero-figure { flex: 0 0 auto; }

.hero-figure .thermo {
  height: min(42vh, 330px);
  width: auto;
}

.hero-copy { flex: 1 1 320px; }

.hero-copy h2 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-faint);
}

.headline {
  font-size: clamp(3rem, 9vw, 4.75rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--mercury-deep);
  margin: 0;
  font-variant-numeric: tabular-nums;
}

.headline-sub {
  margin: 10px 0 0;
  font-size: 1.15rem;
  color: var(--ink-soft);
}

.headline-sub strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block;
  margin-top: 18px;
  padding: 12px 22px;
  border-radius: 999px;
  background: var(--mercury);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
  box-shadow: var(--shadow);
}

.btn:hover { background: var(--mercury-deep); }

/* ---------- class grid ---------- */

.section-head {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: baseline;
  justify-content: space-between;
  margin: 40px 0 18px;
}

.section-head h2 {
  margin: 0;
  font-size: 1.3rem;
  letter-spacing: -.01em;
}

.sorter {
  display: flex;
  gap: 4px;
  background: #dceaec;
  border-radius: 999px;
  padding: 4px;
}

.sorter button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font: inherit;
  font-size: .85rem;
  font-weight: 600;
  padding: 6px 14px;
  border-radius: 999px;
  cursor: pointer;
}

.sorter button[aria-pressed="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(0, 69, 78, .14);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 16px;
  padding-bottom: 56px;
}

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 14px;
  padding: 18px 14px 16px;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease;
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(0, 69, 78, .09), 0 16px 32px -14px rgba(0, 69, 78, .34);
}

.rank {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: .72rem;
  font-weight: 700;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

.grade-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .02em;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--brand-wash);
  color: var(--brand-dark);
}

.card-pct {
  margin-top: 8px;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--mercury-deep);
  font-variant-numeric: tabular-nums;
}

.card-teacher {
  font-weight: 650;
  text-align: center;
  line-height: 1.25;
}

.card-room {
  font-size: .82rem;
  color: var(--ink-soft);
  font-variant-numeric: tabular-nums;
}

/* ---------- footer ---------- */

.foot {
  border-top: 1px solid var(--rule);
  padding: 22px 0 40px;
  color: var(--ink-faint);
  font-size: .85rem;
}

.foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* ---------- classroom TV page ---------- */

/* Authored at a fixed size and scaled to the screen by fit.js, so every
   display shows the same composition instead of a different breakpoint. */

.tv {
  height: 100vh;
  display: flex;
  flex-direction: column;
}

.tv-body {
  flex: 1 1 auto;
  /* Without min-height:0 a flex item refuses to shrink below its content. */
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 28px;
  overflow: hidden;
}

.tv-fit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 64px;
  transform-origin: center center;
}

.tv-figure { flex: 0 0 auto; }

.tv-figure .thermo {
  height: 470px;
  width: auto;
}

.tv-copy {
  flex: 0 0 auto;
  width: 660px;
}

.tv-logo {
  display: block;
  width: auto;
  height: 76px;
  margin-bottom: 14px;
}

.tv-grade {
  display: inline-block;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brand);
  background: var(--brand-wash);
  padding: 7px 16px;
  border-radius: 999px;
}

.tv-teacher {
  margin: 16px 0 4px;
  font-size: 4.1rem;
  font-weight: 800;
  line-height: 1.02;
  letter-spacing: -.03em;
}

.tv-room {
  margin: 0;
  font-size: 1.55rem;
  color: var(--ink-soft);
}

.tv-stat {
  margin: 26px 0 0;
  font-size: 1.5rem;
  color: var(--ink-soft);
}

.tv-stat strong {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.tv-qr {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 30px;
  padding: 22px;
  background: var(--card);
  border: 1px solid var(--rule);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.tv-qr img {
  display: block;
  width: 208px;
  height: auto;
  image-rendering: pixelated;
}

.tv-qr-copy p { margin: 0; }

.tv-qr-lead {
  font-size: 1.95rem;
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.1;
}

.tv-qr-url {
  margin-top: 10px !important;
  font-size: .92rem;
  color: var(--ink-faint);
  word-break: break-all;
}

.tv-foot {
  border-top: 1px solid var(--rule);
  padding: 14px 0;
  font-size: .85rem;
  color: var(--ink-faint);
}

.tv-foot .wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  justify-content: space-between;
}

/* Narrow screens (a parent on a phone) drop the side-by-side composition
   rather than scaling the whole sign down to unreadable. */
@media (max-width: 860px) {
  .tv-fit {
    flex-direction: column;
    gap: 28px;
    transform: none !important;
  }

  .tv { height: auto; min-height: 100vh; }
  .tv-body { overflow: visible; min-height: 0; }
  .tv-copy { width: auto; max-width: 100%; }
  .tv-figure .thermo { height: 300px; }
  .tv-teacher { font-size: 2.6rem; }
  .tv-qr { flex-direction: column; text-align: center; }
}

/* ---------- thermometer ---------- */

.thermo { display: block; }

.thermo-goal {
  font-size: 11px;
  font-weight: 700;
  fill: var(--ink-faint);
  letter-spacing: .04em;
}

.thermo-tick {
  font-size: 11px;
  fill: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

@media print {
  .masthead, .foot, .tv-foot, .sorter { display: none; }
  body { background: #fff; }
  .tv-body { padding: 0; }
  .card, .tv-qr { box-shadow: none; }
}

