/* ============================================================
   A dois — Stories a ecrã inteiro
   Escuro para ler sobre fotografia. Movimento só em
   transform e opacity, para correr a 60fps no telemóvel.
   ============================================================ */

.story {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  padding: 0;
  margin: 0;
  border: 0;
  overflow: hidden;
  background: #191814;
  color: #fffdf9;
}
.story::backdrop { background: #191814; }
body.story-open { overflow: hidden; }

/* ---------- Barras de progresso ---------- */

.story-bars {
  position: absolute;
  z-index: 6;
  top: calc(12px + var(--safe-t));
  left: 14px;
  right: 56px;
  display: flex;
  gap: 4px;
  transition: opacity 200ms linear;
}
.story-bars i {
  flex: 1;
  height: 2.5px;
  overflow: hidden;
  background: rgba(255, 253, 249, 0.24);
  border-radius: 2px;
}
.story-bars b {
  display: block;
  height: 100%;
  background: #fffdf9;
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
}

.story-close {
  position: absolute;
  z-index: 7;
  top: calc(8px + var(--safe-t));
  right: 6px;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  color: #fffdf9;
  opacity: 0.85;
  transition: opacity 160ms linear, transform 160ms var(--ease);
}
.story-close:active { transform: scale(0.9); }
.story-close svg { width: 21px; height: 21px; }

/* Segurar: a interface recolhe, a fotografia fica ---------- */
.story.is-held .story-bars,
.story.is-held .story-close,
.story.is-held .story-copy { opacity: 0.32; }
.story.is-held .story-copy { transition: opacity 220ms linear; }

/* ---------- Fotografia de fundo ---------- */

.story-photo { position: absolute; inset: 0; z-index: 0; overflow: hidden; }
.story-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.06);
  animation: story-pan 9s ease-out both;
}
.story-photo i {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 14, 12, 0.94) 12%, rgba(15, 14, 12, 0.5) 52%, rgba(15, 14, 12, 0.62) 100%);
}
@keyframes story-pan { from { transform: scale(1.14); } to { transform: scale(1.06); } }

/* ---------- Palco ---------- */

