/* ==========================================================================
   PAGE — Blog archive
   --------------------------------------------------------------------------
   Loaded on the posts archive and on category archives, after every shared
   layer.
   ========================================================================== */

/*
 * Named blog-archive, not blog: WordPress's body_class() already puts "blog"
 * on <body> for the posts index, so a bare .blog wrapper would style the body
 * there and not on a category archive.
 */
.blog-archive {
	padding-block-end: var(--space-2xl);
}

/* ==========================================================================
   HERO
   ========================================================================== */

.blog-hero {
	padding-block: var(--space-lg);
	text-align: center;
}

.blog-hero__title {
	margin: 0;
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	font-size: 32px;
	line-height: 1.2;
	color: var(--color-primary-dark);
}

.blog-hero__intro {
	max-width: 890px;
	margin: var(--space-md) auto 0;
	font-family: var(--font-ui);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.45;
	color: var(--color-text);
}

/* ==========================================================================
   FILTER BAR
   ========================================================================== */

/*
 * The rules stop at the container, not the viewport edge — in the frame they
 * span 1309px against the container's 1312, not the full 1440.
 */
/* The bar holds the sort only since the category rail was removed (client
   16.11.2026); it keeps its place at the right-hand end. The rail rules
   below stay for the day the categories come back. */
.blog-filters__inner {
	border-block: 1px solid var(--color-border);
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: var(--space-sm);
	padding-block: var(--space-sm);
}

.blog-filters__nav {
	min-width: 0;
	/* Only the rail scrolls — the page never does. */
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scrollbar-width: none;
}

.blog-filters__nav::-webkit-scrollbar {
	display: none;
}

.blog-archive .blog-filters__rail {
	display: flex;
	align-items: center;
	gap: var(--space-lg);
	margin: 0;
	padding: 0;
	list-style: none;
}

/*
 * The rail takes the width the frame gives it rather than only as much as its
 * labels need.
 *
 * UI Final draws six tabs spanning 1014px of the 1312 content width, a 147px
 * void, then the sort control ending on the right gutter — measured off the
 * frame, and its own tab gap is 48px, which is what the rule above already is.
 * Those three cannot all hold here: the Estonian labels are 285px shorter in
 * total than the English ones in the frame, so with a fixed 48px gap the rail
 * collapses to 719px and the leftover lands in the middle as a 430px hole at
 * 1440 and an 846px one at 1920.
 *
 * Composition wins over the single gap value: the rail grows to the frame's own
 * 1020px and distributes the tabs inside it, which puts the void back at ~128px
 * and keeps the sort where the design has it. The cap is what stops the tabs
 * drifting apart on a 2560 display.
 */
.blog-filters__nav {
	flex: 1 1 auto;
}

@media (min-width: 1024px) {

	.blog-archive .blog-filters__rail {
		justify-content: space-between;
		max-width: 1020px;
	}
}

.blog-filters__tab {
	display: block;
	padding-block: 3px;
	border-bottom: 2px solid transparent;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	color: var(--color-text);
	transition: color var(--transition-base);
}

.blog-filters__tab:hover {
	color: var(--color-primary);
}

.blog-filters__tab.is-current {
	border-bottom-color: var(--color-primary);
	color: var(--color-primary);
}

/* --------------------------------------------------------------------------
   SORT
   -------------------------------------------------------------------------- */

.blog-sort {
	display: flex;
	flex-shrink: 0;
	align-items: center;
	gap: var(--space-xs);
}

/*
 * forms.css sets a bare label to a block-level 12px uppercase ink caption; this
 * one sits inline beside its control. A single class already outranks the bare
 * element, so no scoping is needed.
 */
.blog-sort__label {
	margin-bottom: 0;
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--color-text);
	white-space: nowrap;
}

/*
 * forms.css styles `select` as a boxed field at (0,0,1) and paints its own
 * chevron. This one is a bare inline control, so the reset is scoped through
 * the form to win on the cascade rather than with !important.
 */
.blog-sort .blog-sort__select {
	width: auto;
	padding: 0 22px 0 0;
	border: 0;
	border-radius: 0;
	background-color: transparent;
	background-position: right center;
	background-size: 16px 16px;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	/*
	 * No tracking by default: Firefox sizes a select from its options'
	 * text without letter-spacing, so with the 0.05em tracking the box was
	 * 4.9px narrower than its own label and "Uusimad" rendered as "Uusimac"
	 * (QA 3.11.2026, Firefox 155; Chromium and WebKit include the tracking).
	 */
	letter-spacing: normal;
	color: var(--color-primary-dark);
	cursor: pointer;
}

/*
 * Where the engine can size a control to its content, the select is measured
 * from the label it is actually showing — tracking included, in every engine
 * — so the design's 0.05em comes back with no risk of clipping. Firefox ESR
 * and older engines without field-sizing keep the untracked, unclipped label.
 */
@supports (field-sizing: content) {

	.blog-sort .blog-sort__select {
		field-sizing: content;
		letter-spacing: 0.05em;
	}
}

