/* =============================================================================
   luuletused.ee — base layer
   Direction A's visual identity, kept unchanged by Direction D (HANDOFF §4).
   No framework: the whole site is this file plus two small scripts.
   ========================================================================== */

/* --- tokens ---------------------------------------------------------------
   Three theme states, in this order and no other:
     :root                            light — every token defined here
     prefers-color-scheme + :not()    system dark, unless light is forced
     [data-theme="dark"]              explicit choice, wins both ways
   No colour gets its only definition inside a media or [data-theme] block. */
:root{
  /* surfaces and ink */
  --paper:#fdfcfa;
  --surface:#ffffff;
  --surface-2:#f6f3ee;
  --ink:#1b1916;
  --ink-2:#625d54;
  --ink-3:#8b857a;
  --rule:#e0d9cd;
  --line:#e8e2d9;
  --good:#2c6e4b;
  --good-soft:#e3efe8;
  --warn:#8a6412;
  --warn-soft:#f6eeda;
  /* ad units are walled off on their own ground, never the page ground */
  --adslot:#f0ece5;
  --adslot-line:#d9d2c6;

  /* --- the occasion hues (direction H) -------------------------------------
     Nine of them for twenty-eight categories; src/lib/occasion.js decides which
     one a category gets and sets data-occ on <body>. They identify, and they
     also act: in this direction the hue IS the accent, so the copy button, the
     chosen chip and the page heading all take it from one place. That is the
     whole mechanism — no component below knows an occasion exists.

     --brand is the exception that must not move: the wordmark's red, the same
     on a birthday page and on a page about grief, because a logo that changes
     colour with the occasion stops being a logo. */
  --occ-ruby:#b32e49;
  --occ-fir:#1f5d48;
  --occ-gold:#8f6b22;
  --occ-plum:#7b2d5e;
  --occ-clay:#a1502f;
  --occ-indigo:#35457f;
  --occ-moss:#4d6b34;
  --occ-teal:#235f6b;
  --occ-slate:#465361;
  --brand:#b32e49;
  --occ:var(--brand);
  --accent:var(--occ);
  --accent-soft:#f7e7e9;
  --shadow:0 1px 2px rgba(42,41,38,.07),0 8px 24px -12px rgba(42,41,38,.24);

  /* type */
  --sans:"Plus Jakarta Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --serif:"Crimson Pro",Georgia,"Times New Roman",serif;
  --mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
  --text-xs:11px;
  --text-sm:12.5px;
  --text-base:15px;
  --text-md:16px;
  --text-lg:clamp(18px,2.4vw,20px);
  --text-xl:clamp(22px,4vw,28px);
  --text-2xl:clamp(26px,5vw,34px);
  /* The poem's line box. The ruled background repeats on exactly this period. */
  --leading:30px;

  /* space and shape */
  --gap-1:4px; --gap-2:8px; --gap-3:12px; --gap-4:16px; --gap-5:24px; --gap-6:32px; --gap-7:48px;
  --radius:10px;
  --radius-sm:6px;
  --radius-pill:999px;

  /* reserved heights — every late-loading unit claims its space up front so
     CLS stays at 0 and nothing jumps under a thumb (HANDOFF §6)

     A reserve only pays for itself when it is close to what actually arrives.
     Slot A is a fluid in-article unit, so AdSense picks the height, and 280px
     was a guess that came back about 100px too generous: the creative rendered
     ~180px and the rest was grey plate under the ad. 200px is measured rather
     than guessed — retune it from AdSense reporting once there is a week of
     creatives to look at, since this is one line. */
  --ad-inarticle:200px;
  --ad-infeed:250px;
  --ad-anchor:58px;
  --ad-rail:600px;

  /* Tells the browser which ground to paint before body's background lands.
     It has to track the theme, not list both: with `light dark` a manually
     chosen light theme still paints the OS's dark canvas for a frame. */
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  color-scheme:dark;
  --paper:#14120f;
  --surface:#1c1a17;
  --surface-2:#232019;
  --ink:#f3efe7;
  --ink-2:#aaa397;
  --ink-3:#857e72;
  --rule:#403a31;
  --line:#302c26;
  --good:#7cc39a;
  --good-soft:#1b2a21;
  --warn:#dfb262;
  --warn-soft:#2a2416;
  --adslot:#211e1a;
  --adslot-line:#3b352d;

  /* The same nine, lifted off a dark ground. Dark mode flips the contrast of
     every filled surface — a tile is now a light hue carrying dark text — so
     these are the light ends of the same colours, not the same values dimmed. */
  --occ-ruby:#f0788e;
  --occ-fir:#62b393;
  --occ-gold:#dcb057;
  --occ-plum:#d387b4;
  --occ-clay:#eb9470;
  --occ-indigo:#94a5e8;
  --occ-moss:#a3c47e;
  --occ-teal:#7cbcc9;
  --occ-slate:#9db0c4;
  --brand:#f0788e;
  --accent-soft:#3a1f24;
  --shadow:0 1px 2px rgba(0,0,0,.35),0 10px 28px -14px rgba(0,0,0,.6);
}}
:root[data-theme="dark"]{
  color-scheme:dark;
  --paper:#14120f;
  --surface:#1c1a17;
  --surface-2:#232019;
  --ink:#f3efe7;
  --ink-2:#aaa397;
  --ink-3:#857e72;
  --rule:#403a31;
  --line:#302c26;
  --good:#7cc39a;
  --good-soft:#1b2a21;
  --warn:#dfb262;
  --warn-soft:#2a2416;
  --adslot:#211e1a;
  --adslot-line:#3b352d;

  /* The same nine, lifted off a dark ground. Dark mode flips the contrast of
     every filled surface — a tile is now a light hue carrying dark text — so
     these are the light ends of the same colours, not the same values dimmed. */
  --occ-ruby:#f0788e;
  --occ-fir:#62b393;
  --occ-gold:#dcb057;
  --occ-plum:#d387b4;
  --occ-clay:#eb9470;
  --occ-indigo:#94a5e8;
  --occ-moss:#a3c47e;
  --occ-teal:#7cbcc9;
  --occ-slate:#9db0c4;
  --brand:#f0788e;
  --accent-soft:#3a1f24;
  --shadow:0 1px 2px rgba(0,0,0,.35),0 10px 28px -14px rgba(0,0,0,.6);
}

/* --- which occasion this page is ------------------------------------------
   src/lib/occasion.js puts data-occ on <body>; everything else reads --accent
   and never learns why it changed. --accent is bound here rather than on :root
   because custom properties resolve where they are declared: bound at :root it
   would freeze to the brand red before <body> had a chance to say otherwise. */
[data-occ="ruby"]{--occ:var(--occ-ruby)}
[data-occ="fir"]{--occ:var(--occ-fir)}
[data-occ="gold"]{--occ:var(--occ-gold)}
[data-occ="plum"]{--occ:var(--occ-plum)}
[data-occ="clay"]{--occ:var(--occ-clay)}
[data-occ="indigo"]{--occ:var(--occ-indigo)}
[data-occ="moss"]{--occ:var(--occ-moss)}
[data-occ="teal"]{--occ:var(--occ-teal)}
[data-occ="slate"]{--occ:var(--occ-slate)}
body{--accent:var(--occ);--accent-soft:color-mix(in srgb,var(--occ) 12%,var(--surface))}
/* A tile sets its own --occ inline, so it needs its own accent-soft too. */
.occ,.season{--accent:var(--occ);--accent-soft:color-mix(in srgb,var(--occ) 12%,var(--surface))}

