/* ===== Reset minimal ===== */
*,
*::before,
*::after {
    box-sizing: border-box
}

html,
body {
    margin: 0;
    padding: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
    /* prend tout l’espace dispo pour pousser le footer en bas */
}

img {
    max-width: 100%;
    height: auto;
    display: block
}

a {
    text-decoration: underline;
    color: inherit
}

p {
    margin: 0 0 1em;
    text-align: justify;
}

li {
    margin: 0 0 .5em;
    list-style-position: outside;
}

button,
input,
textarea {
    font: inherit
}

/* ===== Thème / variables ===== */
:root {
    --container: 100em;
    /* 1600px : header/nav */
    --content: 70em;
    /* ≈1120px : corps de page */
    --gutter: 1em;
    /* 24px */
    --text: #7E7E7E;
    --title: #424242;
    --muted: #6a6a6a;
    --line: #eee;
    --brand: #d62828;
    --hero-img: url("/assets/img/colocs.jpg");
}

body {
    font-family: "Rubik", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    line-height: 1.5;
    background: #fff;
}

/* ===== Helpers ===== */
.container {
    max-width: var(--container);
    margin: 0 auto;
    padding: 0 1em 4em 1em;
    /* overflow-x: hidden; */
}

.mt-16 {
    margin-top: 1em
}

.mt-24 {
    margin-top: 1.5em
}

.mt-40 {
    margin-top: 2.5em
}

.mt-56 {
    margin-top: 3.5em
}

.gap-16 {
    gap: 1em
}

.gap-24 {
    gap: 1.5em
}

.gap-40 {
    gap: 2.5em
}

/* ===== Header (nav fixe + ombre élégante) ===== */
.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    background: #fff;
    box-shadow: 0 0.25em 0.75em rgba(0, 0, 0, .08);
    transition: box-shadow .3s ease;
}

.hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--gutter)
}

.brand img {
    height: 4em;
    width: auto;
}

/* logo un peu réduit */

.nav {
    display: flex;
    gap: 1.125em;
    font-size: .8125em;
    letter-spacing: .04em;
    text-transform: uppercase;
    font-size: 1.1em;
}

.nav a {
    padding: .5em .375em;
    border-radius: .5em;
    color: #111;
    text-decoration: none;
}

.nav a:hover {
    background: #f7f7f7
}

.nav .bailleur {
    font-weight: 500
}

/* ===== Hero (parallax) ===== */
.hero {
    position: relative;
    display: grid;
    place-items: center;
    overflow: hidden;
    color: #fff;
    text-align: center;
    isolation: isolate;
    opacity: 0;
    transition: opacity 1.5s ease-in-out;
}

.hero.is-visible {
    opacity: 1;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: center/cover no-repeat var(--hero-img);
    background-attachment: fixed;
    /* parallax natif */
    z-index: -2;
}

.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, .08);
    /* voile pour éclaircir */
    z-index: -1;
}

.hero-text {
    padding: 0 1.5em;
    text-shadow: 0 .125em .5em rgba(0, 0, 0, .35);
    margin-top: -2em;
}

.hero-text h1 {
    margin: 0 0 .08em;
    font-weight: 300;
    font-size: clamp(1.75em, 4.6vw, 3.5em);
    line-height: 1.05;
    color: #fff;
}

.hero-text h1 strong {
    font-weight: 700
}

.text-center {
    text-align: center
}

/* ===== Typo titres ===== */
h1 {
    font-size: clamp(1.75em, 3.6vw, 4em);
    font-weight: 300;
    line-height: 1.15;
    margin: 0.6em 0 0.4em;
    text-align: center;
    white-space: pre-wrap;
    color: var(--title);
}

h2.section-title {
    font-size: clamp(1.875em, 3.4vw, 2.75em);
    font-weight: 500;
    text-align: center;
    margin: 1.5em 0 1em;
    color: var(--title);
}

