/* ============================================================
   ADULT GATE — заблокированные превью 18+ и модалка
   Файл подключается на каждой странице (см. inzoi_enqueue_adult_gate_assets)
   ============================================================ */

/* --- Картинка-заглушка, где у нас есть обёртка (post_thumbnail_html) --- */

.inzoi-adult-thumb {
	position: relative;
	display: block;
	cursor: pointer;
}

.inzoi-adult-thumb img {
	display: block;
}

.inzoi-adult-thumb::after {
	content: "Нажмите, чтобы узнать как открыть";
	position: absolute;
	left: 50%;
	bottom: 10px;
	transform: translateX(-50%);
	max-width: 88%;
	text-align: center;
	font-size: 11px;
	font-weight: 600;
	color: #fff;
	background: rgba(0, 0, 0, 0.45);
	padding: 5px 10px;
	border-radius: 999px;
	opacity: 0;
	transition: opacity 0.15s ease;
	pointer-events: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.inzoi-adult-thumb:hover::after,
.inzoi-adult-thumb:focus-visible::after {
	opacity: 1;
}

.inzoi-adult-thumb:focus-visible {
	outline: 2px solid #82bcff;
	outline-offset: 2px;
}

.inzoi-adult-thumb__badge {
	position: absolute;
	top: 10px;
	right: 10px;
	background: #ff4b5c;
	color: #ffffff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	padding: 5px 8px;
	border-radius: 7px;
	letter-spacing: 0.02em;
	pointer-events: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
	z-index: 5;
}

/* --- Блюр-классы карточек/одиночных страниц ---
   mod-card--blur и media-card--blur ставятся в шаблонах темы по чекбоксу
   blur_image БЕЗ проверки возраста (шаблон карточки лежит в родительской
   теме, доступа к нему у нас нет). Перебиваем CSS-блюр для тех, у кого
   возраст уже подтверждён — см. body_class фильтр inzoi_body_class_age_verified. */
body.inzoi-age-verified .mod-card--blur,
body.inzoi-age-verified .media-card--blur,
body.inzoi-age-verified .mod-card--blur .mod-card__img,
body.inzoi-age-verified .media-card--blur img {
	filter: none !important;
	-webkit-filter: none !important;
}

/* --- Та же заглушка, но выведенная напрямую через <img src="..."> без
   обёртки (single.php слайдер, list-mod.php и т.п.). Раньше заглушка была
   data:URI и матчилась атрибутным селектором — но это ломало вывод там,
   где шаблон оборачивает src в esc_url() (esc_url по умолчанию не
   пропускает протокол data: и обрезает строку в пустую — картинка
   пропадала целиком). Теперь заглушка — обычный файл темы, а класс
   .inzoi-adult-locked-img навешивается в adult-gate.js по точному
   совпадению src с inzoiGate.placeholderSrc. --- */

.inzoi-adult-locked-img {
	cursor: pointer;
}

/* ============================================================
   МОДАЛКА "Контент 18+"
   ============================================================ */

.inzoi-gate-modal {
	position: fixed;
	inset: 0;
	z-index: 10000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.inzoi-gate-modal[hidden] {
	display: none;
}

.inzoi-gate-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(15, 17, 23, 0.55);
	backdrop-filter: blur(2px);
}

.inzoi-gate-modal__box {
	position: relative;
	width: 100%;
	max-width: 380px;
	background: #ffffff;
	border-radius: 18px;
	padding: 28px 24px 24px;
	text-align: center;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
	animation: inzoiGateIn 0.18s ease;
}

@keyframes inzoiGateIn {
	from { opacity: 0; transform: translateY(8px) scale(0.98); }
	to   { opacity: 1; transform: translateY(0) scale(1); }
}

.inzoi-gate-modal__close {
	position: absolute;
	top: 10px;
	right: 12px;
	width: 30px;
	height: 30px;
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	color: #9aa0b0;
	cursor: pointer;
	border-radius: 8px;
}

.inzoi-gate-modal__close:hover {
	background: #f2f4f8;
	color: #444;
}

.inzoi-gate-modal__icon {
	width: 52px;
	height: 52px;
	margin: 0 auto 14px;
	border-radius: 16px;
	background: #ff4b5c;
	color: #fff;
	font-weight: 800;
	font-size: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
}

.inzoi-gate-modal__title {
	font-size: 18px;
	font-weight: 700;
	margin-bottom: 8px;
	color: #1f2433;
}

.inzoi-gate-modal__text {
	font-size: 14px;
	line-height: 1.55;
	color: #5f6679;
	margin-bottom: 20px;
}

.inzoi-gate-modal__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 12px 18px;
	border-radius: 12px;
	background: #82bcff;
	color: #ffffff !important;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	transition: background 0.15s ease;
}

.inzoi-gate-modal__btn:hover,
.inzoi-gate-modal__btn:visited,
.inzoi-gate-modal__btn:active {
	background: #51a2ff;
	color: #ffffff !important;
}

body.inzoi-gate-modal-open {
	overflow: hidden;
}

/* --- Тёмная тема --- */

html.dark .inzoi-gate-modal__box {
	background: #181a23;
}

html.dark .inzoi-gate-modal__title {
	color: #e1e4ed;
}

html.dark .inzoi-gate-modal__text {
	color: #9aa0b8;
}

html.dark .inzoi-gate-modal__close:hover {
	background: #232634;
	color: #d1d5e0;
}

@media (max-width: 480px) {
	.inzoi-gate-modal__box {
		padding: 24px 18px 20px;
	}
}