/* Directory · Discovery Stories
   Map-led collection library. Organic decks open into a map + place column,
   with touch-only motion, row-snapped scrolling and no route semantics. */
.dir-split--stories { background: var(--ds-surface-soft); }
.dir-stories-panel { position: relative; z-index: 2; min-width: 0; padding: 0; overflow: hidden; display: flex; flex-direction: column; background: #fff; box-shadow: -18px 0 34px rgba(18,29,33,.2); }
.dir-story-scrollframe { position: relative; flex: 1 1 auto; min-height: 0; }
.dir-stories-scroll { height: 100%; min-height: 0; overflow-y: auto; padding: 16px 18px 38px; scroll-snap-type: y mandatory; scroll-padding-top: 8px; }

/* Quiet header aligned with TOMI Shorts · Local Guide above it. */
.dir-stories-head { display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center; gap: 18px; min-height: 96px; padding: 13px 2px 14px; border-bottom: 1px solid #cbd5d1; color: #182226; scroll-snap-align: start; scroll-snap-stop: always; }
.dir-stories-head > div:first-child { max-width: 330px; }
.dir-stories-head h1 { display: block; margin: 0 0 4px; font-family: var(--ds-font-display); font-size: 35px; line-height: .96; }
.dir-stories-head p { display: block; margin: 0; color: var(--ds-muted); font-size: 12px; line-height: 1.3; }
.dir-stories-rating { display: grid; grid-template-columns: 30px auto; gap: 2px 8px; align-items: center; }
.dir-stories-rating > span { grid-row: 1 / span 2; width: 30px; height: 30px; display: grid; place-items: center; border-radius: 9px; background: var(--ds-accent); color: var(--ds-accent-ink); }
.dir-stories-rating > span .tomi-icon { font-size: 18px; }
.dir-stories-rating b { font-family: var(--ds-font-display); font-size: 12px; line-height: 1; }
.dir-stories-rating small { color: var(--ds-muted); font-size: 8px; }
.dir-story-stars { display: inline-flex; gap: 2px; color: var(--ds-accent); }
.dir-story-stars .tomi-icon { font-size: 13px; }
.dir-story-signals { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px 1px 0; }
.dir-story-signals > span { display: inline-flex; align-items: center; gap: 5px; padding: 7px 9px; border-radius: 999px; background: #fff; color: #536169; font-size: 9px; font-weight: 700; }
.dir-story-signals .tomi-icon { color: #192429; font-size: 12px; }
.dir-story-section { margin-top: 17px; }
.dir-story-section__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 10px; padding: 0 1px; }
.dir-story-section__head span b, .dir-story-section__head span small { display: block; }
.dir-story-section__head span b { font-family: var(--ds-font-display); font-size: 22px; line-height: 1; }
.dir-story-section__head span small { margin-top: 4px; color: var(--ds-muted); font-size: 9px; font-weight: 600; }
.dir-story-section__head em { padding: 6px 8px; border-radius: 999px; background: #dce3e0; color: #52615e; font-size: 8px; font-style: normal; font-weight: 800; letter-spacing: .05em; }

/* Library grid. The first collection has editorial priority but uses the same deck. */
.dir-story-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 13px; align-items: stretch; }
.dir-story-card { position: relative; min-width: 0; overflow: visible; border: 0; border-radius: var(--ds-card-radius); background: transparent; color: #182226; box-shadow: none; isolation: isolate; }
.dir-story-card--featured { grid-column: span 2; }
.dir-story-card { scroll-snap-align: start; scroll-snap-stop: always; }
.dir-story-deck { position: relative; display: block; width: 100%; height: 180px; overflow: hidden; border-radius: calc(var(--ds-card-radius) - 1px) calc(var(--ds-card-radius) - 1px) 0 0; background: transparent; }
.dir-story-deck__sheet { position: absolute; display: block; overflow: hidden; border: 2px solid rgba(255,255,255,.86); border-radius: 18px 18px 12px 12px; background: linear-gradient(135deg,#9a9a9a,#5f5f5f) center/cover no-repeat; box-shadow: 0 10px 24px rgba(13,22,26,.22); transition: transform 260ms cubic-bezier(.2,.72,.2,1), opacity 220ms ease; }
/* O fallback partilhado precisa de position:relative nos media normais para
   ancorar o pseudo-ícone. As folhas deste baralho são a exceção: os seus inset
   só funcionam em posição absoluta. Esta regra tem de vencer a especificidade
   de `.kiosk [data-ph]` e preservar também a sombra exterior da pilha. */
.kiosk .dir-story-deck__sheet[data-ph] { position: absolute; box-shadow: 0 10px 24px rgba(13,22,26,.22), inset 0 -34px 68px rgba(8,12,24,.12); }
.dir-story-deck__sheet--back { z-index: 1; inset: 7px 24px 21px 18px; transform: translate(-7px,-2px) rotate(-3.5deg); filter: saturate(.75) brightness(.76); }
.dir-story-deck__sheet--middle { z-index: 2; inset: 12px 17px 11px 23px; transform: translate(7px,-1px) rotate(3deg); filter: saturate(.88) brightness(.9); }
.dir-story-deck__sheet--cover { z-index: 3; inset: 19px 8px 0; color: #fff; }
.dir-story-deck__shade { position: absolute; inset: 0; background: linear-gradient(180deg,rgba(7,12,14,.03) 12%,rgba(7,12,14,.84) 100%); }
.dir-story-deck__icon { position: absolute; z-index: 2; left: 11px; top: 10px; width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--ds-accent); color: var(--ds-accent-ink); box-shadow: 0 6px 16px rgba(0,0,0,.25); }
.dir-story-deck__icon .tomi-icon { font-size: 28px; }
.dir-story-deck__label { position: absolute; z-index: 2; left: 12px; right: 12px; bottom: 20px; }
.dir-story-deck__label b { display: block; max-width: 96%; font-family: var(--ds-font-display); font-size: 32px; line-height: .9; text-wrap: balance; text-shadow: 0 2px 10px rgba(0,0,0,.4); }
.dir-story-card__body { min-height: 128px; margin: 0 8px; padding: 18px 16px; border: 1px solid var(--ds-border); border-top: 0; border-radius: 0 0 var(--ds-card-radius) var(--ds-card-radius); background: #fff; box-shadow: 0 8px 20px rgba(18,29,33,.08); }
.dir-story-card__body > p { margin: 0; color: #26353b; font-size: 18px; font-weight: 600; line-height: 1.32; }
.dir-story-card--featured .dir-story-deck { height: 230px; }
.dir-story-card--featured .dir-story-deck__sheet--back { inset: 7px 39px 24px 25px; transform: translate(-9px,-2px) rotate(-3deg); }
.dir-story-card--featured .dir-story-deck__sheet--middle { inset: 14px 27px 12px 38px; transform: translate(9px,-1px) rotate(2.8deg); }
.dir-story-card--featured .dir-story-deck__sheet--cover { inset: 22px 14px 0; }
.dir-story-card--featured .dir-story-deck__icon { left: 16px; top: 14px; width: 62px; height: 62px; border-radius: 18px; }
.dir-story-card--featured .dir-story-deck__icon .tomi-icon { font-size: 39px; }
.dir-story-card--featured .dir-story-deck__label { left: 18px; bottom: 26px; }
.dir-story-card--featured .dir-story-deck__label b { max-width: 84%; font-size: 50px; }
.dir-story-card--featured .dir-story-card__body { min-height: 104px; margin: 0 14px; padding: 18px 19px; }
.dir-story-card--featured .dir-story-card__body > p { max-width: 455px; font-size: 20px; line-height: 1.28; }

/* Touch feedback: the deck starts opening sideways before the detail appears. */
.dir-story-card.is-opening { z-index: 20; }
.dir-story-card.is-opening .dir-story-deck__sheet--back { transform: translateX(112px) scale(.92); opacity: .68; }
.dir-story-card.is-opening .dir-story-deck__sheet--middle { transform: translateX(56px) scale(.96); opacity: .86; }
.dir-story-card.is-opening .dir-story-deck__sheet--cover { transform: translateX(-8px); }

/* Row navigation: one tap advances to the next complete grid/card row. */
.dir-story-scroll-rail { position: absolute; z-index: 30; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
.dir-story-scroll-rail[hidden] { display: none; }
.dir-story-scroll-btn { width: 50px; height: 50px; display: grid; place-items: center; border: 1px solid rgba(24,34,38,.1); border-radius: 50%; background: #fff; color: #182226; box-shadow: var(--ds-shadow-float); }
.dir-story-scroll-btn:first-child .tomi-icon { transform: rotate(180deg); }
.dir-story-scroll-btn .tomi-icon { font-size: 19px; }
.dir-story-scroll-btn:disabled { opacity: .24; }
.dir-story-scroll-tail { width: 100%; height: 0; pointer-events: none; }

/* Collection detail: map + independent place cards, never a numbered itinerary. */
.dir-story-detail { flex: 1 1 auto; min-height: 0; display: flex; background: var(--ds-surface-soft); }
.dir-story-map { position: relative; flex: 0 0 43%; min-height: 0; background: #dce3e0; animation: dir-story-map-in 300ms ease both; }
.dir-story-map > .map-canvas { position: absolute; inset: 0; }
.dir-story-map__summary { position: absolute; z-index: 1100; left: 17px; right: 17px; bottom: 17px; display: grid; grid-template-columns: 56px 1fr; gap: 13px; align-items: center; padding: 13px; border-radius: 20px; background: rgba(24,34,38,.94); color: #fff; box-shadow: var(--ds-shadow-float); backdrop-filter: blur(8px); }
.dir-story-map__summary > span { width: 56px; height: 56px; display: grid; place-items: center; border-radius: 17px; background: var(--ds-accent); color: var(--ds-accent-ink); }
.dir-story-map__summary > span .tomi-icon { font-size: 30px; }
.dir-story-map__summary small, .dir-story-map__summary b, .dir-story-map__summary em { display: block; }
.dir-story-map__summary small { color: var(--ds-accent); font-size: 8px; font-weight: 800; letter-spacing: .07em; }
.dir-story-map__summary b { margin-top: 4px; font-family: var(--ds-font-display); font-size: 21px; line-height: 1; }
.dir-story-map__summary em { margin-top: 5px; color: #c8d2cf; font-size: 10px; font-style: normal; font-weight: 600; }
.dir-story-detail__content { position: relative; z-index: 2; flex: 1 1 auto; min-width: 0; min-height: 0; background: #dde7e3; box-shadow: -18px 0 34px rgba(18,29,33,.2); }
.dir-story-detail__panel { width: 100%; height: 100%; min-width: 0; min-height: 0; overflow-y: auto; padding: 18px 20px 36px; scroll-snap-type: y mandatory; scroll-padding-top: 10px; }
.dir-story-back { min-height: 45px; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; border-radius: 999px; background: #fff; color: #182226; font-size: 11px; font-weight: 800; }
.dir-story-back .tomi-icon { font-size: 17px; }
.dir-story-detail__hero { margin-top: 11px; padding: 20px 22px; border-radius: 20px; background: #182226; color: #fff; }
.dir-story-detail__hero > div { max-width: 460px; }
.dir-story-detail__hero > div > span { color: var(--ds-accent); font-size: 11px; font-weight: 800; letter-spacing: .075em; }
.dir-story-detail__hero h1 { margin: 7px 0 8px; font-family: var(--ds-font-display); font-size: 40px; line-height: .92; }
.dir-story-detail__hero p { max-width: 440px; margin: 0 0 12px; color: #d8e0de; font-size: 16px; font-weight: 600; line-height: 1.32; }
.dir-story-detail__hero .dir-story-stars .tomi-icon { font-size: 14px; }
.dir-story-detail__intro { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 11px 0 14px; padding: 11px 13px; border-radius: 16px; background: #fff8dc; }
.dir-story-detail__intro span b, .dir-story-detail__intro span small { display: block; }
.dir-story-detail__intro span b { font-family: var(--ds-font-display); font-size: 16px; }
.dir-story-detail__intro span small { margin-top: 3px; color: #746c4c; font-size: 8px; }
.dir-story-detail__intro > em { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 7px 9px; border-radius: 999px; background: #182226; color: #fff; font-size: 8px; font-style: normal; font-weight: 800; letter-spacing: .04em; }
.dir-story-places__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 15px; margin-bottom: 9px; }
.dir-story-places__head b { font-family: var(--ds-font-display); font-size: 25px; }
.dir-story-places__head small { color: var(--ds-muted); font-size: 10px; font-weight: 600; }
.dir-story-place { position: relative; min-height: 176px; padding-right: 58px; opacity: 0; scroll-snap-align: start; scroll-snap-stop: always; box-shadow: 0 6px 20px rgba(18,29,33,.07); animation: dir-story-place-in 420ms cubic-bezier(.2,.72,.2,1) forwards; animation-delay: calc(80ms + (var(--story-i) * 70ms)); }
.dir-story-place__media { flex-basis: 45%; }
.dir-story-place__media::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg,rgba(0,0,0,.32),transparent 70%); }
.dir-story-place__media > i { position: absolute; z-index: 2; left: 13px; bottom: 13px; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--ds-accent); color: var(--ds-accent-ink); font-style: normal; box-shadow: 0 5px 16px rgba(0,0,0,.25); }
.dir-story-place__media > i .tomi-icon { font-size: 30px; }
.dir-story-place__body { padding: 17px 18px; gap: 8px; }
.dir-story-place__body small { color: #806a0f; font-size: 10px; font-weight: 800; letter-spacing: .055em; }
.dir-story-place__body strong { font-size: 26px; line-height: 1.02; }
.dir-story-place__body > span { display: flex; align-items: center; gap: 6px; font-size: 13px; }
.dir-story-place__body > span .tomi-icon { font-size: 17px; }
.dir-story-place__arrow { position: absolute; right: 14px; top: 50%; width: 42px; height: 42px; display: grid; place-items: center; transform: translateY(-50%); border-radius: 50%; background: #182226; color: #fff; }
.dir-story-place__arrow .tomi-icon { font-size: 17px; }

@keyframes dir-story-map-in {
  from { opacity: 0; transform: translateX(-22px); }
  to { opacity: 1; transform: none; }
}
@keyframes dir-story-place-in {
  from { opacity: 0; transform: translateX(-105px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .dir-story-deck__sheet { transition: none !important; }
  .dir-story-map, .dir-story-place { animation: none !important; }
  .dir-story-place { opacity: 1; }
}
