/* Elixira · Presentación "The World in a Cup" · estilos con alcance .ex-app (no pisan el tema) */
/* ==========================================================
   ELIXIRA · Presentación "The World in a Cup"
   Concepto de layout: un salón con proyector en penumbra; la
   superficie ES el verde Elixira (estrategia "empapada"),
   hojas cayendo en un canvas de fondo y cada slide como una
   lámina botánica con mucho aire y poco texto.
   ========================================================== */
.ex-app {
  /* --- Color (OKLCH). Paleta Elixira: #385721 / #4d8a18 / #68dd68 --- */
  --bg:          oklch(0.205 0.042 146);  /* verde bosque profundo, fondo */
  --bg-2:        oklch(0.245 0.05 143);   /* banda secundaria */
  --surface:     oklch(0.29 0.058 140);   /* paneles puntuales */
  --line:        oklch(0.43 0.06 138);    /* filetes y bordes finos */
  --ink:         oklch(0.965 0.018 120);  /* texto principal */
  --ink-2:       oklch(0.83 0.04 128);    /* texto secundario */
  --brand-dark:  oklch(0.42 0.1 133);     /* #385721 */
  --brand:       oklch(0.56 0.15 133);    /* #4d8a18 */
  --brand-light: oklch(0.82 0.19 143);    /* #68dd68, acento <10% */
  --ox-1:        oklch(0.62 0.12 95);     /* hoja algo oxidada */
  --ox-2:        oklch(0.56 0.12 62);     /* hoja oxidada */
  --ox-3:        oklch(0.42 0.08 45);     /* hoja muy oxidada */
  --ox-4:        oklch(0.32 0.05 40);     /* añejado */
  --gold:        oklch(0.82 0.11 84);     /* guiño a la edición negro y oro */

  /* --- Tipografía --- */
  --f-display: "Gloock", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --f-body: "Hanken Grotesk", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --f-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --t-hero: clamp(3rem, 2rem + 5.4vw, 6rem);
  --t-h2: clamp(2.1rem, 1.5rem + 2.8vw, 3.9rem);
  --t-h3: clamp(1.25rem, 1.05rem + 0.8vw, 1.7rem);
  --t-lead: clamp(1.12rem, 1rem + 0.55vw, 1.45rem);
  --t-body: clamp(1rem, 0.94rem + 0.3vw, 1.18rem);
  --t-small: clamp(0.82rem, 0.79rem + 0.15vw, 0.92rem);

  /* --- Movimiento --- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);   /* ease-out-quint */
  --ease-expo: cubic-bezier(0.16, 1, 0.3, 1);

  /* --- Z-index semántico --- */
  --z-canvas: 0;
  --z-content: 1;
  --z-sticky: 20;
  --z-modal: 40;
  --z-toast: 50;

  --z-app: 100000; /* por encima del tema y de la barra de administración de WP (99999) */

  color-scheme: dark;
  /* El contenedor ocupa toda la ventana, aunque el shortcode esté dentro de una página del tema */
  position: fixed; inset: 0; z-index: var(--z-app);
  background: var(--bg);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: var(--t-body);
  line-height: 1.55;
  overflow: hidden;
  text-align: left;
}

.ex-app, .ex-app *, .ex-app *::before, .ex-app *::after { box-sizing: border-box; }
/* Bloquea el scroll del tema mientras se presenta */
body.ex-presenting { overflow: hidden; }

/* ---------- Defensa frente a estilos del tema ---------- */
/* Los temas de bloques limitan el ancho del contenido (.is-layout-constrained > *):
   la presentación siempre ocupa toda la ventana. */
.ex-app,
.is-layout-constrained > .ex-app,
.entry-content > .ex-app {
  position: fixed !important; inset: 0 !important;
  width: 100vw !important; height: 100vh !important; height: 100dvh !important;
  max-width: none !important; margin: 0 !important; padding: 0 !important;
}
.ex-app [hidden] { display: none !important; }
.ex-app img { max-width: 100%; height: auto; }
.ex-app h1, .ex-app h2, .ex-app h3 { color: inherit; text-transform: none; letter-spacing: normal; padding: 0; border: 0; background: none; }
.ex-app ul, .ex-app ol, .ex-app dl, .ex-app figure, .ex-app blockquote { margin: 0; }
.ex-app button { text-transform: none; letter-spacing: normal; box-shadow: none; min-height: 0; line-height: 1.2; text-shadow: none; }
.ex-app a.ex-icon-btn { text-decoration: none; color: var(--ink); }


