/* ==========================================================================
   Riddle Educat – About page: "Our Journey" timeline + "Our Future Vision"
   Loaded AFTER the page's inline <style> so equal-specificity rules win.
   Brand colours come from the page's existing variables (--primary, --accent,
   --secondary, --gray, --dark) with the current hex values as fallbacks.
   ========================================================================== */

section.rd-journey,
section.rd-vision {
  --rdj-navy: var(--primary, #0f2438);
  --rdj-navy-2: var(--primary-light, #163654);
  --rdj-gold: var(--accent, #c8962c);
  --rdj-gold-deep: var(--secondary, #a97a1e);
  --rdj-ink: var(--dark, #1e293b);
  --rdj-muted: var(--gray, #45566b);
  --rdj-line: #e3e8ef;
  --rdj-year-col: 150px;
  --rdj-node-col: 30px;
}

/* ---------- Section shell ---------- */
section.rd-journey {
  background: var(--light, #f6f7f9);
  padding: 88px 0 96px;
}

.rd-journey__head {
  max-width: 640px;
  margin: 0 auto 56px;
  text-align: center;
}
.rd-journey__head .section-title { margin-bottom: 12px; }
.rd-journey__head .section-subtitle { margin-bottom: 0; font-size: 1.02rem; }

/* ---------- Timeline (mobile-first: spine on the left) ---------- */
.rd-timeline {
  list-style: none;
  margin: 0 auto;
  padding: 0;
  max-width: 1000px;
  position: relative;
}
.rd-timeline::before {               /* the spine */
  content: "";
  position: absolute;
  top: 8px;
  bottom: 8px;
  left: 13px;
  width: 2px;
  background: var(--rdj-line);
}

.rd-tl-item {
  position: relative;
  display: grid;
  grid-template-columns: var(--rdj-node-col) minmax(0, 1fr);
  column-gap: 12px;
  margin: 0 0 28px;
}
.rd-tl-item:last-child { margin-bottom: 0; }

.rd-tl-node {
  grid-column: 1;
  grid-row: 1;
  justify-self: start;
  align-self: start;
  width: 16px;
  height: 16px;
  margin: 8px 0 0 6px;
  border-radius: 50%;
  background: #fff;
  border: 3px solid var(--rdj-navy);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  transition: background-color .25s ease, border-color .25s ease, transform .25s ease;
}

.rd-tl-year {
  grid-column: 2;
  grid-row: 1;
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.55rem;
  line-height: 1.2;
  letter-spacing: -.01em;
  color: var(--rdj-navy);
  margin: 0 0 10px;
}

.rd-tl-card {
  grid-column: 2;
  grid-row: 2;
  background: #fff;
  border: 1px solid var(--rdj-line);
  border-radius: 14px;
  padding: 22px 22px 20px;
  box-shadow: 0 1px 2px rgba(15, 36, 56, .04), 0 10px 24px -16px rgba(15, 36, 56, .22);
  transition: border-color .25s ease, box-shadow .25s ease, transform .25s ease;
}

.rd-tl-title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 1.18rem;
  line-height: 1.3;
  color: var(--rdj-navy);
  margin: 0;
}

.rd-tl-points {
  list-style: none;
  margin: 14px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--rdj-line);
  display: grid;
  gap: 10px;
}
.rd-tl-points li {
  position: relative;
  padding-left: 16px;
  font-size: .92rem;
  line-height: 1.6;
  color: var(--rdj-muted);
}
.rd-tl-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--rdj-gold);
}

/* Hover only where a real pointer exists, so touch devices don't get sticky hovers */
@media (hover: hover) {
  .rd-tl-item:hover .rd-tl-card {
    border-color: rgba(200, 150, 44, .6);
    box-shadow: 0 1px 2px rgba(15, 36, 56, .05), 0 16px 32px -18px rgba(15, 36, 56, .32);
    transform: translateY(-2px);
  }
  .rd-tl-item:hover .rd-tl-node {
    background: var(--rdj-gold);
    border-color: var(--rdj-gold-deep);
    transform: scale(1.12);
  }
}

/* ---------- Tablet: wider card, bullets still stacked ---------- */
@media (min-width: 640px) {
  .rd-tl-card { padding: 24px 28px 22px; }
  .rd-tl-year { font-size: 1.8rem; }
}

/* ---------- Desktop: year | spine | card, bullets in columns (short cards) ---------- */
@media (min-width: 900px) {
  .rd-timeline::before {
    left: calc(var(--rdj-year-col) + 14px);
  }
  .rd-tl-item {
    grid-template-columns: var(--rdj-year-col) var(--rdj-node-col) minmax(0, 1fr);
    column-gap: 0;
    margin-bottom: 32px;
    align-items: start;
  }
  .rd-tl-year {
    grid-column: 1;
    grid-row: 1;
    text-align: right;
    font-size: 2.1rem;
    margin: 0;
    padding-right: 22px;
    line-height: 1.05;
    padding-top: 2px;
  }
  .rd-tl-node {
    grid-column: 2;
    grid-row: 1;
    justify-self: center;
    margin: 12px 0 0;
  }
  .rd-tl-card {
    grid-column: 3;
    grid-row: 1;
    margin-left: 12px;
  }
  .rd-tl-points {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 18px 26px;
  }
}

/* ---------- Future vision ---------- */
section.rd-vision {
  background: var(--rdj-navy);
  color: #fff;
  padding: 84px 0;
}
.rd-vision__layout {
  display: grid;
  gap: 40px;
  max-width: 1040px;
  margin: 0 auto;
  align-items: start;
}
.rd-vision__tag {
  display: inline-block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--rdj-gold);
  border: 1px solid rgba(200, 150, 44, .55);
  border-radius: 999px;
  padding: 5px 14px;
  margin-bottom: 18px;
}
section.rd-vision .rd-vision__title {
  font-family: 'Fraunces', Georgia, serif;
  font-weight: 600;
  font-size: 2.3rem;
  line-height: 1.15;
  color: #fff;
  margin: 0 0 14px;
}
.rd-vision__lede {
  margin: 0;
  color: rgba(255, 255, 255, .78);
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 34ch;
}
.rd-vision__goals {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
}
.rd-vision__goals li {
  position: relative;
  padding: 22px 0 22px 26px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: 1.05rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, .92);
}
.rd-vision__goals li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .16); }
.rd-vision__goals li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 26px;
  bottom: 26px;
  width: 3px;
  border-radius: 2px;
  background: var(--rdj-gold);
}

@media (min-width: 900px) {
  .rd-vision__layout { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 64px; }
}
@media (max-width: 640px) {
  section.rd-journey { padding: 64px 0 72px; }
  section.rd-vision { padding: 64px 0; }
  section.rd-vision .rd-vision__title { font-size: 1.9rem; }
  .rd-journey__head { margin-bottom: 40px; }
}

/* ---------- Scroll reveal (only hides content when scripting is enabled) ---------- */
@media (scripting: enabled) {
  .rd-reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity .55s ease, transform .55s ease;
  }
  .rd-reveal.is-visible {
    opacity: 1;
    transform: none;
  }
}

/* ---------- Keyboard focus & reduced motion ---------- */
.rd-tl-card:focus-within { border-color: rgba(200, 150, 44, .6); }

@media (prefers-reduced-motion: reduce) {
  .rd-reveal,
  .rd-reveal.is-visible,
  .rd-tl-card,
  .rd-tl-node {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

/* ---------- Fix: closing CTA ----------
   The page's `section:nth-child(even)` rule (white background) was overriding the
   navy gradient of .cta-section, leaving its white text invisible. */
section.cta-section {
  background: linear-gradient(135deg, var(--primary, #0f2438), var(--primary-light, #163654));
}
