/**
 * Slide Popup Styles — pgc-popup для слайдера топ-событий
 * Namhie Theme
 */

/* Variables */
:root {
	--pgc-accent: #00636B;
	--pgc-accent-hover: #015057;
	--pgc-accent-light: rgba(18, 71, 52, 0.08);
	--pgc-bg: #F8F9FA;
	--pgc-border: #E8E8E8;
	--pgc-text: #222;
	--pgc-text-secondary: #555;
	--pgc-text-muted: #767676;
	--pgc-white: #fff;
	--pgc-radius: 16px;
	--pgc-font: "Noah", Sans-serif;
}

/* Overlay */
.pgc-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
	backdrop-filter: blur(12px);
	-webkit-backdrop-filter: blur(12px);
	z-index: 99999;
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.pgc-popup-overlay.active {
	opacity: 1;
	visibility: visible;
}

/* Popup window */
.pgc-popup {
	position: fixed;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -48%) scale(0.96);
	width: 90%;
	max-width: 520px;
	max-height: 90vh;
	background: var(--pgc-white);
	border-radius: var(--pgc-radius);
	box-shadow: 0 25px 80px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.12);
	z-index: 100000;
	opacity: 0;
	visibility: hidden;
	overflow: hidden;
	font-family: var(--pgc-font);
	transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
	            opacity 0.3s ease,
	            visibility 0.3s ease;
}

.pgc-popup.active {
	opacity: 1;
	visibility: visible;
	transform: translate(-50%, -50%) scale(1);
}

.pgc-popup-inner {
	overflow-y: auto;
	overflow-x: hidden;
	max-height: 90vh;
	overscroll-behavior: contain;
}

/* Close button */
.pgc-popup-close {
	position: absolute;
	top: 0;
	right: 0;
	width: 42px;
	height: 42px;
	background: var(--pgc-accent);
	border: none;
	border-radius: 0 var(--pgc-radius) 0 14px;
	color: var(--pgc-white);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 10;
	transition: background 0.2s ease;
	padding:0;
}

.pgc-popup-close:hover {
	background: var(--pgc-accent-hover);
}

.pgc-popup-close svg {
	width: 20px;
	height: 20px;
}

/* Image */
.pgc-popup-image {
	position: relative;
	line-height: 0;
	background: var(--pgc-bg);
}

.pgc-popup-image img {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 1 / 1;
	object-fit: cover;
}

