/* Header, navigation, footer, section layout. Breakpoints: 1240 (nav) · 991 · 767 · 478. */

/* Header ---------------------------------------------------------------- */

.site-header {
	position: relative;
	z-index: 50;
	background: var(--white);
}

.site-header__top-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	align-content: center;
	gap: 0.5em 2em;
	/* Fixed like the Bricks bar (54px from 1440 up, 51.6px at 991); when the contacts wrap they overflow it. */
	height: min(calc(0.5367vw + 4.627rem), 5.4rem);
	padding-top: var(--space-xs);
}

.site-header__search {
	display: inline-flex;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.site-header__contact {
	display: inline-flex;
	align-items: center;
	gap: 0.5em;
	color: var(--base);
	font-style: normal;
}

.site-header__contact span {
	font-family: var(--font-body);
	font-size: 1.6rem;
}

.site-header__social {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.site-header__social a,
.site-header__contact img {
	display: inline-flex;
	flex-shrink: 0;
}

.site-header__main-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--content-gap);
	padding-bottom: var(--space-s);
}

/* 10em of the fluid body size, like the Frames header (180px at 1440). */
.site-header__logo img {
	width: calc(var(--text-m) * 10);
	height: auto;
}

/* Bricks: 15px list gap after an empty hidden menu item + 16px wrapper gap = 31px before the button at every width. */
.site-header__video {
	flex-shrink: 0;
	margin-left: calc(3.1rem - var(--content-gap));
}

.site-header__toggle {
	display: none;
	/* Padding enlarges the tap target; the negative margin keeps the icon where Bricks drew it. */
	margin: -0.4rem;
	padding: 0.4rem;
	border: 0;
	background: none;
	cursor: pointer;
}

.site-header__toggle-close {
	display: none;
}

/* Navigation (desktop) */

.site-nav {
	margin-left: auto;
}

.site-nav__list {
	display: flex;
	align-items: center;
	gap: 1.5rem;
	padding: 0;
	list-style: none;
}

.site-nav__item--mobile-only {
	display: none;
}