h2 {
    font-size: 1.4em;
    font-weight: 600;
    margin: 0 0 0.5em;
    color: var(--title);
}

h3 {
    font-size: 1.125em;
    font-weight: 600;
    margin: 2em 0 0.5em;
    color: var(--title);
}

/* ===== Intro ===== */
.intro {
    margin: 3em 0 .5em;
    text-align: center;
    color: var(--muted)
}

/* ===== Grilles ===== */
.grid {
    display: grid
}

.grid-2 {
    grid-template-columns: 1fr 1fr
}

.grid-3 {
    grid-template-columns: 1fr 1fr 1fr
}

.align-start {
    align-items: start
}

.align-center {
    align-items: center
}

.ratio {
    position: relative;
    aspect-ratio: 16/9;
    border-radius: .25em;
    overflow: hidden
}

.ratio img {
    width: 100%;
    height: 100%;
    object-fit: cover
}

.grid img {
    border-radius: .25em
}

/* ===== Lists ===== */
.list {
    margin: .5em 0 0 1.125em;
    padding: 0
}

.list li {
    margin: .375em 0
}

/* ===== Contenu principal (centré) ===== */
.page-content {
    max-width: var(--content);
    margin: 0 auto;
    padding: 0 var(--gutter);
    position: relative;
    z-index: 1;
    background: #fff;
}


/* ===== Contact ===== */
.contact {
    display: grid;
    place-items: center;
    margin-bottom: 2em;
}

.contact h2 {
    font-size: 2.125em;
    margin: .375em 0;
}

/* Grille du formulaire */
.form {
    width: 100%;
    max-width: 40em;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1em;
}

.form .span-2 {
    grid-column: span 2
}

.form .form-actions {
    display: flex;
    justify-content: center
}

.form label {
    display: block
}

.form label>span {
    display: block;
    font-size: .75em;
    color: var(--muted);
    margin-bottom: .375em
}

.form input,
.form textarea {
    width: 100%;
    padding: .6875em .75em;
    box-sizing: border-box;
    border: .0625em solid #cfcfcf;
    border-radius: .5em;
    outline: 0;
    background: #fff;
}

.form textarea {
    min-height: 8em
}

.form input:focus,
.form textarea:focus {
    border-color: #bdbdbd
}

.btn {
    color: #222;
    font-size: 1rem;
    line-height: normal;
    display: inline-block;
    padding: .6em 1em;
    border: .0625em solid #222;
    background: #fff;
    border-radius: .5em;
    cursor: pointer;
}

.btn:hover {
    opacity: .9
}

/* ===== Remontée en haut ===== */
.back-top {
    position: fixed;
    right: 1.4em;
    bottom: 10em;
    margin: 0;
    font-size: 0.8125em;
    background: rgba(255, 255, 255, 0.96);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    z-index: 20;
    border-radius: 50%;
}

.back-top a {
    display: inline-block;
    padding: 8px 12px;
    font-size: 1.2em;
    border-radius: 50%;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
    background: transparent;
    color: var(--muted);
    text-decoration: none;
}

/* .back-top a:hover {
    color: #d62828;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
} */

.back-top.is-visible {
    opacity: .69;
    pointer-events: auto;
}

/* ===== Footer ===== */
.site-footer {
    background: #f5f5f5;
    padding: 10px 0;
    text-align: center;
    border-top: 1px solid #ddd;
}

.foot-nav a {
    margin: 0 10px;
    text-decoration: none;
    font-size: 1.2em;
}

.foot {
    padding: 1.125em 0
}

.foot-nav {
    display: flex;
    flex-wrap: wrap;
    gap: .875em;
    font-size: .75em;
    color: var(--muted)
}

.site-footer .foot {
    display: grid;
    place-items: center
}

.site-footer .foot-nav {
    justify-content: center
}

.form-actions {
    position: relative;
}

