/* --- Grundläggande & Återställning --- */
:root {
    --primary-color: #007bff;
    --dark-grey: #333;
    --light-grey: #f4f4f4;
    --container-width: 1200px;
    --border-radius: 5px;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: #fff;
    color: var(--dark-grey);
    line-height: 1.6;
}

main {
    flex-grow: 1; /* Tvingar footern att stanna i botten */
    /* width: 100%; Tas bort från den generella regeln för att fixa mobil layout */
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 2rem 20px;
}

/* En bredare container för sidor som behöver mer utrymme, t.ex. galleriet */
.container-wide {
    max-width: 1600px; /* Bredare än standard */
    margin: 0 auto;
    width: 100%; /* Appliceras specifikt här för att fixa galleri-layouten på desktop */
    box-sizing: border-box; /* Viktigt: Inkluderar padding i den totala bredden */
    padding: 2rem 20px;
}

/* Mindre padding på mobilen för båda containrarna */
@media (max-width: 767px) {
    .container {
        padding: 1.5rem 15px;
    }
    .container-wide {
        padding: 1.5rem 15px;
    }
}

h1, h2 {
    color: var(--dark-grey);
}

/* Centrera kategorirubrikerna i galleriet */
.gallery-category h2 {
    text-align: center;
}

/* --- Header --- */
header {
    background-color: #fff;
    padding: 1rem 20px;
    border-bottom: 1px solid #eaeaea;
    position: sticky;
    top: 0;
    z-index: 10;
}

header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0; /* Nollställ padding för header-containern */
}

.logo img {
    max-height: 50px;
    display: block;
}

header .nav ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 1rem;
}

header .nav a {
    text-decoration: none;
    color: var(--dark-grey);
    font-weight: 600;
    padding: 8px 12px;
    border-radius: var(--border-radius);
    transition: background-color 0.2s, color 0.2s;
}

header .nav a:hover {
    background-color: var(--light-grey);
}

header .nav a.active {
    color: var(--primary-color);
    font-weight: 700;
}

/* --- Hamburgermeny --- */
.nav-toggle {
    display: none; /* Göm på desktop */
    cursor: pointer;
    border: none;
    background: transparent;
    padding: 0;
    width: 30px;
    height: 30px;
    position: relative;
    z-index: 1001;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    content: '';
    display: block;
    background: var(--dark-grey);
    height: 3px;
    width: 100%;
    border-radius: 5px;
    transition: transform 0.25s ease-in-out;
}

.hamburger::before {
    position: absolute;
    bottom: 8px;
}

.hamburger::after {
    position: absolute;
    top: 8px;
}

/* Mobilanpassning av header */
@media (max-width: 767px) {
    .nav-toggle {
        display: block;
    }

    .nav {
        position: absolute;
        background: white;
        left: 0;
        right: 0;
        top: 100%;
        box-shadow: 0 5px 10px rgba(0,0,0,0.1);
        
        /* Göm menyn som standard */
        visibility: hidden;
        opacity: 0;
        transform: scale(0.95);
        transition: visibility 0.25s, opacity 0.25s, transform 0.25s;
    }

    .nav--visible {
        visibility: visible;
        opacity: 1;
        transform: scale(1);
    }

    .nav ul {
        flex-direction: column;
        text-align: center;
    }

    .nav a {
        display: block;
        padding: 1rem;
    }
}

/* --- Footer --- */
footer {
    background-color: var(--dark-grey);
    color: #fff;
    text-align: center;
    padding: 2rem 0;
    margin-top: auto;
}

/* --- Hero-sektion (Startsida) --- */
.hero {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    background-color: var(--light-grey);
    padding: 2rem 20px;
}

.hero-content h1 {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

/* Mindre rubrik på mobil */
@media (max-width: 767px) {
    .hero-content h1 {
        font-size: 2.2rem;
    }
}

.hero-content p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
}

/* --- Generisk knappstil --- */
.btn-primary {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    transition: background-color 0.2s, transform 0.2s;
}

.btn-primary:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

/* --- Sektioner på startsidan --- */
.home-section {
    padding-top: 3rem;
    padding-bottom: 3rem;
    text-align: center;
}

/* Alternativ bakgrundsfärg för varannan sektion */
.home-section.alt-bg {
    background-color: var(--light-grey);
}

.home-section h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.home-section p {
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 2.5rem;
    font-size: 1.1rem;
    color: #666;
}

.home-gallery-preview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.preview-item {
    background-color: #fff;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.preview-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.preview-item h3 {
    margin: 1rem 0;
}

/* --- Om mig-sida --- */
.about-me-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2rem;
}

