/* ==========================================================================
   PAGES — блоки внутрішніх сторінок
   1. Загальне
   2. Банер внутрішньої сторінки
   3. Храми парафії (temples.html)
   4. Наставник (catechesis.html)
   5. Картки-матеріали
   6. Відео: добірка та головна трансляція
   7. Картки записів (блог, події)
   8. Таблиця анонсів
   9. Галерея + лайтбокс
   10. Контакти
   11. Стаття (окремий допис)
   12. Пагінація
   ========================================================================== */


/* ==========================================================================
   1. ЗАГАЛЬНЕ
   ========================================================================== */

/* перша секція йде одразу під хлібними крихтами */
.section--top {
	padding-top: clamp(1rem, 2vw, 1.75rem);
}

.events-announce {
	margin-top: clamp(2rem, 4vw, 3rem);
}

.subhead {
	margin-bottom: 1.25rem;
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.2;
	color: var(--c-blue);
}


/* ==========================================================================
   2. БАНЕР ВНУТРІШНЬОЇ СТОРІНКИ
   ========================================================================== */

.page-hero {
	position: relative;
	display: grid;
	grid-template-columns: 100%;
	align-items: center;
	min-height: clamp(15rem, 27vw, 24.25rem);
	overflow: hidden;
}

/* хлібні крихти лежать поверх банера */
.breadcrumbs--overlay {
	position: absolute;
	z-index: 2;
	top: 0;
	right: 0;
	left: 0;
	color: rgba(255, 255, 255, .85);
}

.breadcrumbs--overlay a,
.breadcrumbs--overlay [aria-current],
.breadcrumbs--overlay li + li::before {
	color: inherit;
}

.breadcrumbs--overlay a:hover,
.breadcrumbs--overlay a:focus-visible {
	color: var(--c-white);
}

.page-hero__media {
	position: absolute;
	inset: 0;
}

.page-hero__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.page-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(103deg, rgba(39, 59, 102, .93) 0%, rgba(39, 59, 102, .6) 58%, rgba(39, 59, 102, .2) 100%);
}

.page-hero__inner {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1.125rem;
	padding-block: clamp(1.75rem, 5vw, 3.5rem);
}

.page-hero__title {
	max-width: 32rem;
	font-family: var(--font-display);
	font-size: var(--fs-h2);
	font-weight: 600;
	line-height: 1.15;
	text-transform: uppercase;
	overflow-wrap: break-word;
	color: var(--c-white);
}

.page-hero__text {
	max-width: 30rem;
	font-size: var(--fs-lead);
	color: var(--c-white);
}


/* ==========================================================================
   3. ХРАМИ ПАРАФІЇ
   ========================================================================== */

.temples-list {
	display: flex;
	flex-direction: column;
	gap: clamp(1.25rem, 3vw, 2rem);
}

.temple-block {
	position: relative;
	display: grid;
	gap: clamp(1.25rem, 3vw, 2.5rem);
	padding: clamp(1rem, 2.5vw, 2.25rem);
	padding-bottom: clamp(1.75rem, 3.5vw, 3rem);
	background-color: var(--c-cream);
}

/* золота лінія по нижньому краю блока */
.temple-block::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 6px;
	background-image: var(--gold-h);
}

.temple-block__img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.temple-block__body {
	display: flex;
	flex-direction: column;
	gap: 1.125rem;
}

.temple-block__title {
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	line-height: 1.25;
	color: var(--c-blue);
}

.temple-block__text {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	font-size: var(--fs-body);
	line-height: 1.6;
}

.temple-block__meta {
	display: grid;
	gap: 1.5rem;
	margin-top: auto;
	padding-top: .5rem;
}

