/* Section roots stay in normal flow. Only bounded inner content animates. */
.chapter-heading { position: relative; }
.chapter-cue {
  display: block;
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 56px;
  height: 1px;
  background: linear-gradient(90deg, #9b572d, #9b572d20);
  transform-origin: left center;
  pointer-events: none;
}
.esperienze--editoriale .chapter-cue { background: linear-gradient(90deg, #d9c29a, #d9c29a20); }
.chapter-motion-target { transform-origin: center center; }
.chapter-path-progress {
  position:absolute;
  left:16%;right:16%;top:46px;height:1.4px;
  background:#996b43;transform-origin:left center;
  pointer-events:none;z-index:-1;
}
.path-timeline:has(.chapter-path-progress)::before { border-color:#d5c8b5; }
@media(max-width:700px){
 .chapter-path-progress{left:42px;right:auto;top:40px;bottom:40px;width:1.4px;height:auto;transform-origin:center top}
}
@media(prefers-reduced-motion:reduce){
 .chapter-motion-target{opacity:1!important;will-change:auto!important}
}
.chapter-nav { isolation: isolate; }
.chapter-nav a { position: relative; z-index: 1; }
.chapter-nav a[aria-current="location"] { background: transparent; box-shadow: none; }
.nav-marker {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 18px;
  background: linear-gradient(145deg, #37332d, #242320);
  box-shadow: 0 3px 8px #24232018;
  pointer-events: none;
}
.nav-progress {
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: #9b572d;
  transform: scaleX(0);
  transform-origin: left center;
  pointer-events: none;
}
.nav-context {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  translate: -50% 0;
  max-width: 90%;
  padding: 5px 14px;
  border: 1px solid #d8d0c3;
  border-radius: 20px;
  background: #faf9f6;
  color: #65533e;
  font: 500 12px/1.3 Satoshi, Arial, sans-serif;
  white-space: nowrap;
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}
.chapter-nav.has-context .nav-context { opacity: 1; }
.has-chapters .skip-link { z-index: 40; }
@media (min-width: 701px) and (max-aspect-ratio: 5/4) {
  .hero { padding-bottom: 150px; }
}
@media (min-width: 701px) and (max-aspect-ratio: 5/4) and (max-height: 950px) {
  /* Short portrait windows: retain the complete photo instead of forcing
     its minimum height underneath the fixed navigation. */
  .hero-art { min-height: 0; max-height: 48svh; }
  .hero-art img { object-fit: contain; object-position: right bottom; }
}
@media (max-width: 700px), (max-height: 500px) {
  .has-chapters { scroll-padding-top: calc(90px + env(safe-area-inset-top, 0px)); }
  .chapter-cue { width: 40px; }
  .nav-marker { border-radius: 14px; }
  .nav-progress { left: 0; right: 0; bottom: 0; }
  .nav-context {
    bottom: auto;
    top: 100%;
    left: 0;
    translate: none;
    width: 100%;
    max-width: none;
    border: 0;
    border-radius: 0;
    padding: 6px 12px 16px;
    font-size: 12px;
    text-align: center;
    box-shadow: 0 8px 12px -12px #29272225;
  }
}
@media (prefers-reduced-motion: reduce) {
  .chapter-cue { transform: none !important; opacity: 1 !important; }
  .nav-context { transition: none; }
  .has-chapters { scroll-behavior: auto; }
}
/* Wide landscape phones retain the existing bottom dock. Its caption must
   stay above it, not below the bottom edge of the screen. */
@media (min-width: 701px) and (max-height: 500px) {
  .nav-context {
    top: auto;
    bottom: calc(100% + 8px);
    left: 50%;
    translate: -50% 0;
    width: max-content;
    max-width: 90%;
    border: 1px solid #d8d0c3;
    border-radius: 20px;
    padding: 5px 14px;
  }
}
