/* ===============================
   MÉDIAS UNIFIÉS (images, vidéos, PDFs, gifs dynamiques)
   =============================== */
/* ===============================
   MÉDIAS UNIFIÉS (séparation figure / img / embed)
   =============================== */

/* --- Figure générique (bloc multimédia avec cadre) --- */
figure,
.embed-figure,
.gif-wrapper + .embed-figure,
.embed-container {
    display: block;
    margin: 1.5em 0;
    padding: 0.5em;
    border: 2px solid var(--header-background-color);
    border-radius: 10px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    background-color: var(--content-background-color, transparent);
    width: 100%;
}

/* --- Images SEULES (hors figure) → cadre --- */
img:not(figure img) {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 7px;
    border: 2px solid var(--header-background-color);
    box-shadow: 0 4px 8px rgba(0,0,0,0.08);
    background-color: var(--content-background-color, transparent);
}

/* --- Images DANS une figure → pas de double bordure --- */
figure img,
.embed-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 7px;
    border: none;             /* pas de cadre, le figure s'en charge */
    box-shadow: none;         /* pas d’ombre, héritée du figure */
    background: transparent;
}

/* --- Vidéos animées dans figure --- */
.embed-figure video.video-anim {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 7px;
    border: none;
    box-shadow: none;
    background: transparent;
}

/* --- Iframes dans container --- */
.embed-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%;
    height: 100%;
    border: none;             /* pas de bordure interne */
    border-radius: 7px;
    background: transparent;
}

/* --- Figcaption (pour tous les médias) --- */
figure figcaption,
.embed-figure figcaption,
.gif-wrapper + .embed-figure figcaption,
.embed-container figcaption {
    font-size: 0.85em;
    margin-top: 0.3em;
    padding: 0.3em 0.5em;
    background-color: var(--header-background-color) !important;
    color: var(--content-background-color) !important;
    border-radius: 7px;
    text-align: left;
    font-weight: 400;
    line-height: 1.3;
    font-style: italic;
}

/* --- Container responsive pour iframe/tableaux/PDF --- */
.embed-container {
    position: relative;
    padding-bottom: 65%;
    height: 0;
    overflow: hidden;
}

/* ===============================
   ANKI
   =============================== */
.cartes-anki-button {
    background-color: #93C5FD;
    color: #2C2C2C;
    border: none;
    padding: 2px 4px;
    border-radius: 10px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    display: inline-block;
    margin: 2px;
    line-height: 1.2;
}

.notes-anki-button {
    background-color: #4ADE80;
    color: #2C2C2C;
    border: none;
    padding: 2px 4px;
    border-radius: 10px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    display: inline-block;
    margin: 2px;
    line-height: 1.2;
}

.flag-anki-button {
    background-color: #2C2C2C;
    border-radius: 3px;
    padding: 3px;
    margin: 2px;
    line-height: 1.7;
}

.sauvegarde-anki-button {
    background-color: #2e64df;
    color: #ffffff;
    border: none;
    padding: 2px 4px;
    border-radius: 4px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.2);
    display: inline-block;
    margin: 2px;
    line-height: 1.2;
}

/* ===============================
   TAB BAR
   =============================== */
.tab-bar {
    display: flex;
    border-bottom: 1px solid #555;
    background: #353535; 
    border-radius: 8px 8px 0 0;
    overflow: hidden;
}

.tab-button {
    display: inline-block;
    padding: 6px 14px;
    margin: 0;
    font-family: sans-serif;
    font-size: 14px;
    font-weight: 600;
    color: #eee;
    background: #353535;
    border: 1px solid #343232;
    border-bottom: none;
    border-radius: 0 0 6px 6px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.tab-button:hover {
    background: #454545;
}

.tab-button.active {
    background: #555;
    color: #ffffff;
}

/* ===============================
   COPY BLOCK
   =============================== */
.copy-block {
    display: inline-block;
    cursor: pointer;
    background-color: #f1f5f9;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 0.2em 0.4em;
    font-family: monospace;
    position: relative;
    margin: 0;
    transition: background-color 0.2s;
}

.copy-block:hover {
    background-color: #e2e8f0;
}

.copy-block code {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font-size: 0.95em;
}

.copy-feedback {
    opacity: 0;
    transform: translateY(5px);
    pointer-events: none;
    font-size: 0.85em;
    color: #22c55e;
    background-color: #f9fafb;
    border: 1px solid #cbd5e1;
    border-radius: 4px;
    padding: 2px 6px;
    position: absolute;
    left: 0;
    top: calc(100% + 0.4em);
    white-space: nowrap;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    z-index: 5;
    box-shadow: 0px 2px 6px rgba(0,0,0,0.15);
}

.copy-feedback.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ===============================
   FOOTER ET LOGOS
   =============================== */
footer {
    margin-top: 2em;
    padding: 1em;
    text-align: center;
    font-size: 0.9em;
    color: #666;
    border-top: 1px solid #ddd;
}

.social-icons a {
    display: inline-block;
    margin: 0 8px;
    vertical-align: middle;
    transition: color 0.2s;
}

.social-logo {
    height: 28px;
    vertical-align: middle;
}

/* ===============================
   ICONES / BOUTONS GÉNÉRIQUES
   =============================== */
.icon-btn {
    --_size: 32px;
    inline-size: var(--_size);
    block-size: var(--_size);
    display: inline-grid;
    place-items: center;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
    border-radius: 999px;
    outline-offset: 3px;
    transition: transform .12s ease, color .12s ease;
    color: var(--header-background-color);
}

.icon-btn:hover {
    transform: translateY(-1px);
    color: var(--header-accent-color);
}

.icon {
    inline-size: 70%;
    block-size: 70%;
    color: inherit;
}

/* ===============================
   BOUTON GIF (vidéo animée)
   =============================== */
.gif-wrapper {
    display: inline-flex;
    align-items: center;
    margin-left: 0.1em;
}

.gif-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35em;
    background: transparent;
    color: #2563eb;
    font-weight: 500;
    border: 1px solid #2563eb;
    border-radius: 6px;
    padding: 0.15em 0.5em;
    cursor: pointer;
    font-size: 0.8em;
    line-height: 1.2;
    vertical-align: text-bottom;
    transition: all 0.2s ease;
}

.gif-btn:hover {
    background: #2563eb;
    color: white;
}

.gif-btn .icon {
    width: 0.8em;
    height: 0.8em;
    display: inline-block;
}
/* ===============================
   FALLBACK MÉDIAS
   =============================== */
.media-fallback {
    display: block;
    padding: 1em;
    margin: 0.5em 0;
    font-style: italic;
    font-size: 0.95em;
    color: #555;
    background-color: #fafafa;
    border: 2px dashed var(--header-background-color, #bbb);
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(0,0,0,0.05);
}
