/* ==========================================================================
   Deníček Daisy – vzhled odvozený z ilustrací pejska
   Barvy jsou vzaté ze srsti, očí a červeného postroje na obrázcích. Všechno
   podstatné je v proměnných hned níže (světlý a noční režim).
   ========================================================================== */

/* --- Písma ---------------------------------------------------------------
   Stejná jako na plavacek.net: Fraunces (nadpisy) a Atkinson Hyperlegible
   Next (text), obě pod licencí SIL OFL (texty licencí jsou ve složce fonts).
   Adresy jsou relativní k tomuto souboru, takže fungují v kořeni i v podsložce.
   ------------------------------------------------------------------------ */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff") format("woff");
  font-weight: 400 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson.woff2") format("woff2");
  font-weight: 200 800; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next";
  src: url("fonts/atkinson-italic.woff2") format("woff2");
  font-weight: 200 800; font-style: italic; font-display: swap;
}

:root {
  --font-head: "Fraunces", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
  --font-body: "Atkinson Hyperlegible Next", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;

  color-scheme: light dark;

  --bg: #fcf6ea;            /* krémová jako srst */
  --band: #f3e6cc;          /* béžový pás */
  --surface: #ffffff;
  --text: #2e1d14;          /* tmavě hnědá jako čumáček */
  --muted: #6b5344;
  --line: #e3d2b0;

  --head: #4a2b1b;          /* čokoládová (hlavička, patička) */
  --on-head: #fff7e8;
  --accent: #f4bf72;        /* karamelová (aktivní odkaz v nabídce) */
  --on-accent: #2e1d14;

  --amber: #f2b052;         /* hlavní tlačítka: skvrny na srsti */
  --amber-hover: #f7c675;
  --on-amber: #2e1d14;
  --btn-border: #2e1d14;
  --ink2: #2e1d14;          /* okraj světlých tlačítek */

  --red: #b3342b;           /* červený postroj */
  --on-red: #ffffff;
  --red-hover: #8f2720;
  --title: #8f2a1f;         /* nadpisy karet a odkazy v kartách */

  --strap: #b8312a;         /* popruh pod hlavičkou */
  --webbing: #6c6a72;       /* šedý lem popruhu a přezka */
  --stitch: rgb(255 240 220 / .8);

  --link: #a3301f;
  --link-hover: #6f1d12;
  --em: #7d4a00;            /* kurzíva v textu: tmavý karamel */
  --hover-bg: #ffe3a8;      /* zvýraznění odkazu při najetí */
  --focus: #4a2b1b;
  --pill-bg: #4a2b1b;       /* aktivní stránkování */
  --pill-fg: #ffffff;
  --chart: #a3301f;
  --mark: #ffeab0;

  --radius: .9rem;
  --shadow: 0 1px 2px rgb(46 29 20 / .08), 0 8px 22px rgb(46 29 20 / .08);
  --zoom-bg: rgb(255 255 255 / .88);
  --container: 54rem;
  --measure: 40rem;
}

/* noční režim: podle systému, přepínač v hlavičce má přednost */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1b110b; --band: #251810; --surface: #2e1e14; --text: #f6ebda; --muted: #cdb8a0; --line: #4b3524;
    --head: #3b2316;
    --btn-border: #f6c982; --ink2: #f6ebda;
    --red-hover: #9a2a22;
    --title: #ffb59a;
    --link: #ffbe73; --link-hover: #ffe0b0; --focus: #ffd27a; --hover-bg: #5a3a14; --em: #f4bf72;
    --pill-bg: #f4bf72; --pill-fg: #2e1d14; --chart: #f4bf72; --mark: #5a4310;
    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 22px rgb(0 0 0 / .3);
    --zoom-bg: rgb(27 17 11 / .85);
  }
}
:root[data-theme="dark"] {
  --bg: #1b110b; --band: #251810; --surface: #2e1e14; --text: #f6ebda; --muted: #cdb8a0; --line: #4b3524;
  --head: #3b2316;
  --btn-border: #f6c982; --ink2: #f6ebda;
  --red-hover: #9a2a22;
  --title: #ffb59a;
  --link: #ffbe73; --link-hover: #ffe0b0; --focus: #ffd27a; --hover-bg: #5a3a14; --em: #f4bf72;
  --pill-bg: #f4bf72; --pill-fg: #2e1d14; --chart: #f4bf72; --mark: #5a4310;
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 22px rgb(0 0 0 / .3);
  --zoom-bg: rgb(27 17 11 / .85);
  color-scheme: dark;
}
:root[data-theme="light"] { color-scheme: light; }

/* ---------- základ ---------- */

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 1.0625rem/1.65 var(--font-body);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; padding-block: 1.5rem 3.5rem; outline: none; }

