/**
 * Сторінка новин/статей (page-news.php).
 */

body.granulka-news-page {
	overflow-x: hidden;
}

body.granulka-news-page .granulka-page {
	width: 100%;
	margin: 0;
}

.granulka-news-archive {
	max-width: 1440px;
	background-color: #f0f0f0;
	margin: 0 auto;
	padding: 16px 64px 0;
}

.granulka-news-archive__inner {
	max-width: 1440px;
	box-sizing: border-box;
}

.granulka-main-news-archive {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.granulka-news-archive__wrap {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.granulka-news-archive__title {
	margin: 0;
	font-family: 'Onest', sans-serif;
	font-size: 32px;
	font-weight: 500;
	line-height: 40px;
	letter-spacing: 0.01em;
	color: #464646;
}

.granulka-news-archive__title-wrap {
	margin-bottom: 24px;
	text-align: center;
}

/* ========== Filters (Tabs + Search) ========== */
.granulka-news-archive__filters {
	background-color: #ffffff;
	border: 1px solid #dedede;
	border-radius: 8px;
	padding: 16px 12px 0 16px;
	position: relative;
	display: flex;
	align-items: stretch;
	justify-content: space-between;
	gap: 24px;
}

.granulka-news-archive__tabs {
	display: flex;
	align-self: stretch;
	align-items: flex-end;
	gap: 24px;
	flex-wrap: nowrap;
}

.granulka-news-archive__tab {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	text-decoration: none;
	font-family: 'Onest', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0.16px;
	color: #464646;
	padding: 0;
	white-space: nowrap;
}

.granulka-news-archive__tab-text {
	display: block;
	padding: 0;
}

.granulka-news-archive__tab-line {
	display: block;
	width: 47px;
	height: 4px;
	border-radius: 100px 100px 0 0;
	background-color: #11b568;
	margin-top: 12px;
	opacity: 0;
}

.granulka-news-archive__tab.is-active {
	color: #11b568;
}

.granulka-news-archive__tab.is-active .granulka-news-archive__tab-line {
	opacity: 1;
}

.granulka-news-archive__search {
	display: flex;
	align-self: stretch;
	align-items: center;
	gap: 12px;
	padding: 0 8px 16px;
	flex: 0 0 auto;
}

.granulka-news-archive__search-input {
	display: none;
	border: 0;
	outline: 0;
	background: transparent;
	font-family: 'Onest', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0.16px;
	color: #464646;
	width: 220px;
}

.granulka-news-archive__search-input::placeholder {
	color: #6b6b6b;
}

/* Нативний «хрестик» у type=search у Chrome/Safari — сірий замість системного синього */
.granulka-news-archive__search-input::-webkit-search-cancel-button {
	-webkit-appearance: none;
	display: block;
	width: 22px;
	height: 22px;
	margin-left: 1px;
	cursor: pointer;
	background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M12 4L4 12M4 4l8 8' stroke='%236b6b6b' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E")
		center / 17px 17px no-repeat;
}

.granulka-news-archive__search-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #464646;
	cursor: pointer;
}

.granulka-news-archive__search-btn:hover {
	color: #11b568;
}

/* Search opened state: overlays tabs across full filters width */
.granulka-news-archive__filters.is-search-open .granulka-news-archive__search {
	position: absolute;
	inset: 0;
	padding: 0 12px 0 16px;
	width: auto;
	box-sizing: border-box;
	background: #ffffff;
	border-radius: 8px;
	z-index: 5;
}

.granulka-news-archive__filters.is-search-open .granulka-news-archive__search-input {
	display: block;
	flex: 1 1 auto;
	width: calc(100% - 44px);
	max-width: calc(100% - 44px);
}

.granulka-news-archive__filters.is-search-open .granulka-news-archive__tabs {
	visibility: hidden;
	opacity: 0;
	pointer-events: none;
}

/* ========== Cards ========== */
.granulka-news-archive__cards {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.granulka-news-archive__row {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 16px;
	align-items: stretch;
}

.granulka-news-card {
	background: #ffffff;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	min-height: 557px;
	min-width: 0;
}

/* Розміри карток у гріді: 2/3 і 1/3 */
.granulka-news-card--half {
	grid-column: span 1;
}

.granulka-news-card--two-thirds {
	grid-column: span 2;
}

.granulka-news-card--one-third {
	grid-column: span 1;
}

.granulka-news-card__img-wrap {
	flex-shrink: 0;
	height: 330px;
	width: 100%;
	background: #e2e2e2;
	border-radius: 8px 8px 0 0;
	overflow: hidden;
}

.granulka-news-card__img {
	display: block;
	width: 100%;
	height: 100%;
}

.granulka-news-card__img-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: #e2e2e2;
}

.granulka-news-card__content {
	padding: 16px;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.granulka-news-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.granulka-news-card__date {
	font-family: 'Onest', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0.16px;
	color: #464646;
}

.granulka-news-card__share {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: transparent;
	color: #464646;
	cursor: pointer;
}

.granulka-news-card__share-wrap {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.granulka-news-card__share-feedback {
	display: none;
	font-family: 'Onest', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0.16px;
	color: #464646;
	white-space: nowrap;
}

.granulka-news-card__share-wrap.is-copied .granulka-news-card__share-feedback {
	display: inline-flex;
}

.granulka-news-card__share:hover {
	color: #11b568;
}

.granulka-news-card__title-block {
	margin-bottom: 25px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
}

/* У вузькій колонці гріда зайвий простір під заголовком — теги лишаються внизу картки. */
.granulka-news-card--small .granulka-news-card__title-block {
	flex: 1 1 auto;
	min-height: 0;
}

.granulka-news-card--wide .granulka-news-card__title-block {
	flex: 0 1 auto;
	overflow: visible;
}

.granulka-news-card__title {
	margin: 0;
	margin-bottom: 16px;
	min-width: 0;
}

.granulka-news-card__title-link {
	font-family: 'Onest', sans-serif;
	text-decoration: none;
	color: #464646;
	display: block;
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
	hyphens: auto;
}

.granulka-news-card__title-link:hover {
	color: #11b568;
}

.granulka-news-card--wide .granulka-news-card__title-link {
	font-size: 20px;
	font-weight: 500;
	line-height: 32px;
	letter-spacing: 0;
}

.granulka-news-card__title .granulka-news-card__title-link {
	color: #11b568;
}

.granulka-news-card--small .granulka-news-card__title-link {
	font-size: 18px;
	font-weight: 600;
	line-height: 28px;
	letter-spacing: 0;
}

.granulka-news-card__excerpt {
	margin: 0;
	font-family: 'Onest', sans-serif;
	font-size: 16px;
	font-weight: 400;
	line-height: 24px;
	letter-spacing: 0.16px;
	color: #464646;
	overflow-wrap: anywhere;
	word-break: break-word;
	hyphens: auto;
}

.granulka-news-card__labels {
	display: flex;
	gap: 4px;
	align-items: center;
	flex-wrap: wrap;
}

.granulka-news-card__label {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 8px 16px;
	background-color: rgba(17, 181, 104, 0.08);
	border-radius: 100px;
	font-family: 'Onest', sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 18px;
	letter-spacing: 0;
	color: #11b568;
	white-space: nowrap;
}

.granulka-news-archive__empty {
	margin: 0;
	font-family: 'Onest', sans-serif;
	font-size: 16px;
	line-height: 24px;
	color: #464646;
}

/* ========== Pagination ========== */
.granulka-news-archive__pagination {
	display: flex;
	align-items: center;
	gap: 24px;
	justify-content: center;
	padding: 24px 0 0;
}

.granulka-news-archive__page-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	color: #464646;
	text-decoration: none;
}

.granulka-news-archive__page-arrow:hover {
	color: #11b568;
}

.granulka-news-archive__pages {
	display: flex;
	align-items: center;
	gap: 8px;
}

.granulka-news-archive__pages--desktop {
	display: flex;
}

.granulka-news-archive__pages--mobile {
	display: none;
}

.granulka-news-archive__page-btn {
	width: 48px;
	height: 48px;
	border-radius: 100px;
	background: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	font-family: 'Onest', sans-serif;
	font-size: 18px;
	font-weight: 600;
	line-height: 28px;
	letter-spacing: 0.18px;
	color: #464646;
}

.granulka-news-archive__page-btn.is-active {
	color: #11b568;
}

.granulka-news-archive__page-btn:hover {
	color: #11b568;
}

.granulka-news-archive__page-btn--ellipsis {
	letter-spacing: 0;
	white-space: nowrap;
}

.granulka-contacts__breadcrumbs {
	margin-bottom: 40px;
}

/* ========== Responsive ========== */
@media (max-width: 991px) {
	.granulka-news-card__excerpt {
		display: none;
	}

	.granulka-contacts__breadcrumbs {
		margin-bottom: 16px;
	}

	.granulka-footer {
		margin-top: 120px;
	}

	.granulka-news-archive__title-wrap {
		margin-bottom: -3px;
	}

	.granulka-news-archive {
		padding: 16px 16px 0;
	}

	.granulka-news-archive__filters {
		margin-bottom: 8px;
		padding: 16px 12px 0 12px;
		align-items: stretch;
		gap: 12px;
	}

	.granulka-news-archive__tabs {
		flex: 1 1 auto;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
	}

	.granulka-news-archive__search {
		flex: 0 0 auto;
		padding: 0 8px 16px;
	}

	.granulka-news-archive__search-input {
		width: 140px;
	}
}

@media (max-width: 767px) {
	.granulka-news-archive__pages--desktop {
		display: none;
	}

	.granulka-news-archive__pages--mobile {
		display: flex;
	}

	.granulka-news-archive__filters.is-search-open .granulka-news-archive__search-input {
		width: calc(100% - 32px);
		max-width: calc(100% - 32px);
	}

	.granulka-news-archive__filters {
		padding: 0 12px 0 16px;
		align-items: flex-end;
		gap: 0;
	}

	.granulka-news-archive__tabs {
		flex: 0 0 279px;
		width: 279px;
		max-width: 279px;
		height: 56px;
		gap: 24px;
		align-items: center;
	}

	.granulka-news-archive__tab {
		height: 100%;
		justify-content: flex-end;
		padding-bottom: 0;
	}

	.granulka-news-archive__tab-line {
		margin-top: 12px;
	}

	.granulka-news-archive__search {
		flex: 0 0 auto;
		padding: 16px 8px;
		gap: 0;
	}

	.granulka-news-archive__search-input {
		width: 100%;
	}

	.granulka-news-archive__filters.is-search-open .granulka-news-archive__search {
		padding: 0 12px 0 16px;
	}

	.granulka-news-archive__cards {
		gap: 12px;
	}

	.granulka-news-archive__row {
		grid-template-columns: 1fr;
	}

	.granulka-news-card {
		grid-column: 1 / -1 !important;
		min-height: auto;
	}

	.granulka-news-card__content {
		height: auto;
		min-height: 0;
	}
}
