/*
 * News cards, Aktualitātes list (filters + grid), Būtiskie notikumi grid, yearly archive accordion.
 * Was Bricks templates 69/579/1625 + Global CSS (.card, .actuality-page-content-wrapper, .Home-page-actualitys, .custom-accordion).
 */

/* Headings here are UI, not article text: undo .entry-content heading spacing. */
:is(.news-card, .news-archive) :is(h2, h3) { margin: 0; padding: 0; }

/* ---------- Card (parts/post-card.php) ---------- */
.news-card {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: 2.5rem;
	width: calc(33.2% - 2rem);
	border-radius: var(--radius-s);
	box-shadow: var(--shadow-card);
}
.news-card:focus-within { outline: 2px solid var(--primary); outline-offset: 2px; }
.news-card__media { display: block; }
.news-card__img {
	width: 100%;
	height: 100%;
	min-height: 28.9rem;
	object-fit: cover;
	border-radius: var(--radius-s) var(--radius-s) 0 0;
}
.news-card__body {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: flex-start;
	height: 100%;
	padding: 0 2.5rem 0 3.2rem;
}
.news-card .news-card__title {
	font-size: 2.4rem;
	letter-spacing: normal;
	line-height: var(--heading-line-height);
	color: var(--secondary);
}
.news-card .news-card__link { color: inherit; text-decoration: none; }
.news-card .news-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	display: flex;
	cursor: pointer;
}
.news-card .news-card__link:hover { color: inherit; }
.news-card__link:focus-visible { outline: none; }
.news-card__excerpt {
	padding-top: 1.6rem;
	font-size: 1.6rem;
	letter-spacing: -1.1px;
	color: rgba(12, 18, 33, 0.59);
}
.news-card__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	align-self: center;
	width: 100%;
	padding: 3.9rem 0 2.8rem;
}
.news-card__date {
	font-size: 1.6rem;
	font-weight: 400;
	color: rgba(12, 18, 33, 0.36);
}
.news-card__level { display: flex; align-items: center; column-gap: .8rem; }
.news-card__dot {
	flex: 0 0 1.6rem;
	width: 1.6rem;
	height: 1.6rem;
	border-radius: 50%;
}
.news-card .news-card__level-link {
	font-size: 1.4rem;
	color: var(--base);
	text-decoration: none;
}
.news-card .news-card__level-link:hover { color: var(--base); }

@media (max-width: 991px) {
	.news-card { width: 100%; }
}
@media (max-width: 767px) {
	.news-card .news-card__title { font-size: 2rem; }
}

/* ---------- Aktualitātes list ---------- */
.news-filter {
	display: flex;
	flex-wrap: wrap;
	gap: .9rem;
}
.news-filter .news-filter__pill {
	padding: .75rem 2rem;
	font-size: 1.8rem;
	font-weight: 400;
	letter-spacing: -1.1px;
	text-transform: capitalize;
	text-decoration: none;
	color: rgba(12, 18, 33, 0.44);
	background: var(--white);
	border-radius: 13px;
}
.news-filter .news-filter__pill:hover { color: rgba(12, 18, 33, 0.44); }
.news-filter .news-filter__pill.is-active { color: var(--white); background: var(--primary); }

.news-grid {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	gap: 3.2rem;
	padding-top: 5.8rem; /* Bricks: 4.8rem + ~1rem extra offset of the first row (flex line distribution) */
}
.news-list .news-grid > .news-card:nth-of-type(n+2) .news-card__img { max-height: 27rem; }

/* First card: large, horizontal */
.news-list .news-grid > .news-card:first-of-type {
	flex-direction: row;
	column-gap: 4.3rem;
	width: 100%;
	max-height: 56.6rem;
	margin-bottom: 4rem;
}
.news-list .news-grid > .news-card:first-of-type .news-card__media { width: 100%; }
.news-list .news-grid > .news-card:first-of-type .news-card__img {
	min-width: 16.4rem;
	max-height: 49.5rem;
	border-radius: var(--radius-s) 0 0 var(--radius-s);
}
.news-list .news-grid > .news-card:first-of-type .news-card__body {
	width: 90%;
	padding-top: 2.5rem;
	padding-left: 3.2rem;
}
.news-list .news-grid > .news-card:first-of-type .news-card__title { font-size: 3.3rem; }
.news-list .news-grid > .news-card:first-of-type .news-card__excerpt { padding-top: 2.4rem; }

