/**
 * Zážitky — Archív
 *
 * Matched to the KOCRTK_3.0 Figma "Vrstvíme zážitky" archive.
 * Visual values are CSS custom properties on the .zazitky-archiv wrapper.
 */

.zazitky-archiv {
	/* Brand palette */
	--za-teal: #005a64;   /* primary text/titles/buttons */
	--za-blue: #96d7e0;   /* card outline, tagline, arrow */
	--za-yellow: #fce68d; /* filter pills */
	--za-white: #ffffff;
	--za-card-border: var(--za-blue);
	--za-shadow: 0 4px 40px rgb(0 0 0 / 20%);

	/* Layout */
	--za-max-width: 1240px;
	--za-pad-x: clamp(20px, 5vw, 40px);
	--za-columns: 3;
	--za-grid-gap: 28px;
	--za-row-gap: 40px;

	/* Shape */
	--za-radius: 12px;
	--za-card-ratio: 394 / 264;

	/* Type — Nexa (theme-provided) with graceful fallback */
	--za-font: "Nexa Text", "Nexa", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--za-heading-size: clamp(2.25rem, 1rem + 5vw, 4.375rem); /* 36 → 70px */
	--za-card-title: clamp(1.25rem, 1rem + 1vw, 1.75rem);    /* 20 → 28px */
	--za-pill-size: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);    /* 16 → 20px */

	box-sizing: border-box;
	width: 100%;
	font-family: var(--za-font);
	color: var(--za-teal);
}

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

.zazitky-archiv .za-inner {
	max-width: var(--za-max-width);
	margin-inline: auto;
	padding-inline: 0; /* the theme container provides the horizontal padding */
}

/* ---------- Heading ---------- */

.zazitky-archiv .za-heading {
	margin: 0 0 var(--za-row-gap);
	font-size: var(--za-heading-size);
	line-height: 1.2;
	font-weight: 900;
	color: var(--za-teal);
	overflow-wrap: break-word;
}

/* ---------- Filter bar ---------- */

.zazitky-archiv .za-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin-bottom: 20px;
}

.zazitky-archiv .za-filter,
.zazitky-archiv .za-search {
	flex: 1 1 260px;
	min-width: 0;
	position: relative;
}

.zazitky-archiv .za-filter__toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	min-height: 54px;
	padding: 8px 22px;
	border: none;
	border-radius: var(--za-radius);
	background: var(--za-yellow);
	color: var(--za-teal);
	font-family: var(--za-font);
	font-size: var(--za-pill-size);
	font-weight: 700;
	line-height: 1.3;
	text-align: left;
	cursor: pointer;
}

.zazitky-archiv .za-filter__label {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.zazitky-archiv .za-caret {
	flex: 0 0 auto;
	transition: transform 0.2s ease;
}

.zazitky-archiv .za-filter__toggle[aria-expanded="true"] .za-caret {
	transform: rotate(180deg);
}

.zazitky-archiv .za-filter__toggle.has-selection {
	box-shadow: inset 0 0 0 2px var(--za-teal);
}

/* Dropdown panel */
.zazitky-archiv .za-filter__panel {
	position: absolute;
	top: calc(100% + 6px);
	left: 0;
	right: 0;
	z-index: 30;
	max-height: 340px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 12px;
	background: var(--za-white);
	border-radius: var(--za-radius);
	box-shadow: var(--za-shadow);
}

.zazitky-archiv .za-filter__panel[hidden] {
	display: none;
}

.zazitky-archiv .za-filter__opt {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 14px;
	border-radius: var(--za-radius);
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--za-teal);
	cursor: pointer;
	transition: background-color 0.15s ease;
}

/* Small teal dot marker (Figma polygon) */
.zazitky-archiv .za-filter__opt::before {
	content: "";
	flex: 0 0 auto;
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: var(--za-teal);
}

/* Native checkbox kept for state + accessibility, but visually hidden — Figma uses the pill */
.zazitky-archiv .za-filter__opt input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: 0;
	opacity: 0;
	pointer-events: none;
}

.zazitky-archiv .za-filter__opt:hover {
	background: rgb(252 230 141 / 40%); /* soft yellow */
}

/* Selected term → yellow pill (JS toggles .is-checked; :has() is a no-JS fallback) */
.zazitky-archiv .za-filter__opt.is-checked,
.zazitky-archiv .za-filter__opt:has(input:checked) {
	background: var(--za-yellow);
	font-weight: 600;
}

.zazitky-archiv .za-filter__opt:focus-within {
	outline: 2px solid var(--za-teal);
	outline-offset: 1px;
}

/* Keyword search */
.zazitky-archiv .za-search__input {
	width: 100%;
	min-height: 54px;
	padding: 8px 22px;
	border: none;
	border-radius: var(--za-radius);
	background: var(--za-yellow);
	color: var(--za-teal);
	font-family: var(--za-font);
	font-size: var(--za-pill-size);
	font-weight: 700;
	line-height: 1.3;
}

.zazitky-archiv .za-search__input::placeholder {
	color: var(--za-teal);
	opacity: 0.85;
}

.zazitky-archiv .za-search__input:focus-visible,
.zazitky-archiv .za-filter__toggle:focus-visible {
	outline: 2px solid var(--za-teal);
	outline-offset: 2px;
}

/* ---------- Results counter ---------- */

.zazitky-archiv .za-count {
	margin-bottom: 20px;
	text-align: right;
	font-size: 0.875rem;
	font-weight: 400;
	color: var(--za-teal);
}

