/**
 * KOI Theme — Global Styles
 *
 * Styles that cannot be expressed in theme.json:
 * animations, scroll reveal, image filters, responsive overrides.
 *
 * @package KOI
 */

/* ─── RESET ─── */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-font-smoothing: antialiased;
}

img {
	max-width: 100%;
	display: block;
}

:focus-visible {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
}


/**
 * KOI Navigation Styles
 */

/* Default: teal bg (visible on all pages) */
:root :where(.koi-nav) {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	z-index: 100;
	transition: all 0.5s;
	background: rgba(31, 76, 84, 0.95);
	backdrop-filter: blur(12px);
}

/* Front page: transparent nav until scroll */
body.home :where(.koi-nav),
body.page-template-front-page :where(.koi-nav) {
	background: transparent;
	backdrop-filter: none;
}

:root :where(.koi-nav.scrolled) {
	background: rgba(31, 76, 84, 0.95) !important;
	backdrop-filter: blur(12px) !important;
	padding-top: 0.8rem !important;
	padding-bottom: 0.8rem !important;
	box-shadow: 0 2px 20px rgba(0, 0, 0, 0.15);
}

/* Logo sizing (wp:site-logo) */
:root :where(.nav-logo img),
:root :where(.nav-logo .wp-block-site-logo img) {
	height: 120px;
	width: auto;
	transition: all 0.4s;
}

:root :where(.koi-nav.scrolled .nav-logo img),
:root :where(.koi-nav.scrolled .nav-logo .wp-block-site-logo img) {
	height: 45px;
}

/* Navigation links */
:root :where(.nav-links a) {
	color: var(--wp--preset--color--beige);
	opacity: 1;
}

:root :where(.nav-links a:hover) {
	color: var(--wp--preset--color--beige);
}

:root :where(.nav-links a:focus-visible) {
	outline: 2px solid var(--wp--preset--color--gold);
	outline-offset: 2px;
}

/* Navigation separators between menu items */
:root :where(.koi-nav .wp-block-navigation-item:not(:last-child))::after {
	content: '/';
	color: var(--wp--preset--color--beige);
	opacity: 0.25;
	font-family: var(--wp--preset--font-family--primary);
	font-size: 1.35rem;
	font-weight: 400;
	margin-left: 0.3rem;
	pointer-events: none;
}

/* Language switcher — white pill, PL | ENG */
.koi-nav .koi-lang-switcher {
	display: inline-flex;
	align-items: center;
	gap: 0.55rem;
	background: var(--wp--preset--color--white);
	border-radius: 999px;
	padding: 0.35rem 0.9rem;
	margin: 0 0 0 1rem;
	list-style: none;
}
.koi-nav .koi-lang-switcher li {
	margin: 0;
	padding: 0;
	display: inline-flex;
	align-items: center;
	line-height: 1;
}
.koi-nav .koi-lang-switcher li + li::before {
	content: "";
	display: inline-block;
	width: 1px;
	height: 11px;
	background: rgba(31, 76, 84, 0.35);
	margin-right: 0.55rem;
}
.koi-nav .koi-lang-switcher a {
	color: var(--wp--preset--color--teal);
	font-family: var(--wp--preset--font-family--primary);
	font-size: 0.78rem;
	font-weight: 500;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1;
	opacity: 0.7;
	transition: opacity 0.2s, font-weight 0.2s;
}
.koi-nav .koi-lang-switcher a:hover,
.koi-nav .koi-lang-switcher .is-current a { opacity: 1; }
.koi-nav .koi-lang-switcher .is-current a { font-weight: 700; }

/* WP Navigation overlay (mobile menu) — full-screen */
:root :where(.koi-nav .wp-block-navigation__responsive-container.is-menu-open) {
	position: fixed !important;
	top: 0 !important;
	left: 0 !important;
	right: 0 !important;
	bottom: 0 !important;
	width: 100% !important;
	height: 100vh !important;
	z-index: 999 !important;
	background: rgba(31, 76, 84, 0.97);
	backdrop-filter: blur(12px);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow-y: auto;
}

:root :where(.koi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content) {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 1.5rem !important;
	width: 100% !important;
	padding: 2rem !important;
	text-align: center;
}

:root :where(.koi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content .wp-block-navigation-item) {
	width: auto !important;
	text-align: center;
}

