/* Pinnacle Project Feed — all rules are scoped to .ppf-gallery / .ppf-dialog.
   Colours and fonts follow the pinnacle-roofing theme (main.css). */

.ppf-gallery {
	--ppf-accent: #ac8c01;
	--ppf-heading: #2d3438;
	--ppf-text: #3c4a52;
	--ppf-muted: #656a6f;
	--ppf-border: #dde1e5;
	margin: 1.5em 0;
}

.ppf-gallery .ppf-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 24px;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* The theme adds decorative bullets/spacing to .main ul li */
.ppf-gallery .ppf-grid > li,
.ppf-gallery .ppf-slides > li { margin: 0; padding: 0; }
.ppf-gallery .ppf-grid > li:before,
.ppf-gallery .ppf-slides > li:before { content: none !important; display: none !important; }

.ppf-gallery .ppf-card {
	display: flex;
	flex-direction: column;
	background: #fff;
	border: 1px solid var(--ppf-border);
	min-width: 0;
}

.ppf-gallery .ppf-figure { margin: 0; }

.ppf-gallery .ppf-media {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: #d7dce3;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	cursor: pointer;
	color: inherit;
	font: inherit;
	text-align: left;
}

.ppf-gallery .ppf-media img,
.ppf-gallery .ppf-placeholder {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	border: 0;
	background: none;
	object-fit: cover;
	transition: transform 250ms ease-in-out;
}

.ppf-gallery .ppf-media:hover img { transform: scale(1.03); }

.ppf-gallery .ppf-media:focus-visible {
	outline: 3px solid var(--ppf-accent);
	outline-offset: 3px;
}

.ppf-gallery .ppf-play {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 68px;
	height: 68px;
	margin: -34px 0 0 -34px;
	border-radius: 50%;
	background: rgba(20, 24, 27, 0.72);
	box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
	transition: background 200ms ease-in-out;
}

.ppf-gallery .ppf-play:after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	margin: -13px 0 0 -8px;
	border-style: solid;
	border-width: 13px 0 13px 22px;
	border-color: transparent transparent transparent #fff;
}

.ppf-gallery .ppf-media--video:hover .ppf-play,
.ppf-gallery .ppf-media--video:focus-visible .ppf-play { background: var(--ppf-accent); }

.ppf-gallery .ppf-media--external { text-decoration: none; }

.ppf-gallery .ppf-external {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	padding: 10px 14px;
	background: rgba(20, 24, 27, 0.8);
	color: #fff;
	font-family: 'robotobold', sans-serif;
	font-size: 14px;
	line-height: 1.3;
}

.ppf-gallery .ppf-external:after { content: " \2197"; }

.ppf-gallery .ppf-desc {
	margin: 0;
	padding: 12px 16px 0;
	color: var(--ppf-text);
	font-size: 15px;
	line-height: 1.5;
	overflow-wrap: anywhere;
}

.ppf-gallery .ppf-meta {
	margin: auto 0 0;
	padding: 10px 16px 14px;
	color: var(--ppf-muted);
	font-size: 13px;
	line-height: 1.4;
}

.ppf-gallery .ppf-meta__type {
	color: var(--ppf-accent);
	font-family: 'robotobold', sans-serif;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Carousel: swipeable with or without JavaScript (scroll snap). */
.ppf-gallery .ppf-carousel { position: relative; }

.ppf-gallery .ppf-slides {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.ppf-gallery .ppf-slides::-webkit-scrollbar { display: none; }

.ppf-gallery .ppf-slide {
	flex: 0 0 100%;
	min-width: 0;
	scroll-snap-align: start;
}

.ppf-gallery .ppf-carousel__nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 12px;
	padding: 10px 16px 0;
}

.ppf-gallery .ppf-carousel__btn {
	width: 36px;
	height: 36px;
	padding: 0;
	border: 1px solid var(--ppf-border);
	border-radius: 50%;
	background: #fff;
	color: var(--ppf-heading);
	font-size: 22px;
	line-height: 32px;
	cursor: pointer;
}

.ppf-gallery .ppf-carousel__btn:hover:not(:disabled) { border-color: var(--ppf-accent); color: var(--ppf-accent); }
.ppf-gallery .ppf-carousel__btn:focus-visible { outline: 3px solid var(--ppf-accent); outline-offset: 2px; }
.ppf-gallery .ppf-carousel__btn:disabled { opacity: 0.35; cursor: default; }

.ppf-gallery .ppf-carousel__count {
	min-width: 48px;
	text-align: center;
	color: var(--ppf-muted);
	font-size: 13px;
}

/* Without JavaScript: native players replace the Play buttons; carousel arrows are hidden. */
.ppf-gallery .ppf-noscript-video { display: block; width: 100%; aspect-ratio: 4 / 5; background: #000; }
.ppf-gallery.ppf-no-js .ppf-media--video,
.ppf-gallery.ppf-no-js .ppf-carousel__btn { display: none; }

.ppf-gallery .screen-reader-text,
.ppf-dialog .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.ppf-empty { padding: 1em; border: 1px dashed #cad2d7; }

@media only screen and (max-width: 600px) {
	.ppf-gallery .ppf-grid { grid-template-columns: 1fr; gap: 20px; }
	.ppf-gallery .ppf-desc { font-size: 16px; }
}

/* ---------- Player / lightbox dialog ---------- */

.ppf-dialog {
	width: min(960px, calc(100vw - 32px));
	max-width: none;
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	margin: auto;
	padding: 0;
	border: 0;
	background: #111;
	color: #fff;
	overflow: auto;
}

.ppf-dialog::backdrop { background: rgba(10, 12, 14, 0.88); }

.ppf-dialog[data-ppf-fallback] {
	position: fixed;
	inset: 0;
	z-index: 100000;
	box-shadow: 0 0 0 100vmax rgba(10, 12, 14, 0.88);
}

.ppf-dialog__close {
	position: absolute;
	top: 8px;
	right: 8px;
	z-index: 2;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.6);
	color: #fff;
	font-size: 28px;
	line-height: 44px;
	cursor: pointer;
}

.ppf-dialog__close:focus-visible,
.ppf-dialog a:focus-visible { outline: 3px solid #ac8c01; outline-offset: 2px; }

.ppf-dialog__stage {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	background: #000;
}

.ppf-dialog__stage video,
.ppf-dialog__stage img {
	display: block;
	width: 100%;
	max-height: calc(100vh - 160px);
	max-height: calc(100dvh - 160px);
	object-fit: contain;
	background: #000;
}

.ppf-dialog__message { padding: 48px 24px; text-align: center; font-size: 16px; line-height: 1.5; }
.ppf-dialog__message a { color: #f2d36b; text-decoration: underline; }

.ppf-dialog__footer { padding: 12px 18px 16px; font-size: 15px; line-height: 1.5; }
.ppf-dialog__desc { margin: 0 0 6px; color: #f3f4f5; }
.ppf-dialog__desc:empty { display: none; }
.ppf-dialog__link { color: #f2d36b; font-size: 14px; text-decoration: underline; }

@media only screen and (max-width: 600px) {
	.ppf-dialog { width: 100vw; max-height: 100vh; max-height: 100dvh; }
	.ppf-dialog__stage video,
	.ppf-dialog__stage img { max-height: calc(100dvh - 140px); }
}
