/* Sauberes Wien – Stylesheet
   Brand: Primär #e74c3c, Dunkel #2c3e50 */

:root {
    --primary: #e74c3c;
    --primary-dark: #c0392b;
    --ink: #2c3e50;
    --text: #333;
    --bg: #f8f8f8;
    --bg-alt: #ffffff;
    --radius: 10px;
    --shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    --maxw: 1040px;
}

* { box-sizing: border-box; }

body {
    font-family: 'Montserrat', sans-serif;
    margin: 0;
    padding: 0;
    line-height: 1.65;
    color: var(--text);
    background-color: var(--bg);
}
body.lang-ar { font-family: 'Cairo', 'Montserrat', sans-serif; }

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

h1, h2, h3 { font-weight: 800; color: var(--ink); line-height: 1.2; }
h1 { font-size: clamp(2rem, 5vw, 2.8rem); text-align: center; margin-bottom: 20px; }
h2 {
    font-size: clamp(1.6rem, 3.5vw, 2.1rem);
    margin-top: 10px;
    margin-bottom: 24px;
    position: relative;
    padding-bottom: 12px;
}
h2::after {
    content: "";
    position: absolute;
    left: 0; bottom: 0;
    width: 64px; height: 4px;
    background: var(--primary);
    border-radius: 2px;
}
[dir="rtl"] h2::after { left: auto; right: 0; }
h3 { font-size: 1.35rem; color: var(--primary); margin-top: 30px; }
p { margin-bottom: 15px; }

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

.section { padding: 30px 20px; }
.section:nth-of-type(even) { background: var(--bg-alt); }

