* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: Verdana, Arial, sans-serif;
    background-color: #79aada;
    background-image: url(../image/page_bg.gif);
    background-repeat: repeat-y;
    background-position: center 0;
    text-align: center;
    color: #333;
    padding: 0 0 20px;
}

.gallery-nav {
    background-color: #244875;
    position: sticky;
    top: 0;
    max-width: 960px;
    width: 100%;
    margin: 0 auto 20px auto;
    z-index: 999;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.gallery-nav-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    padding: 16px 20px;
    position: relative;
    min-height: 56px;
}

.gallery-back-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 18px;
    background-color: #0099CC;
    color: #fff;
    text-decoration: none;
    font-weight: bold;
    font-size: 13px;
    border-radius: 4px;
    flex-shrink: 0;
    z-index: 1;
    transition: background 0.2s;
}

.gallery-back-btn:hover {
    background-color: #3a6ba3;
}

#naslov-albuma {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    white-space: nowrap;
    margin: 0;
    max-width: calc(100% - 120px);
    overflow: hidden;
    text-overflow: ellipsis;
}

.gallery-container {
    max-width: 960px;
    margin: 0 auto;
    background: #ffffff;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: left;
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 96px);
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
    margin: 20px 0;
}

.gallery-item {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    border: 1px solid #ccc;
    transition: transform 0.2s, box-shadow 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.gallery-item:hover {
    transform: scale(1.03);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin: 28px 0;
}

.pagination a, .pagination span {
    padding: 12px 18px;
    text-decoration: none;
    border: 1px solid #ccc;
    color: #244875;
    font-weight: bold;
    font-size: 15px;
    border-radius: 6px;
    cursor: pointer;
    min-width: 46px;
    text-align: center;
    transition: background 0.2s, color 0.2s;
}

.pagination a:hover {
    background-color: #3a6ba3;
    color: #fff;
    border-color: #3a6ba3;
}

.pagination .active-page {
    background-color: #0099CC;
    color: #fff;
    border-color: #0099CC;
    font-size: 16px;
}

.pagination .disabled {
    color: #ccc !important;
    border-color: #eee !important;
    cursor: not-allowed !important;
    background: none !important;
}

.lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    justify-content: space-between;
    align-items: center;
    padding: 0 20px;
}

body.lightbox-open {
    overflow: hidden;
}

.lightbox-frame {
    width: 80%;
    height: 85%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #000;
    box-shadow: 0 0 20px rgba(255,255,255,0.2);
}

.lightbox-content {
    max-width: 100%;
    max-height: 100%;
    display: block;
    user-select: none;
}

@media (max-width: 768px) {
    .lightbox-frame {
        width: 85%;
        height: 80%;
    }
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    z-index: 2010;
}

.lightbox-nav {
    color: #fff;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    user-select: none;
    padding: 20px;
    transition: color 0.2s;
    z-index: 2010;
}

.lightbox-nav:hover {
    color: #0099CC;
}

.lightbox-nav.nav-disabled {
    color: #555 !important;
    cursor: not-allowed !important;
    pointer-events: none;
}

@media (max-width: 768px) {
    body {
        padding: 0 0 10px;
    }
    .gallery-nav {
        max-width: 100%;
        margin: 0 0 10px 0;
    }
    .gallery-container .site-footer {
        margin: 24px -15px -15px;
        border-radius: 0;
    }
    .gallery-nav-inner {
        padding: 14px 15px;
        min-height: 50px;
    }
    .gallery-container {
        margin: 0 10px;
        padding: 15px;
        min-height: calc(100vh - 70px);
    }
    #naslov-albuma {
        font-size: 14px;
        max-width: calc(100% - 100px);
    }
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .gallery-item {
        height: 130px;
    }
    .pagination a, .pagination span {
        padding: 10px 14px;
        font-size: 13px;
        min-width: 40px;
    }
    .lightbox-nav {
        font-size: 35px;
        padding: 10px;
    }
    
}
.gallery-container .site-footer {
    background-color: #1a2a40;
    color: #ffffff;
    width: auto;
    padding: 18px 20px;
    margin: 24px -20px -20px;
    border-radius: 0;
    margin-top: auto;
}

.gallery-container .footer-content {
    max-width: none;
    padding: 0;
}

.gallery-container .site-footer a {
    color: #0099CC;
}