.temple-block__info {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.temple-block__actions {
	display: flex;
	flex-direction: column;
	gap: .75rem;
	align-items: stretch;
}

.temple-block__actions .btn {
	width: 100%;
	max-width: 18.125rem;
}

@media (min-width: 600px) {
	.temple-block__meta {
		grid-template-columns: minmax(0, 1fr) minmax(17rem, auto);
		align-items: end;
		gap: 2rem;
	}
}

@media (min-width: 1024px) {
	/* у макеті зображення виходить врівень із краєм кремової панелі */
	.temple-block {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: stretch;
		padding: 2.75rem 0;
		gap: 2.375rem;
	}

	/* Панель не має горизонтальних полів, щоб зображення виходило врівень із краєм,
	   тому відступ від краю тримає сам текстовий блок — з того боку, де немає фото. */
	.temple-block__body {
		padding-right: 2rem;
	}

	.temple-block__img {
		height: 100%;
		aspect-ratio: auto;
		min-height: 20rem;
	}

	/* парні блоки — зображення праворуч (колонки теж міняються місцями) */
	.temple-block--reverse {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
	}

	.temple-block--reverse .temple-block__img {
		grid-column: 2;
		grid-row: 1;
	}

	.temple-block--reverse .temple-block__body {
		grid-column: 1;
		grid-row: 1;
		padding-right: 0;
		padding-left: 2rem;
	}
}


/* ==========================================================================
   4. НАСТАВНИК
   ========================================================================== */

.mentor {
	background-color: var(--c-cream);
}

.mentor__inner {
	display: grid;
	gap: clamp(1.5rem, 4vw, 3.5rem);
	align-items: center;
}

.mentor__img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

.mentor__body {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.mentor__title {
	font-family: var(--font-display);
	font-size: var(--fs-h3);
	font-weight: 600;
	text-transform: uppercase;
	color: var(--c-blue);
}

.mentor__person {
	display: flex;
	flex-direction: column;
	gap: .25rem;
}

.mentor__name {
	font-size: var(--fs-lead);
	font-weight: 600;
	color: var(--c-ochre);
}

.mentor__role {
	font-size: var(--fs-sm);
	color: var(--c-ink-muted);
}

.mentor__text em,
.mentor__text .mentor__mission {
	font-style: italic;
}

.mentor__text {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	font-size: var(--fs-body);
	line-height: 1.6;
}

@media (min-width: 900px) {
	.mentor__inner {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
	}
}


/* ==========================================================================
   5. КАРТКИ-МАТЕРІАЛИ
   ========================================================================== */

.resource-grid {
	display: grid;
	gap: 1.25rem;
}

.resource-card {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 1rem;
	height: 100%;
	padding: clamp(1.25rem, 2.5vw, 1.75rem);
	background-color: var(--c-cream);
	border: 1px solid rgba(201, 135, 16, .4);
}

.resource-card__head {
	display: flex;
	align-items: center;
	gap: .75rem;
}

.resource-card__head .icon {
	--icon-size: 1.5rem;
	color: var(--c-brown);
}

.resource-card__title {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 700;
	color: var(--c-blue);
}

.resource-card__text {
	flex: 1;
	font-size: var(--fs-sm);
	line-height: 1.6;
}

@media (min-width: 700px) {
	.resource-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}


/* ==========================================================================
   6. ВІДЕО
   ========================================================================== */

.play-btn {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	width: 3.75rem;
	height: 2.6875rem;
	margin: auto;
	color: var(--c-white);
	background-color: #ce1312;
	border-radius: .75rem;
	transition: background-color var(--transition), scale var(--transition);
}

.play-btn .icon {
	--icon-size: .9375rem;
	margin-left: .1875rem;
}

.play-btn:hover,
.play-btn:focus-visible {
	background-color: #b31110;
	scale: 1.08;
}

.live-badge {
	position: absolute;
	top: 1rem;
	left: 1rem;
	z-index: 1;
	display: inline-flex;
	align-items: center;
	gap: .5rem;
	padding: .375rem .75rem;
	font-size: var(--fs-sm);
	font-weight: 500;
	color: var(--c-blue);
	background-color: rgba(255, 255, 255, .92);
	border-radius: 4px;
}

/* --- головна трансляція --- */

.video-featured {
	display: grid;
	margin-bottom: clamp(1.5rem, 4vw, 2.5rem);
	background-color: var(--c-cream);
}

.video-featured__media {
	position: relative;
	aspect-ratio: 16 / 9;
	overflow: hidden;
}

.video-featured__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.video-featured__media iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.video-featured__body {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: clamp(1.25rem, 3vw, 2.5rem);
}

.video-featured__title {
	font-size: clamp(1.25rem, 1.1rem + .42vw, 1.375rem);
	font-weight: 600;
	line-height: 1.3;
	color: var(--c-ink);
}

.video-featured__text {
	font-size: var(--fs-body);
	line-height: 1.6;
}

/* --- сітка відео --- */

.video-grid {
	display: grid;
	gap: 1.25rem;
}

.video-card {
	/* обов'язково: від нього рахується ::after «розтягнутого» посилання заголовка.
	   Без цього оверлей позиціонувався б від вьюпорта і перехоплював кліки по шапці. */
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: var(--c-cream);
}

.video-card__media {
	position: relative;
	/* у макеті 420x250, а не 16:9 */
	aspect-ratio: 42 / 25;
	overflow: hidden;
}

.video-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: scale .4s ease;
}

.video-card:hover .video-card__media img {
	scale: 1.04;
}

.video-card__body {
	display: flex;
	flex-direction: column;
	gap: .625rem;
	padding: 1rem 1.25rem 1.5rem;
}

.video-card__date {
	font-family: var(--font-ui);
	font-size: var(--fs-sm);
	color: var(--c-brown);
}

.video-card__title {
	font-size: var(--fs-body);
	font-weight: 600;
	line-height: 1.4;
	color: var(--c-ink);
}

.video-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

@media (min-width: 700px) {
	.video-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 1024px) {
	.video-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.video-featured {
		/* межа медіа/панель у макеті на x=819 при контейнері 70…1370 → 750/550 */
		grid-template-columns: minmax(0, 15fr) minmax(0, 11fr);
	}

	.video-featured__media {
		aspect-ratio: auto;
		height: 100%;
	}
}


/* ==========================================================================
   7. КАРТКИ ЗАПИСІВ (блог, події)
   ========================================================================== */

.posts-grid {
	display: grid;
	gap: 1.25rem;
}

.post-card {
	display: grid;
	gap: 1rem;
	height: 100%;
	padding: clamp(.75rem, 1.5vw, 1.125rem);
	background-color: var(--c-cream);
}

.post-card__img {
	width: 100%;
	aspect-ratio: 3 / 2;
	object-fit: cover;
}

.post-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: .625rem;
	padding-block: .25rem;
}

