@import url('https://fonts.googleapis.com/css2?family=Special+Elite&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #F3EBDD;
    font-family: Trebuchet MS, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
}

/* Header */

header {
    background-color: #173D32;
}

/* Navigation base */

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 60px;
    padding: 0 16px;
    flex-wrap: wrap;
}

.logo {
    padding: 14px 0;
    color: #F3EBDD;
    font-family: "Special Elite", cursive;
    font-size: 1.6rem;
    white-space: nowrap;
    text-decoration: none;
}

/* Mobile toggle button */

.nav-toggle {
    display: none;
    font-size: 1.2rem;
    background: none;
    border: none;
    color: #F7F6F3;
    cursor: pointer;
}

/* Menu */

nav ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
}

nav li {
    position: relative;
}

nav li a,
.dropbtn {
    display: block;
    padding: 16px 18px;
    text-decoration: none;
    color: #F7F6F3;
    transition: background-color .3s;
}

nav li a:hover,
.dropdown:hover .dropbtn {
    background-color: forestgreen;
}

/* Dropdown */

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    min-width: 200px;
    background-color: #ffffff;
    box-shadow: 0 4px 12px rgba(0,0,0,.15);
    z-index: 1000;
}

.dropdown-content a {
    color: black;
    padding: 12px 16px;
    display: block;
}

.dropdown-content a:hover {
    background-color: #f1f1f1;
}

.dropdown:hover .dropdown-content {
    display: block;
}

/* Main */

main {
    max-width: 1100px;
    width: 100%;
    flex: 1 0 auto;
    margin: 0 auto;
    padding: 20px;
}

h1, h2 {
    color: forestgreen;
    font-family: "Special Elite", cursive;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
}

p {
    margin-bottom: 1rem;
}

/* Details */

details {
    margin-top: 20px;
}

summary {
    cursor: pointer;
    font-weight: bold;
}

/* Login */

#loginForm {
    background-color: #f9f9f9;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
}

#container {
    display: none;
    background-color: #e8f5e8;
    padding: 24px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #4CAF50;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

input[type="password"] {
    width: 100%;
    max-width: 320px;
    padding: 10px;
    font-size: 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
}

button {
    margin-top: 10px;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    background-color: #007bff;
    color: white;
    width: auto;
}

button:hover {
    background-color: #0056b3;
}

.error {
    color: red;
    margin-top: 10px;
}

/* Footer */

footer {
    padding: 20px;
    text-align: center;
    background-color: #38444d;
    color: white;
}

/* Mobile */

@media (max-width: 768px) {

    .nav-toggle {
        display: block;
    }

    nav ul {
        flex-direction: column;
        width: 100%;
        display: none;
    }

    nav ul.open {
        display: flex;
    }

    nav li {
        width: 100%;
    }

    nav li a,
    .dropbtn {
        text-align: center;
        width: 100%;
    }

    .dropdown-content {
        position: static;
        width: 100%;
        box-shadow: none;
    }
}


/* Gallery */

.page {
    padding: 30px;
}

.topic {
    margin-bottom: 60px;
}

.topic h2 {
    color: #fff;
}

.thumb {
    width: 220px;
    margin: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.thumb:hover {
    transform: scale(1.03);
}

#gallery {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.96);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#viewer {
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#imageArea {
    flex: 1;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    user-select: none;
}

#img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

#meta {
    height: 120px;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

#title {
    color: white;
    font-size: 24px;
}

#description {
    color: #ccc;
    font-size: 16px;
    max-width: 900px;
}

.arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 80px;
    height: 80px;

    border: none;
    border-radius: 50%;

    background: rgba(255,255,255,0.15);
    color: white;

    font-size: 48px;
    font-weight: 300;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: 0.2s ease;
}

.arrow:hover {
    background: rgba(255,255,255,0.3);
    transform: translateY(-50%) scale(1.08);
}

#left { left: 20px; }
#right { right: 20px; }

#closeBtn {
    position: absolute;
    top: 20px;
    right: 20px;

    width: 60px;
    height: 60px;

    border: none;
    border-radius: 50%;

    background: rgba(255,255,255,0.12);
    color: white;

    font-size: 42px;
    font-weight: 200;
    line-height: 1;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    transition: 0.2s ease;
}

#closeBtn:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.08);
}

.gallery-root {
    padding: 30px;
}

.topic {
    margin-bottom: 60px;
}

.topic h2 {
    color: forestgreen;
    font-family: "Special Elite", cursive;
}

.thumb {
    width: 220px;
    margin: 10px;
    border-radius: 10px;
    cursor: pointer;
    transition: transform 0.2s ease;
    user-select: none;
    -webkit-user-drag: none;
}


.thumb:hover {
    transform: scale(1.03);
}

/* Overlay */
#gallery-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.96);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#viewer {
    width: 90vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    align-items: center;
}

#img {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
}

#title {
    color: white;
    font-size: 24px;
    margin-top: 10px;
}

#description {
    color: #ccc;
    font-size: 16px;
    max-width: 900px;
    text-align: center;
}

#left, #right, #closeBtn {
    position: absolute;
    background: rgba(255,255,255,0.12);
    border: none;
    color: white;
    cursor: pointer;
}

#left {
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#right {
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
}

#closeBtn {
    top: 20px;
    right: 20px;
    width: 55px;
    height: 55px;
    border-radius: 50%;
}

::selection {
    background-color: forestgreen;
    color: white;
}

::-moz-selection {
    background-color: forestgreen;
    color: white;
}

/* Adventskalender */

.tree-container {
    position: relative;
    width: 700px;
    max-width: 90%;
    margin: auto;
}

.tree {
    width: 100%;
    display: block;
}

.bauble {
    position: absolute;
    width: 50px;
    cursor: pointer;
    transition: transform .2s;
    transform: translate(-50%, -50%);
}

.bauble:hover {
    transform: translate(-50%, -50%) scale(1.15);
}

.bauble.locked {
    opacity: 0.35;
    cursor: not-allowed;
    filter: grayscale(1);
}

#popup {
    position: absolute;
    display: none;
    background: white;
    width: fit-content;
    max-width: min(90vw, 450px);
    min-width: 220px;
    max-height: 80vh;
    overflow-y: auto;
    padding: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0,0,0,.25);
    z-index: 10;
    text-align: left;
    overflow-wrap: break-word;
}

#popup img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 10px auto;
    border-radius: 8px;
}



#close {
    position: absolute;
    top: 5px;
    right: 8px;
    border: none;
    background: none;
    font-size: 18px;
    color: #333;
    cursor: pointer;
}

@media (max-width: 600px) {
    #popup {
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%;
        max-width: 320px;
    }
}