/* ═══════════════════════════════════════════════════════
   KULTURFÖRENINGEN KATALYSATOR — Stylesheet
   ═══════════════════════════════════════════════════════ */

/* ── Custom Properties ────────────────────────────── */
:root {
    --color-bg:        #0a0a0a;
    --color-bg-alt:    #111111;
    --color-surface:   #1a1a1a;
    --color-border:    #2a2a2a;

    --color-text:      #f0f0f0;
    --color-text-dim:  #999999;
    --color-text-mute: #666666;

    --color-accent:    #8b2020;
    --color-accent-light: #b03030;

    --font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
    --font-body:    'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    --nav-height: 70px;
    --section-pad: clamp(4rem, 10vw, 8rem);
    --content-width: 1100px;

    --transition: 0.3s ease;
}

/* ── Reset ────────────────────────────────────────── */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.7;
    color: var(--color-text);
    background: var(--color-bg);
    overflow-x: hidden;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

ul { list-style: none; }

/* ── Utility ──────────────────────────────────────── */
.section-content {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: var(--section-pad) 1.5rem;
    position: relative;
    z-index: 2;
}

.section-title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 0.3em;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--color-accent);
    margin-top: 0.4em;
    border-radius: 2px;
}

.section-intro {
    color: var(--color-text-dim);
    font-size: 1.1rem;
    margin-bottom: 2.5rem;
    max-width: 600px;
}

/* Section background images */
.section-bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    z-index: 0;
}

.section-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 10, 10, 0.82);
    z-index: 1;
}

.overlay-heavy {
    background: rgba(10, 10, 10, 0.88);
}

section {
    position: relative;
}

/* Fade-in animation */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s ease, transform 0.7s ease;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ═══════════════════════════════════════════════════════
   NAVIGATION
   ═══════════════════════════════════════════════════════ */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: var(--nav-height);
    transition: background var(--transition), box-shadow var(--transition);
}

#navbar.scrolled {
    background: rgba(10, 10, 10, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 1px 0 var(--color-border);
}

.nav-container {
    max-width: var(--content-width);
    margin: 0 auto;
    padding: 0 1.5rem;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo img {
    height: 40px;
    width: auto;
    opacity: 0;
    transition: opacity var(--transition);
}

#navbar.scrolled .nav-logo img {
    opacity: 1;
}

.nav-links {
    display: flex;
    gap: 2.5rem;
}

.nav-links a {
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-dim);
    transition: color var(--transition);
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent);
    transition: width var(--transition);
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--color-text);
}

.nav-links a.active::after {
    width: 100%;
}

/* Hamburger */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    z-index: 1001;
}

.nav-toggle span {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--color-text);
    transition: transform var(--transition), opacity var(--transition);
    transform-origin: center;
}

.nav-toggle.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav-toggle.open span:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* ═══════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════ */
#hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: url('../Bilder/Bakgrunder/norrborgen.jpg') center/cover no-repeat;
    background-attachment: fixed;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(10,10,10,0.6) 0%, rgba(10,10,10,0.85) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.hero-logo {
    width: clamp(300px, 55vw, 560px);
    margin: 0 auto 1.5rem;
    background: rgba(20, 20, 20, 0.55);
    border-radius: 10px;
    padding: 0.8rem;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.hero-tagline {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    font-weight: 300;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-dim);
}

.hero-scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
    color: var(--color-text-dim);
    animation: bounce 2s ease-in-out infinite;
    transition: color var(--transition);
}

.hero-scroll:hover {
    color: var(--color-text);
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50%      { transform: translateX(-50%) translateY(10px); }
}

/* ═══════════════════════════════════════════════════════
   AKTUELLT
   ═══════════════════════════════════════════════════════ */
#aktuellt {
    background: var(--color-bg);
}

.aktuellt-card {
    margin-top: 2rem;
}

.aktuellt-inner {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 2.5rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
}

.aktuellt-poster {
    min-height: 300px;
    overflow: hidden;
}

.aktuellt-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.aktuellt-text {
    padding: 2rem 2rem 2rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.aktuellt-text h3 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.aktuellt-date {
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent-light);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.aktuellt-text p:last-child {
    color: var(--color-text-dim);
    line-height: 1.8;
}

.aktuellt-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-accent-light);
    transition: color var(--transition);
}

