/* ==========================================================================
   LIENS CONTEXTUELS ET COMPOSANTS AMÉLIORÉS - Version Optimisée
   ========================================================================== */

/* Section contextuelle Blog -> About */
.contextual-section {
    padding: var(--space-xl) 0;
    background: linear-gradient(135deg, var(--blanc-silence) 0%, var(--beige-cocon) 50%, var(--blanc-silence) 100%);
    margin: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.contextual-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--rose-confident), transparent);
}

.contextual-card {
    background: var(--couleur-blanc);
    padding: var(--space-xl);
    border-radius: var(--border-radius-lg);
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    border: 1px solid var(--beige-cocon);
    transition: var(--transition-base);
}

.contextual-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.contextual-card__icon {
    font-size: 3rem;
    margin-bottom: var(--space-md);
    display: block;
}

.contextual-card__title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--griss-ancré);
    margin-bottom: var(--space-sm);
    font-weight: 500;
}

.contextual-card__text {
    color: var(--couleur-texte-secondaire);
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: var(--space-lg);
}

.contextual-card__btn {
    display: inline-flex;
    align-items: center;
    font-weight: 500;
}

/* Section promotionnelle About -> Blog */
.blog-promo-section {
    padding: var(--space-xl) 0;
    background: linear-gradient(135deg, var(--vert-respiration) 0%, var(--griss-ancré) 100%);
    color: var(--couleur-blanc);
    text-align: center;
    position: relative;
}

.blog-promo-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" opacity="0.1"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="white"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    pointer-events: none;
}

.blog-promo__content {
    position: relative;
    z-index: 1;
    max-width: 600px;
    margin: 0 auto;
}

.blog-promo__title {
    color: var(--couleur-blanc);
    font-size: 2rem;
    margin-bottom: var(--space-md);
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: var(--font-heading);
    font-weight: 500;
}

.blog-promo__text {
    font-size: 1.2rem;
    margin-bottom: var(--space-lg);
    opacity: 0.95;
    line-height: 1.6;
}

.blog-promo__features {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    margin: var(--space-lg) 0;
    flex-wrap: wrap;
}

.feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-xs);
}

.feature__icon {
    font-size: 2rem;
}

.feature__text {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--couleur-blanc);
}

.blog-promo__btn {
    background: var(--couleur-blanc);
    color: var(--griss-ancré);
    font-weight: 600;
    border: 2px solid var(--couleur-blanc);
}

.blog-promo__btn:hover {
    background: transparent;
    color: var(--couleur-blanc);
    transform: translateY(-2px);
}

/* Navigation du footer */
.footer-nav {
    margin-bottom: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-nav__links {
    display: flex;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.footer-nav__link {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    color: var(--couleur-blanc);
    text-decoration: none;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
    font-weight: 500;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-nav__link:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-2px);
    border-color: rgba(255, 255, 255, 0.2);
}

.footer-nav__icon {
    font-size: 1.1rem;
}

.footer-nav__info {
    text-align: center;
}

.footer-nav__text {
    color: rgba(255, 255, 255, 0.8);
    font-style: italic;
    font-size: 1.1rem;
}

/* ==========================================================================
   BOUTONS AMÉLIORÉS - OPTIMISÉS
   ========================================================================== */
.btn--secondary {
    background: transparent;
    color: var(--rose-confident);
    border: 2px solid var(--rose-confident);
    position: relative;
    overflow: hidden;
    transition: var(--transition-base);
}

.btn--secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: var(--rose-confident);
    transition: var(--transition-base);
    z-index: -1;
}