/* Buttons */
.button {
    display: inline-block;
    background: var(--primary);
    color: #fff;
    padding: 13px 28px;
    border-radius: 6px;
    font-weight: 700;
    margin-top: 18px;
    box-shadow: 0 6px 16px rgba(231, 76, 60, 0.3);
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.button:hover {
    background: var(--primary-dark);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 10px 22px rgba(231, 76, 60, 0.38);
}

/* Header / Navigation */
.header {
    background: var(--ink);
    color: #fff;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.header .logo { font-size: 1.5rem; font-weight: 800; color: #fff; text-decoration: none; letter-spacing: .5px; }
.lang-switcher { font-size: .85rem; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.lang-switcher a { color: #cfd6dd; padding: 2px 4px; }
.lang-switcher a:hover { color: #fff; text-decoration: none; }
.lang-switcher a.active { color: #fff; font-weight: 700; border-bottom: 2px solid var(--primary); }
.lang-switcher .sep { color: #54606c; }

/* Hero */
.hero {
    background: linear-gradient(rgba(44,62,80,0.62), rgba(44,62,80,0.62)), url('/images/hero-wien.jpg') no-repeat center center/cover;
    background-color: var(--ink); /* Fallback, falls Bild fehlt */
    color: #fff;
    text-align: center;
    padding: clamp(70px, 12vw, 130px) 20px;
}
.hero-inner { max-width: 820px; margin: 0 auto; }
.hero h1 { color: #fff; font-size: clamp(2.2rem, 6vw, 3.5rem); text-shadow: 0 2px 14px rgba(0,0,0,.45); }
.hero p { font-size: clamp(1.05rem, 2.5vw, 1.35rem); margin: 18px auto 6px; text-shadow: 0 1px 8px rgba(0,0,0,.45); }

/* Unterschriften-Zähler im Hero */
.hero-counter { margin-top: 20px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.45); }
.hero-counter[hidden] { display: none; }
.counter-num { font-size: clamp(1.6rem, 4vw, 2.2rem); font-weight: 800; color: #fff; }
.counter-text { font-size: 1rem; opacity: .95; }

/* Upload-Formular: Kategorie-Auswahl & Datei-Feld */
.field-label { display: block; font-weight: 700; margin-bottom: 8px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 18px; margin-bottom: 18px; }
.radio-row .radio { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; cursor: pointer; }
.radio-row .radio input { width: auto; margin: 0; }
.petition-form input[type="file"] { padding: 10px; background: #fafafa; }

/* Einwilligungs-Checkbox */
.consent { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 18px; font-size: .9rem; }
.consent input[type="checkbox"] { width: auto; flex: 0 0 auto; margin: 3px 0 0; }
.consent label { font-weight: 400; margin: 0; }
[dir="rtl"] .consent { text-align: right; }

/* Bild-Text-Sektionen */
.image-section { display: flex; flex-wrap: wrap; align-items: center; gap: 30px; margin: 30px 0; }
.image-section img {
    max-width: 100%; height: auto; border-radius: var(--radius);
    box-shadow: var(--shadow); flex: 1; min-width: 300px;
}
.image-section .text-content { flex: 1; min-width: 300px; }
.image-section.reverse .text-content { order: 2; }
.image-section.reverse img { order: 1; }

/* Galerie-Band */
.gallery-band { background: var(--ink); color: #eef2f5; padding: 50px 0; }
.gallery-band h2 { color: #fff; }
.gallery-band h2::after { background: var(--primary); }
.gallery-intro { max-width: 760px; color: #c5cdd5; }
.gallery { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 26px; }
.gallery-col { margin: 0; position: relative; }
.gallery-stack {
    position: relative;
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,.35);
    background: #1c2935;
}
.gallery-stack img {
    position: absolute; inset: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease, transform 6s ease;
}
.gallery-stack img.is-active { opacity: 1; transform: scale(1.05); }
.gallery-col figcaption { margin-top: 12px; text-align: center; }
.badge {
    display: inline-block; padding: 6px 14px; border-radius: 999px;
    font-weight: 700; font-size: .85rem; color: #fff;
}
.badge--good { background: #27ae60; }
.badge--bad { background: var(--primary); }
.gallery-loc {
    display: block; margin-top: 6px; min-height: 1.1em;
    font-size: .8rem; font-weight: 600; color: #6b7280;
}
.gallery-loc:not(:empty)::before { content: "📍 "; }
.gallery-col--good .gallery-stack { box-shadow: 0 10px 30px rgba(39,174,96,.25); }

/* Timeline (3-Stufen-Plan) */
.timeline { list-style: none; padding: 0; margin: 20px 0; }
.timeline li { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 20px; }
.timeline .step-num {
    flex: 0 0 auto;
    width: 38px; height: 38px; border-radius: 50%;
    background: var(--primary); color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800;
}

/* Check-Listen */
.check-list { list-style: none; padding: 0; }
.check-list li {
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 24 24" fill="%23e74c3c"><path d="M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z"/></svg>') no-repeat left 6px;
    background-size: 18px;
    padding-left: 28px;
    margin-bottom: 14px;
}
[dir="rtl"] .check-list li { background-position: right 6px; padding-left: 0; padding-right: 28px; }

.hint { font-size: .85rem; margin-top: 6px; color: #555; }

/* Petitionsformular */
.petition-form {
    background: #fff; padding: 30px; border-radius: var(--radius);
    box-shadow: var(--shadow); margin: 30px 0;
}
.petition-form label { display: block; margin-bottom: 8px; font-weight: 700; }
.petition-form input, .petition-form select {
    width: 100%; padding: 12px; margin-bottom: 18px;
    border: 1px solid #ddd; border-radius: 6px; font-family: inherit; font-size: 1rem;
}
.petition-form input:focus, .petition-form select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(231,76,60,.15);
}
.petition-form button {
    width: 100%; padding: 14px; background: var(--primary); color: #fff;
    border: none; border-radius: 6px; font-size: 1.1rem; font-weight: 700; cursor: pointer;
    transition: background-color .2s ease;
}
.petition-form button:hover { background: var(--primary-dark); }
.petition-form button:disabled { opacity: .7; cursor: not-allowed; }
.petition-form button.is-loading { position: relative; color: transparent; }
.petition-form button.is-loading::after {
    content: ''; position: absolute; top: 50%; left: 50%; width: 20px; height: 20px;
    margin: -10px 0 0 -10px; border: 3px solid rgba(255,255,255,.4); border-top-color: #fff;
    border-radius: 50%; animation: sw-spin .7s linear infinite;
}
@keyframes sw-spin { to { transform: rotate(360deg); } }

.form-status { margin-top: 12px; padding: 10px 14px; border-radius: 6px; font-size: .9rem; font-weight: 600; }
.form-status--loading { background: #f0f0f0; color: #555; }
.form-status--success { background: #e6f6ea; color: #1f7a37; }
.form-status--error   { background: #fdecea; color: #b3261e; }

/* Modal */
.modal-overlay {
    display: none; position: fixed; inset: 0; z-index: 1000;
    background: rgba(0,0,0,.55); align-items: center; justify-content: center; padding: 20px;
}
.modal-overlay.is-open { display: flex; }
.modal-content {
    background: #fff; padding: 34px; border-radius: var(--radius);
    width: 100%; max-width: 420px; text-align: center;
    box-shadow: 0 20px 50px rgba(0,0,0,.3); position: relative;
}
.modal-content h3 { margin-top: 0; color: var(--ink); }
.close-btn {
    position: absolute; top: 10px; right: 16px;
    color: #aaa; font-size: 26px; font-weight: bold; cursor: pointer; line-height: 1;
}
.close-btn:hover { color: var(--primary); }

/* Footer */
.footer { background: var(--ink); color: #fff; text-align: center; padding: 40px 20px; margin-top: 50px; font-size: .9rem; }
.footer a { color: #fff; }
.footer-links .sep { color: #54606c; margin: 0 8px; }

/* Social Icons – jetzt korrekt AUSSERHALB der Media-Query */
.social-icons { margin: 0 0 22px; display: flex; justify-content: center; align-items: center; gap: 22px; }
.social-icons a { display: inline-flex; transition: transform .3s ease; }
.social-icons a:hover { transform: translateY(-3px); text-decoration: none; }
.social-icons svg { fill: #fff; transition: fill .3s ease; }
.social-icons a:hover svg { fill: var(--primary); }

/* Rechtsseiten */
.legal { max-width: 820px; padding: 40px 20px; }
.legal h1 { text-align: left; border-bottom: 3px solid var(--primary); padding-bottom: 10px; }
.content-box { background: #fff; padding: 30px; border-radius: var(--radius); box-shadow: var(--shadow); }
.content-box h2::after { display: none; }
.content-box h2 { font-size: 1.3rem; }
.legal-meta { color: #777; margin-top: 30px; }

/* Reveal-Animationen (nur mit JS aktiv; ohne JS bleibt alles sichtbar) */
.js .reveal { opacity: 0; transform: translateY(26px); }
.js .reveal.is-visible {
    opacity: 1; transform: none;
    transition: opacity .7s ease, transform .7s ease;
}

@media (prefers-reduced-motion: reduce) {
    .js .reveal { opacity: 1 !important; transform: none !important; }
    .gallery-stack img.is-active { transform: none; }
    html { scroll-behavior: auto; }
}

/* Responsive */
@media (max-width: 768px) {
    .image-section { flex-direction: column; }
    /* In der Spalten-Anordnung darf das Bild nicht über flex-basis/min-width
       auf 300px kollabieren – sonst wird es „schmal" und mittig dargestellt.
       Stattdessen volle Breite mit natürlichem Seitenverhältnis. */
    .image-section img { flex: none; width: 100%; min-width: 0; }
    .image-section.reverse .text-content,
    .image-section.reverse img { order: initial; }
    .gallery { grid-template-columns: 1fr; }
    .header { justify-content: center; }
}
