/* Project Page Manager - Frontend Styles */

/* ---------------------------------------------------------------------------
 * Full-bleed layout (breaks out of the theme content container to full width)
 * Scoped to the plugin only so the theme header/nav is never affected.
 * ------------------------------------------------------------------------- */
.ppm-project-page {
	width: 100vw;
	max-width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding: 0;
	box-sizing: border-box;
}

.ppm-project-page * {
	box-sizing: border-box;
}

/* Hide the theme page-title / breadcrumb hero on project pages only.
 * (These selectors target page-title areas, never the site header/nav.) */
body.ppm-project-active .entry-header,
body.ppm-project-active .page-title,
body.ppm-project-active .page-header-title,
body.ppm-project-active .page-title-bar,
body.ppm-project-active .breadcrumb,
body.ppm-project-active .breadcrumbs,
body.ppm-project-active .elementor-page-title,
body.ppm-project-active .wp-block-post-title {
	display: none !important;
}

body.ppm-modal-open {
	overflow: hidden;
}

/* ---------------------------------------------------------------------------
 * Hero Slider
 * ------------------------------------------------------------------------- */
.ppm-hero-slider {
	position: relative;
	width: 100%;
	overflow: hidden;
	background: #fff;
	height: 180px;
	margin-bottom: 0;
}

.ppm-hero-slide {
	display: none;
	width: 100%;
	height: 100%;
}

.ppm-hero-slide.is-active {
	display: block;
}

.ppm-hero-slide-inner {
	display: grid;
	grid-template-columns: minmax(300px, 40%) 1fr;
	gap: 0;
	align-items: stretch;
	height: 100%;
}

.ppm-hero-text {
	padding: 20px 40px;
	background: #f5f5f5;
	display: flex;
	align-items: center;
	font-size: 14px;
	line-height: 1.6;
}

.ppm-hero-image {
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ppm-hero-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.ppm-hero-prev,
.ppm-hero-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.3s;
	z-index: 10;
}

.ppm-hero-prev:hover,
.ppm-hero-next:hover {
	background: rgba(0, 0, 0, 0.7);
}

.ppm-hero-prev { left: 10px; }
.ppm-hero-next { right: 10px; }

/* ---------------------------------------------------------------------------
 * Menu Navigation (full width)
 * ------------------------------------------------------------------------- */
.ppm-menu-nav-wrap {
	background: #fff;
	border-bottom: 2px solid #e5e5e5;
	display: flex;
	align-items: center;
	width: 100%;
	padding: 0 4%;
}

