/*--------------------------------------------------------------
# Document catalog — продовження блоку контенту (без окремої секції)
--------------------------------------------------------------*/
.doc-catalog.page-content__catalog {
	position: relative;
	padding: 28px 0 56px;
	margin-top: 24px;
	background: transparent;
	border-top: 1px solid rgba(12, 49, 114, 0.08);
}

.doc-catalog__title {
	font-size: 1.5rem;
	font-weight: 600;
	color: #1b2b4d;
	margin: 0 0 24px;
	text-align: left;
	font-family: var(--nexin-font);
	line-height: 1.3;
}

.doc-catalog__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* --- Групування (роки / періоди): фільтр + секції --- */
.doc-catalog__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 0 0 18px;
	padding: 10px;
	background: rgba(11, 47, 115, 0.04);
	border: 1px solid rgba(12, 49, 114, 0.08);
	border-radius: 14px;
}

.doc-catalog__filter-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	height: 38px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid rgba(11, 47, 115, 0.18);
	background: #fff;
	color: #0b2f73;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.doc-catalog__filter-btn:hover {
	border-color: rgba(11, 47, 115, 0.28);
	box-shadow: 0 6px 18px rgba(11, 47, 115, 0.10);
}

.doc-catalog__filter-btn.is-active {
	background: #0b2f73;
	border-color: #0b2f73;
	color: #fff;
	box-shadow: 0 10px 22px rgba(11, 47, 115, 0.22);
}

.doc-catalog__filter-btn:focus-visible {
	outline: 3px solid rgba(249, 255, 4, 0.75);
	outline-offset: 2px;
}

.doc-catalog__group {
	display: none;
}

.doc-catalog__group.is-active {
	display: block;
	animation: docCatalogFadeIn 160ms ease-out;
}

.doc-catalog__group-title {
	margin: 0 0 16px;
	font-size: 18px;
	font-weight: 700;
	color: #1b2b4d;
	font-family: var(--nexin-font);
	letter-spacing: 0.02em;
}