/* ---------- Results / loading ---------- */

.zazitky-archiv .za-results {
	transition: opacity 0.2s ease;
}

.zazitky-archiv .za-results.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

.zazitky-archiv .za-grid {
	display: grid;
	grid-template-columns: repeat(var(--za-columns), minmax(0, 1fr));
	gap: var(--za-grid-gap);
}

/* ---------- Card ---------- */

.zazitky-archiv .za-card {
	min-width: 0;
}

.zazitky-archiv .za-card__link {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--za-white);
	border-radius: var(--za-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.zazitky-archiv .za-card__link:hover {
	transform: translateY(-4px);
	box-shadow: 0 18px 40px -24px rgb(0 0 0 / 20%);
}

.zazitky-archiv .za-card__media {
	overflow: hidden;
	aspect-ratio: var(--za-card-ratio);
	background: #eef4f5;
}

.zazitky-archiv .za-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.zazitky-archiv .za-card__link:hover .za-img {
	transform: scale(1.05);
}

.zazitky-archiv .za-img--placeholder {
	background: linear-gradient(135deg, #e6eff1, #d6e7ea);
}

.zazitky-archiv .za-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 12px;
	padding: 24px 28px 28px;
	/* Outline hugs the text body only; the image sits flush at the top. */
	border: 1px solid var(--za-card-border);
	border-top: 0;
	border-radius: 0 0 var(--za-radius) var(--za-radius);
}

.zazitky-archiv .za-card__tag {
	font-family: "Roboto", var(--za-font);
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--za-blue);
}

.zazitky-archiv .za-card__title {
	margin: 0;
	font-size: var(--za-card-title);
	line-height: 1.2;
	font-weight: 800;
	color: var(--za-teal);
	overflow-wrap: break-word;
}

.zazitky-archiv .za-card__desc {
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--za-teal);
}

/* Bulleted metadata list (address / opening hours) */
.zazitky-archiv .za-card__meta {
	margin: 0;
	padding-left: 1.15em;
	list-style: disc;
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--za-teal);
}

.zazitky-archiv .za-card__meta > li {
	margin: 0;
	padding: 0;
}

/* A WYSIWYG value may itself contain a list (e.g. per-day opening hours) —
   flatten it: keep the outer bullet, render inner items as plain lines. */
.zazitky-archiv .za-card__meta ul,
.zazitky-archiv .za-card__meta ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Opening hours — standalone WYSIWYG block below the address list; its own
   paragraphs/lists render as clean unbulleted lines. */
.zazitky-archiv .za-card__hours {
	font-size: 1rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--za-teal);
}

.zazitky-archiv .za-card__hours p {
	margin: 0;
}

.zazitky-archiv .za-card__hours ul,
.zazitky-archiv .za-card__hours ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

.zazitky-archiv .za-card__extra {
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--za-teal);
	opacity: 0.75;
}

/* Stored fields may carry WYSIWYG markup — keep it tight inside the card */
.zazitky-archiv .za-card__desc > *:first-child,
.zazitky-archiv .za-card__extra > *:first-child,
.zazitky-archiv .za-card__meta > li > *:first-child {
	margin-top: 0;
}

.zazitky-archiv .za-card__desc > *:last-child,
.zazitky-archiv .za-card__extra > *:last-child,
.zazitky-archiv .za-card__meta > li > *:last-child {
	margin-bottom: 0;
}

.zazitky-archiv .za-card__detail {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin-top: auto;
	padding-top: 8px;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.5;
	color: var(--za-teal);
}

.zazitky-archiv .za-card__detail .za-arrow {
	flex: 0 0 auto;
	color: var(--za-blue);
	transition: transform 0.2s ease;
}

.zazitky-archiv .za-card__link:hover .za-card__detail .za-arrow {
	transform: translateX(3px);
}

.zazitky-archiv .za-empty {
	margin: 0;
	padding: 48px 0;
	text-align: center;
	color: var(--za-teal);
}

/* ---------- Load more ---------- */

.zazitky-archiv .za-more-wrap {
	display: flex;
	justify-content: center;
	margin-top: var(--za-row-gap);
}

.zazitky-archiv .za-more[hidden] {
	display: none;
}

.zazitky-archiv .za-more {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid var(--za-teal);
	border-radius: 8px;
	background: transparent;
	color: var(--za-teal);
	font-family: var(--za-font);
	font-size: 1rem;
	font-weight: 800;
	line-height: 24px;
	cursor: pointer;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.zazitky-archiv .za-more:hover,
.zazitky-archiv .za-more:focus-visible {
	background: var(--za-teal);
	color: var(--za-white);
	outline: none;
}

.zazitky-archiv .za-more.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/* ---------- Responsive ---------- */

@media (max-width: 991px) {
	.zazitky-archiv {
		--za-grid-gap: 24px;
		--za-row-gap: 32px;
	}

	/* Override the property directly — inline --za-columns can't be beaten by a var reassign. */
	.zazitky-archiv .za-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 680px) {
	.zazitky-archiv .za-grid {
		grid-template-columns: 1fr;
	}

	/* Filter controls stack full-width */
	.zazitky-archiv .za-filter,
	.zazitky-archiv .za-search {
		flex-basis: 100%;
	}

	.zazitky-archiv .za-count {
		text-align: left;
	}

	.zazitky-archiv .za-more {
		width: 100%;
	}
}
