/**
 * MuseMusk - Styles Responsive Additionnels
 *
 * Compléments aux media queries du style.css principal
 * Optimisations pour différents appareils et situations
 *
 * @package MuseMusk
 * @since 2.0.0
 */

/* ==========================================================================
   BREAKPOINTS UTILISÉS
   ==========================================================================
   - Extra large (XL): > 1400px
   - Large (LG): 1024px - 1400px
   - Medium (MD): 768px - 1024px
   - Small (SM): 480px - 768px
   - Extra small (XS): < 480px
   ========================================================================== */

/* ==========================================================================
   EXTRA LARGE SCREENS (> 1400px)
   ========================================================================== */

@media (min-width: 1401px) {
    .container-wide {
        max-width: 1600px;
    }
    
    .hero-large {
        padding: 8rem 2rem;
    }
    
    .card-grid-4 {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .footer-inner {
        gap: 4rem;
    }
}

/* ==========================================================================
   LARGE SCREENS (1024px - 1400px)
   ========================================================================== */

@media (min-width: 1025px) and (max-width: 1400px) {
    :root {
        --font-size-5xl: 3rem;
        --font-size-4xl: 2.25rem;
    }
    
    .card-featured .card-image {
        height: 350px;
    }
}

/* ==========================================================================
   TABLET LANDSCAPE (768px - 1024px)
   ========================================================================== */

@media (min-width: 769px) and (max-width: 1024px) {
    :root {
        --spacing-4xl: 4rem;
        --spacing-3xl: 3rem;
    }
    
    /* Navigation */
    .nav-menu > li > a {
        font-size: 0.8rem;
        letter-spacing: 0.05em;
    }
    
    .nav-menu {
        gap: 1.5rem;
    }
    
    /* Hero */
    .hero-large {
        min-height: 50vh;
    }
    
    /* Cards */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .card-featured {
        grid-column: span 2;
    }
    
    .card-featured .card-image {
        height: 300px;
    }
    
    /* Front page sections */
    .category-showcase {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .gender-sections {
        gap: 2rem;
    }
    
    /* Footer */
    .footer-inner {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .footer-brand {
        grid-column: span 2;
        text-align: center;
        padding-right: 0;
        padding-bottom: 2rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .footer-social {
        justify-content: center;
    }
}

/* ==========================================================================
   TABLET PORTRAIT (600px - 768px)
   ========================================================================== */

@media (min-width: 601px) and (max-width: 768px) {
    :root {
        --spacing-4xl: 3rem;
        --spacing-3xl: 2.5rem;
        --spacing-2xl: 2rem;
    }
    
    /* Typography */
    h1, .hero-title {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    /* Cards - 2 colonnes */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.5rem;
    }
    
    .card-featured {
        grid-column: span 2;
    }
    
    .card-image {
        height: 200px;
    }
    
    .card-featured .card-image {
        height: 250px;
    }
    
    /* Category showcase */
    .category-showcase {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-card {
        padding: 1.5rem;
    }
    
    /* Gender sections */
    .gender-sections {
        grid-template-columns: 1fr;
    }
    
    .gender-section .card-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    /* Archive */
    .archive-subcategories {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 1rem;
    }
    
    .subcategory-link {
        flex-shrink: 0;
    }
}

/* ==========================================================================
   MOBILE LANDSCAPE (480px - 600px)
   ========================================================================== */

@media (min-width: 481px) and (max-width: 600px) {
    :root {
        --spacing-4xl: 2.5rem;
        --spacing-3xl: 2rem;
        --spacing-2xl: 1.5rem;
        --header-height: 65px;
    }
    
    /* Header */
    .site-title {
        font-size: 1.25rem;
    }
    
    .site-logo {
        max-height: 40px;
    }
    
    /* Cards - still 2 columns but smaller */
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .card-content {
        padding: 1rem;
    }
    
    .card-title {
        font-size: 1rem;
    }
    
    .card-excerpt {
        display: none;
    }
    
    .card-featured .card-excerpt {
        display: block;
    }
    
    /* Category showcase */
    .category-showcase {
        grid-template-columns: 1fr 1fr;
    }
    
    .category-card-icon {
        font-size: 2rem;
    }
    
    .category-card-title {
        font-size: 1rem;
    }
}

/* ==========================================================================
   MOBILE PORTRAIT (< 480px)
   ========================================================================== */

@media (max-width: 480px) {
    :root {
        --spacing-4xl: 2rem;
        --spacing-3xl: 1.5rem;
        --spacing-2xl: 1.25rem;
        --spacing-xl: 1rem;
        --header-height: 60px;
        --font-size-5xl: 2rem;
        --font-size-4xl: 1.75rem;
        --font-size-3xl: 1.5rem;
        --font-size-2xl: 1.25rem;
    }
    
    /* Global */
    body {
        font-size: 15px;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Header */
    .header-inner {
        padding: 0 1rem;
    }
    
    .site-title {
        font-size: 1.1rem;
        letter-spacing: 0.08em;
    }
    
    .site-logo {
        max-height: 35px;
    }
    
    /* Hero */
    .hero {
        padding: 2rem 1rem;
    }
    
    .hero-home {
        padding: 2.5rem 1rem 3rem;
    }
    
    .hero-icon {
        font-size: 2.5rem;
    }
    
    .hero-tagline {
        font-size: 1.1rem;
    }
    
    .hero-description {
        font-size: 0.95rem;
    }
    
    /* Sections */
    .section {
        padding: 2rem 0;
    }
    
    .section-title h2 {
        font-size: 1.5rem;
    }
    
    .section-title .subtitle {
        font-size: 0.95rem;
    }
    
    /* Cards - Single column */
    .card-grid {
        grid-template-columns: 1fr;
        gap: 1.25rem;
    }
    
    .card-featured {
        grid-column: span 1;
    }
    
    .card-image {
        height: 200px;
    }
    
    .card-featured .card-image {
        height: 220px;
    }
    
    .card-content {
        padding: 1.25rem;
    }
    
    .card-title {
        font-size: 1.1rem;
    }
    
    .card-excerpt {
        font-size: 0.85rem;
        -webkit-line-clamp: 2;
    }
    
    /* Category showcase */
    .category-showcase {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .category-card {
        flex-direction: row;
        justify-content: flex-start;
        text-align: left;
        padding: 1rem 1.25rem;
        gap: 1rem;
    }
    
    .category-card-icon {
        font-size: 1.75rem;
        margin-bottom: 0;
    }
    
    .category-card-title {
        font-size: 1rem;
        margin-bottom: 0;
    }
    
    .category-card-count {
        margin-bottom: 0;
    }
    
    .category-card-arrow {
        margin-left: auto;
    }
    
    /* Olfactive families */
    .olfactive-families {
        flex-direction: column;
        align-items: stretch;
    }
    
    .family-tag {
        justify-content: center;
    }
    
    /* About Emma */
    .about-emma-icon {
        font-size: 2.5rem;
    }
    
    .about-emma-intro {
        font-size: 1.25rem;
    }
    
    .about-emma-text {
        font-size: 0.95rem;
    }
    
    /* Single article */
    .single-header {
        padding: 2rem 1rem;
    }
    
    .entry-title {
        font-size: 1.5rem;
    }
    
    .entry-meta {
        font-size: 0.85rem;
        flex-direction: column;
        gap: 0.25rem;
    }
    
    .entry-meta .separator {
        display: none;
    }
    
    .single-featured-image {
        margin-top: -1.5rem;
        padding: 0 1rem;
    }
    
    .entry-content {
        padding: 1.5rem 1rem 2rem;
    }
    
    .entry-content p {
        font-size: 1rem;
    }
    
    /* Author box */
    .author-box {
        padding: 1.25rem;
    }
    
    .author-avatar img {
        width: 70px;
        height: 70px;
    }
    
    /* Social share */
    .social-share {
        flex-direction: column;
        align-items: center;
        gap: 1rem;
    }
    
    .social-share-buttons {
        width: 100%;
        justify-content: center;
    }
    
    /* Post navigation */
    .post-navigation-inner {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .nav-link {
        padding: 1rem;
    }
    
    .nav-title {
        font-size: 1rem;
    }
    
    .nav-thumb {
        display: none;
    }
    
    /* Footer */
    .site-footer {
        padding: 2.5rem 1rem 1.5rem;
    }
    
    .footer-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
        text-align: center;
    }
    
    .footer-brand {
        padding-right: 0;
    }
    
    .footer-social {
        justify-content: center;
    }
    
    .footer-col {
        padding-bottom: 1.5rem;
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
    
    .footer-col:last-child {
        border-bottom: none;
    }
    
    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        font-size: 0.8rem;
    }
    
    /* Buttons */
    .btn {
        padding: 0.875rem 1.5rem;
        font-size: 0.8rem;
        width: 100%;
        justify-content: center;
    }
    
    .btn-sm {
        padding: 0.5rem 1rem;
    }
    
    /* Forms */
    input[type="text"],
    input[type="email"],
    input[type="search"],
    textarea {
        padding: 0.875rem 1rem;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    /* Search form */
    .search-form-large {
        flex-direction: column;
        border-radius: 12px;
    }
    
    .search-field-large {
        padding: 1rem;
        text-align: center;
    }
    
    .search-submit-large {
        padding: 1rem;
    }
    
    /* 404 page */
    .error-illustration {
        height: 140px;
    }
    
    .error-number {
        font-size: 5rem;
    }
    
    .error-perfume {
        font-size: 2.5rem;
    }
    
    .error-title {
        font-size: 1.5rem;
    }
    
    .suggestion-cards {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .suggestion-card {
        padding: 1rem;
    }
    
    .suggestion-icon {
        font-size: 1.5rem;
    }
    
    .suggestion-label {
        font-size: 0.85rem;
    }
    
    /* Comments */
    .comment-body {
        padding: 1rem;
    }
    
    .comment-avatar img {
        width: 50px;
        height: 50px;
    }
    
    .comment-respond {
        padding: 1.25rem;
    }
}

/* ==========================================================================
   TRÈS PETITS ÉCRANS (< 360px)
   ========================================================================== */

@media (max-width: 359px) {
    :root {
        --font-size-5xl: 1.75rem;
        --font-size-4xl: 1.5rem;
        --font-size-3xl: 1.25rem;
    }
    
    .site-title {
        font-size: 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .suggestion-cards {
        grid-template-columns: 1fr;
    }
    
    .category-card {
        padding: 0.875rem 1rem;
    }
}

/* ==========================================================================
   ORIENTATION SPÉCIFIQUE
   ========================================================================== */

/* Landscape phones */
@media (max-width: 896px) and (orientation: landscape) {
    .hero-large {
        min-height: auto;
        padding: 2rem;
    }
    
    .hero-icon {
        display: none;
    }
    
    .hero-title {
        font-size: 2rem;
    }
}

/* ==========================================================================
   HIGH DPI / RETINA DISPLAYS
   ========================================================================== */

@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Amélioration des bordures fines */
    .card {
        border: 0.5px solid rgba(0,0,0,0.05);
    }
}

/* ==========================================================================
   PRÉFÉRENCES UTILISATEUR
   ========================================================================== */

/* Mode sombre préféré par le système */
@media (prefers-color-scheme: dark) {
    /* Prêt pour une future implémentation du mode sombre */
}

/* Mouvement réduit */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .hero-icon {
        animation: none;
    }
    
    .card:hover {
        transform: none;
    }
    
    .card:hover .card-image img {
        transform: none;
    }
}

/* Contraste élevé */
@media (prefers-contrast: high) {
    :root {
        --color-text: #000000;
        --color-prune: #2a0025;
        --color-border: rgba(0,0,0,0.3);
    }
    
    .card {
        border: 2px solid var(--color-border);
    }
    
    a {
        text-decoration: underline;
    }
}

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

@media print {
    * {
        background: transparent !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    .site-header,
    .site-footer,
    .main-navigation,
    .social-share,
    .related-posts,
    .post-navigation,
    .comments-area,
    .btn,
    .hero {
        display: none !important;
    }
    
    .entry-content {
        max-width: 100%;
        padding: 0;
    }
    
    h1, h2, h3, h4 {
        page-break-after: avoid;
    }
    
    img {
        max-width: 100% !important;
        page-break-inside: avoid;
    }
    
    p, blockquote {
        orphans: 3;
        widows: 3;
    }
    
    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #666;
    }
    
    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }
}
