/* Custom CSS for Santé Mentale 360° - SEO Optimized */

/* Critical Path CSS Optimizations */
.hero-section {
    contain: layout style paint;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure hero section is always visible on mobile */
@media (max-width: 767.98px) {
    .hero-section {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        contain: none !important;
        position: relative !important;
        z-index: 1 !important;
    }
}

.book-cover-holder {
    contain: layout style paint;
    aspect-ratio: 3/4;
}

.book-cover {
    content-visibility: auto;
    contain-intrinsic-size: 300px 400px;
}

/* Performance improvements for CLS (Cumulative Layout Shift) */
.quotes-carousel {
    min-height: 200px;
    contain: layout style paint;
}

.carousel-item {
    will-change: transform;
}

/* Mobile hero section optimizations */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        contain: none;
    }
    
    .hero-section .container {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
    
    .hero-section .row {
        display: flex !important;
        flex-direction: column !important;
        margin: 0 !important;
    }
    
    .hero-section .col-12 {
        width: 100% !important;
        padding: 0 !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-section .promo {
        padding: 0 !important;
        text-align: center !important;
    }
    
    .hero-section .headline {
        font-size: 1.75rem !important;
        line-height: 1.2 !important;
        margin-bottom: 1rem !important;
    }
    
    .hero-section .subheadline {
        font-size: 1rem !important;
        line-height: 1.4 !important;
        margin-bottom: 1.5rem !important;
    }
    
    .hero-section .book-cover-holder {
        text-align: center !important;
        margin: 0 auto !important;
        max-width: 250px !important;
    }
    
    .hero-section .book-cover {
        width: 100% !important;
        height: auto !important;
        max-width: 250px !important;
    }
    
    /* Reduce spacing between CTA buttons on mobile */
    .cta-holder.row {
        --bs-gutter-y: 0.75rem !important;
        gap: 0.75rem !important;
    }
    
    .cta-holder .col-12 {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
    }
}

/* LEO Enhancement: Improved content structure and readability */
.faq-section .faq-content p {
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.faq-section .faq-content p strong {
    color: #2c5282;
    font-weight: 600;
}

/* LEO: Better visual hierarchy for AI parsing */
.faq-section .faq-content ul {
    margin: 0.5rem 0;
    padding-left: 1.5rem;
}

.faq-section .faq-content ul li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

/* LEO: Enhanced focus states for accessibility and AI understanding */
.faq-toggle:focus,
.faq-toggle:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* LEO: Improved button contrast and readability */
#toggle-more-faqs:focus,
#toggle-more-faqs:focus-visible {
    outline: 2px solid #2c5282;
    outline-offset: 2px;
}

/* LEO: Better spacing for content blocks */
.faq-content .p-3 {
    padding: 1.25rem !important;
}

/* Core Web Vitals Optimizations */
.hero-quotes {
    transform: translateZ(0);
}

/* Intersection Observer optimization for images */
.book-cover {
    loading: lazy;
    decoding: async;
}

/* Font loading optimization for Core Web Vitals */
@font-face {
    font-family: 'Quicksand';
    font-display: swap;
}

@font-face {
    font-family: 'Roboto';
    font-display: swap;
}

/* Existing responsive optimizations */
.logo-responsive {
    height: 80px;
    width: auto;
    max-width: 100%;
    transition: all 0.3s ease;
}

.logo-wrapper {
    padding: 1rem 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .logo-responsive {
        height: 60px;
    }
    
    .logo-wrapper {
        padding: 0.5rem 0;
    }
    
    /* LEO: Mobile FAQ improvements */
    .faq-section .faq-content .p-3 {
        padding: 1rem !important;
    }
    
    /* Mobile performance optimizations - removed problematic contain: strict */
}

@media (max-width: 480px) {
    .logo-responsive {
        height: 50px;
    }
    
    /* LEO: Smaller mobile spacing */
    .faq-section .faq-content .p-3 {
        padding: 0.875rem !important;
    }
    
    /* Additional mobile hero section fixes */
    .hero-section {
        padding: 1.5rem 0 !important;
        display: block !important;
        min-height: auto !important;
        contain: none !important;
    }
    
    .hero-section .headline {
        font-size: 1.5rem !important;
        line-height: 1.1 !important;
    }
    
    .hero-section .subheadline {
        font-size: 0.9rem !important;
        line-height: 1.3 !important;
    }
    
    .hero-section .cta-holder .btn {
        font-size: 0.9rem !important;
        padding: 0.75rem 1.5rem !important;
    }
}

@media (max-width: 320px) {
    .logo-responsive {
        height: 40px;
    }
    
    /* Extra small mobile hero optimizations */
    .hero-section {
        padding: 1rem 0 !important;
    }
    
    .hero-section .headline {
        font-size: 1.3rem !important;
    }
    
    .hero-section .subheadline {
        font-size: 0.85rem !important;
    }
    
    .hero-section .book-cover-holder {
        max-width: 200px !important;
    }
}

/* SEO-optimized book badge styling */
.book-badge {
    position: absolute;
    right: -10px;
    top: 20px;
    width: 90px !important;
    height: 90px !important;
    background: #5cb377;
    border-radius: 50%;
    text-align: center;
    color: #fff;
    font-weight: bold;
    font-family: 'Quicksand', sans-serif;
    padding-top: 22px !important;
    font-size: 0.65rem !important;
    line-height: 1.1;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 10;
    transform: translateZ(0);
}

/* Responsive book badge adjustments */
@media (max-width: 768px) {
    .book-badge {
        width: 80px !important;
        height: 80px !important;
        right: -5px;
        top: 15px;
        padding-top: 20px !important;
        font-size: 0.6rem !important;
    }
}

@media (max-width: 480px) {
    .book-badge {
        width: 70px !important;
        height: 70px !important;
        right: 0px;
        top: 10px;
        padding-top: 18px !important;
        font-size: 0.55rem !important;
    }
}

/* Enhanced book badge specificity for SEO */
.book-cover-holder .book-badge.d-inline-block.shadow {
    position: absolute !important;
    right: 10px !important;
    top: 35px !important; 
    width: 70px !important;
    height: 70px !important;
    background: rgba(92, 179, 119, 0.9) !important;
    border-radius: 50% !important;
    text-align: center !important;
    color: #fff !important;
    font-weight: 600 !important;
    font-family: 'Quicksand', sans-serif !important;
    padding-top: 16px !important;
    font-size: 0.6rem !important;
    line-height: 1.1 !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1) !important;
    z-index: 5 !important;
    display: inline-block !important;
    opacity: 0.85 !important;
    will-change: transform !important;
}

