/* Offres de conversion du pôle Médecine et du blog (medecine/offers.py).

   DA « carnet d'orientation » (DA_HODEA.md), mêmes recettes que la landing webinaire
   (static/css/event_lp.css) : billet perforé pour un webinaire, fiche blanche au coup de feutre
   pour un guide / une alerte / un étudiant, coches manuscrites, CTA ambre unique, barre
   collante mobile en « talon de billet ». Polices auto-hébergées : live/fonts/fonts.css.
   Tout est préfixé .med- : ces blocs s'insèrent dans des pages existantes (articles, fiches écoles). */

:root {
    --med-navy: #1a3a5f;
    --med-navy-deep: #102a47;
    --med-sky: #5bb8f0;
    --med-sky-soft: #e8f4fd;
    --med-sky-marker: rgba(135, 206, 250, .72);
    --med-amber: #f7a823;
    --med-amber-deep: #e08e0b;
    --med-paper: #fffdf8;
    --med-text: #0f2238;
    --med-text-2: #46566d;
    --med-muted: #64748b;
    --med-border: #e1e8f0;
    --med-rule: rgba(26, 58, 95, .14);
    --med-bad: #c2362f;
    --med-link: #2565a8;
    --med-font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
    --med-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;
    --med-ease: cubic-bezier(.2, .8, .2, 1);
    /* Couleur des encoches du billet = fond sur lequel il est posé. */
    --med-cut: #ffffff;
}

/* ============ Socle commun ============ */
.med-offer {
    position: relative; margin: 40px 0; font-family: var(--med-font); color: var(--med-text);
    font-style: normal; line-height: 1.6; text-align: left;
    animation: med-in .4s var(--med-ease) both;
}
.med-offer p { margin: 0; }
.med-kicker {
    font-family: var(--med-font); font-size: 12px; font-weight: 800; letter-spacing: .13em;
    text-transform: uppercase; color: var(--med-navy);
}
.med-offer .med-offer__title {
    margin: 0 0 6px; font-family: var(--med-font); font-size: 21px; font-weight: 800; line-height: 1.3;
    letter-spacing: -.015em; color: var(--med-navy);
}
.med-offer .med-offer__text { margin: 0; font-size: 15.5px; line-height: 1.6; color: var(--med-text-2); }
.med-offer .med-note, .med-offer .med-ticket__meta { margin-bottom: 0; }

/* Coup de feutre bleu, un seul par bloc (le titre de l'offre). */
.med-marker {
    background-image: linear-gradient(100deg, transparent 0 1%, var(--med-sky-marker) 2% 97%, transparent 99%);
    background-size: 100% 36%; background-repeat: no-repeat; background-position: 0 88%;
    -webkit-box-decoration-break: clone; box-decoration-break: clone; padding: 0 4px;
}

/* CTA ambre : un seul visible à la fois. */
.med-offer .med-cta, .med-sticky .med-sticky__cta {
    display: inline-flex; align-items: center; justify-content: center; gap: 10px;
    font-family: var(--med-font); font-weight: 800; color: var(--med-navy-deep) !important;
    background: var(--med-amber); text-decoration: none !important; text-align: center;
    box-shadow: 0 2px 0 var(--med-amber-deep), 0 10px 20px -10px rgba(224, 142, 11, .7);
    transition: transform .15s, background .15s, box-shadow .15s;
}
.med-offer .med-cta { min-height: 54px; padding: 0 26px; border-radius: 12px; font-size: 17px; }
.med-offer .med-cta:hover, .med-sticky .med-sticky__cta:hover { background: #ffb73b; transform: translateY(-1px); opacity: 1; }
.med-offer .med-cta:active, .med-sticky .med-sticky__cta:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--med-amber-deep); }
.med-offer .med-cta:focus-visible, .med-offer .med-btn-secondary:focus-visible, .med-sticky a:focus-visible {
    outline: 3px solid var(--med-sky); outline-offset: 3px;
}

/* Bouton secondaire (outil) : navy. */
.med-offer .med-btn-secondary {
    display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 20px;
    border-radius: 10px; background: var(--med-navy); color: #fff !important; font-family: var(--med-font);
    font-size: 15px; font-weight: 700; text-decoration: none !important; transition: background .15s;
}
.med-offer .med-btn-secondary:hover { background: var(--med-navy-deep); opacity: 1; }

