/* ==================================================================
   Webpublicator 2.0 — výchozí vzhled webu.
   Web si barvy a písmo přebije ve www/theme/style.css (na serveru
   web/theme/style.css) přepsáním proměnných v :root, celý vzhled pak
   šablonami v site/templates/.
   ================================================================== */

:root {
	--brand: #247431;
	--brand-ink: #fff;
	--accent: #ef7d00;
	--bg: #fff;
	--bg-soft: #f5f7f5;
	--ink: #1b2420;
	--muted: #5f6b65;
	--line: #e2e7e4;
	--radius: 12px;
	--font: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-head: var(--font);
	--wrap: 1140px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 17px/1.65 var(--font); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; min-height: 100vh; }
img { max-width: 100%; height: auto; }
a { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; letter-spacing: -.01em; margin: 1.6em 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin-top: .4em; }
h2 { font-size: clamp(1.35rem, 2.6vw, 1.75rem); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: clamp(16px, 4vw, 32px); }

/* --- hlavička a menu ---------------------------------------------- */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); position: sticky; top: 0; z-index: 10; }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: 72px; }
.site-brand { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); line-height: 1.2; }
.site-brand strong { font-size: 1.25rem; font-family: var(--font-head); }
.site-brand span { color: var(--muted); font-size: .85rem; }

.nav-toggle { display: none; border: 1px solid var(--line); background: var(--bg); border-radius: 8px; padding: 8px 14px; font: inherit; font-size: .95rem; cursor: pointer; }

.menu, .menu__sub { list-style: none; margin: 0; padding: 0; }
.menu { display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.menu__item { position: relative; display: flex; align-items: center; }
.menu__item > a, .menu__label { display: block; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 550; font-size: .97rem; }
.menu__item > a:hover { background: var(--bg-soft); color: var(--brand); }
.menu__item.is-active > a, .menu__item.is-active > .menu__label { color: var(--brand); }
.menu > .menu__item.is-active > a { box-shadow: inset 0 -2px 0 var(--brand); border-radius: 8px 8px 0 0; }
.menu__expand { border: 0; background: none; cursor: pointer; padding: 8px 6px 8px 0; margin-left: -8px; color: var(--muted); }
.menu__expand::after { content: "▾"; }

.menu__sub {
	position: absolute; top: 100%; left: 0; min-width: 230px;
	background: var(--bg); border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: 0 12px 32px -12px rgba(0, 0, 0, .25); padding: 6px;
	display: none; flex-direction: column; z-index: 20;
}
.menu__sub .menu__item { display: block; }
.menu__sub .menu__item > a { padding: 8px 12px; }
.menu__sub .menu__sub { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; display: flex; }
.menu__sub .menu__expand { display: none; }
.menu__item.has-children:hover > .menu__sub,
.menu__item.has-children:focus-within > .menu__sub,
.menu__item.is-open > .menu__sub { display: flex; }

/* --- obsah -------------------------------------------------------- */

.site-main { flex: 1; padding-block: 32px 64px; }
.content { max-width: 780px; }
.content > :first-child { margin-top: 0; }
.content img { border-radius: 8px; }
.content figure { margin: 1.5em 0; }
.content figcaption { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.content blockquote { margin: 1.5em 0; padding: .4em 1.2em; border-left: 4px solid var(--accent); color: var(--muted); }
.content table { border-collapse: collapse; width: 100%; margin: 1.5em 0; }
.content th, .content td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.content__hero { width: 100%; margin: 0 0 1.5em; }
.lead { font-size: 1.15rem; color: var(--muted); max-width: 70ch; }
.empty { color: var(--muted); }
.back { margin-top: 2.5em; }
.btn { display: inline-block; padding: 10px 20px; border-radius: 99px; background: var(--brand); color: var(--brand-ink); text-decoration: none; font-weight: 600; }
.btn:hover { filter: brightness(1.1); }
.flash { padding: 12px 16px; border-radius: 8px; background: var(--bg-soft); margin-bottom: 20px; }

/* --- karty článků ------------------------------------------------- */

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 24px; margin: 24px 0; }
.card { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--bg); }
.card__img img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; display: block; }
.card__body { padding: 18px 20px 22px; }
.card__meta { margin: 0 0 6px; color: var(--muted); font-size: .85rem; }
.card__meta a { color: var(--muted); }
.card__title { font-size: 1.2rem; margin: 0 0 8px; }
.card__title a { color: var(--ink); text-decoration: none; }
.card__title a:hover { color: var(--brand); }
.card__perex { margin: 0; color: var(--muted); font-size: .97rem; }
.home-articles { margin-top: 48px; }

.pager { display: flex; justify-content: center; gap: 20px; align-items: center; margin-top: 32px; }

/* --- galerie ------------------------------------------------------ */

.gallery { margin: 2em 0; }
.gallery__title { margin-top: 0; }
.gallery__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.gallery__item { display: block; border-radius: 8px; overflow: hidden; }
.gallery__item img { width: 100%; aspect-ratio: 1; object-fit: cover; display: block; border-radius: 0; transition: transform .25s; }
.gallery__item:hover img { transform: scale(1.04); }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(10, 14, 12, .92); display: flex; align-items: center; justify-content: center; flex-direction: column; padding: 48px 16px 24px; }
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 100%; max-height: calc(100vh - 120px); border-radius: 6px; }
.lightbox__caption { color: #eee; margin-top: 12px; text-align: center; min-height: 1.5em; }
.lightbox button { position: absolute; border: 0; background: rgba(255, 255, 255, .12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 1.4rem; cursor: pointer; }
.lightbox button:hover { background: rgba(255, 255, 255, .25); }
.lightbox__close { top: 12px; right: 12px; }
.lightbox__prev { left: 12px; top: 50%; }
.lightbox__next { right: 12px; top: 50%; }

/* --- patička ------------------------------------------------------ */

.site-footer { background: var(--bg-soft); border-top: 1px solid var(--line); padding-block: 32px; font-size: .95rem; }
.site-footer__inner { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.site-footer p { margin: 6px 0 0; color: var(--muted); }
.site-footer__contact { display: flex; flex-direction: column; gap: 4px; }

/* --- mobil -------------------------------------------------------- */

@media (max-width: 860px) {
	.nav-toggle { display: inline-block; }
	.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--bg); border-bottom: 1px solid var(--line); padding: 8px 16px 16px; box-shadow: 0 16px 24px -16px rgba(0, 0, 0, .2); }
	.site-nav.is-open { display: block; }
	.menu { flex-direction: column; align-items: stretch; }
	.menu__item { flex-wrap: wrap; }
	.menu__item > a, .menu__label { flex: 1; }
	.menu > .menu__item.is-active > a { box-shadow: none; }
	.menu__expand { margin: 0; padding: 8px 12px; }
	.menu__sub { position: static; box-shadow: none; border: 0; width: 100%; padding: 0 0 0 16px; }
	.menu__item.has-children:hover > .menu__sub { display: none; }
	.menu__item.is-open > .menu__sub { display: flex; }
}
