/* ======================================================
   PAGE ÉDITIONS — Olympiades de Robotique UCAO
   Design premium — animations, dégradés, effets visuels
   ====================================================== */

/* === KEYFRAMES === */
@keyframes edFadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes edCardReveal {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes edShimmer {
    0% {
        background-position: -200% center;
    }

    100% {
        background-position: 200% center;
    }
}

@keyframes edGlowPulse {

    0%,
    100% {
        opacity: 0.25;
    }

    50% {
        opacity: 0.55;
    }
}

@keyframes edPulseDot {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.6);
    }
}

@keyframes edBadgeFloat {

    0%,
    100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-6px) rotate(2deg);
    }
}

@keyframes edLineScan {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

@keyframes edSlideLeft {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes edSlideRight {
    from {
        opacity: 0;
        transform: translateX(40px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* ======================================================
   BAND DE STATS (après le héros)
   ====================================================== */
.ed-stats-band {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 50%, #1e4a7a 100%);
    position: relative;
    overflow: hidden;
    border-bottom: 3px solid var(--golden);
}

.ed-stats-band::before {
    content: '';
    position: absolute;
    inset: 0;
    background: repeating-linear-gradient(90deg,
            rgba(255, 255, 255, 0.02) 0px, rgba(255, 255, 255, 0.02) 1px,
            transparent 1px, transparent 80px);
    pointer-events: none;
}

.ed-stats-row {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
}

.ed-stat-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 28px 32px;
    position: relative;
    transition: background 0.3s ease;
    animation: edFadeUp 0.5s ease-out both;
}

.ed-stat-item:nth-child(1) {
    animation-delay: 0.1s;
}

.ed-stat-item:nth-child(2) {
    animation-delay: 0.2s;
}

.ed-stat-item:nth-child(3) {
    animation-delay: 0.3s;
}

.ed-stat-item:nth-child(4) {
    animation-delay: 0.4s;
}

.ed-stat-item:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 22%;
    height: 56%;
    width: 1px;
    background: rgba(255, 255, 255, 0.12);
}

.ed-stat-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.ed-stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: rgba(212, 160, 23, 0.15);
    border: 1px solid rgba(212, 160, 23, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: var(--golden-light);
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.ed-stat-item:hover .ed-stat-icon {
    transform: scale(1.1) rotate(-5deg);
}

.ed-stat-info {
    display: flex;
    flex-direction: column;
}

.ed-stat-num {
    font-family: var(--font-tech);
    font-size: 1.9rem;
    font-weight: 800;
    color: #fff;
    line-height: 1;
}

.ed-stat-label {
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.6);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-top: 4px;
}

/* ======================================================
   SECTION ÉDITION EN COURS — Bloc featured premium
   ====================================================== */
.ed-featured-wrap {
    background: var(--white);
    border-radius: 24px;
    box-shadow: 0 8px 50px rgba(27, 58, 107, 0.12);
    overflow: hidden;
    display: grid;
    grid-template-columns: 420px 1fr;
    position: relative;
    border: 1px solid rgba(27, 58, 107, 0.06);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.4s ease;
}

.ed-featured-wrap:hover {
    transform: translateY(-4px);
    box-shadow: 0 20px 70px rgba(27, 58, 107, 0.16);
}

/* Ligne colorée en haut */
.ed-featured-wrap::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--golden), var(--red), var(--golden), var(--primary));
    background-size: 200% 100%;
    animation: edLineScan 5s linear infinite;
    z-index: 2;
}

/* === Colonne visuelle gauche === */
.ed-featured-visual {
    position: relative;
    background: linear-gradient(145deg, var(--primary-dark) 0%, var(--primary) 55%, #1a4580 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 40px;
    overflow: hidden;
    animation: edSlideLeft 0.6s ease-out both;
}

/* Halos décoratifs */
.ed-featured-visual::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(212, 160, 23, 0.18) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: edGlowPulse 4s ease-in-out infinite;
}

.ed-featured-visual::after {
    content: '';
    position: absolute;
    bottom: -40px;
    left: -40px;
    width: 180px;
    height: 180px;
    background: radial-gradient(circle, rgba(200, 16, 46, 0.12) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
    animation: edGlowPulse 5s ease-in-out infinite 1s;
}

.ed-featured-img-ring {
    position: relative;
    z-index: 1;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    border: 3px solid rgba(212, 160, 23, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(8px);
    box-shadow: 0 0 40px rgba(212, 160, 23, 0.15), 0 0 80px rgba(27, 58, 107, 0.2);
    margin-bottom: 28px;
}

.ed-featured-img-ring img {
    width: 160px;
    height: 160px;
    object-fit: contain;
    filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.4));
    transition: transform 0.5s ease;
}

.ed-featured-wrap:hover .ed-featured-img-ring img {
    transform: scale(1.08) rotate(3deg);
}

