/**
 * Pinstripes X Comic Feed - Frontend Styles
 * Responsive Grid, Modern Cards, and Vanilla Touch Slider
 */

:root {
	--pxcf-cols: 1;
	--pxcf-gap: 20px;
	--pxcf-radius: 8px;
	--pxcf-border-color: #e2e8f0;
	--pxcf-text-color: #1e293b;
	--pxcf-meta-color: #64748b;
	--pxcf-brand-x: #0f1419;
}

.pxcf-feed-container {
	width: 100%;
	box-sizing: border-box;
	margin: 20px 0;
}

.pxcf-feed-container *,
.pxcf-feed-container *::before,
.pxcf-feed-container *::after {
	box-sizing: border-box;
}

/* Empty state */
.pxcf-empty {
	text-align: center;
	padding: 24px;
	background: #f8fafc;
	border: 1px dashed var(--pxcf-border-color);
	border-radius: var(--pxcf-radius);
	color: var(--pxcf-meta-color);
	font-size: 14px;
}

/* ==========================================================================
   Card Styling
   ========================================================================== */
.pxcf-card {
	background: #ffffff;
	border: 1px solid var(--pxcf-border-color);
	border-radius: var(--pxcf-radius);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	height: 100%;
}

.pxcf-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.08), 0 4px 6px -2px rgba(0, 0, 0, 0.04);
}

.pxcf-image-wrapper {
	position: relative;
	width: 100%;
	background: #0f172a;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pxcf-image-link {
	display: block;
	width: 100%;
	height: 100%;
	text-decoration: none;
	position: relative;
	line-height: 0;
}

/* Uncropped Comic Artwork */
.pxcf-comic-img {
	width: 100%;
	height: auto;
	max-height: 750px;
	object-fit: contain;
	display: block;
	transition: opacity 0.2s ease;
}

.pxcf-image-link:hover .pxcf-comic-img {
	opacity: 0.95;
}

/* X Logo Badge */
.pxcf-x-badge {
	position: absolute;
	top: 10px;
	right: 10px;
	width: 28px;
	height: 28px;
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(4px);
	color: #ffffff;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.2s ease, transform 0.2s ease;
	z-index: 2;
}

.pxcf-image-link:hover .pxcf-x-badge {
	background: var(--pxcf-brand-x);
	transform: scale(1.1);
}

/* Meta & Caption */
.pxcf-card-meta {
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	flex-grow: 1;
}

.pxcf-date {
	font-size: 12px;
	color: var(--pxcf-meta-color);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.pxcf-caption {
	font-size: 14px;
	line-height: 1.5;
	color: var(--pxcf-text-color);
	word-break: break-word;
}

.pxcf-caption a {
	color: #0284c7;
	text-decoration: none;
}

.pxcf-caption a:hover {
	text-decoration: underline;
}

/* ==========================================================================
   Single Layout
   ========================================================================== */
.pxcf-layout-single .pxcf-card {
	max-width: 100%;
	margin: 0 auto;
}

/* ==========================================================================
   CSS Grid Layout
   ========================================================================== */
.pxcf-grid-track {
	display: grid;
	grid-template-columns: repeat(var(--pxcf-cols, 1), minmax(0, 1fr));
	gap: var(--pxcf-gap);
}

@media (max-width: 992px) {
	.pxcf-grid-track {
		grid-template-columns: repeat(min(2, var(--pxcf-cols, 1)), minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.pxcf-grid-track {
		grid-template-columns: 1fr;
	}
}

/* ==========================================================================
   Slider / Carousel Layout
   ========================================================================== */
.pxcf-slider-wrapper {
	position: relative;
	overflow: hidden;
	width: 100%;
	padding: 6px 0;
}

.pxcf-slider-track {
	display: flex;
	transition: transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
	will-change: transform;
	width: 100%;
}

.pxcf-slide {
	flex-shrink: 0;
	box-sizing: border-box;
	padding: 0 calc(var(--pxcf-gap) / 2);
}

/* Slider Nav Arrows (Modern Glassmorphic, Sleek, Compact & Proportional) */
.pxcf-slider-wrapper .pxcf-slider-btn {
	position: absolute !important;
	top: 45% !important;
	transform: translateY(-50%) !important;
	width: 30px !important;
	height: 30px !important;
	border-radius: 50% !important;
	background: rgba(15, 23, 42, 0.75) !important;
	backdrop-filter: blur(6px) !important;
	-webkit-backdrop-filter: blur(6px) !important;
	border: 1.5px solid rgba(255, 255, 255, 0.35) !important;
	box-shadow: 0 3px 10px rgba(0, 0, 0, 0.35) !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	z-index: 25 !important;
	color: #ffffff !important;
	padding: 0 !important;
	outline: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
	transition: opacity 0.25s ease, transform 0.2s ease, background-color 0.2s ease, visibility 0.25s ease, border-color 0.2s ease !important;
}

/* Reveal buttons on hover of slider */
.pxcf-slider-wrapper:hover .pxcf-slider-btn {
	opacity: 1 !important;
	visibility: visible !important;
	pointer-events: auto !important;
}

/* Hide slider buttons & dots if single post or all slides fit */
.pxcf-slider-btn.pxcf-hidden,
.pxcf-slider-btn[style*="display: none"],
.pxcf-slider-wrapper:has(.pxcf-slide:only-child) .pxcf-slider-btn,
.pxcf-slider-wrapper:has(.pxcf-slide:only-child) .pxcf-slider-dots {
	display: none !important;
	opacity: 0 !important;
	visibility: hidden !important;
	pointer-events: none !important;
}

/* Touch devices (keep always visible) */
@media (hover: none) {
	.pxcf-slider-wrapper .pxcf-slider-btn {
		opacity: 0.95 !important;
		visibility: visible !important;
		pointer-events: auto !important;
	}
}

.pxcf-slider-wrapper .pxcf-slider-btn:hover {
	background: rgba(15, 23, 42, 0.95) !important;
	border-color: #ffffff !important;
	transform: translateY(-50%) scale(1.1) !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45) !important;
}

.pxcf-slider-wrapper .pxcf-slider-btn:disabled {
	opacity: 0.25 !important;
	cursor: not-allowed !important;
	transform: translateY(-50%) scale(1) !important;
}

.pxcf-slider-wrapper .pxcf-slider-btn svg {
	width: 14px !important;
	height: 14px !important;
	stroke: #ffffff !important;
	stroke-width: 2.5px !important;
	fill: none !important;
	display: block !important;
	filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4)) !important;
}