.spinner {
    position: absolute;
    top: .6em;
    margin-left: -.5em;
    left: 50%;
    width: 1.4em;
    height: 1.4em;
    border: 3px solid #ccc;
    border-top: 3px solid #d62828;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    background: white;
    opacity: .8;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Conteneur */
/* .tooltip {
    position: relative;
    display: inline-block;
    text-decoration: none;
} */

/* Texte du tooltip */
/* .tooltip .tooltip-text {
    visibility: hidden;
    opacity: 0;
    width: max-content;
    background-color: #333;
    color: #fff;
    text-align: center;
    padding: 4px 8px;
    border-radius: 4px;
    position: absolute;
    transition: opacity 0.3s;
    z-index: 99;
    white-space: nowrap;
} */

/* Position par défaut : au-dessus */
/* .tooltip-top .tooltip-text {
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
} */

/* .tooltip-top .tooltip-text::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #333 transparent transparent transparent;
} */

/* À gauche */
/* .tooltip-left .tooltip-text {
    top: 50%;
    right: 125%;
    transform: translateY(-50%);
}

.tooltip-left .tooltip-text::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent transparent #333;
} */

/* À droite */
/* .tooltip-right .tooltip-text {
    top: 50%;
    left: 125%;
    transform: translateY(-50%);
}

.tooltip-right .tooltip-text::after {
    content: "";
    position: absolute;
    top: 50%;
    right: 100%;
    margin-top: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent #333 transparent transparent;
} */

/* En dessous */
/* .tooltip-bottom .tooltip-text {
    top: 125%;
    left: 50%;
    transform: translateX(-50%);
}

.tooltip-bottom .tooltip-text::after {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: transparent transparent #333 transparent;
} */

/* Affichage au survol */
/* .tooltip:hover .tooltip-text,
.tooltip:focus .tooltip-text {
    visibility: visible;
    opacity: 1;
} */

/* ===== Responsive ===== */
@media (max-width:768px) {

    .back-top {
        bottom: 13em;
        right: 1em;
    }

    .grid-2,
    .grid-3 {
        grid-template-columns: 1fr
    }

    .form {
        grid-template-columns: 1fr
    }

    .form .span-2 {
        grid-column: auto
    }

    .nav {
        display: none;
        font-size: 1em;
    }
}

/* Icône hamburger */
.menu-toggle {
    display: none;
    /* caché par défaut */
    font-size: 1.8em;
    cursor: pointer;
    background: none;
    border: none;
    color: #424242;
}

/* Icône hamburger fiable (3 barres en CSS, pas de caractère unicode) */
.menu-toggle {
    display: none;
    /* visible seulement en mobile */
    position: relative;
    width: 34px;
    height: 24px;
    margin-left: auto;
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
    z-index: 11;
    /* au-dessus du fond du menu */
}

/* Hamburger équilibré (3 barres, espacements égaux) */
.menu-toggle {
    display: none;
    /* visible seulement en mobile */
    position: relative;
    width: 34px;
    height: 26px;
    /* ← hauteur choisie pour une répartition parfaite */
    margin-left: auto;
    background: none;
    border: 0;
    padding: 0;
    color: #424242;
    /* currentColor utilisé pour les barres */
    cursor: pointer;
    z-index: 11;
}

.menu-toggle span {
    /* libellé accessible, visuellement masqué */
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    border: 0;
    padding: 0;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    overflow: hidden;
    white-space: nowrap;
}

.menu-toggle::before,
.menu-toggle::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    height: 2px;
    /* épaisseur des barres */
    background: currentColor;
    border-radius: 1px;
}

/* barres : top + middle via box-shadow, puis bottom */
.menu-toggle::before {
    top: 5px;
    /* marge haute = 5px */
    /* offset middle = épaisseur(2) + gap(5) = 7px → 5 + 7 = 12 */
    box-shadow: 0 7px 0 0 currentColor;
}

.menu-toggle::after {
    bottom: 5px;
    /* marge basse = 5px */
}

