/* ══════════════════════════════════════════════════════════
   OPEN COMPONENTS
   Alternatives to boxed card grids. Each has a PHP helper in
   inc/components.php; templates_new.php (section I) shows them all.
   Boxes stay for genuine catalogues (worksheet cards, article grids).
══════════════════════════════════════════════════════════ */

/* Shared small label: Lekton, like .prose-list-title */
.compare-table th,
.spine-label,
.leader-cat,
.specimen-meta,
.figure-unit,
.margin-note-label {
  font-family: 'Lekton', serif;
  letter-spacing: 0.08em;
}


/* ──────────────────────────────────────────
   1. COMPARISON TABLE  (compare_table_html)
   Problem → cause → fix, or region → style → fonts.
   The last column is the answer, so it reads strongest.
────────────────────────────────────────── */
.compare-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1.5rem;
  font-size: 0.92rem;
  line-height: 1.75;
}
.compare-table th {
  text-align: left;
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  padding: 0 1.2rem 0.7rem 0;
  border-bottom: 1px solid var(--text3);
  vertical-align: bottom;
}
.compare-table th:last-child { color: var(--accent); }
.compare-table td {
  padding: 1.1rem 1.2rem 1.1rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text2);
  transition: border-color 0.35s;
}
.compare-table td:first-child {
  font-family: 'Cormorant Upright', serif;
  font-size: 1.12rem;
  line-height: 1.4;
  color: var(--text);
  width: 22%;
}
.compare-table td:last-child { color: var(--text); padding-right: 0; }
.compare-table a { color: var(--accent); }

@media (max-width: 768px) {
  .compare-table, .compare-table tbody, .compare-table tr, .compare-table td { display: block; width: auto; }
  .compare-table thead { display: none; }
  .compare-table tr { padding: 1rem 0; border-bottom: 1px solid var(--border); }
  .compare-table td { border: none; padding: 0.15rem 0; }
  .compare-table td:first-child { width: auto; margin-bottom: 0.3rem; }
  .compare-table td:not(:first-child)::before {
    content: attr(data-label);
    display: block;
    font-family: 'Lekton', serif;
    font-size: 0.66rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text3);
    margin-top: 0.5rem;
  }
  .compare-table td:last-child::before { color: var(--accent); }
}


/* ──────────────────────────────────────────
   2. PROGRESSION SPINE  (spine_html)
   Stages in order: a vertical line with a node per stage.
────────────────────────────────────────── */
.spine {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  max-width: 76ch;
}
.spine-step {
  display: grid;
  grid-template-columns: 12ch 1.6rem 1fr;
  column-gap: 1.2rem;
  position: relative;
}
/* the line: runs through the node column from this node to the next */
.spine-step::before {
  content: '';
  position: absolute;
  left: calc(12ch + 1.2rem + 0.8rem - 0.5px);
  top: 0.9rem;
  bottom: -0.9rem;
  width: 1px;
  background: var(--border-lt);
}
.spine-step:last-child::before { display: none; }
.spine-label {
  font-size: 0.7rem;
  color: var(--text3);
  text-transform: uppercase;
  text-align: right;
  padding-top: 0.45rem;
}
.spine-node {
  width: 0.75rem;
  height: 0.75rem;
  margin: 0.5rem auto 0;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: var(--bg);
  position: relative;
  z-index: 1;
}
.spine-step:first-child .spine-node { background: var(--accent); }
.spine-content { padding-bottom: 2.2rem; }
.spine-step:last-child .spine-content { padding-bottom: 0; }
.spine-title {
  font-family: 'Cormorant Upright', serif;
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 0.35rem;
}
.spine-body { font-size: 0.92rem; color: var(--text2); line-height: 1.8; margin: 0; }
.spine-links { list-style: none; margin: 0.6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.3rem 1.4rem; }
.spine-links a { font-size: 0.88rem; color: var(--accent); text-decoration: none; }
.spine-links a:hover { color: var(--accent-hover); text-decoration: underline; text-underline-offset: 3px; }