.profile-image {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

@media (min-width: 768px) {
    .about-me-content {
        flex-direction: row;
        align-items: flex-start;
    }
}

/* --- Projekt-sida --- */
.project-card {
    background-color: #f9f9f9;
    border: 1px solid #eaeaea;
    border-radius: var(--border-radius);
    padding: 1.5rem 2rem;
    margin-bottom: 2.5rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    overflow: hidden; /* För att hantera float */
}

@media (max-width: 767px) {
    .project-card {
        padding: 1rem 1.25rem;
    }
}

.project-card h2 {
    margin-top: 0;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    display: inline-block;
}

.project-image {
    max-width: 100%;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

/* För större skärmar, placera bild och text sida-vid-sida */
@media (min-width: 768px) {
    .project-image {
        float: right;
        max-width: 40%;
        margin-left: 2rem;
    }
}

/* --- Kontakt-sida --- */
.contact-form {
    margin-top: 2rem;
    max-width: 600px;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    font-family: inherit;
    box-sizing: border-box; /* Viktig för att padding inte ska öka bredden */
}

/* --- Galleri-specifik stil --- */
.gallery-nav {
    text-align: center;
    margin-bottom: 2.5rem;
    display: flex; 
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap; /* Tillåt att knappar radbryts */
}

/* Mobil: Rutnät för knappar i gallerinavigeringen */
@media (max-width: 767px) {
    .gallery-nav {
        display: grid;
        grid-template-columns: 1fr 1fr; /* Två kolumner */
    }
}

.gallery-nav a {
    padding: 10px 20px;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    border-radius: var(--border-radius);
    min-width: 120px; /* Ger alla knappar en minsta bredd för ett enhetligt utseende */
    text-align: center; /* Centrerar texten i knappen */
    transition: background-color 0.2s;
}

.gallery-nav a:hover {
    background-color: #0056b3;
}

.gallery-nav a.active {
    background-color: #0056b3; /* En mörkare nyans för att visa att den är aktiv */
    cursor: default; /* Ändra muspekaren för att indikera att den inte är klickbar igen */
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.gallery-grid img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.gallery-grid img:hover {
    transform: scale(1.03);
    box-shadow: 0 6px 12px rgba(0,0,0,0.2);
}

/* --- Media-fråga för större skärmar (Desktop) --- */
@media (min-width: 768px) {
    .gallery-grid {
        /* Minskar basstorleken på bilderna för att få plats med fler per rad */
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 1.25rem; /* Lite mer luft mellan bilderna */
    }
}

/* Hjälpklass för att dölja element med JavaScript */
.hidden {
    display: none !important; /* !important säkerställer att denna regel vinner */
}


/* --- Lightbox --- */
.lightbox {
    display: none; /* Göm som standard */
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.9);
    justify-content: center;
    flex-direction: column; /* Ny: Stapla bild och text vertikalt */
    align-items: center;
}

.lightbox.active {
    display: flex; /* Visa när aktiv */
}

.lightbox-content {
    margin: 0; /* Ändrad från 'auto'. Låt flexbox sköta centreringen. */
    display: block;
    max-width: 90%; /* Justerat för att ge lite mer plats */
    max-height: 80%; /* Behåller marginal upp/ner */
    animation: zoom 0.3s ease-in-out;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 40px;
    font-weight: bold;
    transition: 0.3s;
    cursor: pointer;
}

/* Ny stil för bildtexten i lightboxen */
#lightbox-caption {
    margin-top: 15px; /* Avstånd från bilden */
    color: #f1f1f1; /* Ljusgrå/vit färg */
    font-size: 1.1rem; /* Lite större text */
    text-align: center;
    padding: 0 10px; /* Lite luft på sidorna */
    max-width: 80%; /* Förhindra att texten blir för bred på stora skärmar */
    /* "Lysande" effekt med text-shadow */
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
}

@keyframes zoom { from {transform: scale(0.8)} to {transform: scale(1)} }

/* --- Stilar för kod-grind (Chiamaka.html) --- */
.password-gate-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background-color: var(--light-grey);
    padding: 20px;
    box-sizing: border-box;
}

/* Ny klass för att applicera bakgrunden på body-elementet */
body.secret-background {
    background-image: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('/images/Chiamaka/hearths.jpg');
    background-size: cover;
    background-position: center;
    background-attachment: fixed; /* Låser bakgrunden vid scroll */
}

/* Gör texten på den hemliga sidan vit och läsbar */
body.secret-background #secret-content,
body.secret-background #secret-content h1 {
    color: white;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.7);
}

.password-box {
    background-color: white;
    padding: 2rem 2.5rem;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.password-box h1 {
    margin-top: 0;
}

.password-box input[type="password"] {
    width: 100%;
    padding: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid #ccc;
    border-radius: var(--border-radius);
    box-sizing: border-box;
}

.error-message {
    color: #d93025;
    margin-top: 1rem;
    min-height: 1.2em;
}

.shake { animation: shake 0.5s; }
@keyframes shake { 10%, 90% { transform: translateX(-1px); } 20%, 80% { transform: translateX(2px); } 30%, 50%, 70% { transform: translateX(-4px); } 40%, 60% { transform: translateX(4px); } }