/* --- reset ---------------------------------------------------------------- */
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;
  background:var(--paper);
  color:var(--ink);
  font-family:var(--sans);
  font-size:var(--text-md);
  line-height:1.55;
  -webkit-font-smoothing:antialiased;
  text-rendering:optimizeLegibility;
}
h1,h2,h3,h4{margin:0;line-height:1.18;letter-spacing:-.015em;text-wrap:balance}
p,ul,ol,figure{margin:0}
ul,ol{padding:0;list-style:none}
img{max-width:100%;height:auto}
button{font:inherit;color:inherit}
a{color:inherit;text-decoration-thickness:1px;text-underline-offset:2px}
:focus-visible{outline:2px solid var(--accent);outline-offset:2px;border-radius:2px}

/* Copy counts, ratings and every other figure line up in a column. */
.tnum{font-family:var(--mono);font-variant-numeric:tabular-nums}

.skip{position:absolute;left:-9999px}
.skip:focus{
  left:var(--gap-2);top:var(--gap-2);z-index:99;
  background:var(--surface);border:1px solid var(--line);
  border-radius:var(--radius-sm);padding:var(--gap-2) var(--gap-3);text-decoration:none;
}
.vh{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}

/* --- layout ---------------------------------------------------------------
   Mobile is the primary design; the wider layouts are the derivative.
     < 780px   one column
     780-1000  wider measure, still one column
     > 1000px  three columns — finder rail, results, ad + shortlist rail */
.wrap{max-width:680px;margin:0 auto;padding:0 var(--gap-4)}
main{padding:var(--gap-5) 0 var(--gap-7)}
.stack>*+*{margin-top:var(--gap-4)}

/* --- masthead -------------------------------------------------------------- */
.bar{background:var(--surface);border-bottom:1px solid var(--line);position:relative}
/* Nine hues in the width of the page, under every header. It is the one place
   the whole palette appears at once, and it sits where the visitor decides
   whether this site has what they came for.

   The segments are elements rather than a gradient because a gradient in nine
   stops has to repeat every hue twice to keep its edges hard, and because these
   are the same tokens the tiles below them use — one definition, two places.

   It replaces the header's bottom border rather than sitting under it, so
   switching the height changes the strip and moves nothing else on the page. */
.bandsplit{position:absolute;left:0;right:0;bottom:-1px;height:6px;display:flex}
.bandsplit i{flex:1}
.bandsplit i:nth-child(1){background:var(--occ-ruby)}
.bandsplit i:nth-child(2){background:var(--occ-fir)}
.bandsplit i:nth-child(3){background:var(--occ-gold)}
.bandsplit i:nth-child(4){background:var(--occ-plum)}
.bandsplit i:nth-child(5){background:var(--occ-clay)}
.bandsplit i:nth-child(6){background:var(--occ-indigo)}
.bandsplit i:nth-child(7){background:var(--occ-moss)}
.bandsplit i:nth-child(8){background:var(--occ-teal)}
.bandsplit i:nth-child(9){background:var(--occ-slate)}

.barrow{display:flex;align-items:center;gap:var(--gap-4);padding:10px var(--gap-4);max-width:680px;margin:0 auto}
.mark{font-family:var(--sans);font-weight:800;font-size:17px;letter-spacing:-.03em;text-decoration:none}
/* Brand red, not --accent: this is the one mark on the page that does not
   change colour with the occasion. */
.mark i{color:var(--brand);font-style:normal;font-weight:800}
.barnav{display:flex;gap:var(--gap-3);font-size:13.5px;color:var(--ink-2)}
.barnav a{text-decoration:none}
.barnav a:hover{color:var(--ink);text-decoration:underline}

/* The menu below 780px. Collapsed here rather than by a script, so the links
   are never painted and then taken away; site.js only flips data-nav.

   Open, it is a row of the bar rather than a panel floating over the page: the
   header does not stick, so there is nothing to float above, and in flow it
   needs no z-index, no shadow and no positioning to undo for the no-JS
   fallback in <head>. */
.burger{
  flex:none;display:inline-flex;align-items:center;justify-content:center;
  width:34px;height:34px;margin-left:calc(var(--gap-2) * -1);
  border:1px solid var(--line);border-radius:var(--radius-sm);
  background:var(--surface);color:var(--ink-2);cursor:pointer;
}
.burger:hover{color:var(--ink)}
/* Three bars from one element: the box is the middle, the pseudo-elements the
   outer two. Nothing to keep in sync when the colour changes. */
.burger__i,.burger__i::before,.burger__i::after{
  display:block;width:16px;height:2px;border-radius:1px;background:currentColor;
}
.burger__i{position:relative}
.burger__i::before,.burger__i::after{content:"";position:absolute;left:0}
.burger__i::before{top:-5px}
.burger__i::after{top:5px}
@media (max-width:779px){
  .barrow{flex-wrap:wrap;row-gap:0}
  .barnav{
    display:none;order:3;flex-basis:100%;flex-direction:column;gap:0;
    margin-top:var(--gap-2);padding-top:var(--gap-1);
    border-top:1px solid var(--line);font-size:var(--text-base);
  }
  .barnav a{padding:10px 2px;border-bottom:1px solid var(--line)}
  .barnav a:last-child{border-bottom:0}
  [data-nav="open"] .barnav{display:flex}
  /* The label is the first thing to go when the bar gets tight; the icon and
     the button's aria-label still say what it does. */
  #themelabel{display:none}
}
@media (min-width:780px){
  .burger{display:none}
}
.tbtn{
  margin-left:auto;display:inline-flex;align-items:center;gap:7px;
  font-size:var(--text-sm);color:var(--ink-2);cursor:pointer;
  border:1px solid var(--line);background:var(--surface);
  padding:5px 11px;border-radius:var(--radius-pill);
}
.tbtn:hover{color:var(--ink)}

/* --- page furniture -------------------------------------------------------- */
.crumbs{font-size:var(--text-sm);color:var(--ink-3);margin-bottom:var(--gap-3)}
.crumbs a{text-decoration:none}
.crumbs a:hover{text-decoration:underline}
/* The heading takes the occasion. It is the largest piece of colour on a page
   that is not a tile, and it is what tells a returning visitor which part of
   the site they landed on before they have read a word. */
.page-title{font-family:var(--sans);font-size:var(--text-2xl);font-weight:800;
  letter-spacing:-.03em;color:var(--accent)}
/* The occasion's name, set small above the heading: the hue never carries the
   meaning by itself. */
.olabel{display:inline-flex;align-items:center;gap:7px;margin-bottom:var(--gap-2);
  font-size:var(--text-xs);font-weight:700;letter-spacing:.1em;text-transform:uppercase;color:var(--accent)}
.olabel::before{content:"";width:7px;height:7px;border-radius:2px;background:var(--occ);flex:none}
/* Holds the heading watermark. The drawing is absolutely positioned inside it,
   so the box needs a corner to clip against and the text needs to sit above. */
.pagehead{position:relative;overflow:hidden}
.pagehead > :not(.ill){position:relative;z-index:1}
.lede{color:var(--ink-2);margin-top:var(--gap-3);font-size:var(--text-lg)}
.count{font-size:var(--text-xs);color:var(--ink-3);margin-top:var(--gap-2);
  font-family:var(--mono);font-variant-numeric:tabular-nums}
.intro{font-size:var(--text-base);color:var(--ink-2);margin-top:var(--gap-3);line-height:1.62}
.empty{margin-top:var(--gap-4);color:var(--ink-2)}
.hsec{
  font-size:var(--text-sm);font-weight:700;letter-spacing:.06em;text-transform:uppercase;
  color:var(--ink-2);margin-top:var(--gap-6);
}