:root :where(.koi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content ul) {
	display: flex !important;
	flex-direction: column !important;
	align-items: center !important;
	gap: 1.5rem !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Hamburger button color */
:root :where(.koi-nav .wp-block-navigation__responsive-container-open) {
	color: var(--wp--preset--color--beige);
}

/* Close button in overlay */
:root :where(.koi-nav .wp-block-navigation__responsive-container-close) {
	color: var(--wp--preset--color--beige);
	position: absolute;
	top: 1.5rem;
	right: 1.5rem;
	z-index: 1000;
}

/* Overlay navigation links */
:root :where(.koi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content) {
	color: var(--wp--preset--color--beige);
	font-size: 1.8rem;
	font-weight: 400;
	letter-spacing: 0.04em;
}

:root :where(.koi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content:hover) {
	color: var(--wp--preset--color--gold);
}

/* Hide separators in overlay */
:root :where(.koi-nav .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item)::after {
	display: none;
}

/* Skip-to-content link */
:root :where(.skip-to-content) {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1001;
	padding: 0.5rem 1rem;
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--teal);
	font-size: 0.88rem;
}

:root :where(.skip-to-content:focus) {
	left: 1rem;
	top: 0.5rem;
}

@media (max-width: 768px) {
	:root :where(.koi-nav) {
		padding: 1.2rem 1.5rem !important;
	}

	:root :where(.koi-nav.scrolled) {
		padding: 0.8rem 1.5rem !important;
	}
}

/**
 * KOI Hero Styles
 */

:root :where(.koi-hero) {
	position: relative;
	overflow: hidden;
}

/**
 * KOI Accompany Section Styles
 */

:root :where(.koi-accompany) {
	position: relative;
	overflow: hidden;
}

:root :where(.sec-accompany-inner) {
	max-width: 700px;
	text-align: center;
	margin: 0 auto;
}

/**
 * KOI Services Section Styles
 */

:root :where(.svc-item) {
	position: relative;
}

:root :where(.svc-item .svc-icon) {
	position: absolute;
	left: 0;
	top: 2rem;
	width: 44px !important;
	height: 44px !important;
}

:root :where(.svc-icon img) {
	filter: var(--wp--custom--icon-filter-gold);
	object-fit: contain;
}

:root :where(.svc-item p) {
	opacity: 0.8;
}

:root :where(.svc-item em) {
	color: var(--wp--preset--color--beige);
	opacity: 1;
}

:root :where(.svc-close) {
	opacity: 0.85;
}

:root :where(.intro) {
	margin-bottom: 3.5rem;
}

/**
 * KOI Mediation Section Styles
 */

:root :where(.med-note a) {
	text-decoration: underline;
	text-underline-offset: 2px;
}

:root :where(.med-note a:hover) {
	color: var(--wp--preset--color--gold);
}

@media (max-width: 1024px) {
	:root :where(.med-grid) {
		gap: 3rem;
	}
}

/**
 * KOI About Section — Photo Collage Styles
 */

:root :where(.about-collage) {
	position: relative;
	padding: 0 1rem 4rem;
	overflow: hidden;
}

:root :where(.about-collage .photo-front) {
	position: relative;
	z-index: 2;
	width: 78%;
}

:root :where(.about-collage .photo-front img) {
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
}

:root :where(.about-collage .photo-back) {
	position: relative;
	z-index: 1;
	width: 72%;
	margin-left: auto;
	margin-top: -3.5rem;
	transform: rotate(2deg);
}

