/* ============================================
   ProTunez Blog - Additional Responsive Styles
   ============================================ */

/* Extra Large Desktop (1440px+) */
@media (min-width: 1440px) {
  .container {
    max-width: 1360px;
  }
  
  .hero-text h1 {
    font-size: 4rem;
  }
  
  .article-header h1 {
    font-size: 3rem;
  }
}

/* Large Desktop (1024px - 1439px) */
@media (max-width: 1439px) and (min-width: 1025px) {
  .articles-grid {
    gap: 1.25rem;
  }
  
  .categories-grid {
    gap: 0.875rem;
  }
}

/* Tablet Landscape (1024px) */
@media (max-width: 1024px) {
  .hero-content {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .hero-text {
    text-align: center;
  }
  
  .hero-text p {
    margin-left: auto;
    margin-right: auto;
  }
  
  .hero-meta {
    justify-content: center;
  }
  
  .hero-image {
    order: -1;
  }
  
  .hero-image img {
    height: 300px;
  }
  
  .article-card.featured {
    grid-column: span 2;
    grid-row: span 1;
  }
  
  .article-card.featured .card-image img {
    height: 240px;
  }
  
  .article-card.featured .card-body h3 {
    font-size: 1.25rem;
  }
  
  .categories-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .main-layout {
    grid-template-columns: 1fr 300px;
    gap: 2rem;
  }
  
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile Large (768px) */
@media (max-width: 768px) {
  :root {
    --header-height: 70px;
  }
  
  .main-nav {
    position: fixed;
    top: var(--header-height);
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg);
    transform: translateY(-100%);
    opacity: 0;
    visibility: hidden;
    transition: all var(--transition-base);
    z-index: var(--z-fixed);
    padding: 1rem;
  }
  
  .main-nav.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
  }
  
  .main-nav ul {
    flex-direction: column;
    gap: 0;
  }
  
  .main-nav a {
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
  }
  
  .mobile-menu-toggle {
    display: flex;
  }
  
  .hero {
    padding: 3rem 0;
  }
  
  .hero-text h1 {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }
  
  .hero-image img {
    height: 250px;
  }
  
  .articles-grid {
    grid-template-columns: 1fr;
  }
  
  .article-card.featured {
    grid-column: span 1;
  }
  
  .article-card.featured .card-image img {
    height: 240px;
  }
  
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }
  
  .category-card {
    padding: 1.5rem 1rem;
  }
  
  .main-layout {
    grid-template-columns: 1fr;
  }
  
  .sidebar-widget {
    order: 2;
  }
  
  .article-header h1 {
    font-size: clamp(1.75rem, 7vw, 2.25rem);
  }
  
  .article-meta {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .article-featured-image img {
    max-height: 300px;
  }
  
  .author-box {
    flex-direction: column;
    text-align: center;
    align-items: center;
  }
  
  .toc {
    padding: 1.25rem;
  }
  
  .key-takeaways {
    padding: 1.5rem;
  }
  
  .share-buttons {
    gap: 0.5rem;
  }
  
  .share-btn {
    padding: 0.5rem 0.875rem;
    font-size: 0.8rem;
  }
  
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
  
  .footer-legal {
    justify-content: center;
  }
  
  h1 {
    font-size: clamp(1.75rem, 6vw, 2.5rem);
  }
  
  h2 {
    font-size: clamp(1.35rem, 4vw, 1.75rem);
  }
}

/* Mobile Small (480px) */
@media (max-width: 480px) {
  .hero-text h1 {
    font-size: clamp(1.75rem, 8vw, 2rem);
  }
  
  .categories-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .category-card {
    padding: 1.25rem 0.875rem;
  }
  
  .article-header h1 {
    font-size: clamp(1.5rem, 7vw, 2rem);
  }
  
  .article-content h2 {
    font-size: clamp(1.25rem, 5vw, 1.5rem);
  }
  
  .article-featured-image img {
    max-height: 250px;
  }
  
  .key-takeaways {
    padding: 1.25rem;
  }
  
  .key-takeaways li {
    padding-left: 1.5rem;
  }
  
  .toc li::before {
    width: 20px;
    height: 20px;
    font-size: 0.7rem;
  }
}

