/**
 * Na slovíčko — Posts Layout
 *
 * Matched to the KOCRTK_3.0 Figma "Na slovíčko" section.
 * All visual values are CSS custom properties on the .na-slovicko wrapper, so
 * tweaking the design means editing the tokens in this one block.
 */

.na-slovicko {
	/* Brand palette (from Figma) */
	--ns-teal: #005a64;   /* primary — all text, titles, buttons, outlines */
	--ns-blue: #96d7e0;   /* accent — card outline + read-more arrow */
	--ns-white: #ffffff;  /* card background */
	--ns-gray: #cccccc;   /* neutral border */
	--ns-breadcrumb: #c8c8c8;

	--ns-card-border: var(--ns-blue); /* set to var(--ns-gray) for a neutral outline */

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

	/* Shape */
	--ns-radius: 12px;
	--ns-btn-radius: 8px;
	--ns-card-ratio: 394 / 264;   /* grid card thumbnail */
	--ns-featured-ratio: 620 / 440;

	/* Type — Nexa (provided by the theme); graceful sans-serif fallback */
	--ns-font: "Nexa Text", "Nexa", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--ns-title-size: clamp(2.25rem, 1rem + 5vw, 4.375rem);       /* 36 → 70px */
	--ns-featured-title: clamp(1.625rem, 1.1rem + 2.2vw, 2.5rem); /* 26 → 40px */
	--ns-card-title: clamp(1.25rem, 1rem + 1vw, 1.75rem);         /* 20 → 28px */
	--ns-perex-size: 1rem;                                        /* 16px */
	--ns-readmore-size: 0.875rem;                                 /* 14px */
	--ns-filter-size: 1rem;                                       /* 16px */

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

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

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

/* ---------- Header (title + filter tabs) ---------- */

.na-slovicko .ns-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 24px;
	margin-bottom: var(--ns-row-gap);
}

.na-slovicko .ns-title {
	margin: 0;
	font-family: var(--ns-font);
	font-size: var(--ns-title-size);
	line-height: 1.2;
	font-weight: 900;
	color: var(--ns-teal);
}

/* Long Slovak words never overflow on narrow screens */
.na-slovicko .ns-title,
.na-slovicko .ns-featured__title,
.na-slovicko .ns-card__title {
	overflow-wrap: break-word;
	hyphens: auto;
}

.na-slovicko .ns-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 15px;
}

.na-slovicko .ns-filter__btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 8px 24px;
	border: 1px solid transparent; /* inactive tabs are plain text */
	border-radius: var(--ns-btn-radius);
	background: transparent;
	color: var(--ns-teal);
	font-family: var(--ns-font);
	font-size: var(--ns-filter-size);
	font-weight: 800;
	line-height: 24px;
	white-space: nowrap;
	cursor: pointer;
	transition: border-color 0.18s ease, background-color 0.18s ease, opacity 0.18s ease;
}

.na-slovicko .ns-filter__btn:hover,
.na-slovicko .ns-filter__btn:focus-visible {
	border-color: var(--ns-teal);
	outline: none;
}

.na-slovicko .ns-filter__btn.is-active {
	border-color: var(--ns-teal);
}

/* ---------- Read-more link (shared) ---------- */

.na-slovicko .ns-readmore {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-size: var(--ns-readmore-size);
	font-weight: 400;
	line-height: 21px;
	color: var(--ns-teal);
}

.na-slovicko .ns-readmore .ns-arrow {
	flex: 0 0 auto;
	color: var(--ns-blue);
	transition: transform 0.2s ease;
}

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

.na-slovicko .ns-results {
	transition: opacity 0.2s ease;
}

.na-slovicko .ns-results.is-loading {
	opacity: 0.45;
	pointer-events: none;
}

/* ---------- Featured (newest post on top) ---------- */

.na-slovicko .ns-featured {
	margin-bottom: var(--ns-row-gap);
}

.na-slovicko .ns-featured__link {
	display: flex;
	gap: clamp(24px, 4vw, 60px);
	align-items: stretch;
	text-decoration: none;
	color: inherit;
}

.na-slovicko .ns-featured__media {
	flex: 0 0 54%;
	align-self: flex-start; /* width from flex-basis drives the aspect height — never the reverse */
	overflow: hidden;
	aspect-ratio: var(--ns-featured-ratio);
	background: #eef4f5;
	border-radius: var(--ns-radius);
}

.na-slovicko .ns-featured__body {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	flex-direction: column;
	justify-content: flex-start;
	gap: 24px;
	padding: 8px 0;
}

.na-slovicko .ns-featured__title {
	margin: 0;
	font-size: var(--ns-featured-title);
	line-height: 1.2;
	font-weight: 900;
	color: var(--ns-teal);
}