/* ---------- Canvas de hojas ---------- */
.ex-leaves {
  position: fixed; inset: 0; width: 100%; height: 100%;
  z-index: var(--z-canvas); pointer-events: none;
}

/* ---------- Deck y slides ---------- */
.ex-deck { position: fixed; inset: 0; z-index: var(--z-content); }
.ex-slide {
  position: absolute; inset: 0;
  overflow-y: auto; overflow-x: hidden;
  opacity: 0; visibility: hidden;
  transform: translateY(18px);
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out), visibility 0s linear .7s;
}
.ex-slide.is-active {
  opacity: 1; visibility: visible; transform: none;
  transition: opacity .7s var(--ease-out), transform .9s var(--ease-out), visibility 0s;
}
.ex-slide__inner {
  min-height: 100%;
  max-width: 1240px; margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: clamp(28px, 6vh, 72px) calc(96px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; justify-content: center;
  gap: clamp(18px, 3vh, 36px);
}
@media (min-width: 700px) {
  .ex-slide__inner { padding-left: max(48px, env(safe-area-inset-left, 0px)); padding-right: max(48px, env(safe-area-inset-right, 0px)); }
}

/* ---------- Tipografía ---------- */
.ex-app h1, .ex-app h2, .ex-app h3 { margin: 0; text-wrap: balance; font-weight: 400; }
.ex-app h1 { font-family: var(--f-display); font-size: var(--t-hero); line-height: 0.98; letter-spacing: -0.015em; }
.ex-app h2 { font-family: var(--f-display); font-size: var(--t-h2); line-height: 1.04; letter-spacing: -0.01em; }
.ex-app h3 { font-family: var(--f-body); font-weight: 600; font-size: var(--t-h3); line-height: 1.2; }
.ex-app p { margin: 0; max-width: 66ch; text-wrap: pretty; }
.ex-lead { font-size: var(--t-lead); color: var(--ink-2); max-width: 58ch; }
.ex-kicker { font-family: var(--f-mono); font-size: var(--t-small); color: var(--brand-light); letter-spacing: 0.02em; }
.ex-muted { color: var(--ink-2); }
em.ex-latin { font-style: italic; }
.ex-mono { font-family: var(--f-mono); font-variant-numeric: tabular-nums; }

/* Pregunta de conversación al pie de cada bloque */
.ex-talk {
  display: flex; gap: 14px; align-items: baseline; flex-wrap: wrap;
  padding-top: 16px; border-top: 1px solid var(--line);
  font-size: var(--t-lead); max-width: 70ch;
}
.ex-talk__label { font-family: var(--f-mono); font-size: var(--t-small); color: var(--gold); white-space: nowrap; }

/* Columnas */
.ex-split { display: grid; gap: clamp(24px, 4vw, 64px); grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) {
  .ex-split { grid-template-columns: 1.05fr 0.95fr; }
  .ex-split--wide-right { grid-template-columns: 0.85fr 1.15fr; }
}
.ex-split > * { min-width: 0; }

/* ---------- Portada ---------- */
.ex-cover { justify-content: flex-end; }
.ex-cover h1 { max-width: 11ch; }
.ex-cover__foot { display: flex; flex-wrap: wrap; gap: 8px 32px; align-items: baseline; color: var(--ink-2); }
.ex-brand { font-family: var(--f-display); font-size: 1.6rem; color: var(--ink); }
.ex-brand span { color: var(--brand-light); }


/* Logo Elixira dorado (edición negro y oro), con fondo transparente directo sobre el verde */
.ex-logo {
  margin: 0; align-self: flex-start;
  width: min(100%, clamp(260px, 32vw, 440px));
}
.ex-logo img { display: block; width: 100%; height: auto; }
.ex-slide.is-active .ex-logo { animation: ex-logo-in 1.1s var(--ease-out) .15s backwards; }
@keyframes ex-logo-in { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Ficha botánica (planta) ---------- */
.ex-varieties { display: grid; gap: 0; border-top: 1px solid var(--line); }
.ex-variety { display: grid; grid-template-columns: minmax(0, 13rem) 1fr; gap: 8px 24px; padding: 16px 0; border-bottom: 1px solid var(--line); }
.ex-variety > * { min-width: 0; }
@media (max-width: 560px) { .ex-variety { grid-template-columns: 1fr; } }
.ex-variety__name { font-family: var(--f-display); font-size: 1.35rem; line-height: 1.2; }
.ex-variety__name small { display: block; font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-2); margin-top: 4px; }
.ex-note { background: var(--surface); padding: 18px 20px; border-radius: 4px; max-width: 60ch; }
.ex-note strong { color: var(--brand-light); font-weight: 600; }

/* Condiciones de cultivo: "etiqueta de vivero" */
.ex-spec { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; border: 1px solid var(--line); }
.ex-spec__row { padding: 18px 20px; border: 1px solid var(--line); margin: -1px 0 0 -1px; display: flex; flex-direction: column; gap: 4px; }
.ex-spec__value { font-family: var(--f-mono); font-size: clamp(1.3rem, 1.1rem + 0.8vw, 1.8rem); color: var(--ink); font-variant-numeric: tabular-nums; }
.ex-spec__label { color: var(--ink-2); font-size: var(--t-small); }
.ex-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0; list-style: none; }
.ex-tags li { border: 1px solid var(--line); padding: 4px 12px; border-radius: 999px; font-size: var(--t-small); color: var(--ink-2); }

