/* ══════════════════════════════════════════════════════════════════════
   Vedic Horā वैदिक होरा — the daily column (/magazine, /magazine/YYYY-MM-DD)

   Page-scoped. Reuses the optical-glass tokens from styles.css / site.css and
   introduces NO new colour: polarity is carried by an inline-SVG SHAPE and a
   LABEL, with --good / --bad tinting only the mark and its hairline. Text
   stays --ink, because --good and --bad are chosen for glass rather than for
   4.5:1 body copy, and a colour-blind reader must lose nothing at all — the
   measured deutan difference between the two tokens is 0.8, which is no
   difference. Shape and word carry the meaning; colour only agrees with them.

   Everything here is prefixed .mg- so it cannot reach another page.
   ══════════════════════════════════════════════════════════════════════ */

/* Two touch-target repairs, scoped to this page only so no other surface
   changes shape: the shared breadcrumb link and any link inside a flag row are
   inline text, and inline text is a 17px-tall target on a phone. Given the
   height here they clear the 44px floor without moving a pixel of layout,
   because the extra height is centred on the text they already occupied. */
.mg-main .crumbs a,
.mg-main .crumbs span[aria-current] {
  display: inline-flex; align-items: center; min-height: 44px;
}
.mg-main .mg-flag a,
.mg-main .mg-golink a { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); }
/* A link that leaves the column stands on its own line rather than inside a
   sentence: given a 44px box it would otherwise push the line-height of the
   paragraph around it. */
.mg-golink { margin: -4px 0 18px; font-size: .9rem; font-weight: 600; }

/* ── The masthead of one day ───────────────────────────────────────── */
.mg-column { max-width: 860px; }

.mg-masthead { margin: 0 0 44px; }
.mg-dateline {
  font-size: .78rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 12px;
}
/* Devanāgarī takes no uppercase and no wide tracking: both are Latin
   typographic devices, and applied to मात्रा-bearing script they only smear it. */
:lang(hi) .mg-dateline { text-transform: none; letter-spacing: .02em; font-size: .84rem; }

.mg-headline {
  font-size: clamp(1.75rem, 4.2vw, 2.6rem); line-height: 1.14;
  margin: 0 0 14px; font-weight: 650; letter-spacing: -.018em;
}
:lang(hi) .mg-headline { letter-spacing: 0; line-height: 1.34; font-size: clamp(1.55rem, 3.8vw, 2.25rem); }

.mg-published {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: .84rem; color: var(--ink-soft); margin: 0 0 22px;
  padding: 7px 14px 7px 11px; border-radius: 999px;
  border: 1px solid var(--hair); background: rgba(255,255,255,.42);
}
.mg-published svg { flex: none; }

.mg-stand { border-top: 1px solid var(--hair); padding-top: 20px; }
.mg-stand p {
  font-size: clamp(1rem, 1.7vw, 1.1rem); line-height: 1.68;
  color: var(--ink-soft); margin: 0 0 12px; max-width: 68ch;
}
.mg-stand p:first-child { color: var(--ink); }
.mg-stand p:last-child { margin-bottom: 0; }

/* ── Sections ──────────────────────────────────────────────────────── */
.mg-sec { margin: 0 0 52px; }
.mg-sec > h2 {
  font-size: 1.16rem; margin: 0 0 6px; line-height: 1.3;
  padding-bottom: 10px; border-bottom: 1px solid var(--hair);
}
.mg-sec > h2 + p { margin-top: 14px; }
.mg-sec p { color: var(--ink-soft); line-height: 1.7; margin: 0 0 14px; max-width: 72ch; }
.mg-sec h3 { font-size: .98rem; margin: 24px 0 8px; color: var(--ink); }

/* A quoted clause from a digitised text. It is the actual translation, so it
   is set apart and never blended into Horā's own prose. */
.mg-quote {
  margin: 10px 0 8px; padding: 12px 0 12px 18px;
  border-left: 2px solid var(--gold); color: var(--ink);
  font-size: .96rem; line-height: 1.66; max-width: 68ch;
}
.mg-cite { font-size: .8rem; color: var(--ink-soft); margin: 0 0 18px; line-height: 1.55; }
.mg-cite b { color: var(--ink-soft); font-weight: 600; }

/* ── The five limbs ────────────────────────────────────────────────── */
.mg-limbs {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px; margin: 18px 0 20px; padding: 0; list-style: none;
}
.mg-limb {
  padding: 15px 16px; border-radius: 15px;
  border: 1px solid var(--hair); background: rgba(255,255,255,.4);
}
.mg-limb dt {
  font-size: .74rem; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 7px;
}
:lang(hi) .mg-limb dt { text-transform: none; letter-spacing: .02em; font-size: .8rem; }
.mg-limb dd { margin: 0; font-size: 1.02rem; color: var(--ink); line-height: 1.4; }

