/* Readings. Everything here sits on the shared tokens and controls in style.css:
   ruled sections instead of boxes, and the chart set in type alone. */
.fortune-main { max-width: 720px; min-height: 60vh; padding-block: var(--space-6) var(--space-8); overflow-wrap: anywhere; }
.fortune-main .lead { color: var(--muted); max-width: 62ch; }
.fortune-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin-block: var(--space-2); }
.fortune-actions > * { max-width: 100%; }
.fortune-form { margin-top: var(--space-3); }
.fortune-form fieldset { margin-bottom: var(--space-4); }
/* The birth details: the Gregorian date, the clock time and the city, each a short part with its
   heading on top and its own error right under its controls. */
.fortune-form .birth-group { margin-bottom: var(--space-3); }
.fortune-form .date-parts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.fortune-form .fortune-extra { margin-top: var(--space-1); }
.fortune-form .fortune-extra:empty { display: none; }
.fortune-form .birth-group > .field-help { margin-bottom: 0; }
.fortune-notice { margin: var(--space-2) 0 0; color: var(--muted); font-size: var(--text-sm); }
.fortune-city .field-help:last-of-type { margin-bottom: 0; }
.fortune-feedback:empty { display: none; }
.fortune-message { max-width: 62ch; }
.fortune-consent { margin-block: var(--space-3); }
.fortune-consent p { margin-bottom: var(--space-1); }
.fortune-ended { padding-block: var(--space-2); }
.site-notice { margin-block: var(--space-2) 0; }

/* The wait: the breathing mark, what is happening now, and a line that fills as an estimate. */
.fortune-wait { display: grid; justify-items: center; gap: var(--space-1); padding-block: var(--space-6); text-align: center; }
.wait-stage { margin: 0; font: 400 var(--text-lg)/1.5 var(--display-font); }
.wait-bar { width: min(280px, 100%); height: 1px; margin-block: var(--space-2); background: var(--line); }
.wait-bar span { display: block; width: 0; height: 1px; background: var(--ink); transition: width 1s linear; }

/* A reading: the overview speaks first; every later part is ruled off from the one before. */
.reading-section { margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }
.reading-section h2 { font-size: var(--text-xl); }
.reading-section > p { max-width: 62ch; }
/* Below the way in: how a chart is set out and read, four steps ruled off from the page above. */
.fortune-intro h2 { font-size: var(--text-lg); }
.fortune-steps { margin: 0; padding-inline-start: 1.5em; }
.fortune-steps li { padding-inline-start: 4px; }
.fortune-steps li + li { margin-top: var(--space-3); }
.fortune-steps li::marker { color: var(--faint); font: 400 var(--text-md)/1.5 var(--serif); }
.fortune-steps p { max-width: 62ch; margin: 0; color: var(--muted); font-size: var(--text-sm); }
.overview > p { font-size: var(--text-lg); line-height: 1.7; }
/* The one closing note, set apart by a hairline right after the reading it speaks of. */
.fortune-disclaimer { margin-top: var(--space-6); padding-top: var(--space-2); border-top: 1px solid var(--line); text-wrap: pretty; }
.fortune-disclaimer + .fortune-actions { margin-top: var(--space-4); }
/* A year: its lead sentence, the facts it rests on, then nine topics in two columns (one on a
   phone). Each topic is a quiet sheet of paper; the reminders run the full width on the wash. */
