/* ==========================================================================
   VANAVIL PHOTOGRAPHY - Responsive & Uncropped Image System
   Fully optimized for all screen sizes:
   - Small Phones (320px - 480px)
   - Medium Phones (481px - 767px)
   - Tablets & iPad (768px - 1023px)
   - Laptops & Desktops (1024px - 1439px)
   - Large Displays (1440px - 1919px)
   - 4K / Ultra-wide Displays (1920px+)
   ========================================================================== */

/* Hidden Helpers */
.hidden { display: none !important; }
@media (max-width: 767px) {
  .hidden-mobile { display: none !important; }
}
@media (min-width: 768px) and (max-width: 1023px) {
  .hidden-tablet { display: none !important; }
}
@media (min-width: 1024px) {
  .hidden-desktop { display: none !important; }
}

/* Image & Media Helpers */
html, body {
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

img, video, iframe, canvas {
  max-width: 100%;
  height: auto;
}

.img-fluid {
  max-width: 100%;
  height: auto;
  display: block;
}

.img-cover {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 20%;
}

/* Grid System Overrides */
.grid-2 { grid-template-columns: 1fr; }
.grid-3 { grid-template-columns: 1fr; }
.grid-4 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

/* Order Helpers */
@media (max-width: 767px) {
  .order-first-mobile { order: -1; }
  .order-last-mobile { order: 99; }
}

/* ==========================================================================
   Universal Uncropped Gallery & Masonry System
   ========================================================================== */
.gallery-grid {
  column-count: 3;
  column-gap: 1.25rem;
  width: 100%;
}

.gallery-grid img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  break-inside: avoid;
  background-color: rgba(0, 0, 0, 0.03);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease;
  cursor: pointer;
}

.masonry-grid {
  column-count: 3;
  column-gap: 1.25rem;
  width: 100%;
}

.masonry-item {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  margin-bottom: 1.25rem;
  display: block;
  break-inside: avoid;
  width: 100%;
  background-color: #111111;
  cursor: pointer;
}

.masonry-item img {
  width: 100% !important;
  height: auto !important;
  display: block !important;
  object-fit: contain !important;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.masonry-item:hover img {
  transform: scale(1.04);
}

/* Base Service Card ("What We Do" - 100% Uncropped Studio Cards) */
.service-card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: #141414;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: var(--color-white);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s ease, border-color 0.4s ease;
  height: 100%;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(197, 160, 89, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.6);
}

.service-card-media {
  position: relative;
  width: 100%;
  aspect-ratio: 3/2; /* Native 4096x2730 photography ratio - ZERO CROPPING */
  overflow: hidden;
  background-color: #0d0d0d;
}

.service-card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
  transition: transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.service-card:hover .service-card-img {
  transform: scale(1.06);
}

.service-card-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: var(--color-gold);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  padding: 0.2rem 0.6rem;
  border-radius: 20px;
  z-index: 2;
}

.service-card-body {
  padding: 1.25rem 1.25rem 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  justify-content: space-between;
  background: #141414;
}

.service-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.service-card-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 500;
  color: #ffffff;
  margin: 0;
  transition: color 0.3s ease;
}

.service-card:hover .service-card-title {
  color: var(--color-gold);
}

.service-card-arrow {
  color: var(--color-gold);
  font-size: 1.25rem;
  transition: transform 0.3s ease;
}

.service-card:hover .service-card-arrow {
  transform: translateX(6px);
}

.service-card-desc {
  font-size: 0.825rem;
  color: rgba(255, 255, 255, 0.7);
  line-height: 1.5;
  margin: 0 0 1rem 0;
}

.service-card-action {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-gold);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0.85;
  transition: opacity 0.3s ease;
}

.service-card:hover .service-card-action {
  opacity: 1;
}


