/* =========================================================================
   CDPS — Centre du Droit de la Protection Sociale
   Feuille de style principale (fidèle à la charte graphique d'origine)
   ========================================================================= */

@font-face {
    font-family: "ABeeZee";
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: local("ABeeZee");
}

:root {
    --color-text: #919191;
    --color-text-dark: #4a4a4a;
    --color-heading: #000000;
    --color-page-bg: #e6e6e6;
    --color-white: #ffffff;
    --color-footer-bg: #f2f2f2;
    --color-border: #acacac;
    --color-btn: #595959;
    --color-btn-hover: #9e9e9e;
    --box-1: #f9f9f9;
    --box-2: #d8d8da;
    --box-3: #fffffd;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.12);
    --radius: 3px;
    --max-width: 1180px;
    --font-base: "ABeeZee", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: var(--font-base);
    font-size: 16px;
    color: var(--color-text);
    background: var(--color-page-bg);
    line-height: 1.6;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: var(--color-text-dark);
    text-decoration: none;
}

a:hover,
a:focus {
    color: #000000;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--color-heading);
    font-weight: 400;
    line-height: 1.25;
    margin-top: 0;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: #000000;
    color: var(--color-white);
    padding: 0.75rem 1.25rem;
    z-index: 1000;
    border-radius: 0 0 var(--radius) 0;
}

.skip-link:focus {
    left: 0;
}

/* ---------- En-tête / navigation ---------------------------------------- */

.site-header {
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.site-header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.brand {
    padding: 10px 0;
}

.brand img {
    display: block;
}

.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.65rem;
    cursor: pointer;
}

.nav-toggle__bar {
    width: 22px;
    height: 2px;
    background: #000000;
    display: block;
}

.site-nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.site-nav > ul {
    display: flex;
    align-items: center;
    gap: 0;
    flex-wrap: wrap;
}

.site-nav > ul > li {
    position: relative;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 28.8px 16px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000000;
    background: none;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}

.nav-link:hover,
.nav-link:focus,
.nav-link.is-active {
    color: var(--color-btn);
}

.chevron {
    width: 6px;
    height: 6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    margin-top: -3px;
}

.submenu {
    display: none;
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 300px;
    background: var(--color-white);
    box-shadow: var(--shadow-sm);
    padding: 0.4rem;
    flex-direction: column;
    z-index: 50;
}

.has-children.is-open .submenu,
.has-children:focus-within .submenu {
    display: flex;
}

.submenu a {
    display: block;
    padding: 0.6rem 0.85rem;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    color: #000000;
}

.submenu a:hover,
.submenu a:focus,
.submenu a.is-active {
    background: var(--color-page-bg);
    color: var(--color-btn);
}

/* ---------- Hero (accueil) ------------------------------------------------ */

.hero {
    position: relative;
    background: url('/images/slide1.jpg') 0% 0% / cover no-repeat fixed;
    color: var(--color-white);
    padding: 10% 0 10% 5%;
    margin: 0;
    overflow: hidden;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: #000000;
    opacity: 0.25;
}

.hero__inner {
    position: relative;
    max-width: 640px;
}

