/* Page-specific sections. */

/* Front page ------------------------------------------------------------- */

.popular-categories .container {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 5rem;
}

.popular-categories__grid {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: var(--space-l);
	width: 100%;
}

.popular-categories__item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 1.6rem;
	text-align: center;
}

.popular-categories__image {
	width: 13rem;
	height: 13rem;
	border-radius: 50%;
	object-fit: cover;
}

.popular-categories__label {
	color: var(--base);
	font-family: var(--font-body);
	font-size: 1.6rem;
	font-weight: 600;
}

.popular-categories__item:hover .popular-categories__label {
	color: var(--action);
}

/* ACSS grid--l-3 / grid--s-2 breakpoints (992px / 480px). */
@media (max-width: 992px) {
	.popular-categories__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 480px) {
	.popular-categories__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.card-slider {
	overflow: hidden;
}

/* Bricks: 50px section gap + the title's own 10px margin (the inverted title has none). */
.card-slider .section-title {
	margin-bottom: 6rem;
}

.card-slider .section-title--inverted {
	margin-bottom: 5rem;
}

.shop-info {
	padding-block: 15rem 5rem;
	background: url('../img/graphic.svg') 170% center / 50% no-repeat;
}

.shop-info__inner {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	gap: var(--space-l) 0;
	align-items: stretch;
}

.shop-info__heading {
	font-size: 5.2rem;
}

.shop-info__heading strong {
	font-weight: 700;
}

.shop-info__text {
	align-self: center;
	font-family: var(--font-body);
}

/* ACSS grid--l-1 */
@media (max-width: 992px) {
	.shop-info__inner {
		grid-template-columns: minmax(0, 1fr);
	}
}

.partners {
	overflow: hidden;
}

.partners__inner {
	padding-bottom: 7rem;
	border-bottom: 1px solid var(--muted);
}

@media (max-width: 991px) {
	.partners__inner {
		padding-bottom: 3rem;
	}
}

/* Jaunumi ---------------------------------------------------------------- */

.page-hero--tall .page-hero__title {
	text-transform: uppercase;
}

.news-section__title {
	margin-bottom: 4.4rem;
}

.news-list {
	display: grid;
	gap: 4rem;
}

.news-card {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
	color: var(--base);
}

.news-card__media {
	height: 35.5rem;
}

.news-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 2.5rem padding + the 7rem gap Bricks left for the (hidden) date column. */
.news-card__body {
	padding: 2.4rem 0 0 9.5rem;
	border-top: 1px solid var(--muted);
}

.news-card__content {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.news-card__title {
	color: var(--base);
	font-size: 3.2rem;
	font-weight: 700;
}

.news-card:hover .news-card__title {
	color: var(--action);
}

.news-card__text {
	color: var(--base);
	font-family: var(--font-body);
	font-size: 1.6rem;
}

.news-card__text--short {
	display: none;
}

/* Side by side: the rule runs across the whole card (over the image too), image centred vertically. */
@media (min-width: 993px) {
	.news-card {
		padding-top: 2.4rem;
		border-top: 1px solid var(--muted);
	}

	.news-card__media {
		align-self: center;
	}

	.news-card__body {
		padding-top: 0;
		border-top: 0;
	}
}

/* ACSS grid--1-2 grid--l-1 stacks at 992px; the Bricks centring starts at 991px. */
@media (max-width: 992px) {
	.news-card {
		grid-template-columns: minmax(0, 1fr);
	}

	.news-card--webp .news-card__media {
		width: 48rem;
		max-width: 100%;
	}

	.news-card--webp .news-card__media img {
		width: 100%;
	}
}

@media (max-width: 991px) {
	.news-card {
		justify-items: center;
	}

	/*
	 * Centred image, 35.5rem tall. Bricks sized the Imagify <picture> wrapper, so JPG/PNG keep their
	 * aspect ratio; .webp originals (no wrapper) were the 480px <img> itself, cropped with cover.
	 */
	.news-card__media {
		max-width: 100%;
	}

	.news-card__media img {
		width: auto;
	}


	.news-card__body {
		width: 100%;
		display: flex;
		justify-content: center;
		padding-left: 0;
	}

	.news-card__content {
		align-items: center;
	}

	.news-card__content > * {
		width: 100%;
	}

	.news-card__text--long {
		display: none;
	}

	.news-card__text--short {
		display: block;
	}
}

/* Akcijas ---------------------------------------------------------------- */

.promo-page__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
}

.promo-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 3rem;
	width: 100%;
}

.promo-card {
	position: relative;
	padding-bottom: 2rem;
	border-radius: 8px 8px 80px 8px;
	box-shadow: var(--card-shadow);
	overflow: hidden;
}

.promo-card__media {
	display: block;
}

.promo-card__media img {
	width: 100%;
	height: auto;
}

/* Bricks put the 2rem bottom margin on the image + text wrapper, i.e. below the text. */
.promo-card__body {
	margin: 1rem 3rem 2rem;
}

.promo-card__title {
	margin-bottom: 1.6rem;
	color: var(--base);
	font-size: 3.6rem;
	font-weight: 700;
}

