/* Sheet landing v3 body (DEV-W170, inc/partials/sheet-landing-v3.php).
 *
 * The planner v3 system carried to the spreadsheets: a numbers row, the dark
 * gold band, one viewer with the workbook's own tab bar, one lived-in tab, the
 * compare slider + table, the first five minutes. Loaded only where
 * templacity_sheet_v3_on() is true, after sheet-landing.css, so every sl- rule
 * still applies and only sl3- rules are new. Components follow the site: buttons
 * var(--radius), chips/labels var(--radius-sm), only dots are round.
 */

.sl3 {
  --sl3-paper: #FDFCFA;
  --sl3-ink: #1F1E1A;
  --sl3-cream: #F3EFE6;
  --sl3-muted: #B9B4A6;
  --sl3-gold: #D9B860;
  --sl3-gold-soft: rgba(217, 184, 96, 0.16);
  --sl3-shadow: 0 1px 2px rgba(31, 30, 26, .06), 0 18px 44px -18px rgba(31, 30, 26, .28);
}
.sl3 > section, .sl3 .sl3-numbers { margin-top: 0; }
.sl3 .sl3-head { max-width: 680px; margin: 0 auto 40px; text-align: center; }
.sl3 .sl3-head h2 { font-size: var(--sl-h2); letter-spacing: -0.015em; line-height: 1.08; margin: 10px 0 0; }
.sl3 .sl3-head p { margin: 14px auto 0; font-size: 15.5px; color: var(--ink-muted); max-width: 54ch; }

/* ---- hero: one real sheet, big, with the real Night edition a tap away ---- */
.sl3-hero-sheet {
  position: relative; width: 100%; max-width: 660px; margin: 0 auto;
  border-radius: var(--radius); overflow: hidden;
  background: var(--sl3-paper); box-shadow: var(--sl3-shadow);
  border: 1px solid rgba(31, 30, 26, .08);
}
/* The light pane sizes the sheet from its own picture (each sheet's hero has its
   own shape; width/height attributes keep it shift-free); Night lies over it,
   cut to the same box from the top. */
