/* rem and em do NOT depend on html font-size in media queries! Instead, 1rem = 1em = 16px */

/**************************/
/* BELOW 1344px (Smaller desktops) */
/**************************/

@media (max-width: 84em) {
    .hero {
        max-width: 120rem;
    }

    .heading-primary {
        font-size: 4.4rem;
    }
}

/**************************/
/* BELOW 1200px (Landscape Tablets) */
/**************************/

@media (max-width: 75em) {
    html {
        /* 9px / 16px  */
        font-size: 56.25%;
    }

    .grid {
        column-gap: 4.8rem;
        row-gap: 6.4rem;
    }

    .logos {
        grid-template-columns: 1fr 1fr !important;
    }

    .heading-secondary {
        font-size: 3.6rem;
    }

    .heading-tertiary {
        font-size: 2.4rem;
    }

    .header {
        padding: 0 3.2rem;
    }

    .main-nav-list {
        gap: 3.2rem;
    }

    .hero {
        gap: 4.8rem;
    }

    .testimonials-container {
        padding: 9.6rem 3.2rem;
    }

    .section-testimonials {
        display: block;
    }

    .testimonials {
        display: block;
    }

    .testimonials figure {
        margin-bottom: 2rem;
    }
}

/**************************/
/* BELOW 944px (Tablets) */
/**************************/

@media (max-width: 59em) {
    html {
        /* 8px / 16px = 0.5 = 50% */
        font-size: 50%;
    }

    .two-box-text {
        grid-template-columns: 1fr !important;
    }

    .hero {
        grid-template-columns: 1fr;
        padding: 0 8rem;
        gap: 6.4rem;
    }

    .step-container {
        grid-template-columns: 1fr !important;
        margin-bottom: 6rem;
    }

    .hero-text-box,
    .hero-img-box {
        text-align: center;
    }

    .hero-img {
        width: 60%;
    }

    .delivered-meals {
        justify-content: center;
        margin-top: 3.2rem;
    }

    .logos img {
        height: 2.4rem;
    }

    .step-number {
        font-size: 7.4rem;
    }

    .meal-content {
        padding: 2.4rem 3.2rem 3.2rem 3.2rem;
    }

    .section-testimonials {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(6, 1fr);
    }

    .cta {
        /* 3/5 = 60% + 2/5 = 40% */
        grid-template-columns: 3fr 2fr;
    }

    .mini-styled-text {
        grid-template-columns: 1fr;
    }

    .cta-form {
        grid-template-columns: 1fr;
    }

    .btn--form {
        margin-top: 1.2rem;
    }

    /* MOBILE NAVIGATION */
    .btn-mobile-nav {
        display: block;
        z-index: 9999;
    }

    .text-cry {
        font-size: 1.6rem;
    }

    .main-nav {
        background-color: rgba(255, 255, 255, 0.9);
        -webkit-backdrop-filter: blur(5px);
        backdrop-filter: blur(10px);
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        transform: translateX(100%);

        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.5s ease-in;

        /* Hide navigation */
        /* Allows NO transitions at all */
        /* display: none; */

        /* 1) Hide it visually */
        opacity: 0;

        /* 2) Make it unaccessible to mouse and keyboard */
        pointer-events: none;

        /* 3) Hide it from screen readers */
        visibility: hidden;
    }

    .nav-open .main-nav {
        opacity: 1;
        pointer-events: auto;
        visibility: visible;
        transform: translateX(0);
    }

    .nav-open .icon-mobile-nav[name="close-outline"] {
        display: block;
    }

    .nav-open .icon-mobile-nav[name="menu-outline"] {
        display: none;
    }

    .main-nav-list {
        flex-direction: column;
        gap: 4.8rem;
    }

    .main-nav-link:link,
    .main-nav-link:visited {
        font-size: 3rem;
    }
}

/**************************/
/* BELOW 704px (Smaller tablets) */
/**************************/

@media (max-width: 44em) {

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

    .btn--outline {
        margin-top: 2rem;
    }

    .btn--full {
        margin-right: 0 !important;
    }

    .diets {
        grid-column: 1 / -1;
        justify-self: center;
    }

    .heading-secondary {
        margin-bottom: 4.8rem;
    }

    .pricing-plan {
        width: 100%;
    }

    .grid--footer {
        grid-template-columns: repeat(6, 1fr);
    }

    .logo-col,
    .address-col {
        grid-column: span 3;
    }

    .logo-col {
        grid-row: 1;
    }

    .footer-logo .logo {
        width: 100%;
        height: 100%;
    }

    .nav-col {
        grid-column: span 3;
        margin-bottom: 3.2rem;
    }

    .faq-section .heading-secondary {
        font-size: 3.8rem;
    }

    .heading-primary {
        text-align: left;
        font-size: 5rem !important;
    }

    .hero-description {
        text-align: justify;
    }

    .two-box-text {
        row-gap: 3rem !important;
        font-size: 10rem !important;
    }
}