.med-note { font-size: 13.5px; font-weight: 600; color: var(--med-muted); }

/* Coches manuscrites à la place des puces. */
.med-offer .med-checks { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 6px; }
.med-offer .med-checks li {
    position: relative; margin: 0; padding-left: 28px; font-size: 15px; font-weight: 600; color: var(--med-text);
}
.med-offer .med-checks li::before {
    content: ''; position: absolute; left: 0; top: 3px; width: 18px; height: 18px;
    background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%235bb8f0' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.5 10.8c1.6 1.2 2.9 2.6 3.9 4.3 2.3-4.6 5.4-8.2 9.1-10.6'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ============ Fiche (guide, alerte, étudiant) ============ */
.med-card {
    background: #fff; border: 1px solid var(--med-border); border-radius: 12px; padding: 22px 24px 20px;
    box-shadow: 0 1px 0 rgba(16, 42, 71, .06), 0 10px 26px -12px rgba(16, 42, 71, .22);
}
.med-card__head { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.med-card__icon {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 50%; background: var(--med-sky-soft);
    color: var(--med-navy); display: inline-flex; align-items: center; justify-content: center; font-size: 15px;
}
.med-card__actions {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px;
    margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--med-rule);
}
.med-card.is-secondary { box-shadow: none; padding: 18px 20px; }
.med-card.is-secondary .med-offer__title { font-size: 18px; }

/* ============ Billet perforé (webinaire) ============ */
.med-ticket {
    /* width plutôt que max-width : fixes.css impose « * { max-width: 100% !important } ». */
    width: min(560px, 100%); margin-left: auto; margin-right: auto;
    background: var(--med-paper); border: 1px solid #efe8d6; border-radius: 16px;
    box-shadow: 0 1px 0 rgba(16, 42, 71, .06), 0 18px 40px -18px rgba(16, 42, 71, .4);
    transform: rotate(1.2deg);
}
.med-ticket__head {
    display: flex; justify-content: space-between; align-items: center; padding: 12px 22px;
    border-bottom: 1.5px dashed #d6dde6;
}
.med-ticket__icon { color: var(--med-sky); }
.med-ticket__body { padding: 18px 22px 16px; }
.med-ticket__date {
    display: flex; align-items: center; flex-wrap: wrap; gap: 6px 16px;
    font-family: var(--med-font); font-size: 25px; font-weight: 800; letter-spacing: -.02em; line-height: 1.15;
    color: var(--med-navy);
}
.med-offer .med-ticket__meta { margin: 6px 0 14px; font-size: 15px; font-weight: 700; color: var(--med-text-2); }
.med-ticket .med-offer__title { font-size: 19px; }
/* Compte à rebours entouré au stylo rouge (annotation, jamais l'info principale : la date est au-dessus). */
.med-countdown {
    position: relative; padding: 0 6px; font-family: var(--med-hand); font-size: 24px; font-weight: 700;
    line-height: 1; color: var(--med-bad); text-transform: none; letter-spacing: 0;
}
.med-countdown::after {
    content: ''; position: absolute; inset: -6px -4px -5px -6px; border: 1.8px solid currentColor;
    border-radius: 50% 46% 52% 44% / 60% 52% 48% 56%; transform: rotate(-4deg); opacity: .75;
}
/* Perforation entre le corps et le talon, avec deux encoches de la couleur du fond. */
.med-ticket__tear { position: relative; height: 0; border-top: 2px dashed #d6dde6; margin: 0 22px; }
.med-ticket__tear::before, .med-ticket__tear::after {
    content: ''; position: absolute; top: -13px; width: 24px; height: 24px; border-radius: 50%;
    background: var(--med-cut); box-shadow: inset 0 0 0 1px #efe8d6;
}
.med-ticket__tear::before { left: -35px; }
.med-ticket__tear::after { right: -35px; }
.med-ticket__actions { padding: 18px 22px 20px; display: flex; flex-direction: column; gap: 10px; text-align: center; }
.med-ticket__actions .med-cta { width: 100%; }
.med-ticket.is-secondary { transform: none; animation-name: med-in; }

/* Fonds des emplacements (pour les encoches du billet). */
.med-offer--section, .med-offer--ecole-end { --med-cut: #f8f9fa; }

/* ============ Fin d'article : « Et maintenant ? » ============ */
.med-offers-end { padding: 8px 40px 44px; font-family: var(--med-font); }
.med-offers-end__kicker { display: block; text-align: center; }
.med-offers-end .med-offers-end__title {
    margin: 6px 0 4px; text-align: center; font-family: var(--med-font); font-size: clamp(24px, 3vw, 30px);
    font-weight: 800; letter-spacing: -.025em; line-height: 1.2; color: var(--med-navy);
}
.med-offers-end .med-offer { margin: 26px auto 0; width: min(640px, 100%); }
.med-offers-end .med-ticket { width: min(560px, 100%); }

/* ============ Liens et emphase dans les articles médecine ============ */
.med-article-content a {
    color: var(--med-link) !important; font-weight: 700; text-decoration: underline;
    text-decoration-thickness: 1.5px; text-underline-offset: 3px;
}
.med-article-content strong {
    color: inherit !important;
    background-image: linear-gradient(transparent 60%, rgba(247, 168, 35, .35) 60% 92%, transparent 92%);
    -webkit-box-decoration-break: clone; box-decoration-break: clone;
}

/* ============ Barre collante mobile (talon du billet) ============ */
.med-sticky { display: none; }

@media (max-width: 960px) {
    .med-ticket { transform: none; }
}

@media (max-width: 640px) {
    .med-offer { margin: 32px 0; }
    .med-card { padding: 20px 18px 18px; }
    .med-offer .med-cta { width: 100%; padding: 0 18px; }
    .med-card__actions { flex-direction: column; align-items: stretch; text-align: center; }
    .med-ticket__date { font-size: 23px; }
    .med-offers-end { padding: 4px 20px 36px; }

    .med-sticky {
        position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 1040;
        display: flex; align-items: center; gap: 4px; padding: 8px 6px 8px 14px;
        border-radius: 14px; background: var(--med-paper); border: 1px solid var(--med-border);
        box-shadow: 0 16px 32px -8px rgba(15, 34, 56, .45); font-family: var(--med-font);
        transform: translateY(160%); transition: transform .3s var(--med-ease);
    }
    .med-sticky.is-visible { transform: none; }
    /* Un seul bouton flottant à la fois : le « Rejoindre HODEA » du site s'efface tant que la barre est là. */
    body:has(.med-sticky.is-visible) #seo-dynamic-fab { opacity: 0; pointer-events: none; }
    .med-sticky__link {
        flex: 1; min-width: 0; display: flex; align-items: center; justify-content: space-between; gap: 10px;
        text-decoration: none !important; color: var(--med-navy) !important;
    }
    .med-sticky__hand { font-family: var(--med-hand); font-size: 21px; font-weight: 700; line-height: 1.1; color: var(--med-navy); }
    .med-sticky__label {
        min-width: 0; font-size: 13.5px; font-weight: 700; line-height: 1.3; color: var(--med-navy);
        display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
    }
    .med-sticky .med-sticky__cta { flex-shrink: 0; height: 44px; padding: 0 14px; border-radius: 10px; font-size: 14.5px; }
    .med-sticky__close {
        flex-shrink: 0; width: 32px; height: 32px; border: 0; background: none; color: var(--med-muted);
        font-size: 15px; display: inline-flex; align-items: center; justify-content: center;
    }
}

@keyframes med-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; } }
.med-ticket { animation-name: med-in-ticket; }
@keyframes med-in-ticket { from { opacity: 0; transform: translateY(10px) rotate(1.2deg); } to { opacity: 1; transform: rotate(1.2deg); } }
@media (max-width: 960px) {
    .med-ticket { animation-name: med-in; }
}

@media (prefers-reduced-motion: reduce) {
    .med-offer, .med-ticket { animation: none; }
    .med-sticky { transition: none; }
    .med-offer .med-cta, .med-sticky .med-sticky__cta { transition: none; }
}
