/* ============================================================================
   Pouls IVC — Bloc Section 1 home Opérationnelle
   Préfixe : .vipi- (VIgicrecy Pouls Ivc)
   v1.0.1 (17/05/2026) — Correction largeur : fond pleine largeur, contenu centré
============================================================================ */

/* ----------------------------------------------------------------------------
   0. Override du bandeau Vigilance pour qu'il déborde aussi en pleine largeur
      Le CSS du plugin vigicrecy-vigilance utilise !important systématiquement,
      donc on en utilise aussi pour le surcharger proprement.
---------------------------------------------------------------------------- */

.elementor .vcvig-stack,
.vcvig-stack {
    margin-left: calc(-50vw + 50%) !important;
    margin-right: calc(-50vw + 50%) !important;
    width: 100vw !important;
    max-width: 100vw !important;
}
.elementor .vcvig-stack .vcvig-banner,
.vcvig-stack .vcvig-banner {
    padding: 12px max(20px, calc((100vw - 1200px) / 2)) !important;
    border-radius: 0 !important;
    box-shadow: none !important;
}

/* ----------------------------------------------------------------------------
   1. Conteneur de section : déborde du conteneur Elementor pour s'étendre
      en pleine largeur du viewport
---------------------------------------------------------------------------- */

.vipi-section {
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
    max-width: 100vw;
    padding: 0;
    box-sizing: border-box;
    overflow: hidden;
}
.vipi-section *,
.vipi-section *::before,
.vipi-section *::after {
    box-sizing: border-box;
}

/* ----------------------------------------------------------------------------
   2. Vague de transition map → glass — pleine largeur viewport
---------------------------------------------------------------------------- */

.vipi-wave-wrap {
    line-height: 0;
    background: #FFFFFF;
    width: 100%;
}
.vipi-wave-svg {
    width: 100%;
    height: 70px;
    display: block;
}
@keyframes vipi-wave-fill-anim {
    0%, 100% { d: path("M0,0 C200,62 400,75 600,32 C800,5 1000,18 1200,65 L1200,80 L0,80 Z"); }
    50%      { d: path("M0,0 C200,22 400,38 600,68 C800,48 1000,32 1200,22 L1200,80 L0,80 Z"); }
}
@keyframes vipi-wave-stroke-anim {
    0%, 100% { d: path("M0,32 C200,62 400,75 600,32 C800,5 1000,18 1200,65"); }
    50%      { d: path("M0,42 C200,22 400,38 600,68 C800,48 1000,32 1200,22"); }
}
.vipi-wave-fill {
    animation: vipi-wave-fill-anim 6s ease-in-out infinite;
}
.vipi-wave-stroke {
    animation: vipi-wave-stroke-anim 6s ease-in-out infinite;
}

/* ----------------------------------------------------------------------------
   3. Wrapper glassmorphism — fond pleine largeur, contenu centré max 1200px
---------------------------------------------------------------------------- */

.vipi-glass-wrap {
    position: relative;
    width: 100%;
    background: radial-gradient(ellipse at top right, #1486CC 0%, #016AB1 45%, #014A85 100%);
    padding: 26px max(20px, calc((100vw - 1200px) / 2)) 24px;
    overflow: hidden;
    color: #ffffff;
}

.vipi-halo {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    z-index: 0;
}
.vipi-halo--cyan {
    top: -50px;
    right: -90px;
    width: 320px;
    height: 320px;
    background: radial-gradient(circle, rgba(6,217,250,0.22) 0%, transparent 70%);
}
.vipi-halo--turq {
    bottom: -80px;
    left: -60px;
    width: 280px;
    height: 280px;
    background: radial-gradient(circle, rgba(59,191,176,0.15) 0%, transparent 70%);
}

/* ----------------------------------------------------------------------------
   4. Header de section
---------------------------------------------------------------------------- */

.vipi-header {
    position: relative;
    z-index: 1;
    margin: 0 0 18px;
}
.vipi-eyebrow {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
    color: #B8ECFF;
    margin: 0 0 4px;
    font-weight: 500;
}
.vipi-title {
    font-size: 24px;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
    line-height: 1.2;
    letter-spacing: -0.3px;
}

/* ----------------------------------------------------------------------------
   5. Grille : édito gauche + cartes droite
---------------------------------------------------------------------------- */

.vipi-grid {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1.1fr 1.6fr;
    gap: 16px;
}

.vipi-edito {
    animation: vipi-fadeup 0.6s ease-out both;
    animation-delay: 0.1s;
}

.vipi-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

/* ----------------------------------------------------------------------------
   6. Cartes IVC — format carré 1:1, contenu réparti verticalement
---------------------------------------------------------------------------- */

.vipi-card {
    position: relative;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 0.5px solid rgba(255,255,255,0.45);
    border-radius: 12px;
    padding: 12px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
    color: #1A2E4A;
    animation: vipi-fadeup 0.6s ease-out both;
    aspect-ratio: 1 / 1;
    display: flex;
    flex-direction: column;
}

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

.vipi-card__head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 4px;
    gap: 6px;
}
.vipi-card__name {
    font-size: 11.5px;
    font-weight: 500;
    color: #1A2E4A;
    line-height: 1.2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    word-break: normal;
    overflow-wrap: anywhere;
}
.vipi-card__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.08);
    flex-shrink: 0;
    display: inline-block;
    margin-top: 2px;
}