/* --- occasion grid --------------------------------------------------------- */
.occgrid{margin-top:var(--gap-3);display:grid;gap:var(--gap-2);
  grid-template-columns:repeat(auto-fill,minmax(150px,1fr))}
/* The tile is the occasion: a filled block of its own hue with its drawing
   behind the text. This is the one place in the design where colour covers a
   large area, and it is the place the visitor is choosing from. */
.occ{border-radius:var(--radius);background:var(--occ);position:relative;overflow:hidden;
  display:flex;flex-direction:column;justify-content:space-between;min-height:86px;
  transition:transform .18s cubic-bezier(.2,.7,.3,1)}
.occ:hover{transform:translateY(-2px)}
/* Two markups reach this tile: home and search use .occ__a, /kategooriad uses a
   bare <a>. The padding lives here so both are laid out, whichever one a future
   view reaches for — without it the bare one printed its text hard against the
   corner of a coloured block, which is exactly what it looked like. */
.occ a{display:block;text-decoration:none;padding:var(--gap-3);position:relative;z-index:1}
.occ .occ__a{padding:var(--gap-3) var(--gap-3) 6px}
.occ .n{display:block;font-size:15px;font-weight:800;letter-spacing:-.02em;color:#fff}
.occ .c{display:block;font-size:10px;color:#fff;opacity:.82;margin-top:3px;
  font-family:var(--mono);font-variant-numeric:tabular-nums}
/* Dark mode inverts the tile — a light hue carrying dark text — so the text
   colour has to follow the ground rather than stay white on a pale block. */
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .occ .n,
  :root:not([data-theme="light"]) .occ .c{color:var(--paper)}}
:root[data-theme="dark"] .occ .n,:root[data-theme="dark"] .occ .c{color:var(--paper)}

/* --- "show all occasions" ---------------------------------------------------
   A native <details>, so the disclosure needs no JavaScript and cannot flash
   open before a script collapses it. <summary> is styled as the button it is;
   the default marker is removed on both the standard and the WebKit selector,
   which still needs its own. */
.moreocc{margin-top:var(--gap-3)}
/* Shaped like the tiles above it — same padding, same corner, same width as a
   row of the grid — but with no border and no ground of its own. It is a way
   further into the grid, not another occasion to choose, so it should read as
   part of that block without pretending to be one of its cells. */
.moreocc__b{display:flex;align-items:center;justify-content:center;gap:6px;cursor:pointer;
  padding:11px var(--gap-3);border:0;border-radius:9px;
  background:transparent;font-size:13.5px;font-weight:600;color:var(--accent);
  list-style:none;user-select:none}
.moreocc__b::-webkit-details-marker{display:none}
.moreocc__b::after{content:"";width:7px;height:7px;margin-left:2px;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:translateY(-2px) rotate(45deg);transition:transform .15s ease}
.moreocc[open] .moreocc__b::after{transform:translateY(1px) rotate(225deg)}
.moreocc__b:hover{background:var(--surface-2)}
.moreocc__b:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.moreocc__less{display:none}
.moreocc[open] .moreocc__more{display:none}
.moreocc[open] .moreocc__less{display:inline}
@media (prefers-reduced-motion:reduce){.moreocc__b::after{transition:none}}

/* --- poem lists ------------------------------------------------------------
   Hairline separators via a 1px grid gap over the border colour: one border,
   no double lines, no :last-child exceptions. */
/* A list row is a verse you can read and copy, not a link to go and find out.
   Occasion poems are short — most of the catalogue fits in six lines — so the
   row carries the poem itself, capped at four lines with a way through to the
   rest. The poem page is unchanged underneath: same URL, same canonical, same
   ratings. It simply stops being the only place the verse exists. */
.plist{margin-top:var(--gap-3);display:flex;flex-direction:column;gap:var(--gap-3);
  background:transparent;border:0;border-radius:0;overflow:visible}
.pitem{position:relative;overflow:hidden;background:var(--surface);
  border:1px solid var(--line);border-radius:var(--radius);
  padding:calc(var(--gap-4) + 4px) var(--gap-4) var(--gap-4)}
/* The occasion band, on the card rather than only on the page: a list of
   related poems on a poem page can hold more than one occasion. */
.pitem::before{content:"";position:absolute;left:0;right:0;top:0;height:5px;background:var(--occ)}
.pitem a{display:block;text-decoration:none}
.pitem .ti{display:block;font-family:var(--serif);font-size:var(--text-lg);font-weight:600;
  letter-spacing:-.01em}
.pitem a:hover .ti{text-decoration:underline;text-underline-offset:3px}
.pitem .ln{display:block;font-family:var(--serif);font-size:13px;color:var(--ink-2);
  line-height:1.45;margin-top:3px}
/* The verse itself. Serif, because a poem beside a sans-serif ad must never be
   mistakable for one. */
.pitem .vs{font-family:var(--serif);font-size:16px;line-height:1.6;color:var(--ink);
  margin-top:var(--gap-2)}
.pitem .vs__more{display:inline-block;margin-top:6px;font-family:var(--sans);font-size:12px;
  font-weight:600;color:var(--accent);text-decoration:none}
.pitem .vs__more:hover{text-decoration:underline}
.pitem .ft{display:flex;align-items:center;gap:var(--gap-2);margin-top:var(--gap-3);flex-wrap:wrap;
  font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:10px;color:var(--ink-3)}
.pitem .ft .rid{border:1px solid var(--line);border-radius:3px;padding:1px 5px;background:var(--surface-2)}
.pitem .ft .cp{color:var(--accent);font-weight:500}
.pitem .ft .sv{margin-left:auto;color:var(--ink-2)}
/* Copy, from the list. On a phone it is the width of the thumb that presses it;
   from 780px a column of full-width buttons is too much weight for what is a
   secondary action there, so it shrinks to its own label. */
.pact{display:flex;gap:var(--gap-2);align-items:center;margin-top:var(--gap-3)}
.pcopy{flex:1;min-height:44px;padding:0 var(--gap-4);border:0;border-radius:9px;
  background:var(--accent);color:#fff;font-family:var(--sans);font-size:14px;font-weight:700;
  cursor:pointer}
.pcopy:hover{filter:brightness(1.06)}
.pcopy.is-done{background:var(--good)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .pcopy{color:var(--paper)}}
:root[data-theme="dark"] .pcopy{color:var(--paper)}
@media (min-width:780px){.pcopy{flex:0 0 auto}}

/* --- poem page ------------------------------------------------------------- */
.poemcard{position:relative;overflow:hidden;border:1px solid var(--line);border-radius:var(--radius);
  background:var(--surface);padding:calc(var(--gap-5) + 4px) var(--gap-4) var(--gap-5)}
.poemcard::before{content:"";position:absolute;left:0;right:0;top:0;height:8px;background:var(--occ)}
/* A wish is two lines in a small card, so it takes the list's band rather than
   the poem page's. */
.poemcard--wish::before{height:4px}
.poemmeta{display:flex;gap:9px;align-items:center;flex-wrap:wrap;margin-top:9px;
  font-family:var(--mono);font-variant-numeric:tabular-nums;font-size:10px;color:var(--ink-3)}
.poemmeta .stars{color:var(--accent);font-family:var(--sans);font-size:var(--text-sm)}
.poemmeta .copies{background:var(--accent-soft);color:var(--accent);padding:3px 7px;
  border-radius:4px;font-weight:500}