.image-scroll {
    opacity: 0;
    transform: translateY(1em);
    transition: transform 1.5s ease-out, opacity 3s ease-out;
}

.image-scroll.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: transform, opacity;
}

.text-scroll {
    opacity: 0;
    transform: translateY(1em);
    transition: transform 0.8s ease-out, opacity 0.8s ease-out;
}

.text-scroll.visible {
    opacity: 1;
    transform: translateY(0);
    will-change: transform, opacity;
}

/* Mobile : afficher hamburger à droite du logo */
@media (max-width: 980px) {

    .menu-toggle {
        display: block;
    }

    /* Menu mobile animé (conserve ton bloc actuel) */
    .nav {
        display: flex;
        flex-direction: column;
        position: absolute;
        top: 100%;
        right: 0;
        width: 75vw;
        max-width: 300px;
        background: #fff;
        border: 1px solid #eee;
        box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
        opacity: 0;
        transform: translateY(-8px) scaleY(.98);
        transform-origin: top;
        max-height: 0;
        overflow: hidden;
        pointer-events: none;
        visibility: hidden;
        transition: opacity .22s ease, transform .22s ease, max-height .28s ease, visibility 0s linear .22s;
    }

    .nav.open {
        opacity: 1;
        transform: translateY(0) scaleY(1);
        max-height: 70vh;
        pointer-events: auto;
        visibility: visible;
        transition: opacity .22s, transform .22s, max-height .32s, visibility 0s;
    }

    .nav a {
        padding: .75em 1em;
        border-bottom: 1px solid #f3f3f3;
        opacity: 0;
        transform: translateX(-6px);
        transition: opacity .18s ease, transform .18s ease;
        text-decoration: none;
    }

    .nav.open a {
        opacity: 1;
        transform: none;
    }

    .nav.open a:nth-child(1) {
        transition-delay: .05s;
    }

    .nav.open a:nth-child(2) {
        transition-delay: .09s;
    }

    .nav.open a:nth-child(3) {
        transition-delay: .13s;
    }

    .nav.open a:nth-child(4) {
        transition-delay: .17s;
    }

    .nav.open a:nth-child(5) {
        transition-delay: .21s;
    }

    .nav.open a:nth-child(6) {
        transition-delay: .25s;
    }

    .hero::before {
        background-position: center 20%;
        background-size: cover;
        background-attachment: scroll;
    }

    /* Texte plus compact */
    .hero-text h1 {
        font-size: clamp(1.15rem, 5.8vw, 1.6rem);
        line-height: 1.25;
        margin: 0;
        text-shadow:
            0 0 4px rgba(0, 0, 0, 0.7),
            0 0 8px rgba(0, 0, 0, 0.6),
            0 0 12px rgba(0, 0, 0, 0.5);
        /* multi-couches pour contraster sur clair ou sombre */
        color: #fff;
    }

    .hero-text {
        display: grid;
        place-items: center;
    }
}


.hero {
    min-height: 70em;
    /* Très grand écran par défaut */
}

@media (max-width: 1919px) {

    /* Écran < 1920px */
    .hero {
        min-height: 37em;
    }

    /* Écran 15" ou équivalent */
}

@media (max-width: 1439px) {

    /* < 1440px */
    .hero {
        min-height: 40em;
    }

    /* iPad Air paysage */
}

@media (max-width: 1179px) and (orientation: landscape) {

    /* < 1180px paysage */
    .hero {
        min-height: 40em;
    }
}

@media (max-width: 819px) and (orientation: portrait) {

    /* iPad Air portrait */
    .hero {
        min-height: 30em;
    }
}

@media (max-width: 844px) and (orientation: landscape) {

    /* iPhone 12 Pro paysage */
    .hero {
        min-height: 28em;
    }
}

@media (max-width: 389px) {

    /* iPhone 12 Pro portrait */
    .hero {
        min-height: 18em;
    }
}