/* SERVEI · Casos Clínicos — front. Calcado a beta.servei.org:
   Montserrat · azul #05498f · rojo #b5171a · navy #141827 · radio 5px.
   Namespaced .scc-*, self-contained. */

.scc-archive,
.scc-caso,
.scc-featured {
	--scc-blue:      #05498f;
	--scc-blue-dark: #043a72;
	--scc-red:       #b5171a;
	--scc-ink:       #141827;
	--scc-gray:      #5d5d5d;
	--scc-gray-soft: #7a7a7a;
	--scc-line:      #e6e8ec;
	--scc-soft:      #f5f7fa;
	--scc-radius:    5px;
	--scc-shadow:    0 1px 3px rgba(20, 24, 39, .06), 0 6px 20px rgba(20, 24, 39, .05);
	font-family: Montserrat, -apple-system, "Segoe UI", sans-serif;
	color: var(--scc-ink);
	max-width: 1120px;
	margin-inline: auto;
	padding-inline: 1.25rem;
}

/* ---------- Banda hero (título de página, calca el page-header de beta) ---------- */
.scc-hero {
	background: linear-gradient(90deg, var(--scc-blue-dark), var(--scc-blue));
	color: #fff;
	border-radius: var(--scc-radius);
	padding: 2.1rem 2rem;
	margin: 1.75rem 0 2rem;
}
.scc-hero h1,
.scc-hero .scc-hero__kicker { margin: 0; }
.scc-hero__kicker {
	text-transform: uppercase; letter-spacing: .14em; font-size: .72rem;
	font-weight: 600; opacity: .85; margin-bottom: .35rem;
}
.scc-hero h1 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); font-weight: 600; line-height: 1.12; }

/* Motivo SERVEI: título de sección en mayúsculas con barra vertical */
.scc-sectitle {
	display: flex; align-items: center; gap: .7rem;
	text-transform: uppercase; letter-spacing: .04em;
	font-weight: 600; font-size: 1.15rem; color: var(--scc-ink); margin: 0 0 1rem;
}
.scc-sectitle::before {
	content: ""; width: 4px; height: 1.3em; border-radius: 2px; background: var(--scc-blue);
}

/* ---------- Ficha ---------- */
.scc-back {
	display: inline-flex; align-items: center; gap: .35rem; margin: 1.75rem 0 1rem;
	font-size: .85rem; font-weight: 600; color: var(--scc-blue); text-decoration: none;
}
.scc-back:hover { color: var(--scc-red); }
.scc-caso__head { margin: 1rem 0 0; }
.scc-caso__title {
	font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 600; line-height: 1.15;
	margin: 0; padding-left: .9rem; border-left: 4px solid var(--scc-red);
}
.scc-caso__meta {
	margin: 1.1rem 0 0; padding-left: .9rem; color: var(--scc-blue); font-weight: 600;
	text-transform: capitalize; font-size: 1.15rem;
}
.scc-caso__head .scc-badges { display: flex; flex-wrap: wrap; gap: .4rem; margin: 1rem 0 0; padding-left: .9rem; }
.scc-caso__head .scc-chips { margin-top: 1.1rem; padding-left: .9rem; }
.scc-caso__body { margin: 3.25rem 0 3.5rem; }
/* Texto clínico: mismo ancho que la caja del slider (940px + 10px de padding + 1px de borde). */
.scc-caso__texto {
	max-width: 940px; margin: 2.75rem auto 0; padding: 0 11px;
	font-size: 1.02rem; line-height: 1.75; color: var(--scc-ink);
}
.scc-caso__texto .scc-sectitle { margin-bottom: 1.25rem; }
.scc-caso__texto p { margin: 0 0 1.15rem; }
.scc-caso__texto > :last-child { margin-bottom: 0; }
.scc-caso__nav {
	display: flex; justify-content: space-between; gap: 1rem;
	margin: 0 0 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--scc-line);
	font-weight: 500;
}
.scc-caso__nav a { color: var(--scc-blue); text-decoration: none; }
.scc-caso__nav a:hover { color: var(--scc-red); }

/* ---------- Slider ---------- */
.scc-slider {
	position: relative; max-width: 940px; margin: 0 auto;
	background: var(--scc-soft); border: 1px solid var(--scc-line);
	border-radius: var(--scc-radius); padding: 10px; box-shadow: var(--scc-shadow);
}
.scc-slide {
	display: flex; align-items: center; justify-content: center;
	height: clamp(340px, 56vh, 560px); background: #fff; border-radius: 3px;
}
.scc-slide__img {
	max-width: 100%; max-height: 100%; width: auto; height: auto;
	display: block; border-radius: 3px;
}
.scc-slider .swiper-button-prev,
.scc-slider .swiper-button-next {
	color: #fff; background: var(--scc-blue); width: 42px; height: 42px;
	border: 0; border-radius: 50%; box-shadow: 0 2px 8px rgba(5, 73, 143, .35);
	transition: background .15s ease;
}
.scc-slider .swiper-button-prev:hover,
.scc-slider .swiper-button-next:hover { background: var(--scc-blue-dark); }
.scc-slider .swiper-button-prev::after,
.scc-slider .swiper-button-next::after { font-size: 15px; font-weight: 700; }