.ed-featured-year {
    position: relative;
    z-index: 1;
    font-family: var(--font-tech);
    font-size: 3.5rem;
    font-weight: 900;
    background: linear-gradient(135deg, #ffffff 0%, var(--golden-light) 60%, var(--golden) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -1px;
    line-height: 1;
    text-shadow: none;
    animation: edBadgeFloat 6s ease-in-out infinite;
}

.ed-featured-visual-dots {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.ed-featured-dot {
    position: absolute;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: rgba(212, 160, 23, 0.4);
    animation: edGlowPulse 3s ease-in-out infinite;
}

/* === Colonne info droite === */
.ed-featured-info {
    padding: 45px 50px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    animation: edSlideRight 0.6s ease-out 0.1s both;
}

.ed-featured-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 18px;
    border-radius: 30px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 18px;
    width: fit-content;
    background: linear-gradient(135deg, #dcfce7, #bbf7d0);
    color: #15803d;
    border: 1px solid rgba(21, 128, 61, 0.2);
}

.ed-featured-status .pulse-dot {
    font-size: 0.45rem;
    animation: edPulseDot 1.4s ease-in-out infinite;
}

.ed-featured-info h3 {
    font-family: var(--font-tech);
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 6px;
    line-height: 1.2;
}

.ed-featured-theme {
    font-size: 1rem;
    color: var(--golden);
    font-weight: 600;
    font-style: italic;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ed-featured-theme i {
    font-size: 0.85rem;
    opacity: 0.8;
}

.ed-featured-desc {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 24px;
    border-left: 3px solid var(--golden-pale);
    padding-left: 16px;
}

/* Méta données */
.ed-featured-meta {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 22px;
}

.ed-meta-chip {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px;
    background: var(--gray-50);
    border-radius: var(--radius);
    border: 1px solid var(--gray-200);
    transition: border-color 0.3s, background 0.3s;
}

.ed-meta-chip:hover {
    background: var(--golden-pale);
    border-color: rgba(212, 160, 23, 0.3);
}

.ed-meta-chip i {
    font-size: 1rem;
    color: var(--golden);
    margin-bottom: 2px;
}

.ed-meta-chip span {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.ed-meta-chip strong {
    font-size: 0.92rem;
    color: var(--text);
    font-weight: 700;
}

/* Tags de thèmes */
.ed-featured-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 28px;
}

.ed-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    background: linear-gradient(135deg, var(--golden-pale), #fff8e8);
    color: #92690a;
    border: 1px solid rgba(212, 160, 23, 0.25);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

.ed-tag:hover {
    background: var(--golden);
    color: var(--white);
    border-color: var(--golden);
    transform: translateY(-2px);
}

.ed-tag i {
    font-size: 0.7rem;
}

/* Actions */
.ed-featured-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.btn-ed-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 28px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 4px 16px rgba(27, 58, 107, 0.3);
}

.btn-ed-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(27, 58, 107, 0.4);
}

.btn-ed-outline {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 26px;
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-ed-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(27, 58, 107, 0.2);
}

/* ======================================================
   SECTION VIDE (no-data éditions)
   ====================================================== */
.ed-empty {
    text-align: center;
    padding: 80px 20px;
    border-radius: 20px;
    background: var(--white);
    border: 2px dashed var(--gray-200);
}

.ed-empty-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--gray-100), var(--gray-50));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--text-muted);
    margin: 0 auto 20px;
}

.ed-empty p {
    font-size: 1.1rem;
    color: var(--text-light);
    font-weight: 600;
    margin-bottom: 8px;
}

.ed-empty small {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ======================================================
   GRILLE ÉDITIONS PRÉCÉDENTES
   ====================================================== */
.ed-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}

.ed-card {
    background: var(--white);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(27, 58, 107, 0.07);
    border: 1px solid rgba(27, 58, 107, 0.05);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
    animation: edCardReveal 0.5s ease-out both;
}

.ed-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 20px 50px rgba(27, 58, 107, 0.15);
}

/* Image / couverture */
.ed-card-cover {
    position: relative;
    height: 190px;
    overflow: hidden;
    background: linear-gradient(145deg, var(--primary-dark), var(--primary));
}

.ed-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    opacity: 0.85;
}

.ed-card:hover .ed-card-cover img {
    transform: scale(1.08);
    opacity: 1;
}

/* Gradient overlay sur l'image */
.ed-card-cover-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
            rgba(10, 20, 40, 0.1) 0%,
            rgba(10, 20, 40, 0.5) 60%,
            rgba(10, 20, 40, 0.85) 100%);
    transition: opacity 0.35s ease;
}

.ed-card:hover .ed-card-cover-overlay {
    opacity: 0.7;
}

