/**
 * ASC360 — Individual travel story (premium editorial)
 * Works with existing .story-hero / .story-article / .story-cover-cta / .story-related markup.
 * Does not alter global homepage tokens; scoped to body[data-page="article"].
 */

@import url("https://fonts.googleapis.com/css2?family=Source+Serif+4:opsz,wght@8..60,500;8..60,600&display=swap");

body[data-page="article"] {
  --story-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --story-measure: 68ch;
  --story-shell: min(720px, calc(100% - 2 * var(--gutter)));
  --story-serif: "Source Serif 4", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --story-hero-h: 100svh;
  background:
    radial-gradient(120% 60% at 50% -10%, rgba(255, 106, 26, 0.07), transparent 55%),
    linear-gradient(180deg, #f7f4ef 0%, var(--paper) 28%, var(--white) 100%);
  color: var(--ink);
}

/* —— Reading progress —— */
.story-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 80;
  pointer-events: none;
  background: transparent;
}

.story-progress__bar {
  display: block;
  height: 100%;
  width: 0%;
  transform-origin: left center;
  background: linear-gradient(90deg, #ff6528, #e78600);
  box-shadow: 0 0 12px rgba(255, 92, 0, 0.35);
  transition: width 80ms linear;
}

@media (prefers-reduced-motion: reduce) {
  .story-progress__bar {
    transition: none;
  }
}

/* —— Ghost button (used on story pages; not in global kit) —— */
body[data-page="article"] .btn--ghost {
  background: transparent;
  border: 1.5px solid rgba(255, 255, 255, 0.55);
  color: var(--white);
}

body[data-page="article"] .btn--ghost:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
  transform: translateY(-1px);
}

body[data-page="article"] .story-cover-cta .btn--ghost {
  border-color: rgba(255, 255, 255, 0.45);
  color: var(--white);
}

/* —— Cinematic hero (exactly one viewport; content vertically centered) —— */
.story-hero {
  position: relative;
  isolation: isolate;
  height: var(--story-hero-h);
  max-height: var(--story-hero-h);
  min-height: var(--story-hero-h);
  display: flex;
  align-items: center;
  color: var(--white);
  overflow: hidden;
  background: var(--navy);
  box-sizing: border-box;
  /* Pull under sticky float header so 100svh fills the first screen */
  margin-top: calc(-1 * (var(--header-h, 68px) + 24px));
}

/* Offer ticker sits just under the floating pill */
body[data-page="article"] .story-hero > .offer-ticker--in-hero {
  top: calc(var(--header-h, 68px) + 18px);
}

.story-hero__media {
  position: absolute;
  inset: 0;
  margin: 0;
  z-index: 0;
  overflow: hidden;
}

.story-hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
  transform: scale(1.08);
  transition: transform 1.35s var(--story-ease);
  will-change: transform;
}

.story-hero.is-ready .story-hero__media img {
  transform: scale(1);
}

.story-hero__shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(
      105deg,
      rgba(6, 16, 28, 0.88) 0%,
      rgba(8, 20, 35, 0.62) 42%,
      rgba(8, 20, 35, 0.28) 68%,
      rgba(8, 20, 35, 0.12) 100%
    ),
    linear-gradient(180deg, transparent 40%, rgba(8, 18, 32, 0.72) 100%),
    radial-gradient(90% 70% at 78% 18%, rgba(255, 92, 0, 0.2), transparent 55%);
}

.story-hero__inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: clamp(0.35rem, 0.9vh, 0.75rem);
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  max-width: min(58rem, 92vw);
  max-height: 100%;
  margin-block: auto;
  margin-inline: auto;
  /* Equal clearance top/bottom so the block sits in the vertical centre */
  padding:
    calc(var(--header-h, 68px) + 18px + var(--offer-ticker-h, 0px) + clamp(8px, 1.2vh, 16px))
    0
    calc(var(--header-h, 68px) + 18px + var(--offer-ticker-h, 0px) + clamp(8px, 1.2vh, 16px));
  box-sizing: border-box;
}

.story-hero__brand {
  display: inline-block;
  margin: 0;
  font-family: var(--f-head);
  font-weight: 700;
  font-size: clamp(1.65rem, 1.2rem + 2.2vw, 2.65rem);
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--white);
  text-decoration: none;
  text-shadow: 0 4px 32px rgba(0, 0, 0, 0.4);
}

.story-hero__brand span {
  color: #ff8a3d;
}

.story-hero__brand small {
  display: block;
  margin-top: 0.4em;
  font-family: var(--f-body);
  font-size: clamp(0.6875rem, 0.58rem + 0.35vw, 0.8125rem);
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.78);
}

