/* Referentside lehe stiilid */
.main-hero {
    height: 60vh;
}

.gallery-grid-section {
    padding: 80px 0;
    background-color: #f9f9f9;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
}

.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.08);
    text-decoration: none;
    color: white;
    display: block;
    transition: box-shadow 0.3s ease;
}

.gallery-card:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.12);
}

.gallery-card img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: filter 0.4s ease, transform 0.4s ease;
}

.gallery-card:hover img {
    filter: brightness(0.4);
    transform: scale(1.05);
}

.card-title {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
    padding: 30px 20px 15px;
    font-size: 1.4rem;
    font-weight: 700;
    transition: opacity 0.3s ease;
}

.gallery-card:hover .card-title {
    opacity: 0;
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.gallery-card:hover .card-overlay {
    opacity: 1;
}

.overlay-text {
    position: relative;
    color: #fff;
    font-size: 1.2rem;
    font-weight: 700;
    padding: 12px 24px;
    text-align: center;
}

.overlay-text::before,
.overlay-text::after {
    content: '';
    position: absolute;
    width: 15px;
    height: 15px;
    border: 2px solid #fff;
    transition: all 0.3s ease;
}

.overlay-text::before {
    top: 5px;
    left: 10px;
    border-right: none;
    border-bottom: none;
}

.overlay-text::after {
    bottom: 5px;
    right: 10px;
    border-left: none;
    border-top: none;
}

/* Popup galerii stiilid */
.gallery-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.gallery-popup.show {
    display: flex;
}

.popup-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 80%;
    background-color: #111;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.4);
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 30px;
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2001;
    transition: color 0.3s;
}

.close-btn:hover {
    color: #bbb;
}

.popup-slider {
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.popup-slider .slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.6s ease-in-out;
}

.popup-slider .slide.active {
    opacity: 1;
}

.popup-slider .slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 'contain' sobib paremini popupi jaoks */
}

/* Noolte ja täppide stiilid (kasutame index.css omasid) */
.popup-content .slider-btn {
    color: white;
    font-size: 3.5rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.7);
}

.popup-content .slider-dots {
    bottom: 25px;
}