.post-card__title {
	font-size: var(--fs-lead);
	font-weight: 600;
	line-height: 1.35;
	color: var(--c-ink);
}

.post-card__excerpt {
	flex: 1;
	font-size: var(--fs-sm);
	line-height: 1.6;
}

.post-card .link-more {
	margin-top: .375rem;
}

/* вертикальний варіант — зображення зверху */
.post-card--vertical {
	display: flex;
	flex-direction: column;
	padding: 0;
}

.post-card--vertical .post-card__img {
	aspect-ratio: 16 / 10;
}

.post-card--vertical .post-card__body {
	flex: 1;
	padding: 1.125rem 1.25rem 1.5rem;
}

@media (min-width: 520px) {
	.post-card {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: start;
		gap: 1.25rem;
	}
}

@media (min-width: 900px) {
	.posts-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1.5rem 1.25rem;
	}

	.posts-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}


/* ==========================================================================
   8. ТАБЛИЦЯ АНОНСІВ
   ========================================================================== */

.events-table {
	width: 100%;
	background-color: var(--c-cream);
}

.events-table th,
.events-table td {
	padding: 1rem 1.25rem;
	text-align: left;
	vertical-align: top;
}

.events-table thead th {
	font-family: var(--font-ui);
	font-size: var(--fs-xs);
	font-weight: 500;
	text-transform: uppercase;
	color: var(--c-brown);
	white-space: nowrap;
}

