/* Cobra Gallery — front-end styles. Scoped under .cg- classes + #cg-lightbox. */

.cg-wrap {
	--cg-accent: #e7c24b;
	--cg-bg: #0b0b0d;
	--cg-card: #15151a;
	--cg-text: #f3f3f5;
	--cg-muted: #9a9aa3;
	--cg-radius: 14px;
	max-width: 1200px;
	margin: 0 auto;
	padding: 24px 16px 64px;
	color: var(--cg-text);
	-webkit-font-smoothing: antialiased;
}

/* Breathing room between the gallery and the site footer. */
.cg-main {
	padding-bottom: 40px;
}

.cg-wrap *,
#cg-lightbox * {
	box-sizing: border-box;
}

/* ---------- Location filter ---------- */
.cg-filter {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 22px;
}

.cg-chip {
	display: inline-block;
	padding: 8px 16px;
	border-radius: 999px;
	background: var(--cg-card);
	color: var(--cg-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: .02em;
	border: 1px solid rgba(255, 255, 255, .08);
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.cg-chip:hover {
	border-color: var(--cg-accent);
}

.cg-chip.is-active {
	background: var(--cg-accent);
	color: #1a1407;
	border-color: var(--cg-accent);
}

/* ---------- Gallery index cards ---------- */
.cg-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 18px;
}

.cg-card {
	display: block;
	background: var(--cg-card);
	border-radius: var(--cg-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	border: 1px solid rgba(255, 255, 255, .06);
	transition: transform .18s ease, box-shadow .18s ease;
}

.cg-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
}

.cg-card__thumb {
	position: relative;
	aspect-ratio: 4 / 3;
	background: #0f0f13;
}

.cg-card__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cg-card__placeholder {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 38px;
	opacity: .35;
}

.cg-card__count {
	position: absolute;
	right: 10px;
	bottom: 10px;
	background: rgba(0, 0, 0, .65);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	padding: 4px 9px;
	border-radius: 999px;
	backdrop-filter: blur(4px);
}

.cg-card__meta {
	padding: 12px 14px 14px;
	display: flex;
	flex-direction: column;
	gap: 3px;
}

.cg-card__title {
	font-weight: 700;
	font-size: 15px;
	line-height: 1.25;
}

.cg-card__date {
	color: var(--cg-muted);
	font-size: 13px;
}

/* ---------- Breadcrumb ---------- */
.cg-breadcrumb {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin-bottom: 20px;
	font-size: 14px;
}

.cg-breadcrumb a {
	color: var(--cg-muted);
	text-decoration: none;
}

.cg-breadcrumb a:hover {
	color: var(--cg-accent);
}

.cg-breadcrumb__sep {
	color: var(--cg-muted);
	opacity: .5;
}

.cg-breadcrumb__current {
	color: var(--cg-text);
	font-weight: 600;
}

/* ---------- Year / month browse tiles ---------- */
.cg-browse {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 16px;
}

.cg-browse__tile {
	display: block;
	background: var(--cg-card);
	border-radius: var(--cg-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	border: 1px solid rgba(255, 255, 255, .06);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cg-browse__tile:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 30px rgba(0, 0, 0, .45);
	border-color: var(--cg-accent);
}

.cg-browse__thumb {
	position: relative;
	aspect-ratio: 1 / 1;
	background: #0f0f13;
}

.cg-browse__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.cg-browse__meta {
	padding: 12px 14px;
	text-align: center;
}

.cg-browse__label {
	display: block;
	font-weight: 800;
	font-size: 20px;
}

.cg-browse__count {
	display: block;
	color: var(--cg-muted);
	font-size: 13px;
	margin-top: 2px;
}

/* ---------- Single gallery header ---------- */
.cg-gallery__head {
	margin-bottom: 20px;
}

.cg-back {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	background: var(--cg-card);
	color: var(--cg-text);
	text-decoration: none;
	font-size: 14px;
	font-weight: 600;
	padding: 11px 18px;
	min-height: 44px;
	box-sizing: border-box;
	border-radius: 999px;
	border: 1px solid rgba(255, 255, 255, .12);
	margin-bottom: 16px;
	transition: border-color .15s ease, background .15s ease, transform .15s ease;
}

.cg-back:hover {
	border-color: var(--cg-accent);
	color: var(--cg-text);
	transform: translateX(-2px);
}

.cg-page-title {
	margin: 0 0 18px;
	font-size: 28px;
	line-height: 1.15;
}

.cg-gallery__title {
	margin: 0;
	font-size: 26px;
	line-height: 1.15;
}

.cg-gallery__sub {
	margin: 6px 0 0;
	color: var(--cg-muted);
	font-size: 14px;
}

/* ---------- Photo grid ---------- */
.cg-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 8px;
}

.cg-tile {
	display: block;
	aspect-ratio: 1 / 1;
	border-radius: 8px;
	overflow: hidden;
	background: #0f0f13;
	cursor: zoom-in;
}

.cg-tile img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .25s ease, opacity .25s ease;
}