/* compact: short schedules (week plans) */
.spine--compact .spine-content { padding-bottom: 1rem; }
.spine--compact .spine-title { font-family: inherit; font-size: 0.98rem; font-weight: 500; margin-bottom: 0.1rem; }
.spine--compact .spine-body { font-size: 0.88rem; line-height: 1.65; }
.spine--compact .spine-label { padding-top: 0.25rem; }
.spine--compact .spine-node { width: 0.6rem; height: 0.6rem; margin-top: 0.38rem; }
.spine--compact .spine-step::before { top: 0.7rem; bottom: -0.7rem; }

/* session bar: one segment per step, sized by its minutes */
.session-bar {
  display: flex;
  gap: 3px;
  margin: 1.5rem 0 0.4rem;
  max-width: 76ch;
}
.session-seg {
  flex: 1 1 0;
  min-width: 0;
  padding: 0.45rem 0.6rem 0.5rem;
  background: var(--accent-bg);
  border-top: 2px solid var(--accent);
  overflow: hidden;
}
.session-min {
  display: block;
  font-family: 'Cormorant Upright', serif;
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--accent);
}
.session-name {
  display: block;
  font-family: 'Lekton', serif;
  font-size: 0.66rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.session-bar + .spine { margin-top: 1.4rem; }

@media (max-width: 768px) {
  /* narrow segments: minutes only (the spine below names each phase) */
  .session-seg { padding: 0.4rem 0.45rem; }
  .session-min { font-size: 1.05rem; white-space: nowrap; }
  .session-name { display: none; }
  .spine-step { grid-template-columns: 1.6rem 1fr; column-gap: 0.9rem; }
  .spine-step::before { left: calc(0.8rem - 0.5px); }
  .spine-label { grid-column: 2; grid-row: 1; text-align: left; padding-top: 0.3rem; }
  .spine-node { grid-column: 1; grid-row: 1; }
  .spine-content { grid-column: 2; }
}


/* ──────────────────────────────────────────
   3. DOT-LEADER INDEX  (leader_index_html)
   Link collections as a table of contents.
   --2col splits long lists into two columns.
────────────────────────────────────────── */
.leader-index {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  max-width: 68ch;
}
.leader-index--2col { max-width: none; columns: 2; column-gap: 3rem; }
.leader-index li { break-inside: avoid; }
.leader-index a {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  padding: 0.55rem 0;
  text-decoration: none;
  color: var(--text);
}
.leader-title { font-size: 1rem; transition: color 0.15s; }
.leader-dots {
  flex: 1;
  min-width: 2rem;
  border-bottom: 1.5px dotted var(--border-lt);
  transform: translateY(-0.25em);
}
.leader-cat { font-size: 0.7rem; color: var(--text3); white-space: nowrap; transition: color 0.15s; }
.leader-index a:hover .leader-title,
.leader-index a:hover .leader-cat { color: var(--accent); }
.leader-desc { display: block; font-size: 0.85rem; color: var(--text2); line-height: 1.6; margin: -0.35rem 0 0.4rem; }

@media (max-width: 768px) {
  .leader-index--2col { columns: 1; }
}


/* ──────────────────────────────────────────
   4. SPECIMEN ROWS  (specimen_list_html)
   Fonts and styles shown as the lettering itself
   (inline SVG in currentColor, so it follows the theme).
────────────────────────────────────────── */
.specimen-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.specimen-row {
  display: grid;
  grid-template-columns: 16rem 1fr;
  gap: 0.4rem 2rem;
  align-items: center;
  padding: 1.2rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.35s;
}
.specimen-name {
  font-family: 'Cormorant Upright', serif;
  font-size: 1.2rem;
  line-height: 1.3;
  color: var(--text);
  transition: color 0.15s;
}
.specimen-meta { display: block; font-size: 0.68rem; color: var(--text3); text-transform: uppercase; margin-top: 0.3rem; }
.specimen-desc { display: block; font-size: 0.85rem; color: var(--text2); line-height: 1.6; margin-top: 0.4rem; }
.specimen-sample { color: var(--text); min-width: 0; }
/* natural size: every specimen is drawn at the same letter height */
.specimen-sample svg { display: block; width: auto; max-width: 100%; height: auto; }
.specimen-row:hover .specimen-name { color: var(--accent); }
.specimen-row:hover .specimen-sample { color: var(--accent); }

@media (max-width: 768px) {
  .specimen-row { grid-template-columns: 1fr; }
}


/* ──────────────────────────────────────────
   5. FIGURE BAND  (figure_band_html)
   Two to four big numbers with a caption. At most one per page.
────────────────────────────────────────── */
.figure-band {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  margin: 1.5rem 0 2rem;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.figure-item { padding: 1.4rem 1.6rem 1.3rem 0; }
.figure-item + .figure-item { padding-left: 1.6rem; border-left: 1px solid var(--border); }
.figure-num {
  font-family: 'Cormorant Upright', serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
}
.figure-unit { font-size: 0.75rem; color: var(--text3); text-transform: uppercase; margin-left: 0.35rem; }
.figure-caption { font-size: 0.85rem; color: var(--text2); line-height: 1.6; margin: 0.6rem 0 0; }

@media (max-width: 768px) {
  .figure-band { grid-template-columns: 1fr; }
  .figure-item + .figure-item { padding-left: 0; border-left: none; border-top: 1px solid var(--border); }
}


/* ──────────────────────────────────────────
   6. MARGIN NOTE  (margin_note_html)
   A short aside set in the section's left margin, level with
   the paragraph it belongs to. Inline aside below 768px.
   Works inside .pillar-section-content (10rem margin + 3rem padding).
────────────────────────────────────────── */
.with-note { position: relative; }
.margin-note {
  position: absolute;
  top: 0.3rem;
  left: calc(-13rem + 1.2rem);
  width: 7.6rem;
  font-size: 0.8rem;
  line-height: 1.55;
  color: var(--text2);
  font-style: italic;
}
.margin-note::before {
  content: '';
  display: block;
  width: 1.5rem;
  height: 1px;
  background: var(--accent);
  margin-bottom: 0.5rem;
}
.margin-note-label { display: block; font-style: normal; font-size: 0.66rem; color: var(--accent); text-transform: uppercase; margin-bottom: 0.25rem; }

@media (max-width: 768px) {
  .margin-note {
    position: static;
    width: auto;
    margin: 0 0 1rem;
    padding-left: 0.9rem;
    border-left: 2px solid var(--accent);
  }
  .margin-note::before { display: none; }
}


/* ──────────────────────────────────────────
   7. PATH  (path_html)
   Stops along a horizontal scale (easy → hard, a normal pen → nib and ink).
   Nodes fill from hollow to solid along the way. Vertical below 768px.
────────────────────────────────────────── */
.path { margin: 1.5rem 0 0; }
.path-ends {
  display: flex;
  justify-content: space-between;
  font-family: 'Lekton', serif;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text3);
  margin-bottom: 0.6rem;
}
.path-ends span:last-child { color: var(--accent); }
.path-stops {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(var(--n, 4), minmax(0, 1fr));
  gap: 0 1.6rem;
  position: relative;
}
/* the scale line with an arrowhead, through the node centres */
.path-stops::before {
  content: '';
  position: absolute;
  left: 0; right: 0.3rem;
  top: 0.45rem;
  height: 1px;
  background: var(--border-lt);
}
.path-stops::after {
  content: '';
  position: absolute;
  right: 0;
  top: calc(0.45rem - 4px);
  border: 4.5px solid transparent;
  border-left: 7px solid var(--border-lt);
  border-right: none;
}
.path-node {
  display: block;
  width: 0.9rem;
  height: 0.9rem;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: color-mix(in srgb, var(--accent) calc(var(--k, 0) * 100%), var(--bg));
  position: relative;
  z-index: 1;
  margin-bottom: 0.9rem;
}
.path-title {
  font-family: 'Cormorant Upright', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
  margin: 0 0 0.3rem;
}
.path-body { font-size: 0.86rem; color: var(--text2); line-height: 1.65; margin: 0; }

@media (max-width: 768px) {
  .path-stops { grid-template-columns: 1fr; gap: 0; padding-left: 1.8rem; }
  .path-stops::before { left: 0.45rem; right: auto; top: 0; bottom: 0.4rem; width: 1px; height: auto; }
  .path-stops::after { left: calc(0.45rem - 4px); right: auto; top: auto; bottom: 0; border: 4.5px solid transparent; border-top: 7px solid var(--border-lt); border-bottom: none; }
  .path-stop { position: relative; padding-bottom: 1.4rem; }
  .path-node { position: absolute; left: -1.8rem; top: 0.25rem; margin: 0; }
}


/* ──────────────────────────────────────────
   8. DECISION LIST  (decision_list_html)
   If this is your goal → choose this, with the reasoning underneath.
────────────────────────────────────────── */
.decision-list {
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
  max-width: 76ch;
}
.decision {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 2.2rem minmax(0, 1.25fr);
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--border);
  transition: border-color 0.35s;
}
.decision-goal { font-family: 'Cormorant Upright', serif; font-size: 1.15rem; color: var(--text2); line-height: 1.35; }
.decision-arrow { color: var(--accent); text-align: center; }
.decision-pick { font-family: 'Cormorant Upright', serif; font-size: 1.15rem; font-weight: 500; color: var(--text); line-height: 1.35; }
.decision-why { grid-column: 3; font-size: 0.86rem; color: var(--text2); line-height: 1.65; margin: 0.3rem 0 0; }

