/* ===== PAGE OVERRIDES ===== */
html, body {
  overflow-x: hidden !important;
  overflow-y: auto !important;
  height: auto !important;
}

.page-history {
  background: #fff;
}

/* ===== BACK BUTTON ===== */
.back-home {
  position: fixed;
  top: 32px;
  left: 40px;
  z-index: 3000;
  color: #000;
  opacity: 0.4;
  transition: opacity 0.3s ease, transform 0.3s ease;
  display: flex;
  align-items: center;
}

.back-home:hover {
  opacity: 1;
  transform: translateX(-4px);
}

/* Dark burger lines */
.burger__line--dark {
  background: #000 !important;
}

.burger.is-open .burger__line--dark {
  background: #000 !important;
}

/* ===== HERO ===== */
.history-hero {
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 120px 40px 60px;
  position: relative;
  text-align: center;
}

.history-hero__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(48px, 8vw, 96px);
  font-weight: 400;
  color: #000;
  letter-spacing: -0.03em;
  line-height: 1.1;
  opacity: 0;
  transform: translateY(30px);
  animation: fadeUp 1s cubic-bezier(0.33, 1, 0.68, 1) 0.2s forwards;
}

.history-hero__subtitle {
  font-family: 'Inter', sans-serif;
  font-size: clamp(14px, 1.6vw, 18px);
  font-weight: 300;
  color: #888;
  letter-spacing: 0.5px;
  margin-top: 20px;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 1s cubic-bezier(0.33, 1, 0.68, 1) 0.5s forwards;
}

.history-hero__scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  opacity: 0;
  animation: fadeUp 1s cubic-bezier(0.33, 1, 0.68, 1) 0.8s forwards,
             float 2s ease-in-out 2s infinite;
  color: #ccc;
}

@keyframes fadeUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes float {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(8px); }
}

/* ===== TIMELINE ===== */
.timeline {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 40px 40px 120px;
}

/* Central vertical line — height set dynamically by JS to end at end dot */
.timeline__line {
  position: absolute;
  left: 50%;
  top: 0;
  width: 1px;
  background: #e0e0e0;
  transform: translateX(-50%);
  height: 0;
  overflow: hidden;
}

/* ===== TIMELINE ITEMS ===== */
.timeline__item {
  position: relative;
  width: 50%;
  padding: 0 60px 80px;
}

.timeline__item--left {
  left: 0;
  padding-right: 60px;
  padding-left: 0;
}

.timeline__item--right {
  left: 50%;
  padding-left: 60px;
  padding-right: 0;
}

/* Dot on the center line */
.timeline__dot {
  position: absolute;
  top: 24px;
  width: 13px;
  height: 13px;
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 50%;
  z-index: 2;
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

.timeline__item--left .timeline__dot {
  right: -7px;
}

.timeline__item--right .timeline__dot {
  left: -7px;
}

/* Active dot when visible */
.timeline__item.is-visible .timeline__dot {
  background: #0053A1;
  border-color: #0053A1;
  transform: scale(1.3);
}

/* ===== TIMELINE CARD ===== */
.timeline__card {
  background: #fff;
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 4px 40px rgba(0, 0, 0, 0.06);
  transition: transform 0.4s cubic-bezier(0.33, 1, 0.68, 1),
              box-shadow 0.4s ease;
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.7s cubic-bezier(0.33, 1, 0.68, 1),
              transform 0.7s cubic-bezier(0.33, 1, 0.68, 1),
              box-shadow 0.4s ease;
}

.timeline__item--left .timeline__card {
  transform: translateX(-40px) translateY(20px);
}

.timeline__item--right .timeline__card {
  transform: translateX(40px) translateY(20px);
}

.timeline__item.is-visible .timeline__card {
  opacity: 1;
  transform: translateX(0) translateY(0);
}

.timeline__card:hover {
  box-shadow: 0 8px 60px rgba(0, 0, 0, 0.1);
}

/* Linked cards */
a.timeline__card--link {
  text-decoration: none;
  color: inherit;
  display: block;
  cursor: pointer;
}

a.timeline__card--link:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 60px rgba(0, 0, 0, 0.12);
}

.timeline__item.is-visible a.timeline__card--link:hover {
  transform: translateX(0) translateY(-4px);
}

/* ===== TIMELINE IMAGE ===== */
.timeline__image {
  width: 100%;
  min-aspect-ratio: 16 / 10;
  overflow: hidden;
  position: relative;
  background: #f5f5f5;
}

