/* === MOBİL VE TABLET AYARLARI === */

/* 📱 Mobil ayarları (600px ve altı) */
@media (max-width: 600px) {
  .container {
    padding: 14px;
  }
  header.card {
    padding: 36px 16px;
    border-radius: 20px;
  }
  .card {
    padding: 18px;
    border-radius: 16px;
  }
  .pill {
    font-size: 12px;
    padding: 6px 10px;
    gap: 6px;
  }
  h1 {
    font-size: clamp(24px, 7vw, 34px);
  }
  .time {
    min-width: 70px;
    padding: 10px;
    border-radius: 12px;
  }
  .time b {
    font-size: 22px;
  }
  .btn {
    padding: 12px 16px;
    font-size: 14px;
    border-radius: 24px;
  }
  .audio-player {
    gap: 8px;
  }
  #trackTitle {
    font-size: 15px;
  }

  /* === GALERİ DEĞİŞİKLİĞİ (Mobil Grid) BAŞLANGIÇ === */

  .gallery {
    display: grid;
    column-count: unset;
    column-gap: unset;

    /* Mobil Grid ayarları */
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 10px;
  }
  .gbox {
    break-inside: unset;
    margin-bottom: 0;
  }
  .gbox > img {
    height: 160px;
    object-fit: cover;
    border-radius: 12px;
  }

  .gallery-scroll {
    max-height: 60vh;
  }
  .timeline-scroll {
    max-height: 50vh;
  }
  .timeline {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
  }
  .tcard {
    padding: 12px;
    border-radius: 12px;
  }
  .tcard h3 {
    font-size: 15px;
  }
  .modal-card,
  .gate-card {
    width: 92vw;
    padding: 18px;
    border-radius: 18px;
  }
  .letter-body {
    max-height: 56vh;
    padding-right: 4px;
  }
  .lb-prev {
    left: 8px !important;
  }
  .lb-next {
    right: 8px !important;
  }
  .stars {
    opacity: 0.5;
  }
  .hearts {
    pointer-events: none;
  }
}

/* 📱 Tablet Ayarları (820px ve altı) */
@media (max-width: 820px) {
  @media (min-width: 601px) {
    .gallery {
      display: grid;
      column-count: unset;
      column-gap: unset;

      /* Tablet Grid ayarları */
      grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
      gap: 12px;
    }
    .gbox {
      break-inside: unset;
      margin-bottom: 0;
    }
    .gbox > img {
      height: 180px;
      object-fit: cover;
    }
  }

  .timeline-scroll {
    max-height: 56vh;
  }
  .audio-player {
    flex-wrap: wrap;
  }
  .contract-area {
    grid-template-columns: 1fr;
  }
  .contract-img {
    max-width: 90vw;
  }

  /* Evlilik Sözleşmesi mobil kaydırma ve noktalar */
  #contractArea {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    gap: 16px;
    background: #ffffff08;
    border: 1px solid var(--ring);
    border-radius: 18px;
    padding: 16px 8vw;
    scroll-snap-type: x mandatory;
    scroll-padding: 8vw;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #contractArea::-webkit-scrollbar {
    display: none;
  }
  #contractArea .contract-box {
    flex: 0 0 80vw;
    display: flex;
    justify-content: center;
    align-items: center;
    scroll-snap-align: center;
  }
  #contractArea .contract-img {
    width: 90%;
    height: auto;
    border-radius: 16px;
    border: 1px solid #ffffff22;
    box-shadow: 0 8px 20px #0008;
  }
  .contract-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 14px;
  }
  .contract-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    border: 2px solid #a855f7;
    transition: all 0.25s ease;
  }
  .contract-dot.active {
    background: radial-gradient(circle, #a855f7 40%, #8b5cf6 100%);
    box-shadow: 0 0 10px #a855f788;
    transform: scale(1.05);
  }
}

/* 📱 Lightbox mobil iyileştirmeleri (768px altı) */
@media (max-width: 768px) {
  #lbOverlay {
    background: transparent !important;
  }
  .lb-prev,
  .lb-next {
    display: none !important;
  }
  #vol {
    display: none;
  }
}

/* Lightbox masaüstü oklarının konumu (641px üstü) */
@media (min-width: 641px) {
  .lb-btn {
    position: fixed !important;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100000;
  }
  .lb-prev {
    left: 16px !important;
    right: auto !important;
  }
  .lb-next {
    right: 16px !important;
    left: auto !important;
  }
}

/* 💍 Evlilik Sözleşmesi — masaüstünde biraz küçült (1024px üstü) */
@media (min-width: 1024px) {
  .contract-card {
    padding: 18px 22px;
  }
  .contract-area {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
  }
  .contract-img {
    max-width: 320px;
    aspect-ratio: 9 / 16;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 6px 16px #0006;
  }
  .contract-box {
    padding: 8px;
    border-radius: 12px;
  }
  .contract-card h2 {
    font-size: 20px;
    margin-bottom: 6px;
  }
}