.ed-card-year-tag {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    font-family: var(--font-tech);
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--white);
    background: linear-gradient(135deg, rgba(212, 160, 23, 0.9), rgba(232, 182, 41, 0.85));
    padding: 5px 14px;
    border-radius: var(--radius-sm);
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(4px);
}

.ed-card-bottom-info {
    position: absolute;
    bottom: 14px;
    left: 14px;
    right: 14px;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ed-card-status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    backdrop-filter: blur(8px);
    background: rgba(212, 160, 23, 0.85);
    color: #fff;
}

.ed-card-status-badge.status-termine,
.ed-card-status-badge.status-archive {
    background: rgba(100, 116, 139, 0.85);
}

/* Body de la carte */
.ed-card-body {
    padding: 22px 24px 26px;
}

.ed-card-title {
    font-family: var(--font-tech);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 8px;
    line-height: 1.3;
}

.ed-card-desc {
    font-size: 0.85rem;
    color: var(--text-light);
    line-height: 1.65;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Stats de la carte */
.ed-card-stats {
    display: flex;
    gap: 0;
    background: var(--gray-50);
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--gray-200);
    margin-bottom: 18px;
}

.ed-card-stat {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 10px 8px;
    position: relative;
}

.ed-card-stat:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 15%;
    height: 70%;
    width: 1px;
    background: var(--gray-200);
}

.ed-card-stat i {
    font-size: 0.8rem;
    color: var(--golden);
}

.ed-card-stat strong {
    font-size: 1rem;
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-tech);
    line-height: 1;
}

.ed-card-stat span {
    font-size: 0.68rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* Actions de la carte */
.ed-card-actions {
    display: flex;
    gap: 8px;
}

.btn-ed-card-primary {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(27, 58, 107, 0.25);
}

.btn-ed-card-primary:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: var(--white);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(27, 58, 107, 0.35);
}

.btn-ed-card-outline {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 14px;
    background: transparent;
    color: var(--primary);
    border: 1.5px solid var(--primary);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    transition: all 0.3s ease;
}

.btn-ed-card-outline:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-1px);
}

/* ======================================================
   TITRE DE SECTION OVERRIDES
   ====================================================== */
.ed-section-header {
    text-align: center;
    margin-bottom: 52px;
}

.ed-section-kicker {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--blue-pale);
    color: var(--blue);
    padding: 5px 16px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    margin-bottom: 14px;
}

.ed-section-kicker i {
    font-size: 0.7rem;
}

.ed-section-header h2 {
    font-family: var(--font-tech);
    font-size: 2rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 10px;
}

.ed-section-header h2 em {
    font-style: normal;
    color: var(--golden);
    position: relative;
}

.ed-section-header h2 em::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--golden);
    opacity: 0.4;
    border-radius: 1px;
}

.ed-section-header p {
    font-size: 1rem;
    color: var(--text-light);
    max-width: 560px;
    margin: 0 auto;
}

.ed-section-line {
    width: 60px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--golden));
    border-radius: 2px;
    margin: 14px auto 0;
}

/* ======================================================
   RESPONSIVE
   ====================================================== */
@media (max-width: 1024px) {
    .ed-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .ed-featured-wrap {
        grid-template-columns: 1fr;
    }

    .ed-featured-visual {
        min-height: 280px;
        flex-direction: row;
        gap: 30px;
        justify-content: center;
        padding: 35px 30px;
    }

    .ed-featured-img-ring {
        width: 160px;
        height: 160px;
        margin-bottom: 0;
    }

    .ed-featured-img-ring img {
        width: 110px;
        height: 110px;
    }

    .ed-featured-year {
        font-size: 2.5rem;
        animation: none;
    }

    .ed-featured-info {
        padding: 35px 40px;
    }

    .ed-featured-meta {
        grid-template-columns: repeat(3, 1fr);
    }

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

@media (max-width: 768px) {
    .ed-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .ed-stat-item {
        padding: 20px 18px;
        gap: 12px;
    }

    .ed-stat-num {
        font-size: 1.5rem;
    }

    .ed-featured-visual {
        flex-direction: column;
        padding: 30px 24px;
        min-height: auto;
    }

    .ed-featured-info {
        padding: 28px 24px 36px;
    }

    .ed-featured-info h3 {
        font-size: 1.45rem;
    }

    .ed-featured-meta {
        grid-template-columns: repeat(2, 1fr);
    }

    .ed-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .ed-section-header h2 {
        font-size: 1.6rem;
    }
}

@media (max-width: 480px) {
    .ed-stats-row {
        grid-template-columns: repeat(2, 1fr);
    }

    .ed-stat-item:nth-child(2)::after,
    .ed-stat-item:nth-child(4)::after {
        display: none;
    }

    .ed-featured-meta {
        grid-template-columns: 1fr 1fr;
    }

    .ed-featured-actions {
        flex-direction: column;
    }

    .btn-ed-primary,
    .btn-ed-outline {
        justify-content: center;
    }
}