/* ---------- Shen Nung: hoja que cae al cuenco ---------- */
.ex-legend-year { font-family: var(--f-mono); color: var(--brand-light); font-size: var(--t-lead); }
.ex-bowl { width: 100%; max-width: 420px; justify-self: center; }
.ex-bowl .drop-leaf { transform-box: fill-box; transform-origin: center; }
.ex-slide.is-active .ex-bowl .drop-leaf { animation: ex-drop 3.6s var(--ease-out) .4s backwards; }
.ex-slide.is-active .ex-bowl .ripple { animation: ex-ripple 1.6s var(--ease-out) 3.2s backwards; }
@keyframes ex-drop {
  0%   { transform: translate(-120px, -260px) rotate(-70deg); opacity: 0; }
  12%  { opacity: 1; }
  35%  { transform: translate(40px, -170px) rotate(40deg); }
  60%  { transform: translate(-50px, -80px) rotate(-30deg); }
  85%  { transform: translate(10px, -8px) rotate(12deg); }
  100% { transform: none; }
}
@keyframes ex-ripple { from { opacity: .9; transform: scale(.3); } to { opacity: 0; transform: scale(1.4); } }
.ex-bowl .ripple { transform-box: fill-box; transform-origin: center; opacity: 0; }
.ex-steam path { stroke-dasharray: 6 10; animation: ex-steam 6s linear infinite; }
@keyframes ex-steam { to { stroke-dashoffset: -160; } }

/* ---------- Lu Yu: cita ---------- */
.ex-quote { font-family: var(--f-display); font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.4rem); line-height: 1.22; margin: 0; max-width: 24ch; }
.ex-quote cite { display: block; margin-top: 14px; font-family: var(--f-mono); font-style: normal; font-size: var(--t-small); color: var(--ink-2); }
.ex-facts { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.ex-facts li { display: grid; grid-template-columns: 6.5rem 1fr; gap: 16px; align-items: baseline; }
.ex-facts li > * { min-width: 0; }
.ex-facts .ex-mono { color: var(--brand-light); font-size: var(--t-small); }

/* ---------- Ruta del té y los caballos ---------- */
.ex-route { width: 100%; height: auto; }
.ex-route .route { fill: none; stroke: var(--gold); stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 0; }
.ex-slide.is-active .ex-route .route { animation: ex-draw 3.2s var(--ease-out) .3s backwards; }
@keyframes ex-draw { from { stroke-dashoffset: 900; } }
.ex-route text { fill: var(--ink); font-family: var(--f-mono); font-size: 13px; }
.ex-route .sub { fill: var(--ink-2); font-size: 11px; }

/* ---------- Beneficios ---------- */
.ex-compounds { display: grid; gap: 0; }
.ex-compound { display: grid; grid-template-columns: 4.2rem 1fr; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line); align-items: start; }
.ex-compound > * { min-width: 0; }
.ex-compound svg { width: 100%; height: auto; }
.ex-compound h3 { margin-bottom: 4px; }
.ex-myth { display: grid; gap: 10px; }
.ex-myth__tag { font-family: var(--f-mono); font-size: var(--t-small); color: var(--gold); }

