/* assets/css/galerija.css */

/* --- DIZAINS (DARK MODE) --- */
:root {
    --bg-color: #121212; 
    --card-bg: #1e1e1e;
    --text-color: #e0e0e0;
    --accent-color: #4dabf7;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Atstarpe augšā, lai fiksētā izvēlne nenosegtu virsrakstu */
    padding-top: 100px; 
}

/* --- IZVĒLNES STILS (Specifiski šai lapai) --- */
#mainNav {
    background-color: #000; /* Melns fons, lai saplūst */
    box-shadow: 0 2px 10px rgba(255,255,255,0.05);
}

header {
    max-width: 1200px;
    margin: 0 auto 40px auto;
    text-align: center;
}

h1 {
    font-size: 2.5rem;
    color: #ffffff;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

p.intro {
    max-width: 700px;
    margin: 0 auto;
    color: #a0a0a0;
    font-size: 1.1rem;
}

/* --- KONTAKTU STILS --- */
.header-contacts {
    margin-top: 25px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap; 
}

.contact-label {
    color: #a0a0a0;
    font-size: 1rem;
    font-weight: 600;
}

.contact-link {
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 50px; 
    font-weight: bold;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-block;
}

.email-btn {
    background-color: #333;
    color: #fff;
    border: 1px solid #555;
}

.phone-btn {
    background-color: var(--accent-color); 
    color: #000; 
}

.contact-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(77, 171, 247, 0.4); 
}

/* --- GALERIJAS GRID --- */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    max-width: 1400px;
    margin: 0 auto;
}

.gallery-item {
    position: relative;
    background: var(--card-bg);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    aspect-ratio: 1 / 1;
    box-shadow: 0 4px 15px rgba(0,0,0,0.5); 
    border: 1px solid #333;
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.gallery-item:hover {
    transform: translateY(-5px);
    border-color: #666;
    box-shadow: 0 10px 30px rgba(0,0,0,0.7);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-item img.loaded {
    opacity: 1;
}

.overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 15px;
    background: linear-gradient(transparent, rgba(0,0,0,0.9));
    color: white;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    box-sizing: border-box;
}

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

/* --- LIGHTBOX (LABOTS Z-INDEX) --- */
#lightbox {
    display: none;
    position: fixed;
    /* SVARĪGI: Šis skaitlis ir lielāks par Bootstrap Menu (1030) */
    z-index: 10000; 
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(0,0,0,0.98); /* Gandrīz pilnīgi melns fons */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    opacity: 0;
    transition: opacity 0.3s;
}

#lightbox.active {
    display: flex;
    opacity: 1;
}

.lightbox-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 90%;
    max-height: 85%;
}

#lightbox img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: 4px;
    box-shadow: 0 0 50px rgba(0,0,0,0.8);
}

#lightbox-caption {
    color: #ddd;
    margin-top: 10px;
    font-size: 1.1rem;
    text-align: center;
    max-width: 80%;
}

/* Aizvēršanas poga - X stūrī */
.close-btn {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    cursor: pointer;
    transition: color 0.2s;
    /* Jābūt augstākam par lightbox (10000) */
    z-index: 10002; 
}
.close-btn:hover { color: #ccc; }

/* Navigācijas bultiņas */
.nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 50px;
    font-weight: bold;
    padding: 20px;
    cursor: pointer;
    user-select: none;
    /* Jābūt augstākam par lightbox */
    z-index: 10001; 
    background-color: rgba(0, 0, 0, 0.3);
    border-radius: 5px;
    transition: background 0.3s ease;
}

.nav-btn:hover { background-color: rgba(0, 0, 0, 0.8); }
.prev-btn { left: 10px; }
.next-btn { right: 10px; }

@media (max-width: 768px) {
    .nav-btn {
        font-size: 30px;
        padding: 15px;
        background-color: rgba(0, 0, 0, 0.1); 
    }
}

.counter {
    position: absolute;
    top: 20px;
    left: 20px;
    color: #a0a0a0;
    font-size: 14px;
    font-family: sans-serif;
    z-index: 10001;
}

/* --- LIGHTBOX CTA POGAS --- */
.lightbox-cta {
    margin-top: 15px;
    text-align: center;
    background: transparent; 
    padding: 0;
    pointer-events: auto;
}

.cta-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.cta-btn {
    text-decoration: none;
    padding: 10px 20px;
    font-size: 0.9rem; 
    font-weight: 500;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-radius: 50px; 
    background-color: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cta-btn:hover {
    background-color: #fff;
    color: #000;
    border-color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 255, 255, 0.15);
}

.cta-btn.phone::before { content: "📞"; font-size: 0.8rem; }
.cta-btn.email::before { content: "✉️"; font-size: 0.9rem; }

@media (max-width: 600px) {
    .cta-buttons { gap: 10px; }
    .cta-btn { padding: 8px 14px; font-size: 0.75rem; flex: 1; justify-content: center; }
}