/* =========================================================
   Página de caso (plantilla base) — se usa junto con trabajos.css (header oscuro)
   Mismas unidades que fresca.css (1u = 1px del mockup)
   ========================================================= */
.case { background: #fff; color: #000; padding: calc(205 * var(--u)) calc(63 * var(--u)) calc(90 * var(--u)); }
.case > * { max-width: calc(1000 * var(--u)); margin-left: auto; margin-right: auto; }

.case-back { display: inline-flex; align-items: center; gap: .5em; font-size: max(13px, calc(15 * var(--u))); font-weight: 500; }
.case-back i { font-style: normal; display: inline-block; transition: transform .4s var(--ease); }
.case-back:hover i { transform: translateX(-5px); }

.case-head { margin-top: calc(40 * var(--u)); text-align: left; }
.case-eyebrow { color: #19c9c8; text-transform: uppercase; font-size: max(12px, calc(20 * var(--u))); line-height: 1.3; }
.case-title { margin-top: calc(6 * var(--u)); font-weight: 800; font-size: max(34px, calc(76 * var(--u))); line-height: 1.05; letter-spacing: -.02em; }
.case-lead { margin-top: calc(24 * var(--u)); max-width: 34em; font-size: max(15px, calc(21 * var(--u))); line-height: 1.5; }
.case-meta { margin-top: calc(34 * var(--u)); display: flex; flex-wrap: wrap; gap: calc(14 * var(--u)) calc(56 * var(--u)); padding-top: calc(22 * var(--u)); border-top: 1.5px solid #000; }
.case-meta dt { font-size: max(11px, calc(13 * var(--u))); text-transform: uppercase; letter-spacing: .1em; color: #6b6b6b; }
.case-meta dd { margin: 4px 0 0; font-weight: 600; font-size: max(14px, calc(18 * var(--u))); }

.case-cover { margin-top: calc(56 * var(--u)); border-radius: calc(27 * var(--u)); overflow: hidden; background: #eee; aspect-ratio: 16 / 9; }
.case-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

.case-block { margin-top: calc(80 * var(--u)); display: grid; grid-template-columns: 1fr 2fr; gap: calc(40 * var(--u)); align-items: start; }
.case-block h2 { font-weight: 800; font-size: max(20px, calc(32 * var(--u))); line-height: 1.2; letter-spacing: -.01em; }
.case-block p { font-size: max(15px, calc(19 * var(--u))); line-height: 1.7; }

.case-gallery { margin-top: calc(80 * var(--u)); list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: calc(26 * var(--u)); }
.case-gallery li { border-radius: calc(27 * var(--u)); overflow: hidden; background: #eee; aspect-ratio: 4 / 5; }
.case-gallery li.case-ph--wide { grid-column: 1 / -1; aspect-ratio: 16 / 9; }
.case-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }
.case-ph { background: repeating-linear-gradient(45deg, #f2f2f2, #f2f2f2 14px, #ececec 14px, #ececec 28px) !important; }

.case-results ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: calc(26 * var(--u)); }
.case-results li { border-top: 1.5px solid #000; padding-top: calc(16 * var(--u)); }
.case-results strong { display: block; font-weight: 800; font-size: max(28px, calc(52 * var(--u))); line-height: 1.05; letter-spacing: -.02em; }
.case-results span { display: block; margin-top: 6px; font-size: max(13px, calc(16 * var(--u))); }

.case-nav { margin-top: calc(100 * var(--u)); padding-top: calc(34 * var(--u)); border-top: 1.5px solid #000; display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; }
.case-nav__all { font-size: max(13px, calc(15 * var(--u))); font-weight: 500; }
.case-nav__next { text-align: right; }
.case-nav__next span { display: block; font-size: max(11px, calc(13 * var(--u))); text-transform: uppercase; letter-spacing: .1em; color: #6b6b6b; }
.case-nav__next strong { display: block; margin-top: 4px; font-weight: 800; font-size: max(22px, calc(40 * var(--u))); line-height: 1.1; letter-spacing: -.01em; }
.case-nav__next i { font-style: normal; display: inline-block; transition: transform .4s var(--ease); }
.case-nav__next:hover i { transform: translateX(6px); }
.case-nav__all:hover { text-decoration: underline; }

/* =========================================================
   MOBILE
   ========================================================= */
@media (max-width: 760px) {
  .case { padding: calc(190 * var(--u)) calc(35 * var(--u)) calc(80 * var(--u)); }
  .case-head { margin-top: calc(34 * var(--u)); }
  .case-meta { gap: 14px 32px; }
  .case-cover { margin-top: calc(40 * var(--u)); border-radius: calc(29 * var(--u)); }
  .case-block { grid-template-columns: 1fr; gap: 12px; margin-top: calc(56 * var(--u)); }
  .case-gallery { grid-template-columns: 1fr; gap: calc(26 * var(--u)); margin-top: calc(56 * var(--u)); }
  .case-gallery li { border-radius: calc(29 * var(--u)); }
  .case-results ul { grid-template-columns: 1fr; }
  .case-nav { flex-direction: column; align-items: flex-start; margin-top: calc(70 * var(--u)); }
  .case-nav__next { text-align: left; }
}

/* =========================================================
   Caso con galería (Natura y siguientes): título + video + piezas
   ========================================================= */
.case--g { padding-top: calc(205 * var(--u)); }
.case--g > * { max-width: calc(1153 * var(--u)); }
.case--g .case-back { display: flex; width: fit-content; margin-left: 0; }
@media (min-width: 761px) { .case--g .case-back { margin-left: max(0px, calc((100% - 1153 * var(--u)) / 2)); } }
.cg-title { margin-top: calc(26 * var(--u)); text-align: center; font-weight: 800; font-size: max(34px, calc(68 * var(--u))); line-height: 1.05; letter-spacing: -.02em; }
.cg-hero { margin-top: calc(34 * var(--u)); width: calc(746 * var(--u)); border: 0; border-radius: calc(27 * var(--u)); }
.case--g > .cg-hero { max-width: none; }
.cg-row { list-style: none; padding: 0; display: grid; gap: calc(26 * var(--u)); margin-top: calc(34 * var(--u)); margin-bottom: 0; }
.cg-row--3 { grid-template-columns: repeat(3, 1fr); }
.cg-row--2 { grid-template-columns: repeat(2, 1fr); }
.cg-tile { min-width: 0; }
.cv { position: relative; overflow: hidden; border-radius: calc(27 * var(--u)); background: #111; isolation: isolate; cursor: pointer; }
.cg-tile--v .cv { aspect-ratio: 9 / 16; }
.cg-tile--h .cv { aspect-ratio: 1280 / 880; }
.cv video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cv__play {
  position: absolute; left: 50%; top: 50%; width: calc(84 * var(--u)); min-width: 48px; aspect-ratio: 1; transform: translate(-50%, -50%);
  border: 0; border-radius: 50%; background: rgba(0, 0, 0, .62); color: #fff; cursor: pointer; display: grid; place-items: center; padding: 0;
  opacity: 0; transition: opacity .35s var(--ease), transform .35s var(--ease), background .35s;
}
.cv__play svg { width: 42%; fill: currentColor; margin-left: 6%; }
.cv:hover .cv__play, .cv__play:focus-visible, .cv:not(.is-playing) .cv__play { opacity: 1; }
.cv.is-playing:not(:hover) .cv__play { opacity: 0; }
.cv.is-playing .cv__play svg { display: none; }
.cv.is-playing .cv__play::before, .cv.is-playing .cv__play::after { content: ""; width: 7%; height: 32%; background: #fff; border-radius: 1px; }
.cv.is-playing .cv__play::before { margin-right: 10%; }
.cv__play:hover { background: #19c9c8; transform: translate(-50%, -50%) scale(1.08); }
.cg-img { margin: calc(34 * var(--u)) auto 0; }
.cg-img img { width: 100%; height: auto; display: block; }

@media (max-width: 760px) {
  .case--g { padding-top: calc(190 * var(--u)); }
  .cg-title { font-size: max(32px, calc(60 * var(--u))); }
  .cg-hero { width: 100%; border-radius: calc(29 * var(--u)); }
  .cv { border-radius: calc(29 * var(--u)); }
  /* las 3 piezas verticales se recorren en horizontal */
  .cg-row--3 { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: calc(22 * var(--u)); margin-left: calc(-35 * var(--u)); margin-right: calc(-35 * var(--u)); padding: 0 calc(35 * var(--u)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cg-row--3::-webkit-scrollbar { display: none; }
  .cg-row--3 .cg-tile { flex: 0 0 62%; scroll-snap-align: center; }
  .cg-row--2 { grid-template-columns: 1fr; }
  .cv__play { opacity: 1; }
}

/* fotos de vía pública: bordes redondeados */
.cg-img--wide { border-radius: calc(40 * var(--u)); overflow: hidden; }
@media (max-width: 760px) { .cg-img--wide { border-radius: calc(36 * var(--u)); } }

/* "Volver a trabajos" (arriba y al pie): turquesa al pasar el mouse */
.case-back, .case-nav__all { transition: color .3s var(--ease); }
.case-back:hover, .case-nav__all:hover { color: #19c9c8; text-decoration: none; }

/* filas de imágenes apaisadas (recetario, etc.) */
.cg-row--img .cg-tile { border-radius: calc(27 * var(--u)); overflow: hidden; background: #eee; aspect-ratio: 3 / 2; }
.cg-row--img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-hero + .cg-img, .cg-img + .cg-row, .cg-row + .cg-hero { margin-top: calc(60 * var(--u)); }
.case--g > .cg-hero ~ .cg-hero { margin-top: calc(60 * var(--u)); }
@media (max-width: 760px) {
  .cg-row--img { display: grid; grid-template-columns: 1fr; margin-left: 0; margin-right: 0; padding: 0; overflow: visible; }
  .cg-row--img .cg-tile { flex: none; }
  .cg-row--img .cg-tile { border-radius: calc(29 * var(--u)); }
}

/* filas de imágenes verticales (stories) */
.cg-tile--ph { border-radius: calc(27 * var(--u)); overflow: hidden; background: #eee; aspect-ratio: 9 / 16; }
.cg-tile--ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-row + .cg-img { margin-top: calc(60 * var(--u)); }
@media (max-width: 760px) { .cg-tile--ph { border-radius: calc(29 * var(--u)); } }

.cg-row + .cg-row { margin-top: calc(60 * var(--u)); }

/* filas de cuatro piezas (Swift) */
.cg-row--4 { grid-template-columns: repeat(4, 1fr); gap: calc(20 * var(--u)); }
@media (max-width: 760px) {
  .cg-row--4 { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; gap: calc(22 * var(--u)); margin-left: calc(-35 * var(--u)); margin-right: calc(-35 * var(--u)); padding: 0 calc(35 * var(--u)); scrollbar-width: none; -webkit-overflow-scrolling: touch; }
  .cg-row--4::-webkit-scrollbar { display: none; }
  .cg-row--4 .cg-tile { flex: 0 0 56%; scroll-snap-align: center; }
}

/* Videos de YouTube (se cargan al hacer clic: imagen + botón de play) */
.cg-yt { width: calc(746 * var(--u)); aspect-ratio: 16 / 9; margin-top: calc(60 * var(--u)); border-radius: calc(27 * var(--u)); overflow: hidden; background: #000; position: relative; isolation: isolate; }
.cg-title + .cg-yt { margin-top: calc(34 * var(--u)); }
.cg-yt + .cg-row, .cg-yt + .cg-yt { margin-top: calc(60 * var(--u)); }
.cg-yt__btn { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; padding: 0; cursor: pointer; background: #000 center / cover no-repeat; }
.cg-yt__play { position: absolute; left: 50%; top: 50%; width: calc(110 * var(--u)); min-width: 56px; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; background: #000; color: #fff; display: grid; place-items: center; transition: transform .35s var(--ease), background .35s; }
.cg-yt__play svg { width: 42%; fill: currentColor; margin-left: 6%; }
.cg-yt__btn:hover .cg-yt__play, .cg-yt__btn:focus-visible .cg-yt__play { transform: translate(-50%, -50%) scale(1.08); background: #19c9c8; }
.cg-yt iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; display: block; }
@media (max-width: 760px) { .cg-yt { width: 100%; border-radius: calc(29 * var(--u)); } }

/* Zócalo: playlist de Spotify (Raza) */
.cg-spotify {
  margin-top: calc(60 * var(--u)); display: flex; align-items: center; gap: calc(34 * var(--u));
  padding: calc(26 * var(--u)) calc(40 * var(--u)) calc(26 * var(--u)) calc(26 * var(--u));
  border-radius: calc(27 * var(--u)); color: #fff; text-align: left;
  background: linear-gradient(135deg, #e3000f 0%, #a1000c 100%);
  transition: transform .5s var(--ease), box-shadow .5s var(--ease);
}
.cg-spotify:hover { transform: translateY(-4px); box-shadow: 0 calc(18 * var(--u)) calc(40 * var(--u)) rgba(160, 0, 12, .28); }
.cg-spotify__cover { flex: none; width: calc(150 * var(--u)); height: calc(150 * var(--u)); min-width: 84px; min-height: 84px; aspect-ratio: 1; border-radius: calc(14 * var(--u)); object-fit: cover; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); }
.cg-spotify__txt { flex: 1; min-width: 0; display: block; }
.cg-spotify__eyebrow { display: block; font-size: max(11px, calc(14 * var(--u))); text-transform: uppercase; letter-spacing: .12em; opacity: .85; }
.cg-spotify__title { display: block; margin-top: 6px; font-weight: 800; font-size: max(18px, calc(36 * var(--u))); line-height: 1.12; letter-spacing: -.01em; }
.cg-spotify__desc { display: block; margin-top: 8px; font-size: max(12px, calc(16 * var(--u))); line-height: 1.45; opacity: .9; max-width: 38em; }
.cg-spotify__cta { flex: none; display: inline-flex; align-items: center; gap: .5em; background: #fff; color: #000; font-weight: 600; font-size: max(13px, calc(16 * var(--u))); padding: .8em 1.4em; border-radius: 999px; transition: background .3s, color .3s; white-space: nowrap; }
.cg-spotify__cta i { font-style: normal; display: inline-block; transition: transform .4s var(--ease); }
.cg-spotify:hover .cg-spotify__cta { background: #19c9c8; }
.cg-spotify:hover .cg-spotify__cta i { transform: translateX(5px); }
@media (max-width: 760px) {
  .cg-spotify { flex-wrap: wrap; gap: 14px 18px; padding: 18px; border-radius: calc(29 * var(--u)); margin-top: calc(48 * var(--u)); }
  .cg-spotify__cover { width: 96px; height: 96px; }
  .cg-spotify__txt { flex: 1 1 calc(100% - 120px); }
  .cg-spotify__desc { display: none; }
  .cg-spotify__cta { flex: 1 1 100%; justify-content: center; }
}

/* Dos videos de YouTube uno al lado del otro */
.cg-yt-row { display: grid; grid-template-columns: 1fr 1fr; gap: calc(26 * var(--u)); margin-top: calc(34 * var(--u)); }
.cg-yt-row .cg-yt { width: auto; margin-top: 0; }
.cg-yt-row + .cg-row { margin-top: calc(60 * var(--u)); }
@media (max-width: 760px) { .cg-yt-row { grid-template-columns: 1fr; gap: calc(26 * var(--u)); } }
.cg-yt-row .cg-yt__play { width: calc(84 * var(--u)); }

/* Video vertical de YouTube dentro de una fila de reels */
.cg-yt__btn img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.cg-tile .cg-yt, .cg-tile .cg-yt--v { width: 100%; margin-top: 0; aspect-ratio: 9 / 16; }
.cg-tile .cg-yt__play { width: calc(84 * var(--u)); min-width: 48px; }