.btn--secondary:hover {
    color: var(--couleur-blanc);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn--secondary:hover::before {
    left: 0;
}

/* ==========================================================================
   AMÉLIORATIONS D'ACCESSIBILITÉ
   ========================================================================== */
.keyboard-navigation .nav__link:focus,
.keyboard-navigation .btn:focus,
.keyboard-navigation .article-card__link:focus {
    outline: 3px solid var(--rose-confident);
    outline-offset: 3px;
    border-radius: var(--border-radius);
}

/* Focus visible amélioré */
.nav__link:focus-visible,
.btn:focus-visible,
.article-card__link:focus-visible,
.footer-nav__link:focus-visible,
.mobile-menu-btn:focus-visible,
.scroll-to-top:focus-visible {
    outline: 3px solid var(--rose-confident);
    outline-offset: 2px;
    border-radius: var(--border-radius);
}

/* Indicateurs de focus pour la navigation mobile */
.nav-mobile__link:focus-visible {
    outline: 3px solid var(--rose-confident);
    outline-offset: -2px;
    border-radius: var(--border-radius);
}

/* ==========================================================================
   ANIMATIONS ET TRANSITIONS AMÉLIORÉES
   ========================================================================== */
.page-transition {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.page-loaded .page-transition {
    opacity: 1;
    transform: translateY(0);
}

/* Animation d'entrée progressive pour les cartes */
.article-card.animated-in {
    animation: cardSlideIn 0.6s ease forwards;
}

@keyframes cardSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading states améliorés */
.lazy-loading {
    background: linear-gradient(90deg, var(--beige-cocon) 25%, var(--blanc-silence) 50%, var(--beige-cocon) 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: var(--border-radius);
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Skeleton loading pour les images */
.skeleton-image {
    background: var(--beige-cocon);
    position: relative;
    overflow: hidden;
}

.skeleton-image::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: skeletonLoading 1.5s infinite;
}

@keyframes skeletonLoading {
    100% {
        transform: translateX(100%);
    }
}

/* ==========================================================================
   AMÉLIORATIONS DU SCROLL-TO-TOP
   ========================================================================== */
.scroll-to-top {
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
}

.scroll-to-top.visible {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.scroll-to-top:hover {
    transform: translateY(-3px) scale(1.05);
}

/* ==========================================================================
   RESPONSIVE DESIGN - AMÉLIORATIONS MOBILE
   ========================================================================== */
@media (max-width: 768px) {
    .contextual-section {
        padding: var(--space-lg) 0;
        margin: var(--space-lg) 0;
    }
    
    .contextual-card {
        padding: var(--space-lg);
        margin: 0 var(--space-sm);
    }
    
    .contextual-card__icon {
        font-size: 2.5rem;
    }
    
    .contextual-card__title {
        font-size: 1.3rem;
    }
    
    .contextual-card__text {
        font-size: 1rem;
    }
    
    .blog-promo-section {
        padding: var(--space-lg) 0;
    }
    
    .blog-promo__title {
        font-size: 1.5rem;
    }
    
    .blog-promo__text {
        font-size: 1.1rem;
    }
    
    .blog-promo__features {
        gap: var(--space-md);
    }
    
    .feature__icon {
        font-size: 1.5rem;
    }
    
    .footer-nav__links {
        flex-direction: column;
        gap: var(--space-sm);
        align-items: center;
    }
    
    .footer-nav__link {
        width: 200px;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .contextual-card {
        padding: var(--space-md);
    }
    
    .blog-promo__features {
        flex-direction: column;
        gap: var(--space-sm);
    }
    
    .feature {
        flex-direction: row;
        justify-content: center;
        text-align: left;
        width: 100%;
        max-width: 250px;
    }
    
    .footer-nav__link {
        width: 100%;
        max-width: 250px;
    }
    
    .scroll-to-top {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
    }
}

/* ==========================================================================
   ACCESSIBILITÉ - RÉDUCTION DES MOUVEMENTS
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
    .contextual-card,
    .article-card,
    .btn,
    .scroll-to-top,
    .nav-mobile__link,
    .footer-nav__link {
        transition: none;
        animation: none;
    }
    
    .contextual-card:hover,
    .article-card:hover,
    .btn:hover,
    .footer-nav__link:hover {
        transform: none;
    }
    
    .page-transition {
        transition: opacity 0.1s ease;
    }
    
    .lazy-loading,
    .skeleton-image::after {
        animation: none;
    }
    
    .scroll-to-top:hover {
        transform: none;
    }
}

/* ==========================================================================
   ÉTATS DE CONTRASTE ÉLEVÉ
   ========================================================================== */
@media (prefers-contrast: high) {
    .contextual-card {
        border: 2px solid var(--griss-ancré);
    }
    
    .footer-nav__link {
        border: 2px solid var(--couleur-blanc);
    }
    
    .nav__link--active {
        font-weight: 600;
        text-decoration: underline;
    }
    
    .btn--secondary {
        border: 3px solid var(--rose-confident);
    }
}

/* ==========================================================================
   IMPRESSION
   ========================================================================== */
@media print {
    .contextual-section,
    .blog-promo-section,
    .footer-nav,
    .scroll-to-top {
        display: none !important;
    }
    
    .contextual-card {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}