/*
 * Structural stylesheet for the almanac layout. Mobile-first; desktop adjustments live in the
 * single min-width media query at the bottom. All colors/typefaces come from the theme token
 * file (theme-almanac.css) via var() — no literal colors or font names in this file.
 */
@import "reset.css";

body {
  background: var(--page-bg);
  color: var(--ink);
  font-family: var(--font-body);
  margin: 0;
  padding: 14px 10px 28px;
}

a {
  color: var(--ink);
}

a:hover,
a:focus-visible {
  color: var(--accent);
}

/* ---------- the sheet ---------- */

.sheet {
  max-width: 880px;
  margin: 0 auto;
  background: var(--paper);
  border: 1px solid var(--rule);
  outline: 2px double var(--rule);
  outline-offset: 3px;
  padding: 24px 16px 28px;
}

/* ---------- masthead ---------- */

.masthead {
  text-align: center;
  border-bottom: 3px double var(--rule);
  padding-bottom: 16px;
}

.masthead-issue {
  display: flex;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 13px;
  font-style: italic;
  color: var(--muted);
  margin: 0 0 10px;
}

/* On small screens only the date survives in the masthead; number and price live in the colophon */
.masthead-issue .issue-side {
  display: none;
}

.masthead-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(34px, 8vw, 68px);
  line-height: 1.02;
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}

.masthead-title a {
  text-decoration: none;
  color: var(--ink);
}

.masthead-tagline {
  font-style: italic;
  font-size: 14.5px;
  color: var(--muted);
  margin: 9px 0 0;
  line-height: 1.45;
}

.almanac-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px 16px;
  padding: 11px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 11.5px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.almanac-nav a {
  text-decoration: none;
}

.almanac-nav a:hover,
.almanac-nav a:focus-visible {
  text-decoration: underline;
}

.almanac-nav a.active {
  color: var(--accent);
  border-bottom: 2px solid var(--accent);
}

/* ---------- ledger rows (cosmic conditions, further reading) ---------- */

.ledger {
  margin: 26px auto 0;
  max-width: 560px;
}

.ledger-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 15px;
  text-align: center;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin: 0 0 2px;
}

.ledger-sub {
  text-align: center;
  font-style: italic;
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.ledger-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15.5px;
  padding: 5px 0;
}

.ledger-label {
  font-weight: 700;
  white-space: nowrap;
}

.ledger-label a {
  text-decoration: none;
  border-bottom: 1px solid var(--rule-soft);
}

.ledger-leader {
  flex: 1;
  border-bottom: 2px dotted var(--rule-soft);
  transform: translateY(-3px);
}

.ledger-value {
  font-style: italic;
  text-align: right;
}

/* ---------- entry (daily horoscope / article) ---------- */

.entry {
  margin: 30px auto 0;
  max-width: 600px;
}

.entry-eyebrow {
  text-align: center;
  font-size: 11.5px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 10px;
}

.entry-header {
  text-align: center;
  margin-bottom: 16px;
}

.entry-title {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: clamp(30px, 6vw, 42px);
  line-height: 1.08;
  margin: 0;
  text-wrap: balance;
}

.entry-glyph {
  font-family: var(--font-glyph);
  font-weight: 400;
}

.entry-dates {
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
  margin: 6px 0 0;
}

.entry-body {
  font-size: 17px;
  line-height: 1.68;
}

.entry-body p {
  margin: 0 0 0.95em;
}

.entry-body > p:first-of-type:not(.pending)::first-letter {
  font-family: var(--font-display);
  font-weight: 900;
  color: var(--accent);
  font-size: 3.1em;
  float: left;
  line-height: 0.82;
  padding: 5px 9px 0 0;
}

.entry-body h2,
.entry-body h3,
.entry-body h4 {
  font-family: var(--font-display);
  font-weight: 900;
  line-height: 1.15;
  margin: 1.4em 0 0.5em;
}

.entry-body h2 { font-size: 26px; }
.entry-body h3 { font-size: 21px; }
.entry-body h4 { font-size: 17px; }

.entry-body ul,
.entry-body ol {
  margin: 0 0 1em;
  padding-left: 1.4em;
}

.entry-body li {
  margin: 0.3em 0;
}

.entry-body blockquote {
  margin: 1.2em 0;
  padding: 2px 0 2px 16px;
  border-left: 3px solid var(--accent);
  font-style: italic;
  color: var(--muted);
}