.sl3-hero-pane img { display: block; width: 100%; height: auto; }
.sl3-hero-pane.is-night { position: absolute; inset: 0; }
.sl3-hero-pane.is-night img { width: 100%; height: 100%; object-fit: cover; object-position: top center; }
.sl3-hero-pane.is-night { background: var(--sl3-ink); }
.sl3-hero-pane[hidden] { display: none; }
.sl3-mode {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
  max-width: 660px; margin: 14px auto 0; font-size: 13px; color: var(--ink-faint);
}
.sl3-mode button {
  font: 500 13px/1 var(--sl-ui); color: var(--ink-muted); background: transparent;
  border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 8px 14px; cursor: pointer;
}
.sl3-mode button[aria-pressed="true"] { color: var(--paper, #fff); background: var(--ink); border-color: var(--ink); }
.sl3-mode button[data-sl3-mode="night"][aria-pressed="true"] { color: var(--sl3-gold); background: var(--sl3-ink); border-color: var(--sl3-ink); }
.sl3-mode span { margin-left: 4px; }
.sl3-pills { margin: 22px 0 0; font-family: var(--sl-ui); font-size: 13.5px; color: var(--ink-muted); letter-spacing: .01em; }

/* ---- a. numbers ---- */
.sl3-numbers { padding-block: 56px 0; }
.sl3-stats {
  list-style: none; margin: 0; padding: 28px 0 0; border-top: 1px solid var(--rule);
  display: grid; grid-template-columns: repeat(var(--n, 5), minmax(0, 1fr)); gap: 20px 24px;
}
.sl3-n { display: block; font-family: var(--serif); font-size: clamp(32px, 3vw, 46px); line-height: 1; letter-spacing: -0.02em; color: var(--ink); }
.sl3-l { display: block; margin-top: 8px; font-size: 13px; line-height: 1.4; color: var(--ink-muted); max-width: 20ch; }
.sl3-note { margin: 22px 0 0; font-size: 14px; color: var(--ink-muted); }

/* ---- b. the band: a dark island in both themes, with its own gold ---- */
.sl3-band { padding-top: var(--sl-gap); }
.sl3-band-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr); gap: 56px; align-items: center;
  background: var(--sl3-ink); color: var(--sl3-cream); border-radius: var(--radius-lg, 20px); padding: 60px;
}
.sl3-seal {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 10px;
  border: 1px solid var(--sl3-gold); border-radius: var(--radius-sm); color: var(--sl3-gold); background: var(--sl3-gold-soft);
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
}
.sl3 .sl3-band h2 { margin: 22px 0 16px; font-size: clamp(30px, 3.4vw, 48px); line-height: 1.06; letter-spacing: -0.018em; color: var(--sl3-gold); max-width: 16ch; }
.sl3-band-copy p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--sl3-muted); max-width: 40ch; }
.sl3-band-cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px; }
.sl3-col { margin: 0 0 14px; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--sl3-muted); }
.sl3-type, .sl3-works { list-style: none; margin: 0; padding: 0; font-size: 15px; line-height: 1.45; }
.sl3-type { counter-reset: t; }
.sl3-type li, .sl3-works li { padding: 11px 0; border-top: 1px solid rgba(243, 239, 230, .12); display: flex; gap: 12px; align-items: baseline; }
.sl3-type li::before {
  counter-increment: t; content: counter(t); flex: none; width: 22px; height: 22px; border-radius: 50%;
  border: 1px solid var(--sl3-gold); color: var(--sl3-gold); font-size: 12px; line-height: 20px; text-align: center; transform: translateY(-1px);
}
.sl3-works li { color: var(--sl3-cream); }
.sl3-works svg { flex: none; color: var(--sl3-gold); transform: translateY(3px); }
.sl3-works strong { font-weight: 500; color: #fff; }

/* ---- c. the viewer ---- */
.sl3-viewer { padding-top: var(--sl-gap); }
.sl3-book { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 48px; align-items: center; }
.sl3-window { border-radius: var(--radius); overflow: hidden; background: var(--sl3-paper); box-shadow: var(--sl3-shadow); border: 1px solid rgba(31, 30, 26, .1); }
.sl3-frame {
  position: relative; display: block; width: 100%; padding: 0; margin: 0; border: 0; cursor: zoom-in;
  background: var(--sl3-paper); aspect-ratio: 5 / 4; overflow: hidden;
}
.sl3-frame[hidden] { display: none; }
.sl3-frame.is-night { background: var(--sl3-ink); }
.sl3-frame .sl3-shot { width: 100%; height: 100%; object-fit: contain; object-position: top center; display: block; }
.sl3-frame.is-night .sl3-shot { object-fit: cover; }
.sl3-zoom {
  position: absolute; right: 12px; bottom: 12px; display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 10px; border-radius: var(--radius-sm); background: rgba(31, 30, 26, .82); color: #fff;
  font: 500 12px/1 var(--sl-ui); opacity: .92; pointer-events: none;
}
/* The tab bar is drawn like a spreadsheet's own: grey strip, the open tab lifted. */
.sl3-tabbar { display: flex; flex-wrap: wrap; gap: 2px; padding: 6px 8px 8px; background: #EDEAE3; border-top: 1px solid rgba(31, 30, 26, .12); }
.sl3-tab {
  font: 500 13px/1 var(--sl-ui); color: #5d5a52; background: transparent; border: 0;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm); padding: 10px 14px; cursor: pointer; min-height: 36px;
}
.sl3-tab:hover { background: rgba(255, 255, 255, .6); color: #1F1E1A; }
.sl3-tab[aria-selected="true"] { background: #fff; color: #1F1E1A; box-shadow: inset 0 2px 0 #8A6D1F; }
.sl3-tab.is-night[aria-selected="true"] { background: var(--sl3-ink); color: var(--sl3-gold); box-shadow: inset 0 2px 0 var(--sl3-gold); }
.sl3-words [hidden] { display: none; }
.sl3-label { margin: 0 0 6px; font-family: var(--serif); font-style: italic; font-size: 19px; color: var(--ink-faint); }
.sl3 .sl3-words h3 { font-size: clamp(26px, 2.4vw, 34px); line-height: 1.1; letter-spacing: -0.012em; margin: 0 0 14px; }
.sl3-words p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-muted); }
.sl3-live { margin-top: 26px; }

/* ---- d. lived in ---- */
.sl3-lived { padding-top: var(--sl-gap); }
.sl3-lived-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 56px; align-items: center; }
.sl3-lived-art { margin: 0; }
.sl3-lived-art .sl3-frame { aspect-ratio: auto; border-radius: var(--radius); box-shadow: var(--sl3-shadow); border: 1px solid rgba(31, 30, 26, .1); }
.sl3-lived-art .sl3-shot { height: auto; }
.sl3-lived-art figcaption { margin-top: 14px; text-align: center; font-size: 13px; color: var(--ink-faint); }
.sl3-ring {
  position: absolute; width: 56px; height: 56px; margin: -28px 0 0 -28px; border-radius: 50%;
  border: 2px solid #C9A646; background: rgba(217, 184, 96, .16); pointer-events: none;
  animation: sl3-pulse 2.4s ease-in-out infinite;
}
@keyframes sl3-pulse { 50% { transform: scale(1.14); opacity: .7; } }
@media (prefers-reduced-motion: reduce) { .sl3-ring { animation: none; } }
.sl3 .sl3-lived-copy h2 { font-size: var(--sl-h2); line-height: 1.08; letter-spacing: -0.015em; margin: 12px 0 16px; }
.sl3-lived-copy > p { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--ink-muted); }
.sl3-facts { list-style: none; margin: 22px 0 0; padding: 0; }
.sl3-facts li { position: relative; padding: 0 0 12px 24px; font-size: 15px; line-height: 1.5; color: var(--ink); }
.sl3-facts li::before { content: ""; position: absolute; left: 2px; top: 7px; width: 9px; height: 9px; border-radius: 50%; border: 2px solid #C9A646; }

/* ---- e. compared ---- */
.sl3-compare { padding-top: var(--sl-gap); }
.sl3-compare .sl-ba { margin-bottom: 48px; }
.sl3-table { border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; font-size: 14.5px; }
.sl3-tr { display: grid; grid-template-columns: 1.1fr 1.5fr 1fr 1fr; border-top: 1px solid var(--rule); }
.sl3-tr:first-child { border-top: 0; }
.sl3-tr > span { padding: 15px 18px; line-height: 1.45; color: var(--ink-muted); }
.sl3-tr > [role="rowheader"] { color: var(--ink); }
.sl3-tr > .is-ours { background: var(--gold-soft); color: var(--ink); }
.sl3-th > span { font-family: var(--serif); font-size: 17px; color: var(--ink); }
.sl3-th > .is-ours { color: var(--gold); }

/* ---- f. first five minutes ---- */
.sl3-first { padding-top: var(--sl-gap); }
.sl3-steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 32px; text-align: center; }
.sl3-step-n {
  display: inline-block; width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--gold);
  color: var(--gold); font-size: 14px; line-height: 28px;
}
.sl3 .sl3-steps h3 { font-size: 24px; margin: 14px 0 10px; letter-spacing: -0.01em; }
.sl3-steps p { margin: 0 auto; font-size: 15px; line-height: 1.55; color: var(--ink-muted); max-width: 34ch; }