/* ==========================================================================
   1. SMALL PHONES (max-width: 480px)
   ========================================================================== */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .container {
    padding: 0 1rem;
  }

  .section {
    padding: 3rem 0;
  }

  /* Header */
  :root {
    --header-height: 80px;
  }

  .header {
    height: 80px;
  }

  .header-container {
    padding: 0 1rem;
  }

  .logo img {
    max-width: min(160px, 48vw);
    height: auto;
    max-height: 52px;
    object-fit: contain;
  }

  /* Hero */
  .hero {
    padding-top: 80px;
    padding-bottom: 2.5rem;
    min-height: 100svh;
  }

  .hero-content {
    padding: 0 0.75rem;
  }

  .hero-title {
    font-size: clamp(2rem, 9vw, 2.75rem) !important;
    line-height: 1.15 !important;
  }

  .hero-subtitle {
    font-size: 0.7rem !important;
    letter-spacing: 0.15em !important;
    margin-bottom: 0.75rem !important;
  }

  .hero-desc {
    font-size: 0.9rem !important;
    margin-bottom: 1.75rem !important;
  }

  .hero-actions {
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
  }

  .hero-actions .btn {
    width: 100%;
    max-width: 280px;
    padding: 0.85rem 1.25rem;
    font-size: 0.75rem;
  }

  .hero-scroll {
    font-size: 0.625rem;
    bottom: 1rem;
  }

  /* Headings */
  h1 { font-size: 1.85rem; }
  h2 { font-size: 1.6rem; }
  h3 { font-size: 1.25rem; }
  h4 { font-size: 1.1rem; }

  /* Service Cards on Small Phones */
  .service-card {
    min-height: unset !important;
    max-height: unset !important;
    aspect-ratio: unset !important;
    margin-bottom: 1rem;
  }

  .service-card-media {
    aspect-ratio: 3/2 !important;
  }

  /* Gallery Grid on Small Phones: 1 Column (Full Width, Zero Cropping) */
  .gallery-grid {
    column-count: 1 !important;
    column-gap: 0 !important;
  }

  .gallery-grid img {
    margin-bottom: 0.85rem !important;
    border-radius: 6px !important;
  }

  /* Masonry Grid on Small Phones */
  .masonry-grid {
    column-count: 1 !important;
    column-gap: 0 !important;
  }

  .masonry-item {
    margin-bottom: 1rem !important;
  }

  /* Page Hero */
  .page-hero {
    height: 45vh !important;
    min-height: 300px !important;
    max-height: 400px !important;
  }

  .page-hero-title {
    font-size: 1.75rem !important;
  }

  .page-hero-content {
    padding: 0 1rem;
  }

  /* Portfolio Filter Bar: Horizontal Scroll on Mobile */
  .portfolio-filters {
    display: flex !important;
    flex-wrap: nowrap !important;
    overflow-x: auto !important;
    justify-content: flex-start !important;
    gap: 0.5rem !important;
    padding: 0.5rem 0.25rem 1rem !important;
    margin-bottom: 1.5rem !important;
    -webkit-overflow-scrolling: touch !important;
    scrollbar-width: none !important;
  }

  .portfolio-filters::-webkit-scrollbar {
    display: none !important;
  }

  .filter-btn {
    flex-shrink: 0 !important;
    padding: 0.5rem 1rem !important;
    font-size: 0.7rem !important;
    border-radius: 25px !important;
  }

  /* Stats */
  .stat-num {
    font-size: 2.25rem !important;
  }

  .stat-label {
    font-size: 0.7rem !important;
  }

  .stats-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1rem !important;
    padding: 1.5rem 0 !important;
  }

  /* Testimonials */
  .testimonial-text {
    font-size: 1.125rem !important;
    padding: 0 0.5rem;
  }

  /* Floating Socials */
  .floating-socials {
    bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    gap: 8px !important;
  }

  .floating-socials .social-icon {
    width: 38px !important;
    height: 38px !important;
  }

  .floating-socials .social-icon svg {
    width: 18px !important;
    height: 18px !important;
  }

  /* Footer */
  .footer {
    padding: 3rem 0 1.5rem;
  }

  .footer-top {
    grid-template-columns: 1fr !important;
    text-align: center;
    gap: 2rem;
  }

  .footer-col p {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-col .flex {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}


/* ==========================================================================
   2. ALL MOBILE (max-width: 767px)
   ========================================================================== */
@media (max-width: 767px) {
  .section {
    padding: 3.5rem 0;
  }

  /* Header */
  :root {
    --header-height: 90px;
  }

  .header {
    height: 90px;
  }

  .logo img {
    max-width: min(190px, 50vw);
    height: auto;
    max-height: 60px;
  }

  /* Service Cards on Mobile */
  .service-card {
    min-height: unset !important;
    max-height: unset !important;
    aspect-ratio: unset !important;
    height: 100% !important;
  }

  .service-card-media {
    aspect-ratio: 3/2 !important;
  }

  /* Gallery Grid on Mobile (2 columns waterfall) */
  .gallery-grid {
    column-count: 2 !important;
    column-gap: 0.65rem !important;
    display: block !important;
  }

  .gallery-grid img {
    margin-bottom: 0.65rem !important;
    border-radius: 4px !important;
    height: auto !important;
    width: 100% !important;
    object-fit: contain !important;
  }

  /* Masonry Grid on Mobile */
  .masonry-grid {
    column-count: 1 !important;
    column-gap: 0 !important;
    display: block !important;
  }

  .masonry-item {
    margin-bottom: 1.25rem !important;
  }

  .masonry-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Page Hero */
  .page-hero {
    height: 48vh !important;
    min-height: 320px !important;
    max-height: 440px !important;
  }

  .page-hero-bg {
    object-position: center 20% !important;
  }

  /* Services Page: Stack Service List items */
  .service-list-item {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
    padding: 2rem 0 !important;
  }

  .service-list-img {
    max-height: 440px !important;
    width: 100% !important;
    height: auto !important;
    object-fit: cover !important;
    object-position: center 22% !important;
    border-radius: 8px !important;
  }

  /* Team Grid (About page) */
  .team-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.25rem !important;
  }

  .team-img-wrap {
    aspect-ratio: 3/4;
    border-radius: 6px;
    overflow: hidden;
  }

  .team-img {
    object-position: center 20% !important;
  }

  /* Philosophy Grid (About page) */
  .philosophy-grid {
    grid-template-columns: 1fr !important;
    gap: 2rem !important;
  }

  /* Booking & Contact Forms */
  .form-row, .grid.grid-2 {
    grid-template-columns: 1fr !important;
  }

  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="date"],
  input[type="number"],
  select,
  textarea {
    font-size: 16px !important; /* Prevents auto-zoom on iOS Safari */
  }

  /* Instagram Grid */
  .insta-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Stats Grid */
  .stats-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 1.5rem !important;
  }

  /* Mobile Nav Links */
  .mobile-nav .nav-link {
    font-size: 1.75rem;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: 1fr !important;
    gap: 2rem;
  }

  .footer-col {
    text-align: center;
  }

  .footer-col p {
    margin-left: auto;
    margin-right: auto;
  }

  .footer-col .flex {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .footer-legal {
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
  }

  /* Floating Socials */
  .floating-socials {
    bottom: calc(15px + env(safe-area-inset-bottom, 0px)) !important;
    right: 12px !important;
    gap: 8px !important;
  }

  .floating-socials .social-icon {
    width: 40px;
    height: 40px;
  }

  .floating-socials .social-icon svg {
    width: 20px;
    height: 20px;
  }
}


