/* ============================================
   UNREGULATED: Responsive Design Styles
   Mobile-First Approach
   ============================================ */

/* ============================================
   TABLET MEDIA QUERY (768px - 1199px)
   ============================================ */

@media (min-width: 768px) and (max-width: 1199px) {
  /* Typography - Minor adjustments for tablet */
  h2 {
    font-size: 32px;
  }

  h3 {
    font-size: 22px;
  }

  /* Header & Navigation */
  .navbar-container {
    height: 65px;
  }

  .navbar-logo {
    font-size: 20px;
  }

  .nav-menu {
    gap: var(--spacing-md);
  }

  /* Hero Section */
  .hero {
    aspect-ratio: 16 / 9;
  }

  /* Copy Section */
  .copy-section {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .content-max-width {
    max-width: 700px;
    padding: 0 var(--spacing-md);
  }

  /* Story Section */
  .story-section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  /* Support Section */
  .support-section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .support-section h2 {
    font-size: 32px;
  }

  /* Merchandise Section - 2 Column Grid on Tablet */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .merch-section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  /* HOA Network Section */
  .hoa-network-section {
    padding: var(--spacing-xl) var(--spacing-md);
  }

  .hoa-network-section h2 {
    font-size: 32px;
  }

  /* Footer - 2 Column Layout on Tablet */
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--spacing-md);
  }

  .site-footer {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  /* Buttons - Slightly reduced padding */
  .btn {
    padding: 12px var(--spacing-md);
  }

  .btn-primary-large {
    padding: 12px 30px;
  }

  /* Copy Buttons - Stack on smaller tablets if needed */
  .copy-buttons {
    gap: var(--spacing-sm);
  }

  /* Sticky Footer */
  .sticky-footer {
    padding: var(--spacing-sm) var(--spacing-md);
    min-height: 65px;
  }

  .sticky-footer-form {
    min-width: 300px;
    gap: var(--spacing-xs);
  }

  /* Newsletter Form */
  .newsletter-form {
    flex-direction: row;
    gap: var(--spacing-xs);
  }

  .newsletter-form input {
    min-width: 250px;
  }
}

/* ============================================
   MOBILE MEDIA QUERY (max-width: 767px)
   ============================================ */

