/* ===========================================================
   ZELA Pinneberg e.V. – Stylesheet
   =========================================================== */

/* ---------- Schrift (lokal eingebunden) ---------- */
/* ubuntu-regular - latin */
@font-face {
    font-display: swap;
    font-family: 'Ubuntu';
    font-style: normal;
    font-weight: 400;
    src: url('fonts/ubuntu-v20-latin-regular.woff2') format('woff2');
}

/* ---------- Design-Variablen ---------- */
:root {
    --brand:        #8b0000;   /* Dunkelrot – Nav, Footer, Buttons */
    --brand-hover:  #a5201f;   /* helleres Rot für Hover/Akzente   */
    --brand-tint:   #f4e9e9;   /* sehr helles Rot für Flächen      */

    --ink:          #1f2328;   /* Fließtext                        */
    --muted:        #5b6169;   /* Nebentext                        */

    --bg:           #eef0f4;   /* Seitenhintergrund                */
    --surface:      #ffffff;   /* Karten                           */
    --line:         #e5e7ec;   /* Rahmen/Trenner                   */

    --radius:       16px;
    --radius-sm:    10px;
    --shadow:       0 1px 2px rgba(20, 23, 28, .04),
                    0 6px 20px rgba(20, 23, 28, .06);
    --shadow-hover: 0 2px 4px rgba(20, 23, 28, .06),
                    0 12px 28px rgba(20, 23, 28, .10);

    --maxw:         1040px;
}

/* ---------- Grundgerüst ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-family: Ubuntu, sans-serif;
    color: var(--ink);
    background-color: var(--bg);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    font-family: Ubuntu, sans-serif;
    color: var(--ink);
    line-height: 1.2;
}

h1 { font-size: clamp(1.6rem, 1.1rem + 2.2vw, 2.25rem); margin: 0 0 .6em; }
h2 { font-size: clamp(1.25rem, 1rem + 1.2vw, 1.55rem); margin: 0 0 .5em; }
h4 { font-size: 1.05rem; margin: 1.6em 0 .4em; }

p { margin: 0 0 1em; }

a {
    color: var(--brand);
    font-weight: 700;
    text-decoration: none;
}
a:hover { color: var(--brand-hover); text-decoration: underline; }

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

:focus-visible {
    outline: 3px solid var(--brand-hover);
    outline-offset: 2px;
    border-radius: 4px;
}

/* ---------- Kopfbereich / Logo ---------- */
header { background: var(--surface); }

.logo_wrapper,
.logo_wrapper_schmal {
    max-width: 960px;
    margin: auto;
    padding: 18px 16px;
}
.logo_wrapper img,
.logo_wrapper_schmal img {
    width: 100%;
    display: block;
}
.logo_wrapper_schmal { display: none; }   /* nur mobil sichtbar */

/* ---------- Navigation ---------- */
.topnav_wrapper {
    background-color: var(--brand);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(20, 23, 28, .12);
}

.topnav {
    max-width: var(--maxw);
    margin: auto;
    padding: 0 8px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.topnav a {
    color: #f6f2f2;
    font-weight: 600;
    text-align: center;
    padding: 15px 18px;
    text-decoration: none;
    transition: background-color .15s ease, color .15s ease;
}
.topnav a:hover {
    background-color: rgba(255, 255, 255, .14);
    color: #fff;
    text-decoration: none;
}
/* Aktiver Menüpunkt */
.topnav a.active {
    color: #fff;
    box-shadow: inset 0 -3px 0 #fff;
}
/* Menüpunkt rechts ausrichten (Impressum) */
.topnav a.nav-right { margin-left: auto; }

/* Hamburger-Icon (nur mobil) */
.topnav .icon {
    display: none;
    margin-left: auto;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    padding: 14px 12px;
    cursor: pointer;
}
.topnav .icon span {
    display: block;
    width: 26px;
    height: 3px;
    background: #fff;
    border-radius: 2px;
}

/* ---------- Hauptbereich ---------- */
main {
    flex: 1 0 auto;
    padding: 28px 16px 48px;
}

.main-wrapper {
    max-width: var(--maxw);
    margin: 0 auto;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
    align-items: start;
}

.main-content { min-width: 0; }

/* Impressum/Datenschutz: volle Breite (keine Seitenleiste) */
.main-content-impressum { grid-column: 1 / -1; min-width: 0; }

/* Artikel als Karten */
.main-content-artikel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(20px, 3vw, 34px);
    margin-bottom: 24px;
    overflow-wrap: break-word;
}
.main-content-artikel:last-child { margin-bottom: 0; }

.main-content-artikel img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-top: 18px;
}

.main-content-artikel > *:first-child { margin-top: 0; }