.pxcf-slider-wrapper .pxcf-prev {
	left: 8px !important;
	right: auto !important;
}

.pxcf-slider-wrapper .pxcf-next {
	right: 8px !important;
	left: auto !important;
}

/* Slider Dots (Subtle & Elegant) */
.pxcf-slider-dots {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
}

.pxcf-dot {
	width: 6px;
	height: 6px;
	border-radius: 50%;
	background: #cbd5e1;
	border: none;
	cursor: pointer;
	padding: 0;
	transition: background-color 0.2s, transform 0.2s, width 0.2s;
}

.pxcf-dot:hover {
	background: #94a3b8;
}

.pxcf-dot.active {
	background: #0284c7;
	width: 8px;
	height: 8px;
	transform: scale(1.15);
}

/* ==========================================================================
   Follow on X Header / Bar
   ========================================================================== */
.pxcf-follow-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 14px;
	margin-bottom: 12px;
	background: #f8fafc;
	border: 1px solid var(--pxcf-border-color);
	border-radius: var(--pxcf-radius);
	box-sizing: border-box;
}

.pxcf-feed-container > .pxcf-follow-bar:last-child {
	margin-top: 14px;
	margin-bottom: 0;
}

.pxcf-follow-user {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pxcf-follow-logo {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: #0f1419;
	color: #ffffff;
	flex-shrink: 0;
}

.pxcf-follow-logo svg {
	width: 14px;
	height: 14px;
	fill: #ffffff;
}

.pxcf-follow-handle {
	font-weight: 700;
	font-size: 14px;
	color: #0f1419;
	text-decoration: none;
	transition: color 0.15s ease;
}

.pxcf-follow-handle:hover {
	color: #0284c7;
	text-decoration: underline;
}

.pxcf-follow-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 6px 14px;
	background: #0f1419;
	color: #ffffff !important;
	font-size: 13px;
	font-weight: 600;
	border-radius: 9999px;
	text-decoration: none !important;
	line-height: 1.2;
	transition: background-color 0.2s ease, transform 0.15s ease;
}

.pxcf-follow-btn:hover {
	background: #272c30;
	transform: scale(1.03);
	color: #ffffff !important;
	text-decoration: none !important;
}

/* ==========================================================================
   Zoom Badge on Comic Cards
   ========================================================================== */
.pxcf-zoom-badge {
	position: absolute;
	top: 10px;
	left: 10px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.75);
	backdrop-filter: blur(4px);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transform: scale(0.85);
	transition: opacity 0.2s ease, transform 0.2s ease, background-color 0.15s ease;
	z-index: 2;
	pointer-events: none;
}

.pxcf-image-wrapper:hover .pxcf-zoom-badge {
	opacity: 1;
	transform: scale(1);
}