.cg-tile:hover img {
	transform: scale(1.05);
}

@media (min-width: 700px) {
	.cg-grid {
		grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	}
}

/* ---------- Pagination ---------- */
.cg-pager {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 18px;
	margin-top: 34px;
}

.cg-pager__btn {
	background: var(--cg-card);
	color: var(--cg-text);
	text-decoration: none;
	padding: 10px 18px;
	border-radius: 999px;
	font-weight: 600;
	font-size: 14px;
	border: 1px solid rgba(255, 255, 255, .08);
}

.cg-pager__btn:hover {
	border-color: var(--cg-accent);
}

.cg-pager__status {
	color: var(--cg-muted);
	font-size: 14px;
}

/* ---------- Empty state ---------- */
.cg-empty {
	color: var(--cg-muted);
	text-align: center;
	padding: 48px 16px;
	font-size: 16px;
}

/* ---------- Lightbox ---------- */
#cg-lightbox {
	--cg-accent: #e7c24b;
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
}

#cg-lightbox[hidden] {
	display: none;
}

.cg-lb__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, .94);
}

.cg-lb__stage {
	position: relative;
	max-width: 96vw;
	max-height: 84vh;
	display: flex;
	align-items: center;
	justify-content: center;
	touch-action: pan-y;
}

.cg-lb__img {
	max-width: 96vw;
	max-height: 84vh;
	width: auto;
	height: auto;
	object-fit: contain;
	border-radius: 6px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .6);
	user-select: none;
	opacity: 1;
	transition: opacity .35s ease;
}

.cg-lb__img.is-loading {
	opacity: 0;
}

.cg-lb__close,
.cg-lb__nav {
	position: absolute;
	z-index: 2;
	background: rgba(20, 20, 24, .7);
	color: #fff;
	border: none;
	cursor: pointer;
	border-radius: 999px;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background .15s ease;
}

.cg-lb__close:hover,
.cg-lb__nav:hover {
	background: var(--cg-accent);
	color: #1a1407;
}

.cg-lb__close {
	top: 16px;
	right: 16px;
	width: 44px;
	height: 44px;
	font-size: 26px;
	line-height: 1;
}

.cg-lb__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 50px;
	height: 50px;
	font-size: 34px;
	line-height: 1;
}

.cg-lb__prev { left: 14px; }
.cg-lb__next { right: 14px; }

.cg-lb__bar {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px calc(16px + env(safe-area-inset-bottom));
	background: linear-gradient(to top, rgba(0, 0, 0, .8), rgba(0, 0, 0, 0));
}

.cg-lb__counter {
	color: #d9d9de;
	font-size: 14px;
	font-weight: 600;
}

.cg-lb__actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-end;
	align-items: center;
	gap: 8px;
}

.cg-lb__admin {
	display: inline-flex;
	gap: 6px;
	margin-right: 6px;
	padding-right: 8px;
	border-right: 1px solid rgba(255, 255, 255, .2);
}

.cg-lb__icon {
	padding: 9px 11px;
	font-size: 15px;
	line-height: 1;
}

.cg-lb__danger:hover {
	background: #ff5a5a;
	color: #fff;
}

.cg-lb__play.is-playing {
	background: var(--cg-accent);
	color: #1a1407;
}

/* Icons must not swallow clicks — keep the event target on the button. */
#cg-lightbox svg {
	pointer-events: none;
	display: block;
}

.cg-lb__label {
	white-space: nowrap;
}

.cg-lb__btn {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	background: rgba(255, 255, 255, .12);
	color: #fff;
	border: none;
	cursor: pointer;
	text-decoration: none;
	padding: 10px 16px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
}

.cg-lb__download {
	background: var(--cg-accent);
	color: #1a1407;
}

.cg-lb__btn:hover {
	filter: brightness(1.08);
}

