/* Eesti AI-laulu auhind 2027: public page. Direction 3 "riba" (band).
   System fonts, one accent (cornflower blue, rukkilill, the national flower), light and dark.

   The idea: a soft colour band goes from edge to edge; the text always stays in one centred
   column of reading width (40rem, about 70 characters per line).
   - Every page: the header sits in the band, the footer sits in the same band.
   - Start page only: the band continues behind the title, the first lines and the opening date,
     so the front page has one clear "cover". Long pages keep only the header band, so the
     long text starts on a plain background and stays calm.
   - Long pages: the text column stays on the same centre line as the header; on wide screens
     the contents list sits in the empty left margin.
   Needs no HTML change. Works with body classes "lihtne" (short pages) and "dok" (long pages). */

:root {
  color-scheme: light dark;
  --paber: #ffffff;
  --paber-2: #f4f6f9;
  --riba: #eef2fb;            /* the band */
  --tint: #16191f;
  --tint-2: #545d6b;          /* 6.7:1 on paper, 5.9:1 on the band */
  --joon: #e0e4ea;
  --rukkilill: #2b4fae;
  --rukkilill-tume: #1d3a85;
  --lünk-taust: #ffeaa0;
  --lünk-tint: #3d2f00;
  --lünk-joon: #a07c00;
  --fookus: #2b4fae;

  --kiri: system-ui, -apple-system, "Segoe UI", Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --mõõt: 40rem;                            /* the one text column */
  --serv: clamp(1.125rem, 5vw, 2.5rem);     /* side margin: 18 px on a phone, up to 40 px */
}

@media (prefers-color-scheme: dark) {
  :root {
    --paber: #121418;
    --paber-2: #1a1d23;
    --riba: #1a2131;
    --tint: #e6e8ec;
    --tint-2: #a0a8b6;        /* 7.7:1 on paper, 6.7:1 on the band */
    --joon: #2b3039;
    --rukkilill: #a7bcf6;
    --rukkilill-tume: #cbd7fb;
    --lünk-taust: #4d3d00;
    --lünk-tint: #ffeaa6;
    --lünk-joon: #c9a227;
    --fookus: #a7bcf6;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; overflow-x: clip; }

body {
  margin: 0;
  background: var(--paber);
  color: var(--tint);
  font-family: var(--kiri);
  font-size: 1.0625rem;
  line-height: 1.62;
  overflow-wrap: break-word;
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 48rem) { body { font-size: 1.125rem; } }

p, li { text-wrap: pretty; }

/* ---------- links and focus ---------- */

a { color: var(--rukkilill); text-decoration-thickness: 1px; text-underline-offset: 0.2em; }
a:hover { color: var(--rukkilill-tume); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--fookus); outline-offset: 2px; border-radius: 2px; }
main:focus { outline: none; }

.vahele {
  position: absolute; left: 0.5rem; top: -4rem; z-index: 10;
  background: var(--paber); color: var(--rukkilill);
  padding: 0.6rem 1rem; border: 2px solid var(--rukkilill);
}
.vahele:focus { top: 0.5rem; }

/* ---------- one centred column for every part ---------- */

.päis-sisu, .leht, .dokument, .jalus-sisu {
  width: min(100% - 2 * var(--serv), var(--mõõt));
  margin-inline: auto;
}
.tekst { min-width: 0; }
main { padding-bottom: 4rem; }

/* ---------- header: in the band on every page ---------- */

.päis { background: var(--riba); }
.päis-sisu {
  padding: 1rem 0 0.25rem;
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 1.5rem;
}
.nimi {
  display: inline-block; padding: 0.5rem 0; margin-right: auto;
  font-weight: 700; font-size: 1rem; letter-spacing: -0.005em;
  color: var(--tint); text-decoration: none;
}
.nimi:hover { color: var(--rukkilill); }
.päis nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.2rem; }
.päis nav li { margin: 0; }
.päis nav a {
  display: inline-block; padding: 0.55rem 0; min-height: 2.75rem;
  color: var(--tint-2); text-decoration: none; font-size: 0.97rem;
  border-bottom: 2px solid transparent;
}
.päis nav a:hover { color: var(--tint); }
.päis nav a[aria-current="page"] { color: var(--tint); border-bottom-color: var(--rukkilill); }