/*
 * A finger needs 44px: the bare select was 87 x 20 to tap on a phone (visual
 * QA 4.11.2026, minor 17). On a touch screen, or any phone-width window, the
 * box grows to 44 tall with the text still centred on the same line, so it
 * looks the same and only the tappable area changes. A mouse keeps the 20px
 * control.
 */
@media (pointer: coarse), (max-width: 767px) {

	.blog-sort .blog-sort__select {
		min-height: 44px;
	}
}

.blog-sort__submit {
	padding: 6px 12px;
	border: 1px solid var(--color-rose);
	border-radius: var(--radius-sm);
	background-color: transparent;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 12px;
	line-height: 16px;
	color: var(--color-primary-dark);
	cursor: pointer;
}

/* ==========================================================================
   FEATURED ARTICLE
   ========================================================================== */

.blog-featured {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-md);
	align-items: center;
	margin-block-start: var(--space-lg);
}

.blog-featured__media {
	position: relative;
	overflow: hidden;

	/* 867 x 558 measured on the UI Final — the earlier 600 came from a reading
	   of the frame that included the body column's own height. */
	aspect-ratio: 867 / 558;
	border-radius: var(--radius-button);
	background-color: var(--color-surface-light);
}

.blog-featured__image {
	width: 100%;
	height: 100%;

	/* cover: editorial photography fills its frame rather than letterboxing. */
	object-fit: cover;
}

/* Makes the whole plate clickable without adding a second announced link. */
.blog-featured__overlay {
	position: absolute;
	inset: 0;
}

.blog-featured__body {
	min-width: 0;
}

.blog-featured__category {
	margin: 0 0 var(--space-sm);
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--color-primary-dark);
}

.blog-featured__title {
	margin: 0 0 var(--space-md);
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	font-size: 26px;
	line-height: 1.25;
	color: var(--color-ink);
}

.blog-featured__title a {
	color: inherit;
	text-decoration: none;
	transition: color var(--transition-base);
}

.blog-featured__title a:hover {
	color: var(--color-primary);
}

.blog-featured__excerpt {
	margin: 0 0 var(--space-lg);
	font-family: var(--font-ui);
	font-weight: 400;
	font-size: 16px;
	line-height: 1.5;
	color: var(--color-text);
}

.blog-featured__action {
	margin: 0;
}

.blog-featured__link {
	display: inline-flex;
	align-items: center;
	gap: var(--space-xs);
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--color-primary-dark);
	transition: color var(--transition-base);
}

.blog-featured__link:hover {
	color: var(--color-primary);
}

.blog-featured__link svg {
	transition: transform var(--transition-base);
}

.blog-featured__link:hover svg {
	transform: translateX(3px);
}

/* ==========================================================================
   ARTICLE GRID
   ========================================================================== */

.blog-archive .blog-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--space-xl) var(--space-md);
	margin: 0;
	padding: 0;
	/*
	 * On later pages the grid opens straight under the filter bar, at the 48px
	 * the frame puts between that bar and the featured article.
	 */
	padding-block-start: var(--space-lg);
	list-style: none;
}

/* Under the featured article on the first page: the 80px the frame draws there. */
.blog-archive .blog-featured + .blog-grid {
	padding-block-start: var(--space-2xl);
}

.blog-grid__item {
	min-width: 0;
}

.blog-post {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.blog-post__media {
	display: block;
	overflow: hidden;

	/* Square in the frame: a 421px image on a 421px card. */
	aspect-ratio: 1;
	border-radius: var(--radius-button);
	background-color: var(--color-surface-light);
}

.blog-post__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* A card with no photograph keeps the frame rather than showing a broken one. */
.blog-post__media--plain {
	background-color: var(--color-surface-gray);
}

.blog-post__category {
	margin: var(--space-sm) 0 0;
	font-family: var(--font-ui);
	font-weight: 500;
	font-size: 12px;
	line-height: 16px;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--color-primary-dark);
}

.blog-post__title {
	margin: var(--space-xs) 0 0;
	font-family: var(--font-heading);
	font-style: normal;
	font-weight: 400;
	font-size: 22px;
	line-height: 1.3;
	color: var(--color-ink);
}

.blog-post__title a {
	color: inherit;
	text-decoration: none;
	transition: color var(--transition-base);
}

.blog-post__title a:hover {
	color: var(--color-primary);
}

/*
 * Clamped so the rows keep a rhythm whatever length the excerpts run to. The
 * title is never clamped, and the full article is one click away.
 */
.blog-post__excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	overflow: hidden;
	margin: var(--space-xs) 0 0;
	font-family: var(--font-ui);
	font-weight: 400;
	font-size: 15px;
	line-height: 1.5;
	color: var(--color-text);
}

.blog-empty {
	margin: var(--space-2xl) 0;
	font-family: var(--font-ui);
	font-size: 16px;
	line-height: 1.6;
	text-align: center;
	color: var(--color-text);
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.blog-pagination {
	margin-block-start: var(--space-2xl);
	padding-block-start: var(--space-lg);
	border-top: 1px solid var(--color-border);
}

.blog-archive .blog-pagination__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: var(--space-xs);
	margin: 0;
	padding: 0;
	list-style: none;
}

