* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Lucida Grande", "Lucida Sans Unicode", Verdana, sans-serif;
    background-color: #f5f5f5;
    color: #333;
    isolation: isolate;
}

/* Header avec logos */
.header-logos,
#burger,
#Menu {
    position: relative;
    z-index: 2;
}

.header-logos {
    width: 90%;
    max-width: 1200px;
    margin: 12px auto 8px;
    display: grid;
    grid-template-columns: 1fr minmax(0, 58%) 1fr;
    align-items: center;
    gap: 20px;
}

.header-logos a {
    text-align: center;
}

.header-logos img {
    max-width: 100%;
    height: auto;
}

.header-logos > .logo-side:first-of-type,
.header-logos > .logo-side:last-of-type {
    justify-self: center;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header-logos > .logo-side:first-of-type img {
    max-height: 120px;
    width: auto;
    max-width: 100%;
}

.header-logos > .logo-side:last-of-type img {
    max-height: 64px;
    width: auto;
    max-width: 100%;
}

.logo-center {
    width: 100%;
    text-align: center;
}

.logo-center a {
    display: block;
    margin: 0 auto;
}

/* Bouton burger - caché en desktop */
#burger {
    display: none;
}

/* Barre menu + recherche */
.header-nav {
    position: relative;
    z-index: 20;
    width: 90%;
    max-width: 1200px;
    margin: 0 auto 12px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.header-nav #Menu {
    flex: 1 1 auto;
    min-width: 0;
    width: auto;
    margin: 0;
}

/* Menu principal */
#Menu {
    background: #0062AE;
    border-radius: 8px;
    overflow: visible;
}

#Menu > ul {
    list-style: none;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
}

#Menu > ul > li {
    position: relative;
    flex: 1;
    min-width: 140px;
}

#Menu > ul > li > .menu-trigger {
    display: block;
    width: 100%;
    padding: 18px 10px;
    text-align: center;
    color: white;
    background: transparent;
    border: none;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    margin: 0;
    font-family: inherit;
    font-size: clamp(0.9rem, 1.5vw, 1.1rem);
    font-weight: inherit;
    line-height: 1.35;
    letter-spacing: inherit;
    text-decoration: none;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    box-sizing: border-box;
    transition: background-color 0.2s;
}

#Menu > ul > li:last-child > .menu-trigger {
    border-right: none;
}

#Menu > ul > li > .menu-trigger:hover {
    background-color: #084586;
}

#Menu > ul > li > .menu-trigger:focus {
    outline: none;
}

#Menu > ul > li > .menu-trigger:focus-visible {
    background-color: #084586;
    outline: 2px solid #fff;
    outline-offset: -2px;
}

/* Sous-menus - desktop */
#Menu > ul > li > ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    min-width: 220px;
    background: #084586;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    border-radius: 0 0 4px 4px;
    list-style: none;
}

#Menu > ul > li:hover > ul,
#Menu > ul > li:focus-within > ul,
#Menu > ul > li.open > ul {
    display: block;
}

#Menu > ul > li > ul > li {
    list-style: none;
}

#Menu > ul > li > ul > li > a {
    display: block;
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    transition: background-color 0.2s;
}

#Menu > ul > li > ul > li:last-child > a {
    border-bottom: none;
}

#Menu > ul > li > ul > li > a:hover,
#Menu > ul > li > ul > li > a:focus-visible {
    background-color: #06366a;
}

/* Desktop : survol sur toute la hauteur (ex. Infos Prescripteurs sur 2 lignes) */
@media (min-width: 1101px) {
    #Menu > ul > li {
        display: flex;
        align-items: stretch;
    }

    #Menu > ul > li > .menu-trigger {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        min-height: 100%;
    }

    #Menu > ul > li:hover > .menu-trigger,
    #Menu > ul > li > .menu-trigger:hover {
        background-color: #084586;
        color: white;
    }
}

/* Contenu principal */
.main-content {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    min-height: 600px;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1;
}

.main-content h1 {
    color: #0062AE;
    margin-bottom: 20px;
}

.main-content h2 {
    color: #0062AE;
    margin-bottom: 16px;
}

.text-center {
    text-align: center;
}

