/* Lunar theme. Dark night-sky palette; everything scales from a few tokens. */
:root {
  --bg: #0b1020;
  --bg-2: #0f1730;
  --surface: #141c33;
  --surface-2: #1b2544;
  --line: #273356;
  --text: #e9edf7;
  --muted: #9aa6c4;
  --accent: #f2c76b;
  --accent-2: #8fb4ff;
  --moon-lit: #f3e9c6;
  --moon-dark: #1a2340;
  --moon-rim: rgba(243, 233, 198, 0.18);
  --radius: 14px;
  --radius-sm: 8px;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(1200px 600px at 80% -10%, #1a2550 0%, var(--bg) 55%);
  color: var(--text);
  font: 16px/1.55 var(--font);
  min-height: 100vh;
}
a { color: var(--accent-2); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 0.5em; font-weight: 700; letter-spacing: -0.01em; }
h1 { font-size: clamp(1.7rem, 2.2vw + 1rem, 2.5rem); }
h1 small { display: block; font-size: 0.5em; font-weight: 500; color: var(--muted); margin-top: 0.35em; }
h2 { font-size: clamp(1.25rem, 1vw + 1rem, 1.6rem); margin-top: 2.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px); }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; width: auto; height: auto; padding: 8px 12px; background: var(--accent); color: #000; z-index: 100; clip: auto; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; backdrop-filter: blur(10px); background: rgba(11, 16, 32, 0.82); border-bottom: 1px solid var(--line); }
.site-header-inner { display: flex; align-items: center; gap: 18px; min-height: 60px; }
@font-face { font-family: 'Lora'; font-style: normal; font-weight: 400 700; font-display: swap; src: url('../fonts/lora-latin.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Lora'; font-style: italic; font-weight: 400; font-display: swap; src: url('../fonts/lora-latin-italic.woff2') format('woff2'); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-mark { width: 34px; height: 34px; border-radius: 8px; display: block; }
.brand-name { font-family: 'Lora', Georgia, 'Times New Roman', serif; font-weight: 500; font-size: 1.35rem; letter-spacing: 0.005em; white-space: nowrap; color: #f3e9c6; }
.brand-name em { font-style: italic; color: var(--accent); }
.site-nav { margin-left: auto; }
.nav-list { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-list a { display: block; padding: 8px 12px; border-radius: var(--radius-sm); color: var(--text); font-weight: 500; white-space: nowrap; }
.nav-list a:hover, .nav-list .current a { background: var(--surface-2); text-decoration: none; }
.loc-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--accent); font: inherit; font-size: 0.9rem; white-space: nowrap; cursor: pointer; }
.loc-chip:hover { background: var(--surface-2); }

/* Location dialog */
.loc-modal { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--text); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
.loc-modal::backdrop { background: rgba(3, 6, 16, 0.7); backdrop-filter: blur(3px); }
.loc-modal-inner { padding: 20px 22px 22px; margin: 0; }
.loc-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.loc-modal-head h2 { margin: 0; font-size: 1.25rem; }
.loc-modal-close { background: transparent; border: 0; color: var(--muted); font-size: 1.6rem; line-height: 1; cursor: pointer; padding: 4px 8px; }
.loc-modal-close:hover { color: var(--text); }
.loc-modal .picker { margin: 12px 0 10px; }
.loc-modal-row { margin-bottom: 14px; }
.loc-modal-sub { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin: 0 0 8px; }
.chip-btn { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); color: var(--text); font: inherit; font-size: 0.92rem; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); color: var(--accent); }
.btn-small { min-height: 34px; padding: 6px 12px; font-size: 0.88rem; }
.link-btn { display: inline-block; margin-left: 6px; padding: 2px 9px; border: 1px solid var(--line); border-radius: 999px; background: transparent; color: var(--accent-2); font: inherit; font-size: 0.8rem; line-height: 1.4; cursor: pointer; vertical-align: baseline; }
.link-btn:hover { border-color: var(--accent-2); background: var(--surface-2); }

