/* =========================================
   History page spacing
   ========================================= */

.history-intro {
  margin: 0 0 2.4em;
  padding: 0 8px;
}

.timeline {
  margin: 3.2em auto 0;
}

.timeline:first-of-type {
  margin-top: 2.2em;
}

.history-after {
  margin-top: 3.2em;
}

/* =========================================
   History / Timeline layout
   ========================================= */

/* Image block inside the timeline */
.pic {
  margin: 5px 0 0;
  text-align: center;
}

/* Timeline wrapper */
.timeline {
  position: relative;
  margin: 0 auto;
}

/* Clear floats inside timeline */
.timeline::after {
  content: "";
  display: block;
  clear: both;
}

/* Vertical center line */
.timeline::before {
  position: absolute;
  top: 52px;
  left: 50%;
  width: 3px;
  height: calc(100% - 32px);
  content: '';
  background: #876d4a;
}

/* Decade label (e.g., 1940's, 1950's) */
.timeline h2 {
  position: relative;
  clear: both;
  display: block;
  max-width: 150px;
  margin: 1em auto 1rem;
  padding: 16px 28px 12px;
  text-align: center;
  color: #fff;
  background: #876d4a;
  border-radius: 4px;
  font-family: "montserrat", "source-han-sans-japanese", sans-serif;
  font-weight: 600;
  font-style: normal;
  letter-spacing: 0.12em;
  font-size: 20px;
  line-height: 1.2;
}

/* Timeline list container */
.timeline ul {
  max-width: calc(100% - 3em);
  margin: 0;
  padding: 0 0 0 2em;
  list-style: none;
}

/* Individual event card */
.timeline li {
  position: relative;
  width: 42%;
  margin-bottom: 1em;
  padding: 1em;
  background: rgba(250, 247, 242, 0.7);
  border: none;
  border-radius: 4px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

/* Arrow pointing toward the center line (default: left side) */
.timeline li::before {
  position: absolute;
  top: 18px;
  left: -14px;
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 12px 7px 0;
  border-color: transparent rgba(250, 247, 242, 0.7) transparent transparent;
  z-index: 0;
}

/* Arrow background layer (shadow behind the main arrow) */
.timeline li::after {
  position: absolute;
  top: 18px;
  left: -16px;
  content: '';
  display: inline-block;
  width: 0;
  height: 0;
  border-style: solid;
  border-width: 7px 12px 7px 0;
  border-color: transparent rgba(250, 247, 242, 0.7) transparent transparent;
  z-index: -1;
}

/* Right-side cards (even items) */
.timeline li:nth-child(even) {
  float: right;
  margin-top: 2em;
}

/* Left-side cards (odd items) */
.timeline li:nth-child(odd) {
  float: left;
}

/* Arrow for left-side cards */
.timeline li:nth-child(odd)::before {
  right: -14px;
  left: auto;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent rgba(250, 247, 242, 0.7);
}

/* Background arrow for left-side cards */
.timeline li:nth-child(odd)::after {
  right: -16px;
  left: auto;
  border-width: 7px 0 7px 12px;
  border-color: transparent transparent transparent rgba(250, 247, 242, 0.7);
  z-index: -1;
}

/* Reset float every two items */
.timeline li:nth-of-type(2n + 1) {
  clear: both;
}

/* Year label */
.timeline li .flag {
  margin: 0 0 4px;
  padding: 0;
  font-family: "montserrat", "source-han-sans-japanese", sans-serif;
  font-weight: 500;
  font-feature-settings: "palt";
  letter-spacing: 0.05em;
  font-size: 13px;
  color: #333;
}

/* Main description text */
.timeline li .desc {
  margin-left: 8px;
  font-size: 12.5px;
  line-height: 1.7;
  font-feature-settings: "palt";
  color: #333;
}

.timeline .pic img {
  width: 80%;
  max-width: none;
  height: auto;
  display: block;
  margin: 0 auto;
}

.timeline .pic {
  margin-bottom: 10px; 
}

/* Photo caption */
.timeline li .cap {
  margin: 0 8px;
  padding: 0;
  font-size: 11px;
  line-height: 1.7;
  font-feature-settings: "palt";
  color: #c3a170;
}

/* History credit */
.history-credit{
  display:block;
  text-align:right;
  padding-right: 4px;
}

/* =========================================
   Timeline: Mobile layout
   ========================================= */
@media only screen and (max-width: 767px) {

  /* Move center line to the left on smaller screens */
  .timeline::before {
    left: 0;
    top: 72px;
    height: calc(100% - 72px);
  }

  /* Add a little extra padding on mobile */
  .timeline ul {
    z-index: 1;
    padding: 0 0 0 1.5em;
  }

  /* Cards become full-width on mobile */
  .timeline li {
    width: 100%;
  }

  /* Cancel left/right float */
  .timeline li:nth-child(even),
  .timeline li:nth-child(odd) {
    float: none;
    margin-top: 1em;
  }

  /* Arrows always point from the left on mobile */
  .timeline li:nth-child(odd)::before {
    right: auto;
    left: -14px;
    border-width: 10px 15px 10px 0;
    border-color: transparent var(--prm-ivory) transparent transparent;
  }

  .timeline li:nth-child(odd)::after {
    right: auto;
    left: -16px;
    border-width: 10px 15px 10px 0;
    border-color: transparent #f8f9fc transparent transparent;
  }
}