/* The Classroom Screen's public pages: the routines (/routines, /routines/<slug> and its print poster) and the pages
   at the words people search for (ScreenPage). Loaded by those views only; the site's tokens come from styles.css,
   with fallbacks for the print poster, which has no site layout. */

/* Shared */
.sp-page { max-width: 920px; }
.sp-cta { background: var(--s-500, #f97316); }
.sp-cta:hover { background: var(--s-600, #ea580c); }
.sp-cta-big { padding: 15px 30px; font-size: 1.1rem; }
.sp-cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin: 20px 0 28px; }
.sp-cta-note, .sp-muted { color: var(--muted); font-size: 0.9rem; }
.sp-section { margin: 32px 0; }
.sp-section h3 { margin: 0 0 8px; font-size: 1.05rem; }

.sp-band { margin: 40px 0; padding: 28px 24px; border-radius: var(--radius); background: var(--p-900); color: #fff; text-align: center; }
.sp-band h2 { margin: 0 0 8px; color: #fff; }
.sp-band p { margin: 0 0 18px; color: var(--p-100); }

.sp-faq { margin: 32px 0; }
.sp-more { margin: 32px 0; padding-top: 20px; border-top: 1px solid var(--line); }
.sp-more h2 { font-size: 1.15rem; }
.sp-more ul { padding-left: 1.2em; }
.sp-more li { margin: 4px 0; }

/* Blocks on the ScreenPage pages */
.sp-widgets { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; list-style: none; }
.sp-widgets li { margin: 0; padding: 6px 14px; border-radius: 999px; background: var(--p-100); color: var(--p-700); font-weight: 600; font-size: 0.92rem; }
.sp-widgets a { color: inherit; }

.sp-plans, .sp-starters { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.sp-plan, .sp-starter { padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.sp-plan ul { margin: 0; padding-left: 1.1em; }
.sp-plan-top { border-color: var(--s-500); box-shadow: var(--shadow); }
.sp-starter p { margin: 0 0 8px; }
.sp-starter-tools { color: var(--muted); font-size: 0.92rem; }

.sp-backgrounds { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; padding: 0; list-style: none; }
.sp-bg { margin: 0; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.sp-swatch { display: block; height: 90px; margin-bottom: 10px; border-radius: 12px; border: 1px solid var(--line); }
.sp-bg-name { font-weight: 700; color: var(--ink); }
.sp-bg-kind { font-size: 0.8rem; color: var(--muted); }
.sp-bg-words { display: block; margin-top: 4px; font-size: 0.9rem; }

.sp-routines { padding-left: 1.2em; }
.sp-routines li { margin: 0 0 10px; }

.sp-table-wrap { overflow-x: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 12px; }
.sp-table { width: 100%; min-width: 680px; border-collapse: collapse; font-size: 0.9rem; }
.sp-table caption { caption-side: bottom; padding: 10px 12px; text-align: left; color: var(--muted); font-size: 0.85rem; }
.sp-table th, .sp-table td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.sp-table thead th { background: var(--p-50); color: var(--ink); }
.sp-table tbody th { color: var(--ink); white-space: nowrap; }

/* /routines */
.rt-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; padding: 0; list-style: none; }
.rt-card { margin: 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.rt-card h2 { margin: 0 0 4px; font-size: 1.15rem; }
.rt-card p { margin: 0 0 6px; }
.rt-meta { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
.rt-when { color: var(--muted); font-size: 0.9rem; }

/* /routines/<slug> */
.rt-print-link { font-weight: 600; }
.rt-steps-box { margin: 24px 0; }
.rt-steps { margin: 0; padding: 0; list-style: none; }
.rt-step { display: grid; grid-template-columns: 48px 64px 1fr auto; grid-template-areas: "num pic text time" "num pic voice voice"; gap: 4px 14px; align-items: center;
  margin: 0 0 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); }
.rt-num { grid-area: num; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--p-600); color: #fff; font-weight: 700; font-size: 1.2rem; }
.rt-pic { grid-area: pic; width: 64px; height: 64px; border-radius: 50%; object-fit: cover; background: #fbf3e6; }
.rt-text { grid-area: text; color: var(--ink); font-weight: 600; font-size: 1.15rem; }
.rt-time { grid-area: time; color: var(--p-700); font-weight: 700; white-space: nowrap; }
.rt-voice { grid-area: voice; justify-self: start; padding: 2px 10px; border-radius: 999px; font-size: 0.82rem; font-weight: 600; }
.rt-tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--s-100); color: var(--s-600); font-size: 0.78rem; vertical-align: middle; }
.rt-total { color: var(--muted); font-weight: 600; }
.rt-voice-0 { background: #fee2e2; color: #991b1b; }
.rt-voice-1 { background: #ffedd5; color: #9a3412; }
.rt-voice-2 { background: #fef9c3; color: #854d0e; }
.rt-voice-3 { background: #dcfce7; color: #166534; }
.rt-voice-4 { background: #dbeafe; color: #1e40af; }

/* How to teach: a script in large type, one card per step (Do / Say / Ask) */
.rt-teach { margin: 36px 0; }
.rt-teach-intro { font-size: 1.1rem; }
.rt-script { margin: 0; padding: 0; list-style: none; counter-reset: rt; }
.rt-script li { counter-increment: rt; position: relative; margin: 0 0 12px; padding: 16px 18px 16px 58px; border-radius: var(--radius); background: var(--p-50); font-size: 1.12rem; line-height: 1.5; }
.rt-script li::before { content: counter(rt); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--p-600); color: #fff;
  font-weight: 700; font-size: 0.95rem; text-align: center; line-height: 30px; }
.rt-script p { margin: 0 0 6px; }
.rt-script b { display: inline-block; min-width: 3.2em; color: var(--p-700); }
.rt-say { color: var(--ink); }
.rt-others { columns: 2; padding-left: 1.2em; }

@media (max-width: 560px) {
  .rt-step { grid-template-columns: 40px 56px 1fr; grid-template-areas: "num pic text" "num pic time" "num pic voice"; }
  .rt-pic { width: 56px; height: 56px; }
  .rt-num { width: 38px; height: 38px; font-size: 1rem; }
  .rt-others { columns: 1; }
}

/* /routines/<slug>/print: a one-page poster */
.rp-body { margin: 0; background: #f4f2fa; color: #1f1637; font-family: 'Poppins', system-ui, sans-serif; }
.rp-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; max-width: 8.5in; margin: 0 auto; padding: 16px; }
.rp-bar a { color: #6d28d9; font-weight: 600; }
.rp-print { padding: 10px 22px; border: 0; border-radius: 999px; background: #f97316; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.rp-sheet { box-sizing: border-box; max-width: 8.5in; margin: 0 auto 32px; padding: 0.6in; background: #fff; box-shadow: 0 8px 24px -12px rgb(76 29 149 / 0.25); }
.rp-title { margin: 0 0 0.3in; font-size: 3rem; line-height: 1.1; text-align: center; color: #4c1d95; }
.rp-steps { margin: 0; padding: 0; list-style: none; }
.rp-step { display: flex; align-items: center; gap: 0.25in; padding: 0.14in 0; border-bottom: 2px solid #ede9fe; break-inside: avoid; }
.rp-num { flex: none; display: grid; place-items: center; width: 0.7in; height: 0.7in; border-radius: 50%; background: #7c3aed; color: #fff; font-size: 2rem; font-weight: 700; }
.rp-pic { flex: none; width: 0.95in; height: 0.95in; border-radius: 50%; object-fit: cover; }
.rp-long .rp-pic { width: 0.7in; height: 0.7in; }
.rp-text { flex: 1; font-size: 1.7rem; font-weight: 600; line-height: 1.2; }
.rp-voice { flex: none; padding: 4px 12px; border-radius: 999px; font-size: 1rem; font-weight: 600; white-space: nowrap; }
.rp-voice-n { font-weight: 700; }
.rp-long .rp-step { padding: 0.08in 0; }
.rp-long .rp-num { width: 0.55in; height: 0.55in; font-size: 1.5rem; }
.rp-long .rp-text { font-size: 1.4rem; }
.rp-foot { margin: 0.3in 0 0; text-align: center; color: #6b6580; font-size: 0.75rem; }

@media print {
  @page { margin: 0.4in; }
  .rp-body { background: #fff; }
  .rp-bar { display: none; }
  .rp-sheet { max-width: none; margin: 0; padding: 0; box-shadow: none; }
  .rp-step, .rp-num, .rp-voice { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
}
