/**
 * Grupo Dupla Portfolio — filter bar, project gallery and lightbox.
 * Replicates Portafolio.tsx.
 *
 * SPECIFICITY NOTE (v1.1.0)
 * This stylesheet is enqueued before the theme and before Elementor, so it
 * loses every specificity TIE. Two upstream rules reach inside the gallery:
 *
 *   hello-elementor/reset.css   [type=button], button        -> (0,1,0)  #c36 border
 *                               [type=button]:hover, :hover  -> (0,1,1)  #c36 background
 *   elementor/frontend.min.css  .elementor img               -> (0,1,1)  height: auto
 *
 * Our buttons carry type="button", so a bare .gd-gallery__zoom (0,1,0) ties
 * with [type=button] and loses on order. Every gallery selector below is
 * therefore scoped with .gd-gallery (0,2,x) and states are declared
 * explicitly. Do not "simplify" these back to single-class selectors.
 */

:root {
	--gd-font-body: "DM Sans", system-ui, sans-serif;
	--gd-ink: #302e2e;
	--gd-muted: #808184;
	--gd-dark: #302e2e;
}

/* ---------------------------------------------------------------
   Filter bar
   --------------------------------------------------------------- */

.gd-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0;
	padding: 0;
}

.gd-filters .gd-filter {
	-webkit-appearance: none;
	appearance: none;
	width: auto;
	height: auto;
	min-height: 0;
	margin: 0;
	padding: 0.5rem 1.5rem;
	border: 1px solid transparent;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: var(--gd-muted);
	font-family: var(--gd-font-body);
	font-size: 0.75rem;
	font-weight: 500;
	font-style: normal;
	line-height: 1.2;
	letter-spacing: 0.15em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: all 0.25s;
}

.gd-filters .gd-filter:focus {
	background: transparent;
	box-shadow: none;
	outline: none;
}

.gd-filters .gd-filter:hover:not(.is-active) {
	background: transparent;
	color: var(--gd-ink);
	border-color: transparent;
}

.gd-filters .gd-filter.is-active,
.gd-filters .gd-filter.is-active:hover,
.gd-filters .gd-filter.is-active:focus {
	background: transparent;
	color: var(--gd-ink);
	border-color: var(--gd-ink);
	cursor: default;
}

.gd-filters .gd-filter:focus-visible {
	outline: 2px solid var(--gd-ink);
	outline-offset: 2px;
}

/* Sections toggled by the filter. !important beats the inline flex of Elementor containers. */
.gd-is-hidden {
	display: none !important;
}

/* ---------------------------------------------------------------
   Project gallery
   --------------------------------------------------------------- */

.gd-gallery {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	margin-bottom: 1.25rem;
	background: var(--gd-dark);
}

/* .elementor img forces height:auto and max-width:100%; both must be undone
   or any slide whose real ratio is not 4:3 leaves the dark box showing. */
.gd-gallery .gd-gallery__img {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	object-fit: cover;
	object-position: center;
	opacity: 0;
	visibility: hidden;
	transition: transform 0.7s;
}

.gd-gallery .gd-gallery__img.is-active {
	opacity: 1;
	visibility: visible;
}

.gd-gallery:hover .gd-gallery__img.is-active,
.e-loop-item:hover .gd-gallery__img.is-active {
	transform: scale(1.05);
}

.gd-gallery .gd-gallery__zoom,
.gd-gallery .gd-gallery__zoom:hover,
.gd-gallery .gd-gallery__zoom:focus,
.gd-gallery .gd-gallery__zoom:active {
	position: absolute;
	inset: 0;
	z-index: 10;
	width: 100%;
	height: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	cursor: zoom-in;
}

.gd-gallery .gd-gallery__zoom:focus-visible {
	outline: 2px solid #fff;
	outline-offset: -4px;
}

.gd-gallery .gd-gallery__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 20;
	display: grid;
	place-items: center;
	width: 2.25rem;
	height: 2.25rem;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 0;
	background: rgba(0, 0, 0, 0.35);
	box-shadow: none;
	color: #fff;
	font-family: var(--gd-font-body);
	font-size: 0.875rem;
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.25s;
}

.gd-gallery .gd-gallery__nav:hover,
.gd-gallery .gd-gallery__nav:focus {
	background: rgba(0, 0, 0, 0.7);
	border-color: rgba(255, 255, 255, 0.5);
	color: #fff;
}

.gd-gallery .gd-gallery__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.gd-gallery .gd-gallery__nav--prev {
	left: 0.75rem;
}

