/* ═══════════════════════════════════════════════════════════════════
   Vorg Content — Feature PDF Viewer ([vorg_pdf_viewer])
   Affiche un PDF embarque depuis une URL. Iframe natif desktop,
   bouton "ouvrir" sur mobile (les navigateurs mobiles affichent mal
   les PDF en iframe).
   ═══════════════════════════════════════════════════════════════════ */

.vpdf {
    font-family: 'Ubuntu', sans-serif;
    margin: 1.5em 0;
}

/* ── Header : titre + boutons ─────────────────────────────────────── */
.vpdf__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}
/* Si le titre est masqué (show_title="no"), on aligne les boutons à droite
   plutôt que de les laisser à gauche par défaut. */
.vpdf--no-title .vpdf__header {
    justify-content: flex-end;
}
.vpdf__title {
    color: #2C7873;
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    flex: 1 1 auto;
}
.vpdf__actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* ── Boutons ──────────────────────────────────────────────────────── */
.vpdf__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none !important;
    transition: background-color .15s ease, color .15s ease, transform .1s ease;
    cursor: pointer;
    border: 1.5px solid transparent;
    white-space: nowrap;
}
.vpdf__btn:hover {
    transform: translateY(-1px);
}
.vpdf__btn:active {
    transform: translateY(0);
}
.vpdf__btn--download {
    background: #2C7873;
    color: #FFFFFF !important;
    border-color: #2C7873;
}
.vpdf__btn--download:hover {
    background: #1F2D30;
    border-color: #1F2D30;
    color: #FFFFFF !important;
}
.vpdf__btn--fullscreen {
    background: #FFFFFF;
    color: #2C7873 !important;
    border-color: #2C7873;
}
.vpdf__btn--fullscreen:hover {
    background: #F9F4EF;
    color: #1F2D30 !important;
    border-color: #1F2D30;
}

/* Petite icone via pseudo-element pour eviter de charger un SVG */
.vpdf__btn--download::before {
    content: "↓";
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
}
.vpdf__btn--fullscreen::before {
    content: "↗";
    font-weight: 700;
    font-size: 16px;
    line-height: 1;
}

/* ── Viewer (iframe) ──────────────────────────────────────────────── */
.vpdf__viewer {
    border: 1px solid #E5E5E5;
    border-radius: 8px;
    overflow: hidden;
    background: #F9F4EF;
    /* hauteur definie inline via style="height:Xpx" depuis le shortcode */
}
.vpdf__iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

/* ── Zone mobile (masquee desktop) ────────────────────────────────── */
.vpdf__mobile {
    display: none;
}
.vpdf__mobile-notice {
    margin: 0 0 16px;
    padding: 16px;
    background: #F9F4EF;
    border-radius: 4px;
    color: #3D4F52;
    font-size: 14px;
    line-height: 1.5;
}
.vpdf__mobile-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.vpdf__mobile-actions .vpdf__btn {
    justify-content: center;
    padding: 14px 20px;
    font-size: 15px;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .vpdf__header {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    .vpdf__title {
        font-size: 20px;
    }
    .vpdf__actions {
        width: 100%;
    }
    .vpdf__actions .vpdf__btn {
        flex: 1 1 auto;
        justify-content: center;
    }
}

@media (max-width: 600px) {
    /* Sur mobile, on cache l'iframe (rendu PDF inconsistent dans les browsers
       mobiles : Android Chrome downloads souvent, iOS Safari affiche mais
       sans toolbar fonctionnelle). On affiche a la place un message + boutons. */
    .vpdf__viewer {
        display: none;
    }
    .vpdf__mobile {
        display: block;
    }
    /* Sur mobile on cache aussi les boutons du header (doublon avec mobile-actions) */
    .vpdf__header .vpdf__actions {
        display: none;
    }
}
