/* =====================================================
   JOBSTATION — FIX GLOBAL
   VERSION STABLE
===================================================== */


/* =====================================================
   1. BASE DES CARTES
===================================================== */

.opportunity-card {

    display: flex;
    flex-direction: column;

    width: 100%;
    min-width: 0;
    min-height: 270px;

    box-sizing: border-box;

    padding: 24px;

    background: #FFFFFF;

    border: 1px solid #E5E7EB;

    border-radius: 20px;

    box-shadow:
        0 8px 24px rgba(15, 23, 42, .06);

    overflow: hidden;

    transition:
        transform .25s ease,
        box-shadow .25s ease;

}


/* =====================================================
   2. HOVER
===================================================== */

.opportunity-card:hover {

    transform: translateY(-5px);

    box-shadow:
        0 18px 40px rgba(15, 23, 42, .10);

}


/* =====================================================
   3. HEADER
===================================================== */

.opportunity-card .card-header {

    display: flex;

    justify-content: space-between;

    align-items: flex-start;

    gap: 15px;

    width: 100%;

    min-width: 0;

    position: relative;

}


/* =====================================================
   4. LOGOS — VERROUILLAGE
===================================================== */

.opportunity-card .card-header img {

    display: block !important;

    width: 60px !important;

    height: 60px !important;

    min-width: 60px !important;

    min-height: 60px !important;

    max-width: 60px !important;

    max-height: 60px !important;

    flex: 0 0 60px !important;

    object-fit: contain !important;

    object-position: center !important;

    box-sizing: border-box;

    transition: transform .25s ease;

}


.opportunity-card:hover .card-header img {

    transform: scale(1.05);

}


/* =====================================================
   5. BADGE
===================================================== */

.opportunity-card .card-badge {

    display: inline-flex;

    align-items: center;

    justify-content: center;

    padding: 7px 12px;

    background: #FFF3E8;

    color: #FF7A00;

    border-radius: 20px;

    font-size: 12px;

    font-weight: 700;

    line-height: 1;

    white-space: nowrap;

}


/* =====================================================
   6. TITRE
===================================================== */

.opportunity-card h3 {

    margin: 20px 0 8px;

    color: #13233D;

    font-size: 21px;

    line-height: 1.3;

    font-weight: 700;

}


/* =====================================================
   7. ENTREPRISE
===================================================== */

.opportunity-card .company {

    margin: 0 0 18px;

    color: #667085;

    font-size: 15px;

    line-height: 1.4;

}


/* =====================================================
   8. META
===================================================== */

.opportunity-card .card-meta {

    display: flex;

    flex-wrap: wrap;

    align-items: center;

    gap: 10px 18px;

    margin: 0 0 22px;

    color: #667085;

    font-size: 14px;

}


.opportunity-card .card-meta span {

    display: inline-flex;

    align-items: center;

    gap: 5px;

    white-space: nowrap;

}


/* =====================================================
   9. FOOTER
===================================================== */

.opportunity-card .card-footer {

    display: flex;

    justify-content: space-between;

    align-items: center;

    gap: 15px;

    width: 100%;

    margin-top: auto;

    padding-top: 18px;

    border-top: 1px solid #EEF2F7;

    font-size: 13px;

}


/* =====================================================
   10. LIEN VOIR
===================================================== */

.opportunity-card .card-footer a {

    color: #FF7A00;

    font-weight: 700;

    text-decoration: none;

    white-space: nowrap;

    transition: transform .25s ease;

}


.opportunity-card .card-footer a:hover {

    text-decoration: underline;

    transform: translateX(4px);

}


/* =====================================================
   11. GRILLE DERNIÈRES OPPORTUNITÉS
===================================================== */

#latestGrid {

    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    gap: 30px !important;

    width: 100%;

    box-sizing: border-box;

}


/* =====================================================
   12. GRILLE PLUS CONSULTÉES
===================================================== */

#mostViewedGrid {

    display: grid !important;

    grid-template-columns:
        repeat(2, minmax(0, 1fr)) !important;

    gap: 30px !important;

    width: 100%;

    box-sizing: border-box;

}


/* =====================================================
   13. CARTES DES PLUS CONSULTÉES
===================================================== */