.ppm-menu-nav {
	flex: 1;
	display: flex;
	gap: 0;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ppm-menu-item {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 16px 20px;
	background: none;
	border: none;
	border-bottom: 3px solid transparent;
	cursor: pointer;
	transition: all 0.3s;
	white-space: nowrap;
	color: #555;
	font-size: 13px;
	font-weight: 500;
	min-width: 100px;
}

.ppm-menu-item i {
	font-size: 24px;
	margin-bottom: 6px;
	display: block;
}

.ppm-menu-item-logo {
	width: 32px;
	height: 32px;
	object-fit: contain;
	margin-bottom: 6px;
	display: block;
}

.ppm-menu-item:hover {
	color: #000;
	background: #f9f9f9;
}

.ppm-menu-item.is-active {
	color: #2271b1;
	border-bottom-color: #2271b1;
	background: #f0f6fc;
}

/* Search Box in Menu */
.ppm-search-box {
	display: flex;
	align-items: center;
	gap: 5px;
	padding: 10px 0 10px 20px;
	margin-left: 20px;
	border-left: 1px solid #e5e5e5;
}

.ppm-search-input {
	width: 280px;
	padding: 8px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 14px;
	transition: border-color 0.3s, box-shadow 0.3s;
}

.ppm-search-input:focus {
	outline: none;
	border-color: #2271b1;
	box-shadow: 0 0 0 1px #2271b1;
}

.ppm-search-btn {
	background: #2271b1;
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 4px;
	cursor: pointer;
	transition: background 0.3s;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 18px;
}

.ppm-search-btn:hover { background: #135e96; }
.ppm-search-btn i { font-size: 18px; }

/* ---------------------------------------------------------------------------
 * Content area (full width)
 * ------------------------------------------------------------------------- */
.ppm-content-panels {
	width: 100%;
	padding: 40px 4% 60px;
}

.ppm-content-panel { display: none; }
.ppm-content-panel.is-active { display: block; }

.ppm-empty {
	text-align: center;
	color: #999;
	padding: 40px 20px;
	font-style: italic;
}

/* ---------------------------------------------------------------------------
 * Cards grid (collection covers)
 * ------------------------------------------------------------------------- */
.ppm-cards-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 28px;
}

.ppm-collection-card {
	background: #fff;
	border-radius: 4px;
	transition: transform 0.25s ease;
}

.ppm-collection-card:hover {
	transform: translateY(-4px);
}

.ppm-collection-open,
.ppm-video-open,
.ppm-pdf-open {
	display: block;
	width: 100%;
	border: none;
	background: none;
	padding: 0;
	margin: 0;
	cursor: pointer;
	text-align: center;
}

.ppm-collection-cover {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 4 / 3;
	background: #fff;
	overflow: hidden;
	position: relative;
}

.ppm-collection-cover img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.ppm-collection-info {
	display: block;
	padding: 14px 8px 4px;
}

.ppm-collection-name {
	display: block;
	font-size: 15px;
	font-weight: 600;
	color: #222;
	line-height: 1.3;
}

.ppm-collection-count {
	display: block;
	font-size: 12px;
	color: #888;
	margin-top: 4px;
}

/* PDF card - A4 first-page preview */
.ppm-pdf-card .ppm-pdf-cover {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1.414;
	background: #fff;
	border: 1px solid #e5e5e5;
	overflow: hidden;
	position: relative;
}

.ppm-pdf-card .ppm-pdf-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: top center;
	display: block;
}

.ppm-pdf-firstpage {
	width: 100%;
	height: 100%;
	border: 0;
	display: block;
	pointer-events: none;
}

/* Transparent layer so a click opens the popup instead of the embedded viewer */
.ppm-pdf-clickguard {
	position: absolute;
	inset: 0;
	z-index: 2;
	cursor: pointer;
}

/* Video play icon */
.ppm-video-play-icon {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 60px;
	height: 60px;
	background: rgba(255, 0, 0, 0.9);
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #fff;
	font-size: 32px;
	pointer-events: none;
	transition: background 0.3s;
}

.ppm-video-open:hover .ppm-video-play-icon {
	background: rgba(255, 0, 0, 1);
}

/* File-type icon badge (top-left of the cover) */
.ppm-type-icon {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 3;
	width: 28px;
	height: 28px;
	border-radius: 4px;
	background: rgba(255, 255, 255, 0.92);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
	display: flex;
	align-items: center;
	justify-content: center;
	color: #444;
}

.ppm-type-icon .dashicons {
	font-size: 18px;
	width: 18px;
	height: 18px;
	line-height: 18px;
}