img, video, iframe { max-width: 100%; }
img { height: auto; }

a { color: var(--link); text-underline-offset: .18em; }
a:hover { color: var(--link-hover); }
/* výrazné najetí na textové odkazy: barevné podbarvení + tlustší podtržení (tlačítka a ikony mají vlastní styl) */
a:where(:not(.btn, .zoom, .to-top, .skip, .logo)):hover {
  background: var(--hover-bg); border-radius: .2em; text-decoration-thickness: .15em;
  box-shadow: 0 0 0 .14em var(--hover-bg);
}

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 4px; }
.site-header :focus-visible, .foot-band :focus-visible { outline-color: #fff; }

.vh {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}

.skip {
  position: absolute; left: .5rem; top: -4rem; z-index: 100;
  background: var(--amber); color: var(--on-amber); border: 2px solid var(--btn-border);
  padding: .6rem 1rem; border-radius: 2rem; font-weight: 700;
}
.skip:focus { top: .5rem; }

.wrap { width: min(100% - 2rem, var(--container)); margin-inline: auto; }

/* odkazy na jiné weby: šipka */
a.ext::after { content: "\00a0\2197"; font-size: .85em; text-decoration: none; display: inline-block; }

h1, h2, h3 { font-family: var(--font-head); }

/* ---------- hlavička: čokoládová, s popruhem od postroje a vykukujícími pejsky ---------- */

:root {
  --paw: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 11.2c-2.9 0-5.6 3.2-5.6 6 0 1.9 1.3 2.8 2.9 2.8 1 0 1.8-.5 2.7-.5s1.7.5 2.7.5c1.6 0 2.9-.9 2.9-2.8 0-2.8-2.7-6-5.6-6z'/%3E%3Cellipse cx='5' cy='10' rx='2.1' ry='2.8' transform='rotate(-20 5 10)'/%3E%3Cellipse cx='9.3' cy='5.3' rx='2.2' ry='3'/%3E%3Cellipse cx='14.7' cy='5.3' rx='2.2' ry='3'/%3E%3Cellipse cx='19' cy='10' rx='2.1' ry='2.8' transform='rotate(20 19 10)'/%3E%3C/svg%3E");
  --strap-h: 1.15rem;
}

.site-header {
  position: relative;
  background: var(--head);
  color: var(--on-head);
  padding: 1.1rem 0 0;
  overflow: hidden;
}
.head-inner {
  position: relative;
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  padding-bottom: 3.3rem;
  display: flex; flex-direction: column; gap: .8rem;
}
.brand-block { display: flex; align-items: center; gap: 1rem 1.1rem; }
/* logo je stejně vysoké jako název + podtitulek; výšku doměří blog.js (--logo-h), bez JS zůstane pevná velikost */
.logo { flex: none; display: block; line-height: 0; border-radius: 50%; }
.logo img { display: block; width: var(--logo-h, 4.5rem); height: var(--logo-h, 4.5rem); }
.brand { margin: 0; font: 700 clamp(2rem, 6vw, 2.9rem)/1.1 var(--font-head); letter-spacing: -.01em; }
.brand a { color: inherit; text-decoration: none; }
.brand a:hover { text-decoration: underline; text-decoration-thickness: .08em; color: inherit; background: none; box-shadow: none; }
.tagline { margin: .15rem 0 0; font-size: 1.02rem; opacity: .94; max-width: 30rem; }

.main-nav ul { list-style: none; margin: .2rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; align-items: center; }
.main-nav .nav-end { margin-left: auto; }
.main-nav a, .theme-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .35rem .9rem; border-radius: 2rem; border: 2px solid transparent;
  color: var(--on-head); text-decoration: none; font: 700 .95rem/1.3 var(--font-body); background: none; cursor: pointer;
}
.main-nav a:hover, .theme-toggle:hover { background: rgb(255 255 255 / .22); color: var(--on-head); box-shadow: none; text-decoration: underline; text-decoration-thickness: .12em; }
.main-nav a[aria-current="page"] { background: var(--accent); color: var(--on-accent); }
.theme-toggle { border-color: var(--accent); }
.theme-toggle svg { width: 1.1rem; height: 1.1rem; fill: currentColor; }
.theme-toggle .i-sun { display: none; }
.theme-toggle[data-dark] .i-sun { display: block; }
.theme-toggle[data-dark] .i-moon { display: none; }

