/* Shared mobile & tablet responsive fixes */

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: hidden;
  width: 100%;
}

img,
picture,
picture img,
video {
  max-width: 100%;
}

.nav-logo img,
.footer-logo img {
  background: transparent !important;
}

.project-img picture,
.project-img picture img,
.hero-media picture,
.hero-media picture img,
.gallery-grid-card picture,
.gallery-grid-card picture img,
#gallery .gallery-item picture,
#gallery .gallery-item picture img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inner {
  width: 100%;
  max-width: 1200px;
  margin-inline: auto;
}

/* —— Project listing grids —— */
.projects-grid {
  min-width: 0;
}

.project-card {
  min-width: 0;
  max-width: 100%;
}

.project-owner,
.project-content h3,
.project-content p {
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* Tablet */
@media (max-width: 1024px) {
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 22px !important;
  }

  .section {
    padding: 80px clamp(18px, 4vw, 32px) !important;
  }

  .section-head {
    margin-bottom: 40px !important;
  }
}

/* Mobile */
    @media (max-width: 768px) {
      .packages-grid {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-top: 36px;
      }

      .packages-grid-wrap {
        overflow: visible;
        margin-inline: 0;
        padding-inline: 0;
      }

      .pkg-card {
        padding: 30px 24px;
      }
    }

    @media (max-width: 640px) {
  #navbar {
    height: 66px;
    padding-inline: 16px !important;
  }

  .nav-logo img {
    height: 40px;
  }

  .mobile-menu {
    top: 76px;
    left: 12px;
    right: 12px;
  }

  .section {
    padding: 64px 16px !important;
  }

  .section-head {
    margin-bottom: 32px !important;
    text-align: center;
  }

  .section-title {
    font-size: clamp(1.65rem, 7.5vw, 2.1rem) !important;
    line-height: 1.12 !important;
  }

  .section-sub {
    font-size: 0.86rem !important;
    line-height: 1.65 !important;
    margin-top: 12px !important;
  }

  .projects-grid {
    grid-template-columns: 1fr !important;
    gap: 18px !important;
  }

  .project-card {
    border-radius: 16px !important;
  }

  .project-img {
    height: 220px !important;
    min-height: 220px !important;
    max-height: 220px !important;
  }

  .project-badge {
    left: 12px !important;
    bottom: 12px !important;
    padding: 6px 10px !important;
    font-size: 0.58rem !important;
  }

  .project-content {
    padding: 16px 14px 18px !important;
  }

  .project-owner {
    font-size: clamp(1.15rem, 5.2vw, 1.4rem) !important;
    line-height: 1.2 !important;
    margin-bottom: 4px !important;
  }

  .project-content h3 {
    font-size: clamp(0.92rem, 3.8vw, 1.05rem) !important;
    margin-bottom: 6px !important;
  }

  .project-content p {
    font-size: 0.82rem !important;
    line-height: 1.6 !important;
  }

  .view-gallery {
    margin-top: 12px !important;
    font-size: 0.66rem !important;
    letter-spacing: 0.1em !important;
  }

  .project-meta {
    gap: 8px !important;
    padding-top: 14px !important;
    margin-top: 14px !important;
  }

  .project-meta span {
    font-size: 0.76rem !important;
    line-height: 1.4 !important;
    white-space: normal !important;
    align-items: flex-start !important;
  }

  .float-btn {
    position: fixed !important;
    right: max(14px, env(safe-area-inset-right, 0px)) !important;
    bottom: max(14px, env(safe-area-inset-bottom, 0px)) !important;
    width: 48px;
    height: 48px;
    font-size: 1.15rem;
  }

  .page-hero {
    height: auto !important;
    min-height: calc(300px + var(--navbar-hero-space, 88px));
    margin-top: 0 !important;
    padding: var(--navbar-hero-space, 88px) 16px 40px;
  }

  .page-hero-inner h1 {
    font-size: clamp(1.85rem, 8vw, 2.35rem) !important;
    line-height: 1.1 !important;
  }

  .page-hero-inner p {
    font-size: 0.88rem !important;
    line-height: 1.6 !important;
  }

  .breadcrumb {
    font-size: 0.68rem !important;
    gap: 6px !important;
  }

  .back-row {
    margin-bottom: 20px !important;
  }

  .main-footer {
    padding: 44px 18px 20px !important;
  }

  .footer-grid {
    grid-template-columns: 1fr !important;
    gap: 28px !important;
  }

  .footer-text {
    max-width: 100% !important;
  }

  .modal {
    padding: 10px !important;
    align-items: flex-end !important;
  }

  .modal-box {
    max-height: 92vh !important;
    border-radius: 16px 16px 0 0 !important;
    width: 100% !important;
  }

  .modal-header {
    padding: 16px !important;
  }

  .modal-title {
    font-size: 1.25rem !important;
  }

  .gallery-viewer-body {
    padding: 14px 14px 20px !important;
  }

  .viewer-main-frame {
    height: min(42vh, 280px) !important;
    min-height: 180px !important;
  }

  .viewer-thumb img {
    width: 64px !important;
    height: 44px !important;
  }

  .lightbox {
    padding: 12px !important;
  }

  .lightbox-inner {
    padding: 0 32px !important;
  }

  .lightbox-nav {
    width: 38px !important;
    height: 38px !important;
    font-size: 0.85rem !important;
  }

  .lightbox-close {
    top: max(10px, env(safe-area-inset-top, 0px)) !important;
    right: 10px !important;
    width: 40px !important;
    height: 40px !important;
  }

  .cta-section {
    padding: 52px 18px !important;
  }

  .cta-section h2 {
    font-size: clamp(1.6rem, 7vw, 2rem) !important;
  }
}

/* Index — project gallery */
@media (max-width: 768px) {
  #gallery .gallery-grid {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
    margin-top: 28px !important;
    gap: 12px !important;
  }

  #gallery .gallery-item {
    height: 230px !important;
    min-height: 200px !important;
  }

  #gallery .gallery-item:first-child {
    grid-row: auto !important;
    height: 260px !important;
  }

  #gallery .gallery-overlay {
    opacity: 1 !important;
    padding: 14px 16px !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #gallery .gallery-overlay span {
    font-size: 0.8rem !important;
    line-height: 1.35 !important;
    padding: 6px 10px !important;
    display: inline-block;
    max-width: 100%;
    white-space: normal;
    word-break: break-word;
  }
}

/* Gallery images stay sharp on mobile — no backdrop blur on image containers */
@media (max-width: 768px) {
  #gallery .gallery-item,
  .project-card,
  .project-img {
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
  }

  #gallery .gallery-item img,
  .project-img img {
    filter: none !important;
  }
}

/* Very small phones */
@media (max-width: 380px) {
  .section {
    padding-inline: 14px !important;
  }

  .project-img {
    height: 200px !important;
    min-height: 200px !important;
    max-height: 200px !important;
  }

  #gallery .gallery-item,
  #gallery .gallery-item:first-child {
    height: 200px !important;
  }
}