.timeline__image img {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.6s cubic-bezier(0.33, 1, 0.68, 1);
}

/* Placeholders keep a fixed aspect ratio */
.timeline__image--placeholder {
  aspect-ratio: 16 / 10;
}

.timeline__card:hover .timeline__image img {
  transform: scale(1.04);
}

/* Logo-style images: contain instead of cover, with padding */
.timeline__image--logo {
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.timeline__image--logo img {
  object-fit: contain;
  width: 80%;
  height: 80%;
}

/* Caddyshack dark background */
.timeline__image--caddyshack {
  background: #83ff00;
}

/* Placeholder images: transparent with subtle dashed border */
.timeline__image--placeholder {
  background: transparent;
  border: none;
}

.timeline__placeholder-inner {
  width: 100%;
  height: 100%;
  border: 1px dashed #ddd;
  border-radius: 2px;
  background: transparent;
}

/* ===== TIMELINE CONTENT ===== */
.timeline__content {
  padding: 28px 32px 32px;
}

.timeline__date {
  display: block;
  font-family: 'Inter', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #0053A1;
  margin-bottom: 8px;
}

.timeline__title {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: clamp(20px, 2.2vw, 26px);
  font-weight: 500;
  color: #000;
  letter-spacing: -0.01em;
  line-height: 1.3;
  margin-bottom: 12px;
}

.timeline__desc {
  font-family: 'Inter', sans-serif;
  font-size: 15px;
  font-weight: 300;
  line-height: 1.7;
  color: #555;
}

/* ===== TIMELINE TERMINUS ===== */
.timeline__terminus {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 20px;
  padding-bottom: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.7s cubic-bezier(0.33, 1, 0.68, 1),
              transform 0.7s cubic-bezier(0.33, 1, 0.68, 1);
}

.timeline__terminus.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline__dot--end {
  position: relative;
  width: 13px;
  height: 13px;
  background: #fff;
  border: 2px solid #ccc;
  border-radius: 50%;
  z-index: 2;
  transition: background 0.4s ease, border-color 0.4s ease, transform 0.4s ease;
}

.timeline__terminus.is-visible .timeline__dot--end {
  background: #0053A1;
  border-color: #0053A1;
  transform: scale(1.3);
}

.timeline__explore-btn {
  margin-top: calc(25vh - 60px);
  margin-bottom: calc(25vh - 60px);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 28px;
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 400;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #0053A1;
  background: transparent;
  border: 1.5px solid #0053A1;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.3s ease, color 0.3s ease, transform 0.2s ease;
}

.timeline__explore-btn:hover {
  background: #0053A1;
  color: #fff;
  transform: translateY(-2px);
}

.timeline__explore-btn svg {
  transition: transform 0.3s ease;
}

.timeline__explore-btn:hover svg {
  transform: translateX(3px);
}

/* ===== FOOTER ===== */
.history-footer {
  padding: 60px 40px;
  background: #000;
  display: flex;
  justify-content: center;
}

.history-footer__logo {
  opacity: 0.6;
  transition: opacity 0.3s ease;
}

.history-footer__logo:hover {
  opacity: 1;
}

.history-footer__logo img {
  width: 120px;
  height: auto;
}

/* ===== MOBILE ===== */
@media (max-width: 768px) {
  .back-home {
    top: 24px;
    left: 24px;
  }

  .history-hero {
    min-height: 50vh;
    padding: 100px 24px 60px;
  }

  .timeline {
    padding: 20px 24px 80px;
  }

  /* Single-column: line on the left */
  .timeline__line {
    left: 16px;
  }

  .timeline__item,
  .timeline__item--left,
  .timeline__item--right {
    width: 100%;
    left: 0;
    padding: 0 0 48px 48px;
  }

  .timeline__item--left .timeline__dot,
  .timeline__item--right .timeline__dot {
    left: 10px;
    right: auto;
  }

  .timeline__item--left .timeline__card,
  .timeline__item--right .timeline__card {
    transform: translateX(30px) translateY(10px);
  }

  .timeline__item.is-visible .timeline__card {
    transform: translateX(0) translateY(0);
  }

  .timeline__content {
    padding: 20px 24px 24px;
  }

  .timeline__image--logo {
    padding: 24px;
  }

  .timeline__terminus {
    align-items: flex-start;
    padding-left: 10px;
  }

  .timeline__explore-btn {
    align-self: center;
  }

  .history-footer {
    padding: 48px 24px;
  }
}
