/* ==========================================================
   Gallery4 – carrousel horizontal pour "Nos logements"
   (adaptation vanilla CSS/JS de gallery4.tsx)
   ========================================================== */

.g4 {
    padding: 4rem 0 3rem;
}

.g4-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}
.g4-head h2 {
    font-size: clamp(1.75rem, 3vw, 2.75rem);
    font-weight: 600;
    margin: 0 0 .75rem;
    color: var(--foreground, #1e293b);
    letter-spacing: -.015em;
}
.g4-head p {
    margin: 0;
    max-width: 32rem;
    color: var(--muted-foreground, #6b7280);
}
.g4-arrows {
    display: flex;
    gap: .5rem;
    flex-shrink: 0;
}
.g4-arrows button {
    width: 40px; height: 40px;
    border-radius: 50%;
    border: 1px solid var(--border, #d1d5db);
    background: transparent;
    color: var(--foreground, #1e293b);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background .15s, color .15s, opacity .15s;
}
.g4-arrows button:hover:not(:disabled) {
    background: var(--accent, #e0e7ff);
}
.g4-arrows button:disabled {
    opacity: .35;
    cursor: not-allowed;
}
@media (max-width: 767px) { .g4-arrows { display: none; } }

.g4-track-wrap {
    width: 100%;
    overflow: hidden;
}
.g4-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 0 5px 2rem;
    scroll-padding-left: 5px;
}
.g4-track::-webkit-scrollbar { display: none; }

.g4-item {
    flex: 0 0 auto;
    width: 320px;
    scroll-snap-align: start;
}
@media (min-width: 1024px) { .g4-item { width: 360px; } }

.g4-card {
    position: relative;
    display: block;
    min-height: 27rem;
    height: 100%;
    border-radius: 14px;
    overflow: hidden;
    text-decoration: none;
    color: #fff;
    box-shadow: 0 8px 24px rgba(0,0,0,.12);
    transition: box-shadow .25s;
}
.g4-card:hover {
    color: #fff;
    box-shadow: 0 14px 36px rgba(0,0,0,.2);
}
.g4-card-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform .4s ease;
}
.g4-card:hover .g4-card-img { transform: scale(1.06); }

.g4-card-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(99, 102, 241, 0) 0%,
        rgba(99, 102, 241, .45) 55%,
        rgba(99, 102, 241, .85) 100%
    );
    mix-blend-mode: multiply;
    pointer-events: none;
}

.g4-card-body {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: #fff;
}
@media (min-width: 768px) { .g4-card-body { padding: 2rem; } }

.g4-card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0 0 .5rem;
    line-height: 1.3;
}
.g4-card-desc {
    font-size: .95rem;
    line-height: 1.45;
    margin: 0 0 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: .95;
}
.g4-card-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: .5rem;
    font-size: .9rem;
}
.g4-card-price {
    font-weight: 700;
    font-size: 1.05rem;
}
.g4-card-more {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    font-weight: 500;
}
.g4-card-more i {
    transition: transform .25s;
}
.g4-card:hover .g4-card-more i { transform: translateX(4px); }

.g4-dots {
    display: flex;
    justify-content: center;
    gap: .5rem;
    margin-top: 1rem;
}
.g4-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    border: 0;
    background: rgba(99, 102, 241, .25);
    cursor: pointer;
    padding: 0;
    transition: background .2s;
}
.g4-dot.is-active { background: var(--primary, #6366f1); }
