/**
 * Kemati Theme - Gutenberg Patterns & Effects
 * Styles premium pour les blocs et patterns Gutenberg
 * 
 * @package Kemati
 */

/* ==========================================================================
   VARIABLES CSS SUPPLÉMENTAIRES
   ========================================================================== */

:root {
    /* Animations */
    --kemati-ease-out-expo: cubic-bezier(0.19, 1, 0.22, 1);
    --kemati-ease-in-out-circ: cubic-bezier(0.85, 0, 0.15, 1);
    --kemati-ease-elegant: cubic-bezier(0.4, 0, 0.2, 1);
    
    /* Durées */
    --kemati-duration-fast: 0.2s;
    --kemati-duration-base: 0.4s;
    --kemati-duration-slow: 0.6s;
    --kemati-duration-elegant: 0.8s;
}

/* ==========================================================================
   EFFETS D'IMAGES - PRÉPARATION POUR PHOTOS
   ========================================================================== */

/* Zoom au survol */
.has-hover-zoom {
    overflow: hidden;
}

.has-hover-zoom img {
    transition: transform var(--kemati-duration-elegant) var(--kemati-ease-elegant);
    will-change: transform;
}

.has-hover-zoom:hover img {
    transform: scale(1.08);
}

/* Élévation au survol */
.has-hover-lift {
    transition: transform var(--kemati-duration-base) var(--kemati-ease-elegant),
                box-shadow var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.has-hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

/* Effet parallaxe */
.has-parallax-effect {
    background-attachment: fixed;
    background-position: center;
    background-size: cover;
}

@media (max-width: 768px) {
    .has-parallax-effect {
        background-attachment: scroll;
    }
}

/* Overlay gradient au survol */
.has-hover-overlay {
    position: relative;
    overflow: hidden;
}

.has-hover-overlay::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(26, 26, 26, 0.7) 100%);
    opacity: 0;
    transition: opacity var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.has-hover-overlay:hover::after {
    opacity: 1;
}