.annual-summary { font: 400 var(--text-lg)/1.7 var(--display-font); }
.fortune-facts.annual-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--space-4); max-width: none; }
.annual-topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); margin-top: var(--space-3); }
.annual-topic { padding: 20px var(--space-3) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-paper); background: var(--card); }
.annual-topic h3 { margin: 0 0 12px; font: 400 18px/1.4 var(--display-font); }
html[lang="zh-Hans"] .annual-topic h3 { letter-spacing: .08em; }
.annual-topic p { margin: 0; color: var(--muted); }
.annual-topic[data-topic="advice"] { grid-column: 1 / -1; border-color: transparent; border-inline-start: 2px solid var(--ink); background: var(--wash); }
.annual-reminders { margin: 0; padding-inline-start: 1.4em; color: var(--muted); }
.annual-reminders li { padding-inline-start: 4px; }
.annual-reminders li + li { margin-top: var(--space-1); }
.annual-reminders li:empty { display: none; }
.annual-reminders li::marker { color: var(--faint); font: 400 var(--text-md)/1.5 var(--serif); }
@media (max-width: 640px) {
  .annual-topics, .fortune-facts.annual-facts { grid-template-columns: minmax(0, 1fr); }
  .annual-summary { font-size: 18px; }
  .annual-topic { padding: var(--space-2) var(--space-2) 20px; }
}

/* The four pillars, set as a chart is written: year, month, day and hour in four equal
   columns; the ten god above, the heavenly stem over the earthly branch. Hairlines between
   columns, Songti glyphs, nothing drawn. The day pillar is the page's one vermilion. */
.pillars { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); max-width: 440px; margin: var(--space-3) 0 var(--space-4); padding-block: var(--space-2); border-block: 1px solid var(--ink); text-align: center; }
.pillar { display: grid; align-content: start; gap: var(--space-1); padding: var(--space-1) 2px; }
.pillar + .pillar { border-inline-start: 1px solid var(--line); }
.pillar dt { display: grid; gap: 4px; min-height: 4.2em; align-content: start; color: var(--faint); font-size: var(--text-xs); line-height: 1.35; }
.pillar-name { color: var(--ink); letter-spacing: .3em; margin-inline-end: -.3em; }
html[lang="en"] .pillar-name { letter-spacing: .08em; margin: 0; text-transform: uppercase; }
.pillar dd { margin: 0; }
.pillar dd span { display: block; font: 400 var(--text-2xl)/1.2 var(--chinese); }
.pillar dd small, .elements small { display: block; color: var(--faint); font: 400 var(--text-xs)/1.4 var(--sans); }
.elements small:empty { display: none; }
.pillars[data-accent] .pillar[data-day] dd span { color: var(--accent); }
/* The five elements in one row: the glyph, and how many of the eight characters carry it. */
.elements { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); max-width: 440px; margin: var(--space-3) 0; text-align: center; }
.elements dt span { display: block; font: 400 var(--text-xl)/1.3 var(--chinese); }
.elements dd { margin: 4px 0 0; font: 400 var(--text-lg)/1.4 var(--serif); }
.elements div + div { border-inline-start: 1px solid var(--line); }
/* Plain facts: a label and its value on one ruled line. */
.fortune-facts { max-width: 520px; margin: var(--space-2) 0 var(--space-3); }
.fortune-facts div { display: grid; grid-template-columns: minmax(6em, 34%) minmax(0, 1fr); gap: var(--space-2); padding-block: var(--space-1); border-bottom: 1px solid var(--line); }
.fortune-facts dt { color: var(--faint); font-size: var(--text-sm); }
.fortune-facts dd { margin: 0; }

/* A short look back, on the same left edge as the two annual readings. Its anchors carry
   only a faint rule, lighter than the bordered topic cards of each year. */
.last-year h2 { margin-bottom: var(--space-1); font-size: var(--text-lg); }
.last-year-guide { color: var(--muted); font-size: var(--text-sm); text-wrap: pretty; }
.last-year-facts { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); margin-block: var(--space-2); }
.last-year-facts div { display: flex; align-items: baseline; gap: var(--space-1); padding: 0; border: 0; }
.last-year-facts dd { font-size: var(--text-sm); }
.last-year-anchors { list-style: none; max-width: 62ch; margin: var(--space-3) 0 0; padding: 0; }
.last-year-anchors li { padding-inline-start: var(--space-2); border-inline-start: 2px solid var(--line); }
.last-year-anchors li + li { margin-top: var(--space-2); }
.last-year-anchors h3 { margin: 0 0 4px; font: 400 var(--text-md)/1.4 var(--display-font); }
html[lang="zh-Hans"] .last-year-anchors h3 { letter-spacing: .06em; }
.last-year-anchors p { margin: 0; color: var(--muted); text-wrap: pretty; }
.share-options:empty { display: none; }
.share-link { overflow-wrap: anywhere; }

