/* ═══════════════════════════════════════════════════════════════
   base.css  —  Global styles, design tokens, layout primitives
   ═══════════════════════════════════════════════════════════════ */

/* ── Tokens ──────────────────────────────────────────────────────────────── */
:root {
    /* Palette */
    --col-bg: #F0EAD6;
    --col-surface: #FFFFFF;
    --col-border: #E2DDD5;
    --col-nav: #1E1A17;
    --col-nav-text: #C9AA88;
    --col-accent: #B5884A;
    --col-accent-h: #9A7039;
    --col-text: #1E1A17;
    --col-text-soft: #5C5349;
    --col-danger: #C0392B;
    --col-success: #27AE60;
    --col-info: #2980B9;
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 40px;
    --space-2xl: 64px;
    /* Typography */
    --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
    --text-xs: .75rem;
    --text-sm: .875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.375rem;
    --text-2xl: 1.75rem;
    --text-3xl: 2.25rem;
    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    /* Shadows */
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
    --shadow-lg: 0 8px 32px rgba(0,0,0,.13);
    /* Layout */
    --max-width: 1100px;
    --nav-height: 60px;
}

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

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    font-size: var(--text-base);
    line-height: 1.65;
    color: var(--col-text);
    background: var(--col-bg);
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

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

a {
    color: var(--col-accent);
    text-decoration: none;
}

    a:hover {
        text-decoration: underline;
        color: var(--col-accent-h);
    }

ul {
    list-style: none;
}

button {
    font: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* ── Typography ──────────────────────────────────────────────────────────── */
h1 {
    font-size: var(--text-3xl);
    font-weight: 700;
    line-height: 1.2;
}

h2 {
    font-size: var(--text-xl);
    font-weight: 600;
    line-height: 1.3;
}

h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

p {
    margin-bottom: var(--space-md);
    color: var(--col-text-soft);
}

    p:last-child {
        margin-bottom: 0;
    }

strong {
    color: var(--col-text);
    font-weight: 600;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--space-xs);
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: var(--text-sm);
    transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--col-accent);
    color: #fff;
    border: 2px solid transparent;
}

    .btn-primary:hover {
        background: var(--col-accent-h);
        color: #fff;
        text-decoration: none;
    }

.btn-outline {
    background: transparent;
    color: var(--col-accent);
    border: 2px solid var(--col-accent);
}

    .btn-outline:hover {
        background: var(--col-accent);
        color: #fff;
        text-decoration: none;
    }

.btn-sm {
    padding: 6px 14px;
    font-size: var(--text-xs);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ── Spinner (HTMX indicator) ────────────────────────────────────────────── */
.spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .6s linear infinite;
}

.spinner--lg {
    width: 28px;
    height: 28px;
    border-color: var(--col-border);
    border-top-color: var(--col-accent);
}

.htmx-request .spinner,
.htmx-indicator.htmx-request {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ── Flash messages ──────────────────────────────────────────────────────── */
.flash-zone {
    padding: 0 var(--space-md);
}

.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    margin: var(--space-sm) auto;
    max-width: var(--max-width);
    font-size: var(--text-sm);
    font-weight: 500;
}

.flash--error {
    background: #fdecea;
    color: var(--col-danger);
    border-left: 3px solid var(--col-danger);
}

.flash--success {
    background: #eafaf1;
    color: var(--col-success);
    border-left: 3px solid var(--col-success);
}

.flash--info {
    background: #ebf5fb;
    color: var(--col-info);
    border-left: 3px solid var(--col-info);
}

.flash-close {
    font-size: 1.1rem;
    color: inherit;
    opacity: .6;
    line-height: 1;
}

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

/* ── Navigation ──────────────────────────────────────────────────────────── */
.site-header {
    background: var(--col-nav);
    position: sticky;
    top: 0;
    z-index: 200;
    height: var(--nav-height);
    border-bottom: 2px solid #3a3026;
}

.header-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--col-nav-text);
    letter-spacing: .5px;
    text-decoration: none;
    flex-shrink: 0;
}

    .site-logo:hover {
        color: #fff;
        text-decoration: none;
    }

.main-nav ul {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
}

.main-nav a {
    color: rgba(201,170,136,.8);
    font-size: var(--text-sm);
    font-weight: 500;
    padding: 6px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: color .15s, background .15s;
}

    .main-nav a:hover {
        color: #fff;
        background: rgba(255,255,255,.07);
    }