/* ==========================================================================
   3. TABLETS (768px to 1023px)
   ========================================================================== */
@media (min-width: 768px) and (max-width: 1023px) {
  .container {
    padding: 0 2rem;
  }

  :root {
    --header-height: 100px;
  }

  .header {
    height: 100px;
  }

  .logo img {
    max-width: 240px;
    height: auto;
    max-height: 75px;
  }

  /* Hero */
  .hero {
    padding-top: 100px;
  }

  .hero-title {
    font-size: clamp(2.75rem, 6vw, 4rem) !important;
  }

  /* Service Cards on Tablets: 2x4 grid */
  .service-card {
    min-height: unset !important;
    max-height: unset !important;
    aspect-ratio: unset !important;
    height: 100% !important;
  }

  .service-card-media {
    aspect-ratio: 3/2 !important;
  }

  /* Stats Grid */
  .stats-grid.grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 2rem;
  }

  /* Gallery Grid on Tablets: 2 columns */
  .gallery-grid {
    column-count: 2 !important;
    column-gap: 1rem !important;
    display: block !important;
  }

  .gallery-grid img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    margin-bottom: 1rem !important;
  }

  /* Masonry Grid on Tablets: 2 columns */
  .masonry-grid {
    column-count: 2 !important;
    column-gap: 1rem !important;
    display: block !important;
  }

  .masonry-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Instagram Grid */
  .insta-grid {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Page Hero */
  .page-hero {
    height: 50vh !important;
    min-height: 380px !important;
  }

  .page-hero-bg {
    object-position: center 20% !important;
  }

  /* Footer */
  .footer-top {
    grid-template-columns: repeat(2, 1fr) !important;
  }
}


