/* Entity hero — deep editorial navy banner shared by child and school
   overview pages. Common shell (`.entity-hero*`, `.entity-tab*`) lives
   here; entity-specific widgets slot inside the hero's top row:

   - `.child-hero-journey*` → year-group journey card (child hero)
   - `.school-hero-activity*` → this-week activity card (school hero)
*/

/* Full-bleed banner: escapes the main's max-w-6xl + horizontal padding, and
   cancels its top padding so the hero butts right up against the top nav. */
.entity-hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  width: 100vw;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  margin-top: -2rem;
  background:
    radial-gradient(1200px 380px at 88% -20%, rgba(67, 137, 221, 0.35), transparent 55%),
    radial-gradient(900px 340px at -10% 120%, rgba(245, 158, 11, 0.18), transparent 55%),
    linear-gradient(170deg, #0B2653 0%, #0A1E42 100%);
  color: #E2E8F0;
}

@media (min-width: 640px) {
  .entity-hero { margin-top: -3rem; }
}

.entity-hero-inner {
  max-width: 72rem;
  margin-inline: auto;
  padding: 2rem 1rem 0;
}

@media (min-width: 640px) { .entity-hero-inner { padding: 2.5rem 1.5rem 0; } }
@media (min-width: 1024px) { .entity-hero-inner { padding: 2.75rem 2rem 0; } }

.entity-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1.25rem;
  flex-wrap: wrap;
}

.entity-hero-name-block {
  min-width: 0;
  flex: 1 1 18rem;
}

.entity-hero-name {
  font-size: clamp(1.75rem, 3.6vw, 2.5rem);
  font-weight: 900;
  letter-spacing: -0.028em;
  line-height: 1;
  color: #FFFFFF;
  margin: 0;
  word-break: break-word;
  text-shadow: 0 2px 20px rgba(10, 25, 62, 0.35);
}

.entity-hero-name-row {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  flex-wrap: wrap;
}

/* Amber "Play now" call-to-action. Matches the ex-nav Play Spello chip
   so the muscle memory transfers — parents/teachers who were used to
   clicking the top-right button reach for the same colour on the child
   hero instead. `button_to` wraps the button in a <form>; make the form
   a plain inline wrapper so flex layout ignores it. */
.entity-hero-name-row form {
  display: inline-flex;
  margin: 0;
  padding: 0;
}
.entity-hero-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.85rem;
  border-radius: 0.5rem;
  border: none;
  font-weight: 800;
  font-size: 0.85rem;
  color: #5B3608;
  cursor: pointer;
  background: linear-gradient(135deg, #FCD34D 0%, #FBBF24 55%, #F59E0B 100%);
  box-shadow: 0 4px 10px -4px rgba(91, 54, 8, 0.35);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.entity-hero-play-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 14px -4px rgba(91, 54, 8, 0.45);
}
.entity-hero-play-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(252, 211, 77, 0.55), 0 4px 10px -4px rgba(91, 54, 8, 0.35);
}

.entity-hero-meta {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.55rem;
  align-items: center;
}

.entity-hero-meta-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 700;
  font-size: 0.8rem;
  line-height: 1.1;
  letter-spacing: 0.01em;
  padding: 0.3rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(4px);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease;
}

a.entity-hero-meta-chip.is-link {
  text-decoration: none;
}
a.entity-hero-meta-chip.is-link:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.28);
  color: #FFFFFF;
}
a.entity-hero-meta-chip.is-link:hover svg {
  color: rgba(255, 255, 255, 0.9);
}

.entity-hero-meta-chip svg {
  width: 0.85rem;
  height: 0.85rem;
  color: rgba(255, 255, 255, 0.65);
}

/* Last-seen chip with a coloured status dot, replacing the SVG icon. */
.entity-hero-status-dot {
  width: 0.55rem;
  height: 0.55rem;
  border-radius: 999px;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.06);
}

/* Amber demo-data chip — surfaces on the school hero when the teacher has
   seeded test data so they never forget they're looking at fake pupils. */
.entity-hero-meta-chip.is-test-data {
  background: rgba(252, 211, 77, 0.18);
  border-color: rgba(252, 211, 77, 0.45);
  color: #FDE68A;
}
.entity-hero-meta-chip.is-test-data svg {
  color: #FCD34D;
}

.entity-hero-meta-chip.is-fresh   .entity-hero-status-dot {
  background: #34D399;
  box-shadow: 0 0 0 3px rgba(52, 211, 153, 0.18), 0 0 10px rgba(52, 211, 153, 0.45);
  animation: entity-hero-status-pulse 2.4s ease-in-out infinite;
}
.entity-hero-meta-chip.is-recent  .entity-hero-status-dot { background: #FCD34D; }
.entity-hero-meta-chip.is-dormant .entity-hero-status-dot { background: #94A3B8; }
.entity-hero-meta-chip.is-never   .entity-hero-status-dot { background: transparent; border: 1.5px dashed rgba(255, 255, 255, 0.45); }

@keyframes entity-hero-status-pulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.6; }
}

/* ── Year-journey widget (child hero) ── */

.child-hero-journey {
  display: inline-flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.8rem 0.95rem 0.85rem;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 20px 44px -22px rgba(5, 15, 40, 0.55),
    0 4px 10px -4px rgba(5, 15, 40, 0.25);
}

.child-hero-journey-row {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
}

.child-hero-chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0.4rem 0.7rem 0.5rem;
  border-radius: 12px;
  background: #F1F5F9;
  min-width: 4.2rem;
  line-height: 1;
}

.child-hero-chip-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748B;
}