.hero h1 {
    color: var(--color-white);
    font-size: 40px;
    line-height: 44px;
    font-weight: bold;
    margin-bottom: 0.75rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.hero p.lead {
    position: relative;
    font-size: 1rem;
    color: var(--color-white);
}

@media (max-width: 640px) {
    .hero {
        padding: 15% 1.25rem;
    }

    .hero h1 {
        font-size: 1.7rem;
        line-height: 1.25;
    }
}

/* ---------- Bannière de page (pages intérieures) -------------------------- */

.page-banner {
    position: relative;
    background-color: #dcdcdc;
    background-repeat: no-repeat;
    background-position: 0% 0%;
    background-size: contain;
    background-attachment: fixed;
    /* Le padding vertical en % (comme sur le site d'origine) fait que la bannière
       s'agrandit avec la largeur de la fenêtre plutôt que d'avoir une hauteur fixe. */
    padding: 10% 1.5rem;
    text-align: left;
}

.page-banner__inner {
    position: relative;
    max-width: var(--max-width);
    margin: 0 auto;
}

.page-banner h1 {
    color: var(--color-white);
    margin: 0;
    font-size: 40px;
    line-height: 44px;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

@media (max-width: 640px) {
    .page-banner {
        padding: 15% 1.25rem;
    }

    .page-banner h1 {
        font-size: 1.6rem;
        line-height: 1.25;
    }
}

/* ---------- Mise en page générale ---------------------------------------- */

.container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
}

.container--narrow {
    max-width: 860px;
}

.content-card {
    background: var(--color-white);
    margin: -30px auto 0;
    max-width: var(--max-width);
    padding: 2rem;
    position: relative;
    box-shadow: var(--shadow-sm);
}

/* Colonne de lecture centrée (comme le col-md-8 encadré de marges vides sur le
   site d'origine), pour les pages de texte qui ne contiennent pas de tableau. */
.content-card.container--narrow {
    max-width: 800px;
}

section + section {
    margin-top: 2.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 0;
    margin-top: -50px;
    position: relative;
}

.card {
    background: var(--color-white);
    padding: 1.75rem;
    text-align: center;
}

.card__image-wrap {
    overflow: hidden;
    margin: 0 auto 1rem;
}

.card img {
    display: block;
    margin: 0 auto;
    max-width: 100%;
    width: 100%;
    transition: transform 0.35s ease-out;
}

.card__image-wrap:hover img {
    transform: scale(1.2) rotate(5deg);
}

.card h3 {
    font-size: 2.375rem;
    font-weight: 400;
    color: #000000;
}

@media (max-width: 640px) {
    .card h3 {
        font-size: 1.75rem;
    }
}

.card p, .card a {
    color: #000000;
    text-align: justify;
    font-size: 0.95rem;
}

.prose h2 {
    font-size: 26px;
    font-weight: 300;
    margin-bottom: 13px;
    margin-top: 1.75rem;
}

.prose h3 {
    font-size: 1.1rem;
}

.prose p {
    text-align: justify;
}

.prose ul {
    padding-left: 1.3rem;
}

.prose li {
    margin-bottom: 0.4rem;
}

.figure {
    background: var(--color-white);
    overflow: hidden;
}

.figure img {
    width: 100%;
    transition: transform 0.35s ease-out;
}

.figure:hover img {
    transform: scale(1.2) rotate(5deg);
}

.figure figcaption {
    padding: 0.75rem 0;
    font-size: 0.9rem;
    color: var(--color-text);
}

.inline-figure {
    float: left;
    margin: 0.3rem 1.25rem 1rem 0;
    max-width: 265px;
}

.two-col {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

@media (max-width: 800px) {
    .two-col {
        grid-template-columns: 1fr;
    }
}

.horizontal-box {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
    flex-wrap: wrap;
}

.horizontal-box img {
    width: 250px;
    height: 250px;
    object-fit: cover;
    flex: none;
    /* L'image est placée à droite du texte, comme sur le site d'origine. */
    order: 2;
}

.horizontal-box__text {
    flex: 1 1 320px;
    min-width: 0;
}

@media (max-width: 600px) {
    .horizontal-box img {
        width: 100%;
        height: auto;
        max-width: 250px;
        margin: 0 auto;
    }
}

.timeline {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0;
    border-left: 3px solid var(--color-border);
}

.timeline li {
    position: relative;
    padding: 0 0 1.3rem 1.5rem;
}

.timeline li::before {
    content: "";
    position: absolute;
    left: -8px;
    top: 0.35rem;
    width: 13px;
    height: 13px;
    background: var(--color-btn);
    border-radius: 50%;
}

.timeline strong {
    color: #000000;
}

/* ---------- Tableaux ------------------------------------------------------ */

.table-wrap {
    overflow-x: auto;
    margin-top: 1.5rem;
}

table {
    border-collapse: collapse;
    border: 1px solid var(--color-border);
    width: 100%;
    background: var(--color-white);
    font-size: 0.92rem;
}

caption {
    caption-side: top;
    text-align: left;
    padding: 0 0 0.75rem;
    font-weight: 700;
    color: #000000;
}

th, td {
    text-align: left;
    padding: 8px;
    border: 1px solid var(--color-border);
}

th {
    background-color: #9e9e9e;
    color: var(--color-white);
}

tbody tr:nth-child(even) {
    background-color: #f2f2f2;
}

tbody tr:hover {
    background-color: #dddddd;
}

table a {
    color: var(--color-text-dark);
    text-decoration: underline;
}

/* ---------- Documents téléchargeables ------------------------------------ */

.doc-list {
    list-style: none;
    padding: 0;
    margin: 1.25rem 0;
    display: grid;
    gap: 0.6rem;
}

.doc-list li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 0.75rem 1rem;
}

.doc-icon {
    flex: none;
}

.doc-icon-inline {
    flex: none;
    vertical-align: middle;
    margin-right: 0.4rem;
}

.doc-list a.doc-name {
    font-weight: 700;
    color: #000000;
    text-decoration: underline;
}

.doc-list .doc-meta {
    color: var(--color-text);
    font-size: 0.82rem;
    display: block;
}

/* ---------- Colloques ------------------------------------------------------ */

.colloque {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1rem;
    display: grid;
    grid-template-columns: 140px 1fr;
    gap: 1.25rem;
}

.colloque__date {
    font-weight: 700;
    color: #000000;
}

.colloque__body h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
}

