/* ==========================================================================
   Casos de éxito (se carga solo en /case-studies/)
   ========================================================================== */
:root { --gray-case: #E4E4E6; --line: #D5D5D8; }

.fa-icon { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; }

/* --- Hero ---------------------------------------------------------------- */
.case-hero { background: #000; padding-top: 110px; }
.case-hero__photo { position: relative; background: #000 var(--hero) center / cover no-repeat; }
.case-hero__photo::before { content: ""; position: absolute; inset: 0; pointer-events: none; }
.case-hero--light .case-hero__photo::before { background: linear-gradient(90deg, rgba(255,255,255,.82) 0%, rgba(255,255,255,0) 65%); }
.case-hero--dark .case-hero__photo::before { background: linear-gradient(90deg, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 65%); }
.case-hero__inner { position: relative; display: grid; grid-template-columns: 1fr 1fr; min-height: 560px; }
.case-hero__text { display: flex; flex-direction: column; justify-content: center; gap: 10px; padding-block: 40px; }
.case-hero--dark .case-hero__text { color: #fff; }
.case-hero__badge {
	align-self: end; justify-self: end; padding: 0 0 25px;
	font-family: var(--font-head); font-weight: 900; font-size: 44px; line-height: 1; color: #fff;
	text-shadow: 0 2px 12px rgba(0,0,0,.45);
}
.case-h1 { font-family: var(--font-head); font-weight: 900; font-size: var(--h1, 38px); line-height: 1.08; }
.case-h1 small { display: block; font-size: .7em; }
.case-hero__sub { font-family: var(--font-head); font-weight: 500; font-size: 19px; line-height: 1.25; }
.case-hero__sub--light { font-weight: 300; font-size: 26px; }
.case-hero__lead { font-family: var(--font-body); font-size: 17px; line-height: 1.55; margin-top: 6px; }
.case-hero--dark .case-hero__lead { font-weight: 600; }
.case-hero__panel {
	background: rgba(255,255,255,.85); padding: 30px 30px 35px; margin-top: 20px;
	display: flex; flex-direction: column; gap: 12px;
}
.case-hero__panel h2 { font-family: var(--font-head); font-weight: 900; font-size: 22px; color: var(--red); }
.case-hero__panel p { font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: #1A1A1A; }
/* Variante "panel": columna izquierda blanca translúcida a toda la altura (Delta) */
.case-hero--panel .case-hero__inner { grid-template-columns: 42% 58%; }
.case-hero--panel .case-hero__text { background: rgba(255,255,255,.9); padding: 60px 40px; gap: 18px; }

.accent { display: block; width: 45px; height: 3px; background: var(--red); margin: 6px 0; }
.accent--white { background: #fff; }

/* --- Logos + botón --------------------------------------------------------- */
.case-logos { display: flex; align-items: center; justify-content: space-between; gap: 30px; padding-block: 25px; }
.case-logos__group { display: flex; align-items: center; gap: 30px; }
.case-logos__sep { width: 2px; height: 60px; background: var(--red); flex: none; }
.case-logos__sep--gray { width: 1px; height: 50px; background: var(--line); }
.case-logos__client { height: auto; }
.case-logos__mgg { width: 170px; }
.btn-red {
	background: var(--red); color: #fff; padding: 12px 28px;
	font-family: var(--font-head); font-weight: 700; font-size: 14px; transition: background .2s;
}
.btn-red:hover { background: var(--red-dark); }

/* --- Secciones ------------------------------------------------------------ */
.case-h2 { font-family: var(--font-head); font-weight: 900; font-size: 24px; line-height: 1.25; color: var(--red); }
.case-h2--lg { font-size: 28px; }
.case-section { padding-block: 50px; }
.case-section > .case-h2 { margin-bottom: 30px; }
.case-text p { font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: #333; }
.case-text p + p { margin-top: 1em; }

/* Texto sobre gris a la izquierda + fotos / foto a la derecha */
.case-split { display: grid; grid-template-columns: 1fr 1fr; }
.case-split__text {
	background: var(--gray-case); display: flex; flex-direction: column; justify-content: center; gap: 14px;
	padding: 45px 45px 45px max(var(--gutter), calc((100vw - var(--container)) / 2));
}
.case-split__text .case-text p { font-size: 16px; }
.case-split__photos { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding-left: 6px; }
.case-split__photos img { width: 100%; height: 250px; object-fit: cover; }
.case-split__photo { min-height: 380px; background: var(--photo) center / cover no-repeat; }
.case-split--reverse .case-split__text { padding: 45px max(var(--gutter), calc((100vw - var(--container)) / 2)) 45px 50px; }

/* Grilla de tarjetas con líneas divisorias */
.case-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); }
.case-card { display: flex; flex-direction: column; gap: 14px; padding: 35px 30px 40px; border-color: var(--line); border-style: solid; border-width: 0; }
.case-card .fa-icon { font-size: 52px; color: var(--red); }
.case-card h3 { font-family: var(--font-head); font-weight: 600; font-size: 15px; line-height: 1.3; color: #1A1A1A; }
.case-card p, .case-card li { font-family: var(--font-body); font-size: 13.5px; line-height: 1.55; color: #444; }
.case-card--red { background: var(--red); }
.case-card--red h3 { font-weight: 900; font-size: 19px; color: #fff; }
.case-card--red p { color: #fff; }
.case-card--red p + p { margin-top: .9em; }
.case-grid--3 > :nth-child(3n+1), .case-grid--3 > :nth-child(3n+2) { border-right-width: 1px; }
.case-grid--3 > :nth-child(-n+3) { border-bottom-width: 1px; }
.case-grid--4 { --cols: 4; }
.case-grid--4 > :not(:last-child) { border-right-width: 1px; }
.case-grid--4 .case-card { padding: 10px 25px 15px; }

/* Columnas informativas (Mercados / Servicios / Canales…) */
.case-info { display: grid; grid-template-columns: repeat(3, 1fr); }
.case-info > div { display: flex; flex-direction: column; gap: 12px; padding: 10px 30px; border-right: 1px solid var(--line); }
.case-info > div:first-child { padding-left: 0; }
.case-info > div:last-child { border-right: 0; }
.case-info .fa-icon { font-size: 46px; color: var(--red); }
.case-info h2 { font-family: var(--font-head); font-weight: 900; font-size: 20px; color: var(--red); }
.case-info p { font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: #333; }
.case-info__logos { display: flex; align-items: center; flex-wrap: wrap; gap: 15px 20px; margin-top: 5px; }
.handles li { display: flex; align-items: center; gap: 10px; font-family: var(--font-body); font-weight: 500; font-size: 15px; padding: 5px 0; }
.handles .fa-icon { font-size: 30px; color: #9A9A9A; }

/* Franja roja de resultados / alcance (con columnas e íconos blancos) */
.case-redband { background: var(--red); color: #fff; border-bottom: 1px solid rgba(255,255,255,.45); }
.case-redband--black { background: #000; border-bottom: 0; }
.case-redband__inner { display: grid; grid-template-columns: var(--grid, 1fr 1fr); align-items: center; padding-block: 35px; }
.case-redband__col { display: flex; align-items: center; gap: 30px; padding: 0 35px; }
.case-redband__col:first-child { padding-left: 0; border-right: 1px solid rgba(255,255,255,.45); }
.case-redband__col:last-child { padding-right: 0; }
.case-redband .fa-icon { font-size: 80px; flex: none; }
.case-redband h2 { font-family: var(--font-head); font-weight: 900; font-size: 22px; margin-bottom: 10px; }
.case-redband h3 { font-family: var(--font-head); font-weight: 700; font-size: 15px; padding-bottom: 10px; margin-bottom: 12px; border-bottom: 1px solid rgba(255,255,255,.45); }
.case-redband p, .case-redband li { font-family: var(--font-body); font-size: 14.5px; line-height: 1.55; }
.case-redband ul { list-style: disc; padding-left: 18px; }
/* Franja de resultados con ícono a la izquierda y dos columnas (INGUAT) */
.case-results { display: grid; grid-template-columns: 110px 1fr; gap: 40px; align-items: center; padding-block: 40px; }
.case-results > .fa-icon { justify-self: center; }
.case-results__cols { display: grid; grid-template-columns: 1fr 1fr; }
.case-results__cols > div { padding: 0 35px; }
.case-results__cols > div:first-child { padding-left: 0; border-right: 1px solid rgba(255,255,255,.45); }
.case-results__cols > div:last-child { padding-right: 0; }

/* Tarjetas 2×2 con ícono en círculo (Delta) */
.case-quad-wrap { background: var(--gray-case); }
.case-quad { display: grid; grid-template-columns: 1fr 1fr; }
.case-quad > div { display: flex; flex-direction: column; gap: 12px; padding: 40px; }
.case-quad > div:nth-child(1) { border-right: 1px solid #CFCFD2; border-bottom: 1px solid #CFCFD2; }
.case-quad > div:nth-child(2) { border-bottom: 1px solid #CFCFD2; }
.case-quad > div:nth-child(3) { border-right: 1px solid #CFCFD2; }
.case-quad h2 { font-family: var(--font-head); font-weight: 900; font-size: 23px; color: var(--red); }
.case-quad p { font-family: var(--font-body); font-size: 15px; line-height: 1.6; color: #333; }
.case-quad .is-red { background: var(--red); }
.case-quad .is-red h2, .case-quad .is-red p { color: #fff; }
.icon-circle { width: 86px; height: 86px; border-radius: 50%; background: #fff; display: grid; place-items: center; color: var(--red); font-size: 38px; margin-bottom: 5px; }
.big-number { font-family: var(--font-head); font-weight: 900; font-size: 72px; line-height: 1; color: #fff; margin-top: 10px; }
.big-number + p { font-weight: 700 !important; font-size: 15px !important; margin-top: -4px; }
.case-quad .small { font-size: 12px; }

/* Videos de YouTube: se carga el reproductor solo al hacer clic (más rápido) */
.case-videos { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; padding-block: 40px; }
.yt { display: flex; flex-direction: column; gap: 15px; }
.yt__frame { position: relative; aspect-ratio: 16 / 9; background: #000 var(--thumb) center / cover no-repeat; border: 0; padding: 0; cursor: pointer; width: 100%; }
.yt__frame .fa-icon { position: absolute; inset: 0; margin: auto; width: 68px; height: 48px; color: #FF0000; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); transition: transform .2s; }
.yt__frame:hover .fa-icon { transform: scale(1.1); }
.yt__frame::after { content: ""; position: absolute; inset: 0; margin: auto; width: 26px; height: 26px; background: #fff; clip-path: polygon(30% 20%, 30% 80%, 80% 50%); pointer-events: none; }
.yt iframe { width: 100%; aspect-ratio: 16 / 9; border: 0; display: block; }
.yt__caption { text-align: center; font-family: var(--font-head); font-weight: 500; font-size: 15px; color: var(--red); }
.yt__caption:hover { text-decoration: underline; }

/* Ciudades + tarjeta de activación (Caribe Mexicano) */
.case-cities { display: grid; grid-template-columns: 45% 55%; gap: 40px; align-items: center; padding-block: 50px 30px; }
.case-cities__title { display: flex; align-items: center; gap: 18px; margin-bottom: 20px; }
.ring-icon { width: 58px; height: 58px; border: 2px solid var(--red); border-radius: 50%; display: grid; place-items: center; color: var(--red); font-size: 26px; flex: none; }
.case-cities p { font-family: var(--font-body); font-size: 19px; line-height: 1.6; color: #1A1A1A; }
.activation { display: grid; grid-template-columns: 56% 44%; border-radius: 10px; overflow: hidden; }
.activation__text { background: var(--red); color: #fff; padding: 30px 35px; display: flex; flex-direction: column; gap: 10px; justify-content: center; }
.activation__text .icon-circle { width: 70px; height: 70px; font-size: 30px; }
.activation__label { font-family: var(--font-head); font-size: 17px; }
.activation h3 { font-family: var(--font-head); font-weight: 900; font-size: 23px; line-height: 1.25; }
.activation p { font-family: var(--font-body); font-size: 18px; line-height: 1.5; }
.activation__photo { min-height: 300px; background: var(--photo) center / cover no-repeat; }

/* Portafolio de medios (EMBRATUR) */
.media-cards { display: grid; grid-template-columns: 1fr 1fr; }
.media-card { display: grid; grid-template-columns: 56% 44%; }
.media-card:first-child { border-right: 1px solid var(--line); padding-right: 25px; }
.media-card:last-child { padding-left: 25px; }
.media-card__text { display: flex; flex-direction: column; justify-content: center; gap: 12px; padding: 10px 20px 10px 0; }
.media-card__text .icon-circle { background: #EEE; width: 92px; height: 92px; font-size: 44px; }
.media-card h3 { font-family: var(--font-head); font-weight: 900; font-size: 20px; color: var(--red); }
.media-card p { font-family: var(--font-body); font-size: 14.5px; line-height: 1.6; color: #333; }
.media-card img { width: 100%; height: 300px; object-fit: cover; }

/* Acordeón nativo (<details>) con tablas */
.case-accordion details { background: #fff; }
.case-accordion details + details { margin-top: 18px; }
.case-accordion summary {
	list-style: none; cursor: pointer; display: flex; align-items: center; gap: 14px;
	background: #111; color: #fff; padding: 16px 22px;
	font-family: var(--font-head); font-weight: 600; font-size: 16px;
}
.case-accordion summary::-webkit-details-marker { display: none; }
.case-accordion summary .fa-icon { color: var(--red); }
.case-accordion summary .icon-minus { display: none; }
.case-accordion details[open] summary .icon-plus { display: none; }
.case-accordion details[open] summary .icon-minus { display: inline-block; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.results-table { width: 100%; min-width: 620px; border-collapse: collapse; font-family: var(--font-body); font-size: 14px; line-height: 1.5; }
.results-table th { background: var(--red); color: #fff; font-weight: 700; text-align: left; padding: 14px 18px; border-right: 1px solid rgba(255,255,255,.35); }
.results-table th:last-child { border-right: 0; }
.results-table td { color: #333; padding: 13px 18px; border-bottom: 1px solid #E2E2E5; border-right: 1px solid #E2E2E5; vertical-align: middle; }
.results-table td:last-child { border-right: 0; }
.results-table td:first-child { white-space: nowrap; }
.results-table tr:nth-child(even) td { background: #FAFAFB; }
.case-results-wrap { background: #F1F1F3; }

/* Franja final MGG */
.case-band { background: var(--red); color: #fff; }
.case-band__inner { display: flex; align-items: center; gap: 50px; padding-block: 35px; }
.case-band__logo { width: 190px; flex: none; }
.case-band__sep { width: 1px; align-self: stretch; min-height: 110px; background: rgba(255,255,255,.6); flex: none; }
.case-band h2 { font-family: var(--font-head); font-weight: 800; font-size: 16px; margin-bottom: 6px; }
.case-band p { font-family: var(--font-body); font-size: 15px; line-height: 1.6; }

/* Navegación entre casos */
.case-nav { background: #F4F4F5; border-top: 1px solid #E2E2E5; }
.case-nav__inner { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-block: 30px; }
.case-nav__side { display: flex; flex-direction: column; gap: 4px; width: 38%; }
.case-nav__side--next { align-items: flex-end; text-align: right; }
.case-nav__label { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; color: #777; }
.case-nav__name { font-family: var(--font-head); font-weight: 900; font-size: 20px; color: #1A1A1A; transition: color .2s; }
.case-nav__side:hover .case-nav__name { color: var(--red); }
.btn-outline-red {
	display: inline-flex; align-items: center; gap: 8px; border: 2px solid var(--red); color: var(--red);
	padding: 12px 24px; font-family: var(--font-head); font-weight: 700; font-size: 14px; transition: background .2s, color .2s;
}
.btn-outline-red:hover { background: var(--red); color: #fff; }

/* --- Índice de casos -------------------------------------------------------- */
.cases-top { height: 230px; background: #000 url("../img/cases/case-studies-hero.webp") center bottom / cover no-repeat; }
.cases-intro { text-align: center; padding-top: 10px; }
.cases-intro h1 { font-family: var(--font-head); font-weight: 900; font-size: 40px; line-height: 1.3; color: var(--red); }
.cases-intro p { font-family: var(--font-body); font-weight: 500; font-size: 15px; color: #555; margin-top: 6px; }
.cases-index { padding-block: 40px 60px; }
.cases-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; }
.case-tile {
	position: relative; width: calc(25% - 12px); min-height: 320px; padding: 22px 22px 20px;
	display: flex; flex-direction: column; justify-content: flex-end; gap: 6px; color: #fff;
	background: #222 var(--photo) center / cover no-repeat; overflow: hidden;
	transition: transform .25s ease, box-shadow .25s ease;
}
.case-tile::before { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0,0,0,.05) 20%, rgba(0,0,0,.82) 100%); }
.case-tile::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .3s ease; }
.case-tile > * { position: relative; text-shadow: 0 1px 3px rgba(0,0,0,.35); }
.case-tile:hover { transform: translateY(-4px); box-shadow: 0 12px 28px rgba(0,0,0,.22); }
.case-tile:hover::after { transform: scaleX(1); }
.case-tile__meta { font-family: var(--font-head); font-weight: 600; font-size: 12px; letter-spacing: 1px; text-transform: uppercase; opacity: .85; }
.case-tile h2 { font-family: var(--font-head); font-weight: 900; font-size: 21px; line-height: 1.15; }
.case-tile__tag { font-family: var(--font-body); font-size: 13.5px; opacity: .9; }
.case-tile__cta { font-family: var(--font-head); font-weight: 700; font-size: 13px; margin-top: 8px; }
.case-tile__cta .fa-icon { margin-left: 4px; transition: margin .25s; }
.case-tile:hover .case-tile__cta .fa-icon { margin-left: 10px; }

/* --- Responsive ----------------------------------------------------------- */
@media (max-width: 1024px) {
	.case-hero__inner, .case-hero--panel .case-hero__inner { grid-template-columns: 1fr 1fr; }
	.case-h1 { font-size: min(var(--h1, 38px), 32px); }
	.case-hero__badge { font-size: 30px; }
	.case-hero__text { padding-inline: 0 20px; }
	.case-logos--multi { flex-direction: column; }
	.case-split, .case-cities, .media-cards { grid-template-columns: 1fr; }
	.case-split__text, .case-split--reverse .case-split__text { padding: 40px var(--gutter); }
	.case-split__photos { padding: 6px 0 0; }
	.case-grid--3, .case-grid--4 { --cols: 2; }
	.case-grid--3 > *, .case-grid--4 > * { border-width: 0 0 1px 0 !important; }
	.media-card:first-child { border-right: 0; padding-right: 0; border-bottom: 1px solid var(--line); padding-bottom: 25px; margin-bottom: 25px; }
	.media-card:last-child { padding-left: 0; }
	.case-tile { width: calc(50% - 8px); min-height: 280px; }
}
@media (max-width: 767px) {
	.case-hero { padding-top: 100px; }
	.case-hero__photo::before { background: none !important; }
	.case-hero--light .case-hero__photo::before { background: linear-gradient(180deg, rgba(255,255,255,.85) 0%, rgba(255,255,255,.55) 55%, rgba(255,255,255,0) 85%) !important; }
	.case-hero--dark .case-hero__photo::before { background: linear-gradient(180deg, rgba(0,0,0,.6) 0%, rgba(0,0,0,.45) 70%, rgba(0,0,0,.15) 100%) !important; }
	.case-hero__inner, .case-hero--panel .case-hero__inner { grid-template-columns: 1fr; min-height: 0; }
	.case-hero--panel .case-hero__text { padding: 35px 20px; margin-inline: calc(var(--gutter) * -1); }
	.case-hero__badge { justify-self: center; padding: 50px 0 25px; font-size: 32px; }
	.case-hero__panel { padding: 25px 20px; }
	.case-logos { flex-direction: column; }
	.case-logos__group { justify-content: center; flex-wrap: wrap; gap: 16px; }
	.case-logos__mgg { width: 140px; }
	.case-grid--3, .case-grid--4, .case-info, .case-quad, .case-videos, .media-card, .activation { grid-template-columns: 1fr; }
	.case-card, .case-grid--4 .case-card { padding: 30px 0; }
	.case-info > div, .case-info > div:first-child { padding: 25px 0; border-right: 0; border-bottom: 1px solid var(--line); }
	.case-info > div:last-child { border-bottom: 0; }
	.case-quad > div { padding: 35px 25px; border-right: 0 !important; }
	.case-split__photos img { height: 150px; }
	.case-split__photo { min-height: 240px; }
	.case-redband__inner { grid-template-columns: 1fr !important; }
	.case-redband__col { flex-direction: column; align-items: flex-start; gap: 15px; padding: 25px 0 !important; border-right: 0 !important; }
	.case-redband__col:first-child { border-bottom: 1px solid rgba(255,255,255,.45); }
	.case-results { grid-template-columns: 1fr; gap: 15px; padding-block: 30px; }
	.case-results > .fa-icon { justify-self: start; font-size: 60px; }
	.case-results__cols { grid-template-columns: 1fr; }
	.case-results__cols > div { padding: 20px 0 !important; border-right: 0 !important; }
	.case-results__cols > div:first-child { border-bottom: 1px solid rgba(255,255,255,.45); }
	.case-band__inner { flex-direction: column; text-align: center; gap: 25px; }
	.case-band__sep { min-height: 1px; width: 60px; align-self: center; }
	.case-nav__inner { flex-direction: column; gap: 22px; }
	.case-nav__side, .case-nav__side--next { width: 100%; align-items: center; text-align: center; }
	.case-tile { width: 100%; min-height: 240px; }
	.cases-top { height: 170px; }
	.cases-intro h1 { font-size: 30px; }
}