/* The ruled lines are gone with direction A. They were that design's one
   decorative gesture; this one puts its gesture in the occasion instead, and a
   verse printed over rules and under a coloured band is two ideas competing.
   What is left is the thing itself, set large. */
.poem-body{
  font-family:var(--serif);
  font-size:20px;
  line-height:1.7;
  margin-top:var(--gap-4);
}
.cta{display:flex;gap:var(--gap-2);margin-top:var(--gap-4)}
/* Class-only selectors: a `.cta button` element rule would outrank .cta__sq
   and quietly turn the icon buttons into full-width primary buttons. */
.cta__copy{
  flex:1;min-height:46px;border:0;border-radius:9px;
  background:var(--accent);color:#fff;
  font-size:14.5px;font-weight:700;padding:var(--gap-3);cursor:pointer;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .cta__copy{color:var(--paper)}}
:root[data-theme="dark"] .cta__copy{color:var(--paper)}
.cta__copy:hover{filter:brightness(1.06)}
.cta__sq{
  flex:none;width:44px;min-height:44px;border-radius:9px;
  background:var(--surface-2);color:var(--ink-2);border:1px solid var(--line);
  font-size:16px;cursor:pointer;
}
.cta__sq[aria-pressed="true"]{color:var(--accent);border-color:var(--accent);background:var(--accent-soft)}
.cta--second{margin-top:var(--gap-2)}
/* Secondary by design: sending the poem as a picture is the better share, but
   copying it is still what most visitors came to do. */
.cta__alt{
  flex:1;min-height:44px;border-radius:9px;cursor:pointer;
  background:var(--surface-2);color:var(--ink);border:1px solid var(--line);
  font-size:14px;font-weight:600;padding:var(--gap-3);
  text-decoration:none;display:inline-flex;align-items:center;justify-content:center;
  box-sizing:border-box;
}
.cta__alt:hover{background:var(--surface);border-color:var(--ink-3)}
.cta__alt--partner{color:var(--accent)}
.cta__alt[disabled]{opacity:.6;cursor:default}
.cta__status{min-height:1.4em;margin-top:var(--gap-2);font-size:var(--text-sm);color:var(--accent)}

/* --- rating ---------------------------------------------------------------
   Sits between the copy button and slot A, so the ad is never one thumb-width
   from the button everyone came to press. */
.rate{
  display:flex;align-items:center;gap:var(--gap-3);flex-wrap:wrap;
  margin-top:var(--gap-3);padding-top:var(--gap-3);border-top:1px solid var(--line);
}
.rate__q{font-size:var(--text-sm);color:var(--ink-2)}
.rate__stars{display:flex;gap:2px;margin-left:auto}
.rate__star{
  border:0;background:none;cursor:pointer;padding:2px 3px;
  font-size:19px;line-height:1;color:var(--line);
}
.rate__star.is-on{color:var(--accent)}
.rate.is-done .rate__star{cursor:default;color:var(--line)}
.rate.is-done .rate__q{color:var(--good);font-weight:600}

.morelink{margin-top:var(--gap-4);font-size:13.5px}
.morelink a{color:var(--accent);font-weight:600;text-decoration:none}
.morelink a:hover{text-decoration:underline}

/* The contribution ask, revealed after a copy. Quiet: it is a thank-you with a
   question attached, not a call to action competing with the poem. */
.nudge{margin-top:var(--gap-3);font-size:13px;color:var(--ink-2)}
.nudge a{color:var(--accent);font-weight:600;text-decoration:none}
.nudge a:hover{text-decoration:underline}

.intro--links{margin-top:var(--gap-2);font-size:13.5px;display:flex;flex-wrap:wrap;
  gap:var(--gap-2) var(--gap-3)}
.intro--links a{color:var(--accent);font-weight:600;text-decoration:none}
.intro--links a::after{content:" →"}
.intro--links a:hover{text-decoration:underline}

/* "Vaata ka" — the cross-links between occasions. Quiet by design: it sits
   below everything the visitor came for, and it is a way out of a page that
   did not have what they wanted, not a second navigation. */
.seealso{margin-top:var(--gap-5);padding-top:var(--gap-4);border-top:1px solid var(--line)}
.seealso__h{font-size:var(--text-sm);font-weight:600;color:var(--ink-2);
  letter-spacing:.02em;margin:0 0 var(--gap-2)}
.seealso__l{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:7px}
.seealso__l a{display:inline-block;padding:5px 10px;border:1px solid var(--line);
  border-radius:999px;background:var(--surface);font-size:13px;text-decoration:none;
  color:var(--ink)}
.seealso__l a:hover{background:var(--surface-2);border-color:var(--ink-3)}
.seealso__l a .tnum{color:var(--ink-3);font-size:11px;margin-left:3px}

/* Slot E is desktop-only: below 1000px the rail is not rendered at all rather
   than pushed under the poem, where it would be a fourth unit on a phone. */
.cols__rail{display:none}

/* --- ad slots --------------------------------------------------------------
   Every unit is labelled, walled off from the page, and reserves its height
   before it fills. The rules CSS cannot enforce — never between the h1 and the
   poem body, never beside the copy button, no interstitial on entry — live in
   the templates and in the tests.

   The unit used to sit on a filled grey plate. That works only while the plate
   and the ad are the same size, and they are not: AdSense sizes a fluid
   in-article unit from the column width and then fills it with whatever demand
   it has, so a 728x90 leaderboard arrived inside a unit about 560px tall. The
   <ins> is transparent, so the plate showed through as a large grey box with a
   small banner adrift in it.

   Nothing here can measure a cross-origin iframe, and clipping an ad is not an
   option. So the ground goes: a rule above and below, and the label, mark the
   boundary instead. Unused unit height now reads as whitespace rather than as
   an empty box, whatever height Google picks. */
.ad{
  display:block;margin:var(--gap-6) 0;padding:var(--gap-2) 0;
  border:0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);
  border-radius:0;background:transparent;
}
.ad__label{
  display:block;margin-bottom:6px;
  font-family:var(--mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);
}
.ad__unit{
  display:flex;align-items:center;justify-content:center;
  min-height:var(--ad-infeed);
}
.ad--inarticle .ad__unit{min-height:var(--ad-inarticle)}
.ad--rail .ad__unit{min-height:var(--ad-rail)}
.ad__unit>ins{width:100%}
/* AdSense marks the <ins> filled or unfilled once it has decided. An unfilled
   unit collapses to nothing, which would otherwise leave a labelled grey box
   with an ad's worth of reserved height and no ad — the empty box this file
   already says is worse than no box at all. Browsers without :has() keep the
   old behaviour, which is the current behaviour, so there is nothing to lose. */
.ad:has(ins[data-ad-status="unfilled"]),
.anchor:has(ins[data-ad-status="unfilled"]){display:none}

/* And the third outcome: no answer at all. site.js marks a slot that has not
   reported in time, and it is treated exactly as unfilled — the reserve is
   scaffolding for a wait, and a wait that never ends is not a wait. The marker
   is set on the list item where there is one, because an empty grid item still
   draws the list's rules. Removed again if AdSense answers late. */
/* Collapsed, but NOT removed from the layout. AdSense measures the width of the
   <ins> when it renders, so an element hidden with display:none measures zero
   and the request fails with no slot size — which would make this safety net
   the reason a slow ad never arrives, on exactly the connections where ads are
   slowest. So the reserve is released and the box emptied while the element
   keeps its place and its width, and a late answer can still fill it. */