.site-nav__toggle {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.site-nav__link {
	display: inline-flex;
	color: var(--base);
	font-family: var(--font-body);
	font-size: 1.6rem;
}

.site-nav__item.is-current > .site-nav__link,
.site-nav__item.is-current > .site-nav__toggle .site-nav__link {
	color: var(--action);
	font-size: 1.8rem;
	font-weight: 600;
}

.site-nav__chevron {
	display: inline-flex;
	width: 1.6rem;
	height: 1.6rem;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 0;
	background: none;
	color: var(--base);
	cursor: pointer;
	transition: transform var(--transition);
}

/* Bricks only flipped the chevron in the desktop mega menu; the mobile accordion keeps it pointing down. */
@media (min-width: 1241px) {
	.site-nav__chevron[aria-expanded='true'] {
		transform: rotate(180deg);
	}
}

.site-nav__item.is-current .site-nav__chevron {
	color: var(--action);
}

.site-nav__dropdown {
	position: absolute;
	top: calc(100% - 0.6rem);
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	padding-block: 3rem;
	overflow: hidden;
	visibility: hidden;
	opacity: 0;
	background: var(--white);
	box-shadow: 0 -4px 4px 4px rgba(208, 208, 208, 0.25);
	transition: opacity var(--transition), visibility var(--transition);
}

@media (min-width: 1241px) {
	.site-nav__item--dropdown:hover > .site-nav__dropdown,
	.site-nav__item--dropdown:focus-within > .site-nav__dropdown,
	.site-nav__toggle:has([aria-expanded='true']) + .site-nav__dropdown {
		visibility: visible;
		opacity: 1;
	}

	/* Bricks flips the chevron while the mega menu is open on hover too. */
	.site-nav__item--dropdown:hover .site-nav__chevron,
	.site-nav__item--dropdown:focus-within .site-nav__chevron {
		transform: rotate(180deg);
	}

	/* Keep the dropdown open while the pointer travels down to it. */
	.site-nav__item--dropdown:hover::after {
		content: '';
		position: absolute;
		left: 0;
		right: 0;
		top: 100%;
		height: 3rem;
	}
}

/* Four 25% columns in an 80vw block, as the Bricks mega menu. */
.site-nav__sub {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 0.5rem;
	width: 80vw;
	max-width: 144rem;
	padding: 0;
	list-style: none;
}

.site-nav__sub li {
	display: flex;
	width: 25%;
}

.site-nav__sublink {
	width: 100%;
	color: var(--base);
	font-family: var(--font-body);
	font-size: 1.6rem;
	line-height: 1.2;
}

.site-nav__sublink:hover,
.site-nav__sublink.is-current {
	color: var(--action);
}

.site-nav__sublink.is-pinned,
.site-nav__sublink.is-current {
	font-weight: 600;
}

@media (min-width: 1241px) {
	.site-nav__dropdown--aprikojums .site-nav__sub {
		justify-content: center;
	}
}

/* Noderīgi rows are a fixed 4rem tall in the Bricks header (Katalogi / Žurnāli pinned in bold). */
.site-nav__dropdown--noderigi .site-nav__sub li {
	height: 4rem;
}

.site-nav__graphic {
	position: absolute;
	top: 13.6rem;
	left: -25rem;
	width: 40rem;
	max-width: none;
	transform: rotate(90deg);
	pointer-events: none;
}

/* Navigation (mobile / tablet): full-screen panel. */

@media (max-width: 1240px) {
	.site-header__toggle {
		display: inline-flex;
		order: 3;
	}

	.site-header .site-header__video {
		display: none;
	}

	.site-header.is-menu-open .site-header__toggle-open {
		display: none;
	}

	.site-header.is-menu-open .site-header__toggle-close {
		display: block;
	}

	.site-header.is-menu-open .site-header__toggle {
		position: fixed;
		top: 10rem;
		right: 4rem;
		z-index: 61;
	}

	.site-nav {
		position: fixed;
		inset: 0;
		z-index: 60;
		margin: 0;
		padding: 15rem 0 4rem;
		overflow-y: auto;
		overscroll-behavior: contain;
		background: var(--white);
		visibility: hidden;
		opacity: 0;
		transition: opacity 0.2s, visibility 0.2s;
	}

	.site-header.is-menu-open .site-nav {
		visibility: visible;
		opacity: 1;
	}

	.has-open-menu body {
		overflow: hidden;
	}

	.site-nav__list {
		flex-direction: column;
		align-items: stretch;
		gap: 2.5rem;
	}

	.site-nav__item {
		padding: 0 5.6rem 0 4rem;
	}

	.site-nav__item--mobile-only {
		display: block;
	}

	.site-nav__link,
	.site-nav__item.is-current > .site-nav__link,
	.site-nav__item.is-current > .site-nav__toggle .site-nav__link {
		font-size: 1.8rem;
		font-weight: 600;
	}

	.site-nav__toggle {
		justify-content: space-between;
		cursor: pointer;
	}

	.site-nav__chevron {
		width: 1.8rem;
		height: 1.8rem;
	}

	.site-nav__dropdown {
		position: static;
		display: none;
		padding: 0;
		overflow: visible;
		visibility: visible;
		opacity: 1;
		box-shadow: none;
	}

	.site-nav__toggle:has([aria-expanded='true']) + .site-nav__dropdown {
		display: block;
	}

	.site-nav__sub {
		flex-direction: column;
		flex-wrap: nowrap;
		gap: 1.5rem;
		width: 25rem;
		max-width: 100%;
		max-height: 80vw;
		margin: 2.4rem 0 1rem;
		padding-left: 1rem;
		overflow-y: auto;
	}

	.site-nav__sub li {
		flex-shrink: 0;
		width: 100%;
	}

	.site-nav__dropdown--noderigi .site-nav__sub {
		max-height: none;
	}

	.site-nav__graphic {
		display: none;
	}
}

@media (max-width: 991px) {
	.site-header__logo img {
		width: 10rem;
	}
}

@media (max-width: 767px) {
	.site-header__top-inner {
		justify-content: center;
	}
}

/* Phones: the contact bar collapses to a spacer, as on the Bricks site. */
@media (max-width: 478px) {
	/* Bricks: the emptied bar keeps its --space-xs top padding plus a 20px bottom margin. */
	.site-header__top-inner {
		height: calc(var(--space-xs) + 2rem);
		padding-top: 0;
	}

	.site-header__top-inner > * {
		display: none;
	}
}

/* Search dialog */

.search-dialog {
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--white);
}

.search-dialog::backdrop {
	background: rgba(0, 43, 27, 0.4);
}

.search-dialog__close {
	position: absolute;
	top: 3rem;
	right: var(--gutter);
	padding: 0.4rem;
	border: 0;
	background: none;
	cursor: pointer;
}

.search-dialog__inner {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2.4rem;
	min-height: 100%;
}

/* Breadcrumbs ---------------------------------------------------------- */

.breadcrumbs {
	padding-block: 1rem;
}

.breadcrumbs a {
	color: var(--action);
}

/* Page hero ------------------------------------------------------------ */

.page-hero {
	position: relative;
	display: flex;
	align-items: center;
	height: 22rem;
	background: var(--hero-bg);
	overflow: hidden;
}

.page-hero--tall {
	height: 38rem;
	align-items: flex-end;
	padding-block: var(--section-space-m);
}

.page-hero__image {
	position: absolute;
	inset: 0;
}

.page-hero__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.page-hero__inner {
	position: relative;
	z-index: 1;
}

.page-hero__title {
	color: var(--base);
	font-size: 4.5rem;
	font-weight: 700;
}

.page-hero__text {
	color: var(--base);
	font-size: 2.4rem;
}

