/* ── ADEL Prix & Mémoires – memoires.css ────────────────────────────────── */

/* ── Reset boîte ─────────────────────────────────────────────────────────── */
.adel-survey-wrap, .adel-memoires-list {
    font-family: inherit;
    max-width: 960px;
    margin: 0 auto 2.5em;
    box-sizing: border-box;
}
.adel-survey-wrap *, .adel-memoires-list *,
.adel-survey-wrap *::before, .adel-memoires-list *::before,
.adel-survey-wrap *::after,  .adel-memoires-list *::after {
    box-sizing: inherit;
}

/* ── En-tête liseuse individuelle ────────────────────────────────────────── */
.adel-survey-head {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5em .75em;
    margin-bottom: .75em;
}
.adel-survey-badge {
    background: #1a3a5c;
    color: #fff;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    padding: .28em .65em;
    border-radius: 3px;
    white-space: nowrap;
}
.adel-survey-title {
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    color: #1a3a5c !important;
    margin: 0 !important;
    line-height: 1.25 !important;
}
.adel-mem-meta {
    color: #555;
    font-size: .95rem;
    margin: 0 0 .9em;
}

/* ── Badges de prix ──────────────────────────────────────────────────────── */
.adel-prize-badge {
    display: inline-block;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .05em;
    text-transform: uppercase;
    padding: .28em .75em;
    border-radius: 3px;
    white-space: nowrap;
    color: #fff;
}
.adel-prize-1er-prix         { background: #b8860b; }
.adel-prize-2e-prix          { background: #757575; }
.adel-prize-3e-prix          { background: #7b4010; }
.adel-prize-mention-speciale { background: #1a3a5c; }
.adel-prize-finaliste        { background: #546e7a; }

/* ── Description ─────────────────────────────────────────────────────────── */
.adel-survey-desc {
    font-size: .93rem;
    line-height: 1.7;
    color: #3d4d5c;
    background: #f2f5f9;
    border-left: 4px solid #1a3a5c;
    padding: .85em 1.15em;
    border-radius: 0 4px 4px 0;
    margin-bottom: 1.2em;
}
.adel-survey-desc p:last-child { margin-bottom: 0; }

/* ── Cadre PDF ───────────────────────────────────────────────────────────── */
.adel-pdf-frame {
    border: 1px solid #d4dae4;
    border-radius: 6px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,.07);
}

/* ── Toolbar PDF ─────────────────────────────────────────────────────────── */
.adel-pdf-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .35em .6em;
    padding: .5em .75em;
    background: #1a3a5c;
    border-bottom: 2px solid #122840;
    user-select: none;
}
.apv-nav, .apv-zoom { display: flex; align-items: center; gap: .25em; }

.apv-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.22);
    color: #fff !important;
    border-radius: 4px;
    padding: .28em .6em;
    font-size: .82rem;
    line-height: 1;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none !important;
    white-space: nowrap;
}
.apv-btn:hover, .apv-btn:focus {
    background: rgba(255,255,255,.28);
    outline: none;
    color: #fff !important;
}
.apv-btn:disabled { opacity: .35; cursor: default; }

.apv-page-wrap {
    display: flex;
    align-items: center;
    gap: .1em;
    color: rgba(255,255,255,.9);
    font-size: .82rem;
    cursor: default;
}
.apv-page-num {
    width: 3em;
    text-align: center;
    background: rgba(255,255,255,.15);
    border: 1px solid rgba(255,255,255,.3);
    color: #fff;
    border-radius: 3px;
    padding: .2em .25em;
    font-size: inherit;
    -moz-appearance: textfield;
}
.apv-page-num:focus { outline: none; background: rgba(255,255,255,.22); }
.apv-page-num::-webkit-inner-spin-button,
.apv-page-num::-webkit-outer-spin-button { opacity: .6; }
.apv-sep   { color: rgba(255,255,255,.5); }
.apv-total { color: rgba(255,255,255,.75); min-width: 1.5em; }
.apv-scale { color: rgba(255,255,255,.85); font-size: .82rem; min-width: 3.6em; text-align: center; }
.apv-dl {
    margin-left: auto;
    background: #b5281e !important;
    border-color: #951e16 !important;
    font-weight: 600;
}
.apv-dl:hover { background: #d4302a !important; }

/* ── Zone rendu PDF ──────────────────────────────────────────────────────── */
.adel-pdf-stage {
    min-height: 400px;
    background: #dde3ec;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 1.4em 1em 1.8em;
    overflow: auto;
}
.apv-canvas {
    max-width: 100%;
    height: auto !important;
    box-shadow: 0 3px 20px rgba(0,0,0,.22);
    border-radius: 2px;
    background: #fff;
}
.apv-iframe { width: 100%; min-height: 680px; border: none; background: #fff; }
.apv-loading { display:flex; flex-direction:column; align-items:center; gap:.65em; color:#5a6a7a; font-size:.88rem; padding:2.5em; }
.apv-loading p { margin:0; }
.apv-spinner {
    width:34px; height:34px;
    border: 3px solid rgba(26,58,92,.15);
    border-top-color: #1a3a5c;
    border-radius: 50%;
    animation: apv-spin .75s linear infinite;
}
@keyframes apv-spin { to { transform: rotate(360deg); } }

/* ══════════════════════════════════════════════════════════════════════════
   LISTE / GRILLE
══════════════════════════════════════════════════════════════════════════ */

.adel-year-heading {
    font-size: 1.15rem !important;
    font-weight: 700 !important;
    color: #1a3a5c !important;
    border-bottom: 2px solid #1a3a5c;
    padding-bottom: .35em;
    margin: 1.8em 0 1em !important;
}

/* Grille de cartes */
.adel-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1.1em;
}

/* Carte */
.adel-card {
    border: 1px solid #d4dae4;
    border-radius: 7px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,.06);
    transition: box-shadow .2s;
    /* span sur toute la largeur quand la liseuse est ouverte */
}
.adel-card:has(.adel-card-viewer:not([style*="display:none"])) {
    grid-column: 1 / -1;
}
.adel-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.adel-card.has-prize { border-top: 3px solid #b8860b; }
.adel-card.has-prize .adel-prize-1er-prix ~ * { border-top-color: #b8860b; }

.adel-card-inner {
    padding: 1em 1.1em;
}
.adel-card-title {
    font-size: 1rem !important;
    font-weight: 700 !important;
    color: #1a3a5c !important;
    margin: .5em 0 .4em !important;
    line-height: 1.3 !important;
}
.adel-card-author {
    font-weight: 600;
    font-size: .88rem;
    color: #2c3e50;
    margin: 0 0 .2em;
}
.adel-card-master {
    font-size: .82rem;
    color: #7f8c8d;
    margin: 0 0 .5em;
    font-style: italic;
}
.adel-card-desc {
    font-size: .84rem;
    color: #555;
    line-height: 1.55;
    margin: 0 0 .8em;
}
.adel-no-pdf { font-size: .82rem; color: #aaa; margin: .5em 0 0; }

/* Bouton carte */
.adel-card-btn {
    display: inline-block;
    background: #1a3a5c;
    color: #fff !important;
    border: none;
    border-radius: 4px;
    padding: .4em .9em;
    font-size: .82rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
    text-decoration: none !important;
    margin-top: .25em;
}
.adel-card-btn:hover { background: #254d7a; color: #fff !important; }
.adel-close-viewer   { background: #546e7a; margin: .6em .9em .9em; display: block; width: max-content; }
.adel-close-viewer:hover { background: #37474f; }

/* Zone viewer dans la carte */
.adel-card-viewer { border-top: 1px solid #e0e6ee; }
.adel-card-viewer .adel-pdf-frame { border-radius: 0; border: none; box-shadow: none; }

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .adel-cards-grid { grid-template-columns: 1fr; }
    .adel-pdf-toolbar { padding: .4em .5em; }
    .apv-scale { display: none; }
}