@keyframes docCatalogFadeIn {
	from { opacity: 0; transform: translateY(2px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Фіксована кількість колонок — без порожнього місця в ряді */
@media (min-width: 992px) {
	.doc-catalog__grid {
		grid-template-columns: repeat(3, 1fr);
	}
}
@media (min-width: 576px) and (max-width: 991px) {
	.doc-catalog__grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

.doc-catalog-card {
	margin: 0;
	padding: 0;
}

.doc-catalog-card__inner {
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 2px 16px rgba(11, 47, 115, 0.06);
	padding: 24px;
	height: 100%;
	display: flex;
	flex-direction: column;
	transition: box-shadow 0.25s ease, transform 0.25s ease, border-color 0.2s ease;
	border: 1px solid rgba(12, 49, 114, 0.06);
}

.doc-catalog-card:hover .doc-catalog-card__inner {
	box-shadow: 0 12px 32px rgba(11, 47, 115, 0.12);
	transform: translateY(-2px);
	border-color: rgba(11, 47, 115, 0.12);
}

.doc-catalog-card__icon {
	width: 52px;
	height: 52px;
	min-width: 52px;
	min-height: 52px;
	border-radius: 12px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 16px;
	font-size: 26px;
	flex-shrink: 0;
}
/* Іконки Font Awesome 5 — завжди видимі, не 0x0 */
.doc-catalog-card__icon i {
	display: inline-block;
	font-size: 1em;
	line-height: 1;
	/* min-width: 1em;
	min-height: 1em; */
	vertical-align: middle;
}
.doc-catalog-card__icon i::before {
	display: block;
}

.doc-catalog-card--pdf .doc-catalog-card__icon {
	background: rgba(220, 53, 69, 0.12);
	color: #c92a3a;
}

.doc-catalog-card--image .doc-catalog-card__icon {
	background: rgba(32, 201, 151, 0.12);
	color: #20c997;
}

.doc-catalog-card--video .doc-catalog-card__icon {
	background: rgba(111, 66, 193, 0.12);
	color: #6f42c1;
}

.doc-catalog-card--link .doc-catalog-card__icon {
	background: rgba(13, 110, 253, 0.12);
	color: #0d6efd;
}

/* Компактний блок відео: мініатюра YouTube + кнопка відтворення */
.doc-catalog-card__video-thumb {
	position: relative;
	margin: -24px -24px 16px -24px;
	border-radius: 12px 12px 0 0;
	overflow: hidden;
	background: #1a1a1a;
	aspect-ratio: 16 / 9;
	max-height: 160px;
}

.doc-catalog-card__video-thumb-img {
	width: 100%;
	height: 100%;
	display: block;
	object-fit: cover;
}

.doc-catalog-card__video-play {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.35);
	color: #fff;
	font-size: 2.5rem;
	transition: background 0.2s ease, transform 0.2s ease;
	pointer-events: none;
}

.doc-catalog-card__video-play i {
	display: inline-block;
	line-height: 1;
	filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.doc-catalog-card--video:hover .doc-catalog-card__video-play {
	background: rgba(0, 0, 0, 0.45);
}

.doc-catalog-card__thumb {
	margin: -24px -24px 16px -24px;
	border-radius: 12px 12px 0 0;
	overflow: hidden;
	background: #f0f0f0;
}

.doc-catalog-card__img {
	width: 100%;
	height: auto;
	display: block;
	object-fit: cover;
	max-height: 180px;
}

.doc-catalog-card__heading {
	font-size: 18px;
	font-weight: 600;
	color: #1b2b4d;
	margin: 0 0 8px;
	line-height: 1.35;
	font-family: var(--nexin-font);
}

.doc-catalog-card__desc {
	font-size: 14px;
	color: #5872a4;
	line-height: 1.5;
	margin: 0 0 16px;
	flex-grow: 1;
}

.doc-catalog-card__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: auto;
}

@media (max-width: 575px) {
	.doc-catalog__filters {
		padding: 8px;
		gap: 8px;
	}
	.doc-catalog__filter-btn {
		height: 36px;
		padding: 0 12px;
		font-size: 13px;
	}
}

.doc-catalog-card__btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 16px;
	font-size: 14px;
	font-weight: 500;
	border-radius: 8px;
	text-decoration: none;
	transition: background 0.2s ease, color 0.2s ease;
}

.doc-catalog-card__btn--view {
	background: #0b2f73;
	color: #fff;
}

.doc-catalog-card__btn--view:hover {
	background: #0a2860;
	color: #fff;
}

.doc-catalog-card__btn--download {
	background: transparent;
	color: #0b2f73;
	border: 1px solid #0b2f73;
}

.doc-catalog-card__btn--download:hover {
	background: rgba(11, 47, 115, 0.08);
	color: #0b2f73;
}

/* --- PDF.js переглядач у спливаючому вікні --- */
.doc-pdf-viewer {
	display: flex;
	flex-direction: column;
	height: 85vh;
	min-height: 400px;
	background: #525659;
}
.doc-pdf-viewer__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px 16px;
	background: #1b2b4d;
	color: #fff;
	flex-shrink: 0;
}
.doc-pdf-viewer__title {
	font-size: 14px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 40%;
}
.doc-pdf-viewer__nav,
.doc-pdf-viewer__zoom-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
}
.doc-pdf-viewer__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	border-radius: 8px;
	color: #fff;
	font-size: 18px;
	cursor: pointer;
	transition: background 0.2s ease;
}
.doc-pdf-viewer__btn:hover:not(:disabled) {
	background: rgba(255, 255, 255, 0.25);
}
.doc-pdf-viewer__btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}
.doc-pdf-viewer__page,
.doc-pdf-viewer__zoom {
	font-size: 13px;
	min-width: 48px;
	text-align: center;
}
.doc-pdf-viewer__scroll {
	flex: 1;
	overflow: auto;
	display: flex;
	justify-content: center;
	align-items: flex-start;
	padding: 20px;
}
.doc-pdf-viewer__canvas-wrap {
	position: relative;
	box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
	background: #fff;
	min-width: 280px;
	min-height: 396px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.doc-pdf-viewer__canvas-wrap.is-loading::after {
	content: 'Завантаження…';
	position: absolute;
	color: #666;
	font-size: 14px;
}
.doc-pdf-viewer__canvas {
	display: block;
	max-width: 100%;
}

/* Власне модальне вікно для PDF (без GLightbox — уникаємо aria-hidden і гарантовано показ) */
.doc-pdf-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.doc-pdf-modal.doc-pdf-modal--open {
	opacity: 1;
	visibility: visible;
}
.doc-pdf-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	cursor: pointer;
}
.doc-pdf-modal__box {
	position: relative;
	width: 100%;
	max-width: 1100px;
	height: 90vh;
	max-height: 900px;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 24px 56px rgba(0, 0, 0, 0.3);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	z-index: 1;
}
.doc-pdf-modal__close {
	position: absolute;
    top: 8px;
    right: 160px;
	z-index: 10;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(11, 47, 115, 0.9);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.doc-pdf-modal__close:hover {
	background: #0b2f73;
}
.doc-pdf-modal .doc-pdf-viewer {
	height: 100%;
	border-radius: 16px;
}

/* Модальне вікно для відео (YouTube) — власна реалізація для стабільного перегляду */
.doc-video-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.doc-video-modal.doc-video-modal--open {
	opacity: 1;
	visibility: visible;
}
.doc-video-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.65);
	cursor: pointer;
}
.doc-video-modal__box {
	position: relative;
	width: 100%;
	max-width: 960px;
	background: #000;
	border-radius: 16px;
	box-shadow: 0 24px 56px rgba(0, 0, 0, 0.4);
	overflow: hidden;
	z-index: 1;
	display: flex;
	flex-direction: column;
}
.doc-video-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 10;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(11, 47, 115, 0.9);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.doc-video-modal__close:hover {
	background: #0b2f73;
}
.doc-video-modal__title {
	padding: 12px 56px 12px 16px;
	background: #1b2b4d;
	color: #fff;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	flex-shrink: 0;
}
.doc-video-modal__wrap {
	position: relative;
	width: 100%;
	height: 0;
	padding-bottom: 56.25%;
	background: #000;
}
.doc-video-modal__iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
@media (max-width: 767px) {
	.doc-video-modal {
		padding: 12px;
	}
	.doc-video-modal__box {
		max-width: 100%;
	}
	.doc-video-modal__title {
		font-size: 14px;
		padding-right: 52px;
	}
}

