/**
 * PERTACAMI Event Gallery — Frontend Styles
 *
 * Dark, aggressive, combat-sport aesthetic matching PERTACAMI brand.
 * Uses the theme's CSS custom properties for brand consistency.
 */

/* ============================================
   CSS Custom Properties (Fallbacks)
   ============================================ */
:root {
	--ptg-bg-dark: #0a0a0a;
	--ptg-bg-card: #141414;
	--ptg-red-primary: rgba(201, 20, 20, 1);
	--ptg-red-dark: rgba(158, 17, 17, 1);
	--ptg-blue-accent: rgba(14, 115, 178, 1);
	--ptg-white: #ffffff;
	--ptg-white-50: rgba(255, 255, 255, 0.5);
	--ptg-white-70: rgba(255, 255, 255, 0.7);
	--ptg-white-90: rgba(255, 255, 255, 0.9);
	--ptg-font-heading: "Oswald", "Open Sans", sans-serif;
	--ptg-font-body: "Open Sans", sans-serif;
	--ptg-transition: 0.3s ease;
	--ptg-radius: 0px; /* Sharp corners for MMA aesthetic */
}

/* ============================================
   Page Header
   ============================================ */
.ptg-page-header {
	text-align: center;
	margin-bottom: 40px;
}

.ptg-page-title {
	font-family: var(--ptg-font-heading);
	font-size: 60px;
	font-weight: 800;
	color: var(--ptg-white);
	margin: 0 0 8px;
	letter-spacing: 3px;
	text-transform: uppercase;
}

.ptg-page-subtitle {
	font-family: var(--ptg-font-heading);
	font-size: 20px;
	font-weight: 400;
	color: var(--ptg-white-50);
	margin: 0 0 12px;
}

.ptg-dots {
	color: var(--ptg-white-50);
	font-size: 16px;
	letter-spacing: 6px;
}

/* ============================================
   Filter Pills
   ============================================ */
.ptg-filter-bar {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding: 0 0 16px;
	margin-bottom: 30px;
}

.ptg-filter-bar::-webkit-scrollbar {
	display: none;
}

.ptg-filter-pill {
	flex-shrink: 0;
	padding: 10px 22px;
	background: rgba(255, 255, 255, 0.08);
	color: var(--ptg-white-70);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: var(--ptg-radius);
	font-family: var(--ptg-font-heading);
	font-size: 14px;
	font-weight: 500;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	cursor: pointer;
	transition: all var(--ptg-transition);
	white-space: nowrap;
}

.ptg-filter-pill:hover {
	background: rgba(255, 255, 255, 0.15);
	color: var(--ptg-white);
	border-color: rgba(255, 255, 255, 0.25);
}

.ptg-filter-pill.active {
	background: var(--ptg-red-primary);
	color: var(--ptg-white);
	border-color: var(--ptg-red-primary);
	font-weight: 700;
	box-shadow: 0 4px 15px rgba(201, 20, 20, 0.4);
}

/* ============================================
   Masonry Grid
   ============================================ */
.ptg-masonry {
	column-count: var(--ptg-columns, 3);
	column-gap: 12px;
}

.ptg-item,
.ptg-separator {
	break-inside: avoid;
	margin-bottom: 12px;
}

/* ============================================
   Event Separator
   ============================================ */
.ptg-separator {
	column-span: all;
	display: flex;
	flex-direction: column;
	align-items: center;
	padding: 24px 0 12px;
	position: relative;
}

.ptg-separator::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 0;
	right: 0;
	height: 1px;
	background: linear-gradient(
		to right,
		transparent,
		rgba(201, 20, 20, 0.4) 20%,
		rgba(201, 20, 20, 0.4) 80%,
		transparent
	);
}

