/* ==========================================================================
   Blábolník – vzhled podle plavacek.net
   Barvy jsou změřené ze screenshotu plavacek.net. 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: #f7f4ec;            /* krémová */
  --band: #eee8d9;          /* béžový pás */
  --surface: #ffffff;
  --text: #0e2a3d;
  --muted: #41596a;
  --line: #ddd4be;

  --navy: #12466b;          /* tmavomodrá (hlavička, vlnka) */
  --on-navy: #ffffff;
  --night: #001940;         /* noční obloha: hlavička a spodek patičky (musí sedět s dírou pod ufounem) */
  --sky: #83bee4;
  --on-sky: #0e2a3d;

  --lime: #a4d233;
  --lime-hover: #b7e04f;
  --on-lime: #0e2a3d;
  --btn-border: #0e2a3d;
  --ink2: #0e2a3d;          /* okraj světlých tlačítek */

  --maroon: #7a3f45;
  --on-maroon: #ffffff;
  --maroon-hover: #5f2f35;
  --title: #7a3f45;         /* nadpisy karet a odkazy v kartách */

  --link: #135f8f;
  --link-hover: #0b3f5f;
  --em: #12466b;            /* kurzíva v textu: tmavě modrá jako hlavička */
  --hover-bg: #dcefa0;      /* zvýraznění odkazu při najetí */
  --focus: #12466b;
  --pill-bg: #12466b;       /* aktivní stránkování */
  --pill-fg: #ffffff;
  --chart: #12466b;
  --mark: #fff3c4;

  --radius: .9rem;
  --shadow: 0 1px 2px rgb(14 42 61 / .08), 0 8px 22px rgb(14 42 61 / .07);
  --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: #0b1d2b; --band: #102a3c; --surface: #133248; --text: #e9eff3; --muted: #aebfcc; --line: #2a4a60;
    --navy: #0b3556; --sky: #83bee4; --night: #021430;
    --btn-border: #a4d233; --ink2: #e9eff3;
    --maroon: #8b4850; --maroon-hover: #a35a63;
    --title: #f1b9be;
    --link: #8fd0f5; --link-hover: #c6e9fb; --focus: #ffd27a; --hover-bg: #3d5a1c; --em: #a9d6f2;
    --pill-bg: #83bee4; --pill-fg: #0e2a3d; --chart: #8fd0f5; --mark: #4a3d10;
    --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 8px 22px rgb(0 0 0 / .25);
    --zoom-bg: rgb(10 26 41 / .85);
  }
}
:root[data-theme="dark"] {
  --bg: #0b1d2b; --band: #102a3c; --surface: #133248; --text: #e9eff3; --muted: #aebfcc; --line: #2a4a60;
  --navy: #0b3556; --sky: #83bee4; --night: #021430;
  --btn-border: #a4d233; --ink2: #e9eff3;
  --maroon: #8b4850; --maroon-hover: #a35a63;
  --title: #f1b9be;
  --link: #8fd0f5; --link-hover: #c6e9fb; --focus: #ffd27a; --hover-bg: #3d5a1c; --em: #a9d6f2;
  --pill-bg: #83bee4; --pill-fg: #0e2a3d; --chart: #8fd0f5; --mark: #4a3d10;
  --shadow: 0 1px 2px rgb(0 0 0 / .35), 0 8px 22px rgb(0 0 0 / .25);
  --zoom-bg: rgb(10 26 41 / .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(--lime); color: var(--on-lime); 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 s tmavomodrou vlnkou ---------- */

.site-header {
  position: relative;
  background: var(--night) url("art/hvezdy.svg") 30% 0 / 720px 360px;
  color: var(--on-navy);
  padding: 1.1rem 0 0;
  overflow: hidden;
}
.head-inner {
  position: relative;
  width: min(100% - 2rem, var(--container));
  margin-inline: auto;
  padding-bottom: 3.6rem;
  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: .92; 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-navy); 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 / .28); color: var(--on-navy); box-shadow: none; text-decoration: underline; text-decoration-thickness: .12em; }
.main-nav a[aria-current="page"] { background: var(--sky); color: var(--on-sky); }
.theme-toggle { border-color: var(--sky); }
.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; }

.wave { position: absolute; left: 0; right: 0; bottom: -1px; width: 100%; height: 3rem; display: block; }
.wave .back { fill: var(--sky); opacity: .35; }
.wave .front { fill: var(--bg); }

/* hvězdy v hlavičce: druhá, řidší vrstva jemně třpytí */
.site-header::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("art/hvezdy.svg") 330px 120px / 900px 450px;
  animation: trpyt 6s ease-in-out infinite alternate;
}
@keyframes trpyt { from { opacity: .25; } to { opacity: .9; } }
@media (prefers-reduced-motion: reduce) { .site-header::before { animation: none; opacity: .6; } html { scroll-behavior: auto; } }

@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(--lime);
  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(--lime); color: var(--on-lime); }