.blog-pagination__item .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding-inline: var(--space-xs);
	border-bottom: 2px solid transparent;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 14px;
	line-height: 20px;
	letter-spacing: 0.05em;
	text-decoration: none;
	color: var(--color-text);
	transition: color var(--transition-base);
}

.blog-pagination__item a.page-numbers:hover {
	color: var(--color-primary);
}

.blog-pagination__item .page-numbers.current {
	border-bottom-color: var(--color-primary-dark);
	color: var(--color-primary-dark);
}

.blog-pagination__item .page-numbers.dots {
	min-width: auto;
	color: var(--color-text);
}

.blog-pagination__item .page-numbers svg {
	display: block;
}

/* ==========================================================================
   >= 768px
   ========================================================================== */

@media (min-width: 768px) {

	.blog-hero__title {
		font-size: 40px;
	}

	.blog-hero__intro {
		font-size: 17px;
	}

	.blog-filters__inner {
		flex-wrap: nowrap;
	}

	/* Two across from here: at 600 a second column leaves only 264px a card. */
	.blog-archive .blog-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.blog-featured__title {
		font-size: 30px;
	}
}

/* ==========================================================================
   >= 1024px — the design's composition
   ========================================================================== */

@media (min-width: 1024px) {

	.blog-hero {
		padding-block: var(--space-lg) 0;
	}

	.blog-hero__title {
		font-size: 48px;
		line-height: 1.17;
	}

	.blog-hero__intro {
		margin-block-start: var(--space-md);
		font-size: 18px;
	}

	/* The frame puts 84px between the intro and the bar's top rule. */
	.blog-filters {
		margin-block-start: var(--space-2xl);
	}

	.blog-filters__inner {
		padding-block: var(--space-md);
	}

	.blog-featured {
		grid-template-columns: repeat(12, minmax(0, 1fr));
	}

	/*
	 * The design's 8/4 leaves the text column 283px here, which is too narrow
	 * for a 32px title, so this range borrows a column back from the image.
	 */
	.blog-featured__media {
		grid-column: span 7;
	}

	.blog-featured__body {
		grid-column: span 5;
	}

	.blog-featured__title {
		font-size: 32px;
		line-height: 1.25;
	}

	.blog-archive .blog-grid {
		gap: var(--space-2xl) var(--space-md);
	}

	.blog-post__title {
		font-size: 24px;
	}

	.blog-pagination__item .page-numbers {
		padding-inline: var(--space-md);
	}
}

/* ==========================================================================
   >= 1280px — the design's full composition
   --------------------------------------------------------------------------
   Three across and the 8/4 featured split both wait for this width: at 1024
   they would leave 283px cards and a 283px text column.
   ========================================================================== */

@media (min-width: 1280px) {

	.blog-featured__media {
		grid-column: span 8;
	}

	/*
	 * The blog archive reference (figma-referents.png, rail 1312) draws 867 +
	 * 48 + 397: the text sits 48px from the image, not the grid's 24. The image
	 * keeps its eight columns; the text column gives up the extra 24.
	 */
	.blog-featured__body {
		grid-column: span 4;
		padding-inline-start: var(--space-md);
	}

	.blog-archive .blog-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* ==========================================================================
   SHORT DESKTOP WINDOW (>= 1024 wide, <= 880 tall; 820 until 19.11.2026)
   --------------------------------------------------------------------------
   Client 04.11.2026, 13" laptop (~1414 x 645 CSS px, 81px sticky bar): the
   archive opened on the heading, 80px of air and the filter bar — the
   featured article started at y508 and only 137px of its picture showed;
   its text, centred against the 547px picture, began at y620 with the title
   at 656-776, all under the 645 fold. Here the same parts keep their order
   and sizes; the air between them comes down (hero 48 -> 24 from the header,
   intro -> bar 80 -> 48, bar 24 -> 16 inside, bar -> featured 48 -> 24,
   featured -> grid 80 -> 48), which brings the featured article up to y412,
   and its text column starts level with the picture's top instead of being
   centred on it (QA-D 04.11.2026). Measured after, 3 engines: eyebrow
   412-432, title 448-568 (three lines; 448-528 where it takes two), excerpt
   from 592 (552): eyebrow and title whole and the excerpt begun above the
   fold at 1414 x 645, 1366 x 640 and 1280 x 600 (before: title 560-680 /
   531-651); "Loe artiklit" follows at 714 (675). The picture keeps its
   867:558 frame — at every short size it is already shorter than the
   window under the bar (547 of 564 at 1414 x 645, 489 of 519 at
   1280 x 600) — and the text stays 48px from it from 1280. Taller
   windows (1440 x 900 and up) keep the frame's spacing and the centred
   text above.
   ========================================================================== */

@media (min-width: 1024px) and (max-height: 880px) {

	.blog-hero {
		padding-block-start: var(--space-md);
	}

	.blog-filters {
		margin-block-start: var(--space-lg);
	}

	.blog-filters__inner {
		padding-block: var(--space-sm);
	}

	.blog-featured {
		align-items: start;
		margin-block-start: var(--space-md);
	}

	.blog-archive .blog-featured + .blog-grid {
		padding-block-start: var(--space-lg);
	}
}
