/* Ditt Tarot: the reading table. Blue engraved cards laid on oxblood baize; pages around
   the table are pale mauve paper printed in prussian ink, like the cards' own linework. */
:root {
  --paper: #f3eef2;       /* page ground, a cool mauve-white */
  --paper-2: #e8e0e6;     /* panels and wells on paper */
  --ink: #1b2a4a;         /* prussian ink, the colour of the card engravings */
  --ink-soft: #4a5672;    /* secondary text on paper (AA on --paper) */
  --rule: rgba(27, 42, 74, 0.18);
  --table: #3b0f1c;       /* oxblood baize: the reading surface */
  --table-2: #4d1727;     /* raised areas on the table */
  --on-table: #f3e6e2;    /* text on the table */
  --on-table-soft: #cdb3b6;
  --table-rule: rgba(243, 230, 226, 0.2);
  --brass: #d2a85a;       /* interactive accent on the table */
  --brass-ink: #7d5a1c;   /* the same brass, dark enough for text on paper */

  --display: 'IM Fell English', 'Iowan Old Style', Georgia, serif;
  --body: 'Public Sans', system-ui, sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3rem;
  --step-2: 1.75rem;
  --step-3: clamp(2.1rem, 4.6vw, 3.4rem);
  --step-4: clamp(2.6rem, 7vw, 5.2rem);

  --gutter: clamp(16px, 3vw, 32px);
  --measure: 68ch;
  --card-ratio: 2 / 3;
  --card-radius: 10px;
  --rail: 300px;
}

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

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

body {
  margin: 0;
  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-thickness: 1px; text-underline-offset: 0.2em; text-decoration-color: var(--rule); }
a:hover { text-decoration-color: currentColor; }

:focus-visible { outline: 2px solid var(--brass-ink); outline-offset: 3px; border-radius: 2px; }
.table :focus-visible { outline-color: var(--brass); }

h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.08; margin: 0 0 0.4em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-2); }
h3 { font-size: var(--step-1); }
p { margin: 0 0 1em; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.prose { max-width: var(--measure); }
.prose p, .prose li { font-size: 1.0625rem; }
.lede { font-size: var(--step-1); line-height: 1.45; color: var(--ink-soft); max-width: 46ch; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: var(--gutter); top: 8px; z-index: 10; background: var(--paper); padding: 8px 12px; }

/* ---------- Header and footer ---------- */
.site-header { background: var(--table); color: var(--on-table); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; min-height: 60px; flex-wrap: wrap; }
.wordmark { font-family: var(--display); font-size: 1.6rem; text-decoration: none; display: flex; align-items: center; gap: 10px; }
.wordmark img { width: 18px; border-radius: 2px; }
.site-nav { display: flex; gap: 4px 18px; flex-wrap: wrap; align-items: center; font-size: var(--step--1); }
.site-nav a { text-decoration: none; padding: 6px 0; border-bottom: 1px solid transparent; }
.site-nav a:hover, .site-nav a[aria-current] { border-bottom-color: var(--brass); }
.site-nav .lang { color: var(--on-table-soft); }
/* Narrow screens: the menu wraps under the wordmark, so the language switch moves up beside it. */
@media (max-width: 720px) {
  .site-header .wrap { position: relative; padding-bottom: 6px; }
  .site-nav { gap: 2px 16px; }
  .site-nav .lang { position: absolute; top: 9px; right: var(--gutter); }
}

.site-footer { margin-top: 80px; padding: 40px 0 56px; border-top: 1px solid var(--rule); font-size: var(--step--1); color: var(--ink-soft); }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 28px; justify-content: space-between; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.site-footer .disclaimer { flex-basis: 100%; max-width: 70ch; }

/* ---------- The table: the oxblood surface every reading happens on ---------- */
.table {
  background:
    radial-gradient(ellipse 70% 80% at 50% 30%, var(--table-2), transparent 75%),
    var(--table);
  color: var(--on-table);
}
.table a { text-decoration-color: var(--table-rule); }
.table .lede { color: var(--on-table-soft); }

/* ---------- Buttons ---------- */
.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px;
  font: 600 var(--step--1) / 1 var(--body); letter-spacing: 0.01em;
  background: var(--ink); color: var(--paper); border: 1px solid var(--ink);
  text-decoration: none; cursor: pointer;
}
.button:hover { background: #26375d; }
.button.ghost { background: transparent; color: inherit; border-color: currentColor; }
.table .button { background: var(--brass); color: var(--table); border-color: var(--brass); }
.table .button:hover { background: #e0b96d; }
.table .button.ghost { background: transparent; color: var(--on-table); border-color: var(--table-rule); }
.button[disabled], .button[aria-disabled='true'] { opacity: 0.5; cursor: default; }

/* ---------- Card: one tarot card, back or face ---------- */
.tcard {
  display: block; aspect-ratio: var(--card-ratio); border-radius: var(--card-radius);
  overflow: hidden; background: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset, 0 10px 24px -12px rgba(20, 4, 10, 0.7);
}
.tcard img { width: 100%; height: 100%; object-fit: cover; }
.tcard.is-reversed img { transform: rotate(180deg); }

/* ---------- Layout with an ad rail on wide screens ---------- */
.layout { display: grid; gap: 48px; grid-template-columns: minmax(0, 1fr); padding-top: 40px; }
@media (min-width: 1100px) { .layout.has-rail { grid-template-columns: minmax(0, 1fr) var(--rail); } }
.rail { display: none; }
@media (min-width: 1100px) { .rail { display: flex; flex-direction: column; gap: 24px; } .rail .ad { position: sticky; top: 24px; } }
.ad { min-height: 120px; }
.ads-preview ins.adsbygoogle { display: grid !important; place-items: center; min-height: 250px; background: var(--paper-2); color: var(--ink-soft); font-size: var(--step--1); }
.ads-preview ins.adsbygoogle::after { content: attr(data-label); }

.breadcrumb { font-size: var(--step--1); color: var(--ink-soft); margin-bottom: 18px; }
.breadcrumb ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.breadcrumb li + li::before { content: '/'; margin-right: 6px; opacity: 0.5; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
