/**
 * P13 - Stats Section
 */

/* =====================================================
   SOMMAIRE HEADER ALIGNMENT
   ===================================================== */

.contenu-fiche__right > h3 {
	display: flex;
	align-items: center;
	gap: 0.5em;
}

/* Separate icon from text for better alignment */
.contenu-fiche__right > h3::before {
	content: "☰";
	line-height: 1;
}

/* Grid margin reset */
.section-stats__grid {
    margin: 0 !important;
}

/* Separator line between items */
.section-stats__item {
    position: relative;
}

.section-stats__item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 1px;
    height: 64px;
    background: rgba(255, 255, 255, 0.2);
}

/* =====================================================
   RESPONSIVE
   ===================================================== */
@media (max-width: 781px) {
    .section-stats__grid {
        flex-wrap: wrap !important;
        gap: var(--wp--preset--spacing--lg) var(--wp--preset--spacing--md) !important;
    }

    .section-stats__grid > .wp-block-column {
        flex-basis: calc(50% - var(--wp--preset--spacing--sm)) !important;
        flex-grow: 0 !important;
    }

    .section-stats__grid h3 {
        font-size: 32px !important;
    }

    .section-stats__grid p {
        font-size: 13px !important;
    }

    /* Hide all separators on mobile */
    .section-stats__item::after {
        display: none !important;
    }
}

@media (max-width: 480px) {
    .section-stats__grid h3 {
        font-size: 28px !important;
    }

    .section-stats__grid p {
        font-size: 12px !important;
    }
}

/* =====================================================
   SOMMAIRE ACCORDION (wp:details native block)
   ===================================================== */

.contenu-fiche__accordion {
    border: none;
}

.contenu-fiche__accordion > summary {
    display: inline-flex;
    align-items: center;
    gap: var(--wp--preset--spacing--xs);
    padding: var(--wp--preset--spacing--xs) var(--wp--preset--spacing--sm);
    background: var(--wp--preset--color--primary);
    color: var(--wp--preset--color--white);
    font-size: var(--wp--preset--font-size--small);
    font-weight: 600;
    border-radius: var(--wp--preset--border-radius--md);
    cursor: pointer;
    transition: background 0.2s ease, transform 0.2s ease;
    list-style: none;
}

.contenu-fiche__accordion > summary::-webkit-details-marker {
    display: none;
}

.contenu-fiche__accordion > summary::after {
    content: " ↓";
}

.contenu-fiche__accordion[open] > summary::after {
    content: " ↑";
}

.contenu-fiche__accordion > summary:hover {
    background: var(--wp--preset--color--primary-hover);
    transform: translateY(-1px);
}

/* Spacing between summary and content */
.contenu-fiche__accordion > summary + .wp-block-group {
    margin-top: var(--wp--preset--spacing--md) !important;
}

/* Animation on open */
.contenu-fiche__accordion[open] > .wp-block-group {
    animation: accordionSlide 0.3s ease;
}

@keyframes accordionSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