/* ---------- Miniaturas bajo el slider ----------
   Va con !important a propósito: el tema (Elementor) trae SU PROPIO Swiper y su
   `.swiper-slide` pisa el ancho, con lo que cada miniatura ocupaba el 100%.
   Además estiliza todos los <button>. Se fija la caja para que no dependa del tema. */
.scc-thumbs { max-width: 940px; margin: .7rem auto 0; }
.scc-thumbs .swiper-wrapper { align-items: stretch; }
.scc-thumbs .scc-thumb {
	flex: 0 0 auto !important;
	width: 96px !important; height: 64px !important;
	min-width: 0 !important; max-width: none !important; min-height: 0 !important;
	padding: 2px !important;
	/* OJO: `margin` SIN !important. Swiper aplica el `spaceBetween` como margen
	   inline; si se fuerza aquí, se lo carga y la tira se descuadra 8px por
	   diapositiva (la activa deja de quedar centrada). */
	margin: 0;
	display: block !important; appearance: none; cursor: pointer;
	background: #fff !important; box-shadow: none !important;
	border: 1px solid var(--scc-line) !important; border-radius: 4px !important;
	opacity: .5; transition: opacity .15s ease, border-color .15s ease;
}
.scc-thumbs .scc-thumb img {
	width: 100% !important; height: 100% !important;
	object-fit: contain !important; display: block !important;
}
.scc-thumbs .scc-thumb:hover { opacity: .85; }
.scc-thumbs .scc-thumb.swiper-slide-thumb-active {
	opacity: 1;
	border-color: var(--scc-blue) !important;
	box-shadow: 0 0 0 1px var(--scc-blue) !important;
}
@media (max-width: 600px) {
	.scc-thumbs .scc-thumb { width: 68px !important; height: 46px !important; }
}

/* ---------- Lightbox (PhotoSwipe) ----------
   El tema pinta TODOS los <button> (fondo rojo, bordes, tamaños), y eso deforma
   los controles de PhotoSwipe. Se neutraliza dentro de .pswp y se le devuelven
   sus medidas. El z-index sube por encima de la barra de admin de WP (99999). */
