/*
 * WOtW Timeline: front-end styles.
 * Carried over unchanged from the original hand-coded Divi module, plus a few additions at the end.
 */
.wotw-timeline *,
.wotw-timeline *::before,
.wotw-timeline *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

.wotw-timeline {
  font-family: 'Open Sans', sans-serif;
  color: #4a4a4a;
  max-width: 860px;
  margin: 0 auto;
  padding: 3rem 1.5rem 5rem;
}

/* ── Intro ── */
.wotw-timeline__intro {
  margin-bottom: 4rem;
  border-bottom: 1px solid #ffd9a8;
  padding-bottom: 2.5rem;
}
.wotw-timeline__intro h2 {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 600;
  color: #8f5010;
  line-height: 1.3;
  margin-bottom: 0.75rem;
}
.wotw-timeline__intro p {
  font-size: 1.05rem;
  line-height: 1.8;
  color: #5a5a5a;
  max-width: 640px;
}

/* ── Track & spine ── */
.wotw-timeline__track {
  position: relative;
  padding-left: 2rem;
}
.wotw-timeline__track::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6rem;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, #f0a843 0%, #ffd9a8 100%);
}

/* ── Era labels ── */
.wotw-era {
  position: relative;
  margin: 3.5rem 0 1.5rem -2rem;
  padding-left: 2rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}
.wotw-era::before {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #c87a1a;
  border: 3px solid #ffefda;
  outline: 2px solid #c87a1a;
  flex-shrink: 0;
  margin-left: -7px;
}
.wotw-era__label {
  font-family: 'Open Sans', sans-serif;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #c87a1a;
  background: #ffefda;
  padding: 0.3rem 0.8rem;
  border-radius: 20px;
}

/* ── Entry: 2-col [year | content] ── */
.wotw-entry {
  position: relative;
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 0 1.75rem;
  margin-bottom: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid #fff3e6;
}
.wotw-entry:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}
.wotw-entry::before {
  content: '';
  position: absolute;
  left: -2.38rem;
  top: 0.5rem;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #fff;
  border: 2px solid #c87a1a;
  transition: background 0.2s;
}
.wotw-entry:hover::before {
  background: #c87a1a;
}

/* ── Year ── */
.wotw-entry__year {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: clamp(1.5rem, 2.5vw, 2rem);
  font-weight: 600;
  color: #c87a1a;
  line-height: 1;
  padding-top: 0.2rem;
  letter-spacing: -0.02em;
}
.wotw-entry__year span {
  display: block;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #ffd9a8;
  margin-top: 0.3rem;
}

/* ── Content column (text + media stacked) ── */
.wotw-entry__content {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding-top: 0.15rem;
}

/* ── Body text ── */
.wotw-entry__body h3 {
  font-family: 'Noto Serif', Georgia, serif;
  font-size: 1.05rem;
  font-weight: 600;
  color: #8f5010;
  margin-bottom: 0.45rem;
  line-height: 1.4;
}
.wotw-entry__body p {
  font-size: 0.95rem;
  line-height: 1.8;
  color: #5a5a5a;
}
.wotw-entry__body em {
  font-style: italic;
  color: #c87a1a;
}

/* ── Thumbnail row ── */
.wotw-entry__media {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* Each thumbnail */
.wotw-thumb {
  position: relative;
  width: 120px;
  height: 90px;
  border-radius: 5px;
  overflow: hidden;
  cursor: pointer;
  flex-shrink: 0;
  background: #ffefda;
  border: 1.5px dashed #ffd9a8;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 3px;
}
.wotw-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.2s;
}
.wotw-thumb:hover img {
  transform: scale(1.05);
}