/**************************/
/* BELOW 544px (Phones) */
/**************************/

@media (max-width: 34em) {
    html {
        /* 8px / 16px = 0.5 = 50% */
        font-size: 50% !important;
    }

    .heading-primary {
        font-size: 4.8rem !important;
    }

    .heading-secondary {
        font-size: 2.8rem !important;
    }

    .heading-tertiary {
        font-size: 2.4rem !important;
    }

    .grid {
        row-gap: 4.8rem;
    }

    .section-how .grid--4-cols {
        row-gap: 6rem;
    }

    .grid--2-cols,
    .grid--3-cols,
    .grid--4-cols {
        grid-template-columns: 1fr !important;
    }

    .btn,
    .btn:link,
    .btn:visited {
        padding: 2.4rem 1.6rem;
    }

    .section-hero {
        padding: 2.4rem 0 6.4rem 0;
    }

    .hero {
        padding: 0 3.2rem;
    }

    .hero-img {
        width: 80%;
    }

    .logos img {
        height: 1.2rem;
    }

    .step-img-box:nth-child(2) {
        grid-row: 1;
    }

    .step-img-box:nth-child(6) {
        grid-row: 5;
    }

    .step-img-box {
        transform: translateY(2.4rem);
    }

    .testimonials {
        grid-template-columns: 1fr;
    }

    .gallery {
        grid-template-columns: repeat(4, 1fr);
        gap: 1.2rem;
    }

    .cta {
        grid-template-columns: 1fr;
    }

    .cta-text-box {
        padding: 3.2rem;
    }

    .cta-img-box {
        height: 32rem;
        grid-row: 1;
    }
}

/*
- Font sizes (px)
10 / 12 / 14 / 16 / 18 / 20 / 24 / 30 / 36 / 44 / 52 / 62 / 74 / 86 / 98

- Spacing system (px)
2 / 4 / 8 / 12 / 16 / 24 / 32 / 48 / 64 / 80 / 96 / 128
*/

/**************************/
/* Fixing Safari flexbox gap */
/**************************/

.no-flexbox-gap .main-nav-list li:not(:last-child) {
    margin-right: 4.8rem;
}

.no-flexbox-gap .list-item:not(:last-child) {
    margin-bottom: 1.6rem;
}

.no-flexbox-gap .list-icon:not(:last-child) {
    margin-right: 1.6rem;
}

.no-flexbox-gap .delivered-faces {
    margin-right: 1.6rem;
}

.no-flexbox-gap .meal-attribute:not(:last-child) {
    margin-bottom: 2rem;
}

.no-flexbox-gap .meal-icon {
    margin-right: 1.6rem;
}

.no-flexbox-gap .footer-row div:not(:last-child) {
    margin-right: 6.4rem;
}

.no-flexbox-gap .social-links li:not(:last-child) {
    margin-right: 2.4rem;
}

.no-flexbox-gap .footer-nav li:not(:last-child) {
    margin-bottom: 2.4rem;
}

@media (max-width: 75em) {
    .no-flexbox-gap .main-nav-list li:not(:last-child) {
        margin-right: 3.2rem;
    }
}

@media (max-width: 59em) {
    .no-flexbox-gap .main-nav-list li:not(:last-child) {
        margin-right: 0;
        margin-bottom: 4.8rem;
    }
}

/**************************/
/* Table Responsive Fixes */
/**************************/