:root :where(.about-collage .photo-back img) {
	box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

:root :where(.about-name) {
	position: relative;
	z-index: 3;
}

:root :where(.sec-about-text p) {
	opacity: 0.8;
}

:root :where(.sec-about-text p:first-child) {
	opacity: 0.9;
}

:root :where(.sec-about-social) {
	border-top: 1px solid rgba(216, 210, 198, 0.12);
	padding-top: 1.5rem;
}

:root :where(.sec-about-social a) {
	color: var(--wp--preset--color--gold);
	opacity: 0.85;
}

:root :where(.sec-about-social a:hover) {
	opacity: 1;
}

/* Social links — strip ALL backgrounds (logos-only style + force override) */
:root :where(.sec-about-social .wp-social-link),
:root :where(.contact-social .wp-social-link),
:root :where(.sec-about-social .wp-block-social-link),
:root :where(.contact-social .wp-block-social-link) {
	background: none !important;
	background-color: transparent !important;
	padding: 0;
}

:root :where(.sec-about-social .wp-social-link a),
:root :where(.contact-social .wp-social-link a) {
	padding: 0;
	min-width: 44px;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

:root :where(.sec-about-social .wp-social-link svg),
:root :where(.contact-social .wp-social-link svg) {
	width: 24px;
	height: 24px;
}

:root :where(.contact-social .wp-social-link) {
	color: var(--wp--preset--color--beige);
	opacity: 0.65;
}

:root :where(.contact-social .wp-social-link:hover) {
	opacity: 1;
	color: var(--wp--preset--color--gold);
}

@media (max-width: 768px) {
	:root :where(.about-collage) {
		padding: 0 0.5rem 3rem;
		max-width: 300px;
		margin: 0 auto;
	}

	:root :where(.koi-about .wp-block-column.about-collage) {
		align-items: center;
		text-align: center;
	}

	:root :where(.sec-about-social.wp-block-social-links) {
		justify-content: center;
	}
}

/**
 * KOI Blog Card Styles
 */

:root :where(.blog-card) {
	overflow: hidden;
	transition: transform 0.4s, box-shadow 0.4s;
	display: flex;
	flex-direction: column;
	height: 100%;
}

:root :where(.blog-card:hover) {
	transform: translateY(-4px);
	box-shadow: 0 12px 40px rgba(31, 76, 84, 0.08);
}

/* Featured image — force square crop */
:root :where(.blog-card-img),
:root :where(.blog-card .wp-block-post-featured-image) {
	aspect-ratio: 1;
	overflow: hidden;
	flex-shrink: 0;
}

:root :where(.blog-card-img img),
:root :where(.blog-card .wp-block-post-featured-image img) {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 0.6s;
}

/* Card body fills remaining space */
:root :where(.blog-card-body) {
	flex: 1;
	display: flex;
	flex-direction: column;
}

:root :where(.blog-card:hover .blog-card-img img),
:root :where(.blog-card:hover img) {
	transform: scale(1.03);
}

:root :where(.blog-card-tag) {
	font-size: 0.6rem;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--wp--preset--color--gold);
	margin-bottom: 0.4rem;
	display: inline-block;
}

/**
 * KOI Blog Carousel
 */

:root :where(.koi-blog-track) {
	display: flex;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 0.5rem;
	list-style: none;
	padding-left: 0;
	align-items: stretch;
}

:root :where(.koi-blog-track)::-webkit-scrollbar {
	display: none;
}

:root :where(.koi-blog-track > li),
:root :where(.koi-blog-track > .blog-card) {
	flex: 1 1 calc((100% - 3rem) / 3);
	max-width: calc((100% - 3rem) / 3);
	scroll-snap-align: start;
	min-width: 0;
}

/* When carousel is active (>3 posts), prevent cards from shrinking */
:root :where(.koi-blog-carousel .koi-blog-track > li),
:root :where(.koi-blog-carousel .koi-blog-track > .blog-card) {
	flex: 0 0 calc((100% - 3rem) / 3);
}

:root :where(.koi-blog-carousel) {
	position: relative;
}

:root :where(.koi-carousel-prev),
:root :where(.koi-carousel-next) {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
	width: 2.8rem;
	height: 2.8rem;
	border-radius: 50%;
	border: 1px solid rgba(31, 76, 84, 0.12);
	background: var(--wp--preset--color--beige-warm);
	color: var(--wp--preset--color--teal);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
	transition: all 0.3s;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

:root :where(.koi-carousel-prev) {
	left: -1.4rem;
}

:root :where(.koi-carousel-next) {
	right: -1.4rem;
}

:root :where(.koi-carousel-prev:hover),
:root :where(.koi-carousel-next:hover) {
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--beige);
	border-color: var(--wp--preset--color--teal);
}

:root :where(.koi-carousel-prev.is-hidden),
:root :where(.koi-carousel-next.is-hidden) {
	opacity: 0;
	pointer-events: none;
}

@media (max-width: 768px) {
	:root :where(.koi-blog-track > li),
	:root :where(.koi-blog-track > .blog-card) {
		flex: 0 0 85%;
	}

	:root :where(.koi-carousel-prev),
	:root :where(.koi-carousel-next) {
		display: none;
	}
}

@media (min-width: 769px) and (max-width: 1024px) {
	:root :where(.koi-blog-track > li),
	:root :where(.koi-blog-track > .blog-card) {
		flex: 0 0 calc((100% - 1.5rem) / 2);
	}
}

/**
 * KOI Photo Break Styles
 */

:root :where(.koi-photo-break) {
	position: relative;
	overflow: hidden;
	height: 70vh;
	min-height: 350px;
	background-color: var(--wp--preset--color--teal);
}

:root :where(.koi-photo-break img) {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 20%;
}

:root :where(.koi-photo-break figure) {
	position: absolute;
	inset: 0;
	margin: 0;
}

/* Gradient overlays */
:root :where(.koi-photo-break)::before,
:root :where(.koi-photo-break)::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	height: 40%;
	z-index: 1;
	pointer-events: none;
}