.aktuellt-link:hover {
    color: var(--color-text);
}

.aktuellt-link svg {
    transition: transform var(--transition);
}

.aktuellt-link:hover svg {
    transform: translateX(4px);
}

/* ═══════════════════════════════════════════════════════
   BILDARKIV (Gallery)
   ═══════════════════════════════════════════════════════ */
#bildarkiv {
    background: var(--color-bg-alt);
}

.gallery-scroll-wrapper {
    position: relative;
}

.gallery-grid, #gallery-grid {
    display: grid;
    grid-template-rows: repeat(2, 180px);
    grid-auto-flow: column;
    grid-auto-columns: 240px;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-right: 60px;
    padding-left: 0;
    transition: padding-left var(--transition);
}

.gallery-grid::-webkit-scrollbar {
    display: none;
}

.gallery-item {
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    position: relative;
    scroll-snap-align: start;
}

.gallery-item::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0);
    transition: background var(--transition);
}

.gallery-item:hover::after {
    background: rgba(0,0,0,0.3);
}

.gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-item:hover img {
    transform: scale(1.05);
}

.gallery-prev,
.gallery-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background var(--transition), border-color var(--transition), opacity var(--transition);
    z-index: 2;
}

.gallery-prev { left: 0; }
.gallery-next { right: 0; }

.gallery-prev:hover,
.gallery-next:hover {
    background: #222;
    border-color: #555;
}

.gallery-prev { display: none; }
.gallery-prev.visible { display: flex; }

/* ═══════════════════════════════════════════════════════
   TIDIGARE ARRANGEMANG
   ═══════════════════════════════════════════════════════ */
#tidigare {
    background: var(--color-bg);
}

.events-timeline {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 3rem;
}


.event-card {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 2rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    transition: border-color var(--transition), transform var(--transition);
}

.event-card:hover {
    border-color: #333;
    transform: translateY(-2px);
}

.event-poster {
    overflow: hidden;
    min-height: 280px;
}

.event-poster img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.event-poster-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--color-surface) 0%, #222 100%);
    gap: 0.5rem;
}

.event-poster-date {
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--color-accent);
}

.event-poster-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-text-mute);
}

.event-info {
    padding: 2rem 2rem 2rem 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.event-date {
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-accent-light);
    margin-bottom: 0.3rem;
}

.event-title {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 0.3rem;
}

.event-meta {
    font-size: 0.85rem;
    color: var(--color-text-mute);
    margin-bottom: 0.8rem;
}

.event-info > p:last-of-type {
    color: var(--color-text-dim);
    font-size: 0.95rem;
}

.event-gallery-preview {
    display: flex;
    gap: 8px;
    margin-top: 1rem;
}

.event-gallery-preview img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    opacity: 0.8;
    cursor: pointer;
    transition: opacity var(--transition), transform var(--transition);
}

.event-gallery-preview img:hover {
    opacity: 1;
    transform: scale(1.08);
}

.event-fb-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--color-text-dim);
    text-decoration: none;
    transition: color var(--transition);
}

.event-fb-link:hover {
    color: var(--color-text);
}

/* Hidden events — visa fler */
.event-card.event-hidden {
    display: none !important;
}

.events-timeline.show-all .event-card.event-hidden {
    display: grid !important;
}

.show-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2.5rem;
    padding: 0.9rem 2rem;
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    color: var(--color-text-dim);
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.show-more-btn:hover {
    background: var(--color-surface);
    color: var(--color-text);
    border-color: #444;
}

.show-more-btn svg {
    transition: transform var(--transition);
}

.show-more-btn.expanded svg {
    transform: rotate(180deg);
}

/* ═══════════════════════════════════════════════════════
   OM KATALYSATOR
   ═══════════════════════════════════════════════════════ */
#om {
    background: var(--color-bg);
}

.om-intro {
    max-width: 700px;
    margin-bottom: 3rem;
}

.om-intro p {
    font-size: 1.2rem;
    line-height: 1.9;
    color: var(--color-text-dim);
}

.om-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
}

.om-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 2rem;
    transition: border-color var(--transition), background var(--transition);
}

.om-card:hover {
    border-color: #333;
    background: rgba(255, 255, 255, 0.06);
}

.om-card-icon {
    color: var(--color-accent);
    margin-bottom: 1rem;
}

