/* DD Galerías de Torneos – estilos del carrusel
   Variables configurables desde Elementor:
   --ddtg-gap, --ddtg-featured-w, --ddtg-cols
*/

.ddtg-carousel {
	position: relative;
	--ddtg-gap: 24px;
	--ddtg-featured-w: 44%;
	--ddtg-cols: 2;
}

.ddtg-carousel:focus {
	outline: none;
}

.ddtg-carousel:focus-visible {
	outline: 2px solid #17539f;
	outline-offset: 4px;
}

.ddtg-viewport {
	overflow: hidden;
}

.ddtg-track {
	display: flex;
	transition: transform 0.5s cubic-bezier(0.33, 1, 0.68, 1);
	will-change: transform;
}

.ddtg-track.is-dragging {
	transition: none;
	cursor: grabbing;
}

.ddtg-slide {
	flex: 0 0 100%;
	min-width: 100%;
	display: flex;
	gap: var(--ddtg-gap);
	align-items: stretch;
	box-sizing: border-box;
}

/* ---- Destacado ---- */

.ddtg-item--featured {
	flex: 0 0 var(--ddtg-featured-w);
	max-width: var(--ddtg-featured-w);
}

.ddtg-item--featured .ddtg-item-media {
	flex: 1 1 auto;
	min-height: 380px;
}

.ddtg-item--featured .ddtg-item-media .ddtg-img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

/* ---- Rejilla ---- */

.ddtg-grid {
	flex: 1 1 auto;
	min-width: 0;
	display: grid;
	grid-template-columns: repeat(var(--ddtg-cols), minmax(0, 1fr));
	gap: var(--ddtg-gap);
	align-content: stretch;
}

/* ---- Tarjeta ---- */

.ddtg-item {
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	text-decoration: none;
	color: inherit;
}

a.ddtg-item:hover,
a.ddtg-item:focus {
	text-decoration: none;
}

a.ddtg-item:focus-visible {
	outline: 2px solid #17539f;
	outline-offset: 2px;
}

.ddtg-item-media {
	display: block;
	position: relative;
	overflow: hidden;
	background: #e9eef5;
}

.ddtg-item--grid .ddtg-item-media {
	aspect-ratio: 4 / 3;
}

.ddtg-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.ddtg-carousel--zoom a.ddtg-item:hover .ddtg-img,
.ddtg-carousel--zoom a.ddtg-item:focus-visible .ddtg-img {
	transform: scale(1.06);
}

/* ---- Barra de título ---- */

.ddtg-bar {
	display: flex;
	align-items: center;
	gap: 0.75em;
	background: #17539f;
	padding: 10px 14px;
	line-height: 1.25;
}

.ddtg-bar-text {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 0.6em;
	row-gap: 0.1em;
	min-width: 0;
}

.ddtg-title {
	color: #fff;
	font-weight: 700;
}

.ddtg-date {
	color: #fff;
	font-weight: 700;
}

.ddtg-sep {
	align-self: stretch;
	width: 1px;
	background: rgba(255, 255, 255, 0.7);
}

.ddtg-bar-arrow {
	margin-inline-start: auto;
	display: inline-flex;
	color: #fff;
	flex: 0 0 auto;
	transition: transform 0.25s ease;
}

.ddtg-bar-arrow svg {
	width: 20px;
	height: 20px;
}

a.ddtg-item:hover .ddtg-bar-arrow {
	transform: translateX(4px);
}

/* ---- Subtítulo (franja bajo la barra) ---- */

.ddtg-sub {
	display: block;
	background: #fff;
	color: #3a3a3a;
	font-size: 0.8em;
	padding: 5px 14px;
}

/* ---- Flechas de navegación ---- */

.ddtg-nav {
	display: flex;
	gap: 12px;
}

.ddtg-carousel--nav-bottom .ddtg-nav {
	justify-content: space-between;
	margin-top: 24px;
}

.ddtg-arrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #17539f;
	color: #fff;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

.ddtg-arrow svg {
	width: 22px;
	height: 22px;
	pointer-events: none;
}

.ddtg-arrow:hover:not(:disabled) {
	transform: scale(1.06);
}

.ddtg-arrow:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.ddtg-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.ddtg-carousel--nav-overlay .ddtg-nav {
	display: contents;
}

.ddtg-carousel--nav-overlay .ddtg-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 2;
}

.ddtg-carousel--nav-overlay .ddtg-arrow--prev {
	inset-inline-start: 24px;
}

.ddtg-carousel--nav-overlay .ddtg-arrow--next {
	inset-inline-end: 24px;
}

.ddtg-carousel--nav-overlay .ddtg-arrow:hover:not(:disabled) {
	transform: translateY(-50%) scale(1.06);
}

/* ---- Accesibilidad / utilidades ---- */

.ddtg-live {
	margin: 0;
}

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

.ddtg-empty {
	padding: 24px;
	border: 1px dashed #b0b8c4;
	border-radius: 6px;
	text-align: center;
	color: #6b7280;
	font-size: 14px;
}

/* ---- Responsive ---- */

@media (max-width: 767px) {
	.ddtg-slide {
		flex-direction: column;
	}

	.ddtg-item--featured {
		flex-basis: auto;
		max-width: 100%;
	}

	.ddtg-item--featured .ddtg-item-media {
		min-height: 240px;
	}
}

/* ---- Movimiento reducido ---- */

@media (prefers-reduced-motion: reduce) {
	.ddtg-track,
	.ddtg-img,
	.ddtg-arrow,
	.ddtg-bar-arrow {
		transition: none !important;
	}
}
