/**
 * RECIPE-SAY Responsive & Print Stylesheet
 * Full mobile responsiveness across 320px to 1440px+
 * Mobile filter drawer, hamburger menu, and clean print styles.
 */

/* ==================== TABLET & LAPTOP (<= 1180px) ==================== */
@media (max-width: 1180px) {
  body {
    padding: 16px;
  }
  
  .app-body {
    padding: 18px;
    gap: 18px;
  }
  
  .hero-row {
    grid-template-columns: 1fr;
  }
  
  .cookbook-panel {
    display: none; /* Collapses into top bar badge */
  }

  .nav-pills {
    display: none; /* Converted to hamburger on smaller viewports */
  }

  .mobile-menu-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #F4F5F8;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    color: #374151;
  }

  .footer-columns-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  
  .about-trust-block {
    grid-template-columns: 1fr;
    gap: 24px;
  }
}

/* ==================== TABLET PORTRAIT (<= 992px) ==================== */
@media (max-width: 992px) {
  .app-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 300px;
    height: 100vh;
    max-height: 100vh;
    z-index: 1000;
    transition: left 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: 10px 0 30px rgba(0, 0, 0, 0.2);
    border-radius: 0 24px 24px 0;
  }

  .app-sidebar.drawer-open {
    left: 0;
  }

  /* Backdrop for mobile drawer */
  .sidebar-backdrop {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(17, 24, 39, 0.5);
    backdrop-filter: blur(4px);
    z-index: 999;
  }

  .sidebar-backdrop.active {
    display: block;
  }

  .sidebar-mobile-close-btn {
    display: flex !important;
  }

  .mobile-filter-trigger-bar {
    display: flex !important;
  }
}

/* ==================== MOBILE DEVICES (<= 768px) ==================== */
@media (max-width: 768px) {
  body {
    padding: 0;
    background: #5844E1;
  }

  .app-window {
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .window-chrome {
    display: none; /* Hide macOS chrome bar on mobile */
  }

  .app-header {
    padding: 12px 16px;
  }

  .brand-logo img {
    height: 36px;
  }

  .app-body {
    padding: 14px;
    gap: 20px;
  }

  .hero-banner {
    flex-direction: column;
    align-items: flex-start;
    padding: 22px 18px;
    gap: 16px;
  }

  .hero-left {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .hero-mascot-wrap {
    width: 80px;
    height: 75px;
  }

  .hero-headline {
    font-size: 22px;
  }

  .hero-subtitle {
    font-size: 12.5px;
  }

  .hero-right-actions {
    align-self: stretch;
  }

  .btn-hero-primary {
    justify-content: center;
    width: 100%;
  }

  .newsletter-card {
    flex-direction: column;
    padding: 24px 18px;
    align-items: flex-start;
    gap: 20px;
  }

  .newsletter-form {
    max-width: 100%;
  }

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

  .trust-badges-grid {
    grid-template-columns: 1fr;
  }

  .app-footer {
    padding: 32px 18px 24px 18px;
  }
}

/* ==================== SMALL PHONES (<= 480px) ==================== */
@media (max-width: 480px) {
  .recipe-card {
    width: 230px;
  }

  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-posts-grid {
    grid-template-columns: 1fr;
  }

  .modal-actions-bar {
    flex-direction: column;
  }
  
  .btn-print, .btn-share {
    width: 100%;
    text-align: center;
  }
}

/* ==================== MOBILE FILTER BAR ==================== */
.mobile-filter-trigger-bar {
  display: none;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border-radius: var(--radius-pill);
  padding: 8px 16px;
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border-light);
  margin-bottom: 4px;
}

.mobile-filter-btn {
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.sidebar-mobile-close-btn {
  display: none;
  position: absolute;
  top: 14px;
  right: 14px;
  background: #F4F5F8;
  border: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

/* ==================== PRINT STYLES ==================== */
@media print {
  body {
    background: #FFFFFF !important;
    padding: 0 !important;
    color: #000000 !important;
  }

  .window-chrome,
  .app-header,
  .app-sidebar,
  .hero-row,
  .adsense-placeholder-slot,
  .newsletter-card,
  .about-trust-block,
  .app-footer,
  .scroll-ctrl-btn,
  .card-more-btn,
  .modal-close-btn,
  .modal-actions-bar,
  .sidebar-backdrop {
    display: none !important;
  }

  .app-window {
    box-shadow: none !important;
    border: none !important;
    border-radius: 0 !important;
  }

  .recipe-modal-backdrop {
    position: static !important;
    background: none !important;
    display: block !important;
    padding: 0 !important;
  }

  .recipe-modal {
    box-shadow: none !important;
    border: none !important;
    max-height: none !important;
  }

  .modal-media-header {
    height: 220px !important;
  }

  a::after {
    content: "" !important;
  }
}