/* Placeholder icon & label */
.wotw-thumb__icon {
  width: 24px;
  height: 24px;
  stroke: #c87a1a;
  opacity: 0.5;
  fill: none;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.wotw-thumb__label {
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #c87a1a;
  opacity: 0.6;
}

/* Video placeholder */
.wotw-thumb[data-type="video-ph"] {
  background: #4a2800;
  border-color: #8f5010;
}
.wotw-thumb[data-type="video-ph"] .wotw-thumb__icon {
  stroke: #ffd9a8;
  opacity: 0.6;
}
.wotw-thumb[data-type="video-ph"] .wotw-thumb__label {
  color: #ffd9a8;
  opacity: 0.7;
}

/* Play button overlay on real video thumbs */
.wotw-thumb__play {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74,40,0,0.4);
  transition: background 0.2s;
}
.wotw-thumb__play:hover {
  background: rgba(74,40,0,0.6);
}
.wotw-thumb__play svg {
  width: 28px;
  height: 28px;
}

/* ── Lightbox overlay ── */
.wotw-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(30,15,0,0.88);
  z-index: 2147483000; /* above Divi's fixed header (100000) and the admin bar */
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}
.wotw-lightbox.is-open {
  display: flex;
}
.wotw-lightbox__inner {
  position: relative;
  max-width: 840px;
  width: 100%;
  max-height: 90vh;
}
.wotw-lightbox__inner img {
  width: 100%;
  height: auto;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 6px;
  display: block;
}
.wotw-lightbox__inner iframe {
  width: 100%;
  aspect-ratio: 16/9;
  border: none;
  border-radius: 6px;
  display: block;
}
.wotw-lightbox__close {
  position: absolute;
  top: -2.5rem;
  right: 0;
  background: none;
  border: none;
  color: #ffd9a8;
  font-size: 1.8rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}
.wotw-lightbox__close:hover {
  color: #fff;
}
.wotw-lightbox__caption {
  margin-top: 0.6rem;
  font-size: 0.8rem;
  color: #ffd9a8;
  text-align: center;
  font-family: 'Open Sans', sans-serif;
}

/* ── Scroll-in animation ── */
.wotw-entry {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.wotw-entry.is-visible {
  opacity: 1;
  transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
  .wotw-entry { opacity: 1; transform: none; transition: none; }
}

/* ── Mobile ── */
@media (max-width: 600px) {
  .wotw-timeline__track { padding-left: 1.25rem; }
  .wotw-entry { grid-template-columns: 1fr; gap: 0.4rem; }
  .wotw-entry__year { font-size: 1.4rem; }
  .wotw-era { margin-left: -1.25rem; }
  .wotw-thumb { width: 104px; height: 78px; }
}

/* ── Added by the WOtW Timeline plugin ── */

/* Real video thumbnails (dark tile behind the play button) */
.wotw-thumb[data-type="video"] {
  background: #4a2800;
  border-color: #8f5010;
}

/* Placeholders aren't clickable */
.wotw-thumb[data-type="photo-ph"],
.wotw-thumb[data-type="video-ph"] {
  cursor: default;
}

/* Keyboard focus */
.wotw-thumb:focus-visible,
.wotw-lightbox__close:focus-visible {
  outline: 2px solid #c87a1a;
  outline-offset: 2px;
}

/* ── Lightbox gallery: arrows + counter ── */
.wotw-lightbox__nav {
  display: none;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 50%;
  background: rgba(74, 40, 0, 0.55);
  color: #ffd9a8;
  cursor: pointer;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 2;
  transition: background 0.2s, color 0.2s;
}
.wotw-lightbox__nav svg {
  width: 24px;
  height: 24px;
}
.wotw-lightbox__nav:hover {
  background: #c87a1a;
  color: #fff;
}
.wotw-lightbox__nav:focus-visible {
  outline: 2px solid #ffd9a8;
  outline-offset: 2px;
}
.wotw-lightbox.has-gallery .wotw-lightbox__nav {
  display: flex;
}
/* Arrows sit over the photo edges on smaller screens… */
.wotw-lightbox__nav--prev { left: 0.5rem; }
.wotw-lightbox__nav--next { right: 0.5rem; }
/* …and outside the photo on wide screens */
@media (min-width: 1000px) {
  .wotw-lightbox__nav--prev { left: -4rem; }
  .wotw-lightbox__nav--next { right: -4rem; }
}
.wotw-lightbox__counter {
  position: absolute;
  top: -2.1rem;
  left: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: #ffd9a8;
}
