/**
 * Styles pour l'affichage public des témoignages
 * Version: 1.0.0
 */

/* Styles communs */
.testimonial-rating {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.testimonial-rating .star {
    font-size: 18px;
    margin-right: 2px;
}

.testimonial-rating .dashicons-star-filled {
    color: #ffcc00;
}

.testimonial-rating .dashicons-star-empty {
    color: #d2d2d7;
}

.testimonial-message {
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    margin-bottom: 16px;
}

.testimonial-author {
    display: flex;
    align-items: center;
    margin-top: 16px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    background-color: #0071e3;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    margin-right: 12px;
    text-transform: uppercase;
}

.author-name {
    font-weight: 500;
    color: #1d1d1f;
}

/* Version simplifiée */
.testimonials-simple-listing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

/* Colonnes fixes */
.testimonials-simple-listing.columns-1 {
    grid-template-columns: 1fr;
}

.testimonials-simple-listing.columns-2 {
    grid-template-columns: repeat(2, 1fr);
}

.testimonials-simple-listing.columns-3 {
    grid-template-columns: repeat(3, 1fr);
}

.testimonials-simple-listing.columns-4 {
    grid-template-columns: repeat(4, 1fr);
}

/* Mode slider */
.testimonials-simple-listing.testimonials-slider {
    display: block;
    position: relative;
    overflow: hidden;
    margin: 20px 0;
}

.testimonials-slider .swiper-wrapper {
    display: flex;
    align-items: stretch;
}

.testimonials-slider .swiper-slide {
    height: auto;
    box-sizing: border-box;
}

.testimonials-slider .testimonial-simple-item {
    height: 100%;
    margin: 0;
}

.testimonial-simple-item {
    background: #fff;
    padding: 24px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 250px;
    display: flex;
    flex-direction: column;
}

.testimonial-simple-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.testimonial-simple-item .testimonial-message {
    flex-grow: 1;
}

.testimonial-simple-item .testimonial-author {
    margin-top: auto;
    padding-top: 16px;
}

/* Styles Swiper personnalisés */
.testimonials-slider .swiper-button-prev,
.testimonials-slider .swiper-button-next {
    position: absolute;
    color: #0071e3;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    top: 50%;
    margin-top: -20px;
    z-index: 10;
}

.testimonials-slider .swiper-button-prev:hover,
.testimonials-slider .swiper-button-next:hover {
    background: #f5f5f7;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.testimonials-slider .swiper-button-prev:after,
.testimonials-slider .swiper-button-next:after {
    font-size: 18px;
    font-weight: bold;
}

.testimonials-slider .swiper-button-prev {
    left: 10px;
}

.testimonials-slider .swiper-button-next {
    right: 10px;
}

.testimonials-slider .swiper-button-disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.testimonials-slider .swiper-button-disabled:hover {
    background: #fff;
}

/* Version grille avec expansion */
.testimonials-grid {
    display: grid;
    gap: 24px;
    margin: 20px 0;
    position: relative;
}

.testimonials-grid[data-columns="1"] {
    grid-template-columns: 1fr;
}

.testimonials-grid[data-columns="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.testimonials-grid[data-columns="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.testimonials-grid[data-columns="4"] {
    grid-template-columns: repeat(4, 1fr);
}

.testimonial-grid-item {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.testimonial-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.testimonial-inner {
    padding: 24px;
}

/* Message avec limitation de lignes */
.testimonial-message-container {
    position: relative;
}

.testimonial-message.clamp-message {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: all 0.3s ease;
}

.testimonial-toggle-link {
    display: inline-block;
    margin-top: 8px;
    color: #0071e3;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.testimonial-toggle-link:hover {
    color: #0077ed;
    text-decoration: underline;
}

/* États d'expansion */
.testimonial-grid-item.expanding {
    animation: expandAnimation 0.4s ease forwards;
}

.testimonial-grid-item.reducing {
    animation: reduceAnimation 0.4s ease forwards;
}

.testimonial-grid-item.expanded {
    grid-column: 1 / -1;
    z-index: 10;
}

.testimonial-grid-item.expanded .testimonial-message.clamp-message {
    -webkit-line-clamp: unset;
    overflow: visible;
}

@keyframes expandAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.02);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes reduceAnimation {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.98);
    }
    100% {
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 1024px) {
    .testimonials-simple-listing.columns-4 {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .testimonials-grid[data-columns="2"],
    .testimonials-grid[data-columns="3"],
    .testimonials-grid[data-columns="4"] {
        grid-template-columns: 1fr;
    }
    
    .testimonials-simple-listing {
        grid-template-columns: 1fr;
    }
    
    .testimonials-simple-listing.columns-3,
    .testimonials-simple-listing.columns-4 {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .testimonial-simple-item,
    .testimonial-inner {
        padding: 20px;
    }
    
    .testimonial-rating .star {
        font-size: 16px;
    }
    
    .testimonial-message {
        font-size: 15px;
    }
    
    .author-avatar {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
}

@media (max-width: 480px) {
    .testimonials-simple-listing.columns-2,
    .testimonials-simple-listing.columns-3,
    .testimonials-simple-listing.columns-4 {
        grid-template-columns: 1fr;
    }
    
    .testimonials-slider .swiper-button-prev,
    .testimonials-slider .swiper-button-next {
        width: 35px;
        height: 35px;
        margin-top: -17.5px;
    }
    
    .testimonials-slider .swiper-button-prev:after,
    .testimonials-slider .swiper-button-next:after {
        font-size: 16px;
    }
    
    .testimonial-simple-item,
    .testimonial-inner {
        padding: 16px;
    }
    
    .testimonial-message {
        font-size: 14px;
    }
}