@media (max-width: 767px) {
  /* Root - Adjust spacing variables for mobile */
  :root {
    --spacing-lg: 25px;
    --spacing-xl: 40px;
    --spacing-xxl: 50px;
  }

  /* Typography - Mobile optimized sizes */
  h1 {
    font-size: 28px;
    line-height: 1.3;
  }

  h2 {
    font-size: 24px;
    line-height: 1.3;
  }

  h3 {
    font-size: 18px;
    line-height: 1.3;
  }

  p {
    font-size: 14px;
    line-height: 1.7;
  }

  /* Body adjustments */
  body {
    font-size: 14px;
  }

  /* Content max-width */
  .content-max-width {
    max-width: 100%;
    padding: 0 var(--spacing-md);
  }

  /* ============================================
     HEADER & NAVIGATION - MOBILE
     ============================================ */

  .sticky-header {
    border-bottom: 1px solid var(--color-gray-border);
  }

  .navbar {
    padding: 0 var(--spacing-md);
  }

  .navbar-container {
    height: 60px;
  }

  .navbar-logo {
    font-size: 18px;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0;
    display: none;
    position: absolute;
    top: 60px;
    left: 0;
    right: 0;
    background-color: var(--color-white);
    border-bottom: 1px solid var(--color-gray-border);
    padding: var(--spacing-md) 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  }

  .nav-menu.active {
    display: flex;
  }

  .nav-menu li {
    padding: var(--spacing-sm) var(--spacing-md);
    border-bottom: 1px solid var(--color-gray-border);
  }

  .nav-menu li:last-child {
    border-bottom: none;
  }

  .nav-link {
    font-size: 12px;
    display: block;
  }

  /* Hamburger menu toggle (if needed) */
  .hamburger-toggle {
    display: block;
    background: transparent;
    border: none;
    color: var(--color-navy);
    font-size: 24px;
    cursor: pointer;
    padding: 8px;
    height: 40px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ============================================
     HERO SECTION - MOBILE
     ============================================ */

  .hero {
    aspect-ratio: 16 / 9;
    min-height: 250px;
  }

  .hero-video-container {
    width: 100%;
    height: 100%;
  }

  .hero-video-container iframe {
    width: 100%;
    height: 100%;
  }

  /* ============================================
     COPY SECTION - MOBILE
     ============================================ */

  .copy-section {
    padding: var(--spacing-lg) var(--spacing-md);
    border-bottom: 1px solid var(--color-gray-border);
  }

  .copy-text {
    font-size: 14px;
    margin-bottom: var(--spacing-md);
  }

  .copy-callout {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    border-left: 4px solid var(--color-red);
  }

  .copy-callout p {
    font-size: 13px;
  }

  /* Buttons - Full width on mobile */
  .copy-buttons {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .copy-buttons .btn {
    width: 100%;
    text-align: center;
  }

  /* ============================================
     STORY SECTION - MOBILE
     ============================================ */

  .story-section {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .story-subsection {
    margin-bottom: var(--spacing-lg);
  }

  .story-subsection h3 {
    font-size: 18px;
    margin-bottom: var(--spacing-md);
  }

  .story-subsection p {
    font-size: 14px;
    line-height: 1.7;
  }

  .story-subsection-highlighted {
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }

  /* ============================================
     SUPPORT SECTION - MOBILE
     ============================================ */

  .support-section {
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
  }

  .support-section h2 {
    font-size: 24px;
    margin-bottom: var(--spacing-sm);
  }

  .support-section p {
    font-size: 14px;
    margin-bottom: var(--spacing-md);
  }

  .support-section .btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ============================================
     MERCHANDISE SECTION - MOBILE (1 Column)
     ============================================ */

  .merch-section {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .merch-section h2 {
    font-size: 24px;
    margin-bottom: var(--spacing-sm);
  }

  .merch-subtitle {
    font-size: 12px;
    margin-bottom: var(--spacing-md);
  }

  /* Single column product grid on mobile */
  .product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
  }

  .product-card {
    padding: var(--spacing-md);
  }

  .product-image {
    aspect-ratio: 1 / 1;
    margin-bottom: var(--spacing-sm);
  }

  .product-card h3 {
    font-size: 13px;
  }

  .product-price {
    font-size: 12px;
  }

  .merch-section .btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* ============================================
     HOA NETWORK SECTION - MOBILE
     ============================================ */

  .hoa-network-section {
    padding: var(--spacing-lg) var(--spacing-md);
  }

  .hoa-network-section h2 {
    font-size: 24px;
  }

  .hoa-network-section p {
    font-size: 14px;
    line-height: 1.7;
  }

  /* Newsletter form stacks vertically on mobile */
  .newsletter-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .newsletter-form input {
    width: 100%;
    padding: 12px var(--spacing-sm);
    min-height: 48px;
  }

  .newsletter-form button,
  .newsletter-form .btn {
    width: 100%;
    min-height: 48px;
  }

  .coming-soon-badge {
    font-size: 11px;
    padding: 10px var(--spacing-sm);
  }

  /* ============================================
     BUTTONS - MOBILE
     ============================================ */

  .btn {
    display: block;
    width: 100%;
    padding: 12px var(--spacing-md);
    font-size: var(--font-size-small);
    text-align: center;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .btn-primary,
  .btn-primary-large {
    min-height: 48px;
  }

  .btn-secondary,
  .btn-secondary-large {
    min-height: 48px;
  }

  .btn-primary-large,
  .btn-secondary-large {
    padding: 12px var(--spacing-md);
  }

  /* ============================================
     STICKY FOOTER - MOBILE (VERTICAL STACK)
     ============================================ */

  .site-footer {
    padding: var(--spacing-lg) var(--spacing-md);
    margin-bottom: 70px;
  }

  /* Single column footer on mobile */
  .footer-grid {
    grid-template-columns: 1fr;
    gap: var(--spacing-md);
  }

  .footer-column h4 {
    font-size: 11px;
    margin-bottom: var(--spacing-sm);
  }

  .footer-column a {
    font-size: 12px;
  }

  /* Sticky footer newsletter - stacks vertically */
  .sticky-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-navy);
    color: var(--color-white);
    padding: var(--spacing-sm);
    z-index: var(--z-sticky-footer);
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-sm);
    min-height: auto;
  }

  .sticky-footer-content {
    flex-direction: column;
    gap: var(--spacing-sm);
  }

  .sticky-footer-text {
    flex: 1 1 auto;
  }

  .sticky-footer-title {
    font-size: 12px;
    margin: 0 0 3px 0;
  }

  .sticky-footer-desc {
    font-size: 11px;
    margin: 0;
  }

  .sticky-footer-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
    min-width: auto;
    width: 100%;
  }

  .sticky-footer-form input {
    width: 100%;
    padding: 10px var(--spacing-sm);
    min-height: 44px;
    font-size: 14px;
  }

  .sticky-footer-form button {
    width: 100%;
    min-height: 44px;
  }

  .sticky-footer-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
  }
}

