/* Mobil anasayfa grid + footer — custom.css çakışmalarını geçersiz kılar */

/* Anasayfa — tüm ekranlarda kompakt ritim (custom.css v18 ile uyumlu) */
#content {
  --home-y-top: clamp(20px, 2.5vw, 28px);
  --home-y-top-tight: clamp(16px, 2vw, 22px);
  --home-y-bottom: clamp(32px, 4vw, 48px);
  --home-header-gap: clamp(16px, 2vw, 22px);
}

@media (max-width: 1020px) {

  #content {
    --home-y-top: clamp(14px, 2vw, 18px);
    --home-y-top-tight: 12px;
    --home-y-bottom: clamp(24px, 3.2vw, 32px);
    --home-header-gap: clamp(12px, 1.8vw, 16px);
  }

  /* Anasayfa bölümleri — mobil sıkı ritim */
  .services-offer-section.home-services,
  .projects-section.home-gallery,
  .news-carousel-section,
  .quote-section,
  .marquee-section,
  .testimonial-section,
  .sss-section--home {
    padding-top: var(--home-y-top, clamp(14px, 2vw, 18px)) !important;
    padding-bottom: var(--home-y-bottom, clamp(24px, 3.2vw, 32px)) !important;
  }
  .banner-section + .services-offer-section.home-services {
    padding-top: var(--home-y-top-tight, 12px) !important;
  }
  .home-services-header,
  .home-gallery-header,
  .news-carousel-header,
  .testimonial-section .title-section,
  .sss-section--home .sss-header {
    margin-bottom: var(--home-header-gap, clamp(12px, 1.8vw, 16px)) !important;
    margin-top: 0 !important;
  }
  .home-services .service-link {
    display: none !important;
  }

  /* Hizmetler & haberler — 2 sütun */
  .listing-grid,
  .row.listing-grid,
  .home-services-grid,
  .news-grid-3,
  .row.news-grid-3,
  .news-carousel-section .news-grid-3 {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: var(--grid-gap, 12px) !important;
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
  .services-offer-section .col-sm-4,
  .services-offer-section .listing-grid__cell,
  .listing-grid > .listing-grid__cell,
  .listing-grid > [class*="col-"],
  .news-grid-3 > .news-carousel-card {
    width: auto !important;
    max-width: 100% !important;
    float: none !important;
    min-width: 0 !important;
  }
  .listing-grid .service-card,
  .listing-grid .offer-post.service-card,
  .news-grid-3 .news-carousel-card {
    height: 100%;
  }
  .service-body h3,
  .service-body h3 a,
  .ncc-body h3,
  .ncc-body h3 a {
    font-size: clamp(12px, 3.4vw, 14px) !important;
    line-height: 1.35 !important;
  }
  .service-body p,
  .ncc-body p {
    font-size: clamp(11px, 3vw, 13px) !important;
    line-height: 1.45 !important;
  }

  /* Foto galeri — tek sütun */
  .gallery-grid,
  .home-gallery-grid,
  .row.gallery-grid,
  .projects-section .gallery-masonry {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  .gallery-grid .gallery-item,
  .gallery-grid .gallery-item:nth-child(6n+1),
  .gallery-grid .gallery-item:nth-child(6n+2) {
    grid-column: span 1 !important;
    width: auto !important;
    float: none !important;
  }
  .gallery-grid .gallery-item:nth-child(6n+1) .gallery-card,
  .gallery-grid .gallery-item:nth-child(6n+2) .gallery-card {
    aspect-ratio: var(--card-ratio, 4 / 3) !important;
  }

  /* Galeri — mobilde başlık ve büyütme butonu gizli, tüm karta tıklanır */
  .gallery-grid .gallery-card .gallery-hover,
  .home-gallery-grid .gallery-card .gallery-hover,
  .projects-section .gallery-grid .gallery-card .gallery-hover,
  .projects-section .gallery-card .gallery-hover {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    pointer-events: none !important;
  }
  .gallery-grid .gallery-card,
  .home-gallery-grid .gallery-card,
  .projects-section .gallery-grid .gallery-card {
    cursor: pointer !important;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .gallery-grid .gallery-card:active,
  .home-gallery-grid .gallery-card:active {
    opacity: 0.94;
  }
  .gallery-grid .gallery-card > img,
  .home-gallery-grid .gallery-card > img {
    pointer-events: none;
  }

  /* Anasayfa iletişim haritası — mobilde gizli */
  .quote-section #map {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: hidden !important;
  }

  /* Footer — taşma ve sütun düzeni */
  .up-footer.footer-main {
    padding: 28px 0 22px !important;
    overflow: hidden;
    box-sizing: border-box;
  }
  .up-footer.footer-main .container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: clamp(14px, 4vw, 20px) !important;
    padding-right: clamp(14px, 4vw, 20px) !important;
    box-sizing: border-box;
  }
  .footer-main-grid {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    align-items: start !important;
  }
  .footer-main-block,
  .footer-main-block--nav,
  .footer-main-block--map,
  .footer-main-block--contact,
  .footer-main-block--gallery {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .footer-main-block--contact {
    order: 3;
  }
  .footer-main-map,
  .footer-main-map .footer-map,
  .footer-main-map .lazy-map-sm {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .footer-main-contact-panel {
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box;
  }
  .footer-main-contact__value,
  .footer-main-contact__value--plain,
  a.footer-main-contact__value {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
  footer .footer-bottom {
    width: 100% !important;
    max-width: 100% !important;
    overflow: hidden;
    box-sizing: border-box;
  }
}

@media (max-width: 480px) {
  .listing-grid,
  .row.listing-grid,
  .home-services-grid,
  .news-grid-3,
  .row.news-grid-3 {
    gap: 10px !important;
  }
  .gallery-grid,
  .home-gallery-grid {
    gap: 10px !important;
  }
}