.promo-card__title a {
	color: inherit;
}

.promo-card__text {
	font-family: var(--font-body);
}

.promo-partners .section-title {
	margin-bottom: 4rem;
}

/* Partner promotions: 38rem cards, 48rem tall, on the ACSS grid--auto-3 / gap--s grid. */
.promo-partners__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(34.5864661654rem, 100vw - 6rem), 1fr));
	gap: var(--space-s);
}

.promo-partners__grid .teaser {
	max-width: 38rem;
	height: 48rem;
	justify-content: flex-start;
}

.promo-partners__grid .teaser__media {
	align-self: center;
	height: auto;
}

/* Images at their own size, centred and capped at the card width and 19rem height (aspect kept), as in Bricks. */
.promo-partners__grid .teaser__media img {
	width: auto;
	max-width: 100%;
	height: auto;
	max-height: 19rem;
}

.promo-partners__grid .teaser__title {
	color: var(--text-color);
	font-size: var(--h3);
}

.promo-extra {
	background: var(--hero-bg);
}

/* The (empty) Bricks slider still added the section's 5rem row gap under the heading. */
.promo-extra .section-title {
	margin-bottom: 6rem;
}

/* ACSS grid--l-1 */
@media (max-width: 992px) {
	.promo-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 991px) {
	.promo-partners__grid {
		justify-items: center;
	}
}


/* Darbinieki ------------------------------------------------------------- */

.team-page {
	display: flex;
	flex-direction: column;
	gap: 8rem;
	padding-block: var(--section-space-m);
}

.team-group {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6rem;
}

.team-group__title {
	margin-bottom: 1rem;
}

/* ACSS grid--auto-2: two columns while 46rem tracks fit, otherwise one. */
.team-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(46.1538461538rem, 100vw - 6rem), 1fr));
	gap: 6rem;
	width: 100%;
	padding-inline: 2.4rem;
}

/* Green 7rem strip on the left, portrait overlapping it. */
/* gap is the ACSS gap--m on the Bricks card; it only shows once the photo stops being absolute. */
.team-card {
	position: relative;
	display: flex;
	gap: var(--space-m);
	min-height: 31rem;
	border-radius: var(--card-radius);
	background: linear-gradient(90deg, var(--action) 7rem, var(--white) 7rem);
	box-shadow: var(--card-shadow);
}

.team-card__photo {
	position: absolute;
	top: 2.4rem;
	left: -2.4rem;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20rem;
	height: 32rem;
	border-radius: 0.8rem;
	overflow: hidden;
}

.team-card__photo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.team-card__body {
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	padding-left: 21.4rem;
}

.team-card__name {
	color: var(--action);
	font-size: 3.2rem;
	font-weight: 700;
	line-height: 1.5;
}

.team-card__role {
	color: var(--base);
	font-family: var(--font-body);
	font-size: 1.8rem;
	font-weight: 600;
}

.team-card__contacts {
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
	margin-top: 4rem;
	padding: 0;
	list-style: none;
}

.team-card__contacts li {
	display: flex;
	align-items: center;
	column-gap: 1.6rem;
}

.team-card__contacts img {
	flex-shrink: 0;
	width: 3rem;
	height: 2rem;
	object-fit: contain;
}

/* Bricks icon boxes: work phone 3×2.8rem, mobile 3×2rem, mail 3×1.6rem. */
.team-card__contacts .team-card__phone-icon {
	height: 2.8rem;
}

.team-card__contacts .team-card__mail-icon {
	height: 1.6rem;
}

.team-card__contacts a {
	color: var(--base);
	font-family: var(--font-body);
	font-size: 1.8rem;
	transition: color var(--transition);
}

.team-card__contacts a:hover {
	color: var(--action);
}

/* Darbinieki on smaller screens, as the Bricks breakpoints. */
@media (max-width: 1240px) {
	.team-grid {
		gap: 8rem;
	}

	.team-card {
		min-width: 52rem;
	}
}

@media (max-width: 991px) {
	.team-card__role {
		text-align: center;
	}
}

@media (max-width: 767px) {
	.team-card {
		flex-direction: column;
		align-items: center;
		min-width: 0;
		padding-bottom: 2rem;
	}

	.team-card__photo {
		position: static;
		margin-left: 7rem;
	}

	.team-card__body {
		align-items: center;
		padding-left: 7rem;
	}

	.team-card__contacts li {
		align-self: center;
	}
}

@media (max-width: 478px) {
	.team-grid {
		gap: 4rem;
		padding-inline: 0;
	}

	.team-card {
		padding-top: 2rem;
		border-radius: 0.8rem;
		background: var(--white);
	}

	.team-card__photo {
		margin-left: 0;
	}

	.team-card__body {
		padding: 0 0 2rem;
	}

	.team-card__contacts li {
		flex-direction: column;
	}
}

/* Partners (catalogue page, archive) -------------------------------------- */

.catalog-hero {
	padding-block: var(--section-space-l);
	background: var(--hero-bg) center / cover no-repeat;
}

.catalog-hero__title {
	color: var(--white);
}

.catalog-hero__text {
	color: var(--white);
}