/* ---------- Report modal ---------- */
.cg-report {
	position: absolute;
	inset: 0;
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.cg-report[hidden] {
	display: none;
}

.cg-report__panel {
	background: #18181d;
	color: var(--cg-text, #f3f3f5);
	border-radius: 14px;
	max-width: 420px;
	width: 100%;
	padding: 24px;
	box-shadow: 0 24px 70px rgba(0, 0, 0, .6);
	border: 1px solid rgba(255, 255, 255, .08);
}

.cg-report__panel h3 {
	margin: 0 0 8px;
	font-size: 19px;
}

.cg-report__panel p {
	margin: 0 0 14px;
	color: #a7a7b0;
	font-size: 14px;
}

.cg-report__panel textarea {
	width: 100%;
	min-height: 90px;
	border-radius: 10px;
	border: 1px solid rgba(255, 255, 255, .15);
	background: #0f0f13;
	color: #fff;
	padding: 11px 13px;
	font-size: 14px;
	font-family: inherit;
	resize: vertical;
}

.cg-report__actions {
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 16px;
}

.cg-report__actions button {
	border: none;
	cursor: pointer;
	padding: 10px 18px;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
}

.cg-report__cancel {
	background: rgba(255, 255, 255, .1);
	color: #fff;
}

.cg-report__submit {
	background: var(--cg-accent);
	color: #1a1407;
}

.cg-report__status {
	margin-top: 12px;
	font-size: 14px;
	min-height: 18px;
}

.cg-report__status.is-ok { color: #7ddc8b; }
.cg-report__status.is-err { color: #ff8d8d; }

/* Stop the page scrolling behind an open lightbox. */
body.cg-lb-open {
	overflow: hidden;
}

/* ---------- Add-to-home-screen hint ---------- */
.cg-a2hs {
	position: fixed;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	z-index: 9998;
	display: flex;
	align-items: center;
	gap: 8px;
	max-width: 90vw;
	background: #18181d;
	color: #f3f3f5;
	border: 1px solid rgba(255, 255, 255, .12);
	border-radius: 999px;
	padding: 6px 8px 6px 12px;
	box-shadow: 0 12px 34px rgba(0, 0, 0, .5);
	font-size: 13px;
	animation: cg-a2hs-in .25s ease;
}

@keyframes cg-a2hs-in {
	from { opacity: 0; transform: translate(-50%, 8px); }
	to   { opacity: 1; transform: translate(-50%, 0); }
}

.cg-a2hs[hidden] { display: none; }

.cg-a2hs__logo {
	display: inline-flex;
	align-items: center;
	color: #f3f3f5;
	cursor: pointer;
}
.cg-a2hs__logo svg { display: block; }

.cg-a2hs__open {
	background: none;
	border: none;
	color: #f3f3f5;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	cursor: pointer;
	padding: 4px 2px;
	white-space: nowrap;
}

.cg-a2hs__close {
	background: none;
	border: none;
	color: #9a9aa3;
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 6px;
}

/* Expanded "how to install" card — shown only after the chip is tapped. */
.cg-a2hs--open {
	display: block;
	border-radius: 16px;
	padding: 16px 18px;
	max-width: 300px;
	text-align: left;
}
.cg-a2hs--open .cg-a2hs__close {
	position: absolute;
	top: 8px;
	right: 10px;
}
.cg-a2hs__lead {
	margin: 0 0 8px;
	padding-right: 18px;
	font-size: 15px;
	font-weight: 700;
}
.cg-a2hs__step {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 8px 0 0;
	color: #cfcfd6;
	font-size: 13px;
}
.cg-a2hs__si {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	flex: none;
	border-radius: 8px;
	background: rgba(255, 255, 255, .08);
	color: var(--cg-accent, #e7c24b);
}

/* ---------- Mobile polish ---------- */
@media (max-width: 600px) {
	.cg-wrap {
		padding: 16px 12px 44px;
	}

	.cg-cards {
		grid-template-columns: 1fr 1fr;
		gap: 12px;
	}

	.cg-card__title {
		font-size: 14px;
	}

	.cg-browse {
		grid-template-columns: 1fr 1fr;
	}

	.cg-grid {
		gap: 6px;
	}

	.cg-gallery__title {
		font-size: 21px;
	}

	.cg-page-title {
		font-size: 22px;
	}

	/* Comfortable tap targets. */
	.cg-chip {
		padding: 10px 16px;
		min-height: 42px;
		display: inline-flex;
		align-items: center;
	}

	.cg-lb__btn {
		min-height: 44px;
		justify-content: center;
	}

	.cg-lb__close {
		top: 10px;
		right: 10px;
	}

	.cg-lb__bar {
		padding: 12px 12px calc(12px + env(safe-area-inset-bottom));
		justify-content: center;
	}

	/* Free up toolbar room on small screens. */
	.cg-lb__counter {
		display: none;
	}

	/* Center the action buttons instead of letting them bunch into the right
	   corner, and wrap them symmetrically if they don't all fit on one row. */
	.cg-lb__actions {
		width: 100%;
		justify-content: center;
		gap: 10px;
	}

	/* On phones, drop the "Play slideshow" text so it becomes a compact round
	   play button (matching the round icon buttons) — that lets Play, Download
	   and Report sit together in one tidy centered row. */
	.cg-lb__play .cg-lb__label {
		display: none;
	}
	.cg-lb__play {
		padding: 12px 14px;
	}
}