/* ---------- Mapa ---------- */
.ex-map-wrap { display: grid; gap: 20px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 1000px) { .ex-map-wrap { grid-template-columns: 2.1fr 1fr; } }
.ex-map-wrap > * { min-width: 0; }
.ex-map { width: 100%; height: auto; display: block; }
.ex-map .land { fill: var(--bg-2); stroke: var(--bg); stroke-width: .5; }
.ex-map .tea { fill: var(--bg-2); stroke: var(--bg); stroke-width: .5; transition: fill .9s var(--ease-out); }
.ex-map .tea.is-past { fill: var(--brand); }
.ex-map .tea.is-now { fill: var(--brand-light); }
.ex-map .dot { fill: var(--brand-light); opacity: 0; transition: opacity .6s var(--ease-out); }
.ex-map .dot.is-past { opacity: .9; fill: var(--ink); }
.ex-map .dot.is-now { opacity: 1; fill: var(--brand-light); }
.ex-map .pulse { fill: none; stroke: var(--brand-light); stroke-width: 1.5; transform-box: fill-box; transform-origin: center; animation: ex-pulse 2.2s var(--ease-out) infinite; }
@keyframes ex-pulse { from { transform: scale(.4); opacity: 1; } to { transform: scale(2.6); opacity: 0; } }
.ex-map-caption { display: grid; gap: 8px; min-height: 9.5rem; }
.ex-map-caption__year { font-family: var(--f-mono); color: var(--brand-light); font-size: var(--t-lead); }
.ex-map-caption__country { font-family: var(--f-display); font-size: clamp(2rem, 1.5rem + 2vw, 3.2rem); line-height: 1; }
.ex-timeline { display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; list-style: none; }
.ex-timeline button {
  font: inherit; font-size: var(--t-small); color: var(--ink-2); background: transparent;
  border: 1px solid var(--line); border-radius: 999px; padding: 5px 12px; cursor: pointer;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out), border-color .3s var(--ease-out);
}
.ex-timeline button.is-past { color: var(--ink); border-color: var(--brand); }
.ex-timeline button[aria-current="true"] { background: var(--brand-light); color: var(--bg); border-color: var(--brand-light); }
.ex-timeline button span { font-family: var(--f-mono); opacity: .8; margin-right: 6px; }

/* ---------- Cosecha ---------- */
.ex-branch { width: 100%; max-width: 460px; height: auto; justify-self: center; }
.ex-branch text { fill: var(--ink); font-family: var(--f-body); font-size: 15px; }
.ex-branch .t-sub { fill: var(--ink-2); font-family: var(--f-mono); font-size: 11.5px; }
.ex-branch .bracket { stroke: var(--gold); fill: none; stroke-width: 1.5; }
.ex-branch .bracket-2 { stroke: var(--ink-2); }
.ex-pluck { display: grid; gap: 14px; }
.ex-pluck dl { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 10px 20px; }
.ex-pluck dt { font-family: var(--f-mono); color: var(--brand-light); font-size: var(--t-small); padding-top: 3px; }
.ex-pluck dd { margin: 0; min-width: 0; }

/* ---------- Proceso ---------- */
.ex-process { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.ex-process li { min-width: 0; }
.ex-process button {
  width: 100%; height: 100%; text-align: left; font: inherit; color: var(--ink-2); background: transparent; border: 0; border-bottom: 3px solid transparent;
  padding: 14px 10px 14px 0; cursor: pointer; display: grid; gap: 4px;
  transition: color .3s var(--ease-out), border-color .4s var(--ease-out);
}
.ex-process button .n { font-family: var(--f-mono); font-size: var(--t-small); }
.ex-process button .w { font-weight: 600; font-size: 1.05rem; color: inherit; }
.ex-process button[aria-current="true"] { color: var(--ink); border-bottom-color: var(--brand-light); }
.ex-process button[aria-current="true"] .n { color: var(--brand-light); }
.ex-process-detail { display: grid; gap: 10px; min-height: 9rem; }
.ex-process-detail h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.7rem, 1.3rem + 1.4vw, 2.5rem); }
.ex-process-detail .meta { font-family: var(--f-mono); font-size: var(--t-small); color: var(--gold); }
.ex-ctc { display: grid; gap: 6px 28px; grid-template-columns: 1fr; padding-top: 16px; border-top: 1px solid var(--line); }
@media (min-width: 800px) { .ex-ctc { grid-template-columns: 1fr 1fr; } }
.ex-ctc > div { min-width: 0; }

