/**
 * Photo gallery archive and single (roadmap 8N).
 * Uses semantic tokens — light defaults + dark overrides.
 *
 * @package Campus
 */

.campus-frontend,
.cp-react-shell {
	--cp-photo-border: #e2e8f0;
	--cp-photo-border-hover: #cbd5e1;
	--cp-photo-pill-bg: #ffffff;
	--cp-photo-pill-fg: #334155;
	--cp-photo-pill-hover-bg: #f8fafc;
	--cp-photo-accent: #2563eb;
	--cp-photo-tile-bg: #f1f5f9;
	--cp-photo-muted: #64748b;
	--cp-photo-shadow: rgba(15, 23, 42, 0.12);
}

html.campus-theme-dark .campus-frontend,
html.campus-theme-dark .cp-react-shell {
	--cp-photo-border: #334155;
	--cp-photo-border-hover: #475569;
	--cp-photo-pill-bg: #1e293b;
	--cp-photo-pill-fg: #e2e8f0;
	--cp-photo-pill-hover-bg: #334155;
	--cp-photo-accent: #60a5fa;
	--cp-photo-tile-bg: #0f172a;
	--cp-photo-muted: #94a3b8;
	--cp-photo-shadow: rgba(0, 0, 0, 0.35);
}

.cp-photo-gallery-header h1 {
	margin: 0 0 16px;
	font-size: 1.75rem;
}