/* Badges */
.pgc-popup-badges {
	position: absolute;
	bottom: -12px;
	left: 28px;
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.pgc-popup-content > .pgc-popup-badges {
	position: static;
	margin-bottom: 12px;
}

.pgc-popup-date-badge,
.pgc-popup-time-badge,
.pgc-popup-venue-badge {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	line-height: 1em;
	background: var(--pgc-accent);
	color: var(--pgc-white);
	padding: 7px 16px;
	border-radius: 24px;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.01em;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.pgc-popup-time-badge,
.pgc-popup-venue-badge {
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.pgc-popup-venue-badge::before {
	content: '';
	display: inline-block;
	width: 14px;
	height: 14px;
	background: currentColor;
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M12 2C8.13 2 5 5.13 5 9c0 5.25 7 13 7 13s7-7.75 7-13c0-3.87-3.13-7-7-7zm0 9.5a2.5 2.5 0 110-5 2.5 2.5 0 010 5z'/%3E%3C/svg%3E");
	-webkit-mask-size: contain;
	mask-size: contain;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	flex-shrink: 0;
}

/* Content */
.pgc-popup-content {
	padding: 12px 28px 24px;
}

.pgc-popup-audience-tags {
	display: flex;
	gap: 8px;
	margin-bottom: 14px;
	flex-wrap: wrap;
}

.pgc-popup-title {
	font-size: 22px;
	font-weight: 500;
	color: var(--pgc-text)!important;
	margin: 0 0 20px;
	line-height: 1.3;
	letter-spacing: -0.02em;
}

.pgc-popup-description {
	font-size: 16px;
	line-height: 1.5;
	color: var(--pgc-text-secondary);
}

.pgc-popup-description p {
    margin: 0px 0 6px;
    line-height: 1.3em;
}

.pgc-popup-description p:last-child {
	margin-bottom: 0;
}

.pgc-popup-description ul {
	margin: 14px 0;
	padding-left: 22px;
}

.pgc-popup-description li {
	margin: 8px 0;
	line-height: 1.6;
}

.pgc-popup-description li::marker {
	color: var(--pgc-accent);
}

.pgc-popup-description strong {
	color: #333;
	font-weight: 600;
}

.pgc-popup-description a {
	color: var(--pgc-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	transition: color 0.2s ease;
}

.pgc-popup-description a:hover {
	color: var(--pgc-accent-hover);
}

/* Tables */
.pgc-popup-description .pgc-table-wrap {
	margin: 16px 0;
	border-radius: 10px;
}

.pgc-popup-description .pgc-table-wrap table {
	margin: 0;
	max-width: 100%;
}

/* No image variant */
.pgc-popup.no-image .pgc-popup-content {
	padding-top: 52px;
}

/* Loading & Error */
.pgc-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 72px 32px;
}

.pgc-spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--pgc-border);
	border-top-color: var(--pgc-accent);
	border-radius: 50%;
	animation: pgcSpin 0.7s linear infinite;
}

@keyframes pgcSpin {
	to { transform: rotate(360deg); }
}

.pgc-no-events {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	padding: 72px 32px;
	color: var(--pgc-text-muted);
	font-size: 15px;
	line-height: 1.5;
	background: var(--pgc-white);
	border-radius: var(--pgc-radius);
	border: 1px dashed #DDD;
}

.pgc-no-events svg {
	width: 52px;
	height: 52px;
	margin-bottom: 16px;
	opacity: 0.3;
	stroke: #bbb;
}

/* Slide popup — square image */
.pgc-popup-slide .pgc-popup-image img {
	aspect-ratio: 1 / 1;
	max-height: none;
	object-fit: cover;
}

/* Buttons */
.pgc-popup-buttons {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 20px;
}

.pgc-popup-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 28px;
	border-radius: 10px;
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.2s ease;
	border: 2px solid transparent;
	line-height: 1.3;
	text-align: center;
}

a.pgc-popup-btn-primary,
a.pgc-popup-btn-primary:link,
a.pgc-popup-btn-primary:visited {
	background: var(--pgc-accent);
	color: #fff;
	border-color: var(--pgc-accent);
}

a.pgc-popup-btn-primary:hover {
	background: #0e3a2a;
	border-color: #0e3a2a;
	color: #fff;
	text-decoration: none;
}

a.pgc-popup-btn-secondary,
a.pgc-popup-btn-secondary:link,
a.pgc-popup-btn-secondary:visited {
	background: transparent;
	color: var(--pgc-accent);
	border-color: var(--pgc-accent);
}

a.pgc-popup-btn-secondary:hover {
	background: var(--pgc-accent);
	color: #fff;
	text-decoration: none;
}

/* Body scroll lock */
body.pgc-popup-open {
	overflow: hidden;
}

/* Responsive */
@media (max-width: 600px) {
	.pgc-popup {
		width: 94%;
		border-radius: 14px;
		max-height: 88vh;
	}

	.pgc-popup-close {
		width: 38px;
		height: 38px;
		border-radius: 0 14px 0 12px;
	}

	.pgc-popup-content {
		padding: 20px 4% 40px 4%;
	}

	.pgc-popup-title {
		font-size: 18px;
		margin-bottom: 14px;
	}

	.pgc-popup-description {
		font-size: 14px;
		line-height: 1.65;
	}

	.pgc-popup-date-badge,
	.pgc-popup-time-badge,
	.pgc-popup-venue-badge {
		font-size: 12px;
		padding: 6px 12px;
	}

	.pgc-popup-badges {
		left: 18px;
	}
}