.pswp { z-index: 100000; }
.pswp__bg { background: #0d1117; }
.pswp button,
.pswp .pswp__button {
	appearance: none; background: none !important; border: 0 !important;
	border-radius: 0 !important; box-shadow: none !important;
	padding: 0 !important; margin: 0 !important; transform: none !important;
	min-width: 0 !important; min-height: 0 !important;
	font-size: inherit !important; line-height: normal !important;
	letter-spacing: normal !important; text-transform: none !important;
	color: var(--pswp-icon-color, #fff) !important;
}
.pswp .pswp__button { width: 50px !important; height: 60px !important; }
.pswp .pswp__button--arrow { width: 75px !important; height: 100px !important; }
.pswp .pswp__button:hover { opacity: 1; }

/* ---------- Vídeo (facade) ---------- */
.scc-video {
	position: relative; aspect-ratio: 16 / 9; background: var(--scc-ink) center / cover no-repeat;
	border-radius: var(--scc-radius); overflow: hidden; cursor: pointer; box-shadow: var(--scc-shadow);
}
.scc-video::after { /* velo para contraste del play */
	content: ""; position: absolute; inset: 0; background: rgba(20, 24, 39, .25);
	transition: background .2s ease;
}
.scc-video:hover::after { background: rgba(20, 24, 39, .1); }
.scc-video__iframe { width: 100%; height: 100%; border: 0; position: relative; z-index: 2; }
.scc-video__play {
	position: absolute; inset: 0; margin: auto; width: 76px; height: 76px; z-index: 3;
	border: 0; border-radius: 50%; background: var(--scc-red); cursor: pointer;
	box-shadow: 0 6px 24px rgba(181, 23, 26, .45); transition: transform .15s ease;
}
.scc-video:hover .scc-video__play { transform: scale(1.06); }
.scc-video__play::before {
	content: ""; position: absolute; inset: 0; margin: auto; width: 0; height: 0;
	border-style: solid; border-width: 13px 0 13px 21px; border-color: transparent transparent transparent #fff;
	transform: translateX(3px);
}

/* ---------- Etiquetas / badges ---------- */
.scc-chips { display: flex; flex-wrap: wrap; gap: .35rem; list-style: none; margin: .6rem 0 0; padding: 0; }
.scc-chip {
	display: inline-block; font-size: .68rem; font-weight: 500; line-height: 1.5; padding: .08rem .55rem;
	border: 1px solid var(--scc-line); border-radius: 999px; color: var(--scc-gray);
	background: var(--scc-soft); text-decoration: none; transition: all .15s ease;
}
.scc-chip:hover { border-color: var(--scc-blue); color: var(--scc-blue); }
.scc-badge {
	display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .03em;
	text-transform: uppercase; padding: .18rem .5rem; border-radius: 3px;
	background: var(--scc-red); color: #fff;
}

/* ---------- Archivo ---------- */
.scc-archive__heading {
	display: flex; align-items: center; gap: .7rem;
	font-size: clamp(1.35rem, 2.6vw, 1.85rem); font-weight: 600; color: var(--scc-ink);
	margin: 1.75rem 0 1.25rem;
}
.scc-archive__heading::before {
	content: ""; width: 4px; height: 1.1em; border-radius: 2px; background: var(--scc-blue);
}

.scc-filter { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 3rem; }
.scc-filter__btn {
	font: inherit; font-size: .8rem; font-weight: 500; padding: .32rem .85rem; cursor: pointer;
	border: 1px solid var(--scc-line); border-radius: 999px; background: #fff; color: var(--scc-ink);
	transition: all .15s ease;
}
.scc-filter__btn:hover { border-color: var(--scc-blue); color: var(--scc-blue); }
.scc-filter__btn[aria-pressed="true"] { background: var(--scc-blue); color: #fff; border-color: var(--scc-blue); }

/* Layout de 2 columnas: años (sidebar) + casos (grid 3 col) */
.scc-archive__layout { display: grid; grid-template-columns: 168px 1fr; gap: 2.25rem; align-items: start; }
.scc-years { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: .1rem; }
.scc-years__btn {
	font: inherit; font-size: .9rem; font-weight: 500; text-align: left; cursor: pointer;
	padding: .4rem .7rem; border: 0; border-left: 3px solid transparent; border-radius: 0 4px 4px 0;
	background: transparent; color: var(--scc-gray); transition: all .15s ease;
}
.scc-years__btn:hover { color: var(--scc-blue); background: var(--scc-soft); }
.scc-years__btn[aria-pressed="true"] {
	color: var(--scc-blue); border-left-color: var(--scc-blue); background: var(--scc-soft); font-weight: 600;
}

.scc-yeargroup { margin-bottom: 2.25rem; }
.scc-yeargroup.is-hidden { display: none; }
.scc-yeargroup__title {
	display: flex; align-items: center; gap: .6rem; font-size: 1.2rem; font-weight: 600;
	color: var(--scc-ink); margin: 0 0 1.1rem;
}
.scc-yeargroup__title::before {
	content: ""; width: 4px; height: 1.05em; border-radius: 2px; background: var(--scc-blue);
}

.scc-grid { display: grid; gap: 1.4rem; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; }

@media (max-width: 960px) {
	.scc-archive__layout { grid-template-columns: 1fr; gap: 1.25rem; }
	.scc-years { position: static; flex-direction: row; flex-wrap: wrap; gap: .35rem; }
	.scc-years__btn { border-left: 0; border: 1px solid var(--scc-line); border-radius: 999px; }
	.scc-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) { .scc-grid { grid-template-columns: 1fr; } }
.scc-card {
	display: flex; flex-direction: column; text-decoration: none; color: inherit; height: 100%;
	border: 1px solid var(--scc-line); border-radius: var(--scc-radius); overflow: hidden;
	background: #fff; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.scc-card:hover { transform: translateY(-3px); box-shadow: var(--scc-shadow); border-color: #cfd8e3; }
.scc-card__thumb {
	width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; flex: 0 0 auto;
	background: linear-gradient(135deg, #eef2f7, #e3e9f1);
}
.scc-card__title {
	margin: .8rem .9rem .35rem; font-weight: 600; font-size: .95rem; line-height: 1.3;
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
	overflow: hidden; height: calc(1.3em * 2);
}
.scc-card:hover .scc-card__title { color: var(--scc-blue); }
.scc-card__date { margin: .4rem .9rem 1rem; color: var(--scc-gray-soft); font-size: .8rem; text-transform: capitalize; }
.scc-card__badges { display: flex; flex-wrap: wrap; gap: .3rem; margin: 0 .9rem 1rem; }
.scc-card.is-hidden { display: none; }

/* ---------- Caso del mes (destacado) ---------- */
.scc-featured {
	margin: 2rem auto; background: #fff; border: 1px solid var(--scc-line);
	border-radius: var(--scc-radius); box-shadow: var(--scc-shadow); overflow: hidden;
}
.scc-featured__kicker {
	background: linear-gradient(90deg, var(--scc-blue-dark), var(--scc-blue)); color: #fff;
	text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; font-weight: 600;
	margin: 0; padding: .7rem 1.5rem;
}
.scc-featured__title { margin: 1.25rem 1.5rem .25rem; font-size: clamp(1.5rem, 3.5vw, 2.2rem); font-weight: 600; line-height: 1.12; }
.scc-featured__title a { color: var(--scc-ink); text-decoration: none; }
.scc-featured__title a:hover { color: var(--scc-blue); }
.scc-featured__date { margin: 0 1.5rem 1rem; color: var(--scc-blue); font-weight: 600; text-transform: capitalize; }
.scc-featured__body { padding: 0 1.5rem 1.5rem; }

@media (prefers-reduced-motion: reduce) {
	.scc-slider .swiper-wrapper { transition-duration: 0ms !important; }
	.scc-card, .scc-video__play { transition: none; }
}