/* ── The windows of the day ────────────────────────────────────────── */
.mg-windows { list-style: none; margin: 18px 0 16px; padding: 0; display: grid; gap: 10px; }
.mg-window {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 13px 16px; border-radius: 14px;
  border: 1px solid var(--hair); background: rgba(255,255,255,.4);
}
/* The hairline is the ONLY colour difference between the two states, and it is
   redundant with both the glyph and the word beside it. */
.mg-window.is-avoid { border-left: 3px solid var(--bad); }
.mg-window.is-taken { border-left: 3px solid var(--good); }
.mg-window-name { font-weight: 600; color: var(--ink); font-size: .95rem; }
.mg-window-time {
  font-variant-numeric: tabular-nums; color: var(--ink); font-size: .95rem;
  margin-left: auto; white-space: nowrap;
}
.mg-window-state {
  font-size: .76rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); border: 1px solid var(--hair);
  padding: 4px 10px; border-radius: 999px; white-space: nowrap;
}
:lang(hi) .mg-window-state { text-transform: none; letter-spacing: .02em; font-size: .82rem; }
.mg-exception {
  margin: 4px 0 0; padding: 14px 16px; border-radius: 14px;
  border: 1px dashed var(--hair); color: var(--ink-soft);
  font-size: .89rem; line-height: 1.66;
}

/* ── Where the grahas stand ────────────────────────────────────────── */
/* The table is the one wide thing on the page. It scrolls INSIDE this box so
   the page itself never scrolls sideways on a phone — and the box is a focus
   stop in its own right (tabindex="0" in the template), because a scroll
   container that cannot be focused cannot be panned by a keyboard, and three
   of this table's four columns appear nowhere else on the site. The ring is
   therefore drawn OUTSIDE the box, where the horizontal clip cannot shear it. */
.mg-scroll { overflow-x: auto; margin: 18px 0 14px; -webkit-overflow-scrolling: touch; }
.mg-scroll:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 10px;
}
.mg-table { width: 100%; border-collapse: collapse; font-size: .88rem; min-width: 420px; }
.mg-table th, .mg-table td {
  text-align: left; padding: 10px 14px 10px 0; border-bottom: 1px solid var(--hair);
  vertical-align: middle;
}
.mg-table thead th {
  font-size: .72rem; letter-spacing: .06em; text-transform: uppercase;
  color: var(--ink-soft); font-weight: 600; white-space: nowrap;
}
:lang(hi) .mg-table thead th { text-transform: none; letter-spacing: .02em; font-size: .8rem; }
/* styles.css uppercases every `th` on the site. That is right for a column
   heading and wrong for a ROW heading here, because these row headings are
   the grahas' own names: "SŪRYA" sets IAST diacritics in caps, where the
   macron and the underdot are hardest to read and most often synthesised
   badly, and reads as shouting a proper noun. Reset for this table only. */
.mg-table tbody th {
  font-weight: 600; color: var(--ink); white-space: nowrap;
  text-transform: none; letter-spacing: 0; font-size: .88rem;
}
.mg-table td { color: var(--ink-soft); }
.mg-table .mg-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.mg-motion { display: inline-flex; align-items: center; gap: 7px; color: var(--ink); white-space: nowrap; }

/* ── Marked days, stations, ingresses ──────────────────────────────── */
.mg-flags { list-style: none; margin: 16px 0; padding: 0; display: grid; gap: 10px; }
.mg-flag {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--hair); background: rgba(255,255,255,.45);
  color: var(--ink); font-size: .93rem; line-height: 1.6;
}
.mg-flag svg { flex: none; margin-top: 2px; }
.mg-empty { color: var(--ink-soft); font-size: .9rem; margin: 16px 0; }

/* ── The twelve undertakings ───────────────────────────────────────── */
.mg-verdicts { display: grid; gap: 16px; margin: 20px 0 26px; }
.mg-verdict {
  padding: 16px 18px; border-radius: 15px;
  border: 1px solid var(--hair); background: rgba(255,255,255,.4);
}
.mg-verdict.is-named { border-left: 3px solid var(--good); }
.mg-verdict.is-barred { border-left: 3px solid var(--bad); }
.mg-verdict-head {
  display: flex; align-items: center; gap: 10px; margin: 0 0 10px;
  font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink);
}
:lang(hi) .mg-verdict-head { text-transform: none; letter-spacing: .02em; font-size: .9rem; }
.mg-verdict-count { color: var(--ink-soft); font-variant-numeric: tabular-nums; letter-spacing: 0; }
.mg-acts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mg-acts li {
  font-size: .88rem; color: var(--ink); line-height: 1.4;
  padding: 7px 12px; border-radius: 10px;
  border: 1px solid var(--hair); background: rgba(255,255,255,.5);
}

.mg-rules { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 14px; }
.mg-rule {
  padding: 15px 17px; border-radius: 14px;
  border: 1px solid var(--hair); background: rgba(255,255,255,.36);
}
.mg-rule p { margin: 0 0 9px; color: var(--ink); font-size: .93rem; line-height: 1.65; max-width: 74ch; }
/* Specificity matched to `.mg-rule p` above (0-1-1), or the caption inherits
   the rule's own ink and the two lines read as one paragraph. */