:root :where(.koi-photo-break)::before {
	top: 0;
	background: linear-gradient(180deg, #EDE8DE 0%, rgba(237, 232, 222, 0) 100%);
}

:root :where(.koi-photo-break)::after {
	bottom: 0;
	background: linear-gradient(0deg, #1F4C54 0%, rgba(31, 76, 84, 0) 100%);
}

@media (max-width: 768px) {
	:root :where(.koi-photo-break) {
		height: 50vh;
		min-height: 280px;
	}
}

/**
 * KOI Contact Section Styles
 */

:root :where(.contact-note) {
	opacity: 0.75;
}

:root :where(.contact-info p) {
	opacity: 0.85;
}

:root :where(.contact-info a) {
	color: var(--wp--preset--color--beige);
	opacity: 0.85;
}

:root :where(.contact-info a:hover) {
	opacity: 1;
	color: var(--wp--preset--color--gold);
}

:root :where(.contact-social) {
	border-top: 1px solid rgba(216, 210, 198, 0.1);
	padding-top: 1.5rem;
}

:root :where(.contact-social a) {
	opacity: 0.65;
}

:root :where(.contact-social a:hover) {
	opacity: 1;
	color: var(--wp--preset--color--gold);
}

/* Contact form (CF7) styling */
:root :where(.contact-form .wpcf7 input),
:root :where(.contact-form .wpcf7 textarea) {
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(216, 210, 198, 0.2);
	color: var(--wp--preset--color--beige);
	padding: 0.75rem 1rem;
	font-family: var(--wp--preset--font-family--primary);
	font-size: 0.88rem;
	border-radius: 4px;
	width: 100%;
}

:root :where(.contact-form .wpcf7 input::placeholder),
:root :where(.contact-form .wpcf7 textarea::placeholder) {
	color: rgba(216, 210, 198, 0.7);
}

:root :where(.contact-form .wpcf7 input[type="submit"]) {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--teal);
	border: none;
	font-weight: 500;
	letter-spacing: 0.06em;
	cursor: pointer;
	transition: opacity 0.3s;
}

:root :where(.contact-form .wpcf7 input[type="submit"]:hover) {
	opacity: 0.85;
}

@media (max-width: 768px) {
	:root :where(.koi-contact .wp-block-columns) {
		flex-direction: column;
		gap: 2rem;
	}
}

/**
 * KOI Single Post Styles
 */

:root :where(.post-tags a) {
	display: inline-block;
	font-size: 0.72rem;
	letter-spacing: 0.06em;
	padding: 0.25rem 0.65rem;
	border: 1px solid rgba(31, 76, 84, 0.15);
	border-radius: 20px;
	color: var(--wp--preset--color--teal);
	transition: all 0.3s;
}

:root :where(.post-tags a:hover) {
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--beige);
	border-color: var(--wp--preset--color--teal);
}

:root :where(.post-navigation a) {
	color: var(--wp--preset--color--teal);
	transition: color 0.3s;
}

:root :where(.post-navigation a:hover) {
	color: var(--wp--preset--color--gold);
}

/**
 * KOI Comments Styles
 */

:root :where(.koi-comments) {
	color: var(--wp--preset--color--teal);
}

:root :where(.koi-comments .comment-respond) {
	margin-top: 2rem;
}

:root :where(.koi-comments textarea),
:root :where(.koi-comments input:not([type="submit"])) {
	background: var(--wp--preset--color--beige-warm);
	border: 1px solid rgba(31, 76, 84, 0.12);
	border-radius: 4px;
	padding: 0.75rem 1rem;
	font-family: var(--wp--preset--font-family--primary);
	font-size: 0.88rem;
	color: var(--wp--preset--color--teal);
	width: 100%;
}

:root :where(.koi-comments input[type="submit"]) {
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--beige);
	border: none;
	padding: 0.7rem 1.5rem;
	border-radius: 4px;
	font-family: var(--wp--preset--font-family--primary);
	font-weight: 500;
	cursor: pointer;
	transition: background 0.3s;
}

