@charset "utf-8";

/*
 * Pages villes - index /fr/villes et page ville /fr/ville/{slug}.
 * Gabarit commun aux sites du framework (cotepatio2, actifimmo2, espritlandes),
 * recolore a la charte Tout l'Immobilier Landes. Le titre a filet colore reprend
 * l'idiome de la home (home.css), qui n'est chargee que sur l'accueil.
 */

/* ===============================
 *  INDEX DES VILLES - Cartes
 * =============================== */
.ville-card,
.ville-card:link,
.ville-card:visited {
    display: flex;
    flex-direction: column;
    height: 100%;
    border: 1px solid var(--neutral-light);
    border-radius: var(--radius-sm);
    overflow: hidden;
    color: inherit;
    text-decoration: none;
    transition: box-shadow var(--transition-base), transform var(--transition-base);
}

.ville-card:hover,
.ville-card:focus {
    box-shadow: 0 6px 18px rgb(0 0 0 / 12%);
    transform: translateY(-2px);
    color: inherit;
}

.ville-card__photo {
    aspect-ratio: 3 / 2;
    background: var(--neutral-light);
    overflow: hidden;
}

.ville-card__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--transition-medium);
}

.ville-card:hover .ville-card__photo img {
    transform: scale(1.04);
}

.ville-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--space-3);
}

.ville-card__name {
    font-size: 1.25rem;
    text-transform: none;
    margin-bottom: var(--space-1);
    color: var(--primary-main);
}

.ville-card__location {
    font-size: .875rem;
    color: var(--neutral-dark);
    margin-bottom: var(--space-2);
}

.ville-card__badges {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
    margin-top: auto;
}

.ville-badge {
    display: inline-block;
    font-size: .75rem;
    font-weight: var(--fw-bold);
    padding: .2rem .6rem;
    border-radius: var(--radius-lg);
    line-height: 1.4;
}

.ville-badge--vente {
    background: var(--focus-x-light);
    color: var(--focus-2x-dark);
}

.ville-badge--location {
    background: var(--primary-x-light);
    color: var(--primary-x-dark);
}

/* ===============================
 *  PAGE VILLE - Photo + carte
 * =============================== */
.ville-hero {
    display: grid;
    grid-template-columns: 1fr;
    gap: .75rem;
    margin-bottom: var(--space-4);
}

.ville-hero-photo,
.ville-hero-map {
    border-radius: var(--radius-sm);
    overflow: hidden;
    /* Cadre les deux blocs a la meme hauteur : sans cela la photo impose sa
       hauteur naturelle et la carte laisse un vide sous elle. */
    aspect-ratio: 3 / 2;
    min-height: 220px;
}

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

.ville-map-iframe {
    border: 0;
    width: 100%;
    height: 100%;
    min-height: 220px;
    display: block;
}

/* ===============================
 *  PAGE VILLE - Texte editorial
 * =============================== */
.ville-description {
    margin-bottom: 0;
}

/* Troncature mobile */
@media screen and (max-width: 991.98px) {
    .ville-description--collapsed {
        position: relative;
        max-height: 120dvh;
        overflow: hidden;
    }

    .ville-description--collapsed::after {
        content: "";
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        height: 80px;
        background: linear-gradient(to top, var(--bg-body) 10%, transparent);
        pointer-events: none;
    }
}

.ville-description-toggle {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    font-size: .813rem;
    font-weight: var(--fw-bold);
    color: var(--primary-dark);
    background: none;
    border: 0;
    padding: .25rem 0;
    margin-top: -2.5rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: color var(--transition-base);
}

.ville-description-toggle:hover {
    color: var(--primary-x-dark);
}

/* ===============================
 *  PAGE VILLE - Recapitulatif
 * =============================== */
.ville-sidebar {
    background: var(--primary-x-light);
    border-radius: var(--radius-sm);
    padding: var(--space-4);
}

.ville-sidebar-title {
    text-transform: none;
    margin-bottom: var(--space-3);
}

.ville-sidebar-stats {
    display: flex;
    gap: .75rem;
    margin-bottom: var(--space-3);
}

.ville-stat {
    flex: 1;
    /* Sans texte editorial le recapitulatif passe pleine largeur : les deux
       compteurs ne doivent pas s'etirer sur 700 px. */
    max-width: 240px;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem .75rem;
    background: #FFF;
    border-radius: var(--radius-xs);
    text-decoration: none;
    color: inherit;
    transition: box-shadow var(--transition-base);
}

.ville-stat:hover {
    box-shadow: 0 4px 12px rgb(0 0 0 / 10%);
    color: inherit;
}

.ville-stat-count {
    font-size: 1.75rem;
    font-weight: var(--fw-bold);
    color: var(--primary-dark);
    line-height: 1;
}

.ville-stat-label {
    font-size: .75rem;
    color: var(--neutral-dark);
    margin-top: .35rem;
    text-align: center;
}

.ville-sidebar-empty {
    font-size: .875rem;
    margin-bottom: 0;
}

.ville-sidebar-links {
    display: flex;
    flex-wrap: wrap;
    gap: .4rem;
}

/* ===============================
 *  PAGE VILLE - Listings et voir aussi
 * =============================== */
.ville-listing,
.ville-voir-aussi {
    margin-bottom: var(--space-5);
}

.ville-listing h2.title,
.ville-voir-aussi h2.title {
    padding-bottom: var(--space-3);
    border-bottom: 1px solid var(--neutral-light);
    text-transform: none;
}

.ville-listing h2.title.orange {
    color: var(--focus-main);
    border-color: var(--focus-main);
}

.ville-listing h2.title.vert {
    color: var(--success-main);
    border-color: var(--success-main);
}

.ville-voir-aussi h2.title.bleu {
    color: var(--primary-main);
    border-color: var(--primary-main);
}

.ville-voir-aussi-links {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

/* ===============================
 *  PAGE VILLE - Contenu SEO secondaire
 * =============================== */
.ville-seo {
    background: var(--neutral-x-light);
    border-radius: var(--radius-sm);
    padding: var(--space-4) var(--space-3);
    border: 1px solid var(--neutral-light);
}

.ville-seo h2 {
    font-size: clamp(16px, 1.4vw, 20px);
    text-transform: none;
    color: var(--primary-dark);
    margin-top: var(--space-4);
    margin-bottom: var(--space-2);
}

.ville-seo h2:first-child {
    margin-top: 0;
}

.ville-seo p {
    font-size: .875rem;
    line-height: 1.75;
    color: var(--neutral-dark);
    margin-bottom: .75rem;
}

.ville-seo strong {
    color: var(--neutral-black);
}

/* ===============================
 *  RESPONSIVE - Desktop (992px)
 * =============================== */
@media screen and (min-width: 992px) {

    .ville-hero {
        grid-template-columns: 55fr 45fr;
    }

    .ville-hero-photo,
    .ville-hero-map {
        aspect-ratio: auto;
        height: 420px;
    }

    .ville-hero--photo-only,
    .ville-hero--map-only {
        grid-template-columns: 1fr;
    }

    .ville-map-iframe {
        min-height: 420px;
    }

    .ville-sidebar {
        position: sticky;
        top: 140px;
    }

    .ville-seo {
        padding: var(--space-5) var(--space-4);
        columns: 2;
        column-gap: 2.5rem;
    }

    .ville-seo h2 {
        column-span: all;
    }

    .ville-seo p {
        break-inside: avoid;
    }

}