.mg-rule p.mg-rule-acts { font-size: .82rem; color: var(--ink-soft); line-height: 1.6; margin: 0; }
.mg-rule-acts b { color: var(--ink); font-weight: 600; }

/* ── The index of days ─────────────────────────────────────────────── */
.mg-clock { display: grid; gap: 8px; }
.mg-clock h2 { margin: 0 0 4px; font-size: 1.05rem; }
.mg-clock p { margin: 0; color: var(--ink-soft); font-size: .92rem; line-height: 1.68; }
.mg-clock-next {
  display: inline-flex; align-items: center; gap: 9px; margin-top: 6px;
  font-size: .9rem; color: var(--ink); font-variant-numeric: tabular-nums;
}

.mg-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; }
.mg-item { padding: 0; margin: 0; }
/* The whole card is the link: 44px is a floor, not a target, and a reader on a
   phone should not have to find a word. */
.mg-item-link {
  display: block; padding: 20px 22px; text-decoration: none; color: inherit;
  border-radius: var(--radius); min-height: 44px;
  transition: background .3s;
}
.mg-item-link:hover { background: rgba(255,255,255,.34); }
.mg-item-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mg-item-date {
  font-size: .76rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 8px;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
:lang(hi) .mg-item-date { text-transform: none; letter-spacing: .02em; font-size: .84rem; }
.mg-today {
  letter-spacing: .04em; color: var(--ink); border: 1px solid var(--hair);
  border-radius: 999px; padding: 3px 9px; background: rgba(255,255,255,.55);
}
.mg-item-head { font-size: 1.1rem; margin: 0 0 8px; line-height: 1.35; color: var(--ink); }
.mg-item-sum { margin: 0 0 12px; color: var(--ink-soft); font-size: .9rem; line-height: 1.62; }
.mg-item-go { margin: 0; color: var(--accent); font-size: .85rem; font-weight: 600; }
.mg-item-marks { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.mg-item-marks li {
  font-size: .8rem; color: var(--ink); padding: 5px 11px;
  border: 1px solid var(--hair); border-radius: 999px; background: rgba(255,255,255,.5);
}

/* ── Pager ─────────────────────────────────────────────────────────── */
.mg-pager {
  display: flex; gap: 12px; flex-wrap: wrap; align-items: center;
  margin: 40px 0 10px; padding-top: 22px; border-top: 1px solid var(--hair);
}
.mg-pager a {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 44px; padding: 11px 18px; border-radius: 13px;
  text-decoration: none; color: var(--ink-soft); font-size: .88rem;
  border: 1px solid var(--hair); background: rgba(255,255,255,.4);
  transition: background .3s, color .3s;
}
.mg-pager a:hover { color: var(--ink); background: rgba(255,255,255,.62); }
.mg-pager .mg-pager-mid { margin-left: auto; }

/* Long provenance, folded away rather than deleted: a reader who wants the
   whole convention can open it, and one who does not is not made to scroll it. */
.mg-details {
  border: 1px solid var(--hair); border-radius: 15px;
  background: rgba(255,255,255,.32); padding: 0 18px; margin: 16px 0;
}
.mg-details > summary {
  cursor: pointer; list-style: none; padding: 15px 0; min-height: 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-size: .9rem; font-weight: 600; color: var(--ink);
}
.mg-details > summary::-webkit-details-marker { display: none; }
.mg-details > summary::after { content: "+"; color: var(--ink-soft); font-size: 1.25rem; line-height: 1; }
.mg-details[open] > summary::after { content: "−"; }
.mg-details p { font-size: .86rem; line-height: 1.72; color: var(--ink-soft); margin: 0 0 16px; }

.mg-fine {
  color: var(--ink-soft); font-size: .82rem; line-height: 1.66;
  border-left: 2px solid var(--hair); padding-left: 14px; margin: 22px 0 0;
}

/* ── Narrow screens ────────────────────────────────────────────────── */
@media (max-width: 560px) {
  .mg-window { gap: 10px; }
  .mg-window-time { margin-left: 0; width: 100%; order: 3; }
  .mg-window-state { order: 2; }
  .mg-item-link { padding: 18px; }
  .mg-limbs { grid-template-columns: repeat(auto-fit, minmax(132px, 1fr)); gap: 10px; }
  .mg-pager a { flex: 1 1 auto; justify-content: center; }
  .mg-pager .mg-pager-mid { margin-left: 0; }
}

/* ── Print: the column is an almanac page, and people print those ──── */
@media print {
  .mg-pager, .mg-item-go { display: none; }
  .mg-sec, .mg-limb, .mg-window, .mg-flag, .mg-verdict, .mg-rule {
    break-inside: avoid; background: none; border-color: #bbb;
  }
  .mg-details { border: none; padding: 0; }
  .mg-details[open] > summary::after, .mg-details > summary::after { content: ""; }
}