/* Video Play Badge (Center on Comic Card) */
.pxcf-video-play-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 48px;
	height: 48px;
	border-radius: 50%;
	background: rgba(15, 23, 42, 0.82);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
	border: 2px solid rgba(255, 255, 255, 0.5);
	transition: transform 0.2s ease, background-color 0.2s ease;
	z-index: 5;
	pointer-events: none;
}

.pxcf-image-wrapper:hover .pxcf-video-play-badge {
	transform: translate(-50%, -50%) scale(1.15);
	background: #0284c7;
	border-color: #ffffff;
}

.pxcf-video-play-badge svg {
	width: 20px;
	height: 20px;
	margin-left: 2px;
	fill: #ffffff;
}

.pxcf-image-link:hover {
	cursor: pointer;
}

/* ==========================================================================
   1-Click Social Share Bar
   ========================================================================== */
.pxcf-share-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 10px;
	padding-top: 8px;
	border-top: 1px solid #f1f5f9;
}

.pxcf-share-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	color: #94a3b8;
	margin-right: 2px;
	letter-spacing: 0.5px;
}

.pxcf-share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid #e2e8f0;
	background: #ffffff;
	color: #475569;
	cursor: pointer;
	padding: 0;
	transition: all 0.15s ease;
	text-decoration: none !important;
}

.pxcf-share-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.pxcf-share-wa:hover {
	background: #25d366;
	border-color: #25d366;
	color: #ffffff;
}

.pxcf-share-x:hover {
	background: #0f1419;
	border-color: #0f1419;
	color: #ffffff;
}

.pxcf-share-copy:hover {
	background: #0284c7;
	border-color: #0284c7;
	color: #ffffff;
}

/* ==========================================================================
   Frontend Lightbox Modal (Zoom on Click)
   ========================================================================== */
.pxcf-lightbox-modal {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pxcf-lightbox-backdrop {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(15, 23, 42, 0.92);
	backdrop-filter: blur(8px);
}

.pxcf-lightbox-container {
	position: relative;
	max-width: 92vw;
	max-height: 90vh;
	display: flex;
	flex-direction: column;
	align-items: center;
	z-index: 10;
	animation: pxcfLightboxPop 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes pxcfLightboxPop {
	from {
		opacity: 0;
		transform: scale(0.92);
	}
	to {
		opacity: 1;
		transform: scale(1);
	}
}

.pxcf-lightbox-close {
	position: fixed !important;
	top: 20px !important;
	right: 24px !important;
	width: 38px !important;
	height: 38px !important;
	background: rgba(15, 23, 42, 0.85) !important;
	backdrop-filter: blur(8px) !important;
	-webkit-backdrop-filter: blur(8px) !important;
	color: #ffffff !important;
	border: 1.5px solid rgba(255, 255, 255, 0.25) !important;
	border-radius: 50% !important;
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	cursor: pointer !important;
	z-index: 1000000 !important;
	padding: 0 !important;
	outline: none !important;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4) !important;
	transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease !important;
}

.pxcf-lightbox-close:hover {
	background: rgba(239, 68, 68, 0.9) !important;
	border-color: #ef4444 !important;
	transform: scale(1.1) !important;
	box-shadow: 0 6px 18px rgba(239, 68, 68, 0.4) !important;
}

.pxcf-lightbox-close svg {
	width: 18px !important;
	height: 18px !important;
	stroke: #ffffff !important;
	stroke-width: 2.5px !important;
	display: block !important;
}

@media (max-width: 640px) {
	.pxcf-lightbox-close {
		top: 14px !important;
		right: 14px !important;
		width: 34px !important;
		height: 34px !important;
	}
	.pxcf-lightbox-close svg {
		width: 16px !important;
		height: 16px !important;
	}
}

.pxcf-lightbox-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	max-height: 85vh;
}

.pxcf-lightbox-img {
	max-width: 90vw;
	max-height: 75vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
}

.pxcf-lightbox-video {
	max-width: 90vw;
	max-height: 75vh;
	width: auto;
	height: auto;
	border-radius: 6px;
	box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6);
	background: #000000;
	outline: none;
}

.pxcf-lightbox-caption {
	margin-top: 12px;
	color: #f8fafc;
	font-size: 14px;
	line-height: 1.5;
	text-align: center;
	max-width: 700px;
	text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}

.pxcf-lightbox-x-link {
	margin-top: 6px;
	color: #38bdf8 !important;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none !important;
	transition: color 0.15s;
}

.pxcf-lightbox-x-link:hover {
	color: #7dd3fc !important;
	text-decoration: underline !important;
}
