/* ========================================
   Team Ăn Uống - Du Hí Ninh Bình
   Custom Styles + Polaroid + Timeline
   ======================================== */

:root {
  --green-primary: #2E7D32;
  --green-dark: #1B5E20;
  --green-light: #81C784;
  --beige: #F8F4EC;
  --beige-dark: #EFEBE0;
  --cream: #FAF7F2;
  --accent: #A67C52;
}

* {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Elegant headings */
h1, h2, .section-title {
  font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
}

/* Hero */
.hero {
  background: linear-gradient(rgba(46, 125, 50, 0.35), rgba(27, 94, 32, 0.45)), 
              url('assets/homestay/hs-1.jpg') center/cover no-repeat;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 120px;
  background: linear-gradient(transparent, #F8F4EC);
}

/* Tab / Nav buttons */
.nav-tab {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.nav-tab.active {
  background-color: #2E7D32;
  color: white;
  box-shadow: 0 4px 12px rgba(46, 125, 50, 0.35);
}

.nav-tab:hover:not(.active) {
  background-color: #E8F5E9;
  transform: translateY(-1px);
}

/* ===== POLAROID GALLERY ===== */
.polaroid-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2.5rem;
  padding: 1rem 0;
}

.polaroid {
  background: #fff;
  padding: 14px 14px 46px;
  box-shadow: 
    0 10px 30px -10px rgba(0, 0, 0, 0.25),
    0 4px 6px -1px rgba(0, 0, 0, 0.1);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), 
              box-shadow 0.3s ease;
  position: relative;
  cursor: pointer;
  border: 1px solid #f0e9df;
}

.polaroid::before {
  /* Subtle top tape effect */
  content: '';
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 52px;
  height: 22px;
  background: linear-gradient(#f4e9d8, #e8d9c0);
  box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  border-radius: 2px;
  z-index: 2;
  opacity: 0.85;
}

.polaroid img {
  width: 100%;
  display: block;
  object-fit: cover;
  aspect-ratio: 4 / 3.05;
  border: 1px solid #f4f0e9;
}

.polaroid .caption {
  margin-top: 14px;
  font-size: 0.875rem;
  line-height: 1.3;
  color: #5C4636;
  text-align: center;
  font-family: 'Playfair Display', Georgia, serif;
  font-style: italic;
  letter-spacing: 0.3px;
}

.polaroid:hover {
  transform: scale(1.06) rotate(0deg) !important;
  box-shadow: 
    0 25px 50px -12px rgba(0, 0, 0, 0.3),
    0 10px 10px -6px rgba(0, 0, 0, 0.15);
  z-index: 10;
}

/* Different tilts for nostalgia */
.polaroid:nth-child(1) { transform: rotate(-3.5deg); }
.polaroid:nth-child(2) { transform: rotate(2.8deg); }
.polaroid:nth-child(3) { transform: rotate(-1.2deg); }

/* ===== HOMESTAY GALLERY ===== */
.homestay-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}

.homestay-gallery img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.homestay-gallery img:hover {
  transform: scale(1.03);
  box-shadow: 0 10px 25px rgba(46, 125, 50, 0.15);
}

/* ===== MEMBERS ===== */
.member-card {
  background: #fff;
  border: 1px solid #e6dfd3;
  transition: all 0.2s ease;
}

.member-card:hover {
  transform: translateY(-3px);
  border-color: #81C784;
  box-shadow: 0 8px 20px rgba(46, 125, 50, 0.1);
}

/* ===== VERTICAL TIMELINE ===== */
.timeline {
  position: relative;
  max-width: 980px;
  margin: 0 auto;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 28px;
  top: 0;
  bottom: 0;
  width: 5px;
  background: linear-gradient(to bottom, #2E7D32, #81C784, #2E7D32);
  border-radius: 9999px;
  opacity: 0.9;
}

.timeline-item {
  position: relative;
  margin-bottom: 2.25rem;
  padding-left: 68px;
}

.timeline-item:last-child {
  margin-bottom: 0;
}

.timeline-dot {
  position: absolute;
  left: 16px;
  top: 12px;
  width: 26px;
  height: 26px;
  background: #F8F4EC;
  border: 5px solid #2E7D32;
  border-radius: 9999px;
  box-shadow: 0 0 0 6px rgba(129, 199, 132, 0.2);
  z-index: 2;
}

.timeline-time {
  display: inline-block;
  background: #2E7D32;
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.5px;
  padding: 4px 13px;
  border-radius: 9999px;
  margin-bottom: 8px;
  box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
}

.timeline-card {
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 8px 25px -8px rgba(0, 0, 0, 0.12), 0 3px 8px -3px rgba(0, 0, 0, 0.08);
  border: 1px solid #f0e9df;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.timeline-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 35px -10px rgba(0, 0, 0, 0.16);
}

.timeline-img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.timeline-card:hover .timeline-img {
  transform: scale(1.06);
}

.timeline-label {
  font-size: 0.68rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #A67C52;
  font-weight: 600;
  padding: 2px 0;
}

/* Day divider */
.day-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 3rem 0 1.75rem;
}

.day-divider::before,
.day-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(to right, transparent, #81C784, transparent);
}

.day-divider span {
  background: #E8F5E9;
  color: #1B5E20;
  font-weight: 700;
  font-size: 0.95rem;
  padding: 6px 22px;
  border-radius: 9999px;
  letter-spacing: 1px;
}

/* Note box */
.note-box {
  background: #F8F4EC;
  border-left: 6px solid #2E7D32;
  border-radius: 0 12px 12px 0;
}

/* Lightbox Modal */
#lightbox {
  animation: fadeIn 0.2s ease forwards;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.lightbox-img {
  max-height: 82vh;
  max-width: 92vw;
  object-fit: contain;
  box-shadow: 0 25px 60px -15px rgb(0 0 0 / 0.4);
  border-radius: 8px;
}

/* Footer */
.site-footer {
  background: #1B5E20;
  color: #d1e8d3;
}

/* Responsive tweaks - Mobile (phones) */
@media (max-width: 640px) {
  .hero {
    min-height: 90vh;
  }

  .hero h1 {
    font-size: 2.1rem !important;
    line-height: 1.1 !important;
  }

  .hero p {
    font-size: 1.15rem !important;
    margin-bottom: 1.25rem !important;
  }

  .polaroid-grid {
    gap: 1.5rem;
  }

  /* Make polaroids straight on mobile - tilted looks bad when stacked */
  .polaroid {
    transform: none !important;
    max-width: 100%;
  }

  .polaroid:nth-child(1),
  .polaroid:nth-child(2),
  .polaroid:nth-child(3) {
    transform: none !important;
  }

  .polaroid:hover {
    transform: scale(1.02) !important;
  }

  /* Timeline - tighter + smaller images on phone */
  .timeline::before {
    left: 18px;
  }

  .timeline-item {
    padding-left: 52px;
    margin-bottom: 1.75rem;
  }

  .timeline-dot {
    left: 6px;
    width: 22px;
    height: 22px;
    border-width: 4px;
  }

  .timeline-img {
    height: 165px;
  }

  .timeline-time {
    font-size: 0.7rem;
    padding: 3px 10px;
  }

  .timeline-card {
    border-radius: 14px;
  }

  /* Buttons in hero - better touch targets */
  .hero .flex.flex-wrap button {
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.65rem;
    padding-bottom: 0.65rem;
    font-size: 0.75rem;
  }

  /* Homestay gallery tighter on phone */
  .homestay-gallery {
    gap: 8px;
  }

  .homestay-gallery img {
    border-radius: 10px;
  }

  /* Members cards */
  .member-card {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
  }

  .member-card span.text-3xl {
    font-size: 1.5rem;
  }

  /* Nav on mobile */
  nav .flex.items-center.gap-x-3 img {
    height: 2rem;
  }

  nav .flex.items-center.gap-x-3 .font-bold {
    font-size: 1.1rem;
  }

  /* Tab buttons more compact */
  .nav-tab {
    padding-left: 0.75rem;
    padding-right: 0.75rem;
    font-size: 0.75rem;
  }

  /* Stats cards on mobile */
  .stats-cards {
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    padding-top: 0.75rem !important;
    padding-bottom: 0.75rem !important;
  }

  /* Lightbox close button bigger touch target */
  #lightbox button {
    width: 44px;
    height: 44px;
    font-size: 1.5rem;
    top: -6px;
    right: -6px;
  }
}

/* Extra small phones */
@media (max-width: 380px) {
  .timeline-img {
    height: 145px;
  }

  .polaroid-grid {
    gap: 1.25rem;
  }
}

/* Small polish */
img {
  -webkit-user-drag: none;
}