/* F5-02 / Historias del México Encantado.
   Editorial frame approved for implementation: xolo at left, jaguar at right,
   axolotl above the author's off-text, CTA lower-left. No tlacuache.
   The whole encounter uses one viewport on desktop; mobile preserves full reading.
   SCOPED TO #mexico ONLY. Flor Negra is frozen. */

.chapter-shell-mexico{height:auto!important}
.chapter-shell-mexico>#mexico{
  --mex-padding-top:clamp(128px,16.5svh,148px);
  position:relative!important;top:auto!important;
  height:100svh!important;min-height:100svh!important;max-height:none!important;
  display:block!important;overflow:hidden!important;isolation:isolate;
  padding:var(--mex-padding-top) 0 18px!important;
  color:#191713;
  background:radial-gradient(ellipse 84% 78% at 54% 26%,#f8f3e9 0%,#f0e8db 70%,#eae2d5 100%);
}
.chapter-shell-mexico>#mexico::before,
.chapter-shell-mexico>#mexico::after{display:none!important}

.chapter-shell-mexico .mex-stage{
  width:min(1320px,calc(100% - 62px));height:100%;position:relative;
  margin-inline:auto;isolation:isolate;overflow:visible;
  font-family:BricolageGrotesque,system-ui,sans-serif;
}
.chapter-shell-mexico .mex-heading,
.chapter-shell-mexico .mex-writing,
.chapter-shell-mexico .mex-voice,
.chapter-shell-mexico .mex-end{position:absolute;margin:0;min-width:0;z-index:4}

/* Main reading axis sits between two organic side frames. */
.chapter-shell-mexico .mex-heading{top:11px;left:21%;width:72%;z-index:4}
.chapter-shell-mexico .mex-kicker{
  display:block;font:650 11px/1.4 Onest,Arial,sans-serif;
  letter-spacing:.115em;text-transform:uppercase;color:#805e43;margin:0 0 10px;
}
.chapter-shell-mexico .mex-title{
  margin:0;color:#171512;font-family:BricolageGrotesque,system-ui,sans-serif;
  font-size:clamp(57px,5.75vw,80px);font-weight:450;
  line-height:.96;letter-spacing:-.058em;text-wrap:balance;
}
.chapter-shell-mexico .mex-title span{display:block;font-size:.56em;line-height:1.05;letter-spacing:-.045em;margin-bottom:3px}
.chapter-shell-mexico .mex-title strong{display:block;font-weight:450;white-space:nowrap}
.chapter-shell-mexico .mex-writing{left:23%;top:29%;width:43%;max-width:560px;z-index:5}
.chapter-shell-mexico .mex-writing p,
.chapter-shell-mexico .mex-voice p{
  margin:0;max-width:none;color:#26221d;letter-spacing:-.012em;
  font:350 clamp(17px,1.48vw,20px)/1.43 BricolageGrotesque,system-ui,sans-serif;
  text-wrap:pretty;
}
.chapter-shell-mexico .mex-writing p+p{margin-top:17px}

/* The off-text is one continuous editorial comment, never a labelled sub-section. */
.chapter-shell-mexico .mex-voice{
  top:72%;right:2%;left:auto;width:47.6%;max-width:none;z-index:5;
}
.chapter-shell-mexico .mex-voice p{font-size:clamp(16.3px,1.34vw,18.3px);line-height:1.36;text-align:right}

