/* DP Visit — cartes d'établissement (accueil, recherche). Copie du style de index.php. */
/* GRID */
.places-grid {
    display: grid;
    gap: 15px;
}

@media(max-width:768px) {
    .places-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 9px; /* gap légèrement réduit = cards plus larges */
    }
    .header h1 {
        font-size: 2.2rem;
    }
    .header p {
        font-size: 1.05rem;
    }
}

@media(min-width:769px) {
    .places-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
    .section-title {
        text-align: center;
        font-size: 1.8rem !important;
        margin-bottom: 25px !important;
    }
}

/* ===========================================
   PLACE CARD — Full-image, zéro overflow
   =========================================== */

/* Carte principale */
.place-card {
    border-radius: 16px;
    overflow: hidden;           /* CLIPPE TOUT */
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(0,0,0,0.06);
    height: 250px;              /* Desktop */
    position: relative;
    display: block;             /* block, pas flex */
    background: #1a1a2e;        /* Fond foncé visible si image manquante */
}

@media(max-width:768px) {
    .place-card { height: 270px; } /* Mobile : agrandi pour un meilleur rendu visuel */
}

.place-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 32px rgba(0,0,0,0.14);
}

/* Image — couvre toute la carte */
.place-card-img-wrap {
    position: absolute;
    inset: 0;                   /* top/right/bottom/left = 0 */
    z-index: 1;
}

.place-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.place-card:hover img { transform: scale(1.05); }

/* Overlay glassmorphism léger */
.place-card-img-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to top,
        rgba(0,0,0,0.72) 0%,
        rgba(0,0,0,0.30) 45%,
        rgba(0,0,0,0.00) 100%
    );
    z-index: 2;
}

/* Zone infos — positionnée avec inset pour éviter tout overflow */
.place-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;                   /* right:0 au lieu de width:100% — critique */
    z-index: 10;
    padding: 0 9px 9px;
    box-sizing: border-box;
    overflow: hidden;           /* CLIPPE les enfants */
    display: flex;
    flex-direction: column;
    gap: 3px;
}

/* Ligne 1 : nom + rating */
.place-header-row {
    display: flex;
    align-items: flex-end;
    gap: 5px;
    overflow: hidden;           /* empêche le rating de déborder */
    width: 100%;
    box-sizing: border-box;
}

.place-name {
    font-weight: 800;
    font-size: 0.88rem;
    color: white;
    letter-spacing: -0.2px;
    line-height: 1.25;
    /* 2 lignes max sur mobile ET desktop */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

@media(min-width:769px) {
    .place-name {
        font-size: 0.95rem;
    }
}

.place-rating {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;             /* ne rétrécit JAMAIS */
    white-space: nowrap;
    font-size: 0.7rem;
    font-weight: 700;
    color: white;
    background: rgba(0,0,0,0.45);
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    padding: 2px 5px;
    border-radius: 8px;
    line-height: 1;
}
.place-rating i { color: #fbbf24; font-size: 0.65rem; }

/* Ligne 2 : localisation — 2 lignes max */
.place-location {
    font-size: 0.7rem;
    color: rgba(255,255,255,0.85);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    gap: 3px;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    line-height: 1.3;
    word-break: break-word;
}
.place-location i { flex-shrink: 0; font-size: 0.6rem; opacity: 0.75; }

/* Ligne 3 : catégories + vues */
.place-cats {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: nowrap;  /* Une seule ligne, pas de retour à la ligne */
    width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    min-width: 0;
}

.place-cat-badge {
    display: inline-block;
    background: rgba(255,255,255,0.20);
    border: 1px solid rgba(255,255,255,0.30);
    color: white;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 2px 7px;
    border-radius: 8px;
    font-size: 0.6rem;
    font-weight: 700;
    white-space: nowrap;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    /* Par défaut (desktop) : aucune limite = texte complet affiché */
    max-width: none;
    flex-shrink: 0;
}

/* Sur mobile : le 1er badge garde sa taille, le 2ème peut être tronqué */
@media(max-width:768px) {
    .place-cat-badge {
        font-size: 0.58rem;
        /* Le 1er badge est prioritaire — flex-shrink:0 + max-width généreux */
        max-width: 90px;
    }
    /* 2e badge : peut se tronquer si nécessaire */
    .place-cat-badge:nth-child(2) {
        flex-shrink: 1;
        max-width: 70px;
    }
    /* 3e badge (distance en mode proximité) */
    .place-cat-badge:nth-child(3) {
        flex-shrink: 1;
        max-width: 60px;
    }
}

.place-views-badge {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    margin-left: auto;
    flex-shrink: 0;             /* ne rétrécit JAMAIS */
    white-space: nowrap;
    font-size: 0.62rem;
    font-weight: 700;
    color: white;
    background: rgba(0,0,0,0.40);
    border: 1px solid rgba(255,255,255,0.18);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 1px 5px;
    border-radius: 8px;
    line-height: 1.4;
}

.place-dist { background:#ecfdf5 !important; border-color:#a7f3d0 !important; color:#065f46 !important; }
.place-location i { color:#cbd5db; }
