*{box-sizing:border-box}
body{margin:0;font-family:system-ui,sans-serif;color:#222;background:#fff}

.site-header,main{max-width:1200px;margin:auto;padding:24px}
.site-header{padding-bottom:8px}

.site-header img{
    width:250px;
    height:auto;
    display:block;
}

.titre-seo {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 12px;
}

.intro-seo {
    margin: 0 0 16px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.reference-seo {
    margin: -10px 0 20px;
    font-size: 0.95rem;
    font-style: italic;
}

.mosaique{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:20px
}

.carte-annonce{
    display:block;
    color:inherit;
    text-decoration:none;
    border:1px solid #ddd
}

.carte-photo {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: #eee;
}

.carte-infos{
    padding:14px;
    display:flex;
    gap:12px;
    flex-wrap:wrap
}

.fiche-annonce{max-width:1200px;margin:auto}

.galerie{
    display:grid;
    grid-template-columns:repeat(3,1fr);
    gap:12px;
    margin:24px 0
}

.galerie img{
    width:100%;
    aspect-ratio:4/3;
    object-fit:cover;
    background:#eee
}

dt{font-weight:700;margin-top:12px}
dd{margin:2px 0}
.filtres{margin:15px 0}

.filtre-grid{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:14px
}

.filtres form{
    border:1px solid #9BD89E;
    padding:18px;
    background:#E5F4E2
}

.filtres label{
    display:grid;
    gap:6px
}

.filtres input,
.filtres select{
    padding:9px;
    font:inherit;
    background:#fff;
    border:1px solid #9BD89E
}

.filtre-actions{
    display:flex;
    gap:10px;
    margin-top:15px
}

.filtre-actions button{
    border:1px solid #9BD89E;
    background:#9BD89E;
    color:#222;
    cursor:pointer
}

.filtre-actions button:hover{
    background:#E5F4E2
}

.carte-photo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dossier-annonce {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 3px solid #9BD89E;
}

.dossier-annonce a{font-weight:600}

.compteur{font-weight:600}
.filtres{margin-bottom:24px}

.carte-annonce:hover{
    box-shadow:0 3px 12px rgba(0,0,0,.08)
}

@media(max-width:800px){
    .mosaique{
        grid-template-columns:repeat(2,minmax(0,1fr))
    }

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

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

@media(max-width:520px){
    .mosaique,.galerie{
        grid-template-columns:1fr
    }

    .site-header,main{
        padding:16px
    }

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

/* Visionneuse des photos */
.photo-galerie {
    display: block;
    width: 100%;
    padding: 0;
    margin: 0;
    border: 0;
    background: none;
    cursor: pointer;
}

.photo-galerie img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}


/* Fenêtre d'affichage en grand */
.visionneuse {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.88);
    align-items: center;
    justify-content: center;
    padding: 60px 80px;
}

.visionneuse.ouverte {
    display: flex;
}


/* Grande photo */
.visionneuse-image {
    display: block;
    max-width: 90vw;
    max-height: 88vh;
    width: auto;
    height: auto;
    object-fit: contain;
}


/* Croix */
.visionneuse-fermer {
    position: fixed;
    top: 20px;
    right: 25px;
    z-index: 10001;
    width: 45px;
    height: 45px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    font-size: 42px;
    line-height: 42px;
    cursor: pointer;
}


/* Flèches */
.visionneuse-precedent,
.visionneuse-suivant {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10001;
    width: 55px;
    height: 70px;
    padding: 0;
    border: 0;
    background: rgba(0, 0, 0, 0.35);
    color: #fff;
    font-size: 55px;
    line-height: 60px;
    cursor: pointer;
}

.visionneuse-precedent {
    left: 20px;
}

.visionneuse-suivant {
    right: 20px;
}


/* Empêche la page derrière de défiler */
body.visionneuse-ouverte {
    overflow: hidden;
}

/* Légende de la photo en grand */
#visionneuse-legende {
    position: absolute;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);

    z-index: 10002;

    display: block;
    max-width: 80%;

    padding: 8px 14px;

    color: #fff;
    background: rgba(0, 0, 0, 0.75);

    font-size: 16px;
    line-height: 1.4;
    text-align: center;

    border-radius: 4px;
}

/* Adaptation téléphone */
@media (max-width: 600px) {

    .visionneuse {
        padding: 50px 45px;
    }

    .visionneuse-image {
        max-width: 95vw;
        max-height: 85vh;
    }

    .visionneuse-fermer {
        top: 10px;
        right: 12px;
        width: 40px;
        height: 40px;
        font-size: 36px;
    }

    .visionneuse-precedent,
    .visionneuse-suivant {
        width: 40px;
        height: 55px;
        font-size: 42px;
        line-height: 50px;
    }

    .visionneuse-precedent {
        left: 5px;
    }

    .visionneuse-suivant {
        right: 5px;
    }
}

/* =========================================================
   Fiche annonce publique
   ========================================================= */

.fiche-annonce > section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 3px solid #9BD89E;
}

.fiche-annonce > section:first-of-type {
    margin-top: 24px;
}


/* Titres des rubriques */

.fiche-annonce > section h2 {
    margin: 0 0 20px;
}


/* Informations générales */

.fiche-annonce > section dl {
    margin: 0;
}

.fiche-annonce > section dt {
    margin-top: 14px;
    font-weight: 700;
}

.fiche-annonce > section dt:first-child {
    margin-top: 0;
}

.fiche-annonce > section dd {
    margin: 4px 0 0;
}


/* Tableau des conditions financières */

.conditions-financieres {
    width: 100%;
    border-collapse: collapse;
    margin-top: 8px;
}

.conditions-financieres th,
.conditions-financieres td {
    padding: 12px 16px;
    text-align: left;
    vertical-align: middle;
    border-bottom: 1px solid #ddd;
}

.conditions-financieres th {
    font-weight: 700;
    background: #E5F4E2;
}

.conditions-financieres th:first-child,
.conditions-financieres td:first-child {
    width: 55%;
}

.conditions-financieres th:nth-child(2),
.conditions-financieres td:nth-child(2) {
    width: 20%;
    white-space: nowrap;
}

.conditions-financieres th:nth-child(3),
.conditions-financieres td:nth-child(3) {
    width: 25%;
}


/* Documents */

.dossier-annonce ul {
    margin: 0;
    padding-left: 20px;
}

.dossier-annonce li {
    margin-bottom: 10px;
}


/* Affichage mobile */

@media (max-width: 600px) {

    .fiche-annonce > section {
        margin-top: 28px;
        padding-top: 20px;
    }

    .conditions-financieres th,
    .conditions-financieres td {
        padding: 10px 8px;
    }

    .conditions-financieres th:first-child,
    .conditions-financieres td:first-child {
        width: 50%;
    }

    .conditions-financieres th:nth-child(2),
    .conditions-financieres td:nth-child(2) {
        width: 25%;
    }

    .conditions-financieres th:nth-child(3),
    .conditions-financieres td:nth-child(3) {
        width: 25%;
    }

}

.fiche-annonce > section.reference-annonce {
    border-top: none;
    padding-top: 0;
    margin-top: 24px;
}

.site-footer {
    width: 100%;
    padding: 10px 24px 24px;
    text-align: right;
    font-size: 13px;
    color: #222;
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 10;
}

/* Téléphone */
@media (max-width: 600px) {

    .site-footer {
        position: static;
        width: 100%;
        margin-top: 20px;
        padding: 10px 24px 24px;
        text-align: right;
    }

}