/* Модальне вікно для зображень — галерея, зум, адаптивність */
.doc-image-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.2s ease, visibility 0.2s ease;
}
.doc-image-modal.doc-image-modal--open {
	opacity: 1;
	visibility: visible;
}
.doc-image-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.85);
	cursor: pointer;
}
.doc-image-modal__box {
	position: relative;
	width: 100%;
	max-width: 96vw;
	max-height: 92vh;
	background: #1a1a1a;
	border-radius: 16px;
	box-shadow: 0 24px 56px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	z-index: 1;
	display: flex;
	flex-direction: column;
}
.doc-image-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 12;
	width: 44px;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(11, 47, 115, 0.9);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.doc-image-modal__close:hover {
	background: #0b2f73;
}
.doc-image-modal__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 12px;
	padding: 12px 56px 12px 16px;
	background: #1b2b4d;
	color: #fff;
	flex-shrink: 0;
}
.doc-image-modal__title {
	font-size: 15px;
	font-weight: 600;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 60%;
}
.doc-image-modal__zoom {
	display: flex;
	align-items: center;
	gap: 8px;
}
.doc-image-modal__zoom-btn {
	width: 36px;
	height: 36px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(255, 255, 255, 0.15);
	border: none;
	border-radius: 8px;
	color: #fff;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease;
}
.doc-image-modal__zoom-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}
.doc-image-modal__zoom-value {
	font-size: 13px;
	min-width: 44px;
	text-align: center;
}
.doc-image-modal__content {
	flex: 1;
	overflow: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	padding: 16px;
}
.doc-image-modal__nav-wrap {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 16px;
	margin-bottom: 12px;
	flex-shrink: 0;
}
.doc-image-modal__nav {
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: rgba(11, 47, 115, 0.9);
	border: none;
	border-radius: 50%;
	color: #fff;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s ease, transform 0.15s ease;
}
.doc-image-modal__nav:hover:not(:disabled) {
	background: #0b2f73;
	transform: scale(1.05);
}
.doc-image-modal__nav:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}
.doc-image-modal__counter {
	font-size: 14px;
	font-weight: 600;
	color: #fff;
}
.doc-image-modal__img-wrap {
	transform-origin: center center;
	transition: transform 0.15s ease;
	max-width: 100%;
}
.doc-image-modal__img {
	display: block;
	max-width: 100%;
	height: auto;
	max-height: 70vh;
	object-fit: contain;
	user-select: none;
	pointer-events: none;
}
@media (max-width: 767px) {
	.doc-image-modal {
		padding: 8px;
	}
	.doc-image-modal__box {
		max-height: 90vh;
	}
	.doc-image-modal__toolbar {
		padding: 10px 52px 10px 12px;
	}
	.doc-image-modal__title {
		font-size: 14px;
		max-width: 50%;
	}
	.doc-image-modal__zoom-btn {
		width: 40px;
		height: 40px;
		font-size: 22px;
	}
	.doc-image-modal__img {
		max-height: 60vh;
	}
}

