/* ==========================================================================
   YCMC PALMARES GRID
   ========================================================================== */

.ycmc-palmares-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
    width: 100%;
    margin: 20px 0;
}

.ycmc-palmares-grid--empty {
    display: block;
    color: #686868;
    font-style: italic;
    text-align: center;
    padding: 20px;
}

/* Card */
.ycmc-palmares-card {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    background: white;
    box-shadow:0px 0px 10px #ececec;
    padding: 18px 12px 54px;
    text-align: center;
    color: #1e4c8a;
    transition: transform 0.2s ease;
}

.ycmc-palmares-card:hover {
    transform: translateY(-3px);
}

.ycmc-palmares-card__icon {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 72px;
    height: 60px;
    margin-bottom: 10px;
    color: inherit;
}

.ycmc-palmares-card__icon svg {
    width: 100%;
    height: 100%;
    display: block;
}

.ycmc-palmares-card__title {
    font-size: 1rem;
    font-weight: 600;
    color: inherit;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    line-height: 1.3;
    margin: 0;
    padding: 0;
}

.ycmc-palmares-card__btn {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: 34px;
    height: 34px;
    border-radius: 0;
    border: 0;
    background: transparent;
    color: inherit;
    font-size: 1.8rem;
    font-weight: 300;
    line-height: 1;
    cursor: pointer;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.ycmc-palmares-card__btn:hover,
.ycmc-palmares-card__btn:focus {
    transform: translateX(-50%) scale(1.2);
    opacity: 0.75;
    outline: 0;
}

.ycmc-palmares-card__content[hidden] {
    display: none !important;
}

/* Couleurs par décennie (bordure + bouton + titre + icône héritent de color) */
.ycmc-palmares-grid[data-cat="palmares-annees-90"]  .ycmc-palmares-card { color: #e7471e; }
.ycmc-palmares-grid[data-cat="palmares-2000-2009"]  .ycmc-palmares-card { color: #f8aa00; }
.ycmc-palmares-grid[data-cat="palmares-2010-2019"]  .ycmc-palmares-card { color: #9dd2c8; }
.ycmc-palmares-grid[data-cat="palmares-2020-2029"]  .ycmc-palmares-card { color: #778db0; }

/* Popup */
body.ycmc-palmares-locked { overflow: hidden; }

.ycmc-palmares-popup {
    position: fixed;
    inset: 0;
    z-index: 10001;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.ycmc-palmares-popup.is-open {
    display: flex;
    animation: ycmcPalmaresFadeIn 0.2s ease;
}

@keyframes ycmcPalmaresFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.ycmc-palmares-popup__overlay {
    position: absolute;
    inset: 0;
    background: rgba(30, 76, 138, 0.7);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
}

.ycmc-palmares-popup__inner {
    position: relative;
    background: #fff;
    width: min(820px, 100%);
    max-height: 85vh;
    overflow-y: auto;
    padding: 45px 40px 35px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3);
}

.ycmc-palmares-popup__close {
    position: absolute;
    top: 8px;
    right: 14px;
    background: transparent;
    border: 0;
    font-size: 2.2rem;
    color: #1e4c8a;
    cursor: pointer;
    line-height: 1;
    padding: 4px 10px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
}

.ycmc-palmares-popup__close:hover {
    color: #e7471e;
}

.ycmc-palmares-popup__title {
    color: #1e4c8a;
    font-size: 1.6rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin: 0 0 20px;
    padding: 0 30px 15px 0;
    border-bottom: 1px solid #eee;
}

.ycmc-palmares-popup__content {
    color: #333;
    line-height: 1.6;
    font-size: 1rem;
}

.ycmc-palmares-popup__content p { margin: 0 0 1em; }
.ycmc-palmares-popup__content img { max-width: 100%; height: auto; }

/* Responsive */
@media screen and (max-width: 1200px) {
    .ycmc-palmares-grid { grid-template-columns: repeat(4, 1fr); }
}

@media screen and (max-width: 1024px) {
    .ycmc-palmares-grid { grid-template-columns: repeat(3, 1fr); gap: 10px; }
    .ycmc-palmares-card { padding: 16px 10px 50px; }
    .ycmc-palmares-card__icon { width: 60px; height: 50px; }
    .ycmc-palmares-card__title { font-size: 0.9rem; }
}

@media screen and (max-width: 767px) {
    .ycmc-palmares-grid { grid-template-columns: repeat(2, 1fr); }
    .ycmc-palmares-popup__inner { padding: 40px 22px 25px; }
    .ycmc-palmares-popup__title { font-size: 1.2rem; }
}

@media screen and (max-width: 420px) {
    .ycmc-palmares-grid { grid-template-columns: 1fr; }
}