[data-ad-timeout] .ad__unit,
[data-ad-timeout] .anchor__unit{min-height:0}
[data-ad-timeout] .ad__label,
[data-ad-timeout] .anchor__label,
[data-ad-timeout] .anchor__close{display:none}
[data-ad-timeout].ad,
[data-ad-timeout] .ad{margin:0;padding:0;border:0}
li.pitem--ad[data-ad-timeout]{padding:0;background:transparent}
/* The anchor is a fixed bar; with nothing in it, the page should not keep
   reserving its height at the bottom either. */
.anchor[data-ad-timeout]{padding:0;border:0;background:transparent}
body:has(.anchor[data-ad-timeout]){padding-bottom:0}

/* Before AdSense answers, the slot holds its space and shows nothing.
   Announcing "REKLAAM" over an empty grey plate and then taking it away a
   second later is worse than either outcome it precedes: the reader is shown a
   thing that is not there yet and may never be. So the ground and the label
   only appear once an ad has. Visibility rather than display for the label, so
   revealing it cannot move anything. An <ins> with no status yet is exactly the
   undecided window; a slot with no <ins> at all is the development
   placeholder, which is meant to be seen. */
/* Once the ad is in, the box is the ad's size. The reserve is scaffolding for
   the wait, not a frame to sit inside: holding 200px open around a 90px
   leaderboard left 110px of nothing, measured. Releasing it costs a shift at
   fill time — that is the trade, and it is the right way round. An ad that is
   bigger than the reserve already grew the box; this only stops it from being
   unable to shrink. */
.ad:has(ins[data-ad-status="filled"]) .ad__unit{min-height:0}
.anchor:has(ins[data-ad-status="filled"]) .anchor__unit{min-height:0}

.ad:has(ins:not([data-ad-status])){border-color:transparent}
.ad:has(ins:not([data-ad-status])) .ad__label{visibility:hidden}
.anchor:has(ins:not([data-ad-status])){border-color:transparent;background:transparent}
.anchor:has(ins:not([data-ad-status])) .anchor__label,
.anchor:has(ins:not([data-ad-status])) .anchor__close{visibility:hidden}

.ad__placeholder{
  font-family:var(--mono);font-size:10.5px;color:var(--ink-3);
  border:1px dashed var(--adslot-line);border-radius:6px;padding:6px 10px;
}

/* Slot D. Fixed rather than sticky so revealing or dismissing it never reflows
   the document; the space it occupies is reserved on <body> instead. */
.anchor{
  position:fixed;left:0;right:0;bottom:0;z-index:20;
  display:flex;align-items:center;gap:9px;
  min-height:var(--ad-anchor);padding:6px var(--gap-3);
  border-top:1px solid var(--adslot-line);background:var(--adslot);
}
.anchor__label{
  font-family:var(--mono);font-size:9px;letter-spacing:.14em;text-transform:uppercase;color:var(--ink-3);
}
.anchor__unit{flex:1;display:flex;align-items:center;justify-content:center;min-height:44px}
/* The same rule .ad__unit has, and for the same reason — it was missing here.
   The <ins> is a flex item with no intrinsic width, so without this it shrinks
   to nothing, AdSense measures a zero-width slot and refuses to fill it. Slot D
   would render, reserve its bar, and never once show an ad. */
.anchor__unit>ins{width:100%}
.anchor__close{
  flex:none;width:28px;height:28px;border-radius:var(--radius-pill);
  border:1px solid var(--adslot-line);background:var(--surface);color:var(--ink-2);
  font-size:15px;line-height:1;cursor:pointer;
}
.has-anchor{padding-bottom:calc(var(--ad-anchor) + var(--gap-2))}
[data-anchor="off"] .anchor{display:none}
[data-anchor="off"] .has-anchor{padding-bottom:0}
/* AdSense answering "unfilled" hides the anchor a few rules above. The space
   reserved for it has to go at the same moment, or the page keeps a band of
   empty ground under the footer for a unit that has already been withdrawn.
   Browsers without :has() keep the reservation, which is the old behaviour. */
.has-anchor:has(.anchor ins[data-ad-status="unfilled"]){padding-bottom:0}

/* --- pagination ------------------------------------------------------------ */
.pager{display:flex;align-items:center;gap:var(--gap-4);margin-top:var(--gap-5);font-size:13.5px}
.pager span{color:var(--ink-3);font-size:var(--text-xs);font-family:var(--mono)}
.pager a{color:var(--accent);font-weight:600;text-decoration:none}
.pager a:hover{text-decoration:underline}

/* --- footer ---------------------------------------------------------------- */
.foot{border-top:1px solid var(--line);background:var(--surface);
  padding:var(--gap-5) 0 var(--gap-6);margin-top:var(--gap-6)}
.foot p{font-size:var(--text-sm);color:var(--ink-3)}
.foot .mock{margin-top:6px;font-family:var(--mono);font-size:var(--text-xs)}


/* --- the finder -----------------------------------------------------------
   Three questions at the top of a page that already ranks. The chips are
   links, so this works with JS off; the script only makes the swap live. */
.finder{
  margin-top:var(--gap-4);padding:var(--gap-3);
  border:1px solid var(--line);border-radius:11px;background:var(--surface-2);
}
.finder[aria-busy="true"]{opacity:.7}
.fq{border:0;padding:0;margin:0 0 11px}
.fq:last-of-type{margin-bottom:0}
.fq__q{padding:0;margin-bottom:6px;display:flex;align-items:center;gap:6px;
  font-size:11.5px;font-weight:600;color:var(--ink-2)}
.fq__n{font-family:var(--mono);font-size:9.5px;color:var(--ink-3);
  border:1px solid var(--line);border-radius:3px;padding:0 4px;background:var(--surface)}
