/* ------------ News page styles ------------- */
.news-navigation {
	background-color: white;
	padding-top: 60px;
	padding-bottom: 25px;
	margin-bottom: 24px;
}

.breadcrumb {
	color: var(--color-text-primary);
}

.news-tabs {
	display: flex;
	gap: 32px;
	list-style: none;
}
.news-tabs li a {
	position: relative;
	color: var(--color-text-dark-green);
	text-decoration: none;
	padding-bottom: 4px;
	transition: color 0.3s ease;
}

/* underline pseudo-element */
.news-tabs li a::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 2px;
	background: var(--color-dark-green);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease;
}

.news-tabs li.active a::after,
.news-tabs li a:hover::after {
	transform: scaleX(1);
}

.news-filters {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 32px;
}
.tag-list {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	list-style: none;
}
.tag-list label {
	display: inline-block;
}
.tag-list label.active span {
	background: var(--color-accent-primary);
	color: var(--color-dark-green);
}
.tag-list label span {
	background: white;
	border: none;
	padding: 9px 16px;
	cursor: pointer;
	font-size: 14px;
	color: #3d3d3dcc;
}

.year-filter {
	position: relative;
}
.year-filter-btn {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 160px;
	gap: 8px;
	background: var(--color-text-dark-green);
	color: #fff;
	border: none;
	padding: 9px 18px;
	cursor: pointer;
	font-size: 16px;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
	transition: background-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.year-filter-btn img {
	width: 16px;
	height: 16px;
	transition: transform 0.25s ease;
}

/* rotate arrow when dropdown open */
.year-filter.open .year-filter-btn img {
	transform: rotate(180deg);
}
.year-list {
	position: absolute;
	right: 0;
	top: calc(100%);
	background: #fff;
	border: 1px solid #e0e0e0;
	list-style: none;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	z-index: 10;
	min-width: 100%; /* same width as button */
	overflow: hidden;
}
.year-list li {
	padding: 20px;
	cursor: pointer;
	white-space: nowrap;
}
.year-list li {
	transition: background-color 0.2s ease, color 0.2s ease;
}
.year-list li.selected {
	/* will be added from JS */
	background: #e8f0ef;
}
.year-list li:hover {
	background: #e8f0ef;
	color: var(--color-text-dark-green);
}

/* Slide/fade animation for dropdown list using visibility */
.year-list {
	visibility: hidden;
	opacity: 0;
	transform: scaleY(0.95);
	transform-origin: top;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}
.year-list.visible {
	visibility: visible;
	opacity: 1;
	transform: translateY(0) scaleY(1);
	pointer-events: auto;
}

.news-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(300px, 1fr));
	gap: 20px;
}
.news-card {
	display: block;
	background: #ffffff;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
}

.news-card a {
	display: flex;
	flex-direction: column;
	height: 100%;
}

.news-card:hover {
	transform: translateY(-6px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}
.card-img img {
	display: block;
	width: 100%;
	height: 192px;
	object-fit: cover;
}

.card-content {
	flex: 1;
	height: auto;
	padding: 24px;
	display: flex;
	flex-direction: column;
	align-items: start;
}

.card-meta {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
	font-size: 13px;
	color: var(--color-text-dark-green);
}
.badge {
	background: var(--color-light-green);
	color: white;
	padding: 4px 12px;
	font-size: 14px;
	line-height: 20px;
}
.date {
	color: #3d3d3dcc;
}
.card-title {
	font-size: 20px;
	font-weight: 500;
	color: var(--color-text-primary);
	margin-bottom: 8px;
}
.card-desc {
	font-size: 16px;
	line-height: 24px;
	color: #3d3d3dcc;
	margin-bottom: 18px;
	max-width: unset;
}
.read-more {
	color: var(--color-dark-green);
	background: none;
	border: none;
	outline: none;
	font-weight: 600;
	transition: color 0.3s ease;
	margin-top: auto;
	cursor: pointer;
}

/* -------- Pagination styles -------- */
.pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 8px;
	margin-top: 40px;
}
.page-list {
	display: flex;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}
.page-nav,
.page-item button {
	width: 56px;
	height: 56px;
	background: #f8fbfc;
	border: 1px solid #d0d8db;
	color: #3d3d3d;
	font-size: 18px;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
	flex-shrink: 0;
}
.page-item.ellipsis {
	width: 56px;
	height: 56px;
	display: flex;
	justify-content: center;
	align-items: center;
	border: 1px solid #d0d8db;
	color: #3d3d3d;
	pointer-events: none;
	background: #f8fbfc;
	flex-shrink: 0;
}
.page-nav[disabled] {
	opacity: 0.4;
	cursor: default;
}
.page-item button:hover:not(:disabled),
.page-item.active button {
	background: var(--color-text-dark-green);
	color: #fff;
}

/* ---------------------- RESPONSIVE ---------------------- */
/* <=1199px  (large / small desktops) */
@media (max-width: 1199px) {
	.news-navigation {
		padding-top: 40px;
		padding-bottom: 20px;
	}
	.news-tabs {
		gap: 24px;
		flex-wrap: wrap;
	}
	.news-filters {
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
	}
	.tag-list {
		gap: 10px;
	}
	.news-grid {
		grid-template-columns: repeat(2, minmax(260px, 1fr));
	}
}

/* <=992px  (tablets) */
@media (max-width: 992px) {
	.year-filter-btn {
		width: 140px;
		font-size: 14px;
		padding: 8px 14px;
	}
	.year-list li {
		padding: 16px;
	}
	.news-grid {
		grid-template-columns: repeat(2, minmax(220px, 1fr));
		gap: 16px;
	}
	.card-img img {
		height: 160px;
	}
	.card-title {
		font-size: 18px;
	}
	.card-desc {
		font-size: 14px;
		line-height: 22px;
	}
	.page-nav,
	.page-item button,
	.page-item.ellipsis {
		width: 48px;
		height: 48px;
	}
}

/* <=768px  (landscape mobiles) */
@media (max-width: 768px) {
	.news-navigation {
		padding-top: 32px;
	}
	.news-tabs {
		gap: 20px;
	}
	.news-grid {
		grid-template-columns: 1fr;
	}
	.card-img img {
		height: 200px;
	}

	.page-list {
		gap: 5px;
	}
}

/* <=576px  (portrait mobiles) */
@media (max-width: 576px) {
	.news-navigation {
		padding-top: 24px;
		padding-bottom: 16px;
	}
	.news-tabs li a {
		font-size: 16px;
	}
	.news-title {
		font-size: 22px;
	}
	.tag-list li button {
		font-size: 12px;
		padding: 6px 12px;
	}
	.card-img img {
		height: 180px;
	}
	.card-content {
		padding: 20px 16px;
	}
	.card-title {
		font-size: 16px;
	}
	.card-desc {
		display: none; /* экономим высоту на мобилках */
	}
	.page-nav,
	.page-item button,
	.page-item.ellipsis {
		width: 35px;
		height: 35px;
		font-size: 16px;
	}
}