.events-table__label {
	display: flex;
	align-items: center;
	gap: .625rem;
}

.events-table__label .icon {
	--icon-size: 1rem;
}

.events-table tbody td {
	font-size: var(--fs-sm);
	line-height: 1.5;
}

.events-table tbody tr + tr {
	border-top: 1px solid rgba(0, 0, 0, .1);
}

.events-table tbody th {
	font-size: var(--fs-sm);
	font-weight: 600;
	color: var(--c-blue);
}

/* мобільний вигляд — картки замість рядків */
@media (max-width: 899px) {
	.events-table thead {
		display: none;
	}

	.events-table,
	.events-table tbody,
	.events-table tr,
	.events-table th,
	.events-table td {
		display: block;
	}

	.events-table tr {
		padding: 1rem .25rem;
	}

	.events-table th,
	.events-table td {
		padding: .375rem 1rem;
	}

	.events-table th::before,
	.events-table td::before {
		content: attr(data-label);
		display: block;
		margin-bottom: .25rem;
		font-family: var(--font-ui);
		font-size: var(--fs-xs);
		text-transform: uppercase;
		color: var(--c-brown);
	}
}

@media (min-width: 900px) {
	.events-table thead th:nth-child(1) { width: 26%; }
	.events-table thead th:nth-child(2) { width: 18%; }
	.events-table thead th:nth-child(3) { width: 26%; }
}


/* ==========================================================================
   9. ГАЛЕРЕЯ
   ========================================================================== */

.gallery {
	display: grid;
	gap: 1.25rem;
	grid-template-columns: 1fr;
}