.story-hero__cat {
  display: inline-block;
  margin: 0;
  padding: 0;
  font-size: clamp(0.75rem, 0.68rem + 0.25vw, 0.875rem);
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #ffb07a;
}

.story-hero h1 {
  margin: 0;
  max-width: min(18em, 100%);
  color: var(--white);
  font-size: clamp(1.45rem, 1.05rem + 1.9vw, 2.65rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
  text-wrap: balance;
  text-shadow: 0 6px 40px rgba(0, 0, 0, 0.45);
}

/* Typewriter (shared landing engine) */
.story-hero h1[data-typewriter] {
  max-width: min(18em, 100%);
}

.story-hero [data-typewriter] .hero__type-stack {
  display: grid;
  grid-template-areas: "stack";
  width: 100%;
}

.story-hero [data-typewriter] .hero__type-ghost,
.story-hero [data-typewriter] .hero__typewriter {
  grid-area: stack;
  max-width: 100%;
}

.story-hero [data-typewriter] .hero__type-ghost {
  visibility: hidden;
  white-space: normal;
  color: transparent;
}

.story-hero [data-typewriter] .hero__typewriter {
  display: inline;
  color: var(--white);
}

.story-hero [data-typewriter] .hero__type-text {
  white-space: normal;
}

.story-hero [data-typewriter] .hero__type-caret {
  display: inline-block;
  width: 0.08em;
  height: 0.85em;
  margin-left: 0.08em;
  vertical-align: -0.05em;
  border-right: 0.12em solid #ff8a3d;
  animation: hero-typewriter-caret 0.75s step-end infinite;
}

.story-hero [data-typewriter].is-typed .hero__type-caret {
  display: none;
}

html:not(.js) .story-hero [data-typewriter] .hero__typewriter {
  display: none !important;
}

html:not(.js) .story-hero [data-typewriter] .hero__type-ghost {
  visibility: visible;
  color: inherit;
}

html.js .story-hero:not(.is-copy-done) .story-hero__lede,
html.js .story-hero:not(.is-copy-done) .story-hero__actions,
html.js .story-hero:not(.is-copy-done) .story-hero__meta {
  opacity: 0;
  transform: translateY(12px);
}

html.js .story-hero.is-copy-done .story-hero__lede,
html.js .story-hero.is-copy-done .story-hero__actions,
html.js .story-hero.is-copy-done .story-hero__meta {
  opacity: 1;
  transform: none;
  transition:
    opacity 560ms var(--story-ease),
    transform 560ms var(--story-ease);
}

html.js .story-hero.is-copy-done .story-hero__actions {
  transition-delay: 70ms;
}

html.js .story-hero.is-copy-done .story-hero__meta {
  transition-delay: 130ms;
}

@media (prefers-reduced-motion: reduce) {
  .story-hero [data-typewriter] .hero__type-caret {
    animation: none !important;
  }

  html.js .story-hero:not(.is-copy-done) .story-hero__lede,
  html.js .story-hero:not(.is-copy-done) .story-hero__actions,
  html.js .story-hero:not(.is-copy-done) .story-hero__meta {
    opacity: 1 !important;
    transform: none !important;
  }
}

.story-hero__lede {
  margin: 0;
  max-width: min(40em, 100%);
  font-size: clamp(0.95rem, 0.88rem + 0.4vw, 1.125rem);
  line-height: 1.45;
  color: #e4eaef;
  text-wrap: pretty;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.35);
}

.story-hero__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin: 0.15rem 0 0;
}

.story-hero__actions .btn {
  min-height: clamp(44px, 5.5vh, 52px);
  padding-inline: clamp(18px, 2.2vw, 26px);
  font-size: clamp(0.9375rem, 0.88rem + 0.3vw, 1.0625rem);
  font-weight: 600;
}

.story-hero__actions .btn--primary {
  box-shadow: 0 12px 28px -10px rgba(255, 92, 0, 0.55);
}

.story-hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  list-style: none;
  margin: 0.15rem 0 0;
  padding: 0;
  font-size: clamp(0.8125rem, 0.75rem + 0.25vw, 0.9375rem);
  color: rgba(255, 255, 255, 0.78);
}

.story-hero__meta li {
  position: relative;
}

.story-hero__meta li + li::before {
  content: "";
  display: inline-block;
  width: 4px;
  height: 4px;
  margin-right: var(--s-4);
  margin-bottom: 0.2em;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.45);
  vertical-align: middle;
}

/* Hero entrance */
html.js body[data-page="article"] .story-hero:not(.is-ready) .story-hero__brand,
html.js body[data-page="article"] .story-hero:not(.is-ready) .story-hero__cat,
html.js body[data-page="article"] .story-hero:not(.is-ready) h1 {
  opacity: 0;
  transform: translateY(18px);
}

