/* ==========================================================================
   WELLUNEX — BİZİM HİKAYEMİZ (LOVE STORY TIMELINE)
   One component for both invitation layouts. The base styles are the compact,
   single-column timeline. Where the timeline itself is wide enough, and the
   browser supports container queries, milestones alternate around a centre
   rail; an older phone simply keeps the compact form.
   ========================================================================== */

.love-story {
  --ls-ink: var(--web-forest, #1C261F);
  --ls-body: var(--web-text, #2C302E);
  --ls-muted: var(--web-text-muted, #6B716C);
  --ls-accent: var(--web-gold-dark, #8C6D1F);
  --ls-accent-bright: var(--web-gold, #D4AF37);
  --ls-line: rgba(140, 109, 31, 0.26);
  --ls-paper: #FFFDF9;
  --ls-ring: #F6F0E6;
  --ls-display: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  --ls-prose: var(--font-serif, 'Cormorant Garamond', Georgia, serif);
  --ls-caps: var(--font-royal, 'Cinzel', Georgia, serif);
  --ls-sans: var(--font-sans, 'Montserrat', system-ui, sans-serif);
  position: relative;
  color: var(--ls-body);
}

.love-story *,
.love-story *::before,
.love-story *::after {
  box-sizing: border-box;
}

.love-story--website {
  padding: clamp(72px, 11vw, 136px) 20px;
  background:
    radial-gradient(900px 320px at 50% 0%, rgba(212, 175, 55, 0.09), transparent 70%),
    linear-gradient(180deg, var(--web-bg, #FAF7F2) 0%, #F4EDE2 100%);
}

/* --- Heading ------------------------------------------------------------- */

.ls-head {
  max-width: 700px;
  margin: 0 auto clamp(44px, 7vw, 84px);
  text-align: center;
}

.ls-kicker {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-family: var(--ls-caps);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.34em;
  text-transform: uppercase;
  color: var(--ls-accent);
}

.ls-kicker::before,
.ls-kicker::after {
  content: '';
  width: 36px;
  height: 1px;
  background: currentColor;
  opacity: 0.5;
}

.ls-title {
  margin: 18px 0 0;
  font-family: var(--ls-display);
  font-size: clamp(2.35rem, 6.2vw, 4rem);
  font-weight: 400;
  line-height: 1.04;
  letter-spacing: -0.015em;
  color: var(--ls-ink);
  text-wrap: balance;
}

.ls-intro {
  max-width: 580px;
  margin: 22px auto 0;
  font-family: var(--ls-prose);
  font-size: clamp(1.12rem, 2.3vw, 1.34rem);
  font-style: italic;
  line-height: 1.7;
  white-space: pre-line;
  text-wrap: pretty;
}

.ls-ornament {
  display: block;
  width: 8px;
  height: 8px;
  margin: 30px auto 0;
  border: 1px solid var(--ls-accent);
  opacity: 0.75;
  transform: rotate(45deg);
}

/* --- Track and rail ------------------------------------------------------ */

.ls-track {
  position: relative;
  max-width: 1060px;
  margin: 0 auto;
}

.ls-rail {
  position: absolute;
  top: 12px;
  bottom: 12px;
  left: 26px;
  width: 1px;
  background: var(--ls-line);
}

.ls-rail-fill {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, var(--ls-accent-bright), var(--ls-accent));
  transform: scaleY(var(--ls-progress, 1));
  transform-origin: top center;
}

.ls-timeline {
  position: relative;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --- Milestone, compact form --------------------------------------------- */

.ls-item {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-areas: "marker card";
  column-gap: 18px;
  align-items: start;
}

.ls-item + .ls-item {
  margin-top: clamp(28px, 5vw, 64px);
}

.ls-marker {
  grid-area: marker;
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(140, 109, 31, 0.42);
  border-radius: 50%;
  background: var(--ls-paper);
  box-shadow: 0 0 0 6px var(--ls-ring), 0 12px 26px -14px rgba(37, 51, 40, 0.5);
  font-family: var(--ls-display);
  font-size: 1.1rem;
  font-variant-numeric: lining-nums;
  color: var(--ls-accent);
}

.ls-aside {
  grid-area: aside;
  display: none;
}

.ls-card {
  grid-area: card;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(45, 74, 62, 0.1);
  border-radius: 20px;
  background: var(--ls-paper);
  box-shadow: 0 30px 60px -40px rgba(37, 51, 40, 0.6), 0 1px 3px rgba(37, 51, 40, 0.05);
}

.ls-photo {
  margin: 0;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #EEE5D6;
}

.ls-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ls-body {
  padding: 22px 22px 26px;
}

.ls-date {
  margin: 0 0 6px;
  font-family: var(--ls-caps);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ls-accent);
}

.ls-milestone-title {
  margin: 0;
  font-family: var(--ls-display);
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
  font-weight: 500;
  line-height: 1.12;
  color: var(--ls-ink);
  text-wrap: balance;
}

.ls-text {
  margin: 10px 0 0;
  font-family: var(--ls-sans);
  font-size: 0.95rem;
  line-height: 1.75;
  color: var(--ls-muted);
  white-space: pre-line;
  text-wrap: pretty;
}

/* --- Alternating form, where the timeline is wide enough ----------------- */

@supports (container-type: inline-size) {
  .ls-track {
    container: ls-track / inline-size;
  }

  @container ls-track (min-width: 760px) {
    .ls-rail {
      left: 50%;
      transform: translateX(-50%);
    }

    .ls-item {
      grid-template-columns: minmax(0, 1fr) 104px minmax(0, 1fr);
      grid-template-areas: "card marker aside";
      column-gap: 0;
      align-items: center;
    }

    .ls-item:nth-child(even) {
      grid-template-areas: "aside marker card";
    }

    .ls-marker {
      justify-self: center;
      width: 60px;
      height: 60px;
      font-size: 1.3rem;
    }

    .ls-aside {
      display: block;
      padding: 0 22px;
    }

    .ls-item:nth-child(even) .ls-aside {
      text-align: right;
    }

    .ls-aside-date {
      font-family: var(--ls-display);
      font-size: clamp(1.7rem, 3.4cqi, 2.5rem);
      font-style: italic;
      line-height: 1.1;
      color: var(--ls-accent);
    }

    /* The aside shows the date; the card keeps its copy for screen readers. */
    .ls-date {
      position: absolute;
      width: 1px;
      height: 1px;
      overflow: hidden;
      clip-path: inset(50%);
      white-space: nowrap;
    }

    .ls-body {
      padding: 30px 34px 34px;
    }
  }
}

/* --- Motion, enabled by love-story.js ------------------------------------ */

.ls-animate .ls-item {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.9s cubic-bezier(0.22, 1, 0.36, 1), transform 0.9s cubic-bezier(0.22, 1, 0.36, 1);
}

.ls-animate .ls-item.is-visible {
  opacity: 1;
  transform: none;
}

.ls-animate .ls-photo img {
  transform: scale(1.06);
  transition: transform 1.8s cubic-bezier(0.22, 1, 0.36, 1);
}

.ls-animate .ls-item.is-visible .ls-photo img {
  transform: scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .ls-animate .ls-item,
  .ls-animate .ls-photo img {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* --- Envelope layout: inside the unfolded card ---------------------------- */

.love-story--envelope {
  --ls-ink: #1A1A1A;
  --ls-body: #333333;
  --ls-muted: #5A5A5A;
  --ls-accent: var(--inv-primary, #8C6D1F);
  --ls-accent-bright: var(--inv-primary, #D4AF37);
  --ls-line: rgba(0, 0, 0, 0.12);
  --ls-paper: #FFFFFF;
  --ls-ring: transparent;
  /* Titles take the couple's heading font, running text their body font:
     some heading fonts (Cinzel) are capitals only, which a paragraph cannot carry. */
  --ls-display: var(--font-heading, 'Cormorant Garamond', Georgia, serif);
  --ls-prose: var(--font-body, Georgia, serif);
  --ls-sans: var(--font-body, Georgia, serif);
  margin: 30px 0;
  padding-top: 26px;
  border-top: 1px dashed rgba(0, 0, 0, 0.15);
  text-align: left;
}

.love-story--envelope .ls-head {
  margin-bottom: 26px;
}

.love-story--envelope .ls-title {
  font-size: clamp(1.6rem, 6vw, 2.1rem);
}

.love-story--envelope .ls-intro {
  font-size: 1rem;
}

.love-story--envelope .ls-rail {
  left: 20px;
}

.love-story--envelope .ls-item {
  grid-template-columns: 40px minmax(0, 1fr);
  column-gap: 12px;
}

.love-story--envelope .ls-item + .ls-item {
  margin-top: 20px;
}

.love-story--envelope .ls-marker {
  width: 40px;
  height: 40px;
  font-size: 0.92rem;
  box-shadow: none;
}

.love-story--envelope .ls-card {
  border-radius: 14px;
  box-shadow: 0 14px 30px -22px rgba(0, 0, 0, 0.45);
}

.love-story--envelope .ls-body {
  padding: 14px 16px 16px;
}

.love-story--envelope .ls-milestone-title {
  font-size: 1.28rem;
}

.love-story--envelope .ls-text {
  font-size: 0.86rem;
  line-height: 1.6;
}
