/*!
 * WPDet Ghana Gallery – Frontend
 * Copyright (c) 2026 Detlef Beyer, medienkonzepte
 *
 * Schrift und Grundfarben kommen bewusst vom Theme; das Plugin setzt nur Struktur
 * und die Farben, bei denen Kontrast garantiert sein muss.
 */
.wpdet-gg-upload,
.wpdet-gg-gallery {
	--gg-ink: #0d141a;
	--gg-paper: #ffffff;
	--gg-muted: #4a5560;      /* 7.4:1 auf Weiß */
	--gg-line: #c9d0d6;
	--gg-accent: #0d141a;
	--gg-ok: #1d6b3a;         /* 6.6:1 auf Weiß */
	--gg-error: #a8231d;      /* 6.5:1 auf Weiß */
	--gg-radius: 6px;
}

/* ---------- Upload ---------- */

/* Component display rules (flex/grid) would otherwise override the hidden attribute. */
.wpdet-gg-upload [hidden] {
	display: none !important;
}

.wpdet-gg-upload {
	max-width: 44rem;
	color: var(--gg-ink);
}

.wpdet-gg-field {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	margin: 0 0 1.25rem;
}

.wpdet-gg-field > label {
	font-weight: 700;
}

.wpdet-gg-upload input[type="text"],
.wpdet-gg-upload input[type="file"] {
	width: 100%;
	box-sizing: border-box;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--gg-muted);
	border-radius: var(--gg-radius);
	background: var(--gg-paper);
	color: var(--gg-ink);
	font: inherit;
}

.wpdet-gg-upload input:focus-visible,
.wpdet-gg-button:focus-visible,
.wpdet-gg-queue-remove:focus-visible {
	outline: 3px solid var(--gg-ink);
	outline-offset: 2px;
}

.wpdet-gg-hint {
	font-size: 0.875em;
	color: var(--gg-muted);
}

.wpdet-gg-check {
	flex-direction: row;
	align-items: flex-start;
	gap: 0.6rem;
}

.wpdet-gg-check input {
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 0.15rem;
	flex: none;
}

.wpdet-gg-check label {
	font-weight: 400;
}

.wpdet-gg-button {
	display: inline-block;
	padding: 0.8rem 1.6rem;
	border: 0;
	border-radius: var(--gg-radius);
	background: var(--gg-accent);
	color: #ffffff;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}

.wpdet-gg-button:hover {
	background: #2b3742;
}

.wpdet-gg-button:disabled {
	opacity: 0.6;
	cursor: progress;
}

/* Honeypot: off-screen rather than display:none, which some bots detect. */
.wpdet-gg-hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.wpdet-gg-notice {
	padding: 0.8rem 1rem;
	border-left: 4px solid currentColor;
	border-radius: var(--gg-radius);
	background: #f3f5f7;
}

.wpdet-gg-notice--success { color: var(--gg-ok); }
.wpdet-gg-notice--error   { color: var(--gg-error); }

.wpdet-gg-status {
	font-weight: 700;
	min-height: 1.5em;
}

.wpdet-gg-queue {
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
	display: grid;
	gap: 0.75rem;
}

.wpdet-gg-queue-item {
	position: relative;
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: 0.85rem;
	padding: 0.75rem 2.75rem 0.75rem 0.75rem;
	border: 1px solid var(--gg-line);
	border-left: 4px solid var(--gg-line);
	border-radius: var(--gg-radius);
	background: var(--gg-paper);
}

.wpdet-gg-queue-item[data-state="uploading"],
.wpdet-gg-queue-item[data-state="preparing"] { border-left-color: var(--gg-ink); }
.wpdet-gg-queue-item[data-state="done"]      { border-left-color: var(--gg-ok); }
.wpdet-gg-queue-item[data-state="failed"]    { border-left-color: var(--gg-error); }

.wpdet-gg-queue-thumb {
	width: 5.5rem;
	aspect-ratio: 1;
	border-radius: 4px;
	background: #eef1f3;
	overflow: hidden;
}

.wpdet-gg-queue-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wpdet-gg-queue-body {
	min-width: 0;
}

.wpdet-gg-queue-body p {
	margin: 0 0 0.3rem;
}

.wpdet-gg-queue-name {
	font-weight: 700;
	overflow-wrap: anywhere;
}

.wpdet-gg-queue-caplabel {
	display: block;
	font-size: 0.875em;
	color: var(--gg-muted);
	margin-bottom: 0.2rem;
}

.wpdet-gg-queue-status {
	font-size: 0.875em;
	margin-top: 0.35rem !important;
	color: var(--gg-muted);
}

[data-state="done"] .wpdet-gg-queue-status   { color: var(--gg-ok); font-weight: 700; }
[data-state="failed"] .wpdet-gg-queue-status { color: var(--gg-error); font-weight: 700; }

.wpdet-gg-queue-remove {
	position: absolute;
	top: 0.4rem;
	right: 0.4rem;
	width: 2.25rem;
	height: 2.25rem;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--gg-ink);
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.wpdet-gg-queue-remove:hover {
	background: #eef1f3;
}

/* ---------- Galerie ---------- */

.wpdet-gg-grid {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 14rem), 1fr));
	gap: 0.6rem;
}

