/* PP Wiki Data — Frontend Styles */

/* ============================================================
 * Shared section styles
 * ============================================================ */

.pp-wiki-section {
	margin: 0 0 8px;
	max-width: 100%;
}

.pp-wiki-heading {
	font-size: 1.5em;
	font-weight: 700;
	margin: 0 0 16px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e5e7eb;
}

.pp-wiki-attribution {
	margin-top: 12px;
	font-size: 0.75em;
	color: #9ca3af;
}

.pp-wiki-attribution a {
	color: #6b7280;
	text-decoration: underline;
}

/* Hidden items (View More toggle) */
.pp-wiki-hidden {
	display: none !important;
}

/* View More button */
.pp-wiki-view-more {
	display: inline-block;
	margin-top: 12px;
	padding: 8px 20px;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	color: #374151;
	font-size: 0.875em;
	font-weight: 500;
	cursor: pointer;
	transition: background 0.2s, border-color 0.2s;
}

.pp-wiki-view-more:hover {
	background: #e5e7eb;
	border-color: #9ca3af;
}

/* ============================================================
 * Placeholder image (no photo uploaded)
 * ============================================================ */

.pp-wiki-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f3f4f6;
	border-radius: 8px;
	width: 100%;
	aspect-ratio: 2/3;
	max-height: 220px;
}

.pp-wiki-placeholder svg {
	width: 40%;
	max-width: 50px;
	opacity: 0.5;
}

/* ============================================================
 * Cast grid (actors with roles)
 * ============================================================ */

.pp-wiki-cast-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.pp-wiki-cast-card {
	text-align: center;
}

.pp-wiki-cast-card img.pp-wiki-cast-img,
.pp-wiki-cast-card .pp-wiki-placeholder.pp-wiki-cast-img {
	width: 100%;
	aspect-ratio: 2/3;
	object-fit: cover;
	border-radius: 8px;
}

.pp-wiki-cast-name {
	margin-top: 8px;
	font-weight: 600;
	font-size: 0.9em;
	line-height: 1.3;
}

.pp-wiki-cast-roles {
	margin-top: 3px;
	font-size: 0.8em;
	color: #6b7280;
	line-height: 1.35;
}

/* ============================================================
 * Characters grid
 * ============================================================ */

.pp-wiki-char-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 16px;
}

.pp-wiki-char-card {
	text-align: center;
}

.pp-wiki-char-card img.pp-wiki-char-img,
.pp-wiki-char-card .pp-wiki-placeholder.pp-wiki-char-img {
	width: 100%;
	aspect-ratio: 2/3;
	object-fit: cover;
	border-radius: 8px;
}

.pp-wiki-char-name {
	margin-top: 8px;
	font-weight: 600;
	font-size: 0.9em;
	line-height: 1.3;
}

.pp-wiki-char-actor {
	margin-top: 2px;
	font-size: 0.78em;
	color: #6b7280;
	font-style: italic;
}

/* ============================================================
 * Crew section
 * ============================================================ */

.pp-wiki-crew-dept {
	margin-bottom: 16px;
}

.pp-wiki-crew-dept-title {
	font-size: 1.1em;
	font-weight: 600;
	margin: 0 0 8px;
	color: #374151;
}

.pp-wiki-crew-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.pp-wiki-crew-member {
	display: flex;
	justify-content: space-between;
	padding: 6px 0;
	border-bottom: 1px solid #f3f4f6;
	font-size: 0.9em;
}

.pp-wiki-crew-name {
	font-weight: 500;
}

.pp-wiki-crew-job {
	color: #6b7280;
}

.pp-wiki-view-more-dept {
	font-size: 0.8em;
	padding: 5px 14px;
	margin-top: 6px;
}

/* ============================================================
 * Media section — tabs
 * ============================================================ */

.pp-wiki-media-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 16px;
	border-bottom: 2px solid #e5e7eb;
	padding-bottom: 0;
}

.pp-wiki-media-tab {
	padding: 8px 16px;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	font-size: 0.9em;
	font-weight: 500;
	color: #6b7280;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s;
}

.pp-wiki-media-tab:hover {
	color: #111827;
}

.pp-wiki-media-tab.active {
	color: #111827;
	border-bottom-color: #2563eb;
	font-weight: 600;
}

.pp-wiki-media-count {
	display: inline-block;
	margin-left: 4px;
	padding: 1px 6px;
	background: #e5e7eb;
	border-radius: 10px;
	font-size: 0.8em;
	color: #374151;
}

.pp-wiki-media-tab.active .pp-wiki-media-count {
	background: #dbeafe;
	color: #1d4ed8;
}

/* Media panels */
.pp-wiki-media-panel {
	display: none;
}

.pp-wiki-media-panel.active {
	display: block;
}