@media (max-width: 768px) {
  .decision { grid-template-columns: 1.6rem minmax(0, 1fr); }
  .decision-goal { grid-column: 1 / -1; }
  .decision-arrow { text-align: left; }
  .decision-why { grid-column: 2; }
}


/* ──────────────────────────────────────────
   9. CHECKLIST  (checklist_html)
   Printed-style tick boxes. Real checkboxes, so readers can tick through
   them on screen; nothing is saved.
────────────────────────────────────────── */
.checklist { margin: 1.5rem 0 0; max-width: 68ch; }
.checklist-label {
  display: block;
  font-family: 'Lekton', serif;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.6rem;
}
.checklist ul { list-style: none; margin: 0; padding: 0; }
.checklist li + li { border-top: 1px dashed var(--border); }
.checklist label {
  display: grid;
  grid-template-columns: 1.4rem 1fr;
  gap: 0.9rem;
  align-items: start;
  padding: 0.75rem 0;
  cursor: pointer;
  font-size: 0.95rem;
  color: var(--text);
  line-height: 1.6;
}
.checklist input {
  appearance: none;
  -webkit-appearance: none;
  width: 1.15rem;
  height: 1.15rem;
  margin: 0.2rem 0 0;
  border: 1.5px solid var(--text3);
  border-radius: 2px;
  background: transparent;
  cursor: pointer;
  position: relative;
}
.checklist input:checked { border-color: var(--accent); }
.checklist input:checked::after {
  content: '';
  position: absolute;
  left: 0.3rem; top: 0.02rem;
  width: 0.35rem; height: 0.7rem;
  border: solid var(--accent);
  border-width: 0 2px 2px 0;
  transform: rotate(40deg);
}
.checklist input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.checklist-note { display: block; font-size: 0.85rem; color: var(--text2); line-height: 1.6; }