.ppm-type-icon--document { color: #c0392b; }
.ppm-type-icon--video { color: #e74c3c; }
.ppm-type-icon--photo { color: #2271b1; }

/* Slide with a filled background (color or photo) */
.ppm-hero-slide.ppm-has-bg .ppm-hero-slide-inner {
	grid-template-columns: 1fr;
}

.ppm-hero-slide.ppm-has-bg .ppm-hero-text {
	background: transparent;
}

.ppm-hero-slide.ppm-has-bg .ppm-hero-image {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Photo collection popup (light background, image left / info right)
 * ------------------------------------------------------------------------- */
.ppm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ppm-lightbox[hidden] { display: none; }

.ppm-lightbox-overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 20, 0.2);
	z-index: 1;
}

.ppm-lightbox-dialog {
	position: relative;
	z-index: 2;
	background: #fff;
	border-radius: 6px;
	width: min(1120px, 96vw);
	max-height: 92vh;
	display: flex;
	overflow: hidden;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.ppm-lightbox-close {
	position: absolute;
	top: 12px;
	right: 14px;
	background: transparent;
	color: #333;
	border: none;
	width: 36px;
	height: 36px;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	z-index: 10;
}

.ppm-lightbox-close:hover { color: #000; }

.ppm-lightbox-left {
	flex: 1 1 auto;
	min-width: 0;
	padding: 28px;
	display: flex;
	flex-direction: column;
}

.ppm-lightbox-stage {
	position: relative;
	flex: 0 0 auto;
	height: 58vh;
	max-height: 520px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fff;
}

.ppm-lightbox-image {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.ppm-lightbox-prev,
.ppm-lightbox-next {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	background: rgba(0, 0, 0, 0.06);
	color: #333;
	border: none;
	width: 42px;
	height: 42px;
	border-radius: 50%;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.2s;
	z-index: 3;
}

.ppm-lightbox-prev { left: 0; }
.ppm-lightbox-next { right: 0; }

.ppm-lightbox-prev:hover,
.ppm-lightbox-next:hover {
	background: rgba(0, 0, 0, 0.14);
}

.ppm-lightbox-counter {
	text-align: center;
	font-size: 12px;
	color: #888;
	padding: 12px 0 8px;
}

.ppm-lightbox-thumbnails {
	display: flex;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 6px;
}

.ppm-lightbox-thumb {
	flex-shrink: 0;
	width: 72px;
	height: 72px;
	border-radius: 4px;
	overflow: hidden;
	cursor: pointer;
	border: 2px solid transparent;
	background: #f5f5f5;
	padding: 0;
}

.ppm-lightbox-thumb:hover { border-color: #bbb; }
.ppm-lightbox-thumb.is-active { border-color: #2271b1; }

.ppm-lightbox-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ppm-lightbox-right {
	flex: 0 0 340px;
	max-width: 340px;
	border-left: 1px solid #eee;
	padding: 34px 26px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.ppm-lightbox-card-name {
	font-size: 22px;
	font-weight: 700;
	color: #1a1a1a;
	margin: 0 0 6px;
}

.ppm-lightbox-photo-name {
	font-size: 13px;
	color: #777;
	margin-bottom: 18px;
}

/* The two text blocks (description + project description) scroll together
 * so the download buttons stay pinned no matter how long the text is. */
.ppm-lightbox-scroll {
	flex: 1 1 auto;
	overflow-y: auto;
	margin-bottom: 16px;
}

.ppm-lightbox-desc,
.ppm-lightbox-desc2 {
	font-size: 14px;
	line-height: 1.7;
	color: #444;
}

.ppm-lightbox-desc2 {
	margin-top: 14px;
}

.ppm-lightbox-desc p,
.ppm-lightbox-desc2 p { margin: 0 0 12px; }

/* Download actions pinned to the bottom of the info panel */
.ppm-lightbox-actions {
	margin-top: auto;
	flex-shrink: 0;
	padding-top: 16px;
	border-top: 1px solid #e5e5e5;
}

.ppm-lightbox-action-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 8px 0;
}

.ppm-lightbox-action-label {
	font-size: 14px;
	font-weight: 600;
	color: #222;
}

.ppm-btn-filled,
.ppm-btn-outline {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
	padding: 9px 24px;
	border-radius: 22px;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s, color 0.2s;
	white-space: nowrap;
}

.ppm-btn-filled {
	background: #111;
	color: #fff;
	border: 1px solid #111;
}

.ppm-btn-filled:hover { background: #333; border-color: #333; color: #fff; }

.ppm-btn-outline {
	background: transparent;
	color: #111;
	border: 1px solid #111;
}

.ppm-btn-outline:hover { background: #111; color: #fff; }

/* ---------------------------------------------------------------------------
 * PDF popup (same page)
 * ------------------------------------------------------------------------- */
.ppm-pdf-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ppm-pdf-popup[hidden] { display: none; }

.ppm-pdf-overlay {
	position: absolute;
	inset: 0;
	background: rgba(20, 20, 20, 0.35);
	z-index: 1;
}

.ppm-pdf-dialog {
	position: relative;
	z-index: 2;
	background: #fff;
	border-radius: 6px;
	width: min(900px, 96vw);
	height: 92vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.3);
}

.ppm-pdf-bar {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 18px;
	border-bottom: 1px solid #eee;
	background: #fafafa;
}

.ppm-pdf-title {
	font-size: 15px;
	font-weight: 600;
	color: #222;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.ppm-pdf-actions {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-shrink: 0;
}

.ppm-pdf-download {
	background: #111;
	color: #fff;
	text-decoration: none;
	padding: 7px 16px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
}

.ppm-pdf-download:hover { background: #333; color: #fff; }

.ppm-pdf-close {
	background: transparent;
	border: none;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	color: #555;
}

.ppm-pdf-close:hover { color: #000; }

.ppm-pdf-frame {
	flex: 1 1 auto;
	width: 100%;
	border: 0;
}

/* ---------------------------------------------------------------------------
 * Video popup
 * ------------------------------------------------------------------------- */
.ppm-video-popup {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.ppm-video-popup[hidden] { display: none; }

.ppm-video-overlay {
	position: absolute;
	inset: 0;
	background: rgba(10, 10, 10, 0.6);
	z-index: 1;
}

.ppm-video-dialog {
	position: relative;
	z-index: 2;
	width: 90vw;
	max-width: 1100px;
	aspect-ratio: 16 / 9;
}

.ppm-video-close {
	position: absolute;
	top: -44px;
	right: 0;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	border: none;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.ppm-video-close:hover { background: rgba(255, 255, 255, 0.35); }

.ppm-video-container {
	width: 100%;
	height: 100%;
}

.ppm-video-container iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------------------------------------------------------------------------
 * Search results (grouped by category)
 * ------------------------------------------------------------------------- */
.ppm-search-results {
	width: 100%;
	padding: 30px 4% 60px;
}

.ppm-search-results[hidden] { display: none; }

.ppm-search-results-head {
	margin-bottom: 24px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e5e5e5;
}

.ppm-search-results-stats {
	font-size: 15px;
	color: #666;
}

.ppm-search-results-stats strong { color: #2271b1; }

.ppm-search-group {
	margin-bottom: 44px;
}

.ppm-search-group-label {
	display: inline-block;
	border: 1px solid #2271b1;
	color: #2271b1;
	padding: 4px 14px;
	border-radius: 4px;
	font-size: 14px;
	font-weight: 600;
	margin-bottom: 20px;
}

/* ---------------------------------------------------------------------------
 * Responsive
 * ------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.ppm-lightbox-dialog {
		flex-direction: column;
		overflow-y: auto;
	}

	.ppm-lightbox-right {
		flex: 1 1 auto;
		max-width: none;
		border-left: none;
		border-top: 1px solid #eee;
		overflow: visible;
	}

	.ppm-lightbox-scroll {
		flex: 0 0 auto;
		overflow-y: visible;
	}

	.ppm-lightbox-stage {
		height: 44vh;
	}
}

@media (max-width: 768px) {
	.ppm-hero-slide-inner {
		grid-template-columns: 1fr;
		height: auto;
	}

	.ppm-hero-text { padding: 15px 20px; }
	.ppm-hero-image { height: 160px; }

	.ppm-menu-nav-wrap {
		flex-direction: column;
		align-items: stretch;
		padding: 0;
	}

	.ppm-menu-nav { padding: 0 10px; }

	.ppm-menu-item {
		min-width: 80px;
		padding: 12px 15px;
		font-size: 12px;
	}

	.ppm-menu-item i { font-size: 20px; }

	.ppm-search-box {
		border-left: none;
		border-top: 1px solid #e5e5e5;
		margin-left: 0;
		padding: 10px 15px;
		width: 100%;
	}

	.ppm-search-input { flex: 1; width: auto; }

	.ppm-cards-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 18px;
	}
}