.na-slovicko .ns-featured__perex {
	margin: 0 0 20px;
	font-size: var(--ns-perex-size);
	font-weight: 400;
	line-height: 1.5;
	color: var(--ns-teal);
}

.na-slovicko .ns-featured__foot {
	margin-top: 0;
}

/* ---------- Grid (rest, rows of 3) ---------- */

.na-slovicko .ns-grid {
	display: grid;
	grid-template-columns: repeat(var(--ns-columns), minmax(0, 1fr));
	gap: var(--ns-grid-gap);
}

.na-slovicko .ns-card {
	min-width: 0;
}

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

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

.na-slovicko .ns-card__media {
	overflow: hidden;
	aspect-ratio: var(--ns-card-ratio);
	background: #eef4f5;
}

.na-slovicko .ns-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	gap: 16px;
	padding: 24px 30px 30px;
	/* Outline hugs the text body only; the image sits flush at the top. */
	border: 1px solid var(--ns-card-border);
	border-top: 0;
	border-radius: 0 0 var(--ns-radius) var(--ns-radius);
}

.na-slovicko .ns-card__title {
	margin: 0;
	font-size: var(--ns-card-title);
	line-height: 1.2;
	font-weight: 800;
	color: var(--ns-teal);
}

.na-slovicko .ns-card__perex {
	margin: 0;
	font-size: var(--ns-perex-size);
	font-weight: 400;
	line-height: 1.5;
	color: var(--ns-teal);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.na-slovicko .ns-card__body .ns-readmore {
	margin-top: auto; /* pin read-more to the card bottom so rows align */
}

/* Shared image behaviour */
.na-slovicko .ns-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.na-slovicko .ns-featured__link:hover .ns-img,
.na-slovicko .ns-card__link:hover .ns-img {
	transform: scale(1.05);
}

.na-slovicko .ns-img--placeholder {
	background: linear-gradient(135deg, #e6eff1, #d6e7ea);
}

/* ---------- Footer button ("Zobraziť všetky články") ---------- */

.na-slovicko .ns-foot {
	display: flex;
	justify-content: center;
	margin-top: var(--ns-row-gap);
}

.na-slovicko .ns-btn-all {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 48px;
	padding: 12px 24px;
	border: 1px solid var(--ns-teal);
	border-radius: var(--ns-btn-radius);
	background: transparent;
	color: var(--ns-teal);
	font-family: var(--ns-font);
	font-size: 1rem;
	font-weight: 800;
	line-height: 24px;
	text-decoration: none;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.na-slovicko .ns-btn-all:hover,
.na-slovicko .ns-btn-all:focus-visible {
	background: var(--ns-teal);
	color: var(--ns-white);
	outline: none;
}

.na-slovicko .ns-empty {
	margin: 0;
	padding: 48px 0;
	text-align: center;
	color: var(--ns-teal);
}

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

@media (max-width: 991px) {
	.na-slovicko {
		--ns-grid-gap: 24px;
		--ns-row-gap: 40px;
	}

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

	/* Featured stacks (image on top, text below) from tablet down. */
	.na-slovicko .ns-featured__link {
		flex-direction: column;
		gap: 24px;
	}

	.na-slovicko .ns-featured__media {
		flex-basis: auto;
		align-self: stretch;
		width: 100%;
	}

	.na-slovicko .ns-featured__body {
		padding: 0;
	}
}

@media (max-width: 680px) {
	.na-slovicko {
		--ns-grid-gap: 24px;
		--ns-row-gap: 32px;
	}

	.na-slovicko .ns-grid {
		grid-template-columns: 1fr;
	}

	.na-slovicko .ns-head {
		flex-direction: column;
		align-items: flex-start;
		gap: 20px;
	}

	/* Filter tabs scroll horizontally instead of stacking tall */
	.na-slovicko .ns-filter {
		flex-wrap: nowrap;
		width: 100%;
		overflow-x: auto;
		gap: 8px;
		padding-bottom: 4px;
		scrollbar-width: none;
	}

	.na-slovicko .ns-filter::-webkit-scrollbar {
		display: none;
	}

	.na-slovicko .ns-filter__btn {
		flex: 0 0 auto;
		padding-inline: 18px;
	}

	/* Featured (already stacked at ≤991) — tighten spacing on phones. */
	.na-slovicko .ns-featured__link {
		gap: 20px;
	}

	.na-slovicko .ns-featured__body {
		gap: 16px;
	}

	.na-slovicko .ns-featured__perex {
		margin-bottom: 8px;
	}

	.na-slovicko .ns-btn-all {
		width: 100%;
	}
}