.chips{display:flex;gap:5px;flex-wrap:wrap}
.chip{
  display:inline-flex;align-items:center;gap:5px;
  min-height:32px;padding:5px 10px;
  font-size:11.5px;text-decoration:none;color:var(--ink-2);
  border:1px solid var(--line);border-radius:var(--radius-pill);background:var(--surface);
}
.chip:hover{border-color:var(--ink-3);color:var(--ink)}
.chip__c{font-size:9.5px;color:var(--ink-3)}
.chip--on{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:700}
.chip--on .chip__c{color:#fff;opacity:.8}
.chip--on:hover{border-color:var(--accent);color:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .chip--on,
  :root:not([data-theme="light"]) .chip--on .chip__c,
  :root:not([data-theme="light"]) .chip--on:hover{color:var(--paper)}}
:root[data-theme="dark"] .chip--on,:root[data-theme="dark"] .chip--on .chip__c,
:root[data-theme="dark"] .chip--on:hover{color:var(--paper)}
/* A combination that would return nothing is dimmed and not tappable: nobody
   should be able to reach an empty result. */
.chip--dim{color:var(--ink-3);opacity:.5;pointer-events:none}

/* The live count is the whole feeling of the feature — 1 240 -> 186 -> 34. */
.counter{
  display:flex;align-items:baseline;gap:var(--gap-2);
  border-top:1px solid var(--line);margin-top:11px;padding-top:10px;
  font-family:var(--mono);font-size:var(--text-xs);color:var(--ink-3);
}
.counter b{font-family:var(--sans);font-size:19px;font-weight:700;color:var(--ink);letter-spacing:-.02em}
.counter b:focus{outline:none}
.counter__was{text-decoration:line-through;opacity:.6}
.counter__clr{margin-left:auto;color:var(--accent);font-family:var(--sans);
  font-size:11.5px;font-weight:600;text-decoration:none}
.finder__go{margin-top:10px;width:100%;min-height:40px;border:1px solid var(--accent);
  border-radius:9px;background:var(--accent);color:#fff;font-weight:600;cursor:pointer}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .finder__go{color:var(--paper)}}
:root[data-theme="dark"] .finder__go{color:var(--paper)}

/* Shown before a visitor can conclude the site is empty, with a real count. */
.widen{
  margin-top:11px;padding:11px var(--gap-3);
  border:1px dashed var(--line);border-radius:9px;background:var(--surface-2);
}
.widen__h{font-size:var(--text-sm);font-weight:600}
.widen__b{font-size:11.5px;color:var(--ink-2);margin-top:4px}
.widen__a{display:inline-block;margin-top:7px;font-size:11.5px;font-weight:600;
  color:var(--accent);text-decoration:none}

/* --- Minu valik ------------------------------------------------------------
   Up to five poems in localStorage. No account, nothing sent to the server. */
.tray{
  margin-bottom:var(--gap-4);padding:11px var(--gap-3);
  border:1px solid var(--line);border-radius:var(--radius);background:var(--surface-2);
}
.tray__h{display:flex;align-items:center;gap:7px;font-size:11.5px;font-weight:600}
.tray__c{font-family:var(--mono);font-size:9.5px;background:var(--accent);color:#fff;
  border-radius:var(--radius-pill);padding:1px 6px}
.tray__list{margin-top:var(--gap-2)}
.tray__r{display:flex;align-items:center;gap:var(--gap-2);
  padding:6px 0;border-bottom:1px solid var(--line)}
.tray__r:last-child{border-bottom:0}
.tray__r a{flex:1;font-family:var(--serif);font-size:12.5px;color:var(--ink-2);text-decoration:none}
.tray__r a:hover{color:var(--ink);text-decoration:underline}
.tray__x{flex:none;width:24px;height:24px;border-radius:var(--radius-pill);
  border:1px solid var(--line);background:var(--surface);color:var(--ink-3);cursor:pointer;line-height:1}

/* Slot C rides in the list as a sibling of the rows, never inside one. */
.pitem--ad{padding:0;background:transparent;border:0;border-radius:0}
.pitem--ad::before{display:none}
.pitem--ad .ad{margin:0;border-radius:0}

/* --- wider viewports -------------------------------------------------------
   One codebase, three layouts (HANDOFF §5):
     < 780px   single column, the finder collapsed above the list
     780-1000  two columns, finder rail and results, no right rail
     > 1000px  three columns, the right rail joins */
@media (min-width:780px){
  .wrap,.barrow{max-width:720px}
  .page-title{letter-spacing:-.02em}
  .cols--category{display:grid;grid-template-columns:238px 1fr;gap:var(--gap-5);align-items:start}
  .cols--category .finder{margin-top:var(--gap-3)}
  .rail{position:sticky;top:var(--gap-4)}
}
@media (min-width:1000px){
  .wrap,.barrow{max-width:1080px}
  .cols--category{grid-template-columns:238px 1fr 300px}
  .cols--home{display:grid;grid-template-columns:1fr 300px;gap:var(--gap-5);align-items:start}
  .cols--poem{display:grid;grid-template-columns:1fr 300px;gap:var(--gap-5);align-items:start}
  /* Main plus the right rail, for the pages that have no finder to put in the
     left one: uuemad, the landings and the prose pages. They were using
     .cols--category, whose first column is 238px wide and meant for the finder
     — so their content was laid out in it and the ad rail took the 1fr column
     beside it. On a prose page that is the whole article in a 238px strip. */
  .cols--list{display:grid;grid-template-columns:1fr 300px;gap:var(--gap-5);align-items:start}
  /* The three columns of .cols--category have to start on the same line, and
     the middle one is the reference: .plist carries margin-top:var(--gap-3),
     so the left and right columns are brought down to meet it rather than the
     list being pulled up. The finder above takes that 12px as its own margin;
     the rail takes it as padding, and the ad inside the rail gives up the
     margin:var(--gap-6) 0 it needs everywhere else — it is the first thing in
     the rail (the tray above it is hidden until localStorage has something to
     put in it), so that 32px was pure offset, and it was what left the right
     column sitting 32px below the other two.

     Padding rather than a margin on the rail because both side columns are
     sticky: a stuck box pins its *border* box at top:var(--gap-4), so a margin
     would be scrolled away with the flow position and the ad would ride 12px
     above the finder the moment the column pinned. Padding is inside the
     border box, so it survives the pin — and it holds the offset whether the
     first child is the ad or the tray, once localStorage has filled one.

     Flex with a gap rather than block margins, because a hidden .tray is
     display:none and therefore not a flex item at all — it cannot leave a gap
     behind it the way a collapsed margin could. The base
     .cols__rail{display:none} further up stays as it is: below 1000px the rail
     is not rendered and none of this applies. */
  .cols__rail{display:flex;flex-direction:column;gap:var(--gap-5);padding-top:var(--gap-3)}
  .cols__rail>.ad{margin:0}

  /* The anchor hands over to the rail at exactly this width. Below it the bar
     is the only unit a phone can carry and it is worth its place; from here the
     page already has the rail and an in-feed unit, and a third pinned across
     the bottom of a wide screen is the one that reads as too many. A sticky bar
     is a phone format anyway — on a desktop it costs more attention than it is
     worth. The reserved height goes with it, or the page keeps a band of empty
     ground under the footer for a bar that is not there. */
  .anchor{display:none}
  .has-anchor{padding-bottom:0}
}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition-duration:.01ms!important;animation-duration:.01ms!important}
  html{scroll-behavior:auto}
}

/* --- search box ------------------------------------------------------------ */
.searchbox{display:flex;gap:var(--gap-2);margin-top:var(--gap-4)}
.searchbox__i{
  flex:1;min-width:0;min-height:44px;padding:0 var(--gap-3);
  font:inherit;font-size:var(--text-base);color:var(--ink);
  border:1px solid var(--line);border-radius:9px;background:var(--surface-2);
}
.searchbox--big .searchbox__i{background:var(--surface)}
.searchbox__i::placeholder{color:var(--ink-3)}
.searchbox__b{
  flex:none;min-height:44px;padding:0 var(--gap-4);
  border:1px solid var(--line);border-radius:9px;background:var(--surface-2);
  color:var(--ink-2);font-weight:600;cursor:pointer;
}
.searchbox__b:hover{color:var(--ink)}

/* --- seasonal band ---------------------------------------------------------
   Traffic is heavily seasonal, so the homepage leads with whatever is close. */