/* Mobile responsive for book badge */
@media (max-width: 768px) {
    .book-cover-holder .book-badge.d-inline-block.shadow {
        width: 60px !important;
        height: 60px !important;
        right: 12px !important;
        top: 30px !important;
        padding-top: 14px !important;
        font-size: 0.55rem !important;
    }
}

@media (max-width: 480px) {
    .book-cover-holder .book-badge.d-inline-block.shadow {
        width: 50px !important;
        height: 50px !important;
        right: 15px !important;
        top: 25px !important;
        padding-top: 12px !important;
        font-size: 0.5rem !important;
    }
}

/* Positioning optimizations */
.book-cover-holder + .text-center {
    margin-top: calc(-1rem + 4px) !important;
    margin-bottom: 1rem !important;
}

.book-cover-holder {
    margin-bottom: 0 !important;
}

@media (max-width: 768px) {
    .book-cover-holder + .text-center {
        margin-top: -0.5rem !important;
    }
}

.col-12.col-md-5.mb-5.align-self-center {
    margin-bottom: 0 !important;
}

@media (max-width: 767.98px) {
    #quotes-carousel {
        margin-bottom: 0 !important;
    }
}

/* Customer reviews carousel optimizations */
#customer-reviews-carousel {
    position: relative;
    contain: layout style paint;
}

#customer-reviews-carousel .carousel-control-prev,
#customer-reviews-carousel .carousel-control-next {
    width: 60px;
    height: 60px;
    background-color: rgba(44, 82, 130, 0.9);
    border-radius: 50%;
    top: 50%;
    transform: translateY(-50%);
    border: 2px solid #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    will-change: transform;
}

#customer-reviews-carousel .carousel-control-prev {
    left: -30px;
}

#customer-reviews-carousel .carousel-control-next {
    right: -30px;
}

#customer-reviews-carousel .carousel-control-prev:hover,
#customer-reviews-carousel .carousel-control-next:hover {
    background-color: rgba(44, 82, 130, 1);
    transform: translateY(-50%) scale(1.1);
}

#customer-reviews-carousel .carousel-control-prev-icon,
#customer-reviews-carousel .carousel-control-next-icon {
    width: 24px;
    height: 24px;
    background-size: 24px 24px;
}

#customer-reviews-carousel .carousel-indicators {
    bottom: -50px;
    margin-bottom: 0;
}

#customer-reviews-carousel .carousel-indicators [data-bs-target] {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: rgba(44, 82, 130, 0.4);
    border: 0;
    margin: 0 8px;
    transition: all 0.3s ease;
}

#customer-reviews-carousel .carousel-indicators .active {
    background-color: #2c5282;
    transform: scale(1.2);
}

#customer-reviews-carousel .item-inner {
    min-height: 280px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    will-change: transform;
}