.story-stage {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: calc(64px + var(--safe-t)) 24px calc(30px + var(--safe-b));
  pointer-events: none;
}
.story-stage.is-interactive {
  pointer-events: auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.story-artwork {
  position: relative;
  align-self: center;
  width: min(62vw, 250px);
  height: min(30vh, 190px);
  margin: auto auto 26px;
  opacity: 0.9;
}
/* Com fotografia o texto encosta em baixo; sem ela o conjunto sobe para o meio. */
.story:not(.has-photo) .story-stage { justify-content: center; }
.story:not(.has-photo) .story-copy { margin-bottom: auto; }
.story-stage.is-interactive .story-artwork { margin-top: 0; }
.story-artwork .story-art { width: 100%; height: 100%; animation: story-float 4.2s ease-in-out infinite alternate; }
@keyframes story-float { to { transform: translateY(-8px) rotate(0.7deg); } }

.story-copy { position: relative; max-width: 420px; }
.story-kicker {
  display: block;
  color: #e0b3a7;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}
.story-title {
  margin-top: 10px;
  color: #fffdf9;
  font-size: clamp(30px, 8.6vw, 44px);
  line-height: 1.02;
  letter-spacing: -0.035em;
}
.story-text {
  margin-top: 14px;
  max-width: 32ch;
  color: #ddd6cc;
  font-size: 16px;
  line-height: 1.5;
}
.story-slot:not(:empty) { margin-top: 18px; }

/* ---------- Ações ---------- */

.story-actions { display: grid; gap: 8px; margin-top: 22px; }
.story-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 100%;
  min-height: 50px;
  padding: 0 18px;
  color: #201d19;
  background: #fffdf9;
  border-radius: var(--r-pill);
  font-size: 15px;
  font-weight: 600;
  transition: transform 150ms var(--ease), opacity 150ms linear;
}
.story-btn:active { transform: scale(0.97); }
.story-btn svg { width: 19px; height: 19px; }
.story-btn.is-quiet {
  min-height: 46px;
  color: #cdc5bb;
  background: transparent;
  border: 1px solid rgba(255, 253, 249, 0.22);
  font-weight: 500;
}

/* ---------- Zonas de toque ---------- */

.story-zones { position: absolute; inset: 56px 0 0; z-index: 1; display: flex; }
.story-zones i { display: block; height: 100%; }
.story-zones [data-zone='prev'] { width: 30%; }
.story-zones [data-zone='next'] { width: 70%; }
.story-stage.is-interactive ~ .story-zones { display: none; }

/* ---------- Lista para tocar (mala, escolhas) ---------- */

.story-list { display: grid; gap: 6px; }
.story-list button {
  display: grid;
  grid-template-columns: 34px 1fr 22px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  padding: 7px 12px 7px 9px;
  color: #f6f1ea;
  text-align: left;
  background: rgba(255, 253, 249, 0.07);
  border: 1px solid rgba(255, 253, 249, 0.13);
  border-radius: 13px;
  transition: transform 170ms var(--ease), background 170ms linear, border-color 170ms linear;
}
.story-list button:active { transform: scale(0.985); }
.story-list button > i { display: grid; width: 32px; height: 32px; place-items: center; color: #dda99c; }
.story-list button > i svg { width: 30px; height: 30px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.story-list button > span { font-size: 14px; line-height: 1.3; }
.story-list button > span small { display: block; margin-top: 2px; color: #b6ada2; font-size: 12px; }
.story-list button > b {
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  color: transparent;
  border: 1px solid rgba(255, 253, 249, 0.28);
  border-radius: 50%;
}
.story-list button > b svg { width: 13px; height: 13px; }
.story-list button.is-on {
  background: rgba(196, 104, 82, 0.2);
  border-color: rgba(228, 180, 167, 0.55);
}
.story-list button.is-on > b {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  animation: story-check 260ms var(--ease);
}
@keyframes story-check { 50% { transform: scale(1.28); } }

/* ---------- Contagem e mosaico de fotos ---------- */

.story-count {
  display: block;
  margin-bottom: 4px;
  color: #fffdf9;
  font-family: var(--font-display);
  font-size: clamp(56px, 20vw, 96px);
  line-height: 0.9;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.05em;
}
.story-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 132px; overflow-y: auto; }
.story-chips span {
  padding: 6px 12px;
  color: #f2ece4;
  background: rgba(255, 253, 249, 0.11);
  border-radius: var(--r-pill);
  font-size: 12.5px;
}
.story-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 5px; }
.story-grid img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 7px; }
.story-note {
  padding: 15px 17px;
  color: #fffdf9;
  background: rgba(255, 253, 249, 0.1);
  border: 1px solid rgba(255, 253, 249, 0.16);
  border-radius: 14px;
}
.story-note p { font-family: var(--font-display); font-size: 16px; line-height: 1.45; }

/* ---------- Ilustrações ---------- */

.story-art {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #e2b0a2;
  stroke-width: 3;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.22));
}
.story-art circle:not(.pulse), .story-art .hat-top, .story-art .house { fill: rgba(196, 104, 82, 0.1); }
.story-art .wave { animation: art-wave 3.2s ease-in-out infinite alternate; transform-origin: center; }
.story-art .w2 { animation-delay: -1s; }
.story-art .w3 { animation-delay: -2s; }
.story-art .hat-rim { animation: art-hat 3s ease-in-out infinite; transform-origin: center; }
.story-art .egg { animation: art-egg 2.4s ease-in-out infinite alternate; transform-origin: bottom; }
.story-art .egg-b { animation-delay: -0.8s; }
.story-art .egg-c { animation-delay: -1.5s; }
.story-art .route-line { stroke-dasharray: 8 8; animation: art-dash 2.6s linear infinite; }
.story-art .route-car { animation: art-car 3.6s ease-in-out infinite alternate; }
.story-art .house { animation: art-house 2.6s ease-in-out infinite alternate; transform-origin: bottom; }
.story-art .h2 { animation-delay: -0.8s; }
.story-art .h3 { animation-delay: -1.6s; }
.story-art .castle-moon { animation: art-moon 3s ease-in-out infinite alternate; }
.story-art .steam { stroke-dasharray: 18 9; animation: art-steam 2.1s linear infinite; }
.story-art .s2 { animation-delay: -1s; }
.story-art .pulse { animation: art-pulse 2.2s ease-in-out infinite; transform-origin: center; }
.story-art.is-music path:first-of-type { stroke-dasharray: 12 7; animation: art-dash 2.6s linear infinite; }
.story-art.is-music circle { animation: art-note 1.5s ease-in-out infinite alternate; transform-origin: center; }
.story-art.is-music circle:nth-of-type(2) { animation-delay: -0.7s; }
.story-art.is-talk circle { animation: art-talk 1.4s ease-in-out infinite; transform-origin: center; }
.story-art.is-talk circle:nth-of-type(2) { animation-delay: 0.18s; }
.story-art.is-talk circle:nth-of-type(3) { animation-delay: 0.36s; }
.story-art.is-camera circle { animation: art-lens 2.2s ease-in-out infinite; transform-origin: center; }
.story-art.is-pin { animation: art-pin 2s ease-in-out infinite alternate; }
.story-art.is-sunrise circle, .story-art.is-sunset circle, .story-art.is-sea circle { animation: art-sun 3.2s ease-in-out infinite alternate; transform-origin: center; }

