/* HistoryStyle */
:root{
  --dark:#0b1c2d;
  --primary:#007bff;
  --success:#28A745;
  --light:#f9fafb;
  --text:#444;
}

body {
  background: rgba(200, 200, 200, 0.08);  /* very light gray */
}

.nav-links li a {
  text-decoration: none;
  color: black;
  font-weight: 500;
  position: relative;
  transition: color 0.3s ease;
  text-shadow: none;
}

/* INTRO */
.story-intro{
  max-width:900px;
  margin:80px auto 40px;
  padding:0 20px;
  text-align:center;
}

.story-intro h2{
  font-size:36px;
  color:var(--primary);
}

.story-intro p{
  text-align: justify;
  font-size: 18px;
  margin: 10px;
}

/* TIMELINE */
.story{
  max-width: 1500px;
  margin:auto;
  position:relative;
}

.story::before{
  content:'';   
  position:absolute;
  left:50%;
  width:2px;
  top:0;
  bottom:0;
  background:var(--primary);
  transform:translateX(-50%);
}

.story-item{
  display:flex;
  width: 100%;
  gap: 2vw; 
  margin:100px 0;
  opacity:0;
  transform:translateY(60px);
  transition:.8s;
}

.story-item-hold{
  display:flex;
  width: 100%;
  gap: 2vw; 
  margin:100px 0;
  opacity:0;
  /* transform:translateY(60px); */
  transition:.8s;
}


.story-item.in-view{
  opacity:1;
  transform:translateY(0);
}

.story-item.left{
  flex-direction:row-reverse;
}

/* ICON */
.story-icon{
  width:70px;
  height:70px;
  border-radius:50%;
  border:3px solid var(--primary);
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:24px;
  color:var(--primary);
  background:#fff;
  z-index:2;
}
.story-icon-container{
  width: 10%;
  justify-items: center;
}

.story-date-right {
  width: 45%;
  text-align: right;
  padding: 25px;
}

.story-date-left {
  width: 45%;
  text-align: left;
  padding: 25px;
}
.story-item span{
  font-weight:600;
  font-size: 18.72px;
  margin-top: 16px;
}

/* ===== FLIP CARD ===== */
.flip-card {
  width: 45%;
  perspective: 1000px;
  /* remove fixed height, let content decide */
}

.flip-card-inner {
  width: 100%;
  position: relative;
  transform-style: preserve-3d;
  transition: 0.8s;
  /* remove height:100% */
}

.flip-card-front,
.flip-card-back {
  position: relative; /* not absolute */
  width: 100%;
  border-radius: 18px;
  backface-visibility: hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,.1);
  padding: 25px;
  background: #fff;
}

.flip-card-back {
  transform: rotateY(180deg);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.flip-card-front img {
  width: 100%;
  height: auto; /* keep aspect ratio */
  max-height: 300px; /* cap the height */
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 10px;
}



/* ================= LARGE TABLETS & SMALL LAPTOPS (<=1060px) ================= */
@media screen and (max-width: 1060px) {
  .flip-card-front h3,
  .flip-card-back h3 {
    font-size: 20px;
  }
  .flip-card-front p,
  .flip-card-back p {
    font-size: 15px;
  }
}

/* ================= TABLETS (<=900px) ================= */
@media screen and (max-width: 900px) {
  .story::before{
    left: 90%;
  }

  .flip-card {
    width: 83%;
    /* margin: 15px; */
    /* height: 500px; */
    perspective: 1000px;
  }

  .story-item.left {
    flex-direction: row;
  }
  .story-date-right, .story-date-left{
    display: none;
  }
  .flip-card-front h3,
  .flip-card-back h3 {
    font-size: 18px;
  }
  .flip-card-front p,
  .flip-card-back p {
    font-size: 14px;
    line-height: 1.6;
  }
}

/* ================= TABLETS (<=700px) ================= */
@media screen and (max-width: 700px) {
  .story::before{
    left: 90%;
  }

  .flip-card {
    width: 83%;
    /* margin: 15px; */
    /* height: 500px; */
    perspective: 1000px;
  }
}


@media screen and (max-width: 480px) {
  .story-icon {
    width: 60px;
    height: 60px;
  }
  .flip-card-front h3,
  .flip-card-back h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }

  /* .flip-card {
    height: 300px;
  } */
  .flip-card-front p,
  .flip-card-back p {
    font-size: 13px;
    line-height: 1.5;
  }
}

/* ================= VERY SMALL SCREENS (<=360px) ================= */
@media screen and (max-width: 360px) {
  .story-icon {
    width: 50px;
    height: 50px;
  }
  .flip-card-front h3,
  .flip-card-back h3 {
    font-size: 15px;
  }

  .flip-card-front p,
  .flip-card-back p {
    font-size: 12px;
    line-height: 1.4;
  }

}

/* ================= ULTRA SMALL SCREENS (<=280px) ================= */
@media screen and (max-width: 280px) {
  .flip-card-front h3,
  .flip-card-back h3 {
    font-size: 14px;
  }

  .flip-card-front p,
  .flip-card-back p {
    font-size: 11px;
    line-height: 1.3;
  }
}