/* ==========================================================================
   Trabajos: portada en video, contador de fotos y mini galería (lightbox)
   ========================================================================== */

.section-cases .case-item[data-gallery] { cursor: pointer; }

.section-cases .case-item[data-gallery]:focus-visible {
	outline: 3px solid #3728fd;
	outline-offset: 3px;
}

.section-cases .case-item .case-video {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.6s ease;
}

.section-cases .case-item:hover .case-video { transform: scale(1.08); }

/* Cantidad de fotos/videos del trabajo */
.section-cases .case-count {
	position: absolute;
	top: 14px;
	right: 14px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border-radius: 50px;
	background: rgba(0, 0, 0, 0.55);
	color: #ffffff;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 1px;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.section-cases .case-count::before {
	content: '';
	width: 12px;
	height: 12px;
	border: 1.5px solid currentColor;
	border-radius: 2px;
	box-shadow: 2px -2px 0 -0.5px rgba(0, 0, 0, 0.55), 2px -2px 0 1px currentColor;
}

.section-cases .case-item:hover .case-count { opacity: 1; }

@media (max-width: 600px) {
	.section-cases .case-count { opacity: 1; }
}

/* ---------- Lightbox ---------- */
.rm-lightbox {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.94);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

.rm-lightbox.is-open {
	opacity: 1;
	visibility: visible;
}

.rm-lightbox__stage {
	position: relative;
	width: min(92vw, 1400px);
	height: min(80vh, 900px);
	display: flex;
	align-items: center;
	justify-content: center;
}

.rm-lightbox__stage img,
.rm-lightbox__stage video {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	border-radius: 12px;
	display: block;
	animation: rmLbIn 0.35s ease;
}

@keyframes rmLbIn {
	from { opacity: 0; transform: scale(0.97); }
	to { opacity: 1; transform: scale(1); }
}

.rm-lightbox__caption {
	position: absolute;
	left: 50%;
	bottom: 24px;
	transform: translateX(-50%);
	color: rgba(255, 255, 255, 0.8);
	font-family: "DM Sans", Sans-serif;
	font-size: 14px;
	letter-spacing: 1px;
	text-align: center;
	white-space: nowrap;
}

.rm-lightbox__caption strong { color: #ffffff; font-weight: 700; }

.rm-lightbox button.rm-lightbox__btn {
	position: absolute;
	z-index: 2;
	width: 50px;
	height: 50px;
	padding: 0;
	border: 1px solid rgba(255, 255, 255, 0.3);
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.4);
	color: #ffffff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.rm-lightbox button.rm-lightbox__btn:hover,
.rm-lightbox button.rm-lightbox__btn:focus-visible {
	background: #e8398a;
	border-color: #e8398a;
	color: #ffffff;
}

.rm-lightbox button.rm-lightbox__btn svg {
	width: 20px;
	height: 20px;
	stroke: currentColor;
	stroke-width: 2;
	fill: none;
}

.rm-lightbox__close { top: 24px; right: 24px; }
.rm-lightbox__prev { left: 24px; top: 50%; transform: translateY(-50%); }
.rm-lightbox__next { right: 24px; top: 50%; transform: translateY(-50%); }

.rm-lightbox.is-single .rm-lightbox__prev,
.rm-lightbox.is-single .rm-lightbox__next { display: none; }

@media (max-width: 768px) {
	.rm-lightbox__stage { width: 100vw; height: 70vh; }
	.rm-lightbox__stage img,
	.rm-lightbox__stage video { border-radius: 0; }
	.rm-lightbox__prev { left: 10px; top: auto; bottom: 70px; transform: none; }
	.rm-lightbox__next { right: 10px; top: auto; bottom: 70px; transform: none; }
	.rm-lightbox__close { top: 14px; right: 14px; }
	.rm-lightbox__caption { white-space: normal; width: 70%; }
}

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

/* ---------- Work filtrado por servicio ---------- */
.section-cases .rm-filter {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px 20px;
	margin-top: 10px;
}

.section-cases .rm-filter__name {
	font-size: clamp(24px, 3vw, 34px);
	font-weight: 800;
	color: #1a1a1a;
	margin: 0;
}

.rooming-kit .section-cases .rm-filter__all {
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	color: #3728fd;
}

.section-cases .rm-empty {
	color: #666;
	font-size: 16px;
}

.section-cases .section-header--filtered { flex-direction: column; align-items: flex-start; gap: 0; }
.section-cases .section-header--filtered .rm-filter { margin-top: 0; }

/* ---------- Tarjetas de trabajo como link a su página ---------- */
.rooming-kit .section-cases a.case-item {
	display: block;
	color: inherit;
	text-decoration: none;
}

.section-cases a.case-item:focus-visible {
	outline: 3px solid #3728fd;
	outline-offset: 3px;
}

.rooming-kit .section-cases .case-more {
	position: absolute;
	right: clamp(16px, 2.4vw, 26px);
	bottom: clamp(18px, 2.6vw, 28px);
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 16px;
	border-radius: 50px;
	background: #ffffff;
	color: #1a1a1a;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 1px;
	text-transform: uppercase;
	opacity: 0;
	transform: translateY(10px);
	transition: opacity 0.35s ease, transform 0.45s cubic-bezier(0.16, 1, 0.3, 1), background 0.3s ease, color 0.3s ease;
}

.section-cases .case-more svg {
	width: 14px;
	height: 14px;
	stroke: currentColor;
	stroke-width: 2;
	fill: none;
	transition: transform 0.3s ease;
}

.section-cases a.case-item:hover .case-more {
	opacity: 1;
	transform: none;
}

.section-cases a.case-item.studio:hover .case-more { background: #3728fd; color: #ffffff; }
.section-cases a.case-item.lab:hover .case-more { background: #e8398a; color: #ffffff; }
.section-cases a.case-item.printing:hover .case-more { background: #efff4a; color: #1a1a1a; }
.section-cases a.case-item:hover .case-more svg { transform: translateX(3px); }

/* En pantallas táctiles no hay hover: el botón se ve siempre */
@media (hover: none) {
	.rooming-kit .section-cases .case-more { opacity: 1; transform: none; }
}