/* ---- full-size reader ---- */
.sl3-dialog { width: min(1280px, 96vw); max-height: 92vh; padding: 0; border: 0; border-radius: var(--radius); background: var(--sl3-paper); box-shadow: 0 30px 80px rgba(0, 0, 0, .4); }
.sl3-dialog::backdrop { background: rgba(20, 19, 16, .72); }
.sl3-dialog-scroll { max-height: 92vh; overflow: auto; }
.sl3-dialog img { display: block; width: 100%; height: auto; max-width: none; }
.sl3-close {
  position: sticky; float: right; top: 10px; margin: 10px 10px -54px 0; z-index: 1; width: 44px; height: 44px;
  border-radius: var(--radius); border: 0; background: rgba(31, 30, 26, .85); color: #fff; font-size: 24px; line-height: 1; cursor: pointer;
}

/* ---- tablets and phones ---- */
@media (max-width: 960px) {
  .sl3-band-grid, .sl3-book, .sl3-lived-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  .sl3-band-grid { padding: 40px 28px; }
  .sl3-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .sl3-numbers { padding-top: 40px; }
  .sl3-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 16px; }
  .sl3-band-grid { padding: 32px 20px; border-radius: var(--radius); }
  .sl3-band-cols { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .sl3-steps { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .sl3-tab { padding: 9px 10px; font-size: 12.5px; }
  .sl3-zoom { right: 8px; bottom: 8px; }
  /* The table becomes one card per row: the answer column never sits off-screen. */
  .sl3-th { display: none; }
  .sl3-tr { grid-template-columns: minmax(0, 1fr); padding: 14px 0; }
  .sl3-tr > span { padding: 6px 16px; }
  .sl3-tr > [role="rowheader"] { font-family: var(--serif); font-size: 18px; padding-bottom: 8px; }
  .sl3-tr > [role="cell"]::before { content: attr(data-col); display: block; font-size: 11.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 2px; }
  .sl3-tr > .is-ours { margin: 0 12px; border-radius: var(--radius-sm); padding: 10px 12px; }
  .sl3-tr > .is-ours::before { color: var(--gold); }
  .sl3-dialog { width: 100vw; max-height: 100vh; border-radius: 0; }
  .sl3-dialog-scroll { max-height: 100vh; }
  .sl3-dialog img { width: 900px; }
}