/* ---------- Seitenleiste ---------- */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 24px;
}
.sidebar-artikel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(20px, 3vw, 28px);
}
.sidebar-artikel h1 { font-size: 1.35rem; }
.sidebar-artikel img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
    margin-top: 12px;
    transition: transform .2s ease, box-shadow .2s ease;
}
.sidebar-artikel a:hover img {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* ---------- Button ---------- */
.button {
    display: block;
    text-align: center;
    background-color: var(--brand);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
    transition: background-color .15s ease, transform .1s ease, box-shadow .15s ease;
}
.button:hover { background-color: var(--brand-hover); box-shadow: var(--shadow-hover); }
.button:active { transform: translateY(1px); }
.button a {
    display: block;
    color: #fff;
    padding: 4px 16px;
    text-decoration: none;
}
.button a:hover { color: #fff; text-decoration: none; }
.button h2 { color: #fff; margin: .5em 0; }

/* ---------- Impressum-Feinschliff ---------- */
.main-content-impressum ul { padding-left: 1.1rem; }
.main-content-impressum h4 { color: var(--brand); }

/* ---------- Footer ---------- */
footer {
    flex-shrink: 0;
    background-color: var(--brand);
    color: #fff;
}
.footer-wrapper {
    max-width: var(--maxw);
    margin: auto;
    padding: 28px 16px;
    display: flex;
    flex-wrap: wrap;
    gap: 24px 40px;
    justify-content: space-between;
}
.footer-wrapper div { flex: 1 1 200px; }
.footer-wrapper p {
    font-size: .85rem;
    line-height: 1.5;
    margin: 0 0 2px;
    color: rgba(255, 255, 255, .9);
}
.footer-wrapper u { font-weight: 700; }

/* Falls iOS Ziffernfolgen (IBAN etc.) doch verlinkt: Text weiß statt dunkelrot */
footer a { color: inherit; text-decoration: none; }

.disclaimer { color: #ffd7d7; }

/* ===========================================================
   Responsive – Tablet & Mobil
   =========================================================== */
@media screen and (max-width: 860px) {
    .main-wrapper { grid-template-columns: 1fr; gap: 24px; }
}

@media screen and (max-width: 768px) {
    /* Logo-Umschaltung */
    .logo_wrapper { display: none; }
    .logo_wrapper_schmal { display: block; }

    /* Navigation zusammenklappen */
    .topnav a:not(.icon) { display: none; width: 100%; text-align: left; }
    .topnav .icon { display: flex; }

    .topnav.responsive { flex-direction: column; align-items: stretch; }
    .topnav.responsive a:not(.icon) {
        display: block;
        border-top: 1px solid rgba(255, 255, 255, .14);
        padding: 14px 16px;
    }
    .topnav.responsive a.active { box-shadow: inset 3px 0 0 #fff; }
    .topnav.responsive .icon {
        position: absolute;
        right: 4px;
        top: 4px;
    }
    .topnav.responsive { position: relative; padding-top: 8px; }
}

/* ===========================================================
   Animationen (gesteuert von motion.js – ohne JS oder bei
   „Bewegung reduzieren“ bleibt alles statisch)
   =========================================================== */
:root { --ease-out: cubic-bezier(.22, 1, .36, 1); }

/* ---------- Logo-Intro: Zelt zeichnet sich, dann der Schriftzug ---------- */
.logo_wrapper, .logo_wrapper_schmal { position: relative; }
.logo_wrapper   { --text-top: 62%; }   /* ab hier beginnt im Bild der Schriftzug */
.logo_wrapper_schmal { --text-top: 64%; }

.logo-tent {
    position: absolute;
    inset: 18px 16px;          /* = Padding des Wrappers → deckungsgleich mit dem Bild */
    width: calc(100% - 32px);
    height: calc(100% - 36px);
    pointer-events: none;
    animation: logo-tent-out .5s ease 2.4s forwards;
}
.logo-tent path { fill: none; stroke: #a52323; stroke-width: var(--sw); stroke-linejoin: round; stroke-linecap: round; }
.logo-tent .outline { stroke-dasharray: 1; stroke-dashoffset: 1; animation: logo-draw 1.4s var(--ease-out) forwards; }
.logo-tent .pole    { stroke-dasharray: 1; stroke-dashoffset: 1; animation: logo-draw .6s var(--ease-out) .9s forwards; }
.logo-tent .flap {
    fill: #a52323; stroke: none;
    transform-box: fill-box; transform-origin: left center; transform: scaleX(0);
    animation: logo-flap .7s var(--ease-out) 1.3s forwards;
}
.logo-intro .logo_wrapper img,
.logo-intro .logo_wrapper_schmal img {
    animation: logo-text .8s var(--ease-out) 1.5s both;
}
@keyframes logo-draw { to { stroke-dashoffset: 0; } }
@keyframes logo-flap { to { transform: scaleX(1); } }
@keyframes logo-tent-out { to { opacity: 0; } }
/* Bis kurz vor Schluss nur den Schriftzug zeigen, dann das ganze Bild
   (das gezeichnete Zelt liegt deckungsgleich darüber und blendet aus) */
@keyframes logo-text {
    0%    { opacity: 0; transform: translateY(8px); filter: blur(4px); clip-path: inset(var(--text-top) 0 0 0); }
    99.9% { opacity: 1; transform: none; filter: none; clip-path: inset(var(--text-top) 0 0 0); }
    100%  { opacity: 1; clip-path: inset(0); }
}

/* ---------- Karten beim Scrollen einblenden ---------- */
.motion .main-content-artikel:not(.in):not(.done),
.motion .sidebar-artikel:not(.in):not(.done) {
    opacity: 0;
    transform: translateY(28px);
}
.motion .main-content-artikel.in,
.motion .sidebar-artikel.in {
    transition: opacity .8s var(--ease-out), transform .8s var(--ease-out);
}

/* ---------- Mikro-Interaktionen ---------- */
/* Sidebar-Karten heben sich leicht an */
.sidebar-artikel { transition: transform .35s var(--ease-out), box-shadow .35s var(--ease-out); }
.sidebar-artikel:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }

/* Gleitender Unterstrich in der Navigation */
.topnav { position: relative; }
.nav-indicator {
    position: absolute;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: #fff;
    pointer-events: none;
    transition: left .45s var(--ease-out), width .45s var(--ease-out), opacity .2s;
}
.has-indicator .topnav a.active { box-shadow: none; }

/* Lesefortschritt unter der Navigation */
.scroll-progress {
    height: 2px;
    background: rgba(255, 255, 255, .55);
    transform: scaleX(0);
    transform-origin: left;
}

/* Textlinks: Unterstrich wächst von links */
.main-content-artikel p a,
.sidebar-artikel p a {
    text-decoration: none;
    background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat;
    transition: background-size .35s var(--ease-out);
}
.main-content-artikel p a:hover,
.sidebar-artikel p a:hover { text-decoration: none; background-size: 100% 2px; }

/* Glanz über die Buttons */
.button { position: relative; overflow: hidden; }
.button::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .25) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform .7s var(--ease-out);
    pointer-events: none;
}
.button:hover::before { transform: translateX(100%); }

@media screen and (max-width: 768px) {
    .nav-indicator { display: none; }
    .has-indicator .topnav.responsive a.active { box-shadow: inset 3px 0 0 #fff; }
    .has-indicator .topnav a.active { box-shadow: inset 0 -3px 0 #fff; }
}

@media print {
    .motion .main-content-artikel, .motion .sidebar-artikel { opacity: 1 !important; transform: none !important; }
    .logo-tent, .scroll-progress { display: none; }
}

/* ---------- Nachtszene im Kopfbereich („Der Verein“) ---------- */
.night-banner {
    background: linear-gradient(#1a0f14 0%, #3a1218 70%, #5a1a1a 100%);
    overflow: hidden;
}
.night-banner svg {
    display: block;
    width: 100%;
    height: clamp(160px, 20vw, 240px);
    max-width: 1400px;
    margin: 0 auto;
}
.nb-star  { fill: #fff; opacity: .5; }
.nb-moon  { fill: #f4e3d0; opacity: .9; }
.nb-tent path { fill: none; stroke: #f4e9e9; stroke-width: 3.5; stroke-linejoin: round; }
.nb-tent .nb-flap { fill: #f4e9e9; stroke: none; opacity: .9; }
.nb-name { font-family: Ubuntu, sans-serif; font-size: 30px; font-weight: 700; letter-spacing: .08em; fill: #f4e9e9; }
.nb-glow, .nb-flame { transform-box: fill-box; }
.nb-glow  { transform-origin: center; }
.nb-flame { transform-origin: 50% 100%; }
.nb-spark { fill: #ffb347; opacity: 0; }

.motion .nb-star  { opacity: .2; animation: nb-twinkle 3s ease-in-out infinite; animation-delay: var(--d); }
.motion .nb-glow  { animation: nb-glow 2.4s ease-in-out infinite; }
.motion .nb-flame { animation: nb-flicker .9s ease-in-out infinite alternate; }
.motion .nb-inner { animation-duration: .6s; animation-delay: -.3s; }
.motion .nb-spark { animation: nb-spark 2.8s linear infinite; animation-delay: var(--d); }
.motion .nb-name  { animation: nb-name 1.2s var(--ease-out) .3s both; }
@keyframes nb-twinkle { 50% { opacity: .9; } }
@keyframes nb-glow    { 50% { opacity: .7; transform: scale(1.12); } }
@keyframes nb-flicker {
    0%   { transform: scale(1, 1) skewX(0); }
    50%  { transform: scale(.92, 1.08) skewX(3deg); }
    100% { transform: scale(1.04, .94) skewX(-3deg); }
}
@keyframes nb-spark {
    0%   { opacity: 0; transform: translate(0, 0); }
    15%  { opacity: 1; }
    100% { opacity: 0; transform: translate(var(--x), -60px); }
}
@keyframes nb-name { from { opacity: 0; transform: translateY(8px); } }