@keyframes art-wave { to { transform: translateX(8px) scaleX(0.97); } }
@keyframes art-hat { 50% { transform: rotate(-3deg) translateY(-5px); } }
@keyframes art-egg { to { transform: translateY(-9px) rotate(3deg); } }
@keyframes art-dash { to { stroke-dashoffset: -32; } }
@keyframes art-car { to { transform: translate(24px, -17px) rotate(-7deg); } }
@keyframes art-house { to { transform: translateY(-6px); } }
@keyframes art-moon { to { transform: translateY(-8px); opacity: 0.55; } }
@keyframes art-steam { to { stroke-dashoffset: -54; transform: translateY(-5px); } }
@keyframes art-note { to { transform: translateY(-8px) scale(1.05); } }
@keyframes art-talk { 0%, 55%, 100% { transform: scale(0.72); opacity: 0.35; } 25% { transform: scale(1.2); opacity: 1; } }
@keyframes art-lens { 45% { transform: scale(1); opacity: 1; } 52% { transform: scale(0.72); opacity: 0.35; } 60% { transform: scale(1.08); opacity: 1; } }
@keyframes art-pin { to { transform: translateY(-10px); } }
@keyframes art-sun { to { transform: scale(1.1); opacity: 0.75; } }
@keyframes art-pulse { 0%, 100% { transform: scale(0.85); opacity: 0.5; } 50% { transform: scale(1.15); opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .story-photo img, .story-artwork .story-art, .story-art * { animation: none !important; }
  .story-photo img { transform: none; }
}

/* ---------- Informação do sítio ---------- */
.story-dishes { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.story-dishes li {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 10px 12px;
  background: rgba(255, 253, 249, 0.08);
  border: 1px solid rgba(255, 253, 249, 0.12);
  border-radius: 12px;
}
.story-dishes b { font-family: var(--font-display); font-size: 15px; color: #fffdf9; }
.story-dishes span { color: #e0b3a7; font-size: 13px; font-variant-numeric: tabular-nums; }
.story-dishes small { grid-column: 1 / -1; color: #b6ada2; font-size: 12px; line-height: 1.4; }
.story-rows { display: grid; gap: 0; margin: 0; }
.story-rows div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 253, 249, 0.12);
}
.story-rows dt { color: #b6ada2; font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; padding-top: 2px; }
.story-rows dd { margin: 0; color: #f2ece4; font-size: 14px; line-height: 1.4; }

.story-know { display: grid; gap: 6px; margin: 0 0 14px; padding: 0; list-style: none; }
.story-know li { position: relative; padding-left: 14px; color: #f2ece4; font-size: 14px; line-height: 1.45; }
.story-know li::before { content: ''; position: absolute; left: 0; top: 8px; width: 6px; height: 6px; border-radius: 50%; background: #e0b3a7; }
