/* ========================================
   FONTS
   ======================================== */
@import url('https://api.fontshare.com/v2/css?f[]=clash-display@700,600,500&display=swap');
@import url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700&display=swap');

/* ========================================
   DESIGN TOKENS
   ======================================== */
:root {
    /* Colors */
    --color-bg: #0d0d0d;
    --color-surface: #161616;
    --color-surface-raised: #1e1e1e;
    --color-border: #2a2a2a;
    --color-text: #e8e2d8;
    --color-text-muted: #888880;
    --color-text-subtle: #555550;

    /* Typography */
    --font-display: 'Clash Display', 'Inter', sans-serif;
    --font-body: 'Satoshi', 'Inter', sans-serif;

    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-auto: auto;

    /* Layout */
    --max-width: 680px;
    --radius: 4px;
    --radius-md: 8px;
}

/* ========================================
   RESET & BASE
   ======================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.6;
    min-height: 100vh;
    padding-bottom: env(safe-area-inset-bottom);
}

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

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

/* ========================================
   TYPOGRAFIE
   ======================================== */
h1, h2, h3 {
    font-family: var(--font-display);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.95rem, 7vw, 3.5rem); }
h2 { font-size: clamp(1.25rem, 4vw, 2rem); }
h3 { font-size: clamp(1rem, 3vw, 1.25rem); }

h2 {
    font-family: var(--font-body);
    color: var(--color-text-muted)
}

.eyebrow {
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* ========================================
   LAYOUT
   ======================================== */
.container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--space-sm);
}

/* ========================================
   NAVIGATION
   ======================================== */
.page-header {
    padding: var(--space-md) 0;
    border-bottom: 1px solid var(--color-border);
    /* margin-bottom: var(--space-md); */
}

.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
}

.nav-logo {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 1rem;
    letter-spacing: 0.05em;
    flex-shrink: 0;
}

.nav-links {
    display: flex;
    list-style: none;
    flex-wrap: wrap;
}

.nav-links a {
    font-size: 0.875rem;
    color: var(--color-text-muted);
    transition: color 0.2s;
    padding: 1rem;
}

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

/* ========================================
   BUTTONS
   ======================================== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-xs);
    padding: 0.75rem 1.5rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn:hover {
    border-color: var(--color-text-muted);
    background: var(--color-surface);
}

.btn-primary {
    background: var(--color-text);
    color: var(--color-bg);
    border-color: var(--color-text);
}

.btn-primary:hover {
    background: transparent;
    color: var(--color-text);
}

.btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-full {
    width: 100%;
}

.btn-danger {
    color: #ff8080;
    border-color: #ff8080;
}

.btn-danger:hover {
    background: rgba(255, 128, 128, 0.1);
}

/* ========================================
   FORMULARE
   ======================================== */
.form-group {
    margin-bottom: var(--space-md);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: var(--space-xs);
    color: var(--color-text-muted);
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-text-muted);
}

.form-input::placeholder {
    color: var(--color-text-subtle);
}

/* ========================================
   FEEDBACK / ALERTS
   ======================================== */
.alert {
    padding: 1rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

.alert-success {
    background: rgba(232, 226, 216, 0.08);
    border: 1px solid rgba(232, 226, 216, 0.25);
    color: var(--color-text);
}

.alert-error {
    background: rgba(220, 80, 80, 0.1);
    border: 1px solid rgba(220, 80, 80, 0.3);
    color: #ff8080;
}

/* ========================================
   FILTER TABS
   ======================================== */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.filter-tab {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: transparent;
    color: var(--color-text-muted);
    font-family: var(--font-body);
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.2s;
}

.filter-tab.active,
.filter-tab:hover {
    border-color: var(--color-text);
    color: var(--color-text);
}

/* ========================================
   GALERIE
   ======================================== */
.gallery-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: var(--space-md);
}

.gallery-grid {
    columns: 2;
    column-gap: 2px;
}

@media (min-width: 480px) {
    .gallery-grid {
        columns: 3;
    }
}

.gallery-item {
    position: relative;
    break-inside: avoid;
    margin-bottom: 2px;
    background: var(--color-surface);
    cursor: pointer;
}

.gallery-item img,
.gallery-item video {
    width: 100%;
    height: auto;
    display: block;
    transition: opacity 0.2s;
}

.gallery-item:hover img,
.gallery-item:hover video {
    opacity: 0.88;
}

.gallery-item-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: flex-end;
    padding: 0.5rem;
}

.gallery-item:hover .gallery-item-overlay {
    opacity: 1;
}

/* ========================================
   LIGHTBOX
   ======================================== */
