/* ==============================
   Grundinställningar
   ============================== */

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background-color: #f5f5f5;
    color: #333;
}


/* ==============================
   Header
   ============================== */

.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #ddd;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 20px;

    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-title {
    margin: 0;
    font-size: 28px;
    color: #333;
}


/* ==============================
   Meny
   ============================== */

.main-menu {
    display: flex;
    gap: 25px;
}

.main-menu a {
    text-decoration: none;
    color: #444;
    font-size: 16px;
    padding: 8px 0;
}

.main-menu a:hover {
    color: #777;
}

.main-menu a.active {
    font-weight: bold;
    border-bottom: 2px solid #555;
}


/* ==============================
   Huvudinnehåll
   ============================== */

.content-container {
    max-width: 1100px;
    margin: 40px auto;
    padding: 0 20px;
}


/* ==============================
   Välkomstsektion
   ============================== */

.welcome {
    background-color: white;
    padding: 25px;
    border-radius: 8px;

    display: flex;
    gap: 30px;
    align-items: center;

    margin-bottom: 45px;
}

.welcome-image {
    max-width: 200px;
    max-height: 120px;

    object-fit: cover;

    border-radius: 6px;
}

.welcome-text {
    flex: 1;
}

.welcome-text h2 {
    margin-top: 0;
    font-size: 30px;
}

.welcome-text p {
    line-height: 1.6;
    font-size: 17px;
}


/* ==============================
   Senaste händelser
   ============================== */

.events h2 {
    font-size: 26px;
    margin-bottom: 20px;
}

.event-card {
    background-color: white;

    padding: 20px;
    margin-bottom: 15px;

    border-radius: 8px;

    border-left: 4px solid #777;
}

.event-card h3 {
    margin-top: 0;
    margin-bottom: 10px;
}

.event-card p {
    margin-bottom: 10px;
    line-height: 1.5;
}

.event-card time {
    color: #777;
    font-size: 14px;
}


/* ==============================
   Footer
   ============================== */