.season{
  display:flex;flex-direction:column;gap:var(--gap-1);justify-content:space-between;
  position:relative;overflow:hidden;min-height:104px;
  margin-top:var(--gap-3);padding:var(--gap-4);
  border:0;border-radius:var(--radius);background:var(--occ);text-decoration:none;
}
.season__k{display:block;position:relative;z-index:1;font-size:10px;font-weight:800;
  letter-spacing:.12em;text-transform:uppercase;color:#fff;opacity:.92}
.season__h{display:block;position:relative;z-index:1;font-size:var(--text-lg);
  font-weight:800;letter-spacing:-.02em;color:#fff}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .season__k,
  :root:not([data-theme="light"]) .season__h{color:var(--paper)}}
:root[data-theme="dark"] .season__k,:root[data-theme="dark"] .season__h{color:var(--paper)}

/* --- occasion tiles with sub-shortcuts ------------------------------------- */
.occ__a{display:block;padding:var(--gap-3) var(--gap-3) 6px;text-decoration:none;position:relative;z-index:1}
/* The shortcuts sit on the hue too, so they are outlined in the tile's own text
   colour at low alpha rather than bordered in the page's line colour. */
.occ__sub{display:flex;gap:5px;flex-wrap:wrap;padding:0 var(--gap-3) var(--gap-3);position:relative;z-index:1}
.occ__sub a{
  font-size:10.5px;color:#fff;text-decoration:none;
  border:1px solid color-mix(in srgb,#fff 38%,transparent);
  border-radius:var(--radius-pill);padding:2px 7px;
  background:color-mix(in srgb,#fff 12%,transparent);
}
.occ__sub a:hover{background:color-mix(in srgb,#fff 24%,transparent)}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .occ__sub a{
  color:var(--paper);border-color:color-mix(in srgb,var(--paper) 38%,transparent);
  background:color-mix(in srgb,var(--paper) 12%,transparent)}}
:root[data-theme="dark"] .occ__sub a{
  color:var(--paper);border-color:color-mix(in srgb,var(--paper) 38%,transparent);
  background:color-mix(in srgb,var(--paper) 12%,transparent)}

/* --- forms ----------------------------------------------------------------- */
.wrap--narrow{max-width:560px}
.form{margin-top:var(--gap-5)}
.field{margin-bottom:var(--gap-4)}
.field label{display:block;font-size:var(--text-sm);font-weight:600;margin-bottom:5px}
.field__opt{font-weight:400;color:var(--ink-3)}
.field input,.field select,.field textarea{
  width:100%;min-height:44px;padding:10px var(--gap-3);
  font:inherit;font-size:var(--text-base);color:var(--ink);
  border:1px solid var(--line);border-radius:9px;background:var(--surface);
}
.field textarea{font-family:var(--serif);line-height:1.7;resize:vertical}
.field [aria-invalid="true"]{border-color:var(--accent)}
.field__h{margin-top:5px;font-size:11.5px;color:var(--ink-3)}
.field__e{margin-top:5px;font-size:11.5px;color:var(--accent);font-weight:600}
.form__go{
  width:100%;min-height:46px;border:0;border-radius:9px;
  background:var(--accent);color:#fff;font-size:var(--text-base);font-weight:600;cursor:pointer;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]) .form__go{color:var(--paper)}}
:root[data-theme="dark"] .form__go{color:var(--paper)}
/* Honeypot: off-screen rather than display:none, which some bots skip. */
.hp{position:absolute;left:-9999px;width:1px;height:1px;overflow:hidden}

.notice{margin-top:var(--gap-4);padding:var(--gap-3) var(--gap-4);border-radius:var(--radius);
  border:1px solid var(--line);background:var(--surface-2)}
.notice--good{border-left:3px solid var(--good)}
.notice--bad{border-left:3px solid var(--accent);color:var(--accent);font-size:var(--text-base)}
.notice__h{font-weight:600}
.notice__b{margin-top:4px;font-size:var(--text-base);color:var(--ink-2)}

/* --- category FAQ ---------------------------------------------------------- */
.faq{margin-top:var(--gap-5)}
.faq__i{border-bottom:1px solid var(--line);padding:var(--gap-3) 0}
.faq__i:last-child{border-bottom:0}
.faq__q{font-size:var(--text-base);font-weight:600}
.faq__a{margin-top:5px;font-size:13.5px;color:var(--ink-2);line-height:1.6}

/* --- recipient vote (tagging stage 4) -------------------------------------- */
.rate--tags{align-items:flex-start}
.tagvote{display:flex;gap:5px;flex-wrap:wrap;margin-left:auto;max-width:100%}
.tagvote__b{
  border:1px solid var(--line);background:var(--surface);color:var(--ink-2);
  border-radius:var(--radius-pill);padding:4px 10px;font-size:11.5px;cursor:pointer;
}
.tagvote__b:hover{border-color:var(--ink-3);color:var(--ink)}
.tagvote__b.is-on{background:var(--accent);border-color:var(--accent);color:#fff;font-weight:600}
.is-done .tagvote__b{cursor:default}
.is-done .tagvote__b:not(.is-on){opacity:.45}

/* --- poem tags -------------------------------------------------------------- */
.ptags{display:flex;gap:4px;flex-wrap:wrap;margin-top:var(--gap-2)}
.ptags a{
  font-size:10px;color:var(--ink-3);text-decoration:none;
  border:1px solid var(--line);border-radius:var(--radius-pill);
  padding:2px 8px;background:var(--surface-2);
}
.ptags a:hover{color:var(--ink);border-color:var(--ink-3)}

.byline{margin-top:6px;font-size:var(--text-sm);color:var(--ink-3)}
.field select[multiple]{height:auto;padding:6px}
.field select[multiple] option{padding:4px 6px}

/* --- moderation ------------------------------------------------------------ */
.adminbar{display:flex;align-items:center;gap:var(--gap-4);flex-wrap:wrap}
.adminbar .tbtn{margin-left:auto}
.pending{border:1px solid var(--line);border-radius:var(--radius);background:var(--surface);
  padding:var(--gap-4);margin-top:var(--gap-4)}
.pending__t{font-family:var(--serif);font-size:var(--text-xl);font-weight:600}
.pending__m{margin-top:5px;font-family:var(--mono);font-size:var(--text-xs);color:var(--ink-3)}
.pending__c{display:flex;gap:4px;flex-wrap:wrap;margin-top:var(--gap-2)}
.pending__c .tg{font-size:10px;color:var(--ink-3);border:1px solid var(--line);
  border-radius:var(--radius-pill);padding:2px 8px;background:var(--surface-2)}
.pending__a{display:flex;gap:var(--gap-2);margin-top:var(--gap-4)}
.pending__a form{flex:1}
.pending__a form:last-child{flex:none}
.pending__no{min-height:44px;padding:0 var(--gap-4);border:1px solid var(--line);
  border-radius:9px;background:var(--surface-2);color:var(--ink-2);font-weight:600;cursor:pointer}
.pending__no:hover{color:var(--accent);border-color:var(--accent)}

/* =============================================================================
   Occasion drawings

   One rule per occasion, painted with gradients, a clip-path or a mask. There
   is no image file and no SVG asset, so an occasion costs a CSS rule and
   nothing in the request waterfall — which matters on a site whose visitors
   arrive on a phone from a Google result and leave ninety seconds later.

   Each drawing inherits its tile's text colour and is mixed down to 18% of it,
   so one definition works on a red tile, on a slate one, and on the light-hue
   tiles the dark theme uses. Decorative throughout: every mark is aria-hidden
   and sits behind text that already names the occasion.
   ========================================================================== */
.ill{position:absolute;display:block;right:-10px;bottom:-14px;width:96px;height:96px;
  pointer-events:none;color:color-mix(in srgb,currentColor 18%,transparent);--play:paused}
.ill::before,.ill::after{content:"";position:absolute}

/* sünnipäev — cake and three candles */
.ill--cake{background:
  linear-gradient(currentColor 0 0) 22px 24px/4px 18px,
  linear-gradient(currentColor 0 0) 46px 20px/4px 22px,
  linear-gradient(currentColor 0 0) 70px 24px/4px 18px,
  linear-gradient(currentColor 0 0) 6px 46px/84px 34px;
  background-repeat:no-repeat}
.ill--cake::after{inset:0;transform-origin:50% 70%;background:
  radial-gradient(ellipse 4px 6px at 24px 16px,currentColor 98%,transparent 100%),
  radial-gradient(ellipse 4px 6px at 48px 12px,currentColor 98%,transparent 100%),
  radial-gradient(ellipse 4px 6px at 72px 16px,currentColor 98%,transparent 100%);
  background-repeat:no-repeat}

/* jõulud — fir tree and falling snow */
.ill--tree::before{inset:0;background:currentColor;
  clip-path:polygon(50% 4%,68% 34%,59% 34%,78% 62%,56% 62%,56% 80%,44% 80%,44% 62%,22% 62%,41% 34%,32% 34%)}
.ill--tree::after{inset:0;background:
  radial-gradient(circle 3px at 12px 18px,currentColor 98%,transparent),
  radial-gradient(circle 2px at 86px 26px,currentColor 98%,transparent),
  radial-gradient(circle 3px at 90px 58px,currentColor 98%,transparent),
  radial-gradient(circle 2px at 8px 50px,currentColor 98%,transparent);
  background-repeat:no-repeat}

/* pulmad — two rings */
.ill--rings::before{inset:0;background:
  radial-gradient(circle at 34px 54px,transparent 0 18px,currentColor 18px 22px,transparent 23px) no-repeat}
.ill--rings::after{inset:0;transform-origin:34px 54px;background:
  radial-gradient(circle at 62px 54px,transparent 0 18px,currentColor 18px 22px,transparent 23px) no-repeat}

/* armastus — one heart */
.ill--heart::before{inset:10px;background:currentColor;
  clip-path:path('M38 72 C 6 50, 8 20, 25 17 C 32 15, 38 21, 38 27 C 38 21, 44 15, 51 17 C 68 20, 70 50, 38 72 Z')}

/* emadepäev, naistepäev — five petals */
.ill--flower{background:
  radial-gradient(circle 12px at 48px 18px,currentColor 98%,transparent),
  radial-gradient(circle 12px at 78px 40px,currentColor 98%,transparent),
  radial-gradient(circle 12px at 66px 76px,currentColor 98%,transparent),
  radial-gradient(circle 12px at 30px 76px,currentColor 98%,transparent),
  radial-gradient(circle 12px at 18px 40px,currentColor 98%,transparent),
  radial-gradient(circle 7px at 48px 47px,currentColor 98%,transparent);
  background-repeat:no-repeat}

/* lein — a single candle, the quietest mark in the set */
.ill--candle{background:
  linear-gradient(currentColor 0 0) 42px 40px/12px 42px,
  linear-gradient(currentColor 0 0) 33px 82px/30px 5px;
  background-repeat:no-repeat}
.ill--candle::after{inset:0;transform-origin:48px 36px;
  background:radial-gradient(ellipse 5px 9px at 48px 28px,currentColor 98%,transparent) no-repeat}

/* uusaasta — a burst, masked out of a repeating conic sweep */
.ill--burst::before{inset:12px;
  background:repeating-conic-gradient(from 0deg,currentColor 0 2.4deg,transparent 2.4deg 30deg);
  -webkit-mask:radial-gradient(circle,transparent 0 11px,#000 13px 33px,transparent 34px);
  mask:radial-gradient(circle,transparent 0 11px,#000 13px 33px,transparent 34px)}
.ill--burst{background:
  radial-gradient(circle 3px at 88px 16px,currentColor 98%,transparent),
  radial-gradient(circle 2px at 10px 78px,currentColor 98%,transparent);
  background-repeat:no-repeat}

/* lõpetamine — mortarboard and tassel */
.ill--cap::before{inset:0;background:currentColor;clip-path:polygon(48% 24%,94% 46%,48% 68%,2% 46%)}
.ill--cap::after{left:62%;top:52%;width:4px;height:28px;background:currentColor;border-radius:0 0 2px 2px}

/* isadepäev — hills and a low sun */
.ill--hill::before{inset:0;background:currentColor;
  clip-path:polygon(0 84%,27% 44%,48% 84%,63% 58%,100% 84%,100% 100%,0 100%)}
.ill--hill::after{inset:0;background:radial-gradient(circle 13px at 68px 28px,currentColor 98%,transparent) no-repeat}

/* bigger, on the seasonal block */
.ill--lg{width:138px;height:138px;right:-14px;bottom:-20px;transform:scale(1.44);transform-origin:100% 100%}

/* the same mark behind a page heading, in the occasion hue rather than in the
   text colour — here it sits on paper, not on a filled tile */
.ill--wm{color:color-mix(in srgb,var(--occ) 22%,transparent);right:-6px;top:-12px;bottom:auto;
  transform:scale(1.3);transform-origin:100% 0}
@media (min-width:780px){.ill--wm{transform:scale(1.7)}}

/* --- motion ----------------------------------------------------------------
   Each mark has one moving part and nothing else in the frame moves. WHO may
   move is the actual rule: the seasonal block and a page's single watermark
   animate on their own, because they are alone on screen; a tile in the grid
   moves only while hovered or keyboard-focused. Twenty-eight animating tiles is
   a fairground, so every tile starts paused and the running state travels down
   as one inherited custom property.

   A paused animation holds its 0% frame, and every 0% frame below is the mark's
   resting look, so switching motion off shifts nothing. Everything here is
   transform and opacity — no layout property is ever animated. */
.season .ill,.ill--wm{--play:running}
.occ:hover .ill,.occ:focus-within .ill{--play:running}

@keyframes lu-flicker{
  0%,100%{opacity:1;transform:scaleY(1)}
  30%{opacity:.72;transform:scaleY(.86)}
  55%{opacity:1;transform:scaleY(1.08)}
  78%{opacity:.84;transform:scaleY(.94)}
}
.ill--cake::after{animation:lu-flicker 2.6s ease-in-out infinite}

@keyframes lu-snow{
  0%{transform:translateY(-6px);opacity:0}
  18%{opacity:1}
  82%{opacity:1}
  100%{transform:translateY(16px);opacity:0}
}
.ill--tree::after{animation:lu-snow 7s linear infinite}

@keyframes lu-turn{0%,100%{transform:rotate(0deg)}50%{transform:rotate(9deg)}}
.ill--rings::after{animation:lu-turn 9s ease-in-out infinite}

@keyframes lu-beat{
  0%,100%{transform:scale(1)}
  8%{transform:scale(1.06)}
  16%{transform:scale(1)}
  24%{transform:scale(1.04)}
  32%{transform:scale(1)}
}
.ill--heart::before{animation:lu-beat 4.2s ease-in-out infinite}

@keyframes lu-spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}
.ill--flower{animation:lu-spin 64s linear infinite}

/* One breath in the flame, and nothing else. A page about grief may move; it
   may not perform. */
@keyframes lu-breathe{0%,100%{opacity:.9;transform:scale(1)}50%{opacity:1;transform:scale(1.05)}}
.ill--candle::after{animation:lu-breathe 5.5s ease-in-out infinite}

/* exactly one segment of the sweep, so the loop is seamless */
@keyframes lu-sweep{from{transform:rotate(0deg)}to{transform:rotate(30deg)}}
.ill--burst::before{animation:lu-sweep 11s linear infinite}

@keyframes lu-swing{0%,100%{transform:rotate(-7deg)}50%{transform:rotate(7deg)}}
.ill--cap::after{transform-origin:50% 0;animation:lu-swing 3.8s ease-in-out infinite}

@keyframes lu-rise{0%,100%{transform:translateY(3px)}50%{transform:translateY(-3px)}}
.ill--hill::after{animation:lu-rise 10s ease-in-out infinite}

/* Bind the running state LAST. Every rule above sets `animation` in shorthand
   form, and the shorthand resets animation-play-state to `running` — so this
   declaration only wins if it comes after all of them. Bound earlier, the gate
   silently does nothing and all twenty-eight tiles animate at once. */
.ill::before,.ill::after,.ill--flower{animation-play-state:var(--play)}