@media (min-width: 560px) {
	.gallery {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.gallery {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.gallery__item {
	position: relative;
	display: block;
	overflow: hidden;
}

.gallery__img {
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	transition: scale .4s ease;
}

.gallery__item:hover .gallery__img,
.gallery__item:focus-visible .gallery__img {
	scale: 1.06;
}

.gallery__expand {
	position: absolute;
	top: .75rem;
	right: .75rem;
	display: grid;
	place-items: center;
	color: var(--c-white);
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .55));
}

.gallery__expand .icon {
	--icon-size: 1.125rem;
}

/* підпис — компактна плашка в нижньому лівому куті */
.gallery__caption {
	position: absolute;
	bottom: .625rem;
	left: .625rem;
	max-width: calc(100% - 1.25rem);
	padding: .375rem .625rem;
	font-family: var(--font-ui);
	font-size: var(--fs-xs);
	line-height: 1.3;
	color: var(--c-white);
	background-color: rgba(20, 26, 40, .72);
}

/* --- мозаїчний варіант: плитки на 1 або 2 колонки --- */

.gallery--masonry {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	grid-auto-rows: clamp(8rem, 30vw, 11rem);
}

/* посилання має заповнити комірку, інакше height:100% на <img> нема від чого рахувати
   і під низькими фото лишається порожнеча */
.gallery--masonry .gallery__item {
	height: 100%;
}

.gallery--masonry .gallery__img {
	height: 100%;
	aspect-ratio: auto;
}

/* модифікатор ставиться на <li> — саме він є елементом сітки */
.gallery__cell--wide {
	grid-column: span 2;
}

@media (min-width: 900px) {
	.gallery--masonry {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		grid-auto-rows: clamp(12rem, 19vw, 17rem);
	}
}

/* --- лайтбокс --- */

.lightbox {
	position: fixed;
	inset: 0;
	z-index: 200;
	display: grid;
	place-items: center;
	padding: clamp(1rem, 4vw, 3rem);
	background-color: rgba(18, 26, 46, .92);
}

.lightbox[hidden] {
	display: none;
}

.lightbox__img {
	max-width: 100%;
	max-height: 82vh;
	object-fit: contain;
}

.lightbox__caption {
	margin-top: 1rem;
	font-size: var(--fs-sm);
	text-align: center;
	color: var(--c-white);
}

.lightbox__close {
	position: absolute;
	top: clamp(.75rem, 3vw, 1.75rem);
	right: clamp(.75rem, 3vw, 1.75rem);
	display: grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	color: var(--c-white);
	background-color: rgba(255, 255, 255, .12);
	border-radius: 50%;
	transition: background-color var(--transition);
}

.lightbox__close:hover {
	background-color: rgba(255, 255, 255, .25);
}

.lightbox__close .icon {
	--icon-size: 1.25rem;
}


/* ==========================================================================
   10. КОНТАКТИ
   ========================================================================== */

.contacts {
	display: grid;
	gap: clamp(2rem, 5vw, 3.5rem);
}

.contacts__list {
	display: flex;
	flex-direction: column;
	gap: clamp(1.5rem, 3vw, 2.25rem);
}

.contacts__list .info-item__label {
	margin-bottom: 1rem;
}

.contacts__list .info-item__value {
	font-size: var(--fs-lead);
	line-height: 1.5;
}

.contacts__socials {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: .5rem;
}

.contacts__map {
	position: relative;
	aspect-ratio: 16 / 10;
	overflow: hidden;
}

.contacts__map iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

@media (min-width: 900px) {
	.contacts {
		grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
		align-items: start;
		gap: clamp(2rem, 5vw, 4rem);
	}

	.contacts__map {
		aspect-ratio: 16 / 9.2;
	}
}


/* ==========================================================================
   11. СТАТТЯ
   ========================================================================== */

.article__title {
	margin-bottom: clamp(1.25rem, 3vw, 2rem);
	font-family: var(--font-display);
	font-size: var(--fs-h2);
	font-weight: 600;
	line-height: 1.15;
	text-transform: uppercase;
	color: var(--c-blue);
}

.article__cover {
	width: 100%;
	/* виміряно в макеті: 1299x396 */
	aspect-ratio: 82 / 25;
	object-fit: cover;
	margin-bottom: 1.25rem;
}

.article__meta {
	margin-bottom: clamp(1.25rem, 3vw, 2rem);
}

.article__body {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	/* у макеті колонка набору ≈1040px, а не вся ширина контейнера */
	max-width: 65rem;
	font-size: var(--fs-lead);
	line-height: 1.7;
}

.article__signature {
	font-style: italic;
	color: var(--c-ink-muted);
}

.article__footer {
	margin-top: clamp(2rem, 5vw, 3.5rem);
}

.btn--back {
	gap: 1rem;
	color: var(--c-brown);
	background-color: var(--c-cream);
	font-size: var(--fs-sm);
}

.btn--back:hover,
.btn--back:focus-visible {
	background-color: #fff4d8;
}

.btn--back .icon {
	--icon-size: .5rem;
	rotate: 180deg;
}


/* ==========================================================================
   12. ПАГІНАЦІЯ
   ========================================================================== */

.pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .875rem;
	margin-top: clamp(1.75rem, 4vw, 2.5rem);
}

.pagination__item {
	display: grid;
	place-items: center;
	min-width: 1.875rem;
	height: 1.875rem;
	padding-inline: .25rem;
	font-family: var(--font-ui);
	font-size: var(--fs-sm);
	font-weight: 500;
	color: var(--c-brown);
	background-color: var(--c-cream);
	transition: background-color var(--transition), color var(--transition);
}

a.pagination__item:hover,
a.pagination__item:focus-visible {
	background-color: #fff4d8;
}

.pagination__item.is-current {
	color: var(--c-white);
	background-color: var(--c-ochre);
}

.pagination__item--nav {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .75rem;
	min-width: 8.3125rem;
	padding-inline: 1rem;
}

.pagination__item--nav .icon {
	--icon-size: .5rem;
}

.pagination__item--prev .icon {
	rotate: 180deg;
}

.pagination__item--gap,
.pagination__item.is-disabled {
	pointer-events: none;
}

.pagination__item.is-disabled {
	opacity: .5;
}