/* ---------- Tipos: escala de oxidación ---------- */
.ex-oxbar { position: relative; height: 14px; border-radius: 999px; background: linear-gradient(90deg, var(--brand-light) 0%, var(--brand) 22%, var(--ox-1) 45%, var(--ox-2) 68%, var(--ox-3) 86%, var(--ox-4) 100%); }
.ex-oxbar__marker { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; background: var(--ink); border: 4px solid var(--bg); transition: left .9s var(--ease-expo); }
.ex-oxscale { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-2); }
.ex-types { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.ex-types button {
  font: inherit; display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  background: transparent; color: var(--ink-2); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px;
  transition: background-color .3s var(--ease-out), color .3s var(--ease-out);
}
.ex-types button i { width: 18px; height: 18px; border-radius: 50% 0 50% 0; display: inline-block; background: var(--sw); }
.ex-types button[aria-current="true"] { background: var(--surface); color: var(--ink); border-color: var(--ink-2); }
.ex-type-detail { display: grid; gap: 12px; grid-template-columns: 1fr; min-height: 12rem; }
@media (min-width: 900px) { .ex-type-detail { grid-template-columns: 1.1fr 1fr; gap: 40px; } }
.ex-type-detail > * { min-width: 0; }
.ex-type-detail h3 { font-family: var(--f-display); font-weight: 400; font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.8rem); }
.ex-type-detail .path { font-family: var(--f-mono); font-size: var(--t-small); color: var(--brand-light); }
.ex-funfact { border-left: 0; background: var(--surface); padding: 16px 20px; border-radius: 4px; display: grid; gap: 6px; }
.ex-funfact b { font-family: var(--f-mono); font-weight: 500; color: var(--gold); font-size: var(--t-small); }

/* ---------- Blends: carta ---------- */
.ex-origin-steps { display: grid; grid-template-columns: 1fr; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 800px) { .ex-origin-steps { grid-template-columns: repeat(3, 1fr); } }
.ex-origin-steps > div { padding: 16px 18px 16px 0; border-bottom: 1px solid var(--line); min-width: 0; display: grid; gap: 4px; }
.ex-origin-steps .ex-mono { color: var(--brand-light); font-size: var(--t-small); }
.ex-menu { list-style: none; margin: 0; padding: 0; columns: 1; column-gap: 56px; }
@media (min-width: 820px) { .ex-menu { columns: 2; } }
.ex-menu li { break-inside: avoid; display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; padding: 12px 0; border-bottom: 1px dotted var(--line); }
.ex-menu .name { font-family: var(--f-display); font-size: 1.3rem; }
.ex-menu .origin { font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-2); text-align: right; }
.ex-menu .what { grid-column: 1 / -1; color: var(--ink-2); font-size: var(--t-small); }