.text-intro {
    font-size: 18px;
    color: #000066;
}

/* Boutons catalogue (remplace les balises <font>) */
.btn-catalogue {
    display: inline-block;
    font-size: 18px;
    background-color: #0062AE;
    color: #FFF;
    text-decoration: none;
    padding: 4px 12px;
    font-weight: bold;
}

.btn-catalogue:hover,
.btn-catalogue:focus-visible {
    background-color: #084586;
}

/* Liens sociaux */
.social-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.social-links a {
    display: inline-flex;
}

.social-links img {
    width: 36px;
    height: 36px;
    object-fit: contain;
}

/* Tableaux de liens (sites.htm) */
.link-table {
    width: 70%;
    margin: 0 auto;
    border-collapse: collapse;
    background-color: #0062AE;
}

.link-table td {
    padding: 12px;
    text-align: center;
    border: 2px solid #084586;
}

.link-table a {
    font-family: Verdana, Geneva, sans-serif;
    font-size: 18px;
    color: #FFF;
    text-decoration: none;
}

.link-table a:hover,
.link-table a:focus-visible {
    text-decoration: underline;
}

/* Boutons sites hospitaliers */
.btn-site {
    display: inline-block;
    font-size: clamp(1rem, 2vw, 22px);
    background-color: #0062AE;
    color: #FFF;
    text-decoration: none;
    padding: 8px 16px;
    font-weight: bold;
    margin: 4px;
}

.btn-site:hover,
.btn-site:focus-visible {
    background-color: #084586;
}

.site-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.back-home {
    display: inline-block;
    text-align: center;
    text-decoration: none;
    color: #0062AE;
    margin: 24px 0;
}

.back-home img {
    width: 80px;
    max-width: 120px;
    height: auto;
    display: block;
    margin: 8px auto;
}

.page-meta {
    font-size: 14px;
    color: #0062AE;
    text-align: center;
    margin-top: 8px;
}

.page-meta-divider {
    border: none;
    border-top: 1px solid rgba(0, 98, 174, 0.35);
    max-width: 420px;
    margin: 14px auto 18px;
}

/* Grille newsletters */
.newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.newsletter-panel {
    background-color: #0062AE;
    border: 2px solid #084586;
    border-radius: 4px;
    overflow: hidden;
}

.newsletter-panel h3 {
    background-color: aliceblue;
    color: #0062AE;
    font-size: clamp(0.95rem, 1.3vw, 1.1rem);
    padding: 10px;
    text-align: center;
    margin: 0;
}

.newsletter-panel ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.newsletter-panel li {
    border-top: 1px solid #084586;
}

.newsletter-panel a {
    display: block;
    padding: 10px 12px;
    color: #FFF;
    text-decoration: none;
    font-size: clamp(0.85rem, 1.2vw, 1rem);
    text-align: center;
    line-height: 1.35;
}

.newsletter-panel a:hover,
.newsletter-panel a:focus-visible {
    background-color: #084586;
}

/* Actualités — timeline */
.news-timeline {
    list-style: none;
    margin: 28px auto 0;
    padding: 0;
    max-width: 820px;
}

.news-item {
    margin-bottom: 16px;
}

.news-card {
    border: 1px solid #084586;
    border-radius: 4px;
    padding: 16px 18px;
    background: #f8fbff;
}

.news-meta {
    margin: 0 0 8px;
    font-size: 0.9rem;
    color: #0062AE;
}

.news-meta time {
    font-weight: bold;
}

.news-category {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 8px;
    border-radius: 3px;
    background: rgba(0, 98, 174, 0.12);
    font-size: 0.85rem;
}

.news-title {
    margin: 0 0 8px;
    color: #0062AE;
    font-size: 1.15rem;
}

.news-summary {
    margin: 0 0 10px;
    line-height: 1.5;
}

.news-link a {
    color: #0062AE;
    font-weight: bold;
    text-decoration: none;
}

.news-link a:hover,
.news-link a:focus-visible {
    text-decoration: underline;
}

.news-home-list {
    list-style: none;
    margin: 0 auto 8px;
    padding: 0;
    max-width: 720px;
}

.news-home-list li {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 98, 174, 0.2);
    align-items: baseline;
}