@media (max-width: 991px) {
	.news-list .news-grid > .news-card:first-of-type .news-card__title { font-size: 2rem; }
}
@media (max-width: 767px) {
	.news-list .news-grid > .news-card:first-of-type { flex-direction: column; max-height: none; }
	.news-list .news-grid > .news-card:first-of-type .news-card__img { border-radius: var(--radius-s) var(--radius-s) 0 0; }
}

.news-list__more {
	display: flex;
	justify-content: center;
	width: fit-content;
	margin: 4rem auto 0;
	padding: 1.4rem 2.4rem;
	font-size: 1.8rem;
	font-weight: 600;
	color: var(--primary);
	border: 1px solid var(--primary);
	border-radius: var(--radius-s);
}
.news-list__more:hover { color: var(--white); background: var(--primary); }
.news-list__more.is-loading { opacity: .5; pointer-events: none; }

/* ---------- Būtiskie notikumi (project-news) ---------- */
.news-grid--project { gap: 2.4rem; padding-top: 0; }
.news-card--project .news-card__body { padding: 3.2rem 2.5rem 3.2rem 3.2rem; }
.news-card--project .news-card__text { display: flex; flex-direction: column; row-gap: 2rem; }
.news-card--project .news-card__excerpt { padding-top: 0; letter-spacing: normal; color: rgba(12, 18, 33, 0.6); }
.news-card__date--project { padding-top: 9rem; }

@media (max-width: 991px) {
	.news-grid--project { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 767px) {
	.news-grid--project { grid-template-columns: minmax(0, 1fr); gap: 3.2rem; }
	.news-card--project .news-card__title { font-size: 1.9rem; }
}

/* ---------- Spacing inside .page-content (Bricks section paddings) ---------- */
:is(.news-block, .news-page) > .news-list:first-child { margin-top: calc(4.8rem - var(--section-space-s)); }
.news-block--project > .news-grid--project:first-child { margin-top: calc(9.8rem - var(--section-space-s)); }
:is(.news-block, .news-page) > .news-archive { margin-top: calc(9.7rem + var(--section-space-m)); }
.news-block--project > .news-grid--project + .news-archive { margin-top: calc(10.4rem + var(--section-space-m)); }
@media (max-width: 991px) {
	.news-block--project > .news-grid--project:first-child { margin-top: calc(6rem - var(--section-space-s)); }
	.news-block--project > .news-grid--project + .news-archive { margin-top: calc(6rem + var(--section-space-m)); }
}

/* ---------- Yearly archive accordion ("Arhivētie paziņojumi") ---------- */
.news-archive { display: flex; flex-direction: column; row-gap: 4.3rem; }
.news-archive .news-archive__title {
	font-size: 2.8rem;
	letter-spacing: normal;
	color: var(--secondary);
}
.news-archive__year {
	margin-bottom: 1.6rem;
	border-radius: 1rem;
	box-shadow: 0 3px 8px 0 rgba(0, 0, 0, 0.13);
}
.news-archive__toggle {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	padding: 4rem 3.2rem;
	font-size: 2.3rem;
	line-height: 1.15;
	text-align: left;
	color: var(--black);
	background: var(--white);
	border-radius: 1rem;
}
.news-archive__toggle strong { font-weight: 700; }
.news-archive__icon svg { width: 26px; height: 26px; }
.news-archive__icon-open,
.news-archive__toggle[aria-expanded="true"] .news-archive__icon-closed { display: none; }
.news-archive__toggle[aria-expanded="true"] .news-archive__icon-open { display: block; }
.news-archive__panel { overflow: hidden; transition: height .3s ease; }
.news-archive__panel-inner { padding: 0 3.2rem; }
.news-archive .news-archive__month {
	font-size: 1.8rem;
	font-weight: 400;
	letter-spacing: normal;
	color: rgba(12, 20, 39, 0.38);
}
.news-archive .news-archive__month:not(:first-child) { padding-top: 3rem; }
.news-archive .news-archive__posts { margin: 0; padding: 0; list-style: none; }
.news-archive .news-archive__post {
	display: flex;
	column-gap: 5.6rem;
	margin: 0;
	padding: 2.4rem 0;
	border-bottom: 1px solid rgba(12, 18, 33, 0.09);
}
.news-archive .news-archive__link {
	font-size: 1.6rem;
	font-weight: 700;
	color: var(--base);
	text-decoration: none;
}
.news-archive .news-archive__link:hover { color: var(--base); }
.news-archive__date { font-size: 1.6rem; color: rgba(12, 18, 33, 0.48); }

@media (max-width: 767px) {
	.news-archive .news-archive__post { flex-direction: column; row-gap: 2rem; }
}