@media (max-width: 34em) {

    /* Fix for tables */
    .sophie-table-header,
    .sophie-comparison-header {
        display: none;
    }

    .sophie-table-row,
    .sophie-comparison-row {
        display: flex;
        flex-direction: column;
        gap: 0.8rem;
        padding: 1.6rem;
        border: 1px solid #e9ecef;
        margin-bottom: 1.6rem;
        border-radius: 8px;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    }

    /* Add labels for Results Table */
    .sophie-results-table .sophie-table-row div:nth-child(1) {
        font-weight: 700;
        color: #2e4194;
        margin-bottom: 0.8rem;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.8rem;
    }

    .sophie-results-table .sophie-table-row div:nth-child(2)::before {
        content: "Ce qu'elle craignait : ";
        font-weight: 600;
        color: #555;
    }

    .sophie-results-table .sophie-table-row div:nth-child(3)::before {
        content: "La réalité avec SAPR : ";
        font-weight: 600;
        color: #555;
    }

    /* Add labels for Comparison Table */
    .sophie-comparison-table .sophie-comparison-row div:nth-child(1) {
        font-weight: 700;
        color: #2e4194;
        margin-bottom: 0.8rem;
        border-bottom: 1px solid #eee;
        padding-bottom: 0.8rem;
    }

    .sophie-comparison-table .sophie-comparison-row div:nth-child(2)::before {
        content: "Plan seul : ";
        font-weight: 600;
        color: #555;
    }

    .sophie-comparison-table .sophie-comparison-row div:nth-child(3)::before {
        content: "Plan + Conseiller SAPR : ";
        font-weight: 600;
        color: #555;
    }

    /* Align text left for mobile */
    .sophie-comparison-row div:nth-child(2),
    .sophie-comparison-row div:nth-child(3) {
        text-align: left;
        font-size: 1.6rem;
    }

    /**************************/
    /* CASE STUDY MOBILE IMPROVEMENTS */
    /**************************/

    /* Amélioration de la lisibilité pour les cas pratiques John et Eva */

    /* Section cas pratique - textes principaux */
    .case-intro-text,
    .case-profile-text {
        font-size: 2rem !important;
    }

    /* Liste des items dans les cas pratiques */
    .case-list-item {
        font-size: 2rem !important;
        line-height: 1.7 !important;
    }

    .case-list-item em {
        font-size: 1.8rem !important;
    }

    /* Texte de réalité */
    .case-reality {
        font-size: 2.2rem !important;
    }

    /* Boîte de déclenchement */
    .case-trigger-text {
        font-size: 2rem !important;
        line-height: 1.7 !important;
    }

    .case-trigger-question {
        font-size: 2.6rem !important;
    }

    .case-trigger-answer {
        font-size: 2.2rem !important;
    }

    .case-unknowns p {
        font-size: 2rem !important;
    }

    .case-unknowns li {
        font-size: 1.8rem !important;
    }

    /* Après SAPR - sous-titre */
    .case-after-subtitle {
        font-size: 2.2rem !important;
    }

    .case-section-title {
        font-size: 2.6rem !important;
    }

    /* Piliers - contenu */
    .case-pillar-subtitle {
        font-size: 1.8rem !important;
    }

    .case-pillar-list li {
        font-size: 1.8rem !important;
        line-height: 1.6 !important;
    }

    /* Témoignage */
    .case-testimonial-title {
        font-size: 2.6rem !important;
    }

    .case-testimonial-quote {
        font-size: 2.4rem !important;
        line-height: 1.7 !important;
    }

    .case-testimonial-author {
        font-size: 2rem !important;
    }

    /* CTA final */
    .case-cta-text {
        font-size: 2.6rem !important;
    }

    .case-cta-question {
        font-size: 2.2rem !important;
    }

    .case-cta-closing {
        font-size: 2rem !important;
    }

    /**************************/
    /* EVA CASE STUDY MOBILE */
    /**************************/

    .eva-subtitle {
        font-size: 2.4rem !important;
    }

    .eva-intro {
        font-size: 2.6rem !important;
    }

    .eva-challenge-item span {
        font-size: 2.2rem !important;
    }

    .eva-quote {
        font-size: 2.6rem !important;
        line-height: 1.7 !important;
    }

    .eva-error-text {
        font-size: 2.6rem !important;
    }

    .eva-result-label {
        font-size: 2.2rem !important;
    }

    .eva-result-value {
        font-size: 2.4rem !important;
    }

    .eva-solution-text {
        font-size: 2.4rem !important;
    }

    .eva-benefit-text {
        font-size: 2.2rem !important;
    }

    .eva-testimonial-quote {
        font-size: 2.8rem !important;
        line-height: 1.8 !important;
    }

    .eva-testimonial-author {
        font-size: 2.4rem !important;
    }

    .eva-cta-text {
        font-size: 3rem !important;
    }

    .eva-cta-subtitle {
        font-size: 2.6rem !important;
    }

    /**************************/
    /* EVA CONSEILLER SECTION - CARTES DE SERVICE */
    /**************************/

    /* Sous-titre de la section */
    .eva-subtitle-text {
        font-size: 2.4rem !important;
    }

    /* Titres des cartes de service */
    .eva-service-header h4 {
        font-size: 2.6rem !important;
    }

    /* Textes Avant/Après dans les cartes */
    .eva-before-after p {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
        margin-bottom: 1.4rem !important;
    }

    /* Introduction des services */
    .eva-service-intro {
        font-size: 2.4rem !important;
        line-height: 1.7 !important;
    }

    /* Liste des bénéfices - OPTIMISÉ POUR ÉVITER CHEVAUCHEMENT */
    .eva-benefits-list li {
        font-size: 2.2rem !important;
        line-height: 1.8 !important;
        padding: 1rem 0 1rem 3.2rem !important;
        position: relative !important;
    }

    /* Texte de mise en évidence */
    .eva-highlight {
        font-size: 2.4rem !important;
        line-height: 1.7 !important;
    }

    /* Section crise */
    .eva-crisis-event {
        font-size: 2.4rem !important;
    }

    .eva-crisis-date {
        font-size: 2rem !important;
    }

    /* Conséquences de la crise - AUGMENTÉ */
    .eva-crisis-consequences h4 {
        font-size: 2.4rem !important;
        margin-bottom: 1.6rem !important;
    }

    .eva-crisis-consequences li {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
        padding: 1rem 0 1rem 3.2rem !important;
    }

    .eva-crisis-quote {
        font-size: 2.6rem !important;
        line-height: 1.7 !important;
    }

    .eva-crisis-fear {
        font-size: 2.4rem !important;
        line-height: 1.7 !important;
    }

    /* Section réajustement avec conseiller - AUGMENTÉ */
    .eva-solution-intro {
        font-size: 2.4rem !important;
        line-height: 1.7 !important;
    }

    .eva-solution-quote {
        font-size: 2.6rem !important;
        line-height: 1.7 !important;
    }

    .eva-section-subtitle {
        font-size: 2.4rem !important;
    }

    /* Cartes d'ajustement */
    .eva-adjustment-card h5 {
        font-size: 2.4rem !important;
        margin-bottom: 1.6rem !important;
    }

    .eva-adjustment-card li {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
        padding: 1rem 0 1rem 3.2rem !important;
    }

    /* Section communauté et témoignage - AUGMENTÉ */
    .eva-community-content p {
        font-size: 2.4rem !important;
    }

    .eva-testimonial {
        font-size: 2.6rem !important;
        line-height: 1.8 !important;
        padding: 2.4rem !important;
    }

    /* Section 3 piliers - CORRIGÉ POUR MOBILE */
    .eva-pillars-grid {
        grid-template-columns: 1fr !important;
        gap: 2.4rem !important;
    }

    .eva-pillar-card {
        padding: 2.4rem !important;
        text-align: center !important;
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
    }

    .eva-pillar-number {
        width: 5.6rem !important;
        height: 5.6rem !important;
        font-size: 2.8rem !important;
        margin: 0 auto 2rem !important;
        display: block !important;
        line-height: 5.6rem !important;
        text-align: center !important;
        flex-shrink: 0 !important;
        float: none !important;
        position: relative !important;
    }

    .eva-pillar-card h4 {
        font-size: 2.4rem !important;
        margin-bottom: 1.4rem !important;
        margin-top: 0 !important;
        clear: both !important;
        width: 100% !important;
    }

    .eva-pillar-card p {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
        clear: both !important;
        width: 100% !important;
        margin-top: 0 !important;
    }

    /* Section FAQ - AUGMENTÉ */
    .faq-question {
        font-size: 2.2rem !important;
        padding: 1.4rem 0 !important;
    }

    .faq-answer {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
    }

    .faq-answer p {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
    }

    /* Section Timeline (Pourquoi un plan) - AUGMENTÉ */
    .why-text {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
    }

    .why-conclusion {
        font-size: 2.4rem !important;
        line-height: 1.7 !important;
    }

    /* Section Hero - OPTIMISÉ */
    .hero-description {
        font-size: 2rem !important;
        line-height: 1.7 !important;
    }

    .hero-list li {
        font-size: 2rem !important;
        line-height: 1.7 !important;
    }

    /* Section Stats - AUGMENTÉ */
    .step-description {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
    }

    .stat-desc {
        font-size: 2rem !important;
        line-height: 1.6 !important;
    }

    /* Autres éléments Eva */
    .eva-explanation {
        font-size: 2.4rem !important;
    }

    .eva-tasks-list li {
        font-size: 2.2rem !important;
        line-height: 1.7 !important;
        padding-left: 3.2rem !important;
    }

    .eva-reality {
        font-size: 2.6rem !important;
    }

    .eva-quote-secondary {
        font-size: 2.4rem !important;
        line-height: 1.7 !important;
    }

    .eva-turning-text {
        font-size: 2.4rem !important;
    }
}