/* ==========================================================================
   4. DESKTOPS (1024px to 1439px)
   ========================================================================== */
@media (min-width: 1024px) {
  :root {
    --header-height: 110px;
  }

  .header {
    height: 110px;
  }

  .logo img {
    max-width: 270px;
    height: auto;
    max-height: 85px;
  }

  .nav-desktop {
    display: flex;
    align-items: center;
    gap: 1.75rem;
  }

  .service-card {
    min-height: unset !important;
    max-height: unset !important;
    aspect-ratio: unset !important;
    height: 100% !important;
  }

  .service-card-media {
    aspect-ratio: 3/2 !important;
  }

  .gallery-grid {
    column-count: 3 !important;
    column-gap: 1.25rem !important;
    display: block !important;
  }

  .gallery-grid img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
    margin-bottom: 1.25rem !important;
  }

  .masonry-grid {
    column-count: 3 !important;
    column-gap: 1.25rem !important;
    display: block !important;
  }

  .masonry-item img {
    width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  .insta-grid {
    grid-template-columns: repeat(6, 1fr) !important;
  }

  .footer-top {
    grid-template-columns: 2fr 1fr 1fr 1.5fr !important;
  }
}


/* ==========================================================================
   5. LARGE DESKTOPS & 4K (1440px+)
   ========================================================================== */
@media (min-width: 1440px) {
  .container {
    max-width: var(--container-width);
  }

  .gallery-grid {
    column-count: 4 !important;
    column-gap: 1.5rem !important;
  }

  .gallery-grid img {
    margin-bottom: 1.5rem !important;
  }

  .service-card {
    min-height: 520px;
  }
}

@media (min-width: 1920px) {
  .container {
    max-width: 1600px;
  }

  .hero-title {
    font-size: 5.5rem !important;
  }
}


/* ==========================================================================
   Touch Device Enhancements
   ========================================================================== */
@media (hover: none) and (pointer: coarse) {
  .service-card-desc {
    max-height: 50px !important;
    opacity: 0.9 !important;
  }

  .hover-zoom:hover img {
    transform: none;
  }

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

  .filter-btn {
    min-height: 44px;
    padding: 0.5rem 1rem;
  }

  .slider-btn {
    width: 48px;
    height: 48px;
  }

  .faq-question {
    min-height: 48px;
  }

  .cursor-dot,
  .cursor-outline {
    display: none !important;
  }
}


/* ==========================================================================
   Safe Area Insets (Notched phones & gesture bars)
   ========================================================================== */
@supports (padding: env(safe-area-inset-bottom)) {
  .footer-bottom {
    padding-bottom: calc(var(--spacing-md) + env(safe-area-inset-bottom));
  }

  .floating-socials {
    bottom: calc(15px + env(safe-area-inset-bottom));
    right: calc(12px + env(safe-area-inset-right));
  }

  .mobile-menu {
    padding-bottom: env(safe-area-inset-bottom);
  }
}


/* ==========================================================================
   Landscape Phone Fix
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
  .hero {
    min-height: auto;
    padding: 90px 0 2rem;
  }

  .page-hero {
    height: 85vh !important;
    min-height: 280px !important;
  }

  .video-section {
    height: 90vh !important;
  }

  .mobile-nav .nav-link {
    font-size: 1.25rem !important;
  }

  .mobile-nav {
    gap: 1rem !important;
  }

  .mobile-menu {
    overflow-y: auto !important;
    padding: 2rem 0 !important;
  }
}