/* Card text shared by the figure, keyword and split cards */
.figure-card-title, .keyword-title, .split-card-title {
  font-family: 'Cormorant Upright', serif;
  font-size: 1.22rem;
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  margin: 0;
}
.figure-card-body, .keyword-body, .split-card-body { font-size: 0.86rem; line-height: 1.65; color: var(--text2); margin: 0.35rem 0 0; }
.figure-cards, .keyword-cards, .split-cards { list-style: none; margin: 1.5rem 0 0; padding: 0; }


/* ──────────────────────────────────────────
   10. FIGURE CARDS  (figure_cards_html)
   A big accent number from the card's own text; accent rule along the bottom.
────────────────────────────────────────── */
.figure-cards { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); gap: 12px; }
.figure-card {
  background: var(--surface);
  padding: 1.1rem 1.1rem 1.2rem;
  border-bottom: 3px solid var(--accent);
  transition: background 0.35s, border-color 0.35s;
}
.figure-card-fig { display: flex; align-items: baseline; gap: 0.4rem; margin-bottom: 0.5rem; }
.figure-card-num { font-family: 'Cormorant Upright', serif; font-size: 3.4rem; line-height: 0.9; font-weight: 500; color: var(--accent); }
.figure-card-unit { font-family: 'Lekton', serif; font-size: 0.66rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text3); line-height: 1.3; }


