/* Printable worksheets (radni-listovi/slovo-*.html): A4, two sheets per
   letter. Mostly outlines, so printing uses little ink; --panel (the
   letter's colour) is only an accent. */

@font-face {
  font-family: "Baloo 2";
  font-weight: 700 800;
  font-display: swap;
  src: url("../fonts/baloo2-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Baloo 2";
  font-weight: 700 800;
  font-display: swap;
  src: url("../fonts/baloo2-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Nunito";
  font-weight: 700 800;
  font-display: swap;
  src: url("../fonts/nunito-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Nunito";
  font-weight: 700 800;
  font-display: swap;
  src: url("../fonts/nunito-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@page { size: A4; margin: 0; }

:root {
  --ink: #3b2410;
  --soft: #8a6a4a;
  --line: #d9c7aa;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: #e9e1d4;
  color: var(--ink);
  font-family: "Nunito", system-ui, sans-serif;
  font-weight: 700;
  -webkit-print-color-adjust: exact;
  print-color-adjust: exact;
}

.ws-toolbar {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 10px 16px;
  background: #fffaf2;
  box-shadow: 0 2px 10px rgba(40, 25, 10, 0.15);
}
.ws-toolbar a { color: var(--ink); font-weight: 800; }
.ws-toolbar button {
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--panel);
  color: #fff;
  font: 800 16px "Baloo 2", sans-serif;
  cursor: pointer;
}

.ws-sheet {
  position: relative;
  width: 210mm;
  height: 297mm;
  margin: 10mm auto;
  padding: 11mm 13mm 18mm;
  background: #fff;
  box-shadow: 0 4px 24px rgba(40, 25, 10, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 3.2mm;
}

@media print {
  body { background: #fff; }
  .ws-toolbar { display: none; }
  .ws-sheet { margin: 0; box-shadow: none; break-after: page; }
}

/* ---------- Header ---------- */
.ws-head {
  display: grid;
  grid-template-columns: 40mm 1fr 30mm;
  align-items: center;
  gap: 5mm;
  padding-bottom: 3mm;
  border-bottom: 1mm solid color-mix(in srgb, var(--panel) 35%, #fff);
}
.ws-logo { width: 40mm; height: auto; }
.ws-title h1 { margin: 0; font: 800 15mm/1 "Baloo 2", sans-serif; color: var(--panel); }
.ws-title p { margin: 1mm 0 0; font-size: 3.2mm; color: var(--soft); }
.ws-pic { margin: 0; display: grid; justify-items: center; gap: 1mm; }
.ws-pic img { width: 26mm; height: 26mm; object-fit: cover; border-radius: 50%; border: 1mm solid color-mix(in srgb, var(--panel) 40%, #fff); }
.ws-pic figcaption { font: 800 4.2mm "Baloo 2", sans-serif; }

.ws-h2 { display: flex; align-items: center; gap: 2.5mm; margin: 1.5mm 0 0; font: 800 5mm/1.2 "Baloo 2", sans-serif; }
.ws-h2 span {
  display: grid;
  place-items: center;
  flex: none;
  width: 7mm;
  height: 7mm;
  border-radius: 50%;
  background: var(--panel);
  color: #fff;
  font-size: 4mm;
}

/* ---------- Letters (js/worksheet.js) ---------- */
.ws-guides { display: grid; grid-template-columns: 1fr 1fr; gap: 8mm; }
.ws-guide svg { display: block; width: 100%; height: 56mm; }
.ws-row svg { display: block; width: 100%; height: auto; }
.ws-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 4mm; }
.ws-pair .ws-row:first-child svg, .ws-pair .ws-row:last-child svg { width: 100%; }

.ws-lines line { stroke: var(--line); stroke-width: 0.9; }
.ws-lines line:nth-child(2) { stroke-dasharray: 4 4; }
.ws-lines line.is-base { stroke: #b49a76; stroke-width: 1.4; }

.ws-glyph path { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.ws-glyph--guide path { stroke: color-mix(in srgb, var(--panel) 22%, #fff); stroke-width: 13; }
.ws-glyph--centre path { stroke: color-mix(in srgb, var(--panel) 80%, #3b2410); stroke-width: 1.6; stroke-dasharray: 0.1 4.2; }
.ws-glyph--solid path { stroke: #c9b8a0; stroke-width: 7; }
.ws-glyph--dashed path { stroke: #9e8667; stroke-width: 2; stroke-dasharray: 0.1 5; }

.ws-dot { fill: var(--panel); }
.ws-num { font: 800 8px "Baloo 2", sans-serif; text-anchor: middle; fill: #fff; }
.ws-arrow { fill: none; stroke: var(--panel); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Page 2 ---------- */
.ws-copy { display: grid; gap: 1mm; }
.ws-copy__model { margin: 1mm 0 0; font: 800 9mm/1.1 "Baloo 2", sans-serif; color: var(--panel); }
.ws-copy__model--sentence { font-size: 6.5mm; margin-top: 3mm; }
.ws-line { height: 11mm; border-bottom: 0.6mm solid #b49a76; background: linear-gradient(transparent calc(50% - 0.2mm), var(--line) calc(50% - 0.2mm), var(--line) calc(50% + 0.2mm), transparent calc(50% + 0.2mm)); background-size: 4mm 100%; }

.ws-sounds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.ws-sound { display: grid; justify-items: center; gap: 1.5mm; padding: 3mm 2mm; border: 0.6mm solid var(--line); border-radius: 4mm; }
.ws-sound strong { font: 800 8mm "Baloo 2", sans-serif; }
.ws-sound span { font-size: 6.5mm; letter-spacing: 0.4mm; white-space: nowrap; color: #b49a76; }

.ws-naslovo { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4mm; }
.ws-box { display: grid; align-content: space-between; height: 36mm; padding: 3mm; border: 0.6mm dashed #b49a76; border-radius: 4mm; }
.ws-box strong { font: 800 4.6mm "Baloo 2", sans-serif; color: var(--panel); }
.ws-box span { font: 800 6mm "Baloo 2", sans-serif; color: var(--soft); }

.ws-colour { flex: 1; display: grid; place-items: center; min-height: 0; margin-bottom: 2mm; border: 0.6mm solid var(--line); border-radius: 5mm; overflow: hidden; }
.ws-colour__letter {
  font: 800 42mm/1 "Baloo 2", sans-serif;
  padding: 6mm 0 1mm;
  color: #fff;
  -webkit-text-stroke: 0.7mm var(--ink);
  paint-order: stroke fill;
}

.ws-foot {
  position: absolute;
  left: 13mm;
  right: 13mm;
  bottom: 7mm;
  display: flex;
  justify-content: space-between;
  gap: 4mm;
  font-size: 3mm;
  color: var(--soft);
}

/* ?preview (tools/build-worksheets.sh): the first sheet only, flush. */
.is-preview body { background: #fff; }
.is-preview .ws-toolbar { display: none; }
.is-preview .ws-sheet { margin: 0; box-shadow: none; }

/* ---------- Radni list dana (functions/_lib/daily-sheet.js) ---------- */
.wd-toolbar { flex-wrap: wrap; }
.wd-levels { display: flex; gap: 6px; }
.wd-levels a {
  padding: 8px 14px;
  border: 2px solid color-mix(in srgb, var(--panel) 40%, #fff);
  border-radius: 999px;
  color: var(--ink);
  font: 800 15px "Baloo 2", sans-serif;
  text-decoration: none;
}
.wd-levels a[aria-current="page"] { background: var(--panel); border-color: var(--panel); color: #fff; }
.wd-days { display: flex; align-items: center; gap: 10px; font-weight: 800; }
.wd-days a, .wd-days__off { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: #fff; border: 2px solid #e8dccb; color: var(--ink); font: 800 20px "Baloo 2", sans-serif; text-decoration: none; }
.wd-days__off { opacity: 0.35; }

.wd-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 2.5mm; }
.wd-grid span { display: grid; place-items: center; height: 13mm; border: 0.5mm solid var(--line); border-radius: 3mm; font: 800 8mm "Baloo 2", sans-serif; }

.wd-connect { display: flex; justify-content: space-around; padding: 0 20mm; }
.wd-connect > div { display: grid; gap: 4mm; }
.wd-connect span { display: flex; align-items: center; gap: 4mm; font: 800 11mm/1 "Baloo 2", sans-serif; }
.wd-connect i { display: block; width: 3.5mm; height: 3.5mm; border-radius: 50%; background: var(--panel); }

.wd-words { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5mm 6mm; }
.wd-words span { display: flex; align-items: flex-end; font: 800 9mm/1 "Baloo 2", sans-serif; letter-spacing: 0.5mm; }
.wd-box {
  display: inline-block;
  width: 8mm;
  height: 9.5mm;
  margin: 0 0.6mm;
  border: 0.6mm solid var(--panel);
  border-radius: 1.6mm;
  background: #fff;
  vertical-align: bottom;
}

.wd-scrambles { display: grid; grid-template-columns: 1fr 1fr; gap: 5mm 8mm; }
.wd-scramble { display: grid; gap: 2.5mm; }
.wd-tiles { display: flex; gap: 1.5mm; }
.wd-tiles b {
  display: grid;
  place-items: center;
  width: 9mm;
  height: 9mm;
  border-radius: 2mm;
  background: color-mix(in srgb, var(--panel) 18%, #fff);
  font: 800 6.5mm "Baloo 2", sans-serif;
}
.wd-answer { display: flex; }

.wd-sentence { margin: 2mm 0 0; font: 800 10mm/1.3 "Baloo 2", sans-serif; letter-spacing: 0.4mm; }
.wd-count { margin: 0; display: flex; align-items: center; gap: 3mm; font: 800 5mm "Baloo 2", sans-serif; }

@media print { .wd-toolbar { display: none; } }
/* The daily sheet has one page for everything: a little more compact. */
.wd-sheet { gap: 2.6mm; }
.wd-sheet .ws-box { height: 27mm; }
.wd-sheet .ws-copy__model { font-size: 8mm; }
.wd-sheet .ws-line { height: 9mm; }
.wd-sheet .ws-sound { padding: 2mm; }

/* ---------- Phones and small tablets ---------- */
@media screen and (max-width: 820px) {
  .ws-sheet { margin: 8px auto; }
  .ws-toolbar { display: grid; grid-template-columns: 1fr auto; gap: 8px 10px; padding: 10px 12px; }
  .ws-toolbar > a { font-size: 15px; }
  .ws-toolbar button { padding: 8px 16px; font-size: 15px; }
  .wd-levels { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(3, 1fr); }
  .wd-levels a { padding: 8px 4px; text-align: center; font-size: 14px; }
  .wd-days { grid-column: 1 / -1; justify-content: center; }
  /* Toolbar order: back + print, levels, date. */
  .wd-toolbar > a { order: 1; }
  .wd-toolbar > button { order: 2; }
  .wd-toolbar .wd-levels { order: 3; }
  .wd-toolbar .wd-days { order: 4; }
}
@media print { .ws-sheet { zoom: 1 !important; } }

/* ---------- Site top bar on the sheets (css/style.css .book-bar) ---------- */
html:has(body.page-ws) { height: auto; }
body.page-ws {
  height: auto;
  min-height: 100%;
  overflow: auto;
  color: var(--ink);
  background: #e9e1d4;
  font-family: "Nunito", system-ui, sans-serif;
  padding-top: calc(var(--bar-h, 60px) + env(safe-area-inset-top));
}
body.page-ws .ws-toolbar { top: calc(var(--bar-h, 60px) + env(safe-area-inset-top)); }
@media print {
  body.page-ws { padding-top: 0; background: #fff; }
  body.page-ws .book-bar, .letters, .letters-soon, .consent { display: none !important; }
}

/* "Svaki dan novi radni list!" above the daily sheet (screen only). */
.wd-news {
  display: grid;
  justify-items: center;
  gap: 2px;
  width: min(210mm, calc(100% - 16px));
  margin: 12px auto 0;
  padding: 12px 16px;
  border-radius: 18px;
  background: var(--panel);
  color: #fff;
  text-align: center;
  box-shadow: 0 4px 0 color-mix(in srgb, var(--panel) 55%, #2a1a0c);
}
.wd-news strong { font: 800 22px/1.15 "Baloo 2", sans-serif; }
.wd-news span { font-size: 15px; }
.wd-news b { font-weight: 800; }
.wd-news small { font-size: 12px; opacity: 0.9; }
.wd-news a { color: #fff; font-weight: 800; }
.wd-news--old { background: #fff; color: var(--ink); box-shadow: 0 4px 0 #e0d2bd; }
.wd-news--old a { color: color-mix(in srgb, var(--panel) 75%, #3b2410); }
@media print { .wd-news { display: none; } }
/* ?preview (tools/build-worksheets.sh): the sheet only, no site bar. */
.is-preview body.page-ws { padding-top: 0; background: #fff; }
.is-preview .book-bar, .is-preview .consent { display: none !important; }

/* ---------- Toolbar: [Radni listovi] · date · [Ispiši], then the levels ---------- */
.ws-toolbar .ws-back {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  border-radius: 999px;
  background: #1f9e9a;
  color: #fff;
  font: 800 15px "Baloo 2", sans-serif;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 3px 0 #12605d;
}
.ws-toolbar .ws-back:hover { background: #1a8986; }
.ws-toolbar button { white-space: nowrap; box-shadow: 0 3px 0 color-mix(in srgb, var(--panel) 55%, #2a1a0c); }
.wd-toolbar {
  display: grid !important;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px 12px;
}
.wd-toolbar .ws-back { justify-self: start; order: 0; }
.wd-toolbar .wd-days { justify-self: center; grid-column: 2; order: 0; }
.wd-toolbar > button { justify-self: end; grid-column: 3; order: 0; }
.wd-toolbar .wd-levels { grid-column: 1 / -1; justify-self: center; order: 0; display: flex; gap: 8px; }
@media screen and (max-width: 820px) {
  .wd-toolbar { grid-template-columns: auto 1fr auto; padding: 10px; gap: 8px; }
  .wd-toolbar .ws-back { padding: 0 12px; font-size: 14px; min-height: 38px; }
  .wd-toolbar > button { padding: 8px 12px; font-size: 14px; }
  .wd-toolbar .wd-days { gap: 6px; font-size: 14px; }
  .wd-toolbar .wd-days a, .wd-toolbar .wd-days__off { width: 30px; height: 30px; font-size: 18px; }
  .wd-toolbar .wd-levels { display: grid; grid-template-columns: repeat(3, 1fr); width: 100%; }
}
@media screen and (max-width: 400px) {
  .wd-toolbar .ws-back { font-size: 0; padding: 0 12px; }
  .wd-toolbar .ws-back::after { content: "Listovi"; font-size: 14px; }
}

.wd-date { white-space: nowrap; }
.wd-date__short { display: none; }
@media screen and (max-width: 520px) {
  .wd-date__long { display: none; }
  .wd-date__short { display: inline; }
}

/* Tabs on the fixed sheets: Cijeli list · Početnik · Srednji · Napredni */
.ws-toolbar:not(.wd-toolbar) { flex-wrap: wrap; }
.ws-tabs { display: flex; flex-wrap: wrap; gap: 6px; }
@media screen and (max-width: 820px) {
  .ws-toolbar:not(.wd-toolbar) .ws-tabs { order: 3; grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); }
  .ws-toolbar:not(.wd-toolbar) .ws-tabs a { padding: 8px 2px; font-size: 13px; text-align: center; }
}
