/* Poetry Site - Responsive Styles */

/* === MOBILE BASE (< 480px) === */
@media (max-width: 479px) {
  .poem-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 1rem;
  }

  .poem-nav {
    flex-direction: column;
    gap: var(--space-md);
    text-align: center;
  }

  .nav-adjacent {
    gap: var(--space-md);
  }

  .site-header {
    padding: 2rem 1rem 1rem;
  }

  .poem-article {
    padding: var(--space-lg);
  }

  /* Reduce ornament sizes on mobile */
  .poem-card::before,
  .poem-card::after {
    width: 25px;
    height: 25px;
    opacity: 0.4;
  }

  .poem-article::before,
  .poem-article::after {
    width: 40px;
    height: 40px;
    opacity: 0.4;
  }

  /* Disable card breathing for battery */
  .poem-card {
    animation: none;
  }

  /* Smaller drop cap */
  .poem-body p:first-of-type::first-letter {
    font-size: 2.5em;
  }

  /* Simpler title effect */
  .site-title {
    letter-spacing: 0.1em;
  }
}

/* === SMALL TABLETS (480px - 767px) === */
@media (min-width: 480px) and (max-width: 767px) {
  .poem-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
    padding: 1.5rem;
  }
}

/* === TABLET LANDSCAPE / SMALL DESKTOP (768px - 1023px) === */
@media (min-width: 768px) and (max-width: 1023px) {
  .poem-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    padding: 2rem;
  }
}

/* === DESKTOP (1024px+) === */
@media (min-width: 1024px) {
  .poem-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 3rem;
  }
}

/* === LARGE DESKTOP (1280px+) === */
@media (min-width: 1280px) {
  .poem-grid {
    max-width: 1400px;
    grid-template-columns: repeat(4, 1fr);
  }

  .poem-content {
    max-width: 600px;
  }
}

/* === TOUCH DEVICE HANDLING === */
@media (hover: none) and (pointer: coarse) {
  .poem-card:hover {
    transform: none;
  }

  .poem-card:active {
    transform: scale(0.98);
    transition: transform 0.1s ease;
  }

  .poem-body {
    font-size: 1.15rem;
    line-height: 1.85;
  }

  .nav-home,
  .nav-prev,
  .nav-next {
    padding: var(--space-sm);
  }
}

/* === REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  /* Ensure all breathing/flickering stops */
  .animate-breathe,
  .animate-flicker,
  .animate-shimmer,
  .animate-glow,
  .poem-card,
  .corner,
  .edge,
  .poem-article::before,
  .poem-article::after,
  .poem-card::before,
  .poem-card::after,
  .site-title,
  .poem-title,
  .site-header::after,
  .poem-header::after,
  .footer-ornament {
    animation: none !important;
  }
}

/* === PRINT STYLES === */
@media print {
  .poem-nav {
    display: none;
  }

  .poem-article {
    box-shadow: none;
    border: 1px solid #d4c9b5;
    background: #faf6ef;
  }

  .poem-article::before,
  .poem-article::after,
  .poem-card::before,
  .poem-card::after,
  .footer-ornament {
    display: none;
  }

  body {
    background: #f5efe6;
    color: #2a2520;
  }

  .site-title,
  .poem-title {
    text-shadow: none;
  }
}
