/* ============================================= */
/* IMPORTS ET VARIABLES GLOBALES */
/* ============================================= */
@import url('fonts.css');

/* CSS Variables */
:root {
    /* Colors */
    --color-green: #005D48;
    --color-pink: #A70043;

    /* Fonts */
    --font-sans-serif: "Josefin Sans", sans-serif, "Helvetica Neue";
    --font-strict: "Jost", "Josefin Sans", sans-serif, "Helvetica Neue";
    --body-font: var(--font-sans-serif);

    /* Typography */
    --body-font-weight: 300;
    --body-line-height: 1.5;
    --body-color: #212529;
    --body-bg: #fff;
    --heading-color: inherit;

    /* Layout */
    --header-bg: #fff;
    --header-title-bg: #EFF1E6;
    --header-title-text-bg: rgba(239,241,230,0.7);
    --header-h1-bg: rgba(0, 93, 72,0.7);
    --header-h1-color: #fff;
    --header-h1-font-size: 4rem;
    --menu-bg: #fff;
    --footer-bg: var(--color-green);
    --menu-active-color: var(--color-pink);
    --main-title-color: var(--color-green);
    --content-box-color: #fff;
    --content-box-bg: var(--color-green);
    --content-box-font: var(--font-sans-serif);

    /* Header */
    --header-burger-size: 30px;
    --header-burger-color: #000;
}

/* ============================================= */
/* RESET ET BASE STYLES */
/* ============================================= */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    font-family: var(--body-font);
    font-size: 1rem;
    font-weight: var(--body-font-weight);
    line-height: var(--body-line-height);
    color: var(--body-color);
    background-color: var(--body-bg);
    overflow-x: hidden;
    overflow-y: auto;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    padding-top: 92px; /* Égal à la hauteur du header */
}

/* ============================================= */
/* UTILITIES */
/* ============================================= */
.d-flex {
    display: flex !important;
}

.flex-column {
    flex-direction: column !important;
}

.h-100 {
    height: 100% !important;
}

.mt-auto {
    margin-top: auto !important;
}

.text-align-left {
    text-align: left;
}

.text-align-center {
    text-align: center;
}

.text-align-right {
    text-align: right;
}

/* ============================================= */
/* CONTAINER */
/* ============================================= */
.container {
    width: 100%;
    padding-right: calc(var(--gutter-x) * 0.5);
    padding-left: calc(var(--gutter-x) * 0.5);
    margin-right: auto;
    margin-left: auto;
    font-size: 1.1rem;
}

@media (max-width: 575.98px) {
    .container, .header-title {
        padding: 0 15px;
    }
}

