/* ==========================================================================
   JHON LAWRENCE C. CABOLBOL — Responsive Stylesheet
   Breakpoints: 1200px | 992px | 768px | 576px
   ========================================================================== */


/* --------------------------------------------------------------------------
   ≥ 1200px — small desktop
   -------------------------------------------------------------------------- */
@media (max-width: 1200px) {
  .services-grid,
  .works-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .pricing-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
  }

  .masonry {
    columns: 3;
  }
}


/* --------------------------------------------------------------------------
   ≤ 992px — laptop / tablet landscape
   -------------------------------------------------------------------------- */
@media (max-width: 992px) {
  .masonry {
    columns: 2;
  }

  .about-grid,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .about-image {
    max-width: 480px;
    margin-inline: auto;
  }

  /* About bio text centers to match the page's centered sections */
  .about-copy {
    text-align: center;
  }

  .contact-info {
    text-align: center;
  }

  .contact-details {
    align-items: center;
  }

  /* Stack each contact row (icon above text) so rows center evenly */
  .contact-detail {
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 8px;
  }

  .contact-info .social-links {
    justify-content: center;
  }

  /* Center the contact form so it doesn't stretch full-width under the info */
  .contact-form {
    max-width: 640px;
    margin-inline: auto;
  }

  /* Inner-page left-aligned headers become centered on small screens */
  .section-header.left {
    text-align: center;
    margin-inline: auto;
  }

  /* Center the about timeline to match the centered header above it */
  .timeline {
    max-width: 560px;
    padding-left: 0;
    margin-inline: auto;
  }

  .timeline::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .timeline-item {
    padding: 28px 0 40px;
    text-align: center;
  }

  .timeline-item::before {
    left: 50%;
    transform: translateX(-50%);
  }

  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 36px;
  }

  /* Third column (Get In Touch) spans the full row once the grid drops to 2 columns */
  .footer-col:nth-child(3) {
    grid-column: 1 / -1;
  }

  .slider-nav.prev {
    left: -6px;
  }

  .slider-nav.next {
    right: -6px;
  }
}


/* --------------------------------------------------------------------------
   ≤ 768px — tablet / large phone
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
  /* Off-canvas mobile navigation */
  .nav-links {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 950;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    background: var(--glass);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
  }

  /* Fallback so the menu panel is readable even without backdrop support */
  @supports not ((backdrop-filter: blur(24px)) or (-webkit-backdrop-filter: blur(24px))) {
    .nav-links {
      background: rgba(13, 13, 13, 0.97);
    }
    html[data-theme="light"] .nav-links {
      background: rgba(245, 243, 239, 0.97);
    }
  }

  .nav-links.open {
    opacity: 1;
    visibility: visible;
  }

  .nav-link {
    font-size: 1.15rem;
    padding: 12px 22px;
  }

  .nav-link::after {
    left: 50%;
    right: 50%;
    bottom: 6px;
  }

  .nav-link.active::after {
    left: 22px;
    right: 22px;
  }

  .hamburger {
    display: flex;
  }

  .hero-title {
    font-size: clamp(2.1rem, 9vw, 3.2rem);
  }

  .stats-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .services-grid,
  .works-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .work-card.wide {
    grid-column: span 1;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
    max-width: 440px;
    margin-inline: auto;
  }

  .pricing-card.popular {
    transform: scale(1.02);
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .contact-form {
    padding: 30px 22px;
  }

  .slider-track {
    min-height: 400px;
  }

  .slider-nav {
    width: 42px;
    height: 42px;
  }

  .slider-nav.prev {
    left: 0;
  }

  .slider-nav.next {
    right: 0;
  }

  .lightbox-btn {
    width: 44px;
    height: 44px;
  }

  .lightbox-prev {
    left: 14px;
  }

  .lightbox-next {
    right: 14px;
  }

  .lightbox-close {
    top: 16px;
    right: 16px;
  }

  .page-hero {
    padding: calc(var(--nav-height) + 40px) 0 60px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom {
    justify-content: center;
    text-align: center;
  }
}


/* --------------------------------------------------------------------------
   ≤ 576px — small phone
   -------------------------------------------------------------------------- */
@media (max-width: 576px) {
  .hero-cta {
    flex-direction: column;
    align-items: center;
    width: 100%;
  }

  .hero-content {
    padding: 110px 16px 70px;
  }

  /* Compress the long name on small screens */
  .logo-mark {
    width: 34px;
    height: 34px;
    font-size: 1.05rem;
  }

  .logo-text {
    font-size: 0.88rem;
  }

  .logo-text em {
    font-size: 0.5rem;
  }

  .hero-cta .btn {
    width: 100%;
    max-width: 320px;
  }

  .hero-eyebrow {
    letter-spacing: 0.24em;
  }

  .scroll-indicator {
    display: none;
  }

  .masonry {
    columns: 1;
  }

  .stats-grid {
    grid-template-columns: 1fr 1fr;
  }

  .filter-btn {
    flex: 1 1 auto;
    min-width: 96px;
    text-align: center;
    padding: 9px 14px;
  }

  .section {
    padding-block: 60px;
  }

  .map-embed,
  .map-embed iframe {
    min-height: 320px;
  }

  /* Keep the map info card inside the map on small screens */
  .map-embed .map-card {
    left: 12px;
    right: 12px;
    bottom: 12px;
    transform: none;
    padding: 12px 16px;
    font-size: 0.7rem;
    letter-spacing: 0.08em;
  }

  .contact-form {
    padding: 26px 20px;
  }

  .back-to-top {
    right: 16px;
    bottom: 16px;
    width: 44px;
    height: 44px;
  }

  .footer-bottom {
    flex-direction: column;
  }
}


/* --------------------------------------------------------------------------
   Touch devices — reveal captions that normally appear on hover
   -------------------------------------------------------------------------- */
@media (hover: none) {
  .work-info,
  .masonry-overlay {
    opacity: 1;
  }

  .work-info,
  .masonry-overlay h3,
  .masonry-overlay p {
    transform: translateY(0);
  }
}


/* --------------------------------------------------------------------------
   ≤ 400px — very small phones (keep the navbar from overflowing)
   -------------------------------------------------------------------------- */
@media (max-width: 400px) {
  .nav-inner {
    gap: 10px;
  }

  .logo {
    gap: 8px;
  }

  .logo-text {
    font-size: 0.78rem;
  }

  .logo-text em {
    font-size: 0.46rem;
  }

  .theme-toggle,
  .hamburger {
    width: 38px;
    height: 38px;
  }

  .nav-actions {
    gap: 8px;
  }
}


/* --------------------------------------------------------------------------
   ≤ 360px — smallest phones (extra safety for the long brand name)
   -------------------------------------------------------------------------- */
@media (max-width: 360px) {
  .logo-text {
    font-size: 0.72rem;
  }

  .logo {
    gap: 6px;
  }

  .contact-form {
    padding: 24px 16px;
  }
}