.child-hero-chip-value {
  font-size: 0.95rem;
  font-weight: 800;
  color: #0F172A;
  margin-top: 0.28rem;
}

.child-hero-chip.is-target { background: var(--color-brand-500); }
.child-hero-chip.is-target .child-hero-chip-label { color: rgba(255, 255, 255, 0.78); }
.child-hero-chip.is-target .child-hero-chip-value { color: white; }

.child-hero-chip.is-pending {
  background: #FFF7ED;
  border: 1px dashed #FDBA74;
}
.child-hero-chip.is-pending .child-hero-chip-label { color: #B45309; }
.child-hero-chip.is-pending .child-hero-chip-value { color: #9A3412; font-size: 0.78rem; }

.child-hero-arrow {
  flex-shrink: 0;
  width: 2.4rem;
  height: 2rem;
  color: var(--color-brand-400);
}
.child-hero-arrow svg { display: block; width: 100%; height: 100%; }

.child-hero-journey-caption {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: #64748B;
  text-align: right;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.4rem;
}

.child-hero-journey-caption::before {
  content: "";
  display: inline-block;
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 999px;
  background: currentColor;
  transform: translateY(0.5px);
}

.child-hero-journey-caption.is-up   { color: #047857; }
.child-hero-journey-caption.is-down { color: #B45309; }
.child-hero-journey-caption.is-on   { color: var(--color-brand-600); }
.child-hero-journey-caption.is-pending { color: #B45309; }

/* ── Activity-this-week widget (school hero) ──
   White card mirroring the child hero's journey card so the two pages
   feel like siblings. Three compact stats in one row. */

.school-hero-activity {
  display: inline-flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.75rem 1rem 0.9rem;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 20px 44px -22px rgba(5, 15, 40, 0.55),
    0 4px 10px -4px rgba(5, 15, 40, 0.25);
}

.school-hero-activity-eyebrow {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748B;
}

.school-hero-activity-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.school-hero-activity-stat {
  display: flex;
  flex-direction: column;
  padding: 0.1rem 0.85rem 0.1rem 0;
  min-width: 3.8rem;
}

.school-hero-activity-stat + .school-hero-activity-stat {
  padding-left: 0.85rem;
  border-left: 1px solid #E2E8F0;
}

.school-hero-activity-value {
  font-size: 1.25rem;
  font-weight: 900;
  color: #0F172A;
  line-height: 1;
  letter-spacing: -0.01em;
}

.school-hero-activity-value.is-muted { color: #CBD5E1; }

.school-hero-activity-label {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #64748B;
  margin-top: 0.32rem;
  white-space: nowrap;
}

/* ── About-this-page widget (word lists hero) ──
   White card mirroring the school activity card, but holds an explanatory
   paragraph instead of stats. Used on the word lists index. */

.word-lists-hero-about {
  display: inline-flex;
  flex-direction: column;
  gap: 0.35rem;
  max-width: 26rem;
  padding: 0.85rem 1rem 0.95rem;
  background: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 16px;
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9) inset,
    0 20px 44px -22px rgba(5, 15, 40, 0.55),
    0 4px 10px -4px rgba(5, 15, 40, 0.25);
}

.word-lists-hero-about-eyebrow {
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #64748B;
  margin: 0;
}

.word-lists-hero-about-body {
  font-size: 0.82rem;
  line-height: 1.45;
  color: #334155;
  margin: 0;
}

.word-lists-hero-about-body strong {
  color: #0F172A;
  font-weight: 700;
}

/* ── Tabs strip ──
   Split into two elements so the horizontal divider can run edge-to-edge
   across the full-bleed hero while the tab links themselves stay aligned
   with the rest of the page content. */

.entity-hero-tabs-band {
  margin-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

@media (min-width: 640px) {
  .entity-hero-tabs-band { margin-top: 2rem; }
}

.entity-hero-tabs {
  max-width: 72rem;
  margin-inline: auto;
  padding: 0 1rem;
  display: flex;
  gap: 0.15rem;
  overflow-x: auto;
}

@media (min-width: 640px) { .entity-hero-tabs { padding: 0 1.5rem; } }
@media (min-width: 1024px) { .entity-hero-tabs { padding: 0 2rem; } }

.entity-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.9rem 0.85rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  transition: color 140ms ease;
}

.entity-tab::after {
  content: "";
  position: absolute;
  left: 0.4rem;
  right: 0.4rem;
  bottom: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  transition: background-color 140ms ease;
}

.entity-tab:hover { color: rgba(255, 255, 255, 0.9); }
.entity-tab:hover::after { background: rgba(255, 255, 255, 0.25); }

.entity-tab.is-active { color: #FFFFFF; }
.entity-tab.is-active::after {
  background: #FCD34D;
  box-shadow: 0 0 10px rgba(252, 211, 77, 0.5);
}

.entity-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.2rem;
  padding: 0 0.4rem;
  height: 1.2rem;
  border-radius: 999px;
  font-size: 0.68rem;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.7);
}

.entity-tab.is-active .entity-tab-count {
  background: rgba(252, 211, 77, 0.18);
  color: #FCD34D;
}

/* Right-aligned action sharing the tab row. `margin-left: auto` pushes
   it to the end of the flex row (next to the last tab on narrow screens,
   pinned right when tabs fit). Styled as a plain link, not a button. */
.entity-hero-tabs-action {
  margin-left: auto;
  align-self: center;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  white-space: nowrap;
  text-decoration: none;
  flex-shrink: 0;
  transition: color 0.15s;
}
.entity-hero-tabs-action:hover {
  color: #FFFFFF;
}
.entity-hero-tabs-action svg {
  width: 14px;
  height: 14px;
  opacity: 0.85;
}