@media (min-width: 576px) {
    .container, .header-title {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container, .header-title {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container, .header-title {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container, .header-title {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container, .header-title {
        max-width: 1320px;
    }
}

/* ============================================= */
/* TYPOGRAPHIE */
/* ============================================= */
a {
    color: var(--color-pink);
}

p {
    margin-bottom: 0.5rem;
}

h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-weight: 500;
    line-height: 1.2;
    color: var(--heading-color);
    font-weight: 800;
}

h1 {
    font-size: calc(1.375rem + 1.5vw);
}

h2 {
    font-size: 2rem;
    font-family: var(--font-sans-serif);
    text-align: left;
    margin-bottom: 2rem;
    margin-top: 2rem;
}

h3 {
    text-align: left;
    font-weight: 700;
    font-family: var(--font-sans-serif);
    font-size: 1.25rem;
}

h4 {
    font-size: 1.1rem;
    text-align: left;
    font-weight: 700;
    font-family: var(--font-sans-serif);
    font-style: italic;
}

h5 {
    font-size: 1.1rem;
}

h6 {
    font-size: 1rem;
}

/* ============================================= */
/* HEADER */
/* ============================================= */
header.header-menu {
    z-index: 100;
    width: 100%;
    position: sticky;
    top: 0;
    background-color: var(--header-bg);
    font-optical-sizing: auto;
    font-weight: 700;
    font-style: normal;
    text-transform: uppercase;
    padding: 1rem 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

nav {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0 auto;
    padding: 0;
    justify-content: center;
}

nav ul li {
    display: inline-block;
}

nav ul li a {
    display: block;
    color: var(--text-color);
    font-weight: bold;
    text-decoration: none;
    padding: 1rem 1.5rem;
    transition: background 0.3s;
}

li.menu-active a {
    font-style: italic;
    color: var(--menu-active-color) !important;
}

.nav-menu li:hover {
    margin-top: -3px;
    border-bottom: 3px solid #A70043;
}

/* ============================================= */
/* HEADER TITLE */
/* ============================================= */
header.header-title {
    position: relative;
    border-radius: 25px;
    width: 100%;
    margin: 0 auto;
    background: var(--header-title-bg) url('../img/header-leaves.png') no-repeat left center;
    background-size: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-title {
    text-align: center;
    font-family: var(--font-strict);
    font-size: 30px;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--main-title-color);
    background-color: var(--header-title-text-bg);
    padding: 1rem;
}

img.header-logo {
    margin-right: 20px;
    width: 125px;
    height: 170px;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

img.footer-logo {
    width: 71px;
    height: 97px;
}

/* ============================================= */
/* MAIN CONTENT */
/* ============================================= */
main {
    flex: 1;
    padding: 40px 0;
}

/* Page H1 styling */
main h1 {
    height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 30px;
    background-size: 100%;
    background-size: cover;
    background-position: center;
    color: var(--header-h1-color);
    font-size: var(--header-h1-font-size);
    font-family: var(--font-strict);
    font-weight: 900;
}

body.page-home h1 {
    display: none;
}
body h1 {
    background-image: linear-gradient(var(--header-h1-bg), var(--header-h1-bg)), url("../img/header-title-minor-pages.jpg");
}

body.page-patients h1 {
    background-image: linear-gradient(var(--header-h1-bg), var(--header-h1-bg)), url("../img/header-title-patients.jpg");
}

body.page-stages h1 {
    background-image: linear-gradient(var(--header-h1-bg), var(--header-h1-bg)), url("../img/header-title-stages.jpg");
}

body.page-equipe h1 {
    background-image: linear-gradient(var(--header-h1-bg), var(--header-h1-bg)), url("../img/header-title-equipe.jpg");
}

body.page-contact h1 {
    background-image: linear-gradient(var(--header-h1-bg), var(--header-h1-bg)), url("../img/header-title-contact.jpg");
}

body.page-404 h1 {
    background-image: linear-gradient(var(--header-h1-bg), var(--header-h1-bg)), url("../img/header-title-404.jpg");
}

/* ============================================= */
/* MOBILE MENU */
/* ============================================= */
@media (max-width: 768px) {
    nav {
        flex-direction: column;
    }

    .nav-menu {
        display: none;
        flex-direction: column;
        background-color: var(--menu-bg);
        padding-bottom: 20px;
        position: absolute;
        top: 92px;
        left: 0;
        right: 0;
        align-items: center;
        justify-content: flex-start;
    }

    .menu-toggle:checked ~ .nav-menu {
        display: flex;
        top:62px;
        z-index: 9999;
        height: 100vh;
    }
}

@media (min-width: 768px) {
    .nav-menu {
        width: 1200px;
        display: flex !important;
        flex-direction: row;
        position: static;
        background: none;
    }

    .menu-toggle {
        display: none;
    }
}

/* ============================================= */
/* GRID SYSTEMS */
/* ============================================= */
.grid-2, .grid-3 {
    display: grid;
    grid-gap: 30px;
    grid-template-columns: 1fr;
}

@media (min-width: 768px) {
    .grid-2 {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 992px) {
    .grid-3 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.grid-2-1 {
    display: grid;
    grid-gap: 30px;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .grid-2-1 {
        grid-template-columns: 2fr 1fr;
    }
}

.grid-1-2 {
    display: grid;
    grid-gap: 30px;
    grid-template-columns: 1fr;
}

@media (min-width: 992px) {
    .grid-1-2 {
        grid-template-columns: 1fr 2fr;
    }
}

.page-home .grid-2-1 {
    margin-bottom: 1rem;
}

.page-home .grid-2-1 > div:nth-child(2) {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center !important;
}

.page-home .grid-2-1 .se-component {
    float: none !important;
    margin: 0 auto !important;
}

/* ============================================= */
/* CONTENT BOXES */
/* ============================================= */
.text-block.with-background,
.content-box.with-background {
    padding: 35px 35px 20px 35px;
    border-radius: 15px;
    background-color: var(--content-box-bg);
    color: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}
.with-background a {
    color:#fff;
} 
.with-background a:hover {
    text-decoration: none;
} 

.col {
    overflow: hidden;
}

.content-box {
    padding: 0;
    border-radius: 25px;
    font-family: var(--content-box-font);
    margin: 15px 0 20px 0;
    font-weight: var(--body-font-weight);
    display: flex;
    flex-direction: column;
}

.content-box h2 {
    color: var(--content-box-color);
    margin-bottom: 15px;
    margin-top: 0;
}
.text-block h3 {
    margin:10px 0;
}

.content-box p {
    flex-grow: 1;
}

/* ============================================= */
/* BUTTONS */
/* ============================================= */
.text-block .button {
    margin:10px 0;   
}
.content-box .button {
    margin: 0 auto;
}
.text-block .button, .content-box .button, button { /* , .button, button */
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 20px;
    border-style: none;    
    font-weight: 800;
    font-size: 0.8rem;
    width: fit-content;
    padding: 12px 30px;
}
.button, button {
    background-color: var(--color-green);
    color: #fff;
}
.text-block .button, .content-box .button, .content-box .button, .content-box button {
    background-color: #fff;
    color: var(--color-green);
}

.content-box .button a {
    color: var(--color-green);
    text-decoration: none;
    display: block;
    padding: 10px 30px;
    width: 100%;
}

.text-block .button:hover, .content-box .button:hover {
    background-color: var(--color-pink);
    color:#fff;
    transition: background-color 0.3s, color 0.3s;
}

.content-box .button:hover a {
    color: #ffffff;
}

/* ============================================= */
/* HAMBURGER MENU */
/* ============================================= */
.menu-toggle {
    width: var(--header-burger-size);
    margin-top: 0;
    height: var(--header-burger-size);
    aspect-ratio: 1;
    border: none;
    padding: 0;
    border-inline: calc(var(--header-burger-size)/2) solid transparent;
    box-sizing: content-box;
    --header-burger-g1: linear-gradient(var(--header-burger-color) 20%, transparent 0 80%, var(--header-burger-color) 0)
            no-repeat content-box border-box;
    --header-burger-g2: radial-gradient(circle closest-side at 50% 12.5%, var(--header-burger-color) 95%, transparent)
            repeat-y content-box border-box;
    background:
        var(--header-burger-g2) left var(--header-burger-p, 0px) top,
        var(--header-burger-g1) left calc(var(--header-burger-size)/10 + var(--header-burger-p, 0px)) top,
        var(--header-burger-g2) right var(--header-burger-p, 0px) top,
        var(--header-burger-g1) right calc(var(--header-burger-size)/10 + var(--header-burger-p, 0px)) top;
    background-size:
        20% 80%,
        40% 100%;
    position: relative;
    clip-path: inset(0 25%);
    -webkit-mask: linear-gradient(90deg, transparent, black 25% 75%, transparent);
    cursor: pointer;
    transition:
        background-position 0.3s var(--header-burger-s, 0.3s),
        clip-path 0s var(--header-burger-s, 0.6s);
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.menu-toggle:before,
.menu-toggle:after {
    content: "";
    position: absolute;
    border-radius: var(--header-burger-size);
    inset: 40% 0;
    background: var(--header-burger-color);
    transition: transform 0.3s calc(0.3s - var(--header-burger-s, 0.3s));
}

.menu-toggle:checked {
    clip-path: inset(0);
    --header-burger-p: calc(-1 * var(--header-burger-size));
    --header-burger-s: 0s;
}

.menu-toggle:checked:before {
    transform: rotate(45deg);
}

.menu-toggle:checked:after {
    transform: rotate(-45deg);
}

.menu-toggle:focus-visible {
    clip-path: none;
    -webkit-mask: none;
    border: none;
    outline: 2px solid var(--header-burger-color);
    outline-offset: 5px;
}

.menu-hamburger {
    z-index: 9999;
    display: block;
    margin: 0 auto;
    cursor: pointer;
}

/* ============================================= */
/* FORMS */
/* ============================================= */
label {
    display: block;
    margin-top: 15px;
    text-align: left;
}

input, textarea {
    width: 100%;
    padding: 8px;
    margin-top: 5px;
    border: 1px solid #ccc;
}

.checkbox {
    margin-top: 15px;
}

.checkbox label {
    display: inline;
}

button {
    width: 100%;
    background: var(--color-green);
    color: white;
    cursor: pointer;
}

button:hover {
    background: var(--color-pink);
}

.form-group {
    margin-bottom: 20px;
}

.honeypot {
    display: none;
}

/* ============================================= */
/* FOOTER */
/* ============================================= */
footer {
    padding: 1rem 0;
    color: #fff;
    background-color: var(--footer-bg);
}

.footer-menu ul {
    display: inline-flex;
    gap: 30px;
    align-items: center;
    list-style: none;
    padding: 0;
    margin: 0;
    font-weight: 400;
}

.footer-menu a {
    color: #fff;
    text-decoration: none;
    font-size: 0.9rem;
}

.footer-menu a:hover {
    text-decoration: underline;
}

.footer-logo img {
    width: 71px;
    height: 97px;
}

footer .container {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.footer-left {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

/* ============================================= */
/* TABLES */
/* ============================================= */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

/* Préférer le padding sur th/td plutôt qu'une hauteur fixe sur tr (évite les bugs WebKit) */
th, td {
    text-align: center;
    border-bottom: 1px solid #fff;
    border-right: 1px solid #fff;
    padding: 0.8rem 0.5rem;
}

tr:last-child td {
    border-bottom: none;
}

th:last-child, td:last-child {
    border-right: none;
}

td:first-child {
    text-align: left;
}

.table-container th, .table-container td {
    color: #fff;
    font-weight: 300;
}

.table-container {
    background-color: var(--color-green);
    padding: 25px;
    border-radius: 25px;
}

.content-box table {
    color: #fff;
}

/* Accessibilité conforme et compatible Safari (évite le fantôme de scroll) */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
    top: 0;
    left: 0;
}

/* Tableau responsive : cartes sur mobile */
@media (max-width: 767.98px) {
    .table-responsive {
        display: block;
        width: 100%;
        border-collapse: separate; /* Crucial pour Safari quand les enfants sont en block/flex */
    }

    /* display: none supprime proprement thead du flux sans créer d'espace fantôme */
    /* L'accessibilité reste assurée par data-label et le ::before des td */
    .table-responsive thead {
        display: none;
    }

    .table-responsive tbody,
    .table-responsive tr,
    .table-responsive td {
        display: block;
        width: 100%;
    }

    .table-responsive tr {
        height: auto;
        padding: 15px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.5);
    }

    .table-responsive tbody tr:last-child {
        border-bottom: none;
    }

    .table-responsive td {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 15px;
        text-align: right;
        border: none;
        padding: 6px 0;
        box-sizing: border-box;
    }

    /* Libellé de la colonne, injecté depuis data-label */
    .table-responsive td::before {
        content: attr(data-label);
        font-weight: 700;
        text-align: left;
        flex: 0 0 45%;
    }

    /* La 1re cellule devient le "titre" de la carte */
    .table-responsive td:first-child {
        display: block;
        text-align: left;
        font-weight: 700;
        font-size: 1.05rem;
        padding-bottom: 10px;
    }

    .table-responsive td:first-child::before {
        display: none;
    }
}

/* ============================================= */
/* LISTS */
/* ============================================= */
ul {
    text-align: left;
    margin-left: 1rem;
}

/* ============================================= */
/* IMAGES */
/* ============================================= */
img {
    max-width: 100%;
    height: auto;
}

.se-image-container img {
    border-radius: 8px;
}

/* ============================================= */
/* ICON LISTS */
/* ============================================= */
li.icon-list-phone, li.icon-list-mail {
    padding-left: 24px;
    background-repeat: no-repeat;
    background-position: 0 50%;
    background-size: 16px;
}

li.icon-list-phone {
    background-image: url("../img/symbol-contact-phone.svg");
}

li.icon-list-mail {
    background-image: url("../img/symbol-contact-email.svg");
}

/* ============================================= */
/* NUMBER BOX */
/* ============================================= */
.number-box {
    display: flex;
    align-items: center;
    gap: 10px;
    align-items: flex-start;
}

.cercle-number {
    border-radius: 50%;
    width: 25px;
    height: 25px;
    padding: 8px;
    background-color: var(--color-pink);
    color: #fff;
    text-align: center;
    font-size: 1.3rem;
    box-sizing: initial;
    flex-shrink: 0;
}

/* ============================================= */
/* UTILITY CLASSES */
/* ============================================= */
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }

.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* ============================================= */
/* RESPONSIVE STYLES */
/* ============================================= */
@media (max-width: 768px) {
    /* Grid structure for mobile */
    .grid-2,
    .grid-2-1,
    .grid-1-2,
    .grid-3 {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    .col {
        margin-bottom: 30px;
        order: 0;
    }

    /* Mobile title sizes */
    .block-title {
        font-size: 1.75rem;
        margin-bottom: 15px;
    }

    /* Adjust content spacing on mobile */
    .content-box {
        margin-bottom: 15px;
    }

    /* Footer styles */
    .footer-menu ul {
        width: 100%;
        flex-direction: column;
        align-items: center;
        gap: 15px;
        text-align: center;
    }

    .footer-logo {
        display: flex;
        justify-content: center;
    }

    .footer-logo img {
        position: static;
        transform: none;
        margin-top: 10px;
    }

    footer .container {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
    }

    .footer-left {
        align-items: center;
    }
}

@media (min-width: 768px) {
    header.header-title {
        height: 300px !important;
        min-height: 300px;
    }
}

@media (max-width: 768px) {
    .header-title {
        display: flex;
        flex-direction: column;
        align-items: center;
        position: static;
    }

    .main-title {
        background-color: transparent;
    }

    header.header-title {
        top: 0;
        background-image: none;
        padding: 30px;
    }

    img.header-logo {
        position: static;
        transform: none;
        margin-top: 10px;
    }
}
/* ============================================= */
/* ALERT STYLE */
/* ============================================= */
.alert {
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 4px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.alert-success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}
.alert-error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}