/* ---------- text ---------- */

h1, h2, h3 { line-height: 1.2; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 1.35rem + 1.9vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; line-height: 1.12; margin: 2.5rem 0 1.25rem; }
h2 { font-size: 1.3rem; font-weight: 680; margin: 3rem 0 0.75rem; }
h3 { font-size: 1.1rem; font-weight: 680; margin: 2.25rem 0 0.5rem; }
h2, h3, [id] { scroll-margin-top: 1rem; }
mark.lunk[id] { scroll-margin-top: 5rem; }

/* section mark: a short accent line on the start page and short pages ... */
.lihtne h2::before {
  content: ""; display: block; width: 2rem; height: 3px; background: var(--rukkilill); margin-bottom: 0.9rem;
}
/* ... and a quiet hairline on long pages, where 20+ headings in a row would make the blue noisy */
.dok h2 { padding-top: 1.5rem; border-top: 1px solid var(--joon); }

p, ul, ol { margin: 0 0 1rem; }
ul, ol { padding-left: 1.35rem; }
li { margin: 0.35rem 0; }
li::marker { color: var(--tint-2); }
li > ul, li > ol { margin: 0.35rem 0 0.5rem; }
strong { font-weight: 650; }
hr { border: 0; border-top: 1px solid var(--joon); margin: 2rem 0; }

/* ---------- gaps: unfilled facts stay clearly visible ---------- */

mark.lunk {
  background: var(--lünk-taust); color: var(--lünk-tint);
  outline: 1px dashed var(--lünk-joon); outline-offset: 1px;
  padding: 0 0.2em; border-radius: 2px;
  -webkit-box-decoration-break: clone; box-decoration-break: clone;
}
.lunkade-teade {
  border-left: 3px solid var(--lünk-joon); background: var(--paber-2);
  padding: 0.75rem 1rem; margin: 0 0 2rem; font-size: 0.94em;
}
.lunkade-teade p { margin: 0; }

/* the note above a long page (privacy notice before the opening): the band colour, an accent edge */
.lehe-märkus {
  border-left: 3px solid var(--rukkilill); background: var(--riba);
  padding: 1rem 1.1rem 0.15rem; margin: 0 0 1.5rem; font-size: 0.97em;
}
.lehe-märkus .lehe-märkus-pealkiri { font-weight: 680; margin-bottom: 0.4rem; }

/* status line on short pages ("Praegu: ...") */
.olek { border-left: 3px solid var(--joon); padding: 0.1rem 0 0.1rem 0.9rem; color: var(--tint-2); }
.olek strong { color: var(--tint); }

.üles { margin-top: 3rem; font-size: 0.95em; }

/* ---------- contents list of long pages ---------- */

.sisukord ol { list-style: none; padding: 0; margin: 0; }
.sisukord ol ol { padding-left: 0.9rem; margin: 0.1rem 0 0.35rem; }
.sisukord li { margin: 0; }
.sisukord a { display: block; padding: 0.32rem 0; text-decoration: none; line-height: 1.35; }
.sisukord a:hover { text-decoration: underline; }

.sisukord-tekstis { border-block: 1px solid var(--joon); margin: 0 0 2.25rem; }
.sisukord-tekstis summary { cursor: pointer; padding: 0.7rem 0; min-height: 2.75rem; font-weight: 650; }
.sisukord-tekstis nav { padding: 0 0 0.9rem; font-size: 0.97em; }
.sisukord-kõrval { display: none; }
.sisukord-pealkiri {
  font-size: 0.8rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.08em;
  margin: 0 0 0.6rem; color: var(--tint-2);
}