@media (max-width: 600px) {
	.wpdet-gg-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.4rem;
	}
}

.wpdet-gg-item {
	margin: 0;
}

.wpdet-gg-link {
	display: block;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--gg-radius);
	background: #eef1f3;
}

.wpdet-gg-link img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.35s ease;
}

.wpdet-gg-link:hover img,
.wpdet-gg-link:focus-visible img {
	transform: scale(1.04);
}

.wpdet-gg-link:focus-visible {
	outline: 3px solid var(--gg-ink);
	outline-offset: 2px;
}

.wpdet-gg-empty {
	color: var(--gg-muted, #4a5560);
}

.wpdet-gg-pages ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	padding: 0;
	margin: 1.5rem 0 0;
}

.wpdet-gg-pages .page-numbers {
	display: inline-block;
	min-width: 2.5rem;
	padding: 0.5rem 0.75rem;
	text-align: center;
	border: 1px solid var(--gg-line);
	border-radius: var(--gg-radius);
	color: var(--gg-ink);
	text-decoration: none;
}

.wpdet-gg-pages .page-numbers.current {
	background: var(--gg-ink);
	border-color: var(--gg-ink);
	color: #ffffff;
}

/* ---------- Lightbox ---------- */

.wpdet-gg-lightbox {
	width: 100vw;
	height: 100dvh;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: rgba(8, 12, 16, 0.94);
	color: #ffffff;
}

.wpdet-gg-lightbox::backdrop {
	background: rgba(8, 12, 16, 0.6);
}

.wpdet-gg-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
	animation: wpdet-gg-fade 0.2s ease-out;
}

@keyframes wpdet-gg-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

.wpdet-gg-lb-figure {
	margin: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	max-width: calc(100vw - 9rem);
	max-height: 100dvh;
}

.wpdet-gg-lb-img {
	max-width: 100%;
	max-height: calc(100dvh - 6rem);
	object-fit: contain;
	display: block;
}

.wpdet-gg-lb-caption {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem 1rem;
	padding: 0.75rem 1rem 0;
	text-align: center;
	font-size: 0.95rem;
	color: #ffffff;
}

.wpdet-gg-lb-credit,
.wpdet-gg-lb-count {
	color: #c9d0d6; /* 11:1 auf dem dunklen Grund */
}

.wpdet-gg-lb-btn {
	position: absolute;
	width: 3rem;
	height: 3rem;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.12);
	color: #ffffff;
	font-size: 2rem;
	line-height: 1;
	cursor: pointer;
}

.wpdet-gg-lb-btn:hover {
	background: rgba(255, 255, 255, 0.25);
}

.wpdet-gg-lb-btn:focus-visible {
	outline: 3px solid #ffffff;
	outline-offset: 2px;
}

.wpdet-gg-lb-prev  { left: 0.75rem;  top: 50%; transform: translateY(-50%); }
.wpdet-gg-lb-next  { right: 0.75rem; top: 50%; transform: translateY(-50%); }
.wpdet-gg-lb-close { right: 0.75rem; top: calc(0.75rem + env(safe-area-inset-top, 0px)); }

@media (max-width: 600px) {
	.wpdet-gg-lb-figure { max-width: 100vw; }
	.wpdet-gg-lb-prev,
	.wpdet-gg-lb-next { top: auto; bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px)); transform: none; }
	.wpdet-gg-lb-img { max-height: calc(100dvh - 9rem); }
}

@media (prefers-reduced-motion: reduce) {
	.wpdet-gg-link img { transition: none; }
	.wpdet-gg-lightbox[open] { animation: none; }
}

/* ---------- Hinweis über der Galerie ---------- */

.wpdet-gg-intro,
.wpdet-gg-empty {
	text-align: center;
	margin: 0 auto 1.5rem;
	max-width: 40rem;
}

/* Extra class: Elementor's ".elementor a { text-decoration: none }" has equal weight and loads later. */
.wpdet-gg-gallery .wpdet-gg-intro a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
	text-decoration-thickness: 2px;
	text-underline-offset: 3px;
}

.wpdet-gg-gallery .wpdet-gg-intro a:hover,
.wpdet-gg-gallery .wpdet-gg-intro a:focus-visible {
	text-decoration-thickness: 3px;
}

.wpdet-gg-intro a:focus-visible {
	outline: 3px solid var(--gg-ink);
	outline-offset: 2px;
	border-radius: 2px;
}

/* ---------- Gesperrte Galerie ---------- */

.wpdet-gg-locked {
	margin: 0 auto 2rem;
	max-width: 32rem;
}