/* ============================================================
 * Video gallery
 * ============================================================ */

.pp-wiki-video-scroll {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
}

.pp-wiki-video-card {
	cursor: pointer;
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.2s, box-shadow 0.2s;
}

.pp-wiki-video-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.pp-wiki-video-thumb {
	position: relative;
	aspect-ratio: 16/9;
	overflow: hidden;
	background: #000;
}

.pp-wiki-video-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.pp-wiki-play-btn {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	opacity: 0.85;
	transition: opacity 0.2s, transform 0.2s;
}

.pp-wiki-video-card:hover .pp-wiki-play-btn {
	opacity: 1;
	transform: translate(-50%, -50%) scale(1.1);
}

.pp-wiki-video-title {
	padding: 8px 10px 2px;
	font-weight: 500;
	font-size: 0.85em;
	line-height: 1.3;
}

.pp-wiki-video-type {
	padding: 0 10px 8px;
	font-size: 0.75em;
	color: #6b7280;
}

/* Video inline embed */
.pp-wiki-video-embed {
	margin-top: 16px;
	border-radius: 8px;
	overflow: hidden;
	background: #000;
}

.pp-wiki-video-embed-inner {
	position: relative;
	padding-bottom: 56.25%; /* 16:9 */
	height: 0;
}

.pp-wiki-video-embed-inner iframe {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	border: none;
}

.pp-wiki-video-close {
	display: block;
	width: 100%;
	padding: 8px;
	background: #1f2937;
	color: #fff;
	border: none;
	font-size: 0.85em;
	cursor: pointer;
	text-align: center;
}

.pp-wiki-video-close:hover {
	background: #374151;
}

/* ============================================================
 * Image gallery (backdrops, posters, stills)
 * ============================================================ */

.pp-wiki-image-scroll {
	display: grid;
	gap: 12px;
}

.pp-wiki-image-landscape {
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.pp-wiki-image-portrait {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}

.pp-wiki-gallery-item {
	border-radius: 8px;
	overflow: hidden;
	cursor: pointer;
	transition: transform 0.2s, box-shadow 0.2s;
}

.pp-wiki-gallery-item:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.pp-wiki-gallery-item img {
	width: 100%;
	display: block;
	border-radius: 8px;
}

/* ============================================================
 * Lightbox
 * ============================================================ */

.pp-wiki-lightbox {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 99999;
}

.pp-wiki-lightbox-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.85);
}

.pp-wiki-lightbox-content {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 40px;
	box-sizing: border-box;
}

.pp-wiki-lightbox-content img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	border-radius: 4px;
}

.pp-wiki-lightbox-close,
.pp-wiki-lightbox-prev,
.pp-wiki-lightbox-next {
	position: absolute;
	background: rgba(255, 255, 255, 0.15);
	color: #fff;
	border: none;
	font-size: 2em;
	cursor: pointer;
	padding: 8px 16px;
	border-radius: 6px;
	line-height: 1;
	transition: background 0.2s;
}

.pp-wiki-lightbox-close:hover,
.pp-wiki-lightbox-prev:hover,
.pp-wiki-lightbox-next:hover {
	background: rgba(255, 255, 255, 0.3);
}

.pp-wiki-lightbox-close {
	top: 16px;
	right: 16px;
	font-size: 1.5em;
}

.pp-wiki-lightbox-prev {
	left: 16px;
	top: 50%;
	transform: translateY(-50%);
}

.pp-wiki-lightbox-next {
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
}

/* ============================================================
 * External links
 * ============================================================ */

.pp-wiki-links-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.pp-wiki-link-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 8px 14px;
	background: #f3f4f6;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	color: #374151;
	text-decoration: none;
	font-size: 0.85em;
	font-weight: 500;
	transition: background 0.2s, border-color 0.2s, color 0.2s;
}

.pp-wiki-link-btn:hover {
	background: #e5e7eb;
	border-color: #9ca3af;
	color: #111827;
	text-decoration: none;
}

.pp-wiki-link-icon {
	display: inline-flex;
	flex-shrink: 0;
	width: 18px;
	height: 18px;
	overflow: hidden;
}

.pp-wiki-link-icon svg {
	width: 18px !important;
	height: 18px !important;
	max-width: 18px !important;
	max-height: 18px !important;
	flex-shrink: 0;
}