/* ---------- Preparación ---------- */
.ex-brew { display: grid; gap: 28px; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 900px) { .ex-brew { grid-template-columns: auto 1fr; gap: 56px; } }
.ex-brew > * { min-width: 0; }
.ex-brew__gauges { display: flex; gap: 28px; align-items: flex-end; justify-content: center; }
.ex-thermo { width: 84px; height: auto; }
.ex-thermo .fill { fill: var(--brand-light); transition: y .9s var(--ease-expo), height .9s var(--ease-expo); }
.ex-thermo .band { fill: var(--brand-light); opacity: .2; transition: y .9s var(--ease-expo), height .9s var(--ease-expo); }
.ex-thermo text { fill: var(--ink-2); font-family: var(--f-mono); font-size: 10px; }
.ex-timer { width: 200px; height: auto; }
.ex-timer .track { fill: none; stroke: var(--surface); stroke-width: 10; }
.ex-timer .prog { fill: none; stroke: var(--brand-light); stroke-width: 10; stroke-linecap: round; transform: rotate(-90deg); transform-origin: 100px 100px; }
.ex-timer text { fill: var(--ink); font-family: var(--f-mono); text-anchor: middle; }
.ex-brew__readout { display: grid; gap: 6px; }
.ex-brew__big { font-family: var(--f-mono); font-size: clamp(1.8rem, 1.3rem + 2vw, 3rem); font-variant-numeric: tabular-nums; line-height: 1.1; }
.ex-brew__type { font-family: var(--f-display); font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.3rem); }
.ex-btns { display: flex; gap: 10px; flex-wrap: wrap; }
.ex-btn {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 999px; padding: 9px 18px;
  background: var(--brand-light); color: var(--bg); border: 1px solid var(--brand-light);
  transition: transform .2s var(--ease-out), background-color .2s var(--ease-out);
}
.ex-btn:hover { transform: translateY(-1px); }
.ex-btn--ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.ex-rules { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px 32px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.ex-rules li { padding-left: 22px; position: relative; color: var(--ink-2); min-width: 0; }
.ex-rules li::before { content: ""; position: absolute; left: 0; top: .55em; width: 9px; height: 9px; border-radius: 50% 0 50% 0; background: var(--brand); }

/* ---------- Análisis sensorial ---------- */
.ex-senses { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 0; counter-reset: s; }
@media (min-width: 760px) { .ex-senses { grid-template-columns: repeat(4, 1fr); } }
.ex-senses li { min-width: 0; padding: 18px 20px 18px 0; border-top: 1px solid var(--line); display: grid; gap: 8px; align-content: start; }
.ex-senses svg { width: 40px; height: 40px; }
.ex-senses h3 { font-family: var(--f-display); font-weight: 400; font-size: 1.8rem; }
.ex-senses p { color: var(--ink-2); font-size: var(--t-small); }
.ex-aromas { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
.ex-aromas li { padding: 6px 14px; border-radius: 999px; background: var(--surface); font-size: var(--t-small); }
.ex-aromas li b { font-weight: 600; color: var(--ink); }
.ex-aromas li span { color: var(--ink-2); }
.ex-vocab { display: grid; gap: 8px 28px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 0; }
.ex-vocab div { min-width: 0; }
.ex-vocab dt { font-family: var(--f-mono); color: var(--brand-light); font-size: var(--t-small); }
.ex-vocab dd { margin: 0; color: var(--ink-2); font-size: var(--t-small); }

/* ---------- Argentina ---------- */
.ex-arg-map { width: 100%; max-width: 480px; height: auto; justify-self: center; border-radius: 4px; background: var(--bg-2); }
.ex-arg-map .n { fill: var(--surface); stroke: var(--bg); stroke-width: 1; }
.ex-arg-map .a { fill: var(--brand-dark); stroke: var(--brand); stroke-width: 1; }
.ex-arg-map circle { fill: var(--brand-light); }
.ex-arg-map text { font-family: var(--f-mono); font-size: 11px; fill: var(--ink); }
.ex-arg-map .country { fill: var(--ink-2); font-size: 10px; letter-spacing: .08em; }
.ex-arg-map .prov { font-family: var(--f-display); font-size: 17px; fill: var(--ink); }
.ex-figures { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0; border-top: 1px solid var(--line); }
.ex-figures > div { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); min-width: 0; display: grid; gap: 2px; }
.ex-figures .v { font-family: var(--f-mono); font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem); color: var(--ink); font-variant-numeric: tabular-nums; }
.ex-figures .l { color: var(--ink-2); font-size: var(--t-small); }
.ex-history { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.ex-history li { display: grid; grid-template-columns: 4rem 1fr; gap: 14px; align-items: baseline; }
.ex-history li > * { min-width: 0; }
.ex-history .ex-mono { color: var(--gold); }
.ex-estates { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .ex-estates { grid-template-columns: 1fr 1.4fr; gap: 56px; } }
.ex-estates > * { min-width: 0; }
.ex-dir { list-style: none; margin: 0; padding: 0; }
.ex-dir li { display: grid; grid-template-columns: 1fr; gap: 2px; padding: 12px 0; border-bottom: 1px solid var(--line); }
/* Con 8 fincas, la lista pasa a dos columnas en pantallas anchas */
@media (min-width: 1100px) { .ex-dir { columns: 2; column-gap: 32px; } .ex-dir li { break-inside: avoid; } }
.ex-dir .name { font-weight: 600; }
.ex-dir .place { font-family: var(--f-mono); font-size: var(--t-small); color: var(--brand-light); }
.ex-dir .what { color: var(--ink-2); font-size: var(--t-small); }
.ex-src { font-size: 0.78rem; color: var(--ink-2); }
.ex-src a { color: var(--ink-2); }


/* ---------- Animación de exportaciones ---------- */
.ex-expo { width: min(100%, calc((100vh - 230px) * 16 / 9)); aspect-ratio: 16 / 9; max-width: 100%; margin: 0 auto; border-radius: 6px; overflow: hidden; background: #06131f; }
.ex-expo canvas { display: block; width: 100%; height: 100%; }
.ex-expo__foot { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: center; width: min(100%, calc((100vh - 230px) * 16 / 9)); margin: 0 auto; }

/* ---------- Cierre ---------- */
.ex-questions { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; counter-reset: q; }
.ex-questions li { font-size: var(--t-lead); display: grid; grid-template-columns: 2.2rem 1fr; gap: 12px; }
.ex-questions li::before { counter-increment: q; content: counter(q); font-family: var(--f-mono); color: var(--gold); font-size: var(--t-small); padding-top: .35em; }

/* ---------- Barra de control ---------- */
.ex-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: var(--z-sticky);
  display: flex; align-items: center; gap: 10px;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px calc(12px + env(safe-area-inset-bottom, 0px));
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}
.ex-bar__progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: var(--bg-2); }
.ex-bar__progress i { display: block; height: 100%; width: 0; background: var(--brand-light); transition: width .6s var(--ease-out); }
.ex-bar__count { font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-2); font-variant-numeric: tabular-nums; min-width: 5.5ch; }
.ex-bar__title { flex: 1; min-width: 0; font-size: var(--t-small); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ex-icon-btn {
  font: inherit; font-size: var(--t-small); color: var(--ink); background: var(--bg-2); border: 1px solid var(--line);
  border-radius: 999px; height: 40px; min-width: 40px; padding: 0 14px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
}
.ex-icon-btn[aria-pressed="true"] { background: var(--brand-light); color: var(--bg); border-color: var(--brand-light); }
@media (max-width: 560px) { .ex-hide-sm { display: none; } }

/* Selector de idioma EN | ES (enlaces con ?lang=) */
.ex-lang { display: inline-flex; gap: 2px; padding: 3px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg-2); }
.ex-app .ex-lang a {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--f-mono); font-size: var(--t-small); letter-spacing: .04em; line-height: 1;
  color: var(--ink-2); text-decoration: none; border-radius: 999px; height: 32px; min-width: 40px; padding: 0 10px;
  transition: background-color .25s var(--ease-out), color .25s var(--ease-out);
}
.ex-app .ex-lang a:hover { color: var(--ink); }
.ex-app .ex-lang a[aria-current="true"] { background: var(--brand-light); color: var(--bg); }
.ex-app .ex-lang a:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .ex-app .ex-lang a { transition: none; } }

