/* Ditt Horoskop v2: a cyanotype star atlas. */
:root {
  --paper: #0e1f36;      /* night blue: the cyanotype plates, one exposure darker */
  --deep: #15294a;       /* cards, header and footer */
  --line: #f1ece2;       /* warm off-white, like lamplit paper */
  --muted: #b9c1cf;      /* secondary text */
  --rule: rgba(241, 236, 226, 0.16);
  --glow: rgba(240, 179, 90, 0.09);  /* faint amber lamplight */
  --plate: brightness(0.82) saturate(0.9);  /* sits the bright blue plates into the dark page */
  --sun: #f0b35a;        /* reserved for the sun's current sign */

  --display: 'Fraunces', 'Iowan Old Style', Georgia, serif;
  --body: 'Figtree', system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.375rem;
  --step-2: 1.875rem;
  --step-3: clamp(2rem, 4vw, 3.1rem);

  --gutter: clamp(16px, 3vw, 32px);
  --rail: 336px;
}

*, *::before, *::after { box-sizing: border-box; }

html { background: var(--paper); }

body {
  margin: 0;
  background: radial-gradient(ellipse 90% 60% at 50% -10%, var(--glow), transparent 70%) no-repeat, var(--paper);
  color: var(--line);
  font-family: var(--body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }

a { color: inherit; text-decoration-color: var(--rule); text-underline-offset: 0.2em; }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--sun); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 {
  font-family: var(--display); font-weight: 600; line-height: 1.1; margin: 0 0 0.45em;
  /* Fraunces' soft, wonky cut: the playful side of an old-style serif. */
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
}
.wordmark, .button, .slot-label, .quote blockquote, .drop p:first-of-type::first-letter { font-variation-settings: 'SOFT' 100, 'WONK' 1; }
h1 { font-size: var(--step-3); letter-spacing: -0.01em; }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }

p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1360px; margin: 0 auto; padding: 0 var(--gutter); }

.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

.status { color: var(--muted); font-style: italic; }