.news-home-list li:last-child {
    border-bottom: none;
}

.news-home-list time {
    font-size: 0.9rem;
    color: #0062AE;
    font-weight: bold;
}

.news-home-list a {
    color: #333;
    font-weight: bold;
    text-decoration: none;
}

.news-home-list a:hover,
.news-home-list a:focus-visible {
    color: #0062AE;
    text-decoration: underline;
}

/* Tableaux de contenu (transmission, etc.) */
.data-table {
    width: 100%;
    max-width: 900px;
    margin: 24px auto;
    border-collapse: collapse;
}

.data-table th,
.data-table td {
    padding: 12px;
    border: 1px solid #084586;
    vertical-align: middle;
}

.data-table thead th {
    background-color: #0062AE;
    color: white;
    text-align: center;
    font-size: 16px;
}

.data-table tbody td:first-child {
    color: #0062AE;
}

.data-table tbody td:last-child {
    text-align: center;
}

.data-table a {
    color: #0062AE;
    font-weight: bold;
}

.text-body {
    font-size: 16px;
    color: #0062AE;
    line-height: 1.6;
    margin-bottom: 16px;
}

.text-body a {
    color: #0062AE;
    font-weight: bold;
}

.callout {
    font-size: 18px;
    color: #0062AE;
    text-align: center;
    line-height: 1.6;
    margin: 24px auto;
    max-width: 900px;
}

.callout strong {
    display: block;
    margin-bottom: 12px;
}

/* Grille de liens (actirech, etc.) */
.link-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    max-width: 800px;
    margin: 24px auto;
}

.link-grid a {
    display: block;
    padding: 14px 12px;
    background-color: #0062AE;
    color: #FFF;
    text-decoration: none;
    text-align: center;
    font-size: clamp(0.95rem, 1.5vw, 18px);
    border: 2px solid #084586;
    border-radius: 4px;
    line-height: 1.35;
}

.link-grid a:hover,
.link-grid a:focus-visible {
    background-color: #084586;
}

/* DMU : 3 boutons sur la 1re ligne, Activités centré en dessous */
.link-grid--dmu {
    grid-template-columns: repeat(3, 1fr);
}

.link-grid--dmu a:last-child {
    grid-column: 2;
}

/* Informations patients et contact */
.info-section {
    margin: 28px 0;
}

.info-section > h2 {
    color: #0062AE;
    font-size: 1.25rem;
    margin-bottom: 12px;
}

.faq-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.faq-list > li {
    border: 1px solid #084586;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: hidden;
}

.faq-list h3 {
    background: #0062AE;
    color: white;
    font-size: 1rem;
    padding: 12px 16px;
    margin: 0;
}

.faq-list p {
    padding: 12px 16px;
    margin: 0;
    line-height: 1.6;
    color: #333;
}

.callout .btn-catalogue {
    display: inline-block;
    margin-top: 12px;
}

.resource-grid {
    max-width: 900px;
    margin: 24px auto;
}

.resource-grid .contact-card {
    text-align: center;
}

.resource-grid--single {
    grid-template-columns: minmax(260px, 520px);
    justify-content: center;
}

.link-grid--sites {
    max-width: 640px;
    margin: 24px auto;
    grid-template-columns: 1fr;
    justify-items: stretch;
}

.sites-lbmr {
    max-width: 720px;
    margin: 32px auto 0;
}

@media (min-width: 768px) {
    .resource-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .resource-grid .contact-card {
        display: flex;
        flex-direction: column;
        height: 100%;
    }

    .resource-grid .contact-card p:last-child {
        margin-top: auto;
        padding-top: 8px;
    }
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 16px;
    margin: 24px 0;
}

.contact-grid.resource-grid {
    margin: 24px auto;
}

/* Page contact : 4 blocs — évite 3+1 désaligné sur desktop intermédiaire */
.contact-grid--quad {
    max-width: 1100px;
    margin: 24px auto;
    grid-template-columns: 1fr;
}

@media (min-width: 560px) {
    .contact-grid--quad {
        grid-template-columns: repeat(2, minmax(260px, 1fr));
    }
}