.gd-gallery .gd-gallery__nav--next {
	right: 0.75rem;
}

.gd-gallery .gd-gallery__counter {
	position: absolute;
	right: 0.75rem;
	bottom: 0.75rem;
	z-index: 20;
	padding: 0.25rem 0.5rem;
	background: rgba(0, 0, 0, 0.45);
	color: #fff;
	font-family: var(--gd-font-body);
	font-size: 0.75rem;
	line-height: 1.2;
	letter-spacing: 0.1em;
}

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

.gd-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
	background: rgba(0, 0, 0, 0.95);
}

.gd-lightbox[hidden] {
	display: none !important;
}

.gd-lightbox__inner {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	max-width: 72rem;
	height: 100%;
}

.gd-lightbox .gd-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	height: auto;
	margin: 0;
	border: 0;
	border-radius: 0;
	object-fit: contain;
}

.gd-lightbox .gd-lightbox__close,
.gd-lightbox .gd-lightbox__nav {
	position: absolute;
	display: grid;
	place-items: center;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.5);
	border-radius: 0;
	background: transparent;
	box-shadow: none;
	color: #fff;
	font-family: var(--gd-font-body);
	line-height: 1;
	cursor: pointer;
	transition: background-color 0.25s, color 0.25s;
}

.gd-lightbox .gd-lightbox__close:hover,
.gd-lightbox .gd-lightbox__nav:hover,
.gd-lightbox .gd-lightbox__close:focus,
.gd-lightbox .gd-lightbox__nav:focus {
	background: #fff;
	color: var(--gd-ink);
	border-color: rgba(255, 255, 255, 0.5);
}

.gd-lightbox .gd-lightbox__close:focus-visible,
.gd-lightbox .gd-lightbox__nav:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

/* A single-image gallery hides the arrows; our display:grid would show them. */
.gd-lightbox .gd-lightbox__nav[hidden] {
	display: none !important;
}

.gd-lightbox .gd-lightbox__close {
	top: 0;
	right: 0;
	width: 2.75rem;
	height: 2.75rem;
	font-size: 1.25rem;
}

.gd-lightbox .gd-lightbox__nav {
	top: 50%;
	transform: translateY(-50%);
	width: 3rem;
	height: 3rem;
	font-size: 1rem;
}

.gd-lightbox .gd-lightbox__nav--prev {
	left: 0;
}

.gd-lightbox .gd-lightbox__nav--next {
	right: 0;
}

.gd-lightbox__caption {
	position: absolute;
	bottom: 0;
	left: 0;
	margin: 0;
	color: #fff;
	font-family: var(--gd-font-body);
	font-size: 0.75rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

body.gd-lightbox-open {
	overflow: hidden;
}

@media (min-width: 768px) {
	.gd-lightbox {
		padding: 2.5rem;
	}

	.gd-lightbox .gd-lightbox__nav--prev {
		left: 1rem;
	}

	.gd-lightbox .gd-lightbox__nav--next {
		right: 1rem;
	}
}

/* ---------------------------------------------------------------------------
 * [gd_post_gallery] — mirrors ActualidadDetalle.tsx:
 * mt-16 grid grid-cols-1 md:grid-cols-2 gap-5 / w-full aspect-[4/3] object-cover
 * Selectors are qualified with the wrapper to beat `.elementor img` (0,1,1).
 * ------------------------------------------------------------------------- */
.gd-post-gallery {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--gd-pg-gap, 1.25rem);
	margin-top: var(--gd-pg-mt, 4rem);
	width: 100%;
}

.gd-post-gallery .gd-post-gallery__img {
	display: block;
	width: 100%;
	max-width: 100%;
	height: auto;
	aspect-ratio: var(--gd-pg-ratio, 4 / 3);
	object-fit: cover;
	margin: 0;
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

@media (min-width: 768px) {
	.gd-post-gallery {
		grid-template-columns: repeat(var(--gd-pg-cols, 2), minmax(0, 1fr));
	}
}

@media (prefers-reduced-motion: reduce) {
	.gd-filters .gd-filter,
	.gd-gallery .gd-gallery__img,
	.gd-gallery .gd-gallery__nav,
	.gd-lightbox .gd-lightbox__close,
	.gd-lightbox .gd-lightbox__nav {
		transition: none;
	}

	.gd-gallery:hover .gd-gallery__img.is-active,
	.e-loop-item:hover .gd-gallery__img.is-active {
		transform: none;
	}
}