.om-card h3 {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 0.8rem;
}

.om-card p {
    color: var(--color-text-dim);
    font-size: 0.92rem;
    line-height: 1.7;
    margin-bottom: 0.6rem;
}

.om-card p:last-child {
    margin-bottom: 0;
}

/* ═══════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════ */
#footer {
    background: var(--color-bg);
    border-top: 1px solid var(--color-border);
    padding: 3rem 1.5rem;
}

.footer-content {
    max-width: var(--content-width);
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
}

.footer-logo img {
    height: 36px;
    opacity: 0.7;
}

.footer-social {
    display: flex;
    gap: 1.5rem;
}

.footer-social a {
    color: var(--color-text-mute);
    transition: color var(--transition), transform var(--transition);
}

.footer-social a:hover {
    color: var(--color-text);
    transform: translateY(-2px);
}

.footer-copy {
    font-size: 0.8rem;
    color: var(--color-text-mute);
}

/* ═══════════════════════════════════════════════════════
   LIGHTBOX
   ═══════════════════════════════════════════════════════ */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox[hidden] {
    display: flex; /* override hidden for transition */
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lightbox.open {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.lightbox-img-container {
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-img-container img {
    max-width: 90vw;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 4px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}

.lightbox-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--color-text);
    font-size: 2.5rem;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity var(--transition);
    z-index: 2001;
}

.lightbox-close:hover {
    opacity: 1;
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text);
    cursor: pointer;
    opacity: 0.5;
    transition: opacity var(--transition);
    padding: 1rem;
}

.lightbox-prev:hover,
.lightbox-next:hover {
    opacity: 1;
}

.lightbox-prev { left: 1rem; }
.lightbox-next { right: 1rem; }

/* ═══════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════ */

/* Tablet */
@media (max-width: 900px) {
    .om-grid {
        grid-template-columns: 1fr;
    }

    .event-card {
        grid-template-columns: 200px 1fr;
    }

    .aktuellt-inner {
        grid-template-columns: 250px 1fr;
    }
}

/* Mobile */
@media (max-width: 640px) {

    :root {
        --nav-height: 60px;
    }

    /* Nav mobile */
    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 280px;
        height: 100vh;
        background: rgba(15,15,15,0.98);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
        flex-direction: column;
        padding: 6rem 2rem 2rem;
        gap: 1.5rem;
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
        border-left: 1px solid var(--color-border);
    }

    .nav-links.open {
        transform: translateX(0);
    }

    .nav-links a {
        font-size: 1rem;
        letter-spacing: 0.05em;
    }

    /* Gallery — smaller tiles on mobile */
    .gallery-grid, #gallery-grid {
        grid-template-rows: repeat(2, 130px);
        grid-auto-columns: 170px;
    }

    /* Events */
    .event-card {
        grid-template-columns: 1fr;
    }

    .event-poster {
        min-height: 200px;
        max-height: 350px;
    }

    .event-info {
        padding: 1.5rem;
    }

    /* Aktuellt */
    .aktuellt-inner {
        grid-template-columns: 1fr;
    }

    .aktuellt-poster {
        min-height: 250px;
        max-height: 400px;
    }

    .aktuellt-text {
        padding: 1.5rem;
    }

    /* Om */
    .om-card {
        padding: 1.5rem;
    }

    /* Hero */
    #hero {
        background-attachment: scroll; /* fix for mobile */
    }

    .section-bg {
        background-attachment: scroll;
    }

    .hero-logo {
        padding: 1rem 1.5rem;
    }

    /* Event gallery preview */
    .event-gallery-preview img {
        width: 60px;
        height: 45px;
    }

    /* Lightbox */
    .lightbox-prev,
    .lightbox-next {
        padding: 0.5rem;
    }

    .lightbox-prev { left: 0.5rem; }
    .lightbox-next { right: 0.5rem; }
}

/* Small phones */
@media (max-width: 380px) {
    .gallery-grid, #gallery-grid {
        grid-template-rows: repeat(2, 110px);
        grid-auto-columns: 140px;
    }
}

/* Prefer reduced motion */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .fade-in { opacity: 1; transform: none; transition: none; }
    .hero-scroll { animation: none; }
    .gallery-item img { transition: none; }
    .event-card { transition: none; }
}