.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; }
.pager a {
  display: inline-block; min-width: 2.6rem; text-align: center; padding: .45rem .85rem; border-radius: 2rem;
  background: var(--surface); border: 2px solid var(--ink2); color: var(--text); text-decoration: none; font-weight: 700;
}
.pager a.num { display: inline-grid; place-items: center; width: 2.9rem; height: 2.9rem; min-width: 2.9rem; padding: 0; border-radius: 50%; }   /* čísla stránek jsou kulatá */
.pager a:hover { background: var(--lime); color: var(--on-lime); }
.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(--lime);
  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; border-top: 2px dotted var(--line); margin: 2em 0; }
.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 */

/* --- 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(--lime); border-color: #0e2a3d; }
.entry .pic a.zoom:hover::after, .entry .pic a.zoom:focus-visible::after { background: #0e2a3d; }
@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(--lime); color: #0e2a3d; border-color: #0e2a3d; }
.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(--lime);
  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; }

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

.arch-year h2 { font: 700 1.8rem var(--font-head); margin: 1.6rem 0 .2rem; border-bottom: 3px solid var(--lime); 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-list { list-style: none; padding: 0; margin: 0; }
.arch-list li { padding: .15rem 0; }
.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(--lime); color: var(--on-lime);
  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(--lime-hover); color: var(--on-lime); }
.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.blue { background: var(--pill-bg); border-color: var(--pill-bg); color: var(--pill-fg); }
.btn.blue:hover { background: var(--lime); border-color: var(--btn-border); color: var(--on-lime); }
.btn.maroon { background: var(--maroon); border-color: var(--maroon); color: var(--on-maroon); }
.btn.maroon:hover { background: var(--maroon-hover); border-color: var(--maroon-hover); color: var(--on-maroon); }
.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(--lime-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(--navy); color: var(--on-navy); padding: 4.6rem 0 0; overflow: hidden; }
.foot-band .wave-top, .foot-band .wave-bottom { position: absolute; left: 0; right: 0; width: 100%; height: 3rem; display: block; }
.foot-band .wave-top { top: -1px; transform: scaleY(-1); }
.foot-band .wave-bottom { bottom: -1px; }
.wave-top .back { fill: var(--sky); opacity: .35; }
.wave-top .front { fill: var(--bg); }
.wave-bottom .back { fill: #f1dfae; opacity: .8; }   /* pěna na písku */
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .wave-bottom .back { fill: #8f8157; opacity: .75; } }
:root[data-theme="dark"] .wave-bottom .back { fill: #8f8157; opacity: .75; }
.wave-bottom .front { fill: var(--band); }
.band-inner { position: relative; z-index: 1; 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 {   /* pod pískem je hvězdná noc, proto tu platí tmavé barvy */
  --text: #e9eff3; --muted: #aebfcc; --line: #2a4a60; --surface: #133248; --band: #102a3c; --ink2: #e9eff3;
  --maroon: #8b4850; --maroon-hover: #a35a63; --link: #8fd0f5; --link-hover: #c6e9fb; --focus: #ffd27a; --hover-bg: #3d5a1c;
  background: var(--night) url("art/hvezdy.svg") center top / 720px 360px; color: var(--text); padding: 1.8rem 0 4.5rem; text-align: center;
  position: relative; overflow: hidden;
}
.foot-main .wrap { position: relative; z-index: 1; }
.comet { position: absolute; left: clamp(.4rem, 7vw, 9rem); top: clamp(.6rem, 2.2vw, 2.6rem); width: clamp(5rem, 15vw, 9.5rem); height: auto; transform: rotate(17deg); opacity: .95; pointer-events: none; filter: drop-shadow(0 0 6px rgb(143 208 245 / .55)); }
@media (max-width: 40rem) { .comet { left: -.6rem; top: .5rem; width: 4.6rem; } }
.art-credit { margin: 0; font-size: .85rem; color: var(--muted); }
/* ilustrace: pták s fotoaparátem visí pod koncem názvu blogu (jen na širších obrazovkách), Poseidon a mořská panna stojí v modrém pásu patičky */
.art { display: none; }
.brand-text { position: relative; }
@media (min-width: 44rem) {
  .head-inner { padding-bottom: 4.3rem; }   /* místo, aby se ptákovi nezařízl fotoaparát */
  .art-bird { display: block; position: absolute; right: calc(-2.3rem - 30px); top: calc(100% + .25rem); width: 10rem; height: auto; pointer-events: none; z-index: 2; }
}
/* podmořská scéna: voda s paprsky, písek a postavičky z SVG (viz tpl/_scene.php); dole ufoun zvedá písek nad hvězdnou oblohou */
.foot-scene {
  --water-1: #1d6694; --water-2: #2b86b6; --sand-back: #d3b36c; --sand-front: #edcb81;
  position: relative; overflow: hidden; margin-top: -1rem; pointer-events: none;
  background: linear-gradient(to bottom, var(--navy) 0, var(--water-1) 42%, var(--water-2) 100%);
}
.foot-scene::before {   /* světelné paprsky shora */
  content: ""; position: absolute; inset: 0;
  background: conic-gradient(from 166deg at 57% -12%, transparent 0 1deg, rgb(255 255 255 / .15) 1deg 4.5deg, transparent 4.5deg 9deg, rgb(255 255 255 / .09) 9deg 12.5deg, transparent 12.5deg 17deg, rgb(255 255 255 / .13) 17deg 20deg, transparent 20deg 26deg, rgb(255 255 255 / .08) 26deg 29deg, transparent 29deg 360deg);
  -webkit-mask-image: linear-gradient(to bottom, #000, transparent 80%); mask-image: linear-gradient(to bottom, #000, transparent 80%);
}
.sea { position: relative; width: max(100%, 30rem); aspect-ratio: 2000 / 600; margin-left: calc((100% - max(100%, 30rem)) * .06); }   /* na úzkých displejích je scéna širší než okno a ukáže se její důležitější část */
.sea > img, .sea > svg { position: absolute; display: block; height: auto; }
.sea .dunes { left: 0; bottom: 0; width: 100%; height: 100%; }
.sea .diver-bubbles { left: 0; top: 0; width: 100%; height: 100%; overflow: visible; }
.bub { transform-box: fill-box; transform-origin: center; animation: bub 4.6s ease-in infinite; animation-delay: var(--d, 0s); }
.bub circle { fill: rgb(255 255 255 / .1); stroke: rgb(255 255 255 / .8); stroke-width: 2; }
.bub path { fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; opacity: .9; }
@keyframes bub { 0% { opacity: 0; transform: translate(0, 14px) scale(.6); } 18% { opacity: 1; } 100% { opacity: 0; transform: translate(9px, -34px) scale(1.1); } }
@media (prefers-reduced-motion: reduce) { .bub { animation: none; } }
.dunes .d1 { fill: var(--sand-back); }
.dunes .d2 { fill: var(--sand-front); }
.sea .wave-night { left: 0; bottom: -1px; width: 100%; height: 15%; }   /* barva = díra v pruhu písku (#001940); filtr v tmavém režimu ji ztlumí stejně jako díru */
.wave-night .b { fill: #001940; opacity: .38; }
.wave-night .f { fill: #001940; }
.sea .pisek { left: 0; bottom: 0; width: 100%; -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 24%); mask-image: linear-gradient(to bottom, transparent 0, #000 24%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .sea { filter: brightness(.8) saturate(.9); } :root:not([data-theme="light"]) .foot-scene { --water-1: #0f4468; --water-2: #15597f; } }
:root[data-theme="dark"] .sea { filter: brightness(.8) saturate(.9); }
:root[data-theme="dark"] .foot-scene { --water-1: #0f4468; --water-2: #15597f; }
.art-bird { filter: drop-shadow(0 0 1.5px rgb(255 255 255 / .9)); }

.foot-main .wrap { display: grid; gap: 1.6rem; }
.foot-title { font: 600 1rem var(--font-body); margin: 0; }
.foot-main .share-list { margin-inline: auto; }

.to-top {
  position: fixed; right: 1rem; bottom: 1rem; width: 3rem; height: 3rem; border-radius: 50%;
  display: grid; place-items: center; background: var(--lime); color: var(--on-lime);
  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(--lime-hover); color: var(--on-lime); }

/* ---------- 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(--lime);
  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: 18mm 20mm 20mm; }
  html { font-size: 12pt; }
  body { background: #fff !important; color: #000; font: 11.5pt/1.5 Georgia, "Times New Roman", serif; display: block; }
  .skip, .main-nav, .bubbles, .wave, .site-footer, .to-top, .post-share, .post-nav, .back, .pager,
  .logo, .tagline, .tags, .art, .foot-scene, .more-row, dialog.lightbox, .entry .pic a.zoom::before, .entry .pic a.zoom::after,
  .share, [data-print], .theme-toggle { display: none !important; }

  /* hlavička: jen název blogu nad čárou */
  .site-header::before { display: none; }
  .site-header { background: none !important; color: #000; padding: 0 0 2mm; border-bottom: .5pt solid #000; margin-bottom: 8mm; overflow: visible; }
  .head-inner { padding: 0; width: auto; }
  .brand-block, .brand-text { display: block; }
  .brand { font: 700 11pt Georgia, serif; letter-spacing: .02em; text-transform: uppercase; color: #000; }
  .brand a { color: #000; text-decoration: none; }

  .wrap { width: auto; padding: 0; margin: 0; }
  .post-head h1, .card h2 { font: 700 22pt/1.2 Georgia, "Times New Roman", serif; color: #000; margin: 0 0 2mm; }
  .meta { font: italic 10pt Georgia, serif; color: #333; margin: 0 0 6mm; }
  .entry { font-size: 11.5pt; }
  .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), 58mm); margin: 1mm 0 4mm 6mm; padding: 2mm; 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 4mm; margin: 0 0 5mm; break-inside: avoid; }
  .card::before, .card::after { display: none; }

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