/* ====================================================
   SID Roofing — Mobile Stylesheet
   style.css — Linked from all pages via <link> tag
   ⚠️  DO NOT add desktop styles here.
       This file contains ONLY mobile/tablet overrides.
       All desktop design lives in each page's <style>.
   ==================================================== */


/* ── @media (max-width: 768px) — tablets & phones ── */
@media (max-width: 768px) {

  /* Prevent horizontal page scroll */
  html, body {
    overflow-x: hidden;
    max-width: 100%;
  }

  /* Images never overflow their container */
  img {
    max-width: 100%;
    height: auto;
  }

  /* Containers get tighter side padding on small screens */
  .container {
    padding: 0 16px;
  }

  /* ── Section vertical padding ── */
  #services,
  #projects,
  #gallery,
  #why,
  #about,
  #quote,
  #contact,
  #facebook,
  #emergency {
    padding: 56px 0;
  }

  /* ── Buttons: always at least 48px tall for easy tapping ── */
  .btn {
    min-height: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 24px;
  }

  /* ── Hero ── */
  .hero-content {
    padding: 36px 0 28px;
  }

  .hero-sub {
    font-size: 1rem;
    margin-bottom: 28px;
  }

  .hero-buttons {
    flex-direction: column;
    gap: 12px;
  }

  .hero-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* ── Emergency section ── */
  .emergency-phone {
    font-size: 1.7rem;
  }

  /* ── Swipeable Photo Gallery ──────────────────────────
     On mobile the masonry column layout becomes a
     horizontal scroll-snap carousel.
     Desktop is NOT affected (rules wrapped in media query).
  ────────────────────────────────────────────────────── */
  .gallery-grid {
    /* Override the desktop CSS-columns masonry */
    columns: unset !important;
    column-gap: unset !important;

    /* Horizontal swipe strip */
    display: flex !important;
    flex-direction: row !important;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 4px 0 16px;

    /* Hide scrollbar visually, keep scrollable */
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .gallery-grid::-webkit-scrollbar {
    display: none;
  }

  /* Each gallery item snaps to center */
  .gallery-item {
    flex: 0 0 85% !important;
    max-width: 85% !important;
    break-inside: unset !important;
    margin-bottom: 0 !important;
    scroll-snap-align: center;
    border-radius: 10px;
    overflow: hidden;
  }

  .gallery-item img {
    width: 100% !important;
    height: 260px !important;
    object-fit: cover !important;
  }

  /* Swipe hint below gallery header */
  .gallery-header::after {
    content: '← Swipe to browse →';
    display: block;
    color: rgba(255, 255, 255, 0.45);
    font-size: 0.78rem;
    letter-spacing: 1px;
    margin-top: 8px;
    text-align: center;
  }

  /* ── About section ── */
  /* Badge normally sits bottom-right of image with negative offset;
     on mobile keep it in-flow so it doesn't get clipped */
  .about-badge-overlay {
    position: relative !important;
    right: auto !important;
    bottom: auto !important;
    margin-top: 14px;
    display: inline-block;
    border-radius: 8px;
  }

  /* ── Quote form ── */
  .quote-form {
    padding: 28px 20px;
    border-radius: 8px;
  }

  /* ── Contact form box ── */
  .contact-form-box {
    padding: 24px 16px;
    border-radius: 8px;
  }

  /* ── Why-us stat boxes ── */
  .why-stats {
    gap: 12px;
  }

  .stat-box .num {
    font-size: 1.9rem;
  }

  /* ── Facebook embed ── */
  .facebook-embed-box {
    width: 100% !important;
    max-width: 100% !important;
    border-radius: 8px;
  }

  /* ── Emergency features wrap cleanly ── */
  .emergency-features {
    gap: 14px;
  }

}


/* ── @media (max-width: 480px) — phones only ── */
@media (max-width: 480px) {

  /* Headings scale down a touch more */
  .section-title {
    font-size: 1.55rem !important;
  }

  /* Hero */
  .hero-title {
    font-size: clamp(1.5rem, 8.5vw, 2rem) !important;
    line-height: 1.15;
  }

  .hero-badges {
    flex-direction: column;
    gap: 12px;
  }

  /* Emergency */
  .emergency-phone {
    font-size: 1.4rem;
  }

  .emergency-features {
    flex-direction: column;
    gap: 10px;
  }

  /* Services */
  .service-card {
    padding: 22px 16px;
  }

  /* Gallery: slightly wider card on the smallest phones */
  .gallery-item {
    flex: 0 0 90% !important;
    max-width: 90% !important;
  }

  .gallery-item img {
    height: 220px !important;
  }

  /* Before / after project images */
  .project-img-wrap img {
    height: 155px;
  }

  /* Quote + contact forms */
  .quote-form {
    padding: 20px 14px;
  }

  .contact-form-box {
    padding: 20px 14px;
  }

  /* Footer links closer together */
  .footer-links {
    gap: 12px;
  }

  /* Nav wordmark slightly smaller */
  .nav-wordmark-top {
    font-size: 0.78rem !important;
    letter-spacing: 1px;
  }

  .nav-wordmark-sub {
    font-size: 0.46rem !important;
  }

  /* Stat boxes */
  .stat-box {
    padding: 20px 14px;
  }

  .stat-box .num {
    font-size: 1.7rem;
  }

  /* Section padding tighter on small phones */
  #services,
  #projects,
  #gallery,
  #why,
  #about,
  #quote,
  #contact,
  #facebook,
  #emergency {
    padding: 44px 0;
  }

}