.nav-username {
    font-size: var(--text-xs);
    color: var(--col-nav-text);
    opacity: .7;
    padding-right: var(--space-sm);
}

/* Hamburger (hidden on desktop) */
.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 4px;
    padding: 6px;
}

    .nav-toggle span {
        display: block;
        width: 22px;
        height: 2px;
        background: var(--col-nav-text);
        border-radius: 2px;
        transition: transform .2s;
    }

/* ── Main layout ─────────────────────────────────────────────────────────── */
.main-content {
    flex: 1;
    max-width: var(--max-width);
    width: 100%;
    margin: var(--space-xl) auto;
    padding: 0 var(--space-md);
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.site-footer {
    background: var(--col-nav);
    border-top: 2px solid #3a3026;
    padding: var(--space-lg) var(--space-md);
    margin-top: auto;
}

.footer-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

.site-footer p {
    color: rgba(201,170,136,.6);
    font-size: var(--text-xs);
    margin: 0;
}

.footer-nav {
    display: flex;
    gap: var(--space-md);
}

    .footer-nav a {
        color: rgba(201,170,136,.6);
        font-size: var(--text-xs);
    }

        .footer-nav a:hover {
            color: var(--col-nav-text);
        }

/* ── Chips ───────────────────────────────────────────────────────────────── */
.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.chip {
    background: var(--col-surface);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--col-text-soft);
}

/* ── Generic prose page ──────────────────────────────────────────────────── */
.page-prose h1 {
    margin-bottom: var(--space-lg);
}

.page-prose h2 {
    margin: var(--space-xl) 0 var(--space-sm);
}

/* ── Responsive nav ──────────────────────────────────────────────────────── */
@media (max-width: 680px) {
    .nav-toggle {
        display: flex;
    }

    .main-nav {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0;
        right: 0;
        background: var(--col-nav);
        border-bottom: 2px solid #3a3026;
        padding: var(--space-md);
    }

        .main-nav.open {
            display: block;
        }

        .main-nav ul {
            flex-direction: column;
            align-items: flex-start;
            gap: 4px;
        }
}

/* ═══════════════════════════════════════════════════════════════
   Home page — legacy-faithful warm redesign
   ═══════════════════════════════════════════════════════════════ */

.page-home {
    background: #ECE0B7;
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
}

/* ── Hero ── */
.hn-hero {
    position: relative;
    min-height: 220px;
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    align-items: center;
    margin-bottom: var(--space-xl);
    background: #3E342A;
}

.hn-hero-overlay {
    position: absolute;
    inset: 0;
    background-image: url('/static/images/Kopf.webp');
    background-size: cover;
    background-position: center top;
    opacity: .50;
}

.hn-hero-body {
    position: relative;
    padding: var(--space-xl) var(--space-xl);
}

    .hn-hero-body h1 {
        color: #ECE0B7;
        font-size: clamp(1.6rem, 4vw, 2.6rem);
        text-shadow: 0 2px 10px rgba(0,0,0,.5);
        margin-bottom: var(--space-sm);
    }

.hn-hero-sub {
    color: #C9AA88;
    font-size: var(--text-sm);
    letter-spacing: 1px;
    margin-bottom: var(--space-lg);
}

.hn-hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
}

/* ── Two-column layout ── */
.hn-layout {
    display: grid;
    grid-template-columns: 1fr 200px;
    gap: var(--space-xl);
    align-items: start;
}

/* ── Card ── */
.hn-card {
    background: var(--col-surface);
    border: 1px solid rgba(188,165,121,.35);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    padding: var(--space-lg) var(--space-xl);
    margin-bottom: var(--space-lg);
}

    .hn-card h2 {
        font-size: var(--text-lg);
        font-weight: 600;
        color: var(--col-text);
        border-bottom: 2px solid #BCA579;
        padding-bottom: var(--space-xs);
        margin-bottom: var(--space-md);
    }

    .hn-card p {
        color: var(--col-text-soft);
        font-size: var(--text-sm);
        line-height: 1.75;
    }

/* ── Event poster ── */
.hn-poster-wrap {
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-md);
    margin-bottom: var(--space-lg);
}

    .hn-poster-wrap img {
        width: 100%;
        height: auto;
        display: block;
        transition: transform .4s;
    }

        .hn-poster-wrap img:hover {
            transform: scale(1.02);
        }