/* Panel de notas del orador */
.ex-notes {
  /* Debajo de la barra de control, para que ← → sigan funcionando con las notas abiertas */
  position: fixed; left: 0; right: 0; bottom: 0; z-index: calc(var(--z-sticky) - 1);
  max-height: 46vh; overflow-y: auto;
  background: var(--surface); border-top: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 18px calc(72px + env(safe-area-inset-bottom, 0px));
  transform: translateY(100%); transition: transform .5s var(--ease-out);
}
.ex-notes.is-open { transform: none; }
.ex-notes__inner { max-width: 900px; margin: 0 auto; display: grid; gap: 10px; }
.ex-notes__head { font-family: var(--f-mono); font-size: var(--t-small); color: var(--gold); }
.ex-notes p { font-size: 1.05rem; max-width: 75ch; }

.ex-app :focus-visible { outline: 2px solid var(--brand-light); outline-offset: 3px; }
.ex-app button:focus:not(:focus-visible) { outline: none; }


/* ---------- Pantallas bajas (notebooks 768px, proyectores viejos) ---------- */
@media (max-height: 820px) and (min-width: 700px) {
  .ex-app {
    --t-hero: clamp(2.6rem, 1.8rem + 4.2vw, 4.8rem);
    --t-h2: clamp(1.8rem, 1.3rem + 2.2vw, 3rem);
    --t-lead: clamp(1.02rem, 0.95rem + 0.4vw, 1.25rem);
    --t-body: 1rem;
  }
  .ex-slide__inner { gap: 14px; padding-block: 22px 84px; }
  .ex-menu li { padding: 7px 0; }
  .ex-variety, .ex-compound { padding: 11px 0; }
  .ex-senses li { padding-block: 10px; }
  .ex-dir li { padding: 8px 0; }
  .ex-talk { padding-top: 10px; }
  .ex-timer { width: 160px; }
  .ex-thermo { width: 70px; }
}