/* ---------- Header ---------- */
.site-header { border-bottom: 1px solid var(--rule); background: var(--deep); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.wordmark { font-family: var(--display); font-size: 1.5rem; text-decoration: none; white-space: nowrap; }
.site-nav { display: flex; align-items: center; gap: 20px; font-size: var(--step--1); }
/* Nav: Fraunces italic, with a dotted constellation line under the active or hovered link. */
.site-nav a {
  display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  font-family: var(--display); font-style: italic; font-size: 1.05rem; color: var(--line);
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  text-decoration: underline dotted transparent; text-decoration-thickness: 2px; text-underline-offset: 6px;
  transition: text-decoration-color 0.15s;
}
.site-nav a:hover, .site-nav a[aria-current] { text-decoration-color: var(--sun); }
.nav-icon { flex: 0 0 auto; }
.nav-card { border-radius: 2px; transform: rotate(-8deg); transition: transform 0.2s; }
.site-nav a:hover .nav-card { transform: rotate(4deg); }
.nav-sun { border-radius: 50%; border: 1px solid var(--sun); }
.lang button {
  font-family: var(--display); font-style: italic; font-size: 1rem; color: var(--line); cursor: pointer;
  font-variation-settings: 'SOFT' 100, 'WONK' 1;
  background: none; border: 1px solid var(--line); border-radius: 2px; padding: 3px 12px;
  box-shadow: inset 0 0 0 2px var(--deep), inset 0 0 0 3px var(--rule);
}
.lang button:hover { background-color: rgba(241, 236, 226, 0.08); }
@media (max-width: 520px) {
  .wordmark { font-size: 1.25rem; }
  .site-nav { gap: 14px; }
}
@media (max-width: 400px) {
  /* The wordmark already links home. */
  .site-nav a[href='index.html'] { display: none; }
  .site-nav a { font-size: 0.95rem; }
}

/* ---------- Page frame: main column + ad rail ---------- */
.layout {
  max-width: 1360px; margin: 0 auto; padding: 24px var(--gutter) 48px;
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: start;
}
.rail { display: none; }
@media (min-width: 960px) {
  .layout { grid-template-columns: minmax(0, 1fr) var(--rail); }
  .rail { display: block; position: sticky; top: 16px; }
  .ad-mobile { display: none; }
}
.rail .ad { margin: 0 0 20px; }

.ad { margin: 24px 0; }
/* Local preview of where ads land (see AD_PREVIEW in core.js). */
.ads-preview .ad ins {
  min-height: 250px; border: 1px dashed var(--rule); border-radius: 4px; text-decoration: none;
  display: grid !important; place-items: center; color: var(--muted); font-size: var(--step--1);
}
.ads-preview .ad ins::after { content: attr(data-label); }
/* AdSense keeps the slot's height when it has nothing to show. */
.ad ins[data-ad-status='unfilled'] { display: none !important; }

.block { padding: 28px 0; border-top: 1px solid var(--rule); }
.block:first-child { border-top: none; padding-top: 0; }
.block > h2 { margin-bottom: 0.5em; }

.reading { max-width: 80ch; }
/* A block's divider spans the column; only its text keeps the reading measure. */
.block.reading { max-width: none; }
.block.reading > * { max-width: 80ch; }
.drop p:first-of-type:not(.status)::first-letter {
  font-family: var(--display); float: left;
  font-size: 3.4em; line-height: 0.82; padding: 0.06em 0.1em 0 0;
}
.reading-body h3 { margin-top: 1.2em; }
.daily-video { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; margin: 0 0 24px; border: 1px solid var(--rule); border-radius: 12px; background: var(--deep); }
.daily-video[hidden] { display: none; }

.duo { display: grid; gap: 32px; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 720px) { .duo { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* ---------- Home: today's sky ---------- */
.sky {
  background: var(--deep) url('../img/sky.webp') center / cover no-repeat;
  border: 1px solid var(--rule); border-radius: 6px;
  padding: 22px 24px; margin-bottom: 20px; position: relative; overflow: hidden;
}
.sky::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(14, 31, 54, 0.85), rgba(14, 31, 54, 0.45)); }
.sky > * { position: relative; }
.sky p { color: var(--muted); margin: 0; }
.sky h1 { margin: 0.1em 0 0; }

/* ---------- Sign grid ---------- */
.signs {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 190px), 1fr));
}
@media (max-width: 480px) { .signs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.sign-card {
  display: flex; flex-direction: column; height: 100%; text-decoration: none;
  background: var(--deep); border: 1px solid var(--rule); border-radius: 6px; overflow: hidden;
}
.sign-card:hover { border-color: var(--line); }
.sign-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; filter: var(--plate); transition: filter 0.2s; }
.sign-card:hover img { filter: none; }
.sign-card .body { padding: 10px 12px 14px; }
.sign-card h3 { margin: 0; font-size: 1.3rem; }
.sign-card .dates { color: var(--muted); font-size: 0.8rem; margin: 0 0 6px; }
.sign-card .excerpt {
  font-size: 0.9rem; line-height: 1.45; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.sign-card.is-sun { border-color: var(--sun); }
.sun-mark { display: block; color: var(--sun); font-size: 0.8rem; }
@media (max-width: 480px) { .sign-card .excerpt { display: none; } }

/* ---------- Sign page ---------- */
.sign-head { display: flex; align-items: center; gap: 20px; margin-bottom: 8px; }
.sign-head img { width: clamp(96px, 18vw, 150px); aspect-ratio: 1; object-fit: cover; border-radius: 6px; border: 1px solid var(--rule); filter: var(--plate); }
.sign-head h1 { margin: 0 0 4px; }
.sign-head p { color: var(--muted); margin: 0; }

.other-signs { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
.other-signs a { display: block; text-align: center; text-decoration: none; font-size: var(--step--1); }
.other-signs img { aspect-ratio: 1; object-fit: cover; border-radius: 50%; border: 1px solid var(--rule); margin-bottom: 4px; filter: var(--plate); }
.other-signs a:hover img, .other-signs a[aria-current] img { filter: none; }
.other-signs a:hover img { border-color: var(--line); }
.other-signs a[aria-current] img { border: 2px solid var(--line); }

/* ---------- Tarot teaser + forms ---------- */
.teaser { display: flex; gap: 20px; align-items: center; }
.teaser img { filter: var(--plate); width: 96px; border-radius: 8px; border: 1px solid var(--rule); transform: rotate(-4deg); flex: 0 0 auto; }

/* Buttons are drawn like an engraved cartouche: a hairline frame with an inner rule. */
.button {
  display: inline-block; cursor: pointer; text-decoration: none;
  font-family: var(--display); font-size: 1.15rem; line-height: 1.2; color: var(--line);
  background: transparent; border: 1px solid var(--line); border-radius: 2px;
  box-shadow: inset 0 0 0 3px var(--paper), inset 0 0 0 4px var(--rule);
  padding: 10px 22px;
  transition: background-color 0.15s;
}
.button:hover { background-color: rgba(241, 236, 226, 0.08); }
.button:active { background-color: rgba(241, 236, 226, 0.15); }
.button:disabled { opacity: 0.6; cursor: default; }
.button.ghost { border-color: var(--rule); box-shadow: none; }
.button.ghost:hover { border-color: var(--line); }

.newsletter form { display: flex; flex-wrap: wrap; gap: 10px; }
.newsletter input, .question input {
  flex: 1 1 220px; font: inherit; color: var(--line); background: var(--deep);
  border: 1px solid var(--rule); border-radius: 2px; padding: 10px 14px;
}
.newsletter input:focus, .question input:focus { border-color: var(--line); }
.newsletter input::placeholder, .question input::placeholder { color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { background: var(--deep); border-top: 1px solid var(--rule); padding: 28px 0; font-size: var(--step--1); color: var(--muted); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }

/* ---------- Tarot ---------- */
.question { display: grid; gap: 8px; max-width: 560px; margin: 16px 0 28px; }
.question label { color: var(--muted); font-size: var(--step--1); }

.spread { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 3vw, 32px); max-width: 760px; }
@media (max-width: 560px) { .spread { gap: 8px; } .card-caption p { display: none; } }
.slot-label { font-family: var(--display); font-size: var(--step-1); margin-bottom: 8px; text-align: center; }

.card { display: block; width: 100%; padding: 0; border: none; background: none; cursor: pointer; perspective: 1400px; color: inherit; font: inherit; }
.card[aria-disabled='true'] { cursor: default; }
.card-inner { display: block; position: relative; aspect-ratio: 2 / 3; transform-style: preserve-3d; transition: transform 0.8s cubic-bezier(0.3, 0.7, 0.2, 1); }
.card.is-turned .card-inner { transform: rotateY(180deg); }
.card-face {
  position: absolute; inset: 0; backface-visibility: hidden; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--rule); background: var(--deep);
}
.card-face img { width: 100%; height: 100%; object-fit: cover; filter: brightness(0.9); }
.card-front { transform: rotateY(180deg); }
.card:not([aria-disabled='true']):hover .card-back { border-color: var(--line); }
@media (prefers-reduced-motion: reduce) { .card-inner { transition: none; } }

.card-caption { text-align: center; margin-top: 10px; }
.card-caption h3 { font-size: 1.15rem; margin: 0 0 4px; }
.card-caption p { color: var(--muted); font-size: var(--step--1); margin: 0; }

.tarot-reading { max-width: 80ch; margin-top: 36px; }
.tarot-reading h3 { margin: 1.1em 0 0.3em; }

/* ---------- Content pages (guide, science, astrologer) ---------- */
.lede { color: var(--muted); font-size: var(--step-1); line-height: 1.4; margin-bottom: 1.6em; }
.prose h2:not(:first-child), .prose h3 { margin-top: 1.4em; }
.prose h3 { margin-bottom: 0.4em; }
.prose ul { padding-left: 1.2em; margin: 0 0 1em; }
.prose li { margin-bottom: 0.3em; }
.prose li::marker { color: var(--muted); }

.toc { margin-top: 2em; padding-top: 1.2em; border-top: 1px solid var(--rule); }
.toc h3 { margin-top: 0; }
.toc ul { list-style: none; padding: 0; columns: 2 16rem; column-gap: 32px; }
.toc li { break-inside: avoid; }
.toc span { color: var(--muted); font-size: var(--step--1); white-space: nowrap; }

.entry-head { display: flex; align-items: center; gap: 20px; margin-bottom: 0.6em; }
.entry-head img { flex: 0 0 auto; width: 112px; border-radius: 50%; border: 1px solid var(--rule); }
.entry-head h2 { margin: 0 0 0.15em; }
.entry-head p { color: var(--muted); margin: 0; }
.entry-head-portrait { margin: 0.8em 0 0.4em; }
.entry-head-portrait img { filter: grayscale(1) contrast(1.05); }

.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 20px; margin: 0 0 1em; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.facts-stacked { grid-template-columns: 1fr; gap: 0; }
.facts-stacked dt { color: var(--line); font-weight: 600; }
.facts-stacked dd { margin-bottom: 0.8em; }
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 0; }
  .facts dd { margin-bottom: 0.5em; }
}

.quote { margin: 0 0 2em; }
.quote blockquote { margin: 0; font-family: var(--display); font-size: var(--step-1); line-height: 1.35; }
.quote blockquote p { margin: 0 0 0.4em; }
.quote figcaption { color: var(--muted); font-size: var(--step--1); }