.fn-mark {
  color: var(--accent);
  font-weight: 700;
}

.footnotes {
  margin-top: 18px;
  padding-top: 10px;
  border-top: 1px solid var(--rule-soft);
  font-size: 13.5px;
  font-style: italic;
  color: var(--muted);
  line-height: 1.55;
}

.footnotes p {
  margin: 0 0 4px;
}

/* "Not written yet" placeholder copy */
.pending {
  font-style: italic;
  color: var(--muted);
}

/* ---------- certification stamp ---------- */

/* Decorative flourish only: hidden on mobile to save vertical space, stamped over the
   entry-header corner on desktop (see the desktop media query). */
.stamp {
  display: none;
}

/* ---------- sign navigator ("Consult Another Fate") ---------- */

.sign-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.sign-stamp {
  background: transparent;
  border: 1px solid var(--rule);
  color: var(--ink);
  cursor: pointer;
  padding: 11px 2px 9px;
  min-height: 58px;
  font-family: var(--font-body);
  text-align: center;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: background 0.15s, color 0.15s;
}

.sign-glyph {
  display: block;
  font-size: 18px;
  margin-bottom: 3px;
  font-family: var(--font-glyph);
}

.sign-name {
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sign-stamp:hover,
.sign-stamp:focus-visible {
  background: var(--accent);
  color: var(--on-accent);
  border-color: var(--accent);
}

.sign-stamp.active {
  background: var(--ink);
  color: var(--on-accent);
  border-color: var(--ink);
}

/* ---------- colophon ---------- */

.colophon {
  margin-top: 34px;
  border-top: 3px double var(--rule);
  padding-top: 12px;
  text-align: center;
  font-style: italic;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
}

.colophon p {
  margin: 0 0 3px;
}

/* ---------- desktop ---------- */

@media (min-width: 720px) {
  body {
    padding: 40px 20px 56px;
  }

  .sheet {
    outline-width: 3px;
    outline-offset: 5px;
    padding: 44px 60px 54px;
  }

  .masthead {
    padding-bottom: 20px;
  }

  .masthead-issue {
    justify-content: space-between;
    font-size: 13.5px;
  }

  .masthead-issue .issue-side {
    display: inline;
  }

  .masthead-tagline {
    font-size: 17px;
  }

  .almanac-nav {
    font-size: 13px;
    letter-spacing: 0.18em;
    gap: 4px 22px;
    padding: 12px 0;
  }

  .ledger {
    margin-top: 34px;
  }

  .ledger-title {
    font-size: 19px;
  }

  .ledger-sub {
    font-size: 14px;
    margin-bottom: 16px;
  }

  .ledger-row {
    font-size: 16.5px;
  }

  .entry {
    margin-top: 40px;
    /* Anchor for the absolutely-positioned certification stamp */
    position: relative;
  }

  .entry-dates {
    font-size: 15px;
  }

  .entry-body {
    font-size: 18.5px;
    line-height: 1.7;
  }

  .entry-body h2 { font-size: 30px; }
  .entry-body h3 { font-size: 23px; }

  .footnotes {
    font-size: 14px;
  }

  /* Tilted ink stamp overlapping the top-right corner of the entry, beside the centered
     title. Out of the document flow so it costs no vertical space; the title stays centered
     with empty margins either side, so the stamp never covers text. */
  .stamp {
    display: flex;
    position: absolute;
    top: -20px;
    right: -14px;
    width: 104px;
    height: 104px;
    border: 2px solid var(--accent);
    border-radius: 50%;
    align-items: center;
    justify-content: center;
    text-align: center;
    transform: rotate(10deg);
    color: var(--accent);
    padding: 10px;
    font-size: 10.5px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-weight: 700;
    box-shadow: inset 0 0 0 2px var(--paper), inset 0 0 0 3px var(--accent);
    background: var(--accent-wash);
    pointer-events: none;
  }

  .sign-grid {
    grid-template-columns: repeat(auto-fit, minmax(102px, 1fr));
    gap: 9px;
  }

  .sign-glyph {
    font-size: 20px;
  }

  .sign-name {
    font-size: 12px;
    letter-spacing: 0.16em;
  }

  .colophon {
    margin-top: 44px;
    font-size: 14px;
  }
}