@media (min-width: 1090px) {
    .contact-grid--quad {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.contact-card {
    border: 2px solid #084586;
    border-radius: 4px;
    padding: 20px;
    background: #f8fbff;
}

.contact-card h3 {
    color: #0062AE;
    margin: 0 0 12px;
    font-size: 1.1rem;
}

.contact-card p {
    margin: 0 0 8px;
    line-height: 1.5;
}

.contact-card a {
    color: #0062AE;
    font-weight: bold;
}

.contact-card a.btn-catalogue {
    color: #FFF;
    text-decoration: none;
    word-break: break-word;
    text-align: center;
    max-width: 100%;
    box-sizing: border-box;
}

.contact-card a.btn-catalogue:hover,
.contact-card a.btn-catalogue:focus-visible {
    color: #FFF;
    background-color: #084586;
}

.contact-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    margin: 24px 0;
}

.accredit-badge {
    max-width: 120px;
    width: 100%;
    height: auto;
    display: block;
    margin: 16px auto 0;
}

/* Pied de page légal et accessibilité */
.skip-link {
    position: absolute;
    left: -9999px;
    z-index: 9999;
    padding: 12px 16px;
    background: #0062AE;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-weight: bold;
}

.skip-link:focus {
    left: 12px;
    top: 12px;
}

.site-footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px 12px;
    margin-top: 24px;
    font-size: 14px;
}

.site-footer a {
    color: #0062AE;
    text-decoration: none;
    font-weight: bold;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    text-decoration: underline;
}

.site-footer span {
    color: #666;
}

.legal-content h2 {
    color: #0062AE;
    font-size: 1.15rem;
    margin: 24px 0 12px;
}

.legal-content p,
.legal-content ul {
    margin-bottom: 12px;
    line-height: 1.6;
    color: #333;
}

.legal-content ul {
    padding-left: 1.5rem;
}

.legal-content a {
    color: #0062AE;
    font-weight: bold;
}

.legal-content code {
    font-size: 0.9em;
    background: #f0f4f8;
    padding: 2px 6px;
    border-radius: 3px;
}

/* Pages sites hospitaliers */
.site-map-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 24px;
    margin: 24px 0;
}