/* The guide to the parts of Readings, at the top of every page in the section: one ruled strip of
   equal columns, a name and a line for each part. The current part is a sheet of paper under an ink rule. */
.section-guide { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin: calc(var(--space-2) * -1) 0 var(--space-4); border-block: 1px solid var(--line); }
.section-guide a { position: relative; display: grid; align-content: start; gap: 4px; min-height: 76px; padding: 14px var(--space-2) var(--space-2); color: var(--ink); text-decoration: none; }
.section-guide a + a { border-inline-start: 1px solid var(--line); }
.section-guide .guide-title { font: 400 var(--text-lg)/1.3 var(--display-font); }
html[lang="zh-Hans"] .section-guide .guide-title { letter-spacing: .08em; }
.section-guide .guide-note { color: var(--faint); font: 400 13px/1.5 var(--sans); text-wrap: balance; }
.section-guide a:hover { background: var(--wash); }
.section-guide a[aria-current] { background: var(--card); }
.section-guide a[aria-current]::before { content: ""; position: absolute; inset: -1px 0 auto; border-top: 2px solid var(--ink); }
.section-guide a:focus-visible { outline-offset: -4px; }
/* Deep inside one part (a finished reading, one question) the lines are left out. */
.section-guide[data-compact] a { min-height: 48px; align-content: center; padding-block: 10px; }
.section-guide[data-compact] .guide-note { display: none; }
.section-guide[data-compact] .guide-title { font-size: 17px; }
/* After a reading: the other parts of the section, each a quiet sheet of paper that is one link. */
.next-steps h2 { font-size: var(--text-lg); }
.next-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.next-card { display: grid; grid-template-rows: auto 1fr auto; gap: var(--space-1); padding: 20px var(--space-3) var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-paper); background: var(--card); color: var(--ink); text-decoration: none; }
.next-card .next-title { font: 400 var(--text-lg)/1.3 var(--display-font); }
html[lang="zh-Hans"] .next-card .next-title { letter-spacing: .08em; }
.next-card .next-text { color: var(--muted); font-size: var(--text-sm); line-height: 1.7; }
.next-card .next-go { display: inline-flex; align-items: center; min-height: 44px; font: 500 var(--text-sm)/1.5 var(--sans); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 5px; }
.next-card:hover { border-color: var(--control); }
.next-card:hover .next-go { color: var(--accent); }
.fortune-actions + .next-steps { margin-top: var(--space-4); }
@media (max-width: 640px) {
  .section-guide { margin-block: calc(var(--space-3) * -1) var(--space-3); }
  .section-guide a { min-height: 72px; padding: 12px 10px; }
  .section-guide .guide-title { font-size: 16px; }
  html[lang="zh-Hans"] .section-guide .guide-title { letter-spacing: .04em; }
  .section-guide .guide-note { font-size: var(--text-xs); }
  .section-guide[data-compact] .guide-title { font-size: 15px; }
  .next-cards { grid-template-columns: minmax(0, 1fr); }
  .next-card { padding: var(--space-2) var(--space-2) var(--space-1); }
}
@media (max-width: 360px) {
  .section-guide a { padding-inline: 8px; }
}

/* The My page: one line per reading. */
.my-fact { margin: 0; color: var(--ink); }
.reading-list { margin: 0 0 var(--space-1); padding: 0; list-style: none; }
.reading-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); min-height: 48px; border-bottom: 1px solid var(--line); }
.reading-open { margin-inline-end: auto; padding-block: 11px; color: var(--ink); text-decoration: none; }
.reading-open:hover { color: var(--accent); }
@media (max-width: 440px) {
  .pillar dd span { font-size: 36px; }
}