/* ──────────────────────────────────────────
   11. KEYWORD CARDS  (keyword_cards_html)
   No boxes: an italic accent keyword, hairline rules between, a short accent dash to finish.
────────────────────────────────────────── */
.keyword-cards { display: grid; grid-template-columns: repeat(var(--cols, 4), minmax(0, 1fr)); row-gap: 2rem; }
.keyword-card { padding: 0.2rem 1.2rem 0.4rem; border-left: 1px solid var(--border); transition: border-color 0.35s; }
.keyword-key {
  display: block;
  font-family: 'Cormorant Upright', serif;
  font-style: italic;
  font-size: 2.1rem;
  line-height: 1.05;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.keyword-title { display: block; }
.keyword-card::after { content: ''; display: block; width: 1.6rem; height: 2px; background: var(--accent); margin-top: 0.9rem; }
/* first card of each row: no rule on its left */
.keyword-cards[style*="--cols:4"] .keyword-card:nth-child(4n+1),
.keyword-cards[style*="--cols:3"] .keyword-card:nth-child(3n+1),
.keyword-cards[style*="--cols:2"] .keyword-card:nth-child(2n+1),
.keyword-cards[style*="--cols:1"] .keyword-card { border-left: none; padding-left: 0; }


/* ──────────────────────────────────────────
   12. SPLIT CARDS  (split_cards_html)
   Horizontal cards: an accent-tinted glyph column beside the text.
────────────────────────────────────────── */
.split-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.split-card { display: grid; grid-template-columns: 4.6rem minmax(0, 1fr); background: var(--surface); transition: background 0.35s; }
.split-card-glyph {
  display: grid;
  place-items: center;
  background: var(--accent-bg);
  border-right: 2px solid var(--accent);
  font-family: 'Cormorant Upright', serif;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--accent);
  white-space: nowrap;
  padding: 0.6rem 0;
}
.split-card-main { padding: 0.85rem 1rem 0.95rem; }

@media (max-width: 1000px) {
  .figure-cards[style*="--cols:4"], .keyword-cards[style*="--cols:4"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .keyword-cards[style*="--cols:4"] .keyword-card:nth-child(4n+1) { border-left: 1px solid var(--border); padding-left: 1.2rem; }
  .keyword-cards[style*="--cols:4"] .keyword-card:nth-child(2n+1) { border-left: none; padding-left: 0; }
}
@media (max-width: 768px) {
  .split-cards { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .figure-cards { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: 8px; }
  .figure-card { padding: 0.9rem 0.85rem 1rem; }
  .figure-card-num { font-size: 2.7rem; }
  .keyword-cards { grid-template-columns: 1fr !important; }
  .keyword-cards .keyword-card { border-left: none !important; padding-left: 0 !important; }
}