:root :where(.koi-comments input[type="submit"]:hover) {
	background: var(--wp--preset--color--gold);
	color: var(--wp--preset--color--teal);
}

/**
 * KOI Pagination Styles
 */

:root :where(.wp-block-query-pagination) {
	gap: 0.5rem;
}

:root :where(.wp-block-query-pagination-numbers .page-numbers) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	height: 2.75rem;
	padding: 0.25rem 0.5rem;
	font-size: 0.85rem;
	border-radius: 4px;
	color: var(--wp--preset--color--teal);
	transition: all 0.3s;
}

:root :where(.wp-block-query-pagination-numbers .page-numbers:hover) {
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--beige);
}

:root :where(.wp-block-query-pagination-numbers .page-numbers.current) {
	background: var(--wp--preset--color--teal);
	color: var(--wp--preset--color--beige);
	font-weight: 600;
}

:root :where(.wp-block-query-pagination-previous),
:root :where(.wp-block-query-pagination-next) {
	font-size: 0.85rem;
	color: var(--wp--preset--color--teal);
	transition: color 0.3s;
}

:root :where(.wp-block-query-pagination-previous:hover),
:root :where(.wp-block-query-pagination-next:hover) {
	color: var(--wp--preset--color--gold);
}

/* Post excerpt on cards */
:root :where(.blog-card .wp-block-post-excerpt) {
	opacity: 0.65;
}

/* Equal-height cards in grid templates (archive, index, search) */
:root :where(.blog-grid) {
	align-items: stretch;
}

:root :where(.blog-grid > li) {
	display: flex;
}

:root :where(.blog-grid > li > .blog-card) {
	width: 100%;
}


/* ─── MUTED IMAGE FILTER ─── */
:root :where(.img-muted),
:root :where(.img-muted img),
:root :where(.is-style-muted),
:root :where(.is-style-muted img) {
	filter: var(--wp--custom--img-muted-filter);
}

/* ─── SCROLL REVEAL ─── */
:root :where(.sr) {
	opacity: 0;
	transform: translateY(22px);
	transition: opacity 1.4s ease, transform 1.4s ease;
}

:root :where(.sr.vis) {
	opacity: 1;
	transform: translateY(0);
}

/* ─── SEQUENTIAL TEXT ANIMATION ─── */
:root :where(.wave-line),
:root :where(.manifest-line) {
	opacity: 0;
	transform: translateY(15px);
	transition: opacity 1.4s ease, transform 1.4s ease;
	display: block;
}

:root :where(.wave-line.visible),
:root :where(.manifest-line.visible) {
	opacity: 1;
	transform: translateY(0);
}

