/* ==========================================================
   Rainbell: soft, readable, a little bit gothic garden
   Made for dyslexia-friendly reading and colour sensitivity:
   - no pure white or pure black, no neon
   - left-aligned text, roomy spacing, short lines
   - no italics, no all-caps, no justified text
   - nothing relies on colour alone (labels and icons too)
   - follows the visitor's light/dark setting
   ========================================================== */

:root {
  color-scheme: light dark;

  /* Light mode: pressed flowers on old paper */
  --paper: #fbf4ec;
  --surface: #fff9f3;
  --blush: #f8dcdc;
  --butter: #fff0c9;
  --sage: #dbe7d2;
  --sky: #d7e6f3;
  --lilac: #e6dcef;
  --ink: #3b2a35;
  --ink-soft: #5f4a56;
  --rose: #9a3550;
  --line: #d3adb4;
  --focus: #2f5f8a;

  --radius: 14px;
  --font: "Atkinson Hyperlegible", "Lexend", Verdana, "Trebuchet MS", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    /* Dark mode: plum velvet, soft rose */
    --paper: #2b2130;
    --surface: #372b3f;
    --blush: #4d3544;
    --butter: #4a4332;
    --sage: #34443a;
    --sky: #31435a;
    --lilac: #41365b;
    --ink: #f0e4e6;
    --ink-soft: #cdbcc4;
    --rose: #f0a6b8;
    --line: #6a5274;
    --focus: #9cc7ee;
  }
}

/* People who ask their device for more contrast get it */
@media (prefers-contrast: more) {
  :root { --line: var(--ink-soft); --ink-soft: var(--ink); }
}

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

html { font-size: 100%; }

body {
  margin: 0;
  padding: 0 1rem 3rem;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.8;
  letter-spacing: 0.02em;
  word-spacing: 0.08em;
  text-align: left;
  hyphens: manual;
}

.wrap { max-width: 60rem; margin: 0 auto; }

/* ---------- Headings ---------- */

h1, h2, h3 {
  line-height: 1.35;
  font-weight: 700;
  color: var(--rose);
  text-wrap: balance;
  margin: 2rem 0 0.75rem;
}
h1 { font-size: 2.1rem; margin-top: 1.5rem; }
h2 { font-size: 1.55rem; }
h3 { font-size: 1.25rem; color: var(--ink); }

/* Little pressed-flower mark. Hidden from screen readers. */
h2::before {
  content: "✿ ";
  content: "✿ " / "";
  color: var(--rose);
}

/* ---------- Text ---------- */

p, ul, ol, dl { max-width: 65ch; margin: 0 0 1.25em; }
li { margin-bottom: 0.4em; }

/* Emphasis without italics: a soft highlighter stripe */
em, i, cite {
  font-style: normal;
  font-weight: 600;
  background: linear-gradient(transparent 55%, var(--butter) 55%);
}
strong, b { font-weight: 700; }

a {
  color: var(--rose);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 0.2em;
}
a:hover { background: var(--blush); }

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

::selection { background: var(--blush); color: var(--ink); }

hr {
  border: 0;
  border-top: 2px dashed var(--line);
  margin: 2.5rem 0;
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--lilac);
  border-left: 6px solid var(--rose);
  border-radius: 0 var(--radius) var(--radius) 0;
  max-width: 65ch;
}
blockquote p:last-child { margin-bottom: 0; }

code {
  font-family: Consolas, "Courier New", monospace;
  background: var(--sky);
  padding: 0.1em 0.4em;
  border-radius: 6px;
}

img { max-width: 100%; height: auto; border-radius: var(--radius); }

.banner {
  display: block;
  width: 100%;
  height: 12rem;
  object-fit: cover;
  border: 2px solid var(--line);
}

/* ---------- Header and navigation ---------- */

.site-title { margin-bottom: 0.25rem; }
.tagline { color: var(--ink-soft); margin-bottom: 1.25rem; }

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0 0 2rem;
  padding: 0;
  list-style: none;
  max-width: none;
}
.nav li { margin: 0; }
.nav a {
  display: block;
  min-width: 6.5rem;
  padding: 0.45rem 1.1rem;
  text-align: center;
  color: var(--ink);
  background: var(--blush);
  border-radius: 10px;
  text-decoration: none;
}
.nav li:nth-child(4n+2) a { background: var(--butter); }
.nav li:nth-child(4n+3) a { background: var(--sage); }
.nav li:nth-child(4n+4) a { background: var(--sky); }
.nav a:hover { outline: 2px solid var(--rose); }
/* Current page: underline and border, not just colour */
.nav a[aria-current="page"] {
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  border: 2px solid var(--ink);
  padding: calc(0.45rem - 2px) calc(1.1rem - 2px);
}

/* ---------- Media log entries ---------- */

.entries {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
  gap: 1.25rem;
  margin: 1.5rem 0;
}

/* Stitched edge, like an embroidered patch */
.entry {
  position: relative;
  padding: 1.1rem 1.25rem 0.5rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  outline: 2px dashed var(--line);
  outline-offset: -9px;
}
.entry h3 { margin-top: 0; }
.entry p { margin-bottom: 0.75rem; }
.entry .meta { color: var(--ink-soft); }

.badge {
  display: inline-block;
  margin: 0 0.3rem 0.3rem 0;
  padding: 0 0.7rem;
  background: var(--lilac);
  border-radius: 999px;
  font-size: 0.95rem;
}

/* Half stars are written as text, e.g. ★★★★½ */
.stars {
  color: var(--rose);
  font-size: 1.4rem;
  letter-spacing: 0.12em;
}
.loved { font-weight: 700; color: var(--rose); }

/* Vibe scale: every one also has an icon and a written label */
.vibe {
  display: inline-block;
  padding: 0.1rem 0.8rem;
  border-radius: 10px;
  border: 2px solid var(--line);
}
.vibe-steak { background: var(--sage); }
.vibe-hamburger { background: var(--butter); }
.vibe-cod-liver-oil { background: var(--sky); }
.vibe-stale-cracker { background: var(--lilac); }

/* ---------- Tables and forms (for filters later) ---------- */

table { border-collapse: collapse; width: 100%; }
th, td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 2px dashed var(--line);
}
th { background: var(--blush); }

select, input, button {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 10px;
  padding: 0.4rem 0.8rem;
}
button { background: var(--blush); cursor: pointer; }
button:hover { border-color: var(--rose); }

/* ---------- Footer ---------- */

footer {
  margin-top: 3rem;
  padding-top: 1rem;
  border-top: 2px dashed var(--line);
  color: var(--ink-soft);
}

/* ---------- Small screens and motion ---------- */

@media (max-width: 34rem) {
  body { font-size: 1.05rem; }
  h1 { font-size: 1.7rem; }
  .nav a { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Filter bar and screen-reader helper ---------- */

[hidden] { display: none !important; }

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

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 1rem 0 0.5rem;
}
/* Selected button: bold, inverted and ticked, so it is not colour alone */
.filters button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  font-weight: 700;
}
.filters button[aria-pressed="true"]::before {
  content: "✓ ";
  content: "✓ " / "";
}
.filter-status { color: var(--ink-soft); }