.lightbox {
    display: none; /* via JS: .is-open setzt display:flex */
    position: fixed;
    inset: 0;
    z-index: 100;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox.is-open {
    display: flex;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    pointer-events: none; /* rein visuell — Klicks fallen durch zum Lightbox-Container */
}

.lightbox-close-top {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.2);
    background: rgba(0,0,0,0.5);
    color: var(--color-text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.lightbox-content {
    position: relative;
    z-index: 1;
    max-width: min(90vw, 600px);
    max-height: 65vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 100%;
    max-height: 65vh;
    border-radius: var(--radius-md);
    object-fit: contain;
}

.lightbox-actions {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* ========================================
   UPLOAD
   ======================================== */
.upload-zone {
    border: 2px dashed var(--color-border);
    border-radius: var(--radius-md);
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}

.upload-zone.dragover {
    border-color: var(--color-text-muted);
    background: var(--color-surface);
}

.upload-zone-icon {
    font-size: 2.5rem;
    margin-bottom: var(--space-sm);
    display: block;
}

.preview-thumb {
    width: 100%;
    max-height: 220px;
    object-fit: cover;
    border-radius: var(--radius);
}

/* ========================================
   ANTWORTEN
   ======================================== */
.antworten-header {
    padding: var(--space-md) 0;
}

/* Public card grid — Masonry via CSS columns */
.karten-grid {
    columns: 2;
    column-gap: var(--space-sm);
}

.karte-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    cursor: pointer;
    break-inside: avoid;
    margin-bottom: var(--space-sm);
}

.karte-item img {
    width: 100%;
    height: auto;          /* natürliches Seitenverhältnis */
    border-radius: var(--radius-md);
    display: block;
    transition: opacity 0.2s;
}

.karte-item:hover img {
    opacity: 0.85;
}

.karte-author {
    font-size: 0.8rem;
    color: var(--color-text-muted);
    text-align: center;
}

/* ========================================
   FRAME GENERATOR
   ======================================== */

/* Frame-Typ-Tabs */
.frame-type-tabs {
    display: flex;
    gap: 0.5rem;
}

/* Masonry-Picker: natürliche Seitenverhältnisse statt quadratischem Grid */
#frame-gallery-grid {
    display: block;
    columns: 2;
    column-gap: 2px;
}

#frame-gallery-grid .gallery-item {
    aspect-ratio: unset;
    break-inside: avoid;
    margin-bottom: 2px;
}

#frame-gallery-grid .gallery-item img {
    height: auto;
    object-fit: unset;
}

.frame-source-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: var(--space-md);
}

.frame-canvas-container {
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
}

.frame-canvas-container canvas {
    width: 100%;
    height: auto;
    border-radius: var(--radius-md);
    display: block;
}

.frame-actions {
    display: flex;
    flex-direction: column;
    max-width: 320px;
    margin: 0 auto;
}

/* ========================================
   ADMIN
   ======================================== */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1rem;
}

.admin-upload-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin-upload-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: var(--radius);
}

.admin-video-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: var(--color-surface-raised);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius);
    font-size: 2rem;
}

.admin-upload-meta {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

/* Admin card upload form */
.admin-karte-form {
    max-width: 400px;
}

/* Admin card grid */
.admin-karten-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
}

.admin-karte-item {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.admin-karte-item img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    border-radius: var(--radius);
}

.admin-karte-meta {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.btn-sm {
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
}

/* ========================================
   LANDING PAGE
   ======================================== */

.keyvisual {
    width: 100%;
    line-height: 0;
}

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

.keyvisual-bridge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    padding: var(--space-sm) 0 var(--space-lg);
}

.keyvisual-sep {
    font-size: 1.5rem;
    color: #fff;
    font-weight: 300;
}

.keyvisual-adc-logo {
    width: 2.25rem;
    height: auto;
}

.keyvisual-clc-logo {
    height: auto;
    width: 14rem;
}

.event {
    display: flex;
    justify-content: space-between;
}

.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    width: 100%;
    height: auto;
    
    &.adc {
        max-width: 2.25rem;
    }
    &.clc {
        max-width: 14rem;
    }
}

.content {
    background-color: var(--color-text);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    max-width: 320px;
    margin: 0 auto;

    h1 {
        color: var(--color-surface);
    }
    h2, p {
        color: var(--color-text-subtle);
    }
}

.hero-actions {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    max-width: 320px;
}

.page-footer {
    padding: var(--space-lg) 0 var(--space-md);
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-xl);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: center;

    a {
        color: var(--color-text-muted);
    }
}

/* ========================================
   STATES
   ======================================== */
.loading {
    display: flex;
    justify-content: center;
    padding: var(--space-xl) 0;
    color: var(--color-text-muted);
    font-size: 0.875rem;
}

.empty-state {
    text-align: center;
    padding: var(--space-xl) 0;
    color: var(--color-text-muted);
}

/* ========================================
   UTILITIES
   ======================================== */
.text-muted  { color: var(--color-text-muted); }
.text-small  { font-size: 0.875rem; }
.mt-xs       { margin-top: var(--space-xs); }
.mt-sm       { margin-top: var(--space-sm); }
.mt-md       { margin-top: var(--space-md); }
.mt-lg       { margin-top: var(--space-lg); }
.mt-xl       { margin-top: var(--space-xl); }
.mb-sm       { margin-bottom: var(--space-sm); }
.mb-md       { margin-bottom: var(--space-md); }
.mb-lg       { margin-bottom: var(--space-lg); }
.mx-auto     { margin-left: var(--space-auto); margin-right: var(--space-auto); }
.my-lg       { margin-top: var(--space-lg); margin-bottom: var(--space-lg); }
.mx-sm       { margin-left: var(--space-sm); margin-right: var(--space-sm); }
.mx-lg       { margin-left: var(--space-lg); margin-right: var(--space-lg); }
.px-lg       { padding-left: var(--space-lg); padding-right: var(--space-lg); }
