.gallery-section {
    padding: 40px 0;
    background-color: #f8f9fa;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
}

.section-title {
    position: relative;
    display: block;
    font-size: 36px;
    line-height: 1.2em;
    font-weight: 700;
    margin: 0px;
    color: #222;
}

@media (max-width: 991px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .gallery-grid {
        grid-template-columns: 1fr;
    }
}

.gallery-card {
    background: #fff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
}

.gallery-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.gallery-card .card-img {
    position: relative;
    height: 260px;
    overflow: hidden;
}

.gallery-card .card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.gallery-card:hover .card-img img {
    transform: scale(1.08);
}

.gallery-card .photo-count-badge {
    display: inline-block;
    background: #f1f1f1;
    color: #666;
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 12px;
    width: fit-content;
}

.gallery-card .card-content {
    padding: 25px;
    text-align: left;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gallery-card h4 {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 8px;
    transition: color 0.3s ease;
}

.gallery-card:hover h4 {
    color: var(--site-color);
}

.gallery-card p {
    font-size: 15px;
    color: #555;
    margin-bottom: 25px;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gallery-card .btn-view {
    margin-top: auto;
    background: var(--site-color-dark);
    color: #fff;
    padding: 12px 25px;
    border-radius: 20px;
    font-weight: 600;
    font-size: 14px;
    text-transform: none;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    gap: 10px;
}

.gallery-card .btn-view:hover {
    background: var(--site-color);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    color: #fff;
}

.gallery-detail-header {
    background: #fff;
    padding: 40px 0 40px;
    text-align: left;
}

.gallery-detail-header h2 {
    font-size: 36px;
    font-weight: 800;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.gallery-detail-header .detail-photo-count {
    font-size: 16px;
    color: var(--site-color);
    font-weight: 600;
    margin-bottom: 20px;
    display: block;
}

.gallery-detail-header p {
    font-size: 16px;
    color: #444;
    line-height: 1.8;
    width: 100%;
}

.gallery-images-grid {
    padding: 40px 0 80px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.gallery-images-grid.link_container {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

.gallery-images-grid.link_container .gallery-item a.overlay {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
}


@media (max-width: 991px) {
    .gallery-images-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 767px) {
    .gallery-images-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.gallery-item {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    height: 240px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    cursor: pointer;
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.5s ease;
    pointer-events: none;
}

.gallery-item:hover img {
    transform: scale(1.1);
}

.gallery-item .overlay {
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 1;
    z-index: 10;
}

.gallery-item .overlay i {
    background: var(--site-color);
    color: #fff;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    font-size: 16px;
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none !important;
    transform: none !important;
    filter: none !important;
    font-weight: 400 !important;
}

.gallery-item:hover .overlay i {
    transform: none !important;
    filter: none !important;
    font-weight: 400 !important;
}

.gallery-item .overlay::before,
.gallery-item .overlay::after,
.gallery-item a::before,
.gallery-item a::after {
    content: none !important;
    display: none !important;
}

.gallery-item .overlay {
    background: transparent !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    transform: none !important;
    animation: none !important;
}

.image_popup::before,
.image_popup::after {
    display: none !important;
    content: none !important;
}

.gallery-item .overlay i {
    transform: none !important;
    font-weight: normal !important;
    filter: none !important;
    transition: opacity 0.25s ease !important;
}