/* wide screens: text on the same centre line as the header, contents list in the left margin */
@media (min-width: 72rem) {
  .dokument {
    width: 100%; padding-inline: var(--serv);
    display: grid; grid-template-columns: minmax(0, 1fr) var(--mõõt) minmax(0, 1fr); column-gap: 3rem;
  }
  .tekst { grid-column: 2; grid-row: 1; }
  .sisukord-kõrval {
    display: block; grid-column: 1; grid-row: 1; justify-self: end; width: min(100%, 15rem);
    position: sticky; top: 0; align-self: start; max-height: 100vh; overflow-y: auto; scrollbar-width: thin;
    padding: 2.75rem 0.25rem 2rem 0; font-size: 0.875rem;
  }
  .sisukord-kõrval a { color: var(--tint-2); }
  .sisukord-kõrval a:hover { color: var(--rukkilill); }
  .sisukord-tekstis { display: none; }
}

/* ---------- tables (stacked on a phone) ---------- */

.tabel { margin: 0 0 1.5rem; }
table { border-collapse: collapse; width: 100%; font-size: 0.96em; }
th, td { text-align: left; vertical-align: top; padding: 0.65rem 0.9rem 0.65rem 0; border-bottom: 1px solid var(--joon); }
th { font-weight: 650; color: var(--tint-2); font-size: 0.9em; }
td:first-child { font-weight: 600; }

@media (max-width: 40rem) {
  table, thead, tbody, tr, th, td { display: block; }
  thead tr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  tr { border-bottom: 1px solid var(--joon); padding: 0.7rem 0; }
  td { border: 0; padding: 0.1rem 0; }
  td::before {
    content: attr(data-label);
    content: attr(data-label) / "";
    display: block; font-size: 0.82em; font-weight: 400; color: var(--tint-2);
  }
  td:first-child::before { content: none; }
}

/* ---------- start page ---------- */

/* The band continues behind the first four blocks. It is painted edge to edge with border-image,
   so no wrapper element is needed; the 1px outset upwards closes any hairline seam between blocks. */
.leht-avaleht > :is(h1, .juhatus, .juhatus + p, .kutse) {
  margin: 0;
  border-image: linear-gradient(var(--riba), var(--riba)) fill 0 / / 1px 100vmax 0;
}
/* The title fits on one line from 48rem (768 px) up; on a phone it wraps into two even lines. */
.leht-avaleht > h1 { font-size: clamp(2.1rem, 1.3rem + 3.2vw, 2.85rem); padding: clamp(2rem, 6vw, 3.75rem) 0 1.1rem; }
.juhatus { font-size: 1.2em; line-height: 1.5; letter-spacing: -0.005em; }
.leht-avaleht > .juhatus { padding-bottom: 1rem; }
.leht-avaleht > .juhatus + p { padding-bottom: 1.5rem; }
.leht-avaleht > .kutse { padding-bottom: clamp(2.25rem, 6vw, 3.5rem); }

.kutse-pealkiri { margin: 0; font-weight: 680; font-size: 1.08em; line-height: 1.45; }
.kutse-pealkiri::before {
  content: ""; display: block; width: 2rem; height: 3px; background: var(--rukkilill); margin-bottom: 0.75rem;
}
/* open state: the button and the line under it */
.kutse > p:not(.kutse-pealkiri) { margin: 1rem 0 0; }
.kutse > p:last-child:not(:has(.nupp)) { font-size: 0.94em; }

.nupp {
  display: inline-block; min-height: 2.75rem; padding: 0.75rem 1.5rem;
  background: var(--rukkilill); color: var(--paber);
  font-weight: 650; font-size: 1.05em; line-height: 1.25; text-decoration: none; border-radius: 0.4rem;
}
.nupp:hover { background: var(--rukkilill-tume); color: var(--paber); }
.nupp:focus-visible { outline-offset: 3px; }