/* ============================================
   LARGE DESKTOP (1400px+)
   ============================================ */

@media (min-width: 1400px) {
  /* Typography adjustments for large screens */
  h2 {
    font-size: 40px;
  }

  h3 {
    font-size: 26px;
  }

  /* Wider content containers */
  .content-max-width {
    max-width: 1200px;
  }

  .story-section {
    max-width: 1000px;
    margin: 0 auto;
  }

  /* Product grid - 4 columns on large desktop */
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Footer - Could expand to 5 columns on very large screens */
  .footer-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  /* Typography adjustments */
  p {
    font-size: 16px;
  }
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
  /* Hide non-essential elements for printing */
  .sticky-header,
  .sticky-footer,
  .hamburger-toggle,
  .btn {
    display: none;
  }

  /* Optimize for print */
  body {
    background-color: var(--color-white);
    color: var(--color-black);
  }

  /* Prevent page breaks in content blocks */
  .story-section,
  .support-section,
  .merch-section,
  .hoa-network-section {
    page-break-inside: avoid;
  }

  /* Ensure footer doesn't interfere */
  .site-footer {
    margin-bottom: 0;
  }

  /* Adjust links for print */
  a {
    color: var(--color-navy);
    text-decoration: underline;
  }

  /* Print-friendly sizing */
  h2 {
    font-size: 24px;
  }

  h3 {
    font-size: 18px;
  }

  p {
    font-size: 12px;
  }
}

/* ============================================
   TOUCH DEVICE OPTIMIZATION
   (48px minimum tap targets)
   ============================================ */