.cp-photo-gallery-albums {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.cp-photo-gallery-album-pill {
	display: inline-block;
	padding: 6px 14px;
	border-radius: 999px;
	border: 1px solid var(--cp-photo-border);
	background: var(--cp-photo-pill-bg);
	color: var(--cp-photo-pill-fg);
	font-size: 14px;
	text-decoration: none;
	transition: background 0.15s ease, border-color 0.15s ease;
	cursor: pointer;
	font: inherit;
}

.cp-photo-gallery-album-pill:hover {
	border-color: var(--cp-photo-border-hover);
	background: var(--cp-photo-pill-hover-bg);
}

.cp-photo-gallery-album-pill.is-active {
	background: var(--cp-photo-accent);
	border-color: var(--cp-photo-accent);
	color: #fff;
}

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

.cp-photo-gallery-grid--cols-2 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cp-photo-gallery-grid--cols-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.cp-photo-gallery-grid--cols-4 {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.cp-photo-gallery-grid--cols-5 {
	grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cp-photo-gallery-grid--cols-6 {
	grid-template-columns: repeat(6, minmax(0, 1fr));
}

@media (max-width: 700px) {
	.cp-photo-gallery-grid--cols-4,
	.cp-photo-gallery-grid--cols-5,
	.cp-photo-gallery-grid--cols-6 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.cp-photo-gallery-tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.cp-photo-gallery-author {
	font-size: 12px;
	color: var(--cp-photo-muted);
}

.cp-photo-gallery-tile-link,
.cp-photo-gallery-tile-fallback {
	display: block;
	border-radius: 10px;
	overflow: hidden;
	background: var(--cp-photo-tile-bg);
	aspect-ratio: 4 / 3;
}

/* Intranet photo treatment — frames, borders, shadows, CSS filters (matches admin “Intranet presentation”). */
.cp-photo-treat {
	--cp-photo-border-width: 0px;
	--cp-photo-border-color: #cbd5e1;
	--cp-photo-radius: 8px;
	--cp-photo-object-fit: cover;
	box-sizing: border-box;
	display: block;
	width: 100%;
	height: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0;
	border-radius: var(--cp-photo-radius);
	border: var(--cp-photo-border-width) solid var(--cp-photo-border-color);
	overflow: hidden;
	line-height: 0;
	background: transparent;
}

.cp-photo-treat img {
	display: block;
	width: 100%;
	height: auto;
	max-width: 100%;
	vertical-align: bottom;
	object-fit: var(--cp-photo-object-fit, cover);
}

.cp-photo-gallery-tile-link > .cp-photo-treat {
	min-height: 0;
}

.cp-photo-gallery-tile-link > .cp-photo-treat img {
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

/* Frame presets — essentials */
.cp-photo-treat--frame-polaroid {
	background: #fff;
	padding: 10px 10px 28px;
	border-color: transparent;
}

.cp-photo-treat--frame-gallery {
	background: linear-gradient(145deg, #f8fafc 0%, #e2e8f0 100%);
	padding: 6px;
}

.cp-photo-treat--frame-minimal {
	background: transparent;
}

.cp-photo-treat--frame-spotlight {
	background: radial-gradient(
		ellipse 120% 80% at 50% 40%,
		rgba(255, 255, 255, 0.25) 0%,
		transparent 65%
	);
	padding: 4px;
}

.cp-photo-treat--frame-elegant {
	background: #fff;
	padding: 3px;
	box-shadow:
		0 0 0 1px rgba(255, 255, 255, 0.65) inset,
		0 0 0 1px var(--cp-photo-border-color);
}

/* Fun & playful */
.cp-photo-treat--frame-fun-polaroid-stack {
	position: relative;
	background: #fff;
	padding: 12px 12px 30px;
	border: none;
	box-shadow: 0 12px 28px rgba(15, 23, 42, 0.14);
}

.cp-photo-treat--frame-fun-polaroid-stack::before,
.cp-photo-treat--frame-fun-polaroid-stack::after {
	content: '';
	position: absolute;
	inset: 8px;
	background: #fff;
	border: 1px solid rgba(15, 23, 42, 0.08);
	box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
	z-index: 0;
}

.cp-photo-treat--frame-fun-polaroid-stack::before {
	transform: rotate(-7deg);
}

.cp-photo-treat--frame-fun-polaroid-stack::after {
	transform: rotate(5deg);
}

.cp-photo-treat--frame-fun-polaroid-stack img {
	position: relative;
	z-index: 1;
}

.cp-photo-treat--frame-fun-starburst {
	padding: 8px;
	border: none;
	background: radial-gradient(circle at 50% 40%, #fff7a8 0%, #f59e0b 55%, #b45309 100%);
	box-shadow: 0 10px 24px rgba(245, 158, 11, 0.22);
}

.cp-photo-treat--frame-fun-starburst img {
	clip-path: polygon(
		50% 0%,
		61% 35%,
		98% 35%,
		68% 57%,
		79% 94%,
		50% 72%,
		21% 94%,
		32% 57%,
		2% 35%,
		39% 35%
	);
}

.cp-photo-treat--frame-fun-hollywood-marquee {
	position: relative;
	padding: 14px;
	border: none;
	background: linear-gradient(180deg, #140f0a 0%, #05070a 100%);
	box-shadow: 0 14px 30px rgba(15, 23, 42, 0.22);
}

.cp-photo-treat--frame-fun-hollywood-marquee::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background:
		radial-gradient(circle, #ffe083 0 34%, transparent 36%) top 8px left 10px / 26px 26px repeat-x,
		radial-gradient(circle, #ffe083 0 34%, transparent 36%) bottom 8px left 10px / 26px 26px repeat-x,
		radial-gradient(circle, #ffe083 0 34%, transparent 36%) top 10px left 8px / 26px 26px repeat-y,
		radial-gradient(circle, #ffe083 0 34%, transparent 36%) top 10px right 8px / 26px 26px repeat-y;
}

.cp-photo-treat--frame-fun-hollywood-marquee::after {
	content: '';
	position: absolute;
	inset: 8px;
	border: 4px solid #8b5e14;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.12);
	z-index: 1;
	pointer-events: none;
}

.cp-photo-treat--frame-fun-hollywood-marquee img {
	position: relative;
	z-index: 0;
}

.cp-photo-treat--frame-fun-walk-of-fame {
	padding: 8px;
	border: none;
	background: linear-gradient(145deg, #f8b4c5 0%, #d48aa5 48%, #9f4d70 100%);
	box-shadow: 0 12px 28px rgba(159, 77, 112, 0.2);
}

.cp-photo-treat--frame-fun-walk-of-fame img {
	clip-path: polygon(
		50% 0%,
		61% 35%,
		98% 35%,
		68% 57%,
		79% 94%,
		50% 72%,
		21% 94%,
		32% 57%,
		2% 35%,
		39% 35%
	);
}

.cp-photo-treat--frame-fun-ticket-stub {
	padding: 10px;
	border: none;
	background:
		radial-gradient(circle at left center, transparent 0 12px, #e11d48 13px) left / 52% 100% no-repeat,
		radial-gradient(circle at right center, transparent 0 12px, #fb7185 13px) right / 52% 100% no-repeat;
	box-shadow: 0 10px 24px rgba(225, 29, 72, 0.18);
}

.cp-photo-treat--frame-fun-ticket-stub img {
	clip-path: polygon(
		0% 18%,
		5% 18%,
		5% 0%,
		95% 0%,
		95% 18%,
		100% 18%,
		100% 82%,
		95% 82%,
		95% 100%,
		5% 100%,
		5% 82%,
		0% 82%
	);
}

/* Shapes — clip-path on image; object-fit from --cp-photo-object-fit */
.cp-photo-treat--frame-circle-gold {
	padding: 8px;
	background: radial-gradient(circle at 50% 38%, #fff8e7 0%, #e8c56a 55%, #9a7b2c 100%);
	border: none;
}

.cp-photo-treat--frame-circle-gold img {
	clip-path: circle(50% at 50% 50%);
	filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.2));
}

.cp-photo-treat--frame-circle-soft {
	padding: 6px;
	background: radial-gradient(circle at 50% 40%, #f8fafc 0%, #e2e8f0 100%);
	border: none;
}

.cp-photo-treat--frame-circle-soft img {
	clip-path: circle(50% at 50% 50%);
}

.cp-photo-treat--frame-squircle {
	padding: 4px;
	background: linear-gradient(160deg, #f1f5f9, #e2e8f0);
	border: none;
}

.cp-photo-treat--frame-squircle img {
	clip-path: inset(0 round 22%);
}

.cp-photo-treat--frame-hex-modern {
	padding: 4px;
	background: linear-gradient(145deg, #0f172a, #334155);
	border: none;
}

.cp-photo-treat--frame-hex-modern img {
	clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
}

.cp-photo-treat--frame-arch-top {
	padding: 4px;
	background: linear-gradient(180deg, #e2e8f0 0%, #cbd5e1 100%);
	border: none;
}

.cp-photo-treat--frame-arch-top img {
	clip-path: polygon(0% 18%, 0% 100%, 100% 100%, 100% 18%, 50% 0%);
}

/* Gallery mats */
.cp-photo-treat--frame-mat-gold {
	padding: clamp(10px, 3.5vw, 18px);
	background: linear-gradient(145deg, #faf8f3 0%, #ebe6dc 100%);
	border: none;
	box-shadow:
		inset 0 0 0 1px rgba(212, 175, 55, 0.45),
		inset 0 0 0 5px #faf8f3,
		inset 0 0 0 6px rgba(180, 140, 50, 0.25);
}

.cp-photo-treat--frame-mat-black {
	padding: clamp(10px, 3.5vw, 16px);
	background: linear-gradient(180deg, #1e293b 0%, #0f172a 100%);
	border: none;
	box-shadow:
		inset 0 0 0 1px #334155,
		inset 0 0 0 6px #f8fafc,
		inset 0 0 0 7px #0f172a;
}

.cp-photo-treat--frame-museum-mat {
	padding: clamp(12px, 4vw, 22px);
	background: #f5f2eb;
	border: none;
	box-shadow:
		inset 0 0 0 1px #d6d0c4,
		inset 0 0 0 10px #faf9f6,
		inset 0 0 0 11px #c4b8a6;
}

.cp-photo-treat--frame-double-mat {
	padding: clamp(8px, 3vw, 14px);
	background: #fff;
	border: none;
	box-shadow:
		inset 0 0 0 1px #94a3b8,
		inset 0 0 0 5px #f1f5f9,
		inset 0 0 0 6px #cbd5e1,
		inset 0 0 0 11px #fff;
}

/* Themed presentation */
.cp-photo-treat--frame-metal-thin {
	padding: 5px;
	background: linear-gradient(135deg, #e2e8f0 0%, #94a3b8 45%, #cbd5e1 100%);
	border: none;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.5), inset 0 0 0 2px #64748b;
}

.cp-photo-treat--frame-postcard {
	padding: 10px 12px 14px;
	background: #fffef7;
	border: none;
	box-shadow:
		0 0 0 1px #e7e2d6,
		0 2px 0 #d4cfc4,
		0 8px 20px rgba(15, 23, 42, 0.12);
}

.cp-photo-treat--frame-postcard img {
	border-radius: 2px;
}

.cp-photo-treat--frame-vintage-tape {
	position: relative;
	padding: 12px;
	background: #faf8f3;
	border: none;
	box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
}

.cp-photo-treat--frame-vintage-tape::before,
.cp-photo-treat--frame-vintage-tape::after {
	content: '';
	position: absolute;
	width: 44px;
	height: 18px;
	background: linear-gradient(
		90deg,
		rgba(250, 250, 250, 0.75),
		rgba(230, 230, 220, 0.85)
	);
	opacity: 0.9;
	pointer-events: none;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.cp-photo-treat--frame-vintage-tape::before {
	top: 6px;
	left: 8px;
	transform: rotate(-8deg);
}

.cp-photo-treat--frame-vintage-tape::after {
	bottom: 10px;
	right: 8px;
	transform: rotate(6deg);
}

.cp-photo-treat--frame-float-lift {
	padding: 4px;
	background: #fff;
	border: none;
	box-shadow:
		0 2px 4px rgba(15, 23, 42, 0.06),
		0 12px 28px rgba(15, 23, 42, 0.14);
}

/*
 * SVG frame overlays (`public/images/photo-frames/*.svg`)
 * Strategy: photo fills the treatment box (below); frame art is an ::after layer on top with
 * transparent “openings” so the image shows through—no %-inset tuning. Opaque photoreal PNGs
 * cannot be composited this way without a matching alpha mask; use SVG until mask assets exist.
 */
.cp-photo-treat--frame-ornate-gold-gallery,
.cp-photo-treat--frame-bronze-antique,
.cp-photo-treat--frame-rose-gold-filigree,
.cp-photo-treat--frame-oval-ornate,
.cp-photo-treat--frame-device-laptop,
.cp-photo-treat--frame-device-phone-portrait,
.cp-photo-treat--frame-film-strip,
.cp-photo-treat--frame-wood-ornate {
	position: relative;
	border: none;
	padding: 0;
	background: transparent;
}

.cp-photo-treat--frame-ornate-gold-gallery::after,
.cp-photo-treat--frame-bronze-antique::after,
.cp-photo-treat--frame-rose-gold-filigree::after,
.cp-photo-treat--frame-oval-ornate::after,
.cp-photo-treat--frame-device-laptop::after,
.cp-photo-treat--frame-device-phone-portrait::after,
.cp-photo-treat--frame-film-strip::after,
.cp-photo-treat--frame-wood-ornate::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
	background-repeat: no-repeat;
	background-position: center;
	background-size: 100% 100%;
}

.cp-photo-treat--frame-ornate-gold-gallery::after {
	background-image: url('../images/photo-frames/ornate-gold-gallery.svg');
}

.cp-photo-treat--frame-bronze-antique::after {
	background-image: url('../images/photo-frames/bronze-antique.svg');
}

.cp-photo-treat--frame-rose-gold-filigree::after {
	background-image: url('../images/photo-frames/rose-gold-filigree.svg');
}

.cp-photo-treat--frame-oval-ornate::after {
	background-image: url('../images/photo-frames/oval-ornate.svg');
}

.cp-photo-treat--frame-device-laptop::after {
	background-image: url('../images/photo-frames/device-laptop.svg');
}

.cp-photo-treat--frame-device-phone-portrait::after {
	background-image: url('../images/photo-frames/device-phone-portrait.svg');
}

.cp-photo-treat--frame-film-strip::after {
	background-image: url('../images/photo-frames/film-strip.svg');
}

.cp-photo-treat--frame-wood-ornate::after {
	background-image: url('../images/photo-frames/wood-ornate.svg');
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-ornate-gold-gallery img,
.cp-photo-preview-card__media .cp-photo-treat--frame-ornate-gold-gallery img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-ornate-gold-gallery img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-ornate-gold-gallery img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-ornate-gold-gallery img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-ornate-gold-gallery img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-ornate-gold-gallery img,
.cp-photos-recent-link .cp-photo-treat--frame-ornate-gold-gallery img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-ornate-gold-gallery img,
.cp-photo-treat--frame-ornate-gold-gallery img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-bronze-antique img,
.cp-photo-preview-card__media .cp-photo-treat--frame-bronze-antique img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-bronze-antique img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-bronze-antique img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-bronze-antique img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-bronze-antique img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-bronze-antique img,
.cp-photos-recent-link .cp-photo-treat--frame-bronze-antique img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-bronze-antique img,
.cp-photo-treat--frame-bronze-antique img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-rose-gold-filigree img,
.cp-photo-preview-card__media .cp-photo-treat--frame-rose-gold-filigree img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-rose-gold-filigree img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-rose-gold-filigree img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-rose-gold-filigree img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-rose-gold-filigree img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-rose-gold-filigree img,
.cp-photos-recent-link .cp-photo-treat--frame-rose-gold-filigree img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-rose-gold-filigree img,
.cp-photo-treat--frame-rose-gold-filigree img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-wood-ornate img,
.cp-photo-preview-card__media .cp-photo-treat--frame-wood-ornate img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-wood-ornate img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-wood-ornate img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-wood-ornate img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-wood-ornate img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-wood-ornate img,
.cp-photos-recent-link .cp-photo-treat--frame-wood-ornate img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-wood-ornate img,
.cp-photo-treat--frame-wood-ornate img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-oval-ornate img,
.cp-photo-preview-card__media .cp-photo-treat--frame-oval-ornate img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-oval-ornate img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-oval-ornate img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-oval-ornate img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-oval-ornate img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-oval-ornate img,
.cp-photos-recent-link .cp-photo-treat--frame-oval-ornate img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-oval-ornate img,
.cp-photo-treat--frame-oval-ornate img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-device-laptop img,
.cp-photo-preview-card__media .cp-photo-treat--frame-device-laptop img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-device-laptop img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-device-laptop img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-device-laptop img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-device-laptop img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-device-laptop img,
.cp-photos-recent-link .cp-photo-treat--frame-device-laptop img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-device-laptop img,
.cp-photo-treat--frame-device-laptop img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-device-phone-portrait img,
.cp-photo-preview-card__media .cp-photo-treat--frame-device-phone-portrait img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-device-phone-portrait img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-device-phone-portrait img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-device-phone-portrait img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-device-phone-portrait img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-device-phone-portrait img,
.cp-photos-recent-link .cp-photo-treat--frame-device-phone-portrait img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-device-phone-portrait img,
.cp-photo-treat--frame-device-phone-portrait img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

.cp-photo-gallery-tile-link > .cp-photo-treat--frame-film-strip img,
.cp-photo-preview-card__media .cp-photo-treat--frame-film-strip img,
.cp-photo-single-figure .cp-photo-treat.cp-photo-treat--frame-film-strip img,
.cp-hub .cp-photos-mosaic-link .cp-photo-treat--frame-film-strip img,
.cp-hub .cp-photos-spotlight-cover .cp-photo-treat--frame-film-strip img,
.cp-hub .cp-photos-spotlight-link .cp-photo-treat--frame-film-strip img,
.cp-hub .cp-photos-featured-link .cp-photo-treat--frame-film-strip img,
.cp-photos-recent-link .cp-photo-treat--frame-film-strip img,
.cp-photos-recent-item .cp-photo-treat.cp-photo-treat--frame-film-strip img,
.cp-photo-treat--frame-film-strip img {
	position: relative;
	z-index: 1;
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

/* —— Devices & mockups (CSS-only; remaining devices) —— */
.cp-photo-treat--frame-device-phone-landscape {
	position: relative;
	padding: 8% 9%;
	border: none;
	border-radius: 18px;
	background: linear-gradient(145deg, #1e293b, #0f172a);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.07),
		inset -3px 0 10px rgba(0, 0, 0, 0.35);
}

.cp-photo-treat--frame-device-phone-landscape::before {
	content: '';
	position: absolute;
	left: 5.5%;
	top: 50%;
	transform: translateY(-50%);
	width: 3.2%;
	height: 20%;
	background: #020617;
	border-radius: 0 12px 12px 0;
	z-index: 2;
	pointer-events: none;
}

.cp-photo-treat--frame-device-phone-landscape img {
	position: relative;
	z-index: 1;
	border-radius: 10px;
}

.cp-photo-treat--frame-device-tablet {
	position: relative;
	padding: 5.5% 6.5%;
	border: none;
	border-radius: 16px;
	background: linear-gradient(160deg, #334155 0%, #1e293b 100%);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.06),
		inset 0 2px 8px rgba(0, 0, 0, 0.35);
}

.cp-photo-treat--frame-device-tablet img {
	position: relative;
	z-index: 1;
	border-radius: 8px;
}

.cp-photo-treat--frame-device-monitor {
	position: relative;
	padding: 5% 5% 14% 5%;
	border: none;
	border-radius: 6px 6px 0 0;
	background: linear-gradient(180deg, #f3f4f6 0%, #d1d5db 100%);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.65),
		inset 0 -1px 0 rgba(0, 0, 0, 0.08);
}

.cp-photo-treat--frame-device-monitor::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 50%;
	transform: translateX(-50%);
	width: 34%;
	height: 11%;
	background: linear-gradient(180deg, #9ca3af, #6b7280);
	clip-path: polygon(16% 0, 84% 0, 100% 100%, 0 100%);
	pointer-events: none;
	z-index: 0;
}

.cp-photo-treat--frame-device-monitor img {
	position: relative;
	z-index: 1;
	border-radius: 3px;
	box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.4);
}

.cp-photo-treat--frame-device-watch {
	position: relative;
	padding: 15% 17%;
	border: none;
	border-radius: 36%;
	background: radial-gradient(ellipse at 50% 45%, #4b5563 0%, #111827 65%, #020617 100%);
	box-shadow:
		inset 0 0 0 2px rgba(255, 255, 255, 0.07),
		inset 0 4px 14px rgba(0, 0, 0, 0.55);
}

.cp-photo-treat--frame-device-watch img {
	position: relative;
	z-index: 1;
	border-radius: 24%;
	clip-path: inset(0 round 24%);
}

/* —— Ornate gallery (CSS-only shapes; SVG-backed frames listed above) —— */
.cp-photo-treat--frame-hex-elongated {
	padding: 5px;
	border: none;
	background: linear-gradient(145deg, #e2e8f0, #64748b 60%, #94a3b8);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.cp-photo-treat--frame-hex-elongated img {
	clip-path: polygon(5% 0%, 95% 0%, 100% 50%, 95% 100%, 5% 100%, 0% 50%);
}

.cp-photo-treat--frame-stepped-deco {
	padding: 5px;
	border: none;
	background: linear-gradient(145deg, #facc15 0%, #854d0e 50%, #ca8a04 100%);
	box-shadow:
		inset 0 0 0 1px rgba(255, 255, 255, 0.3),
		inset 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.cp-photo-treat--frame-stepped-deco img {
	clip-path: polygon(4% 0%, 96% 0%, 100% 4%, 100% 96%, 96% 100%, 4% 100%, 0% 96%, 0% 4%);
}

.cp-photo-treat--frame-notched-plaque {
	padding: 7px;
	border: none;
	background: linear-gradient(145deg, #fef3c7 0%, #b45309 50%, #f59e0b 100%);
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
}

.cp-photo-treat--frame-notched-plaque img {
	clip-path: polygon(
		0% 8%,
		8% 0%,
		92% 0%,
		100% 8%,
		100% 92%,
		92% 100%,
		8% 100%,
		0% 92%
	);
}

.cp-photo-treat--frame-shape-map-pin {
	padding: 5px;
	border: none;
	background: linear-gradient(180deg, #f87171 0%, #b91c1c 100%);
	box-shadow: 0 2px 8px rgba(185, 28, 28, 0.35);
}

.cp-photo-treat--frame-shape-map-pin img {
	clip-path: polygon(50% 0%, 100% 38%, 84% 100%, 50% 78%, 16% 100%, 0% 38%);
}

.cp-photo-treat--frame-shape-half-moon {
	padding: 4px;
	border: none;
	background: linear-gradient(180deg, #e0e7ff 0%, #6366f1 100%);
}

.cp-photo-treat--frame-shape-half-moon img {
	clip-path: circle(50% at 50% 100%);
}

/* Shadow tiers (outer; frame may add its own) */
.cp-photo-treat--shadow-sm {
	box-shadow: 0 2px 10px var(--cp-photo-shadow);
}

.cp-photo-treat--shadow-md {
	box-shadow: 0 8px 28px var(--cp-photo-shadow);
}

.cp-photo-treat--shadow-lg {
	box-shadow: 0 14px 40px var(--cp-photo-shadow);
}

.cp-photo-treat--shadow-xl {
	box-shadow: 0 22px 56px var(--cp-photo-shadow);
}

/* Non-destructive filters on the image */
.cp-photo-treat--filter-brighten img {
	filter: brightness(1.08) saturate(1.05);
}

.cp-photo-treat--filter-contrast img {
	filter: contrast(1.12) saturate(1.06);
}

.cp-photo-treat--filter-warm img {
	filter: sepia(0.12) saturate(1.15) hue-rotate(-8deg);
}

.cp-photo-treat--filter-cool img {
	filter: saturate(1.08) hue-rotate(12deg) brightness(1.02);
}

.cp-photo-treat--filter-grayscale img {
	filter: grayscale(1);
}

.cp-photo-treat--filter-sepia img {
	filter: sepia(0.45) saturate(1.1);
}

.cp-photo-treat--filter-vivid img {
	filter: saturate(1.35) contrast(1.08);
}

.cp-photo-gallery-tile-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	text-align: center;
	font-size: 14px;
	color: var(--cp-photo-muted);
	text-decoration: none;
}

.cp-photo-gallery-pagination {
	margin-top: 24px;
}

.cp-photo-single-title {
	margin-top: 0;
}

.cp-photo-single-figure {
	margin: 0 0 20px;
	text-align: center;
}

.cp-photo-single-figure .cp-photo-treat {
	max-width: 100%;
}

.cp-photo-single-figure .cp-photo-treat img {
	max-width: 100%;
	height: auto;
	object-fit: var(--cp-photo-object-fit, cover);
	border-radius: 0;
	box-shadow: none;
}

/* Fallback when no treatment wrapper (legacy) */
.cp-photo-single-figure > img {
	max-width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 4px 24px var(--cp-photo-shadow);
}

.cp-photo-single-nav {
	margin-bottom: 16px;
}

.cp-photos-recent-grid {
	list-style: none;
	margin: 0 0 12px;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 8px;
}

.cp-photos-recent-item .cp-photo-treat {
	height: 80px;
	border-radius: 8px;
}

.cp-photos-recent-item .cp-photo-treat img {
	width: 100%;
	height: 100%;
	object-fit: var(--cp-photo-object-fit, cover);
	display: block;
}

.cp-photos-recent-fallback {
	font-size: 13px;
	color: var(--cp-photo-muted);
}

@media (max-width: 600px) {
	.cp-photos-recent-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}