/* --- GLightbox: вікно попереднього перегляду (адаптивне, сучасне) --- */
.glightbox-container .gslide-content {
	background: #fff;
	border-radius: 16px;
	overflow: hidden;
	box-shadow: 0 24px 56px rgba(11, 47, 115, 0.2);
}
.glightbox-container .gslide-description {
	background: #1b2b4d;
	color: #fff;
	padding: 12px 16px;
}
.glightbox-container .gclose {
	top: 12px;
	right: 12px;
	width: 44px;
	height: 44px;
	min-width: 44px;
	min-height: 44px;
	background: rgba(11, 47, 115, 0.92);
	border-radius: 50%;
	opacity: 1;
	z-index: 9999;
	transition: background 0.2s ease, transform 0.2s ease;
}
.glightbox-container .gclose:hover {
	background: #0b2f73;
	transform: scale(1.05);
}
.glightbox-container .gclose svg {
	width: 22px;
	height: 22px;
}
.glightbox-container .gnext,
.glightbox-container .gprev {
	background: rgba(11, 47, 115, 0.85);
	width: 44px;
	height: 44px;
	border-radius: 50%;
	opacity: 1;
}
.glightbox-container .gnext:hover,
.glightbox-container .gprev:hover {
	background: #0b2f73;
}
.glightbox-container .gslide-inner {
	overflow: hidden;
	border-radius: 16px;
}
.glightbox-container .gslide-inner iframe {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 70vh;
	background: #fff;
}
.glightbox-open {
	overflow: hidden;
}
/* Оверлей — темніший, краще контраст */
.glightbox-container .gloader {
	border-color: rgba(11, 47, 115, 0.3);
	border-top-color: #0b2f73;
}
.glightbox-container .gslide-description .gdesc-inner {
	padding: 0;
}

@media (max-width: 768px) {
	.glightbox-container .gslide-content {
		max-width: 98vw;
		max-height: 92vh;
		border-radius: 12px;
	}
	.glightbox-container .gclose {
		top: 8px;
		right: 8px;
		width: 40px;
		height: 40px;
		min-width: 40px;
		min-height: 40px;
	}
	.glightbox-container .gslide-inner iframe {
		min-height: 75vh;
	}
}

@media (max-width: 575px) {
	.glightbox-container .gslide-content {
		max-width: 100vw;
		max-height: 95vh;
		border-radius: 0;
	}
	.glightbox-container .gclose {
		top: 10px;
		right: 10px;
	}
	.doc-catalog__grid {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 768px) {
	.doc-catalog.page-content__catalog {
		padding: 32px 0 48px;
		margin-top: 4px;
	}
	.doc-catalog__title {
		font-size: 1.35rem;
		margin-bottom: 20px;
	}
	.doc-catalog__grid {
		gap: 20px;
	}
	.doc-catalog-card__inner {
		padding: 20px;
	}
	.doc-catalog-card--video {
		grid-column: span 1;
	}
}
