/*
Theme Name:   Arvestagir
Theme URI:    https://arvestagir.am/
Description:  Arvestagir cultural magazine — child theme of Newspaper implementing the arvestagir logobook and website design (Montserrat Arm, black / #0808B2 / #FCFFC7, scribble mark). Trilingual with WPML (am, en, ru).
Author:       Arvestagir
Template:     Newspaper
Version:      1.0.0
Text Domain:  arvestagir
*/

/* ------------------------------------------------------------------ fonts */

@font-face { font-family: "Montserrat arm"; src: url("assets/fonts/Montserratarm-Light.woff") format("woff"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat arm"; src: url("assets/fonts/Montserratarm-Regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat arm"; src: url("assets/fonts/Montserratarm-Medium.woff") format("woff"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat arm"; src: url("assets/fonts/Montserratarm-Bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Montserrat arm"; src: url("assets/fonts/Montserratarm-ExtraBold.woff") format("woff"); font-weight: 800; font-style: normal; font-display: swap; }

/* ----------------------------------------------------------------- tokens */

:root {
	--ag-black: #000;
	--ag-blue: #0808b2;
	--ag-cream: #fcffc7;
	--ag-white: #fff;
	--ag-grey: #5b5b5b;
	--ag-line: #d9d9d9;

	--ag-font: "Montserrat arm", "Montserrat", "Helvetica Neue", Helvetica, Arial, sans-serif;

	/* Measured on the 1920px design, scaled with the viewport. */
	--ag-gutter: clamp(16px, 7.7vw, 148px);
	--ag-max: 1640px;
	--ag-fs-nav: clamp(16px, 1.56vw, 30px);
	--ag-fs-lang: clamp(15px, 1.36vw, 26px);
	--ag-fs-cat: clamp(13px, 1.05vw, 20px);
	--ag-fs-title: clamp(19px, 1.67vw, 32px);
	--ag-fs-lead: clamp(16px, 1.46vw, 28px);
	--ag-fs-date: clamp(15px, 1.46vw, 28px);
	--ag-fs-body: clamp(17px, 1.25vw, 24px);
	--ag-fs-side-title: clamp(15px, 1.1vw, 21px);
	--ag-fs-side-text: clamp(14px, 1vw, 19px);
	--ag-gap: clamp(20px, 4.5vw, 88px);
	--ag-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ------------------------------------------------------------------- base */

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body.ag {
	margin: 0;
	background: var(--ag-white);
	color: var(--ag-black);
	font-family: var(--ag-font);
	font-size: var(--ag-fs-body);
	font-weight: 400;
	line-height: 1.3;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body.ag *,
body.ag *::before,
body.ag *::after { box-sizing: border-box; }

body.ag h1, body.ag h2, body.ag h3, body.ag h4, body.ag h5, body.ag h6,
body.ag p, body.ag ul, body.ag ol, body.ag figure, body.ag blockquote { margin: 0; padding: 0; }

body.ag h1, body.ag h2, body.ag h3, body.ag h4, body.ag h5, body.ag h6 {
	font-family: var(--ag-font);
	color: inherit;
	letter-spacing: 0;
	text-transform: none;
}

body.ag a { color: inherit; text-decoration: none; transition: color .2s var(--ag-ease); }
body.ag a:hover { color: var(--ag-blue); }
body.ag a:focus-visible,
body.ag button:focus-visible,
body.ag input:focus-visible { outline: 2px solid var(--ag-blue); outline-offset: 3px; }

/* Newspaper's base CSS indents every li; reset inside the theme's own lists. */
body.ag .ag-menu li, body.ag .ag-langs li, body.ag .ag-social li, body.ag .ag-article__tags li { margin: 0; padding: 0; line-height: inherit; list-style: none; }
body.ag .ag-nav { width: 100%; }

body.ag img { display: block; max-width: 100%; height: auto; opacity: 1; }
body.ag ::selection { background: var(--ag-cream); color: var(--ag-black); }

.ag-sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ag-skip { position: absolute; left: 16px; top: -100px; z-index: 100; padding: 12px 18px; background: var(--ag-blue); color: #fff !important; }
.ag-skip:focus { top: 16px; }

body.ag .ag-wrap {
	width: min(var(--ag-max), 100% - 2 * var(--ag-gutter));
	margin-inline: auto;
}

.ag-main { display: block; min-height: 50vh; }

.ag-icon-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 1.25em; height: 1.25em; padding: 0;
	border: 0; background: none; color: inherit; cursor: pointer;
	font-size: var(--ag-fs-lang);
	transition: color .2s var(--ag-ease);
}
.ag-icon-btn svg { width: 100%; height: 100%; }
/* Only real pointers get hover colours: touch screens keep :hover after a tap (blue ☰). */
@media (hover: hover) {
	.ag-icon-btn:hover { color: var(--ag-blue); }
}

/* Hand-drawn underline under headings (logobook p.3–4). */
.ag-underline {
	display: block;
	width: min(100%, 15em);
	height: .6em;
	margin-top: -.15em;
	overflow: visible;
	fill: none;
	stroke: var(--ag-blue);
	stroke-width: 2;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
}
.ag-underline path { vector-effect: non-scaling-stroke; }

/* ----------------------------------------------------------------- header */

.ag-header { padding-top: clamp(20px, 2.3vw, 44px); }

/*
 * Design (1920px): logo top-left; languages · search · social on the logo's bottom edge,
 * right-aligned; the menu on its own row below, right-aligned across the full width.
 */
.ag-header__inner {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	grid-template-rows: auto auto;
	column-gap: 32px;
	row-gap: clamp(14px, 3.1vw, 60px);
}

.ag-header__logo {
	grid-column: 1;
	grid-row: 1;
	width: clamp(150px, 17.3vw, 332px);
	color: var(--ag-black);
}
.ag-header__logo svg { display: block; width: 100%; height: auto; }

/* The wrapper only groups markup; its children are placed on the header grid. */
.ag-header__side { display: contents; }

.ag-header__tools {
	grid-column: 2;
	grid-row: 1;
	align-self: end;
	justify-self: end;
	display: flex;
	align-items: center;
	gap: clamp(18px, 2.4vw, 46px);
	margin-bottom: -.4em;
}

.ag-nav { grid-column: 1 / -1; grid-row: 2; justify-self: end; }
.ag-nav__top, .ag-nav__extra { display: none; }

.ag-langs { display: flex; gap: clamp(14px, 1.6vw, 30px); list-style: none; font-size: var(--ag-fs-lang); font-weight: 400; }
.ag-langs .is-active { font-weight: 400; }
.ag-langs a:hover { color: var(--ag-blue); }

.ag-social { display: flex; gap: clamp(12px, 1.3vw, 24px); list-style: none; margin-left: clamp(8px, 1vw, 18px); }
.ag-menu-toggle { display: none; }


.ag-menu {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	gap: .4em clamp(18px, 2.9vw, 56px);
	list-style: none;
	font-size: var(--ag-fs-nav);
	font-weight: 400;
	text-transform: lowercase;
}
/* Russian labels are much longer than the Armenian ones the design was drawn with. */
.ag-lang-ru .ag-header .ag-menu { gap: .4em clamp(14px, 1.7vw, 32px); }

.ag-menu li.is-current > a,
.ag-menu .current-menu-item > a,
.ag-menu .current-category-ancestor > a,
.ag-menu .current-post-ancestor > a { color: var(--ag-blue); }

.ag-search { padding-top: clamp(24px, 3vw, 48px); }
.ag-search[hidden] { display: none; }
.ag-searchform {
	display: flex; align-items: center; gap: 16px;
	padding: 14px 20px;
	background: var(--ag-cream);
	font-size: var(--ag-fs-lead);
}
.ag-searchform input[type="search"] {
	flex: 1; min-width: 0;
	border: 0; border-bottom: 2px solid var(--ag-blue);
	background: transparent;
	padding: 6px 0;
	font: 300 1em/1.3 var(--ag-font);
	color: var(--ag-black);
	border-radius: 0;
	-webkit-appearance: none;
}
.ag-searchform input[type="search"]:focus { outline: none; }

/* -------------------------------------------------------------------- cards */

.ag-card { position: relative; min-width: 0; }
.ag-card__media { position: relative; display: block; overflow: hidden; background: #f2f2f2; }
body.ag .ag-card__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ag-ease); }
.ag-card:hover .ag-card__media img { transform: scale(1.03); }
.ag-card__placeholder { display: grid; place-items: center; width: 100%; height: 100%; background: var(--ag-cream); }
.ag-card__placeholder svg { width: 55%; height: auto; }

.ag-card__cat {
	font-size: var(--ag-fs-cat);
	font-weight: 300;
	text-transform: lowercase;
	letter-spacing: .01em;
}
.ag-card__title {
	font-size: var(--ag-fs-title);
	font-weight: 800;
	line-height: 1.16;
	overflow-wrap: break-word;
}
.ag-card__title a { background: linear-gradient(var(--ag-blue), var(--ag-blue)) 0 100% / 0 2px no-repeat; transition: background-size .35s var(--ag-ease), color .2s; }
.ag-card:hover .ag-card__title a { background-size: 100% 2px; color: var(--ag-black); }
.ag-card__lead { font-size: var(--ag-fs-lead); font-weight: 300; line-height: 1.22; }
.ag-card__date { font-size: var(--ag-fs-date); font-weight: 400; }

.ag-card__body { display: flex; flex-direction: column; gap: clamp(10px, 1.2vw, 22px); }

/* feature: large image, text column on the right */
.ag-card--feature {
	display: grid;
	grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
	gap: clamp(16px, 1.6vw, 32px);
	align-items: start;
}
.ag-card--feature .ag-card__media { aspect-ratio: 814 / 610; }
.ag-card--feature .ag-card__body { gap: clamp(12px, 1.5vw, 28px); }
.ag-card--feature .ag-card__date { margin-top: clamp(8px, 1.5vw, 30px); }

/* tall: portrait image (326 × 608 on the design) */
.ag-card--tall .ag-card__media { aspect-ratio: 326 / 608; margin-bottom: clamp(16px, 1.7vw, 32px); }
.ag-card--tall .ag-card__date { margin-top: clamp(8px, 1.3vw, 24px); }

/* wide: banner across the main column */
.ag-card--wide .ag-card__media { aspect-ratio: 1142 / 232; margin-bottom: clamp(16px, 2vw, 40px); }
.ag-card--wide .ag-card__body { gap: clamp(8px, .8vw, 14px); }
.ag-card--wide .ag-card__lead { max-width: 34em; }

/* side + related: small cards */
.ag-card--side .ag-card__cat,
.ag-card--related .ag-card__cat { margin-bottom: clamp(10px, 1.2vw, 22px); }
.ag-card--side .ag-card__media,
.ag-card--related .ag-card__media { aspect-ratio: 318 / 222; margin-bottom: clamp(14px, 1.6vw, 30px); }
.ag-card--side .ag-card__body { gap: clamp(8px, .8vw, 14px); }
.ag-card--side .ag-card__title { font-size: var(--ag-fs-side-title); line-height: 1.2; }
.ag-card--side .ag-card__lead { font-size: var(--ag-fs-side-text); font-weight: 400; }
.ag-card--side .ag-card__date { font-size: var(--ag-fs-side-text); margin-top: -6px; }
.ag-card--related .ag-card__title { font-size: var(--ag-fs-title); }
.ag-card--related .ag-card__lead,
.ag-card--related .ag-card__date { font-size: var(--ag-fs-lead); font-weight: 300; }
.ag-card--related .ag-card__date { font-weight: 400; margin-top: -6px; }

/* --------------------------------------------------------------------- home */

.ag-home {
	display: grid;
	grid-template-columns: minmax(0, 1fr) clamp(220px, 16.6vw, 320px);
	gap: clamp(32px, 7.2vw, 140px);
	padding-top: clamp(40px, 7.5vw, 145px);
	padding-bottom: clamp(60px, 7vw, 130px);
}

.ag-home__main { display: flex; flex-direction: column; gap: clamp(48px, 3.7vw, 72px); }
.ag-home__side { display: flex; flex-direction: column; gap: clamp(36px, 2.6vw, 50px); }

.ag-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(36px, 3vw, 56px) var(--ag-gap);
}

.ag-more { margin-top: 8px; }
.ag-more__link {
	display: inline-block;
	font-size: var(--ag-fs-nav);
	font-weight: 300;
	text-transform: lowercase;
	padding-bottom: 4px;
	border-bottom: 2px solid var(--ag-blue);
}

/* ------------------------------------------------------------------ article */

.ag-article { padding-top: clamp(32px, 2.9vw, 56px); }

.ag-article__hero img {
	width: 100%;
	max-height: min(80vh, 760px);
	object-fit: cover;
}

.ag-article__layout {
	display: grid;
	grid-template-columns: clamp(220px, 15.5vw, 300px) minmax(0, 920px);
	gap: clamp(32px, 5.3vw, 100px);
	padding-top: clamp(40px, 4.6vw, 90px);
	padding-bottom: clamp(56px, 4vw, 80px);
}

.ag-article__meta { display: flex; flex-direction: column; gap: clamp(12px, 1.2vw, 22px); align-self: start; position: sticky; top: 24px; }
.ag-article__cat { font-size: var(--ag-fs-cat); font-weight: 400; text-transform: lowercase; color: var(--ag-blue); }
.ag-article__cat a { color: var(--ag-blue); }
.ag-article__title { font-size: var(--ag-fs-title); font-weight: 800; line-height: 1.16; overflow-wrap: break-word; }
.ag-article__meta .ag-underline { margin-top: -6px; }
.ag-article__lead { font-size: var(--ag-fs-lead); font-weight: 300; line-height: 1.22; }
.ag-article__date { font-size: var(--ag-fs-cat); margin-top: clamp(8px, 1.6vw, 30px); }
.ag-article__author { font-size: var(--ag-fs-cat); font-weight: 300; margin-top: clamp(16px, 3vw, 60px); line-height: 1.35; }
.ag-article__author strong { font-weight: 800; }
.ag-article__tags { display: flex; flex-wrap: wrap; gap: 6px 14px; list-style: none; font-size: var(--ag-fs-cat); font-weight: 300; margin-top: 8px; }
.ag-article__tags a { color: var(--ag-grey); }
.ag-article__tags a:hover { color: var(--ag-blue); }

/* Article text */
.ag-prose { font-size: var(--ag-fs-body); line-height: 1.27; font-weight: 400; overflow-wrap: break-word; }
.ag-prose > * + * { margin-top: 1.05em; }
.ag-prose p { margin: 0; }
.ag-prose p[style*="justify"] { text-align: left !important; }
.ag-prose strong, .ag-prose b { font-weight: 700; }
.ag-prose em { font-style: italic; }
.ag-prose a { color: var(--ag-blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; }
.ag-prose a:has(> img) { text-decoration: none; }
.ag-prose h2, .ag-prose h3, .ag-prose h4, .ag-prose h5 { font-weight: 800; line-height: 1.2; margin-top: 1.6em; }
.ag-prose h2 { font-size: 1.35em; }
.ag-prose h3 { font-size: 1.2em; }
.ag-prose h4, .ag-prose h5, .ag-prose h6 { font-size: 1.05em; }
.ag-prose ul, .ag-prose ol { padding-left: 1.3em; }
.ag-prose li + li { margin-top: .35em; }
.ag-prose hr { border: 0; height: 2px; background: var(--ag-blue); width: 4em; margin: 2em 0; }
.ag-prose blockquote {
	padding: .2em 0 .2em 1.1em;
	border-left: 2px solid var(--ag-blue);
	font-weight: 300;
	font-size: 1.12em;
}
.ag-prose img { margin-block: 1.6em .6em; }
.ag-prose img.alignleft,
.ag-prose .alignleft { float: left; margin: .3em 1.4em 1em 0; max-width: 46%; }
.ag-prose img.alignright,
.ag-prose .alignright { float: right; margin: .3em 0 1em 1.4em; max-width: 46%; }
.ag-prose img.aligncenter,
.ag-prose .aligncenter { margin-inline: auto; }
.ag-prose::after { content: ""; display: table; clear: both; }

.ag-prose .wp-caption { max-width: 100%; width: auto !important; }
.ag-prose .wp-caption img { margin-bottom: .6em; }
.ag-prose .wp-caption-text,
.ag-prose figcaption { font-size: .78em; font-weight: 300; line-height: 1.35; color: var(--ag-grey); }

.ag-prose iframe,
.ag-prose .wp-block-embed iframe,
.ag-prose .wp-embedded-content { width: 100%; max-width: 100%; aspect-ratio: 16 / 9; height: auto; border: 0; }

.ag-prose .gallery {
	display: grid;
	grid-template-columns: repeat(var(--ag-gallery-cols, 3), minmax(0, 1fr));
	gap: 12px;
	margin-block: 1.6em;
}
.ag-prose .gallery.gallery-columns-2 { --ag-gallery-cols: 2; }
.ag-prose .gallery.gallery-columns-4 { --ag-gallery-cols: 4; }
.ag-prose .gallery br { display: none; }
.ag-prose .gallery-item { margin: 0 !important; width: auto !important; }
.ag-prose .gallery-item img { margin: 0; width: 100%; aspect-ratio: 1; object-fit: cover; border: 0 !important; }
.ag-prose .gallery-caption { display: none; }
.ag-prose .gallery-icon a { display: block; overflow: hidden; cursor: zoom-in; background: #f2f2f2; }
.ag-prose .gallery-icon img { transition: transform .5s var(--ag-ease), opacity .3s; }
.ag-prose .gallery-icon a:hover img { transform: scale(1.04); }
.ag-prose a:has(> img) { cursor: zoom-in; }

/* Lightbox (site.js) */
.ag-lightbox {
	position: fixed; inset: 0; z-index: 1000;
	display: grid; grid-template-columns: 72px minmax(0, 1fr) 72px; align-items: center;
	padding: 56px 12px 64px;
	background: rgba(0, 0, 0, .94);
	color: #fff;
	animation: ag-fade .2s ease-out;
}
.ag-lightbox[hidden] { display: none; }
.ag-lightbox-open, .ag-lightbox-open body { overflow: hidden; }
.ag-lightbox__stage { margin: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; min-height: 0; }
body.ag .ag-lightbox__stage img { max-width: 100%; max-height: calc(100vh - 170px); width: auto; height: auto; object-fit: contain; transition: opacity .2s; box-shadow: 0 10px 40px rgba(0,0,0,.4); }
.ag-lightbox.is-loading .ag-lightbox__stage img { opacity: .35; }
.ag-lightbox__caption { max-width: 900px; text-align: center; font-size: clamp(14px, 1vw, 18px); font-weight: 300; line-height: 1.35; color: rgba(255,255,255,.85); }
.ag-lightbox__caption:empty { display: none; }
.ag-lightbox__count { position: absolute; left: 0; right: 0; bottom: 22px; text-align: center; font-size: 15px; font-weight: 400; letter-spacing: .05em; color: rgba(255,255,255,.75); }
.ag-lightbox button {
	display: inline-flex; align-items: center; justify-content: center;
	width: 52px; height: 52px; padding: 0;
	border: 0; border-radius: 50%; background: transparent; color: #fff; cursor: pointer;
	transition: background .2s, color .2s;
}
.ag-lightbox button:hover { background: var(--ag-blue); }
.ag-lightbox button:focus-visible { outline: 2px solid #8f8fff; outline-offset: 2px; }
.ag-lightbox svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ag-lightbox__close { position: absolute; top: 12px; right: 12px; }
.ag-lightbox__prev { justify-self: start; }
.ag-lightbox__next { justify-self: end; }
.ag-lightbox.is-single .ag-lightbox__nav { visibility: hidden; }
@keyframes ag-fade { from { opacity: 0; } }
@media (max-width: 700px) {
	.ag-lightbox { grid-template-columns: minmax(0, 1fr); padding: 56px 8px 72px; }
	.ag-lightbox__nav { position: absolute; bottom: 10px; }
	.ag-lightbox__prev { left: 16px; }
	.ag-lightbox__next { right: 16px; }
	.ag-lightbox__count { bottom: 26px; }
}

.ag-pages { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2.4em; font-size: var(--ag-fs-cat); }
.ag-pages a, .ag-pages > span:not(.screen-reader-text) { display: inline-grid; place-items: center; min-width: 2.2em; height: 2.2em; border: 1px solid var(--ag-black); text-decoration: none; }
.ag-pages > span.current, .ag-pages .post-page-numbers.current { background: var(--ag-black); color: #fff; }

/* Related */
.ag-related { padding-bottom: clamp(60px, 6vw, 110px); }
body.ag .ag-related__title { font-size: var(--ag-fs-title); font-weight: 800; margin-bottom: clamp(32px, 5.6vw, 108px); text-transform: lowercase; }
.ag-related .ag-grid { gap: 40px clamp(24px, 10vw, 200px); grid-template-columns: repeat(3, minmax(0, 360px)); }

/* ------------------------------------------------------------------ archive */

.ag-archive, .ag-page { padding-top: clamp(40px, 5.6vw, 108px); padding-bottom: clamp(60px, 6vw, 120px); }
.ag-archive__head { margin-bottom: clamp(40px, 4.2vw, 80px); max-width: 46em; }
body.ag .ag-archive__title { font-size: clamp(28px, 3.1vw, 60px); font-weight: 800; line-height: 1.08; text-transform: lowercase; overflow-wrap: break-word; }
.ag-archive__head .ag-underline { width: min(100%, 9em); height: .8em; font-size: clamp(28px, 3.1vw, 60px); }
.ag-archive__desc { margin-top: 1.2em; font-size: var(--ag-fs-lead); font-weight: 300; }
.ag-archive .ag-grid { row-gap: clamp(48px, 4.5vw, 88px); }
.ag-empty { font-size: var(--ag-fs-lead); font-weight: 300; margin-bottom: 1.2em; }

.ag-page .ag-prose { max-width: 920px; }
.ag-page__image { margin-bottom: clamp(32px, 3vw, 56px); }

.ag-pagination { margin-top: clamp(56px, 5vw, 96px); }

/* Infinite scroll (site.js): the marker replaces the numbered pagination when JS runs. */
.ag-feed-more { display: flex; justify-content: center; margin-top: clamp(40px, 4vw, 80px); min-height: 48px; }
.ag-js-feed .ag-pagination { display: none; }
.ag-js-feed .ag-feed-more .ag-more__link { display: none; }
.ag-js-feed .ag-feed-more.is-failed .ag-more__link { display: inline-block; }
.ag-feed-more__loading { display: none; width: 40px; height: 40px; border: 2px solid var(--ag-blue); border-right-color: transparent; border-radius: 50% 40% 55% 45%; animation: ag-spin .9s linear infinite; }
.ag-feed-more.is-loading .ag-feed-more__loading { display: block; }
.ag-home .ag-feed-more { margin-top: 0; }
@keyframes ag-spin { to { transform: rotate(360deg); } }
.ag-pagination .nav-links { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; font-size: var(--ag-fs-lang); font-weight: 300; }
.ag-pagination .page-numbers { padding: 2px 4px; }
.ag-pagination .page-numbers.current { font-weight: 700; border-bottom: 2px solid var(--ag-blue); }
.ag-pagination .prev, .ag-pagination .next { text-transform: lowercase; }

/* ---------------------------------------------------------------------- 404 */

.ag-404 { position: relative; overflow: hidden; background: var(--ag-cream); margin-top: clamp(40px, 5vw, 96px); padding-bottom: clamp(60px, 6vw, 120px); }
.ag-404__mark { width: min(1100px, 120%); margin: 0 auto -6vw; opacity: .95; }
.ag-404__mark svg { width: 100%; height: auto; }
.ag-404__mark path { stroke-width: 4; }
.ag-404__text { position: relative; display: flex; flex-direction: column; gap: 28px; max-width: 760px; }
.ag-404__code { font-size: clamp(56px, 8vw, 150px); font-weight: 800; line-height: 1; }

/* ------------------------------------------------------------------- footer */

.ag-footer { background: var(--ag-black); color: var(--ag-white); padding-block: clamp(48px, 5.6vw, 108px); }
/* Brand blue is too dark on black for hover text; use a lighter tint of it. */
.ag-footer a:hover, .ag-footer .ag-icon-btn:hover { color: #8f8fff !important; }

.ag-footer__inner { display: flex; justify-content: space-between; align-items: flex-start; gap: 40px; }
.ag-footer__logo { flex: 0 0 auto; width: clamp(150px, 15.8vw, 304px); color: var(--ag-white); margin-top: clamp(0px, .5vw, 10px); }
.ag-footer__logo svg { width: 100%; height: auto; }

.ag-footer__side { display: flex; flex-direction: column; align-items: flex-end; gap: clamp(16px, 1.6vw, 30px); text-align: right; }
.ag-footer .ag-langs { margin-bottom: clamp(0px, .4vw, 6px); }
.ag-footer .ag-menu { justify-content: flex-end; max-width: 1000px; row-gap: clamp(10px, 1.1vw, 20px); }
.ag-footer__tools { display: flex; align-items: center; gap: clamp(22px, 3.5vw, 66px); margin-top: clamp(8px, 1.2vw, 22px); }
.ag-footer__copy { margin-top: clamp(28px, 4.5vw, 86px); font-size: var(--ag-fs-lang); font-weight: 400; }

/* -------------------------------------------------------------- responsive */

@media (min-width: 901px) {
	.ag-card--tall .ag-card__media { aspect-ratio: 1 / 1; }
}

@media (max-width: 1180px) {
	.ag-home { grid-template-columns: minmax(0, 1fr); }
	.ag-home__side { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px var(--ag-gap); border-top: 1px solid var(--ag-line); padding-top: 48px; }
	.ag-article__layout { grid-template-columns: minmax(0, 1fr); }
	.ag-article__meta { position: static; max-width: 760px; }
	.ag-article__content { max-width: 920px; }
}

@media (max-width: 900px) {
	.ag-header { padding-top: 24px; }
	.ag-header__inner { row-gap: 0; align-items: center; }
	.ag-header__tools { align-self: center; gap: 16px; margin-bottom: 0; }
	.ag-header .ag-social { display: none; }
	.ag-menu-toggle { display: inline-flex; width: 30px; height: 30px; }
	.ag-header .ag-icon-btn { font-size: 20px; }

	.ag-nav {
		position: fixed; inset: 0; z-index: 50;
		display: flex; flex-direction: column; justify-content: space-between; gap: 32px;
		padding: 24px max(var(--ag-gutter), (100% - var(--ag-max)) / 2) 32px;
		overflow-y: auto;
		background: var(--ag-cream);
		transform: translateY(-100%);
		visibility: hidden;
		transition: transform .45s var(--ag-ease), visibility 0s .45s;
	}
	.ag-nav-open .ag-nav { transform: none; visibility: visible; transition: transform .45s var(--ag-ease); }
	.ag-nav .ag-menu { flex-direction: column; align-items: flex-start; justify-content: center; gap: 18px; font-size: 30px; flex: 1 0 auto; }

	/* Mobile menu: logo (same place as in the header), menu, then languages + social. */
	/* Top row mirrors the header (same padding, logo size and button box), so nothing moves. */
	body.ag .ag-nav__top { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex: 0 0 auto; }
	body.ag .ag-nav__logo { display: block; flex: 0 0 auto; width: clamp(150px, 17.3vw, 332px); color: var(--ag-black); }
	.ag-nav__logo svg { display: block; width: 100%; height: auto; }
	body.ag .ag-nav__extra {
		display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px 24px;
		padding-top: 22px; border-top: 1px solid rgba(0, 0, 0, .15);
	}
	.ag-nav__extra .ag-langs { font-size: 22px; gap: 22px; }
	.ag-nav__extra .ag-langs .is-active { color: var(--ag-blue); }
	.ag-nav__extra .ag-social { display: flex; gap: 18px; margin-left: 0; }
	.ag-nav__extra .ag-icon-btn { font-size: 24px; }
	.ag-nav-open { overflow: hidden; }

	.ag-card--feature { grid-template-columns: minmax(0, 1fr); }
	.ag-card--feature .ag-card__media { aspect-ratio: 4 / 3; }
	.ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ag-home__side { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ag-card--tall .ag-card__media { aspect-ratio: 3 / 4; }
	.ag-card--wide .ag-card__media { aspect-ratio: 16 / 7; }
	.ag-related .ag-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.ag-footer__inner { flex-direction: column; align-items: flex-start; }
	.ag-footer__side { align-items: flex-start; text-align: left; }
	.ag-footer .ag-menu { justify-content: flex-start; }
}

@media (max-width: 560px) {
	.ag-grid,
	.ag-home__side,
	.ag-related .ag-grid { grid-template-columns: minmax(0, 1fr); }
	.ag-card--tall .ag-card__media { aspect-ratio: 4 / 3; }
	.ag-prose .alignleft, .ag-prose .alignright,
	.ag-prose img.alignleft, .ag-prose img.alignright { float: none; max-width: 100%; margin: 1em 0; }
	.ag-prose .gallery { --ag-gallery-cols: 2 !important; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	body.ag *, body.ag *::before, body.ag *::after { transition: none !important; animation: none !important; }
}