/* ─── FADE-UP KEYFRAME ─── */
@keyframes fadeUp {
	from {
		opacity: 0;
		transform: translateY(20px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@keyframes fadeIn {
	from { opacity: 0; }
	to   { opacity: 1; }
}

/* ─── HERO VIDEO ─── */
:root :where(.koi-hero-video) {
	position: absolute;
	inset: 0;
	z-index: 0;
	opacity: 0;
	animation: fadeIn 0.8s ease 0.4s forwards;
}

:root :where(.koi-hero-video video) {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

:root :where(.koi-hero-video)::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(31,76,84,0.55) 0%, rgba(31,76,84,0.45) 50%, var(--wp--preset--color--teal) 100%);
	z-index: 1;
}

/* ─── HERO ─── */
:root :where(.koi-hero-center) {
	position: relative;
	z-index: 2;
	opacity: 0;
	animation: fadeUp 1.2s cubic-bezier(0.16, 1, 0.3, 1) 0.2s forwards;
}

:root :where(.hero-logo) {
	width: clamp(280px, 38vw, 500px);
}

:root :where(.hero-sub a) {
	opacity: 0.8;
	transition: opacity 0.3s;
	color: var(--wp--preset--color--beige);
}

:root :where(.hero-sub a:hover) {
	opacity: 1;
}

/* ─── VERTICAL ALIGN COLUMNS ─── */
.koi-manifest .wp-block-columns,
.koi-manifest .wp-block-columns.is-layout-flex,
.wp-block-columns.med-grid,
.wp-block-columns.med-grid.is-layout-flex {
	align-items: center !important;
}
.koi-manifest .wp-block-columns > .wp-block-column,
.wp-block-columns.med-grid > .wp-block-column {
	align-self: center !important;
}

/* ─── MANIFEST IMAGE MASK ─── */
:root :where(.sec-manifest-img img) {
	-webkit-mask-image:
		linear-gradient(to bottom, transparent 0%, black 4%, black 96%, transparent 100%),
		linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
	-webkit-mask-composite: destination-in;
	mask-image:
		linear-gradient(to bottom, transparent 0%, black 4%, black 96%, transparent 100%),
		linear-gradient(to right, transparent 0%, black 4%, black 96%, transparent 100%);
	mask-composite: intersect;
}

/* ─── ACCOMPANY SECTION ─── */
:root :where(.koi-accompany .lead) {
	opacity: 0.9;
}

/* ─── SUBTITLE (blog) ─── */
:root :where(.subtitle) {
	opacity: 0.65;
	max-width: 460px;
	margin-left: auto;
	margin-right: auto;
}

/* ─── LINK STYLES ─── */
:root :where(.koi-hero a),
:root :where(.koi-nav a),
:root :where(.koi-services a),
:root :where(.koi-about a),
:root :where(.koi-contact a),
:root :where(.koi-footer a),
:root :where(.post-navigation a),
:root :where(.post-tags a) {
	transition: color 0.3s;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
	:root :where(.hero-logo) {
		width: clamp(200px, 55vw, 300px);
	}

	:root :where(.koi-hero-video video) {
		object-position: center;
	}

	:root :where(.koi-manifest .wp-block-columns) {
		flex-direction: column-reverse;
	}

	:root :where(.med-images) {
		flex-direction: column;
	}

	:root :where(.med-images .wp-block-image) {
		max-width: 100%;
	}

	:root :where(.med-grid) {
		flex-direction: column !important;
	}

	/* Reduce section padding on mobile */
	:root :where(.koi-accompany),
	:root :where(.koi-services),
	:root :where(.koi-mediation),
	:root :where(.koi-about),
	:root :where(.koi-blog),
	:root :where(.koi-closing),
	:root :where(.koi-contact),
	:root :where(.koi-manifest) {
		padding-left: 1.5rem !important;
		padding-right: 1.5rem !important;
	}

	:root :where(.koi-closing) {
		padding-top: 4rem !important;
		padding-bottom: 4rem !important;
	}

	/* Blog cards fallback when <4 posts (no carousel) */
	:root :where(.koi-blog-track) {
		flex-wrap: wrap;
		justify-content: center;
	}

	:root :where(.koi-blog-track > li),
	:root :where(.koi-blog-track > .blog-card) {
		flex: 0 0 85%;
		max-width: 340px;
	}

	/* Footer center on mobile */
	:root :where(.koi-footer) {
		justify-content: center !important;
		text-align: center;
		padding: 1.5rem !important;
	}

	:root :where(.footer-meta) {
		justify-content: center;
	}

	/* Hide nav separators in mobile overlay */
	:root :where(.koi-nav .wp-block-navigation-item)::after {
		display: none;
	}
}

/* ─── REDUCED MOTION ─── */
@media (prefers-reduced-motion: reduce) {
	:root :where(.sr) {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	:root :where(.wave-line),
	:root :where(.manifest-line) {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}

	:root :where(.koi-hero-center) {
		opacity: 1;
		animation: none;
	}

	/* Hide autoplay video — poster image shows instead */
	:root :where(.koi-hero-video video) {
		display: none;
	}

	:root :where(.blog-card) {
		transition: none;
	}

	:root :where(.blog-card:hover) {
		transform: none;
		box-shadow: none;
	}

	:root :where(.blog-card:hover .blog-card-img img),
	:root :where(.blog-card:hover img) {
		transform: none;
	}
}

/* ─── HOME PATTERN STACK: kill blockGap between seeded sections ─── */
body.home main#main,
body.home main#main > .wp-block-post-content {
	--wp--style--block-gap: 0;
}
body.home main#main > .wp-block-post-content > * + *,
body.home main#main > * + * {
	margin-block-start: 0;
}

/* ─── PRINT ─── */
@media print {
	:root :where(.koi-nav),
	:root :where(.koi-hero-video),
	:root :where(.koi-photo-break),
	:root :where(.koi-carousel-prev),
	:root :where(.koi-carousel-next) {
		display: none !important;
	}

	body {
		background: #fff !important;
		color: #000 !important;
	}

	:root :where(.koi-hero),
	:root :where(.koi-services),
	:root :where(.koi-about),
	:root :where(.koi-mediation),
	:root :where(.koi-manifest),
	:root :where(.koi-closing),
	:root :where(.koi-contact) {
		background: #fff !important;
		color: #000 !important;
		padding: 1rem !important;
	}
}