.colloque__body p {
    margin: 0.2rem 0;
    color: var(--color-text);
}

@media (max-width: 560px) {
    .colloque {
        grid-template-columns: 1fr;
    }
}

/* ---------- Section "Montpellier" (flux RSS) ------------------------------ */

.feed-section {
    position: relative;
    background: url('/images/1920x1080-5.jpg') center / cover no-repeat fixed;
    color: var(--color-white);
    padding: 50px 20px;
    text-align: center;
}

/* Pas de calque sombre ici : le site d'origine n'en applique aucun sur cette
   section (opacité vide dans la configuration), l'image est affichée telle quelle. */

.feed-section__inner {
    position: relative;
    max-width: 760px;
    margin: 0 auto;
}

.feed-section h2 {
    color: var(--color-white);
    font-size: 2.4rem;
    margin-bottom: 1.5rem;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.feed-item h3 {
    margin: 0 0 0.5rem;
}

.feed-item h3 a {
    color: var(--color-white);
    text-decoration: none;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.55);
}

.feed-item .feed-date {
    font-size: 0.85rem;
    opacity: 0.8;
    margin-bottom: 0.75rem;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
}

.feed-item p {
    color: #e5e5e5;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);
    font-size: 0.95rem;
}

/* ---------- Formulaire de contact ----------------------------------------- */

.contact-layout {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 800px) {
    .contact-layout {
        grid-template-columns: 1fr;
    }
}

form.contact-form {
    background: var(--color-white);
    padding: 1.75rem;
}

.form-row {
    margin-bottom: 1.1rem;
}

.form-row label {
    display: block;
    font-weight: 700;
    margin-bottom: 0.35rem;
    font-size: 0.9rem;
    color: #000000;
}

.form-row input,
.form-row textarea {
    width: 100%;
    padding: 0.6rem 0.8rem;
    border: 1px solid var(--color-border);
    border-radius: 2px;
    font: inherit;
    background: var(--color-white);
    color: #333333;
}

.form-row input:focus,
.form-row textarea:focus {
    outline: 2px solid var(--color-btn);
    outline-offset: 1px;
}

.form-row textarea {
    min-height: 140px;
    resize: vertical;
}

.form-hint {
    font-size: 0.8rem;
    color: var(--color-text);
    margin-top: 0.3rem;
}

.required {
    color: #b3261e;
}

.captcha-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.captcha-image {
    border: 1px solid var(--color-border);
    display: block;
}

.captcha-refresh {
    font-size: 0.8rem;
    text-decoration: underline;
    color: var(--color-text-dark);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
}