/* Specific link colors on hover */
.pp-wiki-link-imdb:hover { border-color: #f5c518; color: #000; }
.pp-wiki-link-facebook:hover { border-color: #1877f2; color: #1877f2; }
.pp-wiki-link-instagram:hover { border-color: #e4405f; color: #e4405f; }
.pp-wiki-link-twitter:hover { border-color: #000; color: #000; }
.pp-wiki-link-official:hover { border-color: #2563eb; color: #2563eb; }

/* Mobile-only view-more button (hidden — slider handles disclosure) */
.pp-wiki-view-more-mob {
	display: none;
}

/* ============================================================
 * Responsive — horizontal scroll sliders (TMDB-style)
 * ============================================================ */

@media (max-width: 768px) {
	/* Section padding */
	.pp-wiki-section {
		padding: 0 12px;
	}

	/* ---------- Cast: horizontal scroll carousel ---------- */
	.pp-wiki-cast-grid {
		display: flex !important;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 12px;
		padding-bottom: 4px;
	}
	.pp-wiki-cast-grid::-webkit-scrollbar { display: none; }

	.pp-wiki-cast-card {
		flex: 0 0 42%;
		scroll-snap-align: start;
		background: #f9fafb;
		border: 1px solid #e5e7eb;
		border-radius: 12px;
		overflow: hidden;
		padding-bottom: 10px;
	}

	.pp-wiki-cast-card img.pp-wiki-cast-img,
	.pp-wiki-cast-card .pp-wiki-placeholder.pp-wiki-cast-img {
		border-radius: 0;
		aspect-ratio: 2/3;
	}

	.pp-wiki-cast-name {
		text-align: left;
		padding: 0 10px;
		font-size: 0.85em;
	}

	.pp-wiki-cast-roles {
		text-align: left;
		padding: 0 10px;
		font-size: 0.75em;
	}

	/* ---------- Characters: horizontal scroll carousel ---------- */
	.pp-wiki-char-grid {
		display: flex !important;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 12px;
		padding-bottom: 4px;
	}
	.pp-wiki-char-grid::-webkit-scrollbar { display: none; }

	.pp-wiki-char-card {
		flex: 0 0 42%;
		scroll-snap-align: start;
		background: #f9fafb;
		border: 1px solid #e5e7eb;
		border-radius: 12px;
		overflow: hidden;
		padding-bottom: 10px;
	}

	.pp-wiki-char-card img.pp-wiki-char-img,
	.pp-wiki-char-card .pp-wiki-placeholder.pp-wiki-char-img {
		border-radius: 0;
		aspect-ratio: 2/3;
	}

	.pp-wiki-char-name {
		text-align: left;
		padding: 0 10px;
		font-size: 0.85em;
	}

	.pp-wiki-char-actor {
		text-align: left;
		padding: 0 10px;
		font-size: 0.75em;
	}

	/* ---------- Videos: horizontal scroll ---------- */
	.pp-wiki-video-scroll {
		display: flex !important;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 12px;
	}
	.pp-wiki-video-scroll::-webkit-scrollbar { display: none; }

	.pp-wiki-video-card {
		flex: 0 0 75%;
		scroll-snap-align: start;
	}

	/* ---------- Images: horizontal scroll ---------- */
	.pp-wiki-image-scroll {
		display: flex !important;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		gap: 8px;
	}
	.pp-wiki-image-scroll::-webkit-scrollbar { display: none; }

	.pp-wiki-image-landscape .pp-wiki-gallery-item {
		flex: 0 0 80%;
		scroll-snap-align: start;
	}

	.pp-wiki-image-portrait .pp-wiki-gallery-item {
		flex: 0 0 32%;
		scroll-snap-align: start;
	}

	/* ---------- Crew: card-like containers (no scroll) ---------- */
	.pp-wiki-crew-dept {
		background: #f9fafb;
		border: 1px solid #e5e7eb;
		border-radius: 12px;
		padding: 16px;
		margin-bottom: 12px;
	}

	.pp-wiki-crew-dept-title {
		margin-top: 0;
	}

	.pp-wiki-crew-member {
		font-size: 0.82em;
	}

	/* ---------- General mobile adjustments ---------- */
	.pp-wiki-placeholder {
		max-height: 200px;
	}

	.pp-wiki-media-tabs {
		flex-wrap: wrap;
	}

	.pp-wiki-media-tab {
		padding: 6px 10px;
		font-size: 0.8em;
	}

	.pp-wiki-lightbox-content {
		padding: 16px;
	}

	.pp-wiki-lightbox-prev,
	.pp-wiki-lightbox-next {
		font-size: 1.4em;
		padding: 6px 10px;
	}

	/* Un-hide all items inside scroll containers so slider shows everything */
	.pp-wiki-cast-grid > .pp-wiki-hidden,
	.pp-wiki-cast-grid > .pp-wiki-mob-hidden,
	.pp-wiki-char-grid > .pp-wiki-hidden,
	.pp-wiki-char-grid > .pp-wiki-mob-hidden,
	.pp-wiki-video-scroll > .pp-wiki-hidden,
	.pp-wiki-video-scroll > .pp-wiki-mob-hidden,
	.pp-wiki-image-scroll > .pp-wiki-hidden,
	.pp-wiki-image-scroll > .pp-wiki-mob-hidden {
		display: block !important;
	}

	/* Hide the desktop "View More" button on mobile — slider handles it */
	.pp-wiki-view-more {
		display: none !important;
	}
}

@media (max-width: 480px) {
	.pp-wiki-cast-card,
	.pp-wiki-char-card {
		flex: 0 0 44%;
	}

	.pp-wiki-cast-name,
	.pp-wiki-char-name {
		font-size: 0.78em;
	}

	.pp-wiki-cast-roles,
	.pp-wiki-char-actor {
		font-size: 0.7em;
	}

	.pp-wiki-video-card {
		flex: 0 0 85%;
	}

	.pp-wiki-heading {
		font-size: 1.25em;
	}

	.pp-wiki-links-row {
		gap: 6px;
	}

	.pp-wiki-link-btn {
		padding: 6px 10px;
		font-size: 0.8em;
	}
}

/* ============================================================
 * User submission form
 * ============================================================ */

/* Collapsed teaser */
.pp-wiki-submit-teaser {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.pp-wiki-submit-teaser-text {
	font-size: 0.9em;
	color: #6b7280;
}

.pp-wiki-submit-toggle {
	display: inline-block;
	padding: 8px 20px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.85em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
	white-space: nowrap;
}

.pp-wiki-submit-toggle:hover {
	background: #1d4ed8;
}

.pp-wiki-submit-intro {
	font-size: 0.9em;
	color: #6b7280;
	margin-bottom: 16px;
}

/* Submission tabs */
.pp-wiki-submit-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 2px solid #e5e7eb;
	padding-bottom: 0;
}

.pp-wiki-submit-tab {
	padding: 8px 16px;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	margin-bottom: -2px;
	font-size: 0.9em;
	font-weight: 500;
	color: #6b7280;
	cursor: pointer;
	transition: color 0.2s, border-color 0.2s;
}

.pp-wiki-submit-tab:hover {
	color: #111827;
}

.pp-wiki-submit-tab.active {
	color: #111827;
	border-bottom-color: #2563eb;
	font-weight: 600;
}

/* Panels */
.pp-wiki-submit-panel {
	display: none;
}

.pp-wiki-submit-panel.active {
	display: block;
}

/* Fields */
.pp-wiki-submit-form {
	position: relative;
}

.pp-wiki-field {
	margin-bottom: 14px;
}

.pp-wiki-field label {
	display: block;
	font-size: 0.85em;
	font-weight: 600;
	color: #374151;
	margin-bottom: 4px;
}

.pp-wiki-field input[type="text"],
.pp-wiki-field input[type="url"],
.pp-wiki-field input[type="email"],
.pp-wiki-field select,
.pp-wiki-field textarea {
	width: 100%;
	max-width: 500px;
	padding: 8px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 0.9em;
	font-family: inherit;
	background: #fff;
	transition: border-color 0.2s;
	box-sizing: border-box;
}

.pp-wiki-field input:focus,
.pp-wiki-field select:focus,
.pp-wiki-field textarea:focus {
	outline: none;
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.pp-wiki-field input[type="file"] {
	font-size: 0.85em;
	padding: 6px 0;
}

.pp-wiki-field textarea {
	resize: vertical;
	min-height: 50px;
}

/* Shared fields separator */
.pp-wiki-submit-shared {
	margin-top: 20px;
	padding-top: 16px;
	border-top: 1px solid #e5e7eb;
}

/* Submit button */
.pp-wiki-submit-btn {
	display: inline-block;
	margin-top: 8px;
	padding: 10px 24px;
	background: #2563eb;
	color: #fff;
	border: none;
	border-radius: 6px;
	font-size: 0.9em;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.pp-wiki-submit-btn:hover {
	background: #1d4ed8;
}

.pp-wiki-submit-btn:disabled {
	background: #93c5fd;
	cursor: not-allowed;
}

/* Messages */
.pp-wiki-submit-message {
	margin-top: 12px;
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 0.875em;
}

.pp-wiki-msg-success {
	background: #d1fae5;
	color: #065f46;
	border: 1px solid #a7f3d0;
}

.pp-wiki-msg-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

/* Responsive submission form */
@media (max-width: 768px) {
	.pp-wiki-submit-tabs {
		flex-wrap: wrap;
	}

	.pp-wiki-submit-tab {
		padding: 6px 12px;
		font-size: 0.8em;
	}

	.pp-wiki-field input[type="text"],
	.pp-wiki-field input[type="url"],
	.pp-wiki-field input[type="email"],
	.pp-wiki-field select,
	.pp-wiki-field textarea {
		max-width: 100%;
	}
}
