/* tarot.jodavaho.io
 *
 * A reading page, not an app: one column of serif prose, the card image as the
 * figure, and the 1909 palette (cream stock, black line, Smith's yellow) kept quiet
 * so the card carries the colour. System fonts only.
 */

:root {
  --paper: #f7f2e7;
  --panel: #fffdf7;
  --ink: #1d1a16;
  --mute: #6b6358;
  --rule: #ddd3bf;
  --accent: #b5482a;
  --gold: #e0b43a;

  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial,
    sans-serif;
  --measure: 40rem;
}

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

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1.0625rem/1.65 var(--serif);
}

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

.masthead {
  border-bottom: 1px solid var(--rule);
  padding: 0.75rem clamp(1rem, 4vw, 2rem);
  font: 600 0.95rem var(--sans);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.5rem clamp(1rem, 4vw, 2rem) 3rem;
}

h1 {
  font-weight: 600;
  font-size: clamp(1.7rem, 5vw, 2.4rem);
  line-height: 1.15;
  margin: 0.5rem 0 1rem;
}

h2 {
  font: 600 0.85rem var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  border-top: 1px solid var(--rule);
  padding-top: 1.25rem;
  margin: 2rem 0 0.5rem;
}

/* Card page */

.jump {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.jump a {
  font: 600 0.9rem var(--sans);
  text-decoration: none;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.35rem 0.9rem;
}

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

figure {
  margin: 0;
  text-align: center;
}

figure img {
  width: min(100%, 22rem);
  height: auto;
  border-radius: 0.6rem;
  box-shadow: 0 0.4rem 1.4rem rgb(29 26 22 / 0.18);
}

figcaption {
  font: 0.8rem/1.45 var(--sans);
  color: var(--mute);
  margin-top: 0.75rem;
}

section {
  scroll-margin-top: 1rem;
}

.ref {
  font: 600 0.7em var(--sans);
  line-height: 0;
}

.ref a {
  text-decoration: none;
  padding: 0 0.1em;
}

.notes ol {
  font: 0.85rem/1.5 var(--sans);
  color: var(--mute);
  padding-left: 1.4rem;
}

.notes li {
  margin-bottom: 0.4rem;
  overflow-wrap: anywhere;
}

.notes li:target {
  color: var(--ink);
  background: rgb(224 180 58 / 0.18);
}

.deck {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 2.5rem;
  border-top: 1px solid var(--rule);
  padding-top: 1rem;
  font: 0.9rem var(--sans);
}

.deck a {
  text-decoration: none;
}

/* Index */

.pick {
  display: grid;
  gap: 0.75rem;
  margin-bottom: 1.25rem;
  font: 0.95rem var(--sans);
}

.pick label,
.pick fieldset {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  border: 0;
  margin: 0;
  padding: 0;
}

.pick legend {
  float: left;
  margin-right: 0.5rem;
}

select,
input[type="search"] {
  font: 1rem var(--sans);
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: 0.4rem;
  padding: 0.45rem 0.6rem;
}

.search label {
  display: block;
  font: 600 0.85rem var(--sans);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--mute);
  margin-bottom: 0.35rem;
}

.search input {
  width: 100%;
  font-size: 1.1rem;
}

select:focus-visible,
input:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 1px;
}

.results {
  list-style: none;
  margin: 1.25rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(7.5rem, 1fr));
  gap: 1rem 0.75rem;
}

.results a {
  display: block;
  text-decoration: none;
  color: var(--ink);
  font: 0.85rem/1.3 var(--sans);
  text-align: center;
}

.results img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.35rem;
  margin-bottom: 0.35rem;
  box-shadow: 0 0.15rem 0.5rem rgb(29 26 22 / 0.15);
}

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

.tip {
  font: 0.9rem/1.5 var(--sans);
  color: var(--mute);
  margin: 0.5rem 0 0;
}

.colophon {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem) 2rem;
  font: 0.8rem/1.5 var(--sans);
  color: var(--mute);
}