/* popruh: červená textilie, šedý lem, prošívání a přezka – jako postroj na obrázcích */
.strap {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--strap-h); z-index: 3;
  box-sizing: border-box; background: var(--strap); border-block: .2rem solid var(--webbing);
}
.strap::before {
  content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 2px dashed var(--stitch); transform: translateY(-1px);
}
.buckle {
  position: absolute; top: 50%; left: max(1rem, calc((100% - var(--container)) / 2)); transform: translateY(-50%);
  width: 3.1rem; height: 1.8rem; box-sizing: border-box; border-radius: .4rem;
  background: var(--webbing); border: .22rem solid #8d8b94; box-shadow: 0 0 0 2px #46444b;
}
.buckle::before { content: ""; position: absolute; inset: .18rem .4rem; border-radius: .2rem; background: var(--strap); }
.buckle::after { content: ""; position: absolute; left: 50%; top: -.1rem; bottom: -.1rem; width: .3rem; margin-left: -.15rem; background: #8d8b94; border-radius: .1rem; }

/* Daisy vykukuje přes popruh a dívá se na nadpis */
.head-dog { display: none; }

/* stopy, které se po hlavičce pomalu objevují zleva doprava */
.paws { position: absolute; inset: 0 0 var(--strap-h) 0; pointer-events: none; overflow: hidden; }
.paws span {
  position: absolute; bottom: 1.45rem; width: 1rem; height: 1rem; background: var(--on-head); opacity: 0;
  -webkit-mask: var(--paw) center / contain no-repeat; mask: var(--paw) center / contain no-repeat;
  transform: rotate(90deg); animation: step 2s ease-in-out 1 both;
}
.paws span:nth-child(even) { bottom: 2.15rem; }
.paws span:nth-child(1) { left: 3%; }
.paws span:nth-child(2) { left: 12%; animation-delay: 0.3s; }
.paws span:nth-child(3) { left: 21%; animation-delay: 0.6s; }
.paws span:nth-child(4) { left: 30%; animation-delay: 0.9s; }
.paws span:nth-child(5) { left: 39%; animation-delay: 1.2s; }
.paws span:nth-child(6) { left: 48%; animation-delay: 1.5s; }
.paws span:nth-child(7) { left: 57%; animation-delay: 1.8s; }
.paws span:nth-child(8) { left: 66%; animation-delay: 2.1s; }
@keyframes step { 0% { opacity: 0; } 20% { opacity: .28; } 60% { opacity: .28; } 100% { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .paws { display: none; } html { scroll-behavior: auto; } }

/* širší displej: Daisy vpravo, logo s hlavou vlevo už není potřeba */
@media (min-width: 40rem) {
  .head-inner { min-height: 13rem; padding-right: 11.5rem; }
  .logo { display: none; }
  .head-dog {
    display: block; position: absolute; right: .5rem; bottom: calc(var(--strap-h) - .35rem); z-index: 1;
    height: 12.4rem; width: auto; max-width: none;
  }
}

@media (max-width: 40rem) {
  .logo img { width: min(var(--logo-h, 4.5rem), 5rem); height: min(var(--logo-h, 4.5rem), 5rem); }
  .theme-toggle { width: 2.8rem; height: 2.8rem; padding: 0; justify-content: center; }
  .theme-toggle [data-theme-label] {   /* na mobilu jen ikona, text čtou čtečky dál */
    position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap;
  }
}

/* ---------- výpisy ---------- */

.page-title { font: 700 clamp(1.7rem, 4.5vw, 2.3rem)/1.2 var(--font-head); margin: .4rem 0 .5rem; }
.lead { font-size: 1.15rem; color: var(--muted); margin-top: 0; }
.empty { color: var(--muted); }

.cards { display: grid; gap: 1.2rem; margin-top: 1rem; }

.card {
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--strap);
  border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden;
}
.card.has-img { display: grid; grid-template-columns: 11rem 1fr; }
.card-img { display: block; background: var(--line); }
.card-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-body { padding: 1.05rem 1.35rem 1.2rem; min-width: 0; }
.card h2 { font: 700 1.5rem/1.25 var(--font-head); margin: 0 0 .25rem; }
.card h2 a { color: var(--title); text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .18em; }
.card h2 a:hover { color: var(--title); }
.meta { margin: 0 0 .6rem; color: var(--muted); font-size: .92rem; }
.excerpt { margin: 0 0 .6rem; }
.more-row { text-align: right; }
.more { font-weight: 700; }

@media (max-width: 36rem) {
  .card.has-img { grid-template-columns: 1fr; }
  .card-img img { aspect-ratio: 16 / 7; }
}

.tags, .tag-cloud { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: .4rem; }
.tags a, .tag-cloud a {
  display: inline-block; padding: .15rem .75rem; border-radius: 2rem; font-size: .9rem;
  border: 1px solid var(--line); background: var(--bg); text-decoration: none;
}
.tags a:hover, .tag-cloud a:hover { border-color: var(--ink2); background: var(--amber); color: var(--on-amber); }
.tag-cloud a { font-size: 1.05rem; padding: .3rem .95rem; }
.count { color: var(--muted); font-size: .85em; }

.pager ul { list-style: none; display: flex; flex-wrap: wrap; justify-content: center; gap: .4rem; padding: 0; margin: 2rem 0 0; align-items: center; }
/* čísla stránek jsou přesné kruhy (stejná šířka i výška), Novější/Starší jsou kapsle stejné výšky */
.pager a {
  display: inline-flex; align-items: center; justify-content: center; box-sizing: border-box;
  height: 2.75rem; min-width: 2.75rem; padding: 0 .4rem; border-radius: 2rem; line-height: 1; gap: .35rem;
  background: var(--surface); border: 2px solid var(--ink2); color: var(--text); text-decoration: none; font-weight: 700;
}
.pager a[rel] { padding: 0 1.1rem; }
.pager a:hover { background: var(--amber); color: var(--on-amber); }
.pager a[aria-current="page"] { background: var(--pill-bg); color: var(--pill-fg); border-color: var(--pill-bg); }

/* ---------- příspěvek ---------- */

.post-head h1 { font: 700 clamp(1.9rem, 5vw, 2.7rem)/1.15 var(--font-head); margin: .5rem 0 .35rem; max-width: var(--measure); }

.entry { max-width: var(--measure); overflow-wrap: break-word; }
.card .entry { max-width: none; }
.entry > :first-child { margin-top: 0; }
.entry p { margin: 0 0 1.1em; }
.entry h2, .entry h3, .entry h4 { line-height: 1.25; margin: 1.8em 0 .5em; color: var(--text); }
.entry h2 { font-size: 1.6rem; } .entry h3 { font-size: 1.3rem; } .entry h4 { font: 700 1.1rem var(--font-body); }
.entry ul, .entry ol { padding-left: 1.5rem; margin: 0 0 1.1em; }
.entry li { margin-bottom: .3em; }
.entry blockquote {
  margin: 1.4em 0; padding: .3em 1.2em; border-left: .35rem solid var(--amber);
  background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0; font-style: italic;
}
.entry blockquote p:last-child { margin-bottom: 0; }
.entry figure { margin: 1.5em 0; text-align: center; }
.entry figcaption { font: italic .92rem/1.4 var(--font-body); color: var(--muted); margin-top: .4rem; }
.entry img { border-radius: .6rem; }
.entry em, .entry i, .entry cite { color: var(--em); }
.entry a { overflow-wrap: anywhere; }
.entry hr {
  border: 0; width: 9rem; height: 1.1rem; margin: 2em auto; background: var(--muted); opacity: .6;
  -webkit-mask: var(--paw) 0 0 / 1.1rem 1.1rem space no-repeat; mask: var(--paw) 0 0 / 1.1rem 1.1rem space no-repeat;
}
.entry pre, .entry code { font: .92em/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.entry code { background: var(--surface); border: 1px solid var(--line); padding: .05em .35em; border-radius: .3rem; }
.entry pre { background: var(--surface); border: 1px solid var(--line); padding: 1rem; border-radius: var(--radius); overflow-x: auto; }
.entry pre code { background: none; border: 0; padding: 0; }
.entry table { border-collapse: collapse; max-width: 100%; display: block; overflow-x: auto; }
.entry th, .entry td { border: 1px solid var(--line); padding: .4rem .7rem; }
.entry iframe, .entry video { border: 0; }
.entry iframe { aspect-ratio: 16 / 9; width: 100%; height: auto; }
.entry img { max-width: 100%; height: auto; }
.entry { display: flow-root; }   /* plovoucí obrázky nepřetečou za konec příspěvku */

/* --- Video v textu: na celou šířku sloupce, bez automatického spuštění --- */
.entry figure.video {
  clear: both; box-sizing: border-box; max-width: 100%; margin: 1.5rem auto; padding: .7rem .7rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 18px rgb(14 42 61 / .12); text-align: left;
}
.entry figure.video video { display: block; width: 100%; height: auto; max-height: 80vh; border-radius: 8px; background: #1d120c; }
.entry figure.video figcaption { margin: .7rem 0 0; font: italic 1rem/1.4 var(--font-body); color: var(--muted); }

/* --- Obrázky v textu: plavou vpravo v rámečku jako na plavacek.net, s lupou --- */
.entry .pic {
  float: right; clear: right; box-sizing: border-box;
  width: min(var(--w, 22rem), 50%); margin: .3rem 0 1rem 1.5rem; padding: .7rem .7rem 1rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: 0 6px 18px rgb(14 42 61 / .12); text-align: left;
}
.entry .pic:not(:has(figcaption)) { padding-bottom: .7rem; }
.entry .pic a.zoom { position: relative; display: block; line-height: 0; cursor: zoom-in; border-radius: 8px; }
.entry .pic a.zoom:focus-visible { outline-offset: -4px; }
.entry .pic img { display: block; width: 100%; height: auto; border-radius: 8px; }
.entry .pic figcaption { margin: .7rem 0 0; font: italic 1rem/1.4 var(--font-body); color: var(--muted); }
/* lupa v rohu: kulatá, jako tlačítka na plavacek.net */
.entry .pic a.zoom::before, .entry .pic a.zoom::after { content: ""; position: absolute; right: .6rem; bottom: .6rem; width: 44px; height: 44px; border-radius: 50%; pointer-events: none; }
.entry .pic a.zoom::before { background: var(--zoom-bg); border: 2px solid var(--text); transition: background-color .15s ease; }
.entry .pic a.zoom::after {
  background: var(--text);
  -webkit-mask: var(--lupa) center / 58% no-repeat; mask: var(--lupa) center / 58% no-repeat;
  --lupa: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21M10.5 7.5v6M7.5 10.5h6'/%3E%3C/svg%3E");
}
.entry .pic a.zoom:hover::before, .entry .pic a.zoom:focus-visible::before { background: var(--amber); border-color: #2e1d14; }
.entry .pic a.zoom:hover::after, .entry .pic a.zoom:focus-visible::after { background: #2e1d14; }
@media (max-width: 38rem) {
  .entry .pic { float: none; width: min(var(--w, 100%), 100%); margin: 1.2rem auto; }
}

/* --- Okno s velkým obrázkem (vzhled jako na plavacek.net) ---------------- */
html.lb-open { overflow: hidden; }
dialog.lightbox {
  border: 0; padding: 0; background: transparent; color: var(--text); overflow: visible;
  max-width: none; max-height: none; width: fit-content; margin: auto;
}
dialog.lightbox::backdrop { background: rgb(4 12 20 / .84); }
.lb-frame {
  box-sizing: border-box; background: var(--surface); padding: .7rem .8rem .8rem; max-width: 96vw;
  border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 24px 70px rgb(0 0 0 / .55);
}
.lb-top { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-bottom: .6rem; min-height: 46px; }
.lb-cap { margin: 0; flex: 1; font: 700 1.3rem/1.2 var(--font-head); color: var(--title); }
.lb-stage { position: relative; display: grid; place-items: center; min-width: min(18rem, 80vw); min-height: 8rem; background: var(--band); border-radius: 8px; overflow: hidden; }
.lb-stage img {
  display: block; max-width: calc(96vw - 1.6rem); max-height: calc(100vh - 12rem); max-height: calc(100dvh - 12rem);
  width: auto; height: auto; object-fit: contain; border-radius: 8px;
}
.lb-stage.loading img { opacity: .35; }
.lb-stage.loading::after { content: "Načítám obrázek…"; position: absolute; inset: 0; display: grid; place-items: center; color: var(--text); font-weight: 700; }
.lb-nav { display: flex; align-items: center; justify-content: center; gap: .8rem; padding-top: .7rem; }
.lb-count { font: 700 .95rem var(--font-body); color: var(--muted); min-width: 3.5rem; text-align: center; }
.lb-btn {
  display: inline-grid; place-items: center; flex: none; width: 46px; height: 46px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 2px solid var(--text); background: transparent; color: var(--text); font: 700 1.6rem/1 var(--font-body);
}
.lb-btn:hover { background: var(--amber); color: #2e1d14; border-color: #2e1d14; }
.lb-btn[hidden], .lb-nav[hidden], .lb-cap[hidden] { display: none; }
@media (prefers-reduced-motion: no-preference) {
  dialog.lightbox[open] .lb-frame { animation: lb-in .18s ease-out; }
  dialog.lightbox[open]::backdrop { animation: lb-fade .18s ease-out; }
}
@keyframes lb-in { from { opacity: 0; transform: scale(.97); } }
@keyframes lb-fade { from { opacity: 0; } }

.post-share {
  margin-top: 2rem; padding: 1rem 1.25rem; background: var(--band);
  border: 1px solid var(--line); border-radius: var(--radius); max-width: var(--measure);
}
.share-lead { margin: 0 0 .6rem; font-weight: 700; }

.post-nav ul { list-style: none; padding: 0; margin: 2.2rem 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.post-nav li { min-width: 0; }
.post-nav a {
  display: block; height: 100%; padding: .8rem 1.1rem; border: 1px solid var(--line); border-top: 4px solid var(--strap);
  border-radius: var(--radius); background: var(--surface); text-decoration: none; color: var(--text);
}
.post-nav a:hover { border-color: var(--ink2); box-shadow: 0 0 0 2px var(--ink2); background: var(--surface); }
.post-nav a:hover .t { background: var(--hover-bg); text-decoration-thickness: .15em; }
.post-nav .dir { display: block; font-size: .85rem; color: var(--muted); }
.post-nav .t { font: 700 1.1rem/1.3 var(--font-head); color: var(--title); text-decoration: underline; text-decoration-thickness: .07em; text-underline-offset: .18em; }
.post-nav .older { grid-column: 2; text-align: right; }
.post-nav .newer { grid-column: 1; }
@media (max-width: 36rem) { .post-nav ul { grid-template-columns: 1fr; } .post-nav .older, .post-nav .newer { grid-column: 1; text-align: left; } }
.back { text-align: center; margin-top: 1.5rem; }

/* stránka nenalezena: Daisy hledá stopu */
.nf-dog { float: right; width: min(8.5rem, 30%); height: auto; margin: 0 0 1rem 1.5rem; border-radius: 50%; }
.notfound { display: flow-root; }

/* ---------- archiv ---------- */

.arch-year h2 { font: 700 1.8rem var(--font-head); margin: 1.6rem 0 .2rem; border-bottom: 3px solid var(--amber); display: inline-block; padding-right: 1rem; }
.arch-year h2 a { text-decoration: none; color: var(--text); }
.arch-year h3 { font: 700 1.1rem var(--font-body); margin: 1rem 0 .3rem; text-transform: capitalize; }
.arch-year h3 a { display: inline-block; min-height: 1.75rem; padding-block: .1rem; }
.arch-list { list-style: none; padding: 0; margin: 0; }
.arch-list li { padding: .15rem 0; }
.arch-list li a { display: inline-block; min-height: 1.5rem; padding-block: .1rem; }
.arch-list time { color: var(--muted); font-variant-numeric: tabular-nums; display: inline-block; min-width: 3.4rem; }

/* ---------- tlačítka a sdílení ---------- */

.btn, button.btn, summary.btn {
  display: inline-flex; align-items: center; gap: .5rem; padding: .55rem 1.2rem; border-radius: 2rem;
  border: 2px solid var(--btn-border); background: var(--amber); color: var(--on-amber);
  font: 700 1rem/1.3 var(--font-body); text-decoration: none; cursor: pointer; list-style: none;
}
summary.btn::-webkit-details-marker { display: none; }
.btn:hover, summary.btn:hover { background: var(--amber-hover); color: var(--on-amber); }
.btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn .brand-ico { width: 1.25rem; height: 1.25rem; fill: currentColor; stroke: none; flex: none; }
.btn.secondary { background: var(--surface); color: var(--text); border-color: var(--ink2); }
.btn.secondary:hover { background: var(--band); color: var(--text); }
.btn.dark { background: var(--pill-bg); border-color: var(--pill-bg); color: var(--pill-fg); }
.btn.dark:hover { background: var(--amber); border-color: var(--btn-border); color: var(--on-amber); }
.btn.red { background: var(--red); border-color: var(--red); color: var(--on-red); }
.btn.red:hover { background: var(--red-hover); border-color: var(--red-hover); color: var(--on-red); }
.btn[hidden], [hidden] { display: none !important; }

.btn-row { list-style: none; padding: 0; margin: .7rem 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; }

.share { display: inline-block; text-align: left; }
.share[open] summary.btn { background: var(--amber-hover); }
.share-list {
  list-style: none; margin: .6rem 0 0; padding: .5rem; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); min-width: 14rem;
}
.share-list a, .linklike {
  display: block; width: 100%; padding: .45rem .75rem; border-radius: .5rem; text-align: left;
  color: var(--link); text-decoration: none; background: none; border: 0; font: inherit; cursor: pointer;
}
.share-list a:hover, .linklike:hover { background: var(--bg); color: var(--link-hover); }

/* ---------- patička: tmavomodrá vlnka a béžový pás ---------- */

.site-footer { margin-top: 1rem; }

.foot-band { position: relative; background: var(--head); color: var(--on-head); padding: calc(var(--strap-h) + 2.4rem) 0 2.4rem; overflow: hidden; }
.foot-band .strap { z-index: 1; }
.foot-band .strap-top { top: 0; bottom: auto; }
.band-inner { position: relative; text-align: center; }
.band-inner h2 { font: 700 1.6rem var(--font-head); margin: 0 0 .3rem; }
.band-inner p { margin: 0 0 1rem; }

.foot-main { background: var(--band); padding: 1.8rem 0 0; text-align: center; border-bottom: .9rem solid var(--head); }
.foot-main .wrap { display: grid; gap: 1.6rem; }
.foot-content { display: grid; gap: 1.6rem; }
.foot-title { font: 600 1rem var(--font-body); margin: 0; }
/* tlačítka pod obrázkem: pod sebou, uprostřed */
.foot-main { padding-bottom: 2rem; }
.foot-main .share-list { margin-inline: auto; }

/* zahrada přes celou šířku, shora a zdola lemovaná popruhem; přezka je jen dole vpravo.
   Po spuštění videa se pás plynule roztáhne na poměr videa (16:9). */
.foot-scene { position: relative; line-height: 0; background: var(--head); }
.scene-media { position: relative; width: 100%; overflow: hidden; aspect-ratio: 2000 / 803; transition: aspect-ratio .6s ease, max-height .6s ease; }
.scene-media img, .scene-media video {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 35% 78%; filter: saturate(.92);
}
.scene-media video { object-position: 30% 70%; background: #1d120c; }
.scene-media.is-video { aspect-ratio: 16 / 9; max-height: min(85vh, 60rem); }
.foot-scene .strap-top { top: 0; bottom: auto; }
.buckle-right { left: auto; right: max(1rem, calc((100% - var(--container)) / 2)); }
@media (min-width: 48rem) {
  .scene-media { aspect-ratio: 3 / 1; max-height: 38rem; }
  .scene-media.is-video { aspect-ratio: 16 / 9; max-height: min(85vh, 60rem); }
}
@media (prefers-reduced-motion: reduce) { .scene-media { transition: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .scene-media img, :root:not([data-theme="light"]) .scene-media video { filter: saturate(.8) brightness(.8); } }
:root[data-theme="dark"] .scene-media img, :root[data-theme="dark"] .scene-media video { filter: saturate(.8) brightness(.8); }

/* tlačítko přehrát / pozastavit: uprostřed pásu, během přehrávání menší dole nad popruhem */
.scene-play {
  position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: grid; place-items: center; width: 4.5rem; height: 4.5rem; padding: 0; border-radius: 50%;
  background: var(--amber); color: var(--on-amber); border: 3px solid #2e1d14; cursor: pointer; line-height: 0;
  box-shadow: 0 4px 14px rgb(0 0 0 / .35); transition: background-color .15s ease, width .3s ease, height .3s ease;
}
.scene-play[hidden] { display: none; }
.scene-play svg { width: 2rem; height: 2rem; fill: currentColor; }
.scene-play .i-play { margin-left: .2rem; }
.scene-play .i-pause { display: none; }
.scene-play:hover { background: #fff; }
.scene-play:focus-visible { outline: 3px solid #fff; outline-offset: 3px; box-shadow: 0 0 0 6px #2e1d14; }
.scene-play.is-playing { top: auto; bottom: calc(var(--strap-h) + 1rem); transform: translateX(-50%); width: 3.25rem; height: 3.25rem; }
.scene-play.is-playing svg { width: 1.5rem; height: 1.5rem; }
.scene-play.is-playing .i-play { display: none; }
.scene-play.is-playing .i-pause { display: block; }
@media (prefers-reduced-motion: reduce) { .scene-play { transition: none; } }

.to-top {
  position: fixed; right: 1rem; bottom: 1rem; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--amber); color: var(--on-amber);
  border: 2px solid var(--btn-border); font-size: 1.5rem; text-decoration: none; box-shadow: var(--shadow); z-index: 50;
}
.to-top:hover { background: var(--amber-hover); color: var(--on-amber); }

/* ---------- kontakt ---------- */

.contact-intro { margin-bottom: 1.2rem; max-width: none; }   /* fotka vpravo až na okraji sloupce */
.contact-intro p { max-width: var(--measure); }
.contact-mail h2, .contact-links h2 { font: 700 1.35rem/1.3 var(--font-head); margin: 1.6rem 0 .5rem; }
.mail-line { font-size: 1.2rem; margin: 0; }
.project-list { list-style: none; margin: .8rem 0 0; padding: 0; display: grid; gap: .9rem; }
.project-list li {
  background: var(--surface); border: 1px solid var(--line); border-left: .35rem solid var(--amber);
  border-radius: var(--radius); padding: .85rem 1.2rem 1rem; box-shadow: var(--shadow);
}
.project-list h3 { font: 700 1.25rem/1.3 var(--font-head); margin: 0 0 .25rem; }
.project-list h3 a { color: var(--title); }
.project-list p { margin: 0; }

/* ---------- tisk ---------- */

@media print {
  /* vždy světlá barevná sada, i když má čtenář zapnutý noční režim */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --band: #fff; --surface: #fff; --text: #000; --muted: #333; --line: #999;
    --title: #000; --em: #000; --link: #000; --link-hover: #000; --hover-bg: transparent; --mark: #eee;
    --shadow: none; color-scheme: light;
  }
  @page { size: A4; margin: 14mm 16mm 16mm; }
  html { font-size: 11pt; }
  body { background: #fff !important; color: #000; font: 11pt/1.4 Georgia, "Times New Roman", serif; display: block; }
  .entry figure.video video { display: none; }
  .skip, .main-nav, .paws, .strap, .head-dog, .foot-dog, .foot-scene, .nf-dog, .site-footer, .to-top, .post-share, .post-nav, .back, .pager,
  .more-row, .tags, dialog.lightbox, .entry .pic a.zoom::before, .entry .pic a.zoom::after, .card-img,
  .share, [data-print], .theme-toggle { display: none !important; }

  /* hlavička: malé logo s hlavou, název a podtitul v jednom řádku nad tenkou čárou (bez barevných ploch, ať se šetří toner) */
  .site-header { background: none !important; color: #000; padding: 0 0 2mm; border-bottom: .5pt solid #000; margin-bottom: 5mm; overflow: visible; }
  .head-inner { padding: 0 !important; min-height: 0 !important; width: auto; }
  .brand-block { display: flex !important; align-items: center; gap: 3mm; }
  .brand-text { display: block; }
  .logo { display: block !important; width: 11mm; height: 11mm; flex: none; }
  .logo img { display: block; width: 11mm; height: 11mm; }
  .brand { font: 700 15pt/1.15 Georgia, serif; letter-spacing: 0; text-transform: none; color: #000; margin: 0; }
  .brand a { color: #000; text-decoration: none; }
  .tagline { display: block !important; font: italic 9pt/1.3 Georgia, serif; color: #333; margin: .5mm 0 0; }

  .wrap { width: auto; padding: 0; margin: 0; }
  .post-head h1 { font: 700 19pt/1.2 Georgia, "Times New Roman", serif; color: #000; margin: 0 0 1mm; }
  .card h2 { font: 700 13pt/1.25 Georgia, "Times New Roman", serif; color: #000; margin: 0 0 1mm; }
  .meta { font: italic 9pt Georgia, serif; color: #333; margin: 0 0 3mm; }
  .entry { font-size: 11pt; }
  main { padding: 0 !important; }
  .entry p { margin: 0 0 2.5mm; }
  .entry h2 { font-size: 14pt; margin: 4mm 0 1.5mm; }
  .entry h3 { font-size: 12pt; margin: 3mm 0 1mm; }
  .entry p, .entry li { orphans: 3; widows: 3; }
  .entry h2, .entry h3, .entry h4 { font-family: Georgia, serif; color: #000; break-after: avoid-page; }
  .entry blockquote { border-left: 2pt solid #666; background: none; break-inside: avoid; margin-left: 0; padding-left: 5mm; }
  .entry pre, .entry code { background: none; border: .5pt solid #999; white-space: pre-wrap; }
  .entry table { display: table; }
  .entry th, .entry td { border-color: #666; }

  /* odkazy: podtržené, za externími ukázaná adresa, aby šla z papíru přepsat */
  a, a:hover { color: #000; background: none; box-shadow: none; text-decoration: underline; }
  .entry a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 9pt; word-break: break-all; text-decoration: none; display: inline; }
  .entry a.ext::after { content: " (" attr(href) ")"; }

  /* obrázky: zůstávají vpravo, menší, v tenkém rámečku, nepřetrhnou se mezi stránkami */
  .entry .pic { float: right; width: min(var(--w, 22rem), 48mm); margin: 1mm 0 3mm 5mm; padding: 1.5mm; background: none;
    border: .5pt solid #777; border-radius: 0; box-shadow: none; break-inside: avoid; }
  .entry .pic img { border-radius: 0; filter: none; }
  .entry .pic figcaption { color: #000; font-size: 9pt; }
  .entry img { max-width: 100%; break-inside: avoid; }
  .entry iframe, .entry video { display: none; }

  .project-list li { box-shadow: none; border: .5pt solid #777; border-left-width: 2pt; border-radius: 0; break-inside: avoid; }
  .project-list h3 a::after { content: " (" attr(href) ")"; font: 9pt Georgia, serif; }

  /* seznam příspěvků (domů, archiv): karty bez rámů a stínů */
  .card { box-shadow: none; border: 0; border-bottom: .5pt solid #999; border-radius: 0; background: none; padding: 0 0 2.5mm; margin: 0 0 3mm; break-inside: avoid; display: block; }
  .card, .card.has-img { display: block !important; grid-template-columns: none !important; }
  .card-body { padding: 0; width: auto; max-width: none; }
  .card .excerpt { margin: 0; }
  .arch-year h2 { font-size: 15pt; margin: 3mm 0 1mm; }
  .arch-year h3 { font-size: 11pt; margin: 2mm 0 .5mm; }
  .arch-list li { padding: 0; }
  .card::before, .card::after { display: none; }

  /* zdroj pod textem */
  .print-src { display: block !important; margin: 6mm 0 0; padding-top: 2mm; border-top: .5pt solid #000; font: 9pt Georgia, serif; color: #000; word-break: break-all; }
}
.print-src { display: none; }
.lb-close { margin-left: auto; }