.site-map {
    width: min(100%, 720px);
    height: 450px;
    border: 0;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.site-plan {
    width: min(100%, 720px);
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Page SIGAPS — tableaux et graphiques */
.sigaps-section {
    max-width: 960px;
    margin: 32px auto;
}

.sigaps-section-title {
    color: #0062AE;
    font-size: 1.2rem;
    text-align: center;
    margin: 0 0 20px;
}

.sigaps-gallery {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
}

.sigaps-figure {
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.sigaps-figure img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border: 1px solid #cce0f0;
    background-color: #fff;
    object-fit: contain;
}

.sigaps-figure figcaption {
    margin-top: 10px;
    font-size: 14px;
    color: #333;
    text-align: center;
    line-height: 1.4;
}

@media (min-width: 768px) {
    .sigaps-gallery--pair {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        align-items: stretch;
    }

    .sigaps-gallery--pair .sigaps-figure {
        height: 100%;
    }

    .sigaps-gallery--pair .sigaps-figure img {
        width: 100%;
        height: 100%;
        max-height: 380px;
        object-fit: contain;
        object-position: center top;
    }
}

/* Accès réservé */
.access-gate {
    max-width: 420px;
    margin: 32px auto;
    padding: 28px 24px;
    border: 2px solid #084586;
    border-radius: 8px;
    background: #f8fbff;
    text-align: center;
}

.access-gate h2 {
    color: #0062AE;
    font-size: 1.2rem;
    margin-bottom: 12px;
}

.access-gate p {
    margin-bottom: 16px;
    line-height: 1.5;
    color: #333;
}

.access-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    align-items: stretch;
}

.access-form label {
    text-align: left;
    font-weight: bold;
    color: #0062AE;
}

.access-form input[type="password"] {
    padding: 12px;
    font-size: 1rem;
    border: 1px solid #084586;
    border-radius: 4px;
}

.access-form button {
    padding: 12px 16px;
    font-size: 1rem;
    font-weight: bold;
    border: none;
    border-radius: 4px;
    background: #0062AE;
    color: #fff;
    cursor: pointer;
}

.access-form button:hover,
.access-form button:focus-visible {
    background: #084586;
}

.access-error {
    color: #7e0202;
    font-weight: bold;
    margin: 0;
}

/* ========== MOBILE / TABLETTE ========== */
@media (max-width: 1100px) {
    .header-logos {
        display: grid;
        grid-template-columns: 1fr 1fr;
        grid-template-areas:
            "banner banner"
            "logo-left logo-right";
        width: 95%;
        gap: 12px 16px;
        align-items: center;
    }

    .logo-center {
        grid-area: banner;
        width: 100%;
    }

    .logo-center img {
        width: 100%;
        max-width: 100%;
    }

    .header-logos > .logo-side:first-of-type {
        grid-area: logo-left;
        justify-self: center;
        width: 100%;
        max-width: none;
    }

    .header-logos > .logo-side:first-of-type img {
        max-height: 110px;
    }

    .header-logos > .logo-side:last-of-type {
        grid-area: logo-right;
        justify-self: center;
        width: 100%;
        max-width: none;
    }

    .header-logos > .logo-side:last-of-type img {
        max-width: 100%;
        max-height: 64px;
        width: auto;
        object-fit: contain;
    }

    #burger {
        display: block;
        flex: 1 1 auto;
        min-width: 0;
        width: auto;
        margin: 0;
        padding: 14px;
        font-size: 1.2rem;
        border: none;
        background: #0062AE;
        color: white;
        cursor: pointer;
        border-radius: 4px;
        transition: background-color 0.3s;
    }

    #burger:hover,
    #burger:focus-visible {
        background-color: #084586;
    }

    .header-nav {
        width: 95%;
    }

    .header-nav #Menu {
        flex: 1 1 100%;
        width: 100%;
    }

    #Menu {
        display: none;
        width: 100%;
        margin: 0;
        border-radius: 4px;
        overflow: hidden;
    }

    #Menu.open {
        display: block;
    }

    #Menu > ul {
        flex-direction: column;
    }

    #Menu > ul > li {
        display: block;
        flex: none;
        width: 100%;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    #Menu > ul > li > .menu-trigger {
        display: block;
        flex: none;
        min-height: 0;
        padding: 14px;
        font-size: 1.1rem;
        border-right: none;
    }

    /* Sous-menus pilotés par .open uniquement (pas le hover desktop) */
    #Menu > ul > li:hover > ul,
    #Menu > ul > li:focus-within > ul {
        display: block;
        max-height: 0;
        opacity: 0;
    }

    #Menu > ul > li.open:hover > ul,
    #Menu > ul > li.open:focus-within > ul,
    #Menu > ul > li.open > ul {
        max-height: 500px;
        opacity: 1;
    }

    #Menu > ul > li:hover > .menu-trigger {
        background-color: transparent;
    }

    #Menu > ul > li.open > .menu-trigger {
        background-color: #084586;
    }

    #Menu > ul > li > ul {
        position: static;
        display: block;
        width: 100%;
        box-shadow: none;
        background: #06366a;
        max-height: 0;
        overflow: hidden;
        opacity: 0;
        transition: max-height 0.3s ease, opacity 0.2s ease;
    }

    #Menu > ul > li.open > ul {
        max-height: 500px;
        opacity: 1;
    }

    #Menu > ul > li > ul > li > a {
        padding: 12px 20px;
        font-size: 1rem;
        text-align: center;
    }

    .main-content {
        width: 95%;
        padding: 20px;
    }

    .link-table {
        width: 95%;
    }

    .link-grid {
        grid-template-columns: 1fr;
    }

    .link-grid--dmu a:last-child {
        grid-column: auto;
    }

    .newsletter-grid {
        grid-template-columns: 1fr;
    }

    .news-home-list li {
        grid-template-columns: 1fr;
        gap: 4px;
    }

    .data-table thead {
        display: none;
    }

    .data-table tr {
        display: block;
        margin-bottom: 16px;
        border: 1px solid #084586;
    }

    .data-table td {
        display: block;
        width: 100%;
        text-align: left;
        border: none;
        border-bottom: 1px solid #e0e0e0;
    }

    .data-table td:last-child {
        border-bottom: none;
        text-align: center;
        padding-top: 8px;
    }
}