@media (max-width: 478px) {
	.page-hero {
		height: 42rem;
	}

	.page-hero--tall {
		align-items: center;
	}
}

/* Section layout (sidebar + main) -------------------------------------- */

/* Bricks "grid--1-3": 25% sidebar, content indented 6rem. */
/* ACSS grid--1-3 grid--l-1: stacks at 992px; the sidebar is hidden from Bricks' 991px. */
.section-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 3fr);
	padding-block: var(--section-space-m);
}

.section-layout--full {
	grid-template-columns: minmax(0, 1fr);
}

.section-layout__sidebar {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	align-self: start;
	border-right: 1px solid var(--muted);
}

.sidebar-list {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 0;
	list-style: none;
}

.sidebar-list__link {
	display: block;
	color: var(--muted);
	font-family: var(--font-body);
	font-size: 1.6rem;
}

.sidebar-list--pinned .sidebar-list__link {
	font-weight: 600;
}

.sidebar-list__link.is-current,
.sidebar-list__link:hover {
	color: var(--action);
}

.sidebar-list__link.is-current {
	position: relative;
	font-weight: 700;
}

/* Active marker on the sidebar's divider line (Bricks: 0.4rem pill, 3px past the item's right edge). */
.sidebar-list__link.is-current::after {
	content: '';
	position: absolute;
	top: 0;
	right: -3px;
	width: 0.4rem;
	height: 100%;
	border-radius: 2em;
	background-color: var(--action);
}

.section-layout__main {
	min-width: 0;
	margin-left: 6rem;
}

.section-layout--full .section-layout__main {
	margin-left: 0;
}

.section-layout__empty {
	color: var(--muted);
}

@media (max-width: 992px) {
	.section-layout {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 991px) {
	.section-layout__sidebar {
		display: none;
	}

	.section-layout__main {
		margin: 2rem 0 0;
	}
}

/* Footer ---------------------------------------------------------------- */

.site-footer {
	padding-top: 7rem;
	background: var(--primary);
	color: var(--neutral);
	font-family: var(--font-body);
	font-size: 1.8rem;
}

.site-footer a {
	color: var(--neutral);
}

.site-footer a:hover {
	color: var(--action);
}

.site-footer__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	padding-bottom: 4rem;
}

.site-footer__col {
	display: flex;
	flex-direction: column;
	gap: 4rem;
}

.site-footer__title {
	width: fit-content;
	color: var(--accent);
	font-size: 4.5rem;
	font-weight: 400;
	border-bottom: 4px solid var(--accent);
}

.site-footer__list {
	display: flex;
	flex-direction: column;
	gap: 3rem;
	margin: 0;
}

.site-footer__list dt {
	color: var(--secondary);
	font-weight: 600;
}

.site-footer__list dd {
	margin: 0;
}

/* Bricks nav menu items carry a trailing 1rem after the last link. */
.site-footer__menu {
	padding-bottom: 1rem;
}

/* The Bricks grid used ACSS grid--m-1, which stacks at 768px (not Bricks' 767px). */
@media (max-width: 768px) {
	.site-footer__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Bricks grouped the bank details with a 2rem gap instead of 3rem. */
.site-footer__list-pair {
	margin-top: -1rem;
}

.site-footer__menu ul,
.site-footer__legal-menu ul {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 0;
	list-style: none;
}

.site-footer__menu a {
	color: var(--accent);
}

.site-footer__copy {
	font-size: var(--text-m);
}

/* Bottom row mirrors the Bricks footer: no wrapping above 767px, so the copyright line shrinks and wraps first. */
.site-footer__bottom {
	display: flex;
	justify-content: space-between;
	padding-block: 1.3rem 3.3rem;
	border-top: 1px solid var(--muted);
}

/* Items stretch to the row height (the card image keeps its ratio via contain), top-aligned on phones. */
.site-footer__legal {
	display: flex;
	justify-content: flex-end;
	column-gap: 6rem;
}

.site-footer__legal img {
	object-fit: contain;
}

.site-footer__legal-menu {
	padding-top: 3px;
}

.site-footer__legal-menu ul {
	flex-direction: row;
	gap: 0;
}

/* Bricks nav menu default: 30px before every item, including the first. */
.site-footer__legal-menu li {
	margin-left: 30px;
}

.site-footer__legal-menu a {
	display: flex;
	color: var(--accent);
	font-size: 1.5rem;
}

@media (max-width: 767px) {
	.site-footer__col:last-child {
		margin-top: 4rem;
	}

	.site-footer__bottom {
		flex-wrap: wrap;
		row-gap: 1rem;
	}

	.site-footer__legal {
		width: 100%;
		justify-content: space-between;
		column-gap: 0;
	}

	.site-footer__legal-menu ul {
		gap: 1rem;
	}

	.site-footer__legal-menu li {
		margin-left: 0;
	}
}

@media (max-width: 478px) {
	.site-footer__legal {
		align-items: flex-start;
	}
}