/* the three dates: a real sequence, drawn as a quiet timeline */
.kalender { list-style: none; padding: 0; margin: 0 0 1rem; }
.kalender li { position: relative; margin: 0 0 0 0.3rem; padding: 0 0 1.15rem 1.4rem; border-left: 1px solid var(--joon); }
.kalender li:last-child { border-left-color: transparent; padding-bottom: 0.2rem; }
.kalender li::before {
  content: ""; position: absolute; left: -0.3rem; top: 0.45rem;
  width: 0.6rem; height: 0.6rem; border-radius: 50%; background: var(--rukkilill);
}
.kalender .kuupäev { display: block; font-weight: 680; font-size: 1.1em; line-height: 1.3; letter-spacing: -0.01em; }
.kalender .mis { display: block; color: var(--tint-2); margin-top: 0.1rem; }

/* ways onward: one link per row, easy to tap; the arrow is not read aloud */
.edasi { list-style: none; padding: 0; margin: 0 0 1rem; }
.edasi li { margin: 0; border-bottom: 1px solid var(--joon); }
.edasi li:first-child { border-top: 1px solid var(--joon); }
.edasi a {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 2.75rem; padding: 0.75rem 0; font-weight: 560; text-decoration: none; color: var(--tint);
}
.edasi a::after { content: "→"; content: "→" / ""; color: var(--rukkilill); transition: transform 0.15s ease; }
.edasi a:hover { color: var(--rukkilill); }
.edasi a:hover::after { transform: translateX(0.2rem); }

/* ---------- footer: the same band ---------- */

.jalus { background: var(--riba); font-size: 0.9rem; color: var(--tint-2); }
.jalus-sisu { padding: 2rem 0 2.5rem; }
.jalus p { margin: 0 0 0.6rem; }
.jalus-nimi { font-weight: 680; color: var(--tint); }
.jalus-lingid { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 0 1.25rem; margin: 0.5rem 0 0.75rem; }
.jalus-lingid li { margin: 0; }
.jalus-lingid a { display: inline-block; min-height: 2.75rem; padding: 0.6rem 0; }

@media (prefers-reduced-motion: reduce) { *, *::after { transition: none !important; } }

@media print {
  .päis nav, .sisukord, .vahele, .üles, .jalus-lingid { display: none !important; }
  .päis, .jalus, .lehe-märkus { background: none; }
  .leht-avaleht > * { border-image: none; }
  .dokument { display: block !important; width: auto; padding: 0; }
  a { color: inherit; }
  mark.lunk { outline: 1px solid #000; }
}

/* ---------- start page: who organises (room for a small photo to the side) ---------- */
.korraldaja { margin: 0 0 1rem; }
.korraldaja-tekst > p:last-child { margin-bottom: 0; }
.korraldaja:has(.korraldaja-pilt) { display: grid; grid-template-columns: 5.5rem minmax(0, 1fr); gap: 0 1.1rem; align-items: start; }
.korraldaja-pilt { width: 5.5rem; height: 5.5rem; border-radius: 50%; object-fit: cover; }

/* ---------- start page: questions that open in place (details/summary, no script) ---------- */
.kkk { border-top: 1px solid var(--joon); margin: 0.5rem 0 1.25rem; }
.kkk details { border-bottom: 1px solid var(--joon); }
.kkk summary {
  list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 1rem;
  min-height: 2.75rem; padding: 0.65rem 0; font-weight: 600; color: var(--rukkilill);
}
.kkk summary::-webkit-details-marker { display: none; }
.kkk summary::after { content: "+"; flex: none; font-size: 1.35em; line-height: 1; font-weight: 400; width: 1em; text-align: center; }
.kkk details[open] > summary::after { content: "\2212"; }
.kkk summary:hover { text-decoration: underline; }
.kkk details > p { margin: 0 0 0.75rem; }
.kkk details > p:last-child { margin-bottom: 1rem; }

/* ---------- email entry page: the questions in a box that is easy to copy ---------- */
.peidus { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.kopeeri {
  display: block; width: 100%; height: 70vh; min-height: 20rem; box-sizing: border-box;
  font: inherit; font-size: 0.95em; line-height: 1.5; color: var(--tint); background: var(--paber);
  border: 1px solid var(--joon); border-radius: 0.4rem; padding: 0.75rem; white-space: pre-wrap; resize: vertical;
}
.kopeeri-abi { color: var(--tint-2); }
.kutse-teine { font-size: 0.94em; }