@media (hover: none) and (pointer: coarse) {
  /* Increase tap targets for touch devices */
  .btn {
    min-height: 48px;
    min-width: 48px;
    padding: 12px 20px;
  }

  .nav-link {
    min-height: 48px;
    padding: 12px var(--spacing-sm);
    display: flex;
    align-items: center;
  }

  .sticky-footer-close {
    min-height: 48px;
    min-width: 48px;
  }

  /* Increase form input heights */
  input[type="email"],
  input[type="text"],
  textarea {
    min-height: 48px;
  }

  /* Larger click targets for footer links */
  .footer-column a {
    display: block;
    padding: 8px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  /* Hover effects disabled on touch */
  .btn:hover {
    opacity: 1;
  }
}

/* ============================================
   PREFERS REDUCED MOTION SUPPORT
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  /* Disable animations for users who prefer reduced motion */
  * {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  /* Remove transitions */
  a,
  button,
  input,
  .btn {
    transition: none;
  }

  /* Disable hero video autoplay for performance */
  .hero-video-container {
    animation: none;
  }
}

/* ============================================
   LANDSCAPE ORIENTATION (Mobile)
   ============================================ */

@media (max-width: 767px) and (orientation: landscape) {
  /* Reduce vertical spacing in landscape mode */
  :root {
    --spacing-xl: 30px;
    --spacing-xxl: 40px;
  }

  .sticky-header {
    height: 50px;
  }

  .navbar-container {
    height: 50px;
  }

  .hero {
    min-height: 300px;
    aspect-ratio: auto;
  }

  .copy-section,
  .story-section,
  .support-section,
  .merch-section,
  .hoa-network-section {
    padding: var(--spacing-md) var(--spacing-md);
  }

  .story-subsection {
    margin-bottom: var(--spacing-md);
  }

  .sticky-footer {
    padding: 8px var(--spacing-md);
    min-height: 50px;
  }
}

/* ============================================
   EXTRA SMALL DEVICES (320px - 374px)
   ============================================ */

@media (max-width: 374px) {
  /* Further reduce spacing for very small screens */
  :root {
    --spacing-md: 12px;
    --spacing-lg: 16px;
  }

  .navbar-logo {
    font-size: 16px;
  }

  h1 {
    font-size: 22px;
  }

  h2 {
    font-size: 20px;
  }

  h3 {
    font-size: 16px;
  }

  p {
    font-size: 13px;
  }

  .btn {
    padding: 10px 12px;
    font-size: 12px;
    min-height: 44px;
  }

  .sticky-footer-form {
    gap: 6px;
  }

  .copy-callout {
    padding: 12px;
    border-left-width: 3px;
  }

  .product-grid {
    gap: 12px;
  }
}

/* ============================================
   SMALL DEVICES (375px - 479px)
   ============================================ */

@media (min-width: 375px) and (max-width: 479px) {
  /* Optimize for common mobile sizes (iPhone SE, iPhone 11, etc.) */
  :root {
    --spacing-md: 14px;
    --spacing-lg: 20px;
  }

  .navbar-logo {
    font-size: 18px;
  }

  h2 {
    font-size: 22px;
  }

  h3 {
    font-size: 18px;
  }

  .copy-buttons {
    gap: 10px;
  }

  .sticky-footer-form input {
    min-height: 44px;
  }
}

/* ============================================
   MEDIUM MOBILE DEVICES (480px - 599px)
   ============================================ */

@media (min-width: 480px) and (max-width: 599px) {
  :root {
    --spacing-md: 16px;
    --spacing-lg: 24px;
  }

  h2 {
    font-size: 26px;
  }

  h3 {
    font-size: 20px;
  }

  p {
    font-size: 14px;
  }
}

/* ============================================
   LARGE MOBILE DEVICES (600px - 767px)
   ============================================ */

@media (min-width: 600px) and (max-width: 767px) {
  :root {
    --spacing-md: 18px;
    --spacing-lg: 28px;
  }

  h2 {
    font-size: 28px;
  }

  h3 {
    font-size: 22px;
  }

  p {
    font-size: 15px;
  }

  /* Can show 2 products side-by-side on larger mobile */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ============================================
   HIGH RESOLUTION DISPLAYS (DPI)
   ============================================ */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
  /* Slightly bolder text for better clarity on high-res screens */
  body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
  }

  /* Refine images and vectors */
  img {
    image-rendering: crisp-edges;
  }
}

/* ============================================
   LANDSCAPE ORIENTATION (Tablet)
   ============================================ */

@media (min-width: 768px) and (orientation: landscape) {
  /* Reduce top/bottom padding in landscape */
  .copy-section,
  .story-section,
  .support-section,
  .merch-section,
  .hoa-network-section {
    padding-top: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
  }
}