html.js body[data-page="article"] .story-hero.is-ready .story-hero__brand,
html.js body[data-page="article"] .story-hero.is-ready .story-hero__cat,
html.js body[data-page="article"] .story-hero.is-ready h1 {
  opacity: 1;
  transform: none;
  transition:
    opacity 720ms var(--story-ease),
    transform 720ms var(--story-ease);
}

html.js body[data-page="article"] .story-hero.is-ready .story-hero__cat {
  transition-delay: 60ms;
}
html.js body[data-page="article"] .story-hero.is-ready h1 {
  transition-delay: 120ms;
}

@media (prefers-reduced-motion: reduce) {
  .story-hero__media img,
  html.js body[data-page="article"] .story-hero:not(.is-ready) .story-hero__brand,
  html.js body[data-page="article"] .story-hero:not(.is-ready) .story-hero__cat,
  html.js body[data-page="article"] .story-hero:not(.is-ready) h1 {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* —— Article body —— */
.story-article {
  position: relative;
  padding-block: clamp(40px, 6vw, 72px) clamp(24px, 4vw, 48px);
}

.story-article__shell {
  width: var(--story-shell);
  margin-inline: auto;
}

.story-article__rail {
  display: none;
}

@media (min-width: 1180px) {
  .story-article__shell {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: clamp(32px, 4vw, 56px);
    width: min(960px, calc(100% - 2 * var(--gutter)));
    align-items: start;
  }

  .story-article__shell > :not(.story-article__rail) {
    grid-column: 2;
  }

  .story-article__rail {
    display: block;
    grid-column: 1;
    grid-row: 1 / -1;
    position: sticky;
    top: calc(var(--header-h) + 28px);
    padding-top: 4px;
  }

  .story-toc {
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .story-toc__label {
    margin: 0 0 var(--s-3);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--ink-3);
  }

  .story-toc a {
    display: block;
    padding: 0.4em 0 0.4em 0.85em;
    border-left: 2px solid var(--line);
    color: var(--ink-2);
    font-size: 0.8125rem;
    line-height: 1.4;
    text-decoration: none;
    transition: color 0.2s ease, border-color 0.2s ease;
  }

  .story-toc a:hover,
  .story-toc a.is-active {
    color: var(--navy);
    border-color: var(--brand);
  }
}

.story-article__body {
  max-width: var(--story-measure);
  font-size: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem);
  line-height: 1.75;
  color: var(--ink-2);
}

.story-article__body > * + * {
  margin-top: 1.15em;
}

.story-article__pull {
  margin: 0 0 1.5em;
  padding: 0 0 0 1.1em;
  border-left: 3px solid var(--brand);
  font-family: var(--story-serif);
  font-size: clamp(1.25rem, 1.1rem + 0.55vw, 1.55rem);
  font-weight: 500;
  line-height: 1.45;
  color: var(--navy);
  text-wrap: pretty;
}

.story-article__body h2 {
  margin-top: 1.85em;
  margin-bottom: 0.55em;
  font-size: clamp(1.35rem, 1.2rem + 0.55vw, 1.7rem);
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: var(--navy);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.story-article__body h3 {
  margin-top: 1.4em;
  margin-bottom: 0.4em;
  font-size: 1.125rem;
  color: var(--navy);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.story-article__body p {
  margin: 0;
  text-wrap: pretty;
}

.story-article__body ul {
  margin: 0.85em 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.65em;
}

.story-article__body ul li {
  position: relative;
  padding-left: 1.35em;
  color: var(--ink-2);
}

.story-article__body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 0.45em;
  height: 0.45em;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(255, 92, 0, 0.15);
}

.story-article__note {
  margin-top: 2.25em !important;
  padding-top: 1.25em;
  border-top: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-3);
}

.story-article__note a {
  font-weight: 600;
}

.story-back {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  margin: 0 0 1.5em;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
}

.story-back:hover {
  color: var(--brand-ink);
}

.story-back::before {
  content: "←";
  font-weight: 700;
}

/* —— Cover CTA band —— */
.story-cover-cta {
  position: relative;
  isolation: isolate;
  margin-block: clamp(16px, 3vw, 32px) 0;
  padding-block: clamp(56px, 8vw, 96px);
  overflow: clip;
  color: var(--white);
  background:
    radial-gradient(80% 90% at 12% 20%, rgba(255, 92, 0, 0.22), transparent 55%),
    linear-gradient(135deg, #0b1b2e 0%, #13263d 48%, #1a3048 100%);
}

.story-cover-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.03) 50%, transparent 100%);
  opacity: 0.8;
}