.site-footer {
    margin-top: 60px;

    padding: 25px;

    text-align: center;

    background-color: #ffffff;

    border-top: 1px solid #ddd;

    color: #777;
}
/* ========================================== Bildgaller ========================================== */ 
.gallery-page { margin-bottom: 50px; } 
.gallery-page > h2 { font-size: 30px; margin-bottom: 10px; } 
.gallery-intro { font-size: 17px; line-height: 1.6; margin-bottom: 40px; color: #555; } 
/* ========================================== Land ========================================== */ 
.country-section { background-color: #ffffff; padding: 25px; margin-bottom: 25px; border-radius: 8px; border: 1px solid #e1e1e1; } 
.country-section h3 { margin-top: 0; margin-bottom: 20px; font-size: 24px; } 
/* ========================================== År ========================================== */ 
.year-folder { margin-left: 20px; } 
.year-folder h4 { font-size: 20px; margin-top: 0; margin-bottom: 15px; } 
/* ========================================== Album ========================================== */ 
.album-list { margin-left: 25px; } 
.album-card { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    max-width: 500px; 
    padding: 15px; 
    margin-bottom: 10px; 
    background-color: #f7f7f7; 
    border: 1px solid #ddd; 
    border-radius: 7px; 
    text-decoration: none; 
    color: #333; 
    transition: background-color 0.2s, transform 0.2s; } 
.album-card:hover { background-color: #eeeeee; transform: translateX(3px); } 
/* Bildikon */ 
.album-icon { font-size: 35px; width: 50px; text-align: center; } 
/* Albumtext */ 
.album-card strong { display: block; font-size: 18px; margin-bottom: 5px; } 
.album-card span { display: block; color: #777; font-size: 14px; }

/* ==============================
   Mobil
   ============================== */

@media (max-width: 700px) {

    .header-container {
        flex-direction: column;
        gap: 20px;
    }

    .main-menu {
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px;
    }

    .welcome {
        flex-direction: column;
    }

    .welcome-image {
        width: 100%;
    }
    .country-section { padding: 18px; } 
    .year-folder { margin-left: 5px; } 
    .album-list { margin-left: 5px; } 
    .album-card { max-width: 100%; }
}
/* ==========================================
   Steg 3 - Knappar
   ========================================== */

.add-button,
.add-album-button {

    border: none;

    background-color: #eeeeee;

    color: #444;

    padding: 9px 14px;

    border-radius: 5px;

    cursor: pointer;

    font-size: 14px;

    margin-bottom: 15px;

}


.add-button:hover,
.add-album-button:hover {

    background-color: #dddddd;

}


/* Knapp för album */

.add-album-button {

    margin-left: 25px;

    margin-top: 5px;

}


/* Lite extra utrymme mellan åren */

.year-folder {

    margin-bottom: 25px;

}


/* När ett land innehåller många år */

.year-list {

    margin-top: 10px;

}

/* Bilder inne i album */

.photo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 25px;
}

.photo-grid img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: 8px;
    display: block;
}

/* Förstorad bild */

.lightbox {
    position: fixed;
    top: 0;
    left: 0;

    width: 100%;
    height: 100%;

    background-color: rgba(0, 0, 0, 0.85);

    display: flex;
    justify-content: center;
    align-items: center;

    z-index: 1000;
}

.lightbox-content {
    position: relative;

    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 90vw;
    max-height: 85vh;

    width: auto;
    height: auto;

    object-fit: contain;

    border-radius: 5px;
}

.lightbox-close {
    position: absolute;

    top: -45px;
    right: 0;

    border: none;

    background: none;

    color: white;

    font-size: 30px;

    cursor: pointer;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;

    top: 50%;
    transform: translateY(-50%);

    border: none;

    background-color: rgba(0, 0, 0, 0.5);

    color: white;

    width: 50px;
    height: 70px;

    font-size: 32px;

    cursor: pointer;

    border-radius: 5px;
}


.lightbox-prev {
    left: -70px;
}


.lightbox-next {
    right: -70px;
}


.lightbox-prev:hover,
.lightbox-next:hover {
    background-color: rgba(0, 0, 0, 0.8);
}

.lightbox-counter {
    position: absolute;

    bottom: -40px;

    left: 50%;

    transform: translateX(-50%);

    color: white;

    font-size: 16px;

    white-space: nowrap;
}

.lightbox-caption {
    position: absolute;

    bottom: -70px;

    left: 50%;

    transform: translateX(-50%);

    color: white;

    font-size: 18px;

    text-align: center;

    white-space: nowrap;
}

/* ================================
   Mobilanpassning för bildalbum
   ================================ */

@media (max-width: 700px) {

    .photo-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .photo-grid img {
        height: 160px;
    }


    .lightbox-content {
        width: 100%;
        max-width: 100%;
    }


    .lightbox-content img {
        max-width: 85vw;
        max-height: 70vh;
    }


    .lightbox-prev,
    .lightbox-next {
        width: 45px;
        height: 60px;

        font-size: 28px;
    }


    .lightbox-prev {
        left: 5px;
    }


    .lightbox-next {
        right: 5px;
    }


    .lightbox-close {
        top: -45px;
        right: 10px;
    }


    .lightbox-caption {
        bottom: -65px;

        width: 90vw;

        font-size: 15px;

        white-space: normal;
    }


    .lightbox-counter {
        bottom: -95px;

        font-size: 14px;
    }
}
.album-actions {
    margin: 20px 0;
}

#add-photos-button {
    padding: 10px 18px;

    border: none;
    border-radius: 6px;

    font-size: 16px;

    cursor: pointer;
}

#add-photos-button:hover {
    opacity: 0.85;
}

.upload-preview {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
    margin-top: 20px;
}

.upload-preview img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    border-radius: 8px;
}
.upload-actions {
    margin-top: 20px;
    display: flex;
    gap: 10px;
}

.upload-actions button {
    padding: 10px 18px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    cursor: pointer;
}
#add-event-button {
    margin: 15px 0 20px 0;

    padding: 10px 18px;

    border: none;
    border-radius: 6px;

    font-size: 16px;

    cursor: pointer;
}
.event-form {
    display: none;

    margin: 20px 0;
    padding: 20px;

    border-radius: 8px;
}

.event-form h3 {
    margin-top: 0;
}

.event-form label {
    display: block;
    margin-top: 12px;
    margin-bottom: 5px;
}

.event-form input,
.event-form textarea {
    width: 100%;
    box-sizing: border-box;

    padding: 10px;

    font-size: 16px;
}

.event-form textarea {
    min-height: 100px;
    resize: vertical;
}

.event-form-buttons {
    margin-top: 15px;

    display: flex;
    gap: 10px;
}

.event-form-buttons button {
    padding: 10px 18px;

    border: none;
    border-radius: 6px;

    cursor: pointer;
}