.flex-col {
  display: flex;
  flex-direction: column;
}

.light-background {
  background: var(--light-color);
}

.gray-background {
  background: var(--light-gray);
}

.flex-row {
  display: flex;
  flex-direction: row;
}

.history-page {
  width: 100vw;
  margin: 0;
  align-items: center;
}

.history-timeline {
  height: 50vh;
  align-items: center;
  justify-content: flex-start;
  width: 100vw;
  position: relative;
}

.history-timeline ul {
  list-style: none;
  padding: 0;
  margin: 0;
  width: 75%;
  height: 100%;
  position: relative;
  display: flex;
  flex-direction: column;
}

.history-timeline li {
  width: 100%;
  flex: 1;
  position: relative;
}

.even-item {
  text-align: left;
  padding-right: 60px;
}

.odd-item {
  text-align: right;
  padding-left: 60px;
}

.history-timeline-list-link {
  text-decoration: none;
  color: var(--white);
  font-size: 30px;
  padding: 20px 0 20px 100px;
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  background: var(--primary-color);
  box-shadow:
    0 4px 12px var(--shadow-light),
    inset 0 2px 4px rgba(0, 0, 0, 0.2);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
  clip-path: polygon(0 0, 100% 0, 85% 100%, 0 100%);
}

.odd-item .history-timeline-list-link {
  justify-content: center;
  padding-left: 30px;
  padding-right: 30px;
  clip-path: polygon(15% 0, 100% 0, 100% 100%, 0 100%);
}

.history-timeline-list-link:hover {
  background: var(--primary-dark);
}

.history-image {
  width: 40%;
  height: 100%;
  margin: -15%;
}

.history-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-content {
  min-height: 100vh;
  padding: 100px 120px 0 120px;
}

.period-title {
  font-size: 36px;
  font-weight: 300;
  margin-bottom: 30px;
}

.period-title::after {
  content: "";
  display: flex;
  width: 100px;
  height: 4px;
  background: var(--primary-color);
  margin: 8px 0 10px 5px;
  transition: width 0.5s ease;
}

.period-title:hover::after {
  width: 150px;
  background: var(--gradient-warm);
}

/* ========================= */
/* ALTERNATING TIMELINE      */
/* ========================= */

.history-period {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 40px;
  margin-bottom: 60px;
}

/* Image block */
.period-image {
  flex: 0 0 380px;
  max-width: 380px;
  overflow: hidden;
}

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

/* Text block */
.history-period .text-content {
  flex: 1;
  justify-content: center;
}

/* image-left: image first, text second (default DOM order) */
.history-period.image-left {
  flex-direction: row;
}

/* image-right: text first, image second (default DOM order) */
.history-period.image-right {
  flex-direction: row;
}

/* Vertical line between image and text */
.history-period.image-left .text-content {
  border-left: 3px solid var(--primary-color);
  padding-left: 40px;
}

.history-period.image-right .text-content {
  border-right: 3px solid var(--primary-color);
  padding-right: 40px;
}

.content-title {
  font-size: 28px;
  font-weight: 400;
  margin-bottom: 20px;
  color: var(--shadow-dark);
}

.content-title::after {
  content: "";
  display: flex;
  width: 80px;
  height: 3px;
  background: var(--tertiary-color);
  margin: 6px 0 8px 5px;
  transition: width 0.5s ease;
}

.content-title:hover::after {
  width: 120px;
  background: var(--gradient-warm);
}

.content-paragraph {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 20px;
}

.content-list {
  font-size: 16px;
  font-weight: 400;
  line-height: 1.5;
  margin-bottom: 10px;
  margin-left: 30px;
}

/* ========================= */
/* RESPONSIVE                */
/* ========================= */

@media (max-width: 1024px) {
  .history-content {
    padding: 60px 40px 0 40px;
  }

  .period-image {
    flex: 0 0 280px;
    max-width: 280px;
  }

  .history-period {
    gap: 30px;
  }
}

@media (max-width: 768px) {
  .history-content {
    padding: 40px 20px 0 20px;
  }

  /* Stack vertically on mobile */
  .history-period.image-left,
  .history-period.image-right {
    flex-direction: column;
  }

  /* Image always on top on mobile */
  .history-period.image-right .period-image {
    order: -1;
  }

  .period-image {
    flex: 0 0 auto;
    max-width: 100%;
    height: 250px;
  }

  .history-period .text-content {
    border-left: none !important;
    border-right: none !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    border-top: 3px solid var(--primary-color);
    padding-top: 20px;
  }

  .history-period {
    gap: 0;
    margin-bottom: 40px;
  }

  .history-timeline {
    height: auto;
    flex-direction: column;
  }

  .history-timeline ul {
    width: 100%;
  }

  .history-image {
    display: none;
  }

  .period-title {
    font-size: 28px;
  }

  .content-title {
    font-size: 22px;
  }
}
