/* Gallery + photo page. Theme-independent; colours via CSS variables so the theme can override them. */
:root { --kovo-accent: #6b4f1d; --kovo-gap: 12px; }   /* accent: bronze, from the old site's brown #5b4611 */
/* Warm base for every page (the theme reads these two variables): cream page, warm dark text */
body { --wp--preset--color--base: #faf6ed; --wp--preset--color--contrast: #2a2118; }

.kovo-gallery {
	--cols: 2;                                      /* phones */
	display: flex;
	flex-wrap: wrap;
	justify-content: center;                        /* centres an incomplete last row */
	gap: var(--kovo-gap);
	margin: 1.5rem 0;
}
@media (min-width: 560px) { .kovo-gallery { --cols: 3; } }   /* tablet: 3 x 5 = 15 */
@media (min-width: 900px) { .kovo-gallery { --cols: 5; } }   /* desktop: 5 x 3 = 15 */
/* break out of a narrow theme text column (block themes force margin auto !important and a max-width) */
.kovo-gallery, .kovo-pager {
	box-sizing: border-box;
	width: min(1200px, 100vw - 32px);
	max-width: none !important;
	margin-left: calc(50% - min(600px, 50vw - 16px)) !important;
	margin-right: 0 !important;
}

.kovo-gallery a {
	flex: 0 0 calc((100% - (var(--cols) - 1) * var(--kovo-gap)) / var(--cols));
	display: block;
	position: relative;
	aspect-ratio: 1 / 1;                            /* square tiles */
	overflow: hidden;
	border-radius: 6px;
	background: #e6dcc6;
}
.kovo-gallery img {
	position: absolute;                             /* fill the square regardless of theme img rules */
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none;
	object-fit: cover;                              /* crop instead of stretching */
	object-position: center;
	transition: transform .25s ease;
}
.kovo-gallery a:hover img, .kovo-gallery a:focus-visible img { transform: scale(1.06); }

/* pager: compact, with a panel that lists every page */
.kovo-pager { position: relative; display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; align-items: center; margin-top: 1.5rem; margin-bottom: 1.5rem; }
.kovo-pager a, .kovo-pager strong, .kovo-pager__dots {
	min-width: 2.4rem; padding: .55rem .7rem; text-align: center; border-radius: 6px; box-sizing: border-box;
	border: 1px solid #d9cfb8; text-decoration: none; line-height: 1; font-size: .95rem; color: inherit; background: #fff;
}
.kovo-pager strong { background: var(--kovo-accent); border-color: var(--kovo-accent); color: #fff; }
.kovo-pager a:hover, .kovo-pager__dots:hover, .kovo-pager__dots[aria-expanded="true"] { border-color: var(--kovo-accent); }
.kovo-pager__dots { cursor: pointer; font-family: inherit; }
.kovo-pager__all {
	position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: 20;
	width: min(34rem, 100%); max-height: 60vh; overflow: auto; box-sizing: border-box;
	display: grid; grid-template-columns: repeat(auto-fill, minmax(2.8rem, 1fr)); gap: 6px; padding: .8rem;
	background: #fff; border: 1px solid #d9cfb8; border-radius: 10px; box-shadow: 0 10px 30px rgba(40, 28, 14, .2);
}
.kovo-pager__all[hidden] { display: none; }
.kovo-pager__all a, .kovo-pager__all strong { min-width: 0; padding: .5rem 0; }

/* photo page */
.kovo-viewer { position: relative; margin: 1rem 0; }
.kovo-photo-full { margin: 0; text-align: center; }
.kovo-photo-full img { max-width: 100%; max-height: 78vh; width: auto; height: auto; border-radius: 6px; }
body.kovo-photo-page .kovo-photo-full img { max-height: max(340px, calc(100vh - 280px)); }   /* whole photo + product line fit on one screen */
.kovo-arrow {
	position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
	width: 2.8rem; height: 4rem; display: flex; align-items: center; justify-content: center;
	font-size: 2.6rem; line-height: 1; text-decoration: none; color: #fff;
	background: rgba(36, 26, 14, .55); border-radius: 6px; transition: background .2s;
}
.kovo-arrow:hover, .kovo-arrow:focus-visible { background: var(--kovo-accent); color: #fff; }
.kovo-arrow--prev { left: .5rem; }
.kovo-arrow--next { right: .5rem; }
@media (max-width: 600px) { .kovo-arrow { width: 2.2rem; height: 3rem; font-size: 2rem; opacity: .8; } }
.kovo-photo-nav { display: flex; justify-content: space-between; gap: 1rem; font-size: .9rem; }
.kovo-photo-nav a { text-decoration: none; max-width: 48%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kovo-photo-nav .kovo-next { margin-left: auto; text-align: right; }

/* Twenty Twenty-Five single template adds its own featured image and an author/category line; we render the photo ourselves. */
body.single-foto .wp-block-post-featured-image,
body.single-foto .wp-block-post-featured-image + .wp-block-group,
body.single-produkt .wp-block-post-title + .wp-block-group.has-small-font-size { display: none; }

/* Lightbox over the gallery / product photos (assets/lightbox.js) */
html.kovo-lb-open, html.kovo-lb-open body { overflow: hidden; }
.kovo-lb { position: fixed; inset: 0; z-index: 9995; display: flex; flex-direction: column; background: #14100b; color: #fff; }
.kovo-lb[hidden] { display: none; }
.kovo-lb__stage { position: relative; flex: 1 1 auto; min-height: 0; display: flex; align-items: center; justify-content: center; padding: 8px; }
.kovo-lb__img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; border-radius: 4px; transition: opacity .15s; }
.kovo-lb__img.is-loading { opacity: .35; }
.kovo-lb .kovo-arrow { border: 0; cursor: pointer; font-family: inherit; }
.kovo-lb__close {
	position: absolute; top: 10px; right: 10px; z-index: 3; width: 2.6rem; height: 2.6rem; border: 0; border-radius: 50%;
	background: rgba(36, 26, 14, .62); color: #fff; font-size: 1.8rem; line-height: 1; cursor: pointer;
}
.kovo-lb__close:hover, .kovo-lb__close:focus-visible { background: var(--kovo-accent); }
.kovo-lb__bar {
	flex: 0 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1.5rem;
	padding: .8rem 1rem calc(.8rem + env(safe-area-inset-bottom)); background: #1c1710; border-top: 1px solid #34291b;
}
.kovo-lb__info { display: flex; flex-direction: column; gap: .15rem; min-width: 0; }
.kovo-lb__title { font-size: 1.05rem; font-weight: 600; }
.kovo-lb__product { color: #cbbfa6; font-size: .9rem; text-decoration: underline; text-underline-offset: 3px; }
.kovo-lb__product:hover { color: #fff; }
.kovo-lb .kovo-ask { background: #c0562a; color: #fff; border: 0; border-radius: 6px; padding: .65rem 1.1rem; font: inherit; cursor: pointer; }
.kovo-lb .kovo-ask:hover { background: #d4632f; }
@media (max-width: 600px) { .kovo-lb__bar { flex-direction: column; align-items: stretch; } .kovo-lb .kovo-ask { width: 100%; } }
.kovo-lb [hidden] { display: none !important; }

/* Gallery filter: light pill buttons with a dropdown panel (assets/gallery.js) */
.kovo-gallery-app.is-busy .kovo-gallery { opacity: .45; transition: opacity .15s; }
.kovo-filter {
	display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 1rem 0 0;
	box-sizing: border-box; width: min(1200px, 100vw - 32px); max-width: none !important;
	margin-left: calc(50% - min(600px, 50vw - 16px)) !important; margin-right: 0 !important;
}
.kovo-pill { position: relative; }
.kovo-pill summary {
	list-style: none; cursor: pointer; user-select: none; display: inline-flex; align-items: center; gap: .35rem;
	padding: .45rem .9rem; border: 1px solid #d9cfb8; border-radius: 999px; background: #fff; font-size: .9rem; line-height: 1.2; color: inherit;
}
.kovo-pill summary::-webkit-details-marker { display: none; }
.kovo-pill summary::after { content: ""; width: .45rem; height: .45rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(45deg) translateY(-2px); opacity: .6; }
.kovo-pill[open] summary::after { transform: rotate(-135deg); }
.kovo-pill summary:hover, .kovo-pill[open] summary { border-color: var(--kovo-accent); }
.kovo-pill.is-active summary { background: var(--kovo-accent); border-color: var(--kovo-accent); color: #fff; }
.kovo-pill__val { font-weight: 600; }
.kovo-pill__panel {
	position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 14rem; max-width: min(22rem, calc(100vw - 32px));
	max-height: 60vh; overflow: auto; padding: .4rem; background: #fff; border: 1px solid #d9cfb8; border-radius: 10px;
	box-shadow: 0 10px 30px rgba(40, 28, 14, .2); display: flex; flex-direction: column;
}
.kovo-pill__panel a { display: flex; justify-content: space-between; gap: 1rem; padding: .5rem .7rem; border-radius: 6px; text-decoration: none; color: inherit; font-size: .95rem; }
.kovo-pill__panel a small { opacity: .55; }
.kovo-pill__panel a:hover { background: #f1ead9; }
.kovo-pill__panel a.is-current { background: #e8dfc9; font-weight: 600; }
.kovo-filter__meta { margin-left: auto; font-size: .85rem; opacity: .75; display: inline-flex; gap: .8rem; align-items: center; }
.kovo-filter__reset { text-decoration: underline; text-underline-offset: 3px; }
.kovo-empty { text-align: center; margin: 2rem 0; opacity: .7; }
@media (max-width: 600px) { .kovo-filter__meta { margin-left: 0; width: 100%; } .kovo-pill__panel { min-width: 12rem; } }
.kovo-pill__val { margin-left: -.3rem; }

/* ---- Products page and product pages ---- */
/* wider text column (the theme's constrained layout allows ~645px); title and content share it */
body.kovo-wide .wp-block-post-title,
body.kovo-wide .entry-content > * { max-width: min(1000px, 100%); }

/* products overview: justified intro, category list a bit further right */
body.kovo-products .entry-content > p { text-align: justify; hyphens: manual; }
.kovo-product-list { padding-left: 2.6rem; }

/* product page: smaller description text */
body.kovo-product .entry-content > :not(.kovo-photos) { font-size: 1.1rem; line-height: 1.65; }

/* photo tiles: square, cover-cropped like the gallery; title + "Poptat produkt" appear on hover */
.kovo-photos { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--kovo-gap); margin: 1.5rem 0; }
@media (min-width: 700px) { .kovo-photos { grid-template-columns: repeat(3, 1fr); } }
.kovo-photo { position: relative; margin: 0; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; background: #e6dcc6; }
.kovo-photo > a { position: absolute; inset: 0; display: block; }
.kovo-photo img {
	position: absolute; inset: 0; width: 100% !important; height: 100% !important; max-width: none;
	object-fit: cover; object-position: center; transition: transform .25s ease;
}
.kovo-photo:hover img, .kovo-photo:focus-within img { transform: scale(1.05); }
.kovo-photo figcaption {
	position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; pointer-events: none;   /* clicks fall through to the photo link */
	display: flex; flex-direction: column; align-items: flex-start; gap: .5rem; padding: 2.2rem .8rem .8rem;
	background: linear-gradient(to top, rgba(28, 19, 10, .82), rgba(28, 19, 10, 0));
	color: #fff; opacity: 0; transform: translateY(6px); transition: opacity .2s ease, transform .2s ease;
}
.kovo-photo:hover figcaption, .kovo-photo:focus-within figcaption { opacity: 1; transform: none; }
.kovo-photo-title {
	font-size: .85rem; line-height: 1.3; text-shadow: 0 1px 2px rgba(0, 0, 0, .5);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.kovo-photo .kovo-ask {
	pointer-events: auto; padding: .4rem .85rem; font-size: .85rem; line-height: 1.2;
	background: #c0562a; color: #fff; border: 0; border-radius: 6px;
}
.kovo-photo .kovo-ask:hover, .kovo-photo .kovo-ask:focus-visible { background: #d4632f; }
/* touch screens have no hover: keep a compact button visible, drop the title */
@media (hover: none) {
	.kovo-photo figcaption { opacity: 1; transform: none; background: none; padding: .5rem; align-items: flex-end; }
	.kovo-photo-title { display: none; }
	.kovo-photo .kovo-ask { font-size: .78rem; padding: .35rem .65rem; box-shadow: 0 1px 4px rgba(0, 0, 0, .35); }
}

/* ---- Photo page (/foto/...): wider photo, product line left, back link right ---- */
body.kovo-photo-page .kovo-viewer { margin: 1.2rem 0 .6rem; }
.kovo-photo-meta { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: .4rem 1.5rem; }
.kovo-photo-meta p { margin: 0; }
.kovo-photo-product { font-size: 1rem; }
.kovo-back { margin-left: auto; text-align: right; font-size: .85rem; }
.kovo-photo-wrap { width: fit-content; max-width: 100%; margin-left: auto; margin-right: auto; }
body.kovo-photo-page .wp-block-post-title { text-align: center; }
/* photo page: less empty space above the title, so the photo can be bigger */
body.kovo-photo-page .wp-site-blocks > main { margin-top: 0 !important; }
body.kovo-photo-page main > .wp-block-group { padding-top: 1.5rem !important; padding-bottom: 2rem !important; }
body.kovo-photo-page .wp-block-post-title { margin-top: 0; margin-bottom: 1rem; font-size: clamp(1.6rem, 3.2vw, 2.4rem); }

/* Header on every page: same column as the home page (logo and menu line up with the content, not with the window edges) */
.wp-site-blocks > header .alignwide { box-sizing: border-box; max-width: 1100px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }

/* ---- Kontakt page: address and map side by side (address first on phones), form underneath ---- */
.kovo-ct { display: grid; grid-template-columns: 1fr; gap: 1.6rem; margin: 1rem 0 2rem; }
@media (min-width: 800px) { .kovo-ct { grid-template-columns: minmax(230px, 300px) 1fr; gap: 2.5rem; align-items: start; } }
.kovo-ct__info h2 { margin: 0 0 .6rem; font-size: 1.3rem; }
.kovo-ct__info address { margin: 0 0 1.1rem; font-style: normal; font-size: 1rem; line-height: 1.55; }
.kovo-ct__info h3 { margin: 0 0 .25rem; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 600; opacity: .65; }
.kovo-ct__info p { margin: 0 0 1.1rem; font-size: 1rem; line-height: 1.6; }
.kovo-ct__info a { text-underline-offset: 3px; }
.kovo-ct__map iframe { display: block; width: 100%; height: 320px; border: 0; border-radius: 8px; background: #e6dcc6; }
@media (min-width: 800px) { .kovo-ct__map iframe { height: 360px; } }
.kovo-ct__formtitle { margin: 0 0 .8rem; font-size: 1.3rem; }
/* contact form: centred on the page (heading and the form block) */
.kovo-ct__formtitle { text-align: center; }
.kovo-ct ~ .kovo-contact .kovo-form { margin-left: auto; margin-right: auto; max-width: 520px; }
/* contact form: Odeslat button, note and result message centred under the fields */
.kovo-ct ~ .kovo-contact .kovo-submit { display: block; margin-left: auto; margin-right: auto; }
.kovo-ct ~ .kovo-contact .kovo-note, .kovo-ct ~ .kovo-contact .kovo-result { text-align: center; }

/* Footer spacing: less empty space between the page content and the footer line */
.wp-site-blocks > footer { margin-block-start: 0 !important; }
.wp-site-blocks > main > .wp-block-group { padding-bottom: 2rem !important; }
.wp-site-blocks > footer { background: #211810; color: #cbbfa6; }
.wp-site-blocks > footer a { color: #e0a030; text-underline-offset: 3px; }
.wp-site-blocks > footer > .wp-block-group { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }   /* symmetrical; the floating Poptávka button lifts itself above the footer (inquiry.js) */
/* footer text on the same column as the header */
.wp-site-blocks > footer .alignwide { box-sizing: border-box; max-width: 1100px; margin-left: auto; margin-right: auto; padding-left: 16px; padding-right: 16px; }

/* Sticky footer: on short pages / tall screens the footer sits at the bottom of the window, not under the content */
.wp-site-blocks { display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh; }
.wp-site-blocks > * { width: 100%; box-sizing: border-box; }
.wp-site-blocks > main { flex: 1 0 auto; }
.wp-site-blocks > footer { margin-top: auto; flex-shrink: 0; }