.story-cover-cta__inner {
  position: relative;
  z-index: 1;
  width: min(720px, calc(100% - 2 * var(--gutter)));
  margin-inline: auto;
  text-align: center;
}

.story-cover-cta .kicker {
  color: #ffb07a;
}

.story-cover-cta h2 {
  margin-top: var(--s-2);
  color: var(--white);
  font-size: clamp(1.75rem, 1.35rem + 1.4vw, 2.5rem);
  letter-spacing: -0.02em;
  text-wrap: balance;
}

.story-cover-cta__inner > p {
  margin: var(--s-4) auto 0;
  max-width: 42ch;
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--fs-lede);
  line-height: 1.55;
}

.story-cover-cta__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--s-3);
  margin-top: var(--s-5);
}

/* —— Related stories —— */
.story-related {
  padding-block: clamp(48px, 7vw, 88px);
  background: linear-gradient(180deg, var(--white), var(--paper));
}

.story-related__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: var(--s-4);
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin: 0 auto var(--s-6);
}

.story-related__head h2 {
  margin-top: var(--s-2);
  font-size: clamp(1.5rem, 1.25rem + 0.9vw, 2rem);
}

.story-related__list {
  list-style: none;
  display: grid;
  gap: var(--s-4);
  width: min(var(--max), calc(100% - 2 * var(--gutter)));
  margin: 0 auto;
  padding: 0;
}

@media (min-width: 760px) {
  .story-related__list {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--s-5);
  }
}

.story-related__link {
  display: grid;
  grid-template-rows: auto 1fr;
  height: 100%;
  color: inherit;
  text-decoration: none;
  border-radius: var(--r-2);
  overflow: hidden;
  background: var(--white);
  border: 1px solid transparent;
  transition:
    border-color 0.25s ease,
    box-shadow 0.35s var(--story-ease),
    transform 0.35s var(--story-ease);
}

.story-related__link img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  background: var(--sand);
  transition: transform 0.55s var(--story-ease);
}

.story-related__link > div {
  display: grid;
  gap: var(--s-2);
  padding: var(--s-4);
  align-content: start;
}

.story-related__link h3 {
  font-size: 1.05rem;
  line-height: 1.35;
  color: var(--navy);
}

@media (hover: hover) and (pointer: fine) {
  .story-related__link:hover {
    border-color: rgba(255, 106, 26, 0.28);
    box-shadow: 0 22px 44px -28px rgba(11, 27, 46, 0.35);
    transform: translateY(-4px);
  }

  .story-related__link:hover img {
    transform: scale(1.04);
  }
}

.story-related__link:focus-visible {
  outline: none;
  box-shadow: var(--focus);
}

/* —— Short / mobile: keep one-screen hero —— */
@media (max-width: 639px) {
  .story-hero h1,
  .story-hero h1[data-typewriter] {
    max-width: none;
  }

  .story-hero__lede {
    -webkit-line-clamp: 2;
  }

  .story-hero__actions .btn {
    flex: 1 1 auto;
    justify-content: center;
  }
}

/* Short viewports: keep one-screen fit without shrinking desktop drama */
@media (max-height: 760px) {
  .story-hero__brand {
    font-size: clamp(1.55rem, 1.1rem + 2vw, 2.35rem);
  }

  .story-hero h1 {
    font-size: clamp(1.35rem, 1rem + 1.8vw, 2.35rem);
  }

  .story-hero__lede {
    font-size: clamp(0.9375rem, 0.88rem + 0.35vw, 1.1rem);
    -webkit-line-clamp: 2;
  }

  .story-hero__inner {
    gap: 0.35rem;
    padding-top: calc(var(--header-h, 68px) + 16px + var(--offer-ticker-h, 0px) + 6px);
    padding-bottom: calc(var(--header-h, 68px) + 16px + var(--offer-ticker-h, 0px) + 6px);
  }

  .story-hero__actions .btn {
    min-height: 42px;
  }
}

@media (max-height: 640px) {
  .story-hero__brand small {
    display: none;
  }

  .story-hero__meta {
    display: none;
  }

  .story-hero__lede {
    -webkit-line-clamp: 1;
  }
}

@media (max-height: 520px) {
  .story-hero__cat {
    display: none;
  }

  .story-hero h1 {
    font-size: clamp(1.15rem, 0.95rem + 1.5vw, 1.65rem);
  }

  .story-hero__actions .btn {
    min-height: 36px;
    font-size: 0.875rem;
  }

  .story-hero__inner {
    gap: 0.35rem;
    padding-top: calc(var(--header-h, 68px) + var(--offer-ticker-h, 0px) + 4px);
    padding-bottom: calc(var(--header-h, 68px) + var(--offer-ticker-h, 0px) + 4px);
  }
}