/* ── Chips ── */
.hn-chips {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
    margin-top: var(--space-md);
}

.hn-chip {
    background: #ECE0B7;
    border: 1px solid #BCA579;
    border-radius: var(--radius-full);
    padding: 4px 14px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--col-text-soft);
    letter-spacing: .4px;
}

/* ── Event list ── */
.hn-event-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

    .hn-event-list li {
        display: flex;
        align-items: baseline;
        gap: var(--space-md);
        padding-bottom: var(--space-sm);
        border-bottom: 1px solid var(--col-border);
    }

        .hn-event-list li:last-child {
            border-bottom: none;
        }

.hn-event-date {
    font-size: var(--text-xs);
    font-weight: 700;
    color: #B5884A;
    white-space: nowrap;
    min-width: 90px;
}

.hn-event-name {
    font-size: var(--text-sm);
    color: var(--col-text-soft);
}

/* ── Concert photo grid ── */
.hn-concert-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-md);
}

.hn-concert-item img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    transition: transform .3s, box-shadow .3s;
    display: block;
}

    .hn-concert-item img:hover {
        transform: translateY(-3px);
        box-shadow: var(--shadow-md);
    }

.hn-concert-item p {
    margin-top: var(--space-xs);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--col-text-soft);
    text-align: center;
}

/* ── Sidebar ── */
.hn-sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.hn-sidebar-card {
    background: var(--col-surface);
    border: 1px solid rgba(188,165,121,.35);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

    .hn-sidebar-card h3 {
        background: #3E342A;
        color: #C9AA88;
        font-size: var(--text-xs);
        font-weight: 600;
        letter-spacing: 1.2px;
        text-transform: uppercase;
        padding: 10px var(--space-md);
    }

    .hn-sidebar-card nav a {
        display: flex;
        align-items: center;
        gap: var(--space-sm);
        padding: 9px var(--space-md);
        font-size: var(--text-xs);
        color: var(--col-text-soft);
        text-decoration: none;
        border-bottom: 1px solid rgba(188,165,121,.2);
        transition: background .15s, color .15s;
    }

        .hn-sidebar-card nav a:last-child {
            border-bottom: none;
        }

        .hn-sidebar-card nav a:hover {
            background: #ECE0B7;
            color: var(--col-text);
        }

        .hn-sidebar-card nav a::before {
            content: '›';
            font-size: 1rem;
            color: #BCA579;
            font-weight: 700;
        }

.hn-sidebar-img img {
    width: 100%;
    height: auto;
    display: block;
}

/* ── Responsive ── */
@media (max-width: 780px) {
    .hn-layout {
        grid-template-columns: 1fr;
    }

    .hn-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .hn-sidebar-card {
        flex: 1 1 180px;
    }

    .hn-hero-body {
        padding: var(--space-lg);
    }
}

/* ── Auth / Login ── */
.page-auth {
    display: flex;
    justify-content: center;
    padding: var(--space-xl) var(--space-md);
}

.auth-card {
    background: var(--col-surface);
    border: 1px solid var(--col-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    padding: var(--space-xl);
    width: 100%;
    max-width: 420px;
}

    .auth-card h1 {
        font-size: var(--text-2xl);
        margin-bottom: var(--space-xs);
    }

    .auth-card > p {
        color: var(--col-text-soft);
        font-size: var(--text-sm);
        margin-bottom: var(--space-lg);
    }

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-md);
}

    .form-group label {
        font-size: var(--text-sm);
        font-weight: 600;
        color: var(--col-text);
    }

    .form-group input {
        padding: 10px 14px;
        border: 1px solid var(--col-border);
        border-radius: var(--radius-sm);
        font: inherit;
        font-size: var(--text-sm);
        background: var(--col-bg);
        color: var(--col-text);
        transition: border-color .15s, box-shadow .15s;
    }

        .form-group input:focus {
            outline: none;
            border-color: var(--col-accent);
            box-shadow: 0 0 0 3px rgba(181,136,74,.15);
        }

.form-check {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin-bottom: var(--space-lg);
}

    .form-check label {
        font-size: var(--text-sm);
        color: var(--col-text-soft);
    }

.form-hint {
    font-size: var(--text-xs);
    color: var(--col-text-soft);
    margin-top: 2px;
}

.auth-switch {
    text-align: center;
    font-size: var(--text-sm);
    color: var(--col-text-soft);
    margin-top: var(--space-lg) !important;
}