/* ---------- Movimiento reducido ---------- */
@media (prefers-reduced-motion: reduce) {
  .ex-app *, .ex-app *::before, .ex-app *::after { animation: none !important; transition-duration: 0.01ms !important; }
  .ex-slide { transform: none; }
}


/* ---------- Videos ---------- */
/* Slide con video de fondo a pantalla completa */
.ex-slide--video { background: var(--bg); }
.ex-bgvideo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.ex-slide--video::after { content: ""; position: absolute; inset: 0; z-index: 0; pointer-events: none;
  background: linear-gradient(to top, oklch(0.16 0.04 146 / 0.92) 0%, oklch(0.16 0.04 146 / 0.45) 45%, oklch(0.16 0.04 146 / 0.1) 100%); }
.ex-slide--video .ex-slide__inner { position: relative; z-index: 1; justify-content: flex-end; }
.ex-slide--video h2 { max-width: 16ch; }
/* Video junto a la explicación de cada paso del proceso */
.ex-process-wrap { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) { .ex-process-wrap.has-media { grid-template-columns: 1fr 1fr; } }
.ex-process-wrap > * { min-width: 0; }
.ex-process-media { position: relative; aspect-ratio: 16 / 9; max-width: 100%; border-radius: 6px; overflow: hidden; background: var(--bg-2); }
.ex-process-media video { width: 100%; height: 100%; object-fit: cover; display: block; transition: opacity .45s var(--ease-out); }
.ex-media-credit { position: absolute; right: 10px; bottom: 8px; font-family: var(--f-mono); font-size: 11px; color: oklch(0.98 0 0 / 0.85); text-shadow: 0 1px 3px oklch(0 0 0 / 0.7); }
.ex-media-credit--slide { position: static; align-self: flex-start; }

/* Fragmentos de YouTube insertados (sin controles, no se pueden clickear) */
.ex-yt { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.ex-yt iframe { position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; transform: translate(-50%, -50%); border: 0; }
/* En el slide aéreo, el video cubre toda la pantalla (como object-fit: cover) */
.ex-yt--cubrir { z-index: 0; }
.ex-yt--cubrir iframe { width: max(100%, 177.78vh); height: max(100%, 56.25vw); }

/* ---------- Calendario de cosecha ---------- */
.ex-cal-scroll { overflow-x: auto; max-width: 100%; }
.ex-cal { min-width: 620px; display: grid; gap: 6px; }
.ex-cal__row { display: grid; grid-template-columns: 10.5rem 1fr; gap: 16px; align-items: center; }
.ex-cal__label { display: flex; gap: 8px; align-items: baseline; min-width: 0; white-space: nowrap; }
.ex-cal__reg { font-weight: 600; }
.ex-cal__place { font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-2); }
.ex-cal__row--home .ex-cal__reg { color: var(--gold); }
.ex-cal__months { display: grid; grid-template-columns: repeat(12, 1fr); font-family: var(--f-mono); font-size: var(--t-small); color: var(--ink-2); }
.ex-cal__months span { text-align: center; }
.ex-cal__track { position: relative; height: 18px; border-radius: 4px;
  background: repeating-linear-gradient(90deg, var(--bg-2) 0 calc(100% / 12 - 2px), transparent calc(100% / 12 - 2px) calc(100% / 12)); }
.ex-cal__track i { position: absolute; top: 0; bottom: 0; border-radius: 4px;
  left: calc((var(--a) - 1) / 12 * 100%); width: calc((var(--b) - var(--a) + 1) / 12 * 100% - 2px);
  transform-origin: left center; }
.ex-cal__season { background: var(--brand-dark); }
.ex-cal__best { background: var(--brand-light); top: 4px !important; bottom: 4px !important; }
.ex-cal__row--home .ex-cal__season { background: var(--gold); opacity: .75; }
.ex-cal__legend { display: flex; gap: 18px; font-size: var(--t-small); color: var(--ink-2); }
.ex-cal__legend span { display: inline-flex; align-items: center; gap: 8px; }
.ex-cal__legend i { position: static; display: inline-block; width: 22px; height: 10px; border-radius: 3px; }
/* Las barras crecen de izquierda a derecha al entrar al slide, una fila tras otra */
.ex-slide.is-active .ex-cal__track i { animation: ex-cal-grow .9s var(--ease-out) backwards; animation-delay: calc(var(--i, 0) * 60ms + .2s); }
.ex-cal__row { --i: 0; }
@keyframes ex-cal-grow { from { transform: scaleX(0); opacity: 0; } }