.ptg-separator__text {
	position: relative;
	z-index: 1;
	background: var(--ptg-bg-dark, #0a0a0a);
	padding: 6px 24px;
	font-family: var(--ptg-font-heading);
	font-size: 18px;
	font-weight: 700;
	color: var(--ptg-white-90);
	text-transform: uppercase;
	letter-spacing: 1.5px;
	border: 1px solid rgba(201, 20, 20, 0.3);
}

.ptg-separator__meta {
	position: relative;
	z-index: 1;
	font-family: var(--ptg-font-body);
	font-size: 12px;
	color: var(--ptg-white-50);
	margin-top: 6px;
	letter-spacing: 0.5px;
}

/* ============================================
   Gallery Item
   ============================================ */
.ptg-item {
	position: relative;
	overflow: hidden;
	border-radius: var(--ptg-radius);
	background: var(--ptg-bg-card);
}

.ptg-item a {
	display: block;
	position: relative;
	text-decoration: none;
	line-height: 0;
}

.ptg-item img {
	width: 100%;
	height: auto;
	display: block;
	transition: transform 0.5s ease, filter 0.4s ease;
}

.ptg-item:hover img {
	transform: scale(1.06);
	filter: brightness(0.7);
}

/* Image Overlay */
.ptg-item__overlay {
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	padding: 40px 14px 14px;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.85) 0%,
		rgba(0, 0, 0, 0) 100%
	);
	opacity: 0;
	transition: opacity var(--ptg-transition);
	display: flex;
	align-items: flex-end;
}

.ptg-item:hover .ptg-item__overlay {
	opacity: 1;
}

.ptg-item__caption {
	font-family: var(--ptg-font-body);
	font-size: 13px;
	color: var(--ptg-white-90);
	line-height: 1.4;
	overflow: hidden;
	text-overflow: ellipsis;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}

/* Video Play Icon */
.ptg-item__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 64px;
	height: 64px;
	background: rgba(201, 20, 20, 0.85);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--ptg-transition);
	z-index: 2;
}

.ptg-item__play svg {
	width: 28px;
	height: 28px;
	margin-left: 3px;
}

.ptg-item:hover .ptg-item__play {
	background: var(--ptg-red-primary);
	transform: translate(-50%, -50%) scale(1.1);
	box-shadow: 0 0 30px rgba(201, 20, 20, 0.5);
}

/* ============================================
   Carousel
   ============================================ */
.ptg-carousel-section {
	margin: 40px 0;
}

.ptg-carousel-title {
	font-family: var(--ptg-font-heading);
	font-size: 28px;
	font-weight: 700;
	color: var(--ptg-white);
	text-transform: uppercase;
	letter-spacing: 1px;
	margin-bottom: 16px;
	padding-left: 16px;
	border-left: 4px solid var(--ptg-red-primary);
}

.ptg-carousel {
	position: relative;
	overflow: hidden;
	border-radius: var(--ptg-radius);
}

.ptg-carousel__track {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	scroll-behavior: smooth;
}

.ptg-carousel__track::-webkit-scrollbar {
	display: none;
}

.ptg-carousel__slide {
	flex-shrink: 0;
	scroll-snap-align: start;
	height: var(--ptg-carousel-height, 400px);
	overflow: hidden;
}

.ptg-carousel__slide a {
	display: block;
	height: 100%;
	text-decoration: none;
}

.ptg-carousel__slide img {
	height: 100%;
	width: auto;
	max-width: none;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease;
}

.ptg-carousel__slide:hover img {
	transform: scale(1.04);
}

/* Carousel Nav Buttons */
.ptg-carousel__btn {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	background: rgba(0, 0, 0, 0.6);
	border: 1px solid rgba(255, 255, 255, 0.15);
	border-radius: var(--ptg-radius);
	color: var(--ptg-white);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--ptg-transition);
	z-index: 5;
	opacity: 0;
	padding: 0;
}

.ptg-carousel:hover .ptg-carousel__btn {
	opacity: 1;
}

.ptg-carousel__btn:hover {
	background: var(--ptg-red-primary);
	border-color: var(--ptg-red-primary);
}

.ptg-carousel__btn svg {
	width: 20px;
	height: 20px;
}

.ptg-carousel__btn--prev {
	left: 12px;
}

.ptg-carousel__btn--next {
	right: 12px;
}

/* ============================================
   Video Grid
   ============================================ */
.ptg-video-grid {
	display: grid;
	grid-template-columns: repeat(var(--ptg-video-columns, 2), 1fr);
	gap: 16px;
	margin: 30px 0;
}

.ptg-video-card {
	position: relative;
	overflow: hidden;
	border-radius: var(--ptg-radius);
	background: var(--ptg-bg-card);
	transition: transform var(--ptg-transition), box-shadow var(--ptg-transition);
}