#mostViewedGrid .opportunity-card {

    width: 100%;

    min-height: 270px;

    box-sizing: border-box;

}


/* =====================================================
   14. SECTION PLUS CONSULTÉES
===================================================== */

.most-viewed {

    padding-top: 70px;

    padding-bottom: 70px;

}


.most-viewed .section-header {

    margin-bottom: 30px;

}


/* =====================================================
   15. STABILITÉ DES CARTES EN PAGINATION
===================================================== */

.opportunity-card {

    break-inside: avoid;

    @media print {
  .opportunity-card {
    break-inside: avoid;
  }
}

}


/* =====================================================
   16. SECTION PLUS CONSULTÉES EN PDF
===================================================== */

/* =====================================================
   17. FALLBACK VISUEL — LOGO MINISTÈRE
===================================================== */

/*
   Le fichier gouv.png n'est actuellement pas chargé.
   On conserve l'espace du logo mais on affiche "MD"
   à sa place.
*/

.opportunity-card
.card-header
img[src$="gouv.png"] {

    visibility: hidden !important;

}


.opportunity-card
.card-header:has(img[src$="gouv.png"])::before {

    content: "MD";

    position: absolute;

    top: 0;
    left: 0;

    display: flex;

    align-items: center;
    justify-content: center;

    width: 60px;
    height: 60px;

    box-sizing: border-box;

    border-radius: 14px;

    background: #F3F4F6;

    color: #13233D;

    font-size: 15px;

    font-weight: 800;

    line-height: 1;

}


/* =====================================================
   18. TABLETTE
===================================================== */

@media (max-width: 1200px) {

    #latestGrid,
    #mostViewedGrid {

        grid-template-columns:
            repeat(2, minmax(0, 1fr)) !important;

    }

}


/* =====================================================
   19. MOBILE
===================================================== */

@media (max-width: 768px) {

    .opportunity-card {

        min-height: 0;

        padding: 20px;

    }


    .opportunity-card h3 {

        font-size: 19px;

    }


    .opportunity-card .card-header img {

        width: 52px !important;

        height: 52px !important;

        min-width: 52px !important;

        min-height: 52px !important;

        max-width: 52px !important;

        max-height: 52px !important;

        flex-basis: 52px !important;

    }


    .opportunity-card
    .card-header:has(img[src$="gouv.png"])::before {

        width: 52px;

        height: 52px;

        border-radius: 12px;

        font-size: 14px;

    }


    #latestGrid,
    #mostViewedGrid {

        grid-template-columns: 1fr !important;

        gap: 20px !important;

    }


    .most-viewed {

        padding-top: 50px;

        padding-bottom: 50px;

    }

}
/* =====================================================
   JOBSTATION — MOST VIEWED PAGINATION FIX
===================================================== */

@media print {

    .most-viewed .section-header {
        break-after: avoid !important;
        page-break-after: avoid !important;
    }

    .most-viewed-grid {
        break-before: avoid !important;
        page-break-before: avoid !important;
    }

    .most-viewed {
        break-inside: avoid !important;
        page-break-inside: avoid !important;
    }

}
/* =====================================================
   JOBSTATION — PRINT / MOST VIEWED FINAL FIX
===================================================== */

@media print {

    /* La section doit pouvoir tenir sur une seule page */
    .most-viewed {

        padding-top: 20px !important;
        padding-bottom: 20px !important;

        margin: 0 !important;

        break-inside: avoid !important;
        page-break-inside: avoid !important;

    }


    /* Header compact */
    .most-viewed .section-header {

        margin-bottom: 16px !important;

        break-after: avoid !important;
        page-break-after: avoid !important;

    }


    /* Grille compacte */
    .most-viewed-grid,
    #mostViewedGrid {

        gap: 16px !important;

        break-before: avoid !important;
        page-break-before: avoid !important;

        break-inside: avoid !important;
        page-break-inside: avoid !important;

    }


    /* Cartes compactes uniquement pour l'impression */
    #mostViewedGrid .opportunity-card {

        min-height: 0 !important;

        height: auto !important;

        padding: 18px !important;

        break-inside: avoid !important;
        page-break-inside: avoid !important;

    }


    /* Logo légèrement réduit à l'impression */
    #mostViewedGrid .opportunity-card .card-header img {

        width: 52px !important;
        height: 52px !important;

        min-width: 52px !important;
        min-height: 52px !important;

        max-width: 52px !important;
        max-height: 52px !important;

    }


    /* Titre */
    #mostViewedGrid .opportunity-card h3 {

        margin: 14px 0 6px !important;

        font-size: 19px !important;

    }


    /* Entreprise */
    #mostViewedGrid .opportunity-card .company {

        margin-bottom: 12px !important;

        font-size: 14px !important;

    }


    /* Métadonnées */
    #mostViewedGrid .opportunity-card .card-meta {

        margin-bottom: 14px !important;

        gap: 8px 14px !important;

        font-size: 13px !important;

    }


    /* Footer */
    #mostViewedGrid .opportunity-card .card-footer {

        padding-top: 12px !important;

    }

}
/* =====================================================
   JOBSTATION — CORRECTIF RESPONSIVE IPHONE
===================================================== */