.honeypot-field {
    position: absolute;
    left: -9999px;
    top: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.btn {
    display: inline-block;
    background: var(--color-btn);
    color: var(--color-white);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    text-transform: uppercase;
}

.btn:hover,
.btn:focus {
    background: var(--color-btn-hover);
    color: var(--color-white);
}

.alert {
    padding: 1rem 1.25rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-weight: 500;
}

.alert--success {
    background: #e6f4ea;
    color: #1e7b34;
    border: 1px solid #b7e1c3;
}

.alert--error {
    background: #fdecea;
    color: #a3281c;
    border: 1px solid #f3c1bc;
}

.contact-card {
    background: #333333;
    color: var(--color-white);
    padding: 1.75rem;
}

.contact-card h3 {
    color: var(--color-white);
    margin-bottom: 1rem;
}

.contact-card p {
    margin: 0.3rem 0;
    color: #cccccc;
}

.contact-card a {
    color: var(--color-white);
    text-decoration: underline;
}

/* ---------- Modale de prévisualisation PDF -------------------------------- */

.pdf-modal {
    width: min(900px, 92vw);
    height: min(85vh, 1100px);
    padding: 0;
    border: none;
    border-radius: 4px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.35);
    overflow: hidden;
}

.pdf-modal::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.pdf-modal[open] {
    display: flex;
    flex-direction: column;
}

.pdf-modal__header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem 1rem;
    background: #333333;
    color: var(--color-white);
    flex: none;
}

.pdf-modal__title {
    flex: 1 1 auto;
    font-weight: 700;
    font-size: 0.9rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-modal__download {
    color: var(--color-white);
    font-size: 0.85rem;
    text-decoration: underline;
    flex: none;
}

.pdf-modal__close {
    flex: none;
    background: none;
    border: none;
    color: var(--color-white);
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    padding: 0 0.25rem;
}

.pdf-modal__close:hover,
.pdf-modal__close:focus {
    color: var(--color-btn-hover);
}

.pdf-modal__frame {
    flex: 1 1 auto;
    width: 100%;
    height: 100%;
    border: none;
}

/* ---------- Pied de page --------------------------------------------------- */

.site-footer {
    background: var(--color-footer-bg);
    color: var(--color-text);
    margin-top: 3rem;
}

.site-footer__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 60px 1.5rem;
    text-align: center;
    font-size: 1rem;
}

.site-footer p {
    margin: 0.25rem 0;
}

.site-footer__credit a {
    color: var(--color-text);
    text-decoration: underline;
}

/* ---------- Responsive nav -------------------------------------------------- */

@media (max-width: 900px) {
    .nav-toggle {
        display: inline-flex;
    }

    .site-nav {
        display: none;
        width: 100%;
        order: 3;
    }

    .site-nav.is-open {
        display: block;
    }

    .site-header__inner {
        flex-wrap: wrap;
        padding: 0 16px;
    }

    .site-nav ul {
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border-top: 1px solid var(--color-page-bg);
        margin-top: 0.5rem;
        padding-top: 0.25rem;
    }

    .nav-link {
        width: 100%;
        justify-content: space-between;
        padding: 14px 8px;
    }

    .submenu {
        position: static;
        box-shadow: none;
        padding-left: 1rem;
        min-width: 0;
    }

    .has-children.is-open .submenu {
        display: flex;
    }

    .card-grid,
    .content-card {
        margin-top: 0;
    }
}

/* ---------- Pages d'erreur (403 / 404 / 500) ------------------------------ */

.error-page {
    text-align: center;
    padding: 4rem 1.5rem 5rem;
}

.error-page__code {
    font-size: 6.5rem;
    font-weight: 700;
    color: var(--color-border);
    line-height: 1;
    margin-bottom: 0.5rem;
    letter-spacing: 0.05em;
}

.error-page__emoji {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.error-page__title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #000000;
    margin-bottom: 0.75rem;
}

.error-page__message {
    color: var(--color-text);
    max-width: 480px;
    margin: 0 auto 2rem;
    line-height: 1.6;
}

.error-page__actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
