/* Carousel Main Wrapper */
.carousel-wrapper {
    width: 100%;
    position: relative;
    cursor: grab;
    display: flex;
    justify-content: center;
}
.carousel-wrapper:active { cursor: grabbing; }
.carousel-container {
    overflow: hidden;
    width: 100%;
    max-width: 1160px; 
    padding: 50px 0;
}
.carousel-track {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    will-change: transform;
}

/* Card Styles */
.carousel-card {
    flex: 0 0 280px;
    width: 280px;
    transition: opacity 0.4s ease, transform 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    opacity: 0.2; 
    transform: translateY(35px);
    cursor: pointer;
}
.carousel-card.clear-view { opacity: 1; transform: translateY(35px); }
.carousel-card.center-focus { opacity: 1; transform: translateY(0px); }

.card-image-wrapper {
    width: 100%;
    height: 380px;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.03);
}
.card-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    pointer-events: none;
}
.card-info {
    margin-top: 15px;
    padding: 0 5px;
}
.card-info h3 { font-size: 1.2rem; font-weight: 700; color: #111; margin-bottom: 4px; }
.card-info .location { font-size: 0.9rem; color: #777; font-weight: 500; margin-bottom: 2px; }
.card-info .year { font-size: 0.85rem; color: #999; font-weight: 500; }

/* POPUP MODAL WITH DYNAMIC FIXED GALLERY SIZE */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    padding: 20px;
}
.modal-overlay.open { opacity: 1; pointer-events: auto; }
.modal-content {
    background-color: #ffffff;
    width: 100%;
    max-width: 700px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    position: relative;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}
.modal-overlay.open .modal-content { transform: scale(1); }
.modal-close-btn {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.5);
    color: #fff;
    border: none;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}
.modal-scroll-area {
    overflow-y: auto;
    width: 100%;
}
.modal-image-wrapper {
    width: 100%;
    height: 340px;
    position: relative;
    background-color: #f5f5f5;
}
.modal-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease;
}

.modal-gallery-thumbs {
    display: flex;
    gap: 10px;
    padding: 15px 30px 0 30px;
    overflow-x: auto;
}
.thumb-img {
    width: 70px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
    cursor: pointer;
    opacity: 0.5;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.thumb-img.active, .thumb-img:hover {
    opacity: 1;
    border-color: #c5a86d;
}
.modal-body { padding: 20px 30px 30px 30px; }
.modal-title { font-size: 1.5rem; font-weight: 700; color: #000000; margin-bottom: 6px; }
.modal-subtitle { font-size: 0.95rem; color: #666666; font-weight: 500; margin-bottom: 15px; }
.modal-description { font-size: 0.95rem; color: #333333; line-height: 1.6; }

/* Responsive Adjustments */
@media (max-width: 768px) {
    .carousel-container { padding: 30px 0; }
    .carousel-track { gap: 16px; }
    .carousel-card { flex: 0 0 200px; width: 200px; transform: translateY(20px); }
    .carousel-card.clear-view { transform: translateY(20px); }
    .carousel-card.center-focus { transform: translateY(0px); }
    .card-image-wrapper { height: 270px; border-radius: 16px; }
    .modal-image-wrapper { height: 240px; }
    .modal-gallery-thumbs { padding: 12px 20px 0 20px; }
    .modal-body { padding: 15px 20px 20px 20px; }
    .modal-title { font-size: 1.3rem; }
    .thumb-img { width: 60px; height: 45px; }
}
@media (max-width: 480px) {
    .carousel-card { flex: 0 0 160px; width: 160px; }
    .card-image-wrapper { height: 230px; }
}