@font-face {
    font-family: 'MyMontserrat';
    src: url(Montserrat-SemiBold.woff2) format('woff2');
}

body {
    background-color: #ecd9c8;
    font-family: 'MyMontserrat', sans-serif;
    margin: 30px;
    padding: 30px;
}

h1, h2, p {
    margin: 4px;
    margin-top: 50px;
    text-align: center;
}

/* ── NAV ── */

nav {
    background-color: transparent;
    padding: 10px 20px;
}

ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-left, .nav-right {
    gap: 15px;
    flex: 1;
    display: flex;
    align-items: center;
}

.nav-center {
    display: flex;
    gap: 15px;
}

.nav-right {
    justify-content: flex-end;
}

/* BRĪDINĀJUMA BOXIŅŠ */
.alert {
    padding: 20px;
    background-color: #f3594e;
    color: black;
    margin-bottom: 15px;
}
.good-alert {
    padding: 20px;
    background-color: #53ec45;
    color: black;
    margin-bottom: 15px;
}

/* BRĪDINĀJUMA BOXIŅA AIZVĒRT POGA */
.closebtn {
    margin-left: 15px;
    color: black;
    font-weight: bold;
    float: right;
    font-size: 22px;
    line-height: 20px;
    cursor: pointer;
    transition: 0.3s;
}
.closebtn:hover {
    color: white;
}

ul li a {
    display: block;
    border-radius: 50px;
    color: #000000;
    padding: 10px 15px;
    text-decoration: none;
    background-color: #eccbc8;
    transition: 0.3s;
}

ul li a:hover {
    background-color: #ce8374;
    color: white;
}

.pressedbtn {
    background-color: #ce8374 !important;
    color: white !important;
}

.no-button {
    background-color: #ecd9c8;
    color: black;
}
.no-button:hover {
    background-color: #ecd9c8;
    color: black;
}

/* ── LOGO ── */

.logo {
    width: 120px;
    height: auto;
    cursor: pointer;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.2);
}

.small-icon {
    height: auto;
}

.datetime-panel {
    text-align: center;
}

hr {
    display: block;
    height: 1px;
    border: 0;
    border-top: 1px solid #d1c0b2;
    margin: 1em 0;
    padding: 0;
}

/* ── GALERIJA ── */

.random-darbs {
    width: 100%;
    height: auto;
    box-shadow: 0px 0px 7px 7px darkgrey;
    transition: transform 0.2s ease;
    margin-left: auto;
    margin-right: auto;
    display: block;
    cursor: pointer;
    border-radius: 10px;
}

.random-darbs:hover {
    transform: scale(0.98);
}

.gallery {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    padding: 0 4px;
    align-items: flex-start;
}

.gallery-col {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.gallery-col img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    box-shadow: 0px 0px 7px 7px darkgrey;
    transition: transform 0.2s ease;
    cursor: pointer;
}

.gallery-col img:hover {
    transform: scale(0.95);
}

/* ── RESPONSIVE ── */

@media screen and (max-width: 1100px) {
    .gallery-col:nth-child(n+4) { display: none; }
}

@media screen and (max-width: 800px) {
    .gallery-col:nth-child(n+3) { display: none; }
}

@media screen and (max-width: 500px) {
    .gallery-col:nth-child(n+2) { display: none; }

    body {
        margin: 10px;
        padding: 10px;
    }
}

/* ── MODĀLIS ── */

#modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    cursor: pointer;
}

#modal.active {
    display: flex;
}

#modal-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    cursor: default;
    max-width: 95vw;
    max-height: 95vh;
}

#modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    background: rgba(255,255,255,0.15);
    border: none;
    color: #fff;
    font-size: 1.3rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

#modal-close:hover {
    background: rgba(255,255,255,0.35);
}

#modal-img {
    max-width: 90vw;
    max-height: 80vh;
    box-shadow: 0 0 40px rgba(0, 0, 0, 0.6);
    border-radius: 4px;
    animation: modalIn 0.25s ease;
}

#modal-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    text-align: center;
    margin: 0;
}

.caption-author {
    color: #fff;
    font-family: 'MyMontserrat', sans-serif;
    font-size: 1rem;
    letter-spacing: 0.05em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

.caption-details {
    color: #ccc;
    font-family: 'MyMontserrat', sans-serif;
    font-size: 0.8rem;
    letter-spacing: 0.04em;
    text-shadow: 0 1px 4px rgba(0,0,0,0.7);
}

@keyframes modalIn {
    from { transform: scale(0.85); opacity: 0; }
    to   { transform: scale(1);    opacity: 1; }
}


/* Filter Board Area Alignment Wrapper */
.filter-panel {
    display: flex;
    flex-direction: column;
    gap: 15px;
    background: #f5f5f5;
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.filter-group label {
    font-weight: bold;
    font-size: 0.95rem;
}

.filter-group input, .filter-group select {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 4px;
    outline: none;
}

/* Results CSS Grid Layout Framework */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    padding-bottom: 40px;
}

.results-grid img.darbs {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 4px;
    cursor: pointer;
    transition: transform 0.2s, opacity 0.2s;
}

.results-grid img.darbs:hover {
    transform: scale(1.02);
    opacity: 0.9;
}

@media screen and (min-width: 768px) {
    .filter-panel {
        flex-direction: row;
        align-items: flex-end;
    }

    .search-box {
        flex: 2;
    }

    .filter-group {
        flex: 1;
    }

    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
        gap: 20px;
    }
}

@media (prefers-color-scheme: dark) {
    
    body {
        background-color: #1a1a1a;
        color: white;
    }

    .random-darbs {
        box-shadow: 0px 0px 7px 7px rgb(0, 0, 0);
    }

    .gallery-col img {
        box-shadow: 0px 0px 7px 7px rgb(0, 0, 0);
    }
    .logo {
        filter: invert(1);
    }
    
    .small-icon {
        filter: invert(1);
    }

    .alert {
        color: black;
    }
    .good-alert {
        color: black;
    }

    .closebtn {
        color: white;
    }
    .closebtn:hover {
        color: black;
    }

    hr {
        border-top: 1px solid #000000;
    }

    ul li a {
        background-color: #a68e8c;
    }

    .no-button {
        background-color: #1a1a1a;
        color: white;
    }

    .no-button:hover {
        background-color: #1a1a1a;
        color: white;
    }
}