@media screen and (max-width: 600px) {

    html,
    body {
        max-width: 100%;
        overflow-x: clip;
    }

    /* BANNIÈRE PUBLICITAIRE */

    .leaderboard {
        width: 100%;
        overflow: hidden;
    }

    .leaderboard .container {
        width: calc(100% - 24px) !important;
        max-width: 100%;
    }

    .leaderboard-banner {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 18px !important;
        padding: 22px !important;
        width: 100%;
    }

    .leaderboard-text {
        width: 100%;
        max-width: 100%;
    }

    .leaderboard h2 {
        font-size: 30px !important;
        line-height: 1.15 !important;
        overflow-wrap: anywhere;
    }

    .leaderboard p {
        font-size: 15px !important;
        line-height: 1.55;
    }

    .leaderboard-brand {
        width: 100% !important;
        max-width: 100%;
    }

    .leaderboard-brand img {
        max-width: 100%;
        height: auto;
    }

    /* HERO */

    .hero {
        width: 100%;
        overflow: hidden;
    }

    .hero-grid {
        grid-template-columns: minmax(0, 1fr) !important;
        gap: 28px !important;
        width: 100%;
    }

    .hero-content {
        width: 100%;
        min-width: 0;
    }

    .hero h1 {
        font-size: 36px !important;
        line-height: 1.12 !important;
        overflow-wrap: break-word;
    }

    .hero p {
        font-size: 17px !important;
        line-height: 1.55;
    }

    .hero-search {
        width: 100%;
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .hero-image {
        width: 100%;
        min-width: 0;
    }

    .hero-image img {
        max-width: 100%;
        height: auto;
    }

    .hero-card {
        max-width: 120px;
    }
}
/* =====================================================
   JOBSTATION — HERO MOBILE : STATISTIQUES EN GRILLE
===================================================== */

@media screen and (max-width: 600px) {

    .hero-image {
        display: grid !important;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
        gap: 12px;
        width: 100%;
        min-width: 0;
        min-height: auto !important;
        padding: 0 4px 12px;
        overflow: visible;
    }

    .hero-image .hero-bg {
        top: 15px;
        right: 5%;
        width: 90%;
        height: 280px;
        transform: none;
    }

    .hero-image > img {
        grid-column: 1 / -1;
        grid-row: 1;
        width: min(300px, 100%);
        max-height: 340px;
        object-fit: contain;
        justify-self: center;
        transform: none !important;
        margin-bottom: 8px;
    }

    .hero-image .hero-card {
        position: relative !important;
        inset: auto !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0;
        padding: 14px !important;
        border-radius: 14px;
        box-shadow: 0 8px 20px rgba(0, 0, 0, .08);
    }

    .hero-image .hero-card h3 {
        font-size: 23px !important;
    }

    .hero-image .hero-card span {
        font-size: 12px !important;
    }
}
@media print {
  .most-viewed {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .section-header {
    break-after: avoid;
    page-break-after: avoid;
  }

  .featured-card,
  .opportunity-card {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}
@media print {
  #mostViewedGrid {
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .most-viewed .section-header {
    break-after: avoid;
    page-break-after: avoid;
  }
}
@media print {
  .featured .section-header,
  .featured-filters {
    break-after: avoid;
    page-break-after: avoid;
  }
}
@media print {
  .featured {
    break-before: page;
    page-break-before: always;
  }
}