.ptg-video-card:hover {
	transform: translateY(-4px);
	box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.ptg-video-card a {
	display: block;
	text-decoration: none;
	color: inherit;
}

.ptg-video-card__thumb {
	position: relative;
	padding-top: 56.25%; /* 16:9 */
	overflow: hidden;
}

.ptg-video-card__thumb img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.ptg-video-card:hover .ptg-video-card__thumb img {
	transform: scale(1.06);
}

.ptg-video-card__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 72px;
	height: 72px;
	background: rgba(201, 20, 20, 0.85);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all var(--ptg-transition);
	z-index: 2;
}

.ptg-video-card__play svg {
	width: 32px;
	height: 32px;
	margin-left: 4px;
}

.ptg-video-card:hover .ptg-video-card__play {
	background: var(--ptg-red-primary);
	transform: translate(-50%, -50%) scale(1.1);
	box-shadow: 0 0 40px rgba(201, 20, 20, 0.5);
}

.ptg-video-card__info {
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ptg-video-card__caption {
	font-family: var(--ptg-font-heading);
	font-size: 15px;
	font-weight: 600;
	color: var(--ptg-white-90);
	text-transform: uppercase;
	letter-spacing: 0.3px;
}

.ptg-video-card__event {
	font-family: var(--ptg-font-body);
	font-size: 12px;
	color: var(--ptg-white-50);
}

/* ============================================
   No Events Fallback
   ============================================ */
.ptg-no-events {
	text-align: center;
	padding: 60px 20px;
}

.ptg-no-events p {
	font-family: var(--ptg-font-heading);
	font-size: 18px;
	color: var(--ptg-white-50);
}

/* ============================================
   Error Message
   ============================================ */
.ptg-error {
	color: var(--ptg-red-primary);
	font-family: var(--ptg-font-body);
	font-size: 14px;
	font-style: italic;
}

/* ============================================
   FancyBox Overrides (Dark theme)
   ============================================ */
.fancybox__container {
	--fancybox-bg: rgba(0, 0, 0, 0.92);
}

.fancybox__toolbar {
	background: transparent;
}

.fancybox__caption {
	font-family: var(--ptg-font-body);
	font-size: 14px;
	color: var(--ptg-white-90);
	padding: 12px 24px;
	text-align: center;
}

.fancybox__nav .f-button {
	background: rgba(201, 20, 20, 0.6);
	border-radius: 0;
	transition: background 0.2s;
}

.fancybox__nav .f-button:hover {
	background: var(--ptg-red-primary);
}

/* ============================================
   Animations
   ============================================ */
@keyframes ptg-fadeIn {
	from {
		opacity: 0;
		transform: translateY(10px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

.ptg-item {
	animation: ptg-fadeIn 0.5s ease both;
}

.ptg-item:nth-child(2) { animation-delay: 0.05s; }
.ptg-item:nth-child(3) { animation-delay: 0.1s; }
.ptg-item:nth-child(4) { animation-delay: 0.15s; }
.ptg-item:nth-child(5) { animation-delay: 0.2s; }
.ptg-item:nth-child(6) { animation-delay: 0.25s; }
.ptg-item:nth-child(7) { animation-delay: 0.3s; }
.ptg-item:nth-child(8) { animation-delay: 0.35s; }
.ptg-item:nth-child(9) { animation-delay: 0.4s; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1024px) {
	.ptg-masonry {
		column-count: 2;
	}

	.ptg-carousel__slide {
		height: calc(var(--ptg-carousel-height, 400px) * 0.75);
	}
}

@media (max-width: 767px) {
	.ptg-page-title {
		font-size: 40px;
	}

	.ptg-page-subtitle {
		font-size: 16px;
	}

	.ptg-masonry {
		column-count: 1;
	}

	.ptg-filter-pill {
		padding: 8px 16px;
		font-size: 12px;
	}

	.ptg-separator__text {
		font-size: 14px;
		padding: 4px 16px;
	}

	.ptg-carousel__slide {
		height: calc(var(--ptg-carousel-height, 400px) * 0.5);
	}

	.ptg-carousel__btn {
		width: 36px;
		height: 36px;
	}

	.ptg-video-grid {
		grid-template-columns: 1fr;
	}

	.ptg-item__play {
		width: 48px;
		height: 48px;
	}

	.ptg-item__play svg {
		width: 22px;
		height: 22px;
	}
}

@media (max-width: 575px) {
	.ptg-page-title {
		font-size: 32px;
		letter-spacing: 2px;
	}

	.ptg-filter-bar {
		margin-bottom: 20px;
	}

	.ptg-carousel-title {
		font-size: 20px;
	}
}
