/* Miller D Photography - Responsive Styles */

/* ============================================
   Mobile First - Base Styles (320px+)
   ============================================ */

/* Base mobile styles are in main.css */

/* ============================================
   Small Mobile (480px+)
   ============================================ */
@media (min-width: 480px) {
  .hero-title {
    font-size: var(--font-size-4xl);
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .gallery-masonry {
    column-count: 2;
  }
}

/* ============================================
   Tablet (768px+)
   ============================================ */
@media (min-width: 768px) {
  :root {
    --header-height: 80px;
  }

  .hero-title {
    font-size: 4.5rem;
  }

  .hero-subtitle {
    font-size: var(--font-size-2xl);
  }

  .section {
    padding: var(--spacing-2xl) 0;
  }

  .grid-2 {
    grid-template-columns: repeat(2, 1fr);
  }

  .grid-3 {
    grid-template-columns: repeat(3, 1fr);
  }

  .grid-4 {
    grid-template-columns: repeat(4, 1fr);
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .gallery-masonry {
    column-count: 3;
  }

  .portfolio-preview {
    grid-template-columns: repeat(2, 1fr);
  }

  .mobile-menu-toggle {
    display: none;
  }

  .nav-list {
    display: flex;
  }

  .hero-nav {
    display: flex;
  }

  .footer-content {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* ============================================
   Desktop (1024px+)
   ============================================ */
@media (min-width: 1024px) {
  .hero-title {
    font-size: 5rem;
  }

  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .gallery-masonry {
    column-count: 4;
  }

  .portfolio-preview {
    grid-template-columns: repeat(3, 1fr);
  }

  .container {
    padding: 0 var(--spacing-lg);
  }

  .section {
    padding: var(--spacing-2xl) 0;
  }
}

/* ============================================
   Large Desktop (1280px+)
   ============================================ */
@media (min-width: 1280px) {
  .gallery-grid {
    grid-template-columns: repeat(5, 1fr);
  }

  .gallery-masonry {
    column-count: 5;
  }

  .portfolio-preview {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============================================
   Mobile Navigation
   ============================================ */
@media (max-width: 767px) {

  html,
  body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Increase usable space on mobile */
  .container,
  .header-container,
  .container-narrow {
    padding: 0 var(--spacing-sm);
  }

  .mobile-menu-toggle {
    display: block;
  }

  .nav {
    position: fixed;
    top: var(--header-height-mobile);
    left: 0;
    right: 0;
    background-color: var(--color-secondary);
    border-bottom: 1px solid var(--color-border);
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-base);
    z-index: 999;
  }

  .nav.active {
    max-height: 500px;
    box-shadow: var(--shadow-md);
  }

  /* Transparent mobile nav on home page when header overlays hero */
  .home .nav {
    background-color: transparent;
    border-bottom: none;
  }

  .home .nav.active {
    box-shadow: none;
    max-height: 500px;
    /* Make mobile nav fully transparent to show hero behind — remove if you prefer a slight backdrop for contrast */
    background-color: transparent;
  }

  .home .nav .nav-list li {
    border-bottom: none;
  }

  .home .nav .nav-link {
    color: var(--header-transparent-text-color, #fff);
  }

  .home .mobile-menu-toggle {
    color: var(--header-transparent-text-color, #fff);
  }

  .nav-list {
    flex-direction: column;
    padding: var(--spacing-md);
    gap: 0;
  }

  .nav-list li {
    width: 100%;
    border-bottom: 1px solid var(--color-border);
  }

  .nav-list li:last-child {
    border-bottom: none;
  }

  .nav-link {
    display: block;
    padding: var(--spacing-sm) 0;
    width: 100%;
  }

  .header {
    height: var(--header-height-mobile);
  }

  .hero {
    margin-top: var(--header-height-mobile);
    min-height: 500px;
  }

  .hero-title {
    font-size: var(--font-size-3xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-lg);
  }

  .hero-nav {
    display: none;
  }

  .hero-controls {
    bottom: var(--spacing-md);
  }

  .section {
    padding: var(--spacing-xl) 0;
  }

  .grid-2,
  .grid-3,
  .grid-4 {
    grid-template-columns: 1fr;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-sm);
  }

  .gallery-masonry {
    column-count: 2;
  }

  .gallery-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .portfolio-preview {
    grid-template-columns: 1fr;
  }

  .pricing-grid {
    grid-template-columns: 1fr;
  }

  .pricing-card.featured {
    transform: scale(1);
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: var(--font-size-xl);
  }

  .lightbox-close {
    top: var(--spacing-sm);
    right: var(--spacing-sm);
    width: 40px;
    height: 40px;
    font-size: var(--font-size-2xl);
  }

  .accordion-header {
    padding: var(--spacing-sm);
    font-size: var(--font-size-sm);
  }

  .btn-large {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: var(--font-size-base);
  }
}

/* ============================================
   Print Styles
   ============================================ */
@media print {

  .header,
  .footer,
  .hero-controls,
  .gallery-controls,
  .nav,
  .mobile-menu-toggle,
  .btn,
  .lightbox {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }

  .section {
    page-break-inside: avoid;
  }

  img {
    max-width: 100%;
    page-break-inside: avoid;
  }
}

/* ============================================
   High DPI Displays
   ============================================ */
@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {

  /* Ensure crisp images on retina displays */
  img {
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
  }
}

/* ============================================
   Landscape Orientation (Mobile)
   ============================================ */
@media (max-width: 767px) and (orientation: landscape) {
  .hero {
    min-height: 400px;
  }

  .hero-title {
    font-size: var(--font-size-2xl);
  }

  .hero-subtitle {
    font-size: var(--font-size-base);
  }
}

/* ============================================
   Accessibility - Reduced Motion
   ============================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}