.catalog-hero__text p {
	margin: 0;
}

/* Frames article grid: ACSS --grid-N tracks (minmax(0, 1fr)). */
.partner-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--grid-gap);
	margin: 0;
	padding: 4.5rem 0 0;
	list-style: none;
}

.partner-card {
	display: flex;
	flex-direction: column;
	gap: clamp(1.6rem, calc(0.3571428571vw + 1.4857142857rem), 2rem);
	transition: transform 0.3s ease;
}

.partner-card:hover {
	transform: translateY(-0.5em);
}

.partner-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	padding: 1rem 2rem;
}

/* The figure is inline-block as in the Bricks markup, so the line's descender gap sits below it. */
.partner-card__media {
	order: -1;
	padding: 1rem 1rem 0;
}

/* 14em of the fluid body size (252px at 1440). */
.partner-card__image {
	display: inline-block;
	width: 100%;
	height: calc(var(--text-m) * 14);
	margin: 0;
	border-radius: var(--card-radius);
	overflow: hidden;
}

.partner-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.partner-card__title {
	color: var(--text-color);
	font-size: var(--h3);
}

.partner-card__title a {
	color: inherit;
}

.partner-card__lede {
	color: #808080;
	font-family: var(--font-body);
	font-size: 1.6rem;
}

/* Partneri archive: logos only, centred in the card. */
.partners-page__title {
	align-self: center;
	text-align: center;
}

.partner-grid--logos .partner-card {
	flex-direction: row;
	justify-content: center;
	align-items: center;
}

.partner-grid--logos .partner-card__media {
	width: 22rem;
}

.partner-grid--logos .partner-card__image {
	width: 20rem;
	height: 15rem;
	border-radius: 0;
}

.partner-grid--logos .partner-card__image img {
	object-fit: contain;
}

@media (max-width: 1240px) {
	.partner-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 991px) {
	.partner-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.partner-grid--logos {
		justify-items: center;
	}

	.partner-grid--logos .partner-card {
		max-width: 100%;
	}

	.partner-grid--logos .partner-card__media {
		width: auto;
		min-width: 0;
	}

	.partner-grid--logos .partner-card__image {
		width: 15rem;
		height: 7rem;
	}
}

/* Search ------------------------------------------------------------------ */

.search-page {
	padding-block: 4rem;
}

.search-page__form {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1.5rem;
}

.search-page__form .section-title {
	margin: 0;
	font-weight: 500;
}

.search-results {
	padding-top: 0;
}

.search-results__title {
	margin-bottom: 2.4rem;
	color: var(--action);
	font-size: var(--h3);
	font-weight: 300;
}

.search-results__grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	align-items: start;
	gap: 2.7rem;
}

.search-card {
	display: flex;
	align-self: stretch;
	flex-direction: column;
	justify-content: space-between;
	gap: 3rem;
	padding: 3.2rem;
	border-radius: var(--card-radius);
	box-shadow: var(--card-shadow);
}

.search-card__media {
	height: 16.5rem;
	overflow: hidden;
}

.search-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.search-card__type {
	margin-top: 3.4rem;
	color: var(--primary);
	font-family: var(--font-body);
	font-size: 1.6rem;
	font-weight: 600;
	line-height: 1.2;
}

.search-card__title {
	margin-top: 1.4rem;
	color: var(--black);
	font-size: 3.2rem;
}

.search-card__date {
	margin-top: 0.5rem;
	color: var(--base);
	font-size: 1.8rem;
	font-weight: 300;
	line-height: 1.2;
}

.search-card__text {
	margin-top: 1.1rem;
	color: var(--base);
	font-size: 1.6rem;
}

.search-card__button {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--action);
	font-family: var(--font-body);
	font-size: 1.6rem;
	font-weight: 600;
}

/* Bricks drew the arrow as a 2.5rem-tall ::before with 0.5rem right padding, on top of the 0.5rem gap. */
.search-card__button {
	min-height: 2.5rem;
}

.search-card__button img {
	margin-right: 0.5rem;
}

.search-results__empty {
	color: var(--muted);
}

/* With JS the next pages load on scroll (as Bricks did); the links are the no-JS fallback. */
.js-infinite .search-results .pagination {
	display: none;
}

/* ACSS grid breakpoints (992px / 768px). */
@media (max-width: 992px) {
	.search-results__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 768px) {
	.search-results__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* 404, subscribe pages ---------------------------------------------------- */

.not-found__inner,
.subscribe-page__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4rem;
	text-align: center;
}

.subscribe-page__inner--thanks {
	gap: 2rem;
}

.subscribe-page__inner--thanks .subscribe-page__text {
	text-align: start;
}

/* The sign-up page body is set in Open Sans (Bricks custom CSS on the form element). */
.subscribe-page--form {
	font-family: var(--font-body);
}

.subscribe-page__intro {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
}

.subscribe-page__form {
	width: 100%;
	max-width: 100rem;
	text-align: left;
}

.subscribe-page__form form {
	max-width: 100rem !important;
	font-family: var(--font-body) !important;
}

.subscribe-page__text {
	font-family: var(--font-body);
	font-size: 1.6rem;
}