/* Révélation du contenu */
.has-reveal-content .wp-block-cover__inner-container {
    transform: translateY(20px);
    opacity: 0;
    transition: all var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.has-reveal-content:hover .wp-block-cover__inner-container {
    transform: translateY(0);
    opacity: 1;
}

/* Filtre noir et blanc → couleur */
.has-bw-to-color img {
    filter: grayscale(100%);
    transition: filter var(--kemati-duration-slow) var(--kemati-ease-elegant);
}

.has-bw-to-color:hover img {
    filter: grayscale(0%);
}

/* Filtre sépia vintage */
.has-vintage-filter img {
    filter: sepia(20%) saturate(90%);
    transition: filter var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.has-vintage-filter:hover img {
    filter: sepia(0%) saturate(100%);
}

/* ==========================================================================
   ANIMATIONS D'ENTRÉE
   ========================================================================== */

/* Base pour toutes les animations */
.animate-on-scroll {
    opacity: 0;
    transition: opacity var(--kemati-duration-slow) var(--kemati-ease-elegant),
                transform var(--kemati-duration-slow) var(--kemati-ease-elegant);
}

.animate-on-scroll.animated {
    opacity: 1;
}

/* Fade In Up */
.fade-in-up {
    transform: translateY(40px);
}

.fade-in-up.animated {
    transform: translateY(0);
}

/* Fade In */
.fade-in {
    transform: none;
}

/* Slide In Left */
.slide-in-left {
    transform: translateX(-60px);
}

.slide-in-left.animated {
    transform: translateX(0);
}

/* Slide In Right */
.slide-in-right {
    transform: translateX(60px);
}

.slide-in-right.animated {
    transform: translateX(0);
}

/* Scale Up */
.scale-up {
    transform: scale(0.9);
}

.scale-up.animated {
    transform: scale(1);
}

/* Stagger children animation */
.stagger-children > * {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--kemati-duration-base) var(--kemati-ease-elegant),
                transform var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.stagger-children.animated > *:nth-child(1) { transition-delay: 0s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(2) { transition-delay: 0.1s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(3) { transition-delay: 0.2s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(4) { transition-delay: 0.3s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(5) { transition-delay: 0.4s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(6) { transition-delay: 0.5s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(7) { transition-delay: 0.6s; opacity: 1; transform: translateY(0); }
.stagger-children.animated > *:nth-child(8) { transition-delay: 0.7s; opacity: 1; transform: translateY(0); }

/* ==========================================================================
   PATTERNS STYLES
   ========================================================================== */

/* Hero Fullscreen */
.kemati-hero-fullscreen {
    position: relative;
}

.kemati-hero-title {
    text-shadow: 0 2px 40px rgba(0, 0, 0, 0.3);
}

/* Scroll Indicator */
.kemati-scroll-indicator {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10;
}

.scroll-indicator {
    width: 24px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 12px;
    position: relative;
}

.scroll-line {
    position: absolute;
    top: 8px;
    left: 50%;
    width: 2px;
    height: 8px;
    background-color: var(--wp--preset--color--white);
    transform: translateX(-50%);
    animation: scrollIndicator 1.5s ease-in-out infinite;
}

@keyframes scrollIndicator {
    0%, 100% {
        opacity: 0;
        transform: translateX(-50%) translateY(0);
    }
    50% {
        opacity: 1;
        transform: translateX(-50%) translateY(10px);
    }
}

/* Section Headers */
.section-header {
    margin-bottom: var(--wp--preset--spacing--40);
}

/* Product Cards */
.kemati-product-card {
    transition: transform var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.kemati-product-card:hover {
    transform: translateY(-5px);
}

.kemati-product-image {
    position: relative;
    background-color: var(--wp--preset--color--cream);
}

.kemati-product-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 60%, rgba(26, 26, 26, 0.05) 100%);
    pointer-events: none;
}

/* Categories Showcase */
.kemati-category-cover {
    cursor: pointer;
}

.kemati-category-cover .wp-block-cover__inner-container {
    transition: transform var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.kemati-category-cover:hover .wp-block-cover__inner-container {
    transform: translateY(-10px);
}

/* Testimonials */
.kemati-testimonial {
    transition: transform var(--kemati-duration-base) var(--kemati-ease-elegant),
                box-shadow var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.kemati-testimonial:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
}

/* Trust Bar */
.kemati-trust-bar {
    position: relative;
}

.kemati-trust-icon {
    color: var(--wp--preset--color--secondary);
    flex-shrink: 0;
}

.kemati-trust-item {
    text-align: center;
}

@media (min-width: 782px) {
    .kemati-trust-item:not(:last-child)::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);
        width: 1px;
        height: 40px;
        background-color: var(--wp--preset--color--wood-light);
    }
}

/* Newsletter Form */
.kemati-newsletter-form .newsletter-form-inner {
    display: flex;
    gap: var(--wp--preset--spacing--20);
    max-width: 500px;
    margin: 0 auto;
}

.kemati-newsletter-form .newsletter-input {
    flex: 1;
    padding: var(--wp--preset--spacing--20);
    background-color: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--wp--preset--color--white);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--medium);
}

.kemati-newsletter-form .newsletter-input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

.kemati-newsletter-form .newsletter-input:focus {
    outline: none;
    border-color: var(--wp--preset--color--wood-light);
}

.kemati-newsletter-form .newsletter-submit {
    background-color: var(--wp--preset--color--white);
    color: var(--wp--preset--color--primary);
    border: none;
    padding: var(--wp--preset--spacing--20) var(--wp--preset--spacing--40);
    font-family: var(--wp--preset--font-family--body);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    cursor: pointer;
    transition: all var(--kemati-duration-fast) var(--kemati-ease-elegant);
}

.kemati-newsletter-form .newsletter-submit:hover {
    background-color: var(--wp--preset--color--wood-light);
    color: var(--wp--preset--color--primary);
}

.kemati-newsletter-form .newsletter-consent {
    margin-top: var(--wp--preset--spacing--20);
    text-align: center;
    font-size: var(--wp--preset--font-size--small);
    color: var(--wp--preset--color--grey-light);
}

.kemati-newsletter-form .newsletter-consent input[type="checkbox"] {
    margin-right: 8px;
}

@media (max-width: 600px) {
    .kemati-newsletter-form .newsletter-form-inner {
        flex-direction: column;
    }
}

/* Instagram Gallery */
.kemati-instagram-grid.has-no-gap {
    gap: 0 !important;
}

.kemati-instagram-item {
    aspect-ratio: 1;
    margin: 0 !important;
}

.kemati-instagram-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ==========================================================================
   BOUTONS PREMIUM
   ========================================================================== */

.kemati-btn-elegant .wp-block-button__link {
    position: relative;
    overflow: hidden;
    transition: all var(--kemati-duration-base) var(--kemati-ease-elegant);
}

.kemati-btn-elegant .wp-block-button__link::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--kemati-duration-slow) var(--kemati-ease-elegant);
}

.kemati-btn-elegant .wp-block-button__link:hover::before {
    left: 100%;
}

.kemati-btn-outline-white .wp-block-button__link {
    color: var(--wp--preset--color--white) !important;
    border-color: rgba(255, 255, 255, 0.5) !important;
    background: transparent !important;
}

.kemati-btn-outline-white .wp-block-button__link:hover {
    background-color: var(--wp--preset--color--white) !important;
    color: var(--wp--preset--color--primary) !important;
}

/* ==========================================================================
   OMBRES UTILITAIRES
   ========================================================================== */

.has-shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.has-shadow-medium {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.has-shadow-elevated {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

.has-shadow-dramatic {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ==========================================================================
   RESPONSIVE AJUSTEMENTS
   ========================================================================== */

@media (max-width: 1024px) {
    .kemati-about-columns {
        flex-direction: column !important;
    }
    
    .kemati-about-image-col,
    .kemati-about-content-col {
        flex-basis: 100% !important;
        width: 100% !important;
    }
}

@media (max-width: 768px) {
    .kemati-categories-grid {
        flex-direction: column !important;
    }
    
    .kemati-testimonials-grid {
        flex-direction: column !important;
    }
    
    .kemati-trust-items {
        flex-direction: column !important;
        gap: var(--wp--preset--spacing--30) !important;
    }
}

/* ==========================================================================
   PLACEHOLDER IMAGES (avant ajout de vraies photos)
   ========================================================================== */

.wp-block-cover:not([style*="background-image"]) {
    background-color: var(--wp--preset--color--cream);
    background-image: 
        linear-gradient(45deg, var(--wp--preset--color--wood-light) 25%, transparent 25%),
        linear-gradient(-45deg, var(--wp--preset--color--wood-light) 25%, transparent 25%),
        linear-gradient(45deg, transparent 75%, var(--wp--preset--color--wood-light) 75%),
        linear-gradient(-45deg, transparent 75%, var(--wp--preset--color--wood-light) 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
}

.wp-block-image:not(:has(img[src])) figure,
.wp-block-image img[src=""] {
    background-color: var(--wp--preset--color--cream);
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-block-image img[src=""]::after {
    content: 'Ajouter une image';
    color: var(--wp--preset--color--grey-medium);
    font-size: var(--wp--preset--font-size--small);
}