#customer-reviews-carousel .quote {
    flex-grow: 1;
    display: flex;
    align-items: center;
    margin-bottom: 1rem !important;
}

/* Responsive carousel optimizations */
@media (max-width: 768px) {
    #customer-reviews-carousel .carousel-control-prev,
    #customer-reviews-carousel .carousel-control-next {
        width: 50px;
        height: 50px;
    }
    
    #customer-reviews-carousel .carousel-control-prev {
        left: -15px;
    }
    
    #customer-reviews-carousel .carousel-control-next {
        right: -15px;
    }
    
    #customer-reviews-carousel .carousel-control-prev-icon,
    #customer-reviews-carousel .carousel-control-next-icon {
        width: 20px;
        height: 20px;
        background-size: 20px 20px;
    }
    
    #customer-reviews-carousel .item {
        margin-bottom: 2rem;
    }
    
    #customer-reviews-carousel .item-inner {
        min-height: 200px;
    }
}

@media (max-width: 480px) {
    #customer-reviews-carousel .carousel-control-prev,
    #customer-reviews-carousel .carousel-control-next {
        width: 40px;
        height: 40px;
    }
    
    #customer-reviews-carousel .carousel-control-prev {
        left: -5px;
    }
    
    #customer-reviews-carousel .carousel-control-next {
        right: -5px;
    }
    
    #customer-reviews-carousel .carousel-control-prev-icon,
    #customer-reviews-carousel .carousel-control-next-icon {
        width: 16px;
        height: 16px;
        background-size: 16px 16px;
    }
}

/* Responsive grid optimizations */
@media (min-width: 992px) {
    #customer-reviews-carousel .item.col-lg-4 {
        flex: 0 0 33.333333%;
        max-width: 33.333333%;
    }
}

@media (max-width: 991.98px) {
    #customer-reviews-carousel .item.col-lg-4 {
        flex: 0 0 100%;
        max-width: 100%;
        margin-bottom: 1.5rem;
    }
}

#customer-reviews-carousel .carousel-inner {
    margin-bottom: 60px;
}

/* Button margin optimizations */
@media (min-width: 765px) and (max-width: 990px) {
    .btn.btn-secondary.scrollto {
        margin-top: 3px;
    }
}

/* Content section layout optimizations for large screens */
@media (min-width: 992px) {
    #content-section .single-col-max {
        max-width: none;
    }
    
    #content-section .container {
        max-width: 1400px;
    }
    
    #content-section .row {
        align-items: center;
    }
    
    #content-section .col-md-6:first-child {
        flex: 0 0 35%;
        max-width: 35%;
    }
    
    #content-section .col-md-6:last-child {
        flex: 0 0 65%;
        max-width: 65%;
        padding-left: 3rem;
    }
    
    #content-section .figure-holder img {
        transform: scale(0.9);
        transform-origin: center;
        will-change: transform;
    }
    
    #content-section .key-points-list {
        columns: 2;
        column-gap: 3rem;
        column-fill: balance;
    }
    
    #content-section .key-points-list li {
        break-inside: avoid;
        margin-bottom: 0.75rem;
        page-break-inside: avoid;
    }
}

/* Extra large screen optimizations */
@media (min-width: 1200px) {
    #content-section .container {
        max-width: 1600px;
    }
    
    #content-section .col-md-6:last-child {
        padding-left: 4rem;
    }
    
    #content-section .key-points-list {
        column-gap: 3.5rem;
    }
    
    #content-section .key-points-list li {
        margin-bottom: 1rem;
    }
}

/* Mobile content layout */
@media (max-width: 991.98px) {
    #content-section .key-points-list {
        columns: 1;
    }
}

/* Mobile spacing fix for audience section icons */
@media (max-width: 768px) {
    #audience-section .item-icon i {
        margin-left: 2px;
    }
}

/* Medium screen content optimizations */
@media (min-width: 768px) and (max-width: 991.98px) {
    #content-section .single-col-max {
        max-width: none;
    }
    
    #content-section .container {
        max-width: 1200px;
    }
    
    #content-section .row {
        align-items: center;
    }
    
    #content-section .col-md-6:first-child {
        flex: 0 0 35%;
        max-width: 35%;
    }
    
    #content-section .col-md-6:last-child {
        flex: 0 0 65%;
        max-width: 65%;
        padding-left: 2rem;
    }
    
    #content-section .figure-holder img {
        transform: scale(0.9);
        transform-origin: center;
    }
    
    #content-section .key-points-list {
        columns: 2;
        column-gap: 2rem;
        column-fill: balance;
    }
    
    #content-section .key-points-list li {
        break-inside: avoid;
        margin-bottom: 0.75rem;
        page-break-inside: avoid;
    }
} 