.chapter-shell-mexico .mex-end{bottom:6.5%;left:24%;width:32%;z-index:8}
.chapter-shell-mexico .mex-action{display:inline-flex;position:relative;align-items:center;max-width:100%}
.chapter-shell-mexico .mex-action .me-cta{
  display:inline-flex;align-items:center;justify-content:space-between;
  border:1px solid #71431f;background:#71431f;color:#f9f2e9;border-radius:999px;
  min-height:52px;padding:13px 23px;gap:22px;
  font:600 clamp(13px,1.18vw,16px)/1.2 Onest,Arial,sans-serif;
  white-space:normal;
}
.chapter-shell-mexico .mex-action .me-cta:hover{background:#f4e9dd;color:#71431f}
.chapter-shell-mexico .mex-action .me-cta::after{content:"→";font-size:23px;line-height:.8}
.chapter-shell-mexico .me-cta-butterfly{
  position:absolute;right:-22px;top:-21px;width:50px;height:auto;
  filter:drop-shadow(0 4px 4px rgba(34,27,19,.13));pointer-events:none;
}

/* Originals on transparent backgrounds. Their scale and edges frame the copy. */
.chapter-shell-mexico .mex-creature{
  position:absolute;display:block;max-width:none;height:auto;object-fit:contain;
  pointer-events:none;user-select:none;
  filter:drop-shadow(0 7px 9px rgba(54,43,32,.12));will-change:opacity,transform;
}
.chapter-shell-mexico .mex-xolo{left:1%;top:4%;width:clamp(165px,18.5vw,240px);z-index:2}
.chapter-shell-mexico .mex-jaguar{right:1.5%;top:4%;width:clamp(175.45px,19.723vw,254.1px);z-index:2}
.chapter-shell-mexico .mex-heading .mex-ajolote{left:39%;right:auto;top:3.0px;width:clamp(52.8px,5.5vw,77px);z-index:5}

/* Preserve the existing scroll-driven butterfly and reduced-motion fallback. */
.chapter-shell-mexico .me-butterfly-flight{
  position:absolute;left:0;top:0;width:49px;height:49px;z-index:7;
  pointer-events:none;display:none;transform-origin:50% 50%;will-change:transform,opacity;
}
.chapter-shell-mexico .me-butterfly-flight img{
  display:block;width:100%;height:auto;
  filter:drop-shadow(0 4px 3px rgba(36,32,20,.14));
  animation:me-wingbeat .38s ease-in-out infinite alternate;
}
html.js:not(.reduce-motion) .chapter-shell-mexico .me-butterfly-flight{display:block}
html.js:not(.reduce-motion) .chapter-shell-mexico .me-cta-butterfly{opacity:0}

/* Laptop / compact desktop: maintain the same viewport height, adapt typography. */
@media(min-width:951px) and (max-width:1180px){
 .chapter-shell-mexico>#mexico{--mex-padding-top:clamp(128px,16svh,143px)}
 .chapter-shell-mexico .mex-stage{width:calc(100% - 46px)}
 .chapter-shell-mexico .mex-heading{left:20%;width:73%}
 .chapter-shell-mexico .mex-title{font-size:clamp(50px,5.7vw,66px)}
 .chapter-shell-mexico .mex-writing{left:22%;width:43%;top:27%}
 .chapter-shell-mexico .mex-writing p{font-size:clamp(16px,1.6vw,18px);line-height:1.38}
 .chapter-shell-mexico .mex-voice{left:auto;right:1%;top:67%;width:47.6%}
 .chapter-shell-mexico .mex-voice p{font-size:clamp(15px,1.55vw,17px);line-height:1.34}
 .chapter-shell-mexico .mex-end{left:23%;bottom:5%}
 .chapter-shell-mexico .mex-xolo{left:0;width:clamp(135px,15vw,170px);top:7%}
 .chapter-shell-mexico .mex-jaguar{right:1%;width:clamp(142.78px,15.972vw,179.08px);top:5%}
 .chapter-shell-mexico .mex-heading .mex-ajolote{left:39%;right:auto;top:10.08px;width:clamp(52.8px,5.5vw,66px)}
}

/* Tablets may use their height, but never force horizontal overflowing text. */
@media(min-width:761px) and (max-width:950px){
 .chapter-shell-mexico>#mexico{--mex-padding-top:132px;padding-bottom:18px!important}
 .chapter-shell-mexico .mex-stage{width:calc(100% - 40px)}
 .chapter-shell-mexico .mex-heading{left:19%;width:74%}
 .chapter-shell-mexico .mex-title{font-size:clamp(44px,6.2vw,57px)}
 .chapter-shell-mexico .mex-writing{left:21%;width:49%;top:26%}
 .chapter-shell-mexico .mex-writing p{font-size:16px;line-height:1.37}
 .chapter-shell-mexico .mex-writing p+p{margin-top:12px}
 .chapter-shell-mexico .mex-voice{left:auto;right:0%;width:54.6%;top:70%}
 .chapter-shell-mexico .mex-voice p{font-size:15.5px;line-height:1.32}
 .chapter-shell-mexico .mex-end{left:14%;bottom:9%;width:39%}
 .chapter-shell-mexico .mex-action .me-cta{font-size:12px;white-space:nowrap;gap:12px;padding:12px 16px}
 .chapter-shell-mexico .me-cta-butterfly{right:auto;left:-17px;top:-20px}
 .chapter-shell-mexico .mex-xolo{left:-1%;top:9%;width:clamp(115px,15vw,140px)}
 .chapter-shell-mexico .mex-jaguar{right:1%;top:5%;width:clamp(123.42px,15.73vw,150.04px)}
 .chapter-shell-mexico .mex-heading .mex-ajolote{left:40%;right:auto;top:8.82px;width:50.6px}
}

/* Mobile: the same editorial order, naturally extended where reading needs room. */
@media(max-width:760px){
 .chapter-shell-mexico>#mexico{
   --mex-padding-top:131px;height:auto!important;min-height:100svh!important;
   padding:var(--mex-padding-top) 0 42px!important;
 }
 .chapter-shell-mexico .mex-stage{
   width:calc(100% - 40px);max-width:530px;height:auto;min-height:0;
   display:flex;flex-direction:column;align-items:stretch;gap:22px;
 }
 .chapter-shell-mexico .mex-heading,.chapter-shell-mexico .mex-writing,
 .chapter-shell-mexico .mex-voice,.chapter-shell-mexico .mex-end{
   position:relative;left:auto;top:auto;bottom:auto;right:auto;width:auto;max-width:none;margin:0;
 }
 .chapter-shell-mexico .mex-heading{padding-right:56px;min-height:128px;z-index:4}
 .chapter-shell-mexico .mex-kicker{font-size:9px;letter-spacing:.10em;margin-bottom:12px;max-width:30ch}
 .chapter-shell-mexico .mex-title{font-size:clamp(38px,9.8vw,58px);line-height:.96;letter-spacing:-.05em}
 .chapter-shell-mexico .mex-title strong{white-space:normal;max-width:9.1ch}
 .chapter-shell-mexico .mex-writing{padding-left:74px;z-index:4}
 .chapter-shell-mexico .mex-writing p,.chapter-shell-mexico .mex-voice p{
   font-size:clamp(16.3px,4.3vw,18.2px);line-height:1.38;
 }
 .chapter-shell-mexico .mex-writing p+p{margin-top:12px}
 .chapter-shell-mexico .mex-voice{padding:0 6px 0 0;align-self:flex-end;width:63%;margin-top:90px;z-index:5;transform:translateX(0)}
 .chapter-shell-mexico .mex-voice p{font-size:16.5px;line-height:1.42}
 .chapter-shell-mexico .mex-end{margin-top:12px;padding-left:74px;align-self:stretch;z-index:8}
 .chapter-shell-mexico .mex-action .me-cta{font-size:12px;min-height:47px;padding:12px 15px;gap:12px}
 .chapter-shell-mexico .mex-xolo{left:-8px;top:205px;width:78px;z-index:2}
 .chapter-shell-mexico .mex-jaguar{right:-8px;top:8px;width:84.7px;z-index:2}
 .chapter-shell-mexico .mex-heading .mex-ajolote{left:43%;right:auto;top:7.98px;width:clamp(44px,13.2vw,55px);z-index:5}
 .chapter-shell-mexico .me-butterfly-flight{width:39px;height:39px}
}
@media(max-width:390px){
 .chapter-shell-mexico .mex-stage{width:calc(100% - 32px);gap:19px}
 .chapter-shell-mexico .mex-heading{padding-right:44px;min-height:124px}
 .chapter-shell-mexico .mex-title{font-size:clamp(36px,10vw,43px)}
 .chapter-shell-mexico .mex-writing{padding-left:63px}
 .chapter-shell-mexico .mex-xolo{left:-10px;top:225px;width:68px}
 .chapter-shell-mexico .mex-jaguar{right:-8px;width:75.02px}
 .chapter-shell-mexico .mex-voice{width:65.8%;padding-top:0}
 .chapter-shell-mexico .mex-heading .mex-ajolote{left:44%;right:auto;top:7.14px;width:46.2px}
 .chapter-shell-mexico .mex-end{padding-left:62px}
}
@media(prefers-reduced-motion:reduce){
 .chapter-shell-mexico .me-butterfly-flight{display:none!important}
 .chapter-shell-mexico .me-cta-butterfly{opacity:1!important}
 .chapter-shell-mexico .mex-creature{transition:none!important;will-change:auto}
}


/* F5-02 restore scroll stop: same dwell as other chapter-shell encounters. */
@media(min-width:950px) and (min-height:760px){
 .chapter-shell-mexico{height:calc(100svh + clamp(94px,16svh,160px))!important}
 .chapter-shell-mexico>#mexico{position:sticky!important;top:0!important;height:100svh!important;min-height:100svh!important}
}