/* Page head */
.lunar-main { padding: 28px 0 60px; }
.crumbs { font-size: 0.9rem; color: var(--muted); margin-bottom: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { color: var(--muted); }
.page-head { margin-bottom: 20px; }
.subtitle { color: var(--muted); font-size: 1.1rem; font-weight: 500; margin: -0.3em 0 0.8em; }
.hero-phase { margin: 0 0 10px; }
.loc-modal-title { margin: 0; font-size: 1.25rem; font-weight: 700; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 70ch; }
.lede strong { color: var(--text); }

/* Controls */
.controls { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 14px; padding: 12px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 22px; }
.controls-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ctl-left, .ctl-center, .ctl-right { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ctl-center { justify-content: center; }
.ctl-right { justify-content: flex-end; margin-left: auto; }
.btn-icon { min-width: 42px; padding: 9px 0; justify-content: center; font-size: 1.3rem; line-height: 1; }
.date-input { padding: 9px 12px; min-height: 42px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; color-scheme: dark; }
.date-input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.cal-day[role="button"] { cursor: pointer; }
.cal-day.is-selected { border-color: var(--accent-2); box-shadow: 0 0 0 2px rgba(143, 180, 255, 0.35); }
.cal-day:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
.today-tag { display: inline-block; margin-left: 6px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #17130a; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; vertical-align: middle; }
.day-hint { margin: 10px 0 0; }
[hidden] { display: none !important; }
.picker { position: relative; flex: 1 1 260px; }
.picker input, .controls select, .controls input[type="number"] {
  width: 100%; padding: 10px 12px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line);
  border-radius: var(--radius-sm); font: inherit; min-height: 42px;
}
.controls select { width: auto; flex: 0 0 auto; }
.controls input[type="number"] { width: 6.5em; }
.picker input:focus, .controls select:focus, .controls input:focus { outline: 2px solid var(--accent-2); outline-offset: 1px; }
.picker-list { position: absolute; z-index: 40; top: calc(100% + 4px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius-sm); box-shadow: var(--shadow); max-height: 280px; overflow: auto; }
.picker-list li { padding: 9px 10px; border-radius: 6px; cursor: pointer; }
.picker-list li:hover, .picker-list li[aria-selected="true"] { background: var(--bg-2); color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 14px; min-height: 42px; border-radius: var(--radius-sm); border: 1px solid var(--accent); background: var(--accent); color: #17130a; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.btn:hover { filter: brightness(1.06); text-decoration: none; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--text); font-weight: 500; }
.btn-ghost:hover { background: var(--surface-2); }
.btn:disabled { opacity: 0.6; cursor: wait; }
.pager { justify-content: space-between; }

/* Hero: tonight's moon */
.hero { display: grid; grid-template-columns: auto 1fr; gap: 26px; align-items: center; padding: 24px; margin-bottom: 26px; background: linear-gradient(135deg, var(--surface) 0%, var(--bg-2) 100%); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.hero-moon { filter: drop-shadow(0 0 28px rgba(243, 233, 198, 0.28)); }
.hero-kicker { color: var(--muted); margin: 0 0 4px; font-size: 0.95rem; }
.day-detail .hero-kicker { color: var(--text); font-weight: 700; font-size: 1.05rem; }
.day-detail { position: relative; }
.hero-corner { position: absolute; top: 14px; right: 16px; display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text); font-size: 0.85rem; font-weight: 600; text-decoration: none; white-space: nowrap; }
.hero-corner:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.day-detail:has(.hero-corner) .hero-kicker { padding-right: 260px; }
@media (max-width: 760px) {
  .hero-corner { position: static; margin: 10px 0 0; }
  .day-detail:has(.hero-corner) .hero-kicker { padding-right: 0; }
  .day-detail:has(.hero-corner) { display: flex; flex-direction: column; }
  .day-detail .hero-corner { order: 10; align-self: flex-start; }
}
.hero-phase { font-size: clamp(1.6rem, 2vw + 1rem, 2.2rem); margin: 0 0 10px; color: var(--accent); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 10px 18px; margin: 0 0 12px; }
.facts div { border-left: 2px solid var(--line); padding-left: 10px; }
.facts dt { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; font-size: 1.15rem; font-weight: 600; }
.hero-next { margin: 0; color: var(--muted); }
.hero-next strong { color: var(--text); }

/* Moon SVG */
.moon-svg { display: block; }
.moon-svg .moon-dark { fill: var(--moon-dark); }
.moon-svg .moon-lit { fill: var(--moon-lit); }
.moon-svg .moon-rim { fill: none; stroke: var(--moon-rim); stroke-width: 1; }
/* Surface: craters are dark overlays with a light rim, so they show on the lit part and vanish into the dark part. */
.moon-svg .moon-crater { fill: #2c2b3a; opacity: 0.16; }
.moon-svg .moon-crater-rim { fill: none; stroke: #fff8e0; stroke-width: 0.9; opacity: 0.3; }
.moon-svg .moon-limb { fill: url(#moon-limb); }
.moon-svg[width="26"] .moon-crater-rim, .strip-day .moon-crater-rim { display: none; }

/* Calendar grid */
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-weekday { text-align: center; color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; padding: 4px 0 6px; }
.cal-blank { min-height: 0; }
.cal-day { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 8px; min-height: 150px; display: flex; flex-direction: column; gap: 6px; transition: border-color 0.15s, transform 0.15s; }
.cal-day:hover { border-color: var(--accent-2); }
.cal-day.has-event { background: var(--surface-2); border-color: rgba(242, 199, 107, 0.45); }
.cal-day.is-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.cal-day-head { display: flex; align-items: baseline; gap: 6px; }
.cal-num { font-weight: 700; font-size: 1.05rem; }
.cal-dow { display: none; color: var(--muted); font-size: 0.8rem; }
.cal-today-tag { margin-left: auto; font-size: 0.7rem; color: var(--accent); text-transform: uppercase; letter-spacing: 0.06em; }
.cal-moon { display: flex; justify-content: center; padding: 2px 0; }
.cal-phase { text-align: center; line-height: 1.25; }
.cal-phase-name { display: block; font-size: 0.82rem; font-weight: 600; }
.has-event .cal-phase-name { color: var(--accent); }
.cal-event-time, .cal-illum { display: block; font-size: 0.78rem; color: var(--muted); }
.cal-times { margin: auto 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: 0.74rem; }
.cal-times dt { color: var(--muted); }
.cal-times dd { margin: 0; font-weight: 600; }
.cal-note { margin-top: 12px; font-size: 0.9rem; }

/* Phase table */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.phase-table { width: 100%; border-collapse: collapse; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.phase-table th, .phase-table td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.phase-table th { color: var(--muted); font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; }
.phase-table tr:last-child td { border-bottom: 0; }
.phase-cell { display: flex; align-items: center; gap: 10px; font-weight: 600; }

/* Full moon pages */
.small { font-size: 0.88rem; }
.pill { display: inline-block; padding: 2px 8px; margin: 2px 4px 2px 0; border-radius: 999px; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }
.pill-super { color: var(--accent); border-color: rgba(242, 199, 107, 0.5); }
.pill-blue { color: var(--accent-2); border-color: rgba(143, 180, 255, 0.5); }
.fm-table .th-notes { min-width: 120px; }
.fm-table td.phase-cell { white-space: normal; }
a.plain { color: inherit; }
.countdown { font-size: 1.05rem; color: var(--accent-2); margin: -4px 0 12px; min-height: 1.4em; }
.hero-fm .hero-phase { font-size: clamp(1.3rem, 1.6vw + 0.9rem, 1.9rem); color: var(--text); }
.fm-rise { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin-top: 4px; }
.fm-rise-result { color: var(--muted); min-height: 1.4em; }
.fm-rise-result strong, .fm-rise-result b { color: var(--text); }
.inline-picker { position: relative; display: inline-block; min-width: 220px; vertical-align: middle; }
.inline-picker input { width: 100%; padding: 8px 10px; background: var(--bg-2); color: var(--text); border: 1px solid var(--line); border-radius: var(--radius-sm); font: inherit; }
.pager-inline { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.name-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.name-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.name-card h2 { margin: 10px 0 2px; font-size: 1.15rem; }
.name-card p { margin: 0 0 6px; }

/* Events */
.type-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-bottom: 10px; }
.type-card { display: block; padding: 20px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: border-color 0.15s, transform 0.15s; }
.type-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-2px); }
.type-card h2 { margin: 12px 0 6px; font-size: 1.15rem; }
.type-card p { margin: 0; color: var(--muted); font-size: 0.93rem; }
.ev-icon .ic-sun { fill: var(--accent); }
.ev-icon .ic-dark { fill: var(--bg); }
.ev-icon .ic-glow { fill: none; stroke: rgba(242, 199, 107, 0.35); stroke-width: 3; }
.ev-icon .ic-moon { fill: var(--moon-lit); }
.ev-icon .ic-umbra { fill: rgba(120, 40, 30, 0.85); }
.ev-icon .ic-streak { stroke: var(--moon-lit); stroke-width: 3; stroke-linecap: round; }
.ev-icon .ic-thin { stroke-width: 1.5; opacity: 0.7; }
.ev-icon .ic-spark { fill: var(--accent); }
.ev-icon .ic-crater { fill: rgba(0, 0, 0, 0.12); }
.ev-icon .ic-horizon { stroke: var(--line); stroke-width: 2; }
.ev-icon .ic-ground { fill: var(--bg-2); }
.ev-icon .ic-ray { stroke: var(--accent); stroke-width: 3; stroke-linecap: round; }
.ev-hero { filter: drop-shadow(0 0 24px rgba(243, 233, 198, 0.2)); }
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.event-row { display: grid; grid-template-columns: 52px 1fr; gap: 12px; padding: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.event-row-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.event-row-name { font-weight: 700; font-size: 1.05rem; color: var(--text); }
.event-row-when { margin: 4px 0; }
.event-row-summary { margin: 0; font-size: 0.92rem; }
.shower-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shower-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.shower-card h2 { margin: 8px 0 4px; font-size: 1.15rem; }
.shower-card p { margin: 0 0 4px; }
.shower-peak { font-weight: 600; }
.ev-icon .ic-planet { stroke: rgba(0, 0, 0, 0.15); stroke-width: 1; }
.ev-icon .ic-mars { fill: #d9744a; }
.ev-icon .ic-jupiter { fill: #e2c39a; }
.ev-icon .ic-saturn { fill: #e6d3a3; }
.ev-icon .ic-venus { fill: #f2e6c9; }
.ev-icon .ic-mercury { fill: #b8b2a8; }
.ev-icon .ic-uranus { fill: #a9dbe3; }
.ev-icon .ic-neptune { fill: #6f8fd6; }
.ev-icon .ic-ring { fill: none; stroke: rgba(230, 211, 163, 0.55); stroke-width: 5; }
.ev-icon .ic-ring-front { fill: none; stroke: rgba(230, 211, 163, 0.9); stroke-width: 5; }
.ev-icon .ic-band { stroke: rgba(150, 100, 60, 0.35); stroke-width: 4; }
.ev-icon .ic-spot { fill: rgba(190, 90, 60, 0.6); }
.planets-tonight h2 { margin-top: 0; }
.planet-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 12px; }
.planet-grid-single { grid-template-columns: 1fr; }
.planet-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 12px 14px; }
.planet-card.is-visible { border-color: rgba(242, 199, 107, 0.5); }
.planet-card.is-hidden { opacity: 0.7; }
.planet-card h3 { margin: 0 0 4px; font-size: 1rem; }
.planet-card p { margin: 0 0 2px; font-size: 0.92rem; }
.planet-explainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; max-width: none; }
.sky-check { margin-top: 6px; }
.sky-check strong { color: var(--text); }
.sky-list { margin: 8px 0 0; padding-left: 18px; font-size: 0.9rem; color: var(--muted); }

/* Gardening by the moon */
.garden-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.garden-day { min-height: 74px; padding: 8px; border-radius: var(--radius-sm); border: 1px solid var(--line); background: var(--surface); display: flex; flex-direction: column; gap: 2px; }
.garden-day.is-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.garden-num { font-weight: 700; }
.garden-q { font-size: 0.78rem; color: var(--muted); }
.garden-event { font-size: 0.72rem; color: var(--accent); }
.garden-day.q1, .swatch.q1 { background: rgba(120, 200, 120, 0.14); border-color: rgba(120, 200, 120, 0.4); }
.garden-day.q2, .swatch.q2 { background: rgba(242, 199, 107, 0.14); border-color: rgba(242, 199, 107, 0.45); }
.garden-day.q3, .swatch.q3 { background: rgba(217, 116, 74, 0.14); border-color: rgba(217, 116, 74, 0.45); }
.garden-day.q4, .swatch.q4 { background: rgba(143, 180, 255, 0.12); border-color: rgba(143, 180, 255, 0.4); }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 4px; border: 1px solid var(--line); vertical-align: -2px; margin-right: 4px; }
.garden-legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 4px; font-size: 0.9rem; }
.garden-ranges { list-style: none; padding: 0; margin: 0 0 12px; display: grid; gap: 8px; }
.wrap-cell { white-space: normal !important; min-width: 280px; }
.day-blurb { margin: 8px 0 0; color: var(--text); }
.phase-article h3 { margin-top: 1.4rem; }
@media (max-width: 680px) {
  .garden-grid { gap: 4px; }
  .garden-day { min-height: 0; padding: 5px; }
  .garden-q { display: none; }
  .garden-event { font-size: 0.75rem; }
}

/* Front page */
.home-head { margin-bottom: 14px; }
.home-moon { margin-bottom: 24px; }
.home-moon .day-hint { display: none; }
.strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.strip-day { display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 10px 4px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); font-size: 0.8rem; }
.strip-day:hover { border-color: var(--accent-2); text-decoration: none; }
.strip-day.is-today { border-color: var(--accent); }
.strip-dow { color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.7rem; }
.strip-num { font-weight: 700; }
.strip-label { color: var(--muted); font-size: 0.72rem; text-align: center; }
/* Two balanced columns: cards flow to fill height, so no holes under short cards. */
.home-grid { columns: 2; column-gap: 14px; margin-bottom: 8px; }
.home-card { display: flex; flex-direction: column; gap: 8px; break-inside: avoid; margin-bottom: 14px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; }
.home-card h2 { margin: 0 0 6px; font-size: 1.15rem; }
.home-card p { margin: 0; }
.planet-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.planet-lines li { display: grid; grid-template-columns: 78px 52px 1fr; gap: 8px; align-items: baseline; font-size: 0.92rem; padding: 4px 0; border-bottom: 1px solid var(--line); }
.planet-lines li:last-child { border-bottom: 0; }
.planet-lines .pl-name { font-weight: 600; }
.planet-lines .pl-mag { color: var(--muted); font-size: 0.82rem; }
.planet-lines .pl-status { color: var(--muted); }
.planet-lines li.is-visible .pl-status { color: var(--text); }
.planet-lines li.is-hidden { opacity: 0.55; }
.home-fm { display: flex; gap: 14px; align-items: flex-start; }
.home-fm-name { margin: 0; font-weight: 700; font-size: 1.15rem; color: var(--accent); }
.home-fm-when { margin: 2px 0 0; }
.home-fm .countdown { margin: 0 0 6px; font-size: 0.95rem; }
.home-events { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.home-events li { display: flex; gap: 10px; align-items: center; }
.home-events li div { display: flex; flex-direction: column; }
.planet-grid-compact { grid-template-columns: 1fr; gap: 6px; margin-top: 4px; }
.planet-grid-compact .planet-card { padding: 8px 10px; }
.planet-grid-compact .planet-card p:not(:first-of-type) { display: none; }
.planet-grid-compact .planet-card.is-hidden { display: none; }
.explore-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.explore-grid h3 { margin: 0 0 6px; font-size: 1.05rem; }
.home .post-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) {
  .explore-grid, .home .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 680px) {
  .home-grid { columns: 1; }
  .explore-grid, .home .post-grid { grid-template-columns: 1fr; }
  .strip { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 3px; }
  .strip-day { padding: 6px 2px; }
  .strip-day .moon-svg { width: 26px; height: 26px; }
  .strip-label { display: none; }
}

/* Popular cities */
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.chip-list a { display: inline-block; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--text); background: var(--surface); font-size: 0.92rem; }
.chip-list a:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }

/* Editorial */
.editorial { max-width: 78ch; }
.phase-explainer { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; max-width: none; }
.phase-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.phase-card h3 { margin: 10px 0 6px; }
.phase-card p { margin: 0; color: var(--muted); font-size: 0.93rem; }

/* Year view */
.year-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.mini-month { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.mini-month h2 { margin: 0 0 8px; font-size: 1.05rem; }
.mini-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.mini-day { display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 3px 0; border-radius: 4px; font-size: 0.7rem; color: var(--muted); }
.mini-day.has-event { background: var(--surface-2); color: var(--accent); }
.mini-day b { font-weight: 500; }

/* Blog */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: border-color 0.15s, transform 0.15s; }
.post-card:hover { border-color: var(--accent-2); transform: translateY(-2px); }
.post-card-media { display: block; aspect-ratio: 16 / 9; background: var(--bg-2); overflow: hidden; }
.post-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card-placeholder { display: flex; align-items: center; justify-content: center; height: 100%; }
.post-card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.post-card-cat { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--accent); }
.post-card-title { margin: 0; font-size: 1.1rem; }
.post-card-title a { color: var(--text); }
.post-card-excerpt { margin: 0; color: var(--muted); font-size: 0.93rem; }
.post-card-meta { margin: auto 0 0; }
.post-single { max-width: 78ch; }
.post-meta { margin: -0.4em 0 1em; }
.post-hero { margin: 0 0 22px; border-radius: var(--radius); overflow: hidden; }
.post-hero img { width: 100%; height: auto; display: block; }
.post-content { font-size: 1.05rem; line-height: 1.7; }
.post-content h2 { margin-top: 2rem; }
.post-content h3 { margin-top: 1.4rem; }
.post-content img { border-radius: var(--radius-sm); }
.post-content blockquote { margin: 1.2em 0; padding: 0.4em 1em; border-left: 3px solid var(--accent); color: var(--muted); }
.post-content a { text-decoration: underline; }
.post-sources { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.post-sources h2 { font-size: 1.1rem; }
.post-sources ul { padding-left: 1.2em; color: var(--muted); font-size: 0.93rem; }
.post-tags { color: var(--muted); font-size: 0.9rem; }
.pagination { margin-top: 24px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; }
.pagination .page-numbers { padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--text); }
.pagination .page-numbers.current { background: var(--accent); color: #17130a; border-color: var(--accent); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; padding: 24px 0; color: var(--muted); font-size: 0.9rem; }
.site-footer-inner { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 14px; }
.site-footer a { color: var(--muted); }

/* Responsive */
@media (max-width: 900px) {
  .cal-day { min-height: 132px; padding: 6px; }
  .cal-times { font-size: 0.7rem; }
}
@media (max-width: 680px) {
  .site-header-inner { flex-wrap: wrap; gap: 8px 12px; padding-top: 8px; padding-bottom: 8px; }
  .site-nav { margin-left: 0; width: 100%; overflow-x: auto; scrollbar-width: none; }
  .site-nav::-webkit-scrollbar { display: none; }
  .nav-list a { padding: 6px 10px; }
  .loc-chip { order: 2; margin-left: auto; font-size: 0.85rem; padding: 5px 10px; }
  .site-nav { order: 3; }
  .hero { grid-template-columns: 1fr; text-align: center; }
  .hero-moon { margin: 0 auto; }
  .facts div { border-left: 0; padding-left: 0; }
  .fm-rise { grid-template-columns: 1fr; text-align: left; }
  .cal-grid { grid-template-columns: 1fr; gap: 8px; }
  .cal-weekday, .cal-blank { display: none; }
  .cal-day { min-height: 0; display: grid; grid-template-columns: 64px 56px 1fr auto; grid-template-areas: "head moon phase times"; align-items: center; gap: 10px; }
  .cal-day-head { grid-area: head; flex-direction: column; gap: 0; align-items: flex-start; }
  .cal-dow { display: block; }
  .cal-today-tag { margin-left: 0; }
  .cal-moon { grid-area: moon; }
  .cal-phase { grid-area: phase; text-align: left; }
  .cal-times { grid-area: times; margin: 0; grid-template-columns: 1fr; text-align: right; }
  .pager { justify-content: center; }
  .ctl-left, .ctl-center, .ctl-right { width: 100%; justify-content: center; margin-left: 0; }
  .ctl-center { flex-wrap: nowrap; }
  .ctl-center select { flex: 1 1 auto; min-width: 0; }
  .ctl-center input[type="number"] { width: 5.2em; }
  .ctl-center [data-lunar-go] { display: none; }
}

/* 404 */
.not-found .nf-head { text-align: center; padding: 28px 0 8px; }
.nf-moon { margin: 0 auto 8px; width: 96px; height: 96px; filter: drop-shadow(0 10px 30px rgba(243, 233, 198, 0.15)); }
.not-found .subtitle { margin-left: auto; margin-right: auto; max-width: 56ch; }
.nf-search { justify-content: center; margin-top: 18px; }
.nf-search .date-input { min-width: min(360px, 70vw); }
.nf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 28px 0 40px; }
.nf-card { display: flex; flex-direction: column; gap: 6px; padding: 16px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); color: var(--text); text-decoration: none; transition: border-color 0.15s, transform 0.15s; }
.nf-card:hover { border-color: var(--accent); transform: translateY(-2px); text-decoration: none; }
.nf-card strong { font-size: 1.05rem; }
.nf-card span { color: var(--muted); font-size: 0.92rem; }
@media (max-width: 900px) { .nf-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .nf-grid { grid-template-columns: 1fr; } }

.footer-legal { margin-top: 8px; font-size: 0.85rem; }
.footer-legal a { color: var(--muted); margin-right: 14px; }

/* Contact Form 7 */
.wpcf7 form { display: grid; gap: 14px; max-width: 680px; margin: 18px 0 8px; }
.wpcf7 label { display: block; font-weight: 600; font-size: 0.95rem; }
.wpcf7 input[type="text"], .wpcf7 input[type="email"], .wpcf7 select, .wpcf7 textarea { width: 100%; margin-top: 6px; padding: 10px 12px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; }
.wpcf7 textarea { min-height: 160px; resize: vertical; }
.wpcf7 input:focus, .wpcf7 select:focus, .wpcf7 textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wpcf7 .wpcf7-acceptance label { font-weight: 400; color: var(--muted); font-size: 0.9rem; }
.wpcf7 .wpcf7-acceptance input { margin-right: 6px; }
.wpcf7 .wpcf7-submit { padding: 11px 18px; border-radius: 8px; border: 1px solid var(--accent); background: var(--accent); color: #17130a; font: inherit; font-weight: 600; cursor: pointer; width: max-content; }
.wpcf7 .wpcf7-submit:disabled { opacity: 0.6; }
.wpcf7 .wpcf7-not-valid-tip { color: #e57373; font-size: 0.85rem; font-weight: 400; }
.wpcf7 .wpcf7-response-output { margin: 0; padding: 10px 14px; border-radius: 8px; border: 1px solid var(--line); }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--accent); }
.wpcf7 form.invalid .wpcf7-response-output, .wpcf7 form.failed .wpcf7-response-output { border-color: #e57373; }
.wpcf7-spinner { display: none; }