/* Very Small Mobile (360px) */
@media (max-width: 360px) {
  .container {
    padding: 0 0.875rem;
  }
  
  .hero-meta {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }
  
  .hero-meta .author {
    width: 100%;
    justify-content: center;
  }
  
  .search-container input {
    padding: 1rem 1rem;
    padding-right: 3.5rem;
    font-size: 1rem;
  }
  
  .btn {
    padding: 0.625rem 1rem;
    font-size: 0.85rem;
  }
}

/* Print Styles */
@media print {
  .site-header,
  .site-footer,
  .sidebar-widget,
  .share-buttons,
  .scroll-top,
  .search-overlay,
  .ad-zone,
  .newsletter-widget,
  .theme-toggle,
  .mobile-menu-toggle {
    display: none !important;
  }
  
  body {
    font-size: 12pt;
    line-height: 1.6;
    color: #000;
    background: #fff;
  }
  
  .article-content {
    max-width: 100%;
  }
  
  .article-featured-image img {
    max-height: 300px;
  }
  
  a {
    color: #000;
    text-decoration: underline;
  }
  
  a[href]::after {
    content: " (" attr(href) ")";
    font-size: 0.8em;
    color: #666;
  }
  
  .hero {
    background: none !important;
    color: #000;
  }
  
  .hero::before,
  .hero::after {
    display: none;
  }
  
  .hero-text h1,
  .hero-text p {
    color: #000;
  }
  
  .key-takeaways {
    background: #fef3c7 !important;
    border: 1px solid #f59e0b !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  :root {
    --border-color: currentColor;
    --shadow-sm: 0 0 0 1px currentColor;
    --shadow-md: 0 0 0 2px currentColor;
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .article-card,
  .category-card,
  .sidebar-widget,
  .hero-text h1,
  .hero-text p,
  .hero-meta,
  .hero-image,
  .article-header .article-category,
  .article-header h1,
  .article-meta,
  .article-featured-image,
  .article-content > *,
  .key-takeaways,
  .share-buttons,
  .author-box,
  .related-articles,
  .footer-col,
  .footer-bottom {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Focus Visible - Keyboard Navigation */
@media (hover: none) and (pointer: coarse) {
  .btn-primary:hover,
  .btn-secondary:hover,
  .btn-ghost:hover,
  .share-btn:hover,
  .footer-links a:hover,
  .footer-social a:hover,
  .category-card:hover,
  .article-card:hover,
  .recent-post:hover,
  .category-list a:hover,
  .tags-cloud a:hover,
  .newsletter-form button:hover,
  .author-social a:hover,
  .scroll-top:hover {
    transform: none;
    box-shadow: none;
  }
  
  .footer-links a:hover {
    transform: none;
  }
  
  .footer-social a:hover {
    transform: none;
    rotate: none;
  }
}

/* Landscape Mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .search-overlay {
    padding-top: 5vh;
  }
  
  .search-container input {
    padding: 1rem 1.5rem;
    font-size: 1.1rem;
  }
  
  .hero {
    padding: 2rem 0;
  }
  
  .hero-image {
    display: none;
  }
}

/* Dark Mode Specific Responsive */
@media (max-width: 768px) {
  [data-theme="dark"] .main-nav {
    background: var(--bg-primary);
  }
  
  [data-theme="dark"] .search-overlay {
    background: rgba(0, 0, 0, 0.95);
  }
}

/* Container Queries for Component-based responsiveness (future-proof) */
@supports (container-type: inline-size) {
  .articles-grid {
    container-type: inline-size;
  }
  
  @container (max-width: 600px) {
    .articles-grid {
      grid-template-columns: 1fr;
    }
  }
  
  @container (min-width: 600px) and (max-width: 900px) {
    .articles-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }
  
  @container (min-width: 900px) {
    .articles-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }
}