.vipi-card__value-row {
    display: flex;
    align-items: baseline;
    gap: 5px;
    flex-wrap: wrap;
    margin-top: 2px;
}
.vipi-card__value {
    font-size: 26px;
    font-weight: 600;
    color: #1A2E4A;
    line-height: 1;
    letter-spacing: -0.5px;
}
.vipi-card__alerte {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.vipi-card__action {
    font-size: 10px;
    color: #1A2E4A;
    margin: 3px 0 0;
    line-height: 1.2;
    display: flex;
    align-items: center;
    gap: 4px;
}
.vipi-card__action em {
    font-style: italic;
}

.vipi-sparkline {
    width: 100%;
    height: 22px;
    display: block;
    margin: auto 0 4px;
}

.vipi-card__meta {
    display: flex;
    justify-content: space-between;
    font-size: 10.5px;
    color: #5F5E5A;
    margin-top: auto;
}

.vipi-card--no-data {
    opacity: 0.7;
}
.vipi-card__no-data {
    padding: 6px 0;
    margin: auto 0;
    text-align: center;
}
.vipi-card__no-data-label {
    font-size: 10px;
    font-style: italic;
    color: #5F5E5A;
}

.vipi-card--focus {
    animation: vipi-fadeup 0.6s ease-out both, vipi-glow 2.4s ease-in-out infinite 0.8s;
}
.vipi-card--focus .vipi-card__name {
    font-weight: 600;
}
.vipi-card__badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #FF9100;
    color: #ffffff;
    font-size: 9px;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 999px;
    letter-spacing: 0.3px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18);
    z-index: 2;
}

@keyframes vipi-glow {
    0%, 100% {
        box-shadow:
            0 0 0 0 rgba(255,145,0,0.55),
            0 2px 12px rgba(0,0,0,0.18);
    }
    50% {
        box-shadow:
            0 0 0 6px rgba(255,145,0,0),
            0 2px 12px rgba(0,0,0,0.18),
            0 0 22px rgba(255,145,0,0.7);
    }
}

/* ----------------------------------------------------------------------------
   7. 8e case Agenda (gradient marine → cyan)
---------------------------------------------------------------------------- */

.vipi-card--agenda,
.vipi-agenda {
    background: linear-gradient(135deg, #016AB1, #06D9FA);
    border: 0.5px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    padding: 12px;
    color: #ffffff;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    box-shadow:
        0 4px 18px rgba(6,217,250,0.32),
        inset 0 1px 0 rgba(255,255,255,0.3);
    animation: vipi-fadeup 0.6s ease-out both;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    aspect-ratio: 1 / 1;
}
.vipi-agenda:hover {
    transform: translateY(-2px);
    box-shadow:
        0 6px 22px rgba(6,217,250,0.42),
        inset 0 1px 0 rgba(255,255,255,0.4);
    color: #ffffff;
}
.vipi-agenda__head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}
.vipi-agenda__label {
    font-size: 11.5px;
    font-weight: 500;
}
.vipi-agenda__icon {
    display: inline-flex;
    line-height: 0;
}
.vipi-agenda__date {
    font-size: 22px;
    font-weight: 600;
    line-height: 1.05;
    margin-top: 2px;
    letter-spacing: -0.3px;
}
.vipi-agenda__desc {
    font-size: 11px;
    line-height: 1.3;
    margin: 4px 0;
    opacity: 0.95;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.vipi-agenda__more {
    font-size: 10.5px;
    opacity: 0.85;
    border-top: 0.5px solid rgba(255,255,255,0.25);
    padding-top: 4px;
    margin-top: auto;
}

/* ----------------------------------------------------------------------------
   8. Légende du bas
---------------------------------------------------------------------------- */

.vipi-legend {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 11px;
    color: rgba(255,255,255,0.78);
}
.vipi-legend__item {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.vipi-legend__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

/* ----------------------------------------------------------------------------
   9. Édito glass — léger override pour s'inscrire dans la grille
---------------------------------------------------------------------------- */

.vipi-edito .vcedito-card--glass {
    height: 100%;
    margin: 0;
}

/* ----------------------------------------------------------------------------
   10. Responsive
---------------------------------------------------------------------------- */

@media (max-width: 1100px) {
    .vipi-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    .vipi-cards {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 700px) {
    .vipi-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    .vipi-card,
    .vipi-agenda {
        aspect-ratio: auto;
        min-height: 130px;
    }
}

@media (max-width: 420px) {
    .vipi-glass-wrap {
        padding: 22px 14px 18px;
    }
    .vipi-cards {
        grid-template-columns: 1fr;
        gap: 8px;
    }
    .vipi-card,
    .vipi-agenda {
        min-height: 0;
    }
    .vipi-wave-svg {
        height: 40px;
    }
    .vipi-title {
        font-size: 20px;
    }
    .vipi-legend {
        gap: 10px;
        font-size: 10px;
    }
}

/* ----------------------------------------------------------------------------
   11. Accessibilité : respect du prefers-reduced-motion
---------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .vipi-wave-fill,
    .vipi-wave-stroke,
    .vipi-edito,
    .vipi-card,
    .vipi-card--focus,
    .vipi-agenda {
        animation: none !important;
    }
    .vipi-edito,
    .vipi-card,
    .vipi-agenda {
        opacity: 1;
        transform: none;
    }
}
