/* ============================================================
   RICHTWERK THEME — Fahrradservice & Reparatur
   Primärfarbe: #0f2b3d (Marine) | Akzent: #e67e22 (Orange)
   Font: Inter | Radius: 20px
   Alle CSS-Selektoren auf tatsächliche render.php-Klassen abgestimmt.
   ============================================================ */

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

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    color: var(--text-dark);
    background: var(--bg-page);
    line-height: 1.6;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ---------- Scroll-Animationen ---------- */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}
.animate-on-scroll.visible { opacity: 1; transform: translateY(0); }

/* ---------- Typografie ---------- */
h1, h2, h3, h4 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    color: var(--brand-primary);
    margin-bottom: 1rem;
}
h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.5rem; }

p + p { margin-top: 0.75rem; }
ul, ol { padding-left: 1.5rem; }
strong { font-weight: 700; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--brand-accent);
    color: white;
    padding: 0.75rem 1.8rem;
    border-radius: 40px;
    font-weight: 600;
    font-family: var(--font-body);
    font-size: 1rem;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: background 0.3s, transform 0.25s, box-shadow 0.25s;
    white-space: nowrap;
}
.btn:hover {
    background: var(--brand-accent-light);
    transform: translateY(-3px);
    box-shadow: var(--shadow-hover);
}
.btn-large { padding: 0.9rem 2.2rem; font-size: 1.05rem; }
.btn-outline {
    background: transparent;
    border: 2px solid var(--brand-accent);
    color: var(--brand-accent);
}
.btn-outline:hover { background: var(--brand-accent); color: white; }

/* ============================================================
   TOP-BAR
   ============================================================ */
.rw-topbar {
    background: var(--brand-primary-dark);
    color: white;
    padding: 0.5rem 0;
    font-size: 0.875rem;
}
.rw-topbar .container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 1.5rem;
}
.rw-topbar a {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
    transition: color 0.2s;
}
.rw-topbar a:hover { color: var(--brand-accent); }

/* ============================================================
   NAVIGATION
   ============================================================ */
.rw-nav {
    background: white;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}
.rw-nav .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 80px;
    gap: 1rem;
    flex-wrap: wrap;
}
.rw-logo-link { line-height: 0; }
.rw-logo-link img { max-height: 55px; width: auto; }

.rw-nav-list {
    display: flex;
    list-style: none;
    gap: 0.25rem;
}
.rw-nav-list a {
    display: block;
    font-weight: 600;
    color: var(--brand-primary);
    padding: 0.5rem 0.85rem;
    border-radius: var(--radius-sm);
    transition: color 0.2s;
}
.rw-nav-list a:hover,
.rw-nav-list a.active { color: var(--brand-accent); }
.rw-nav-cta { font-size: 0.9rem; padding: 0.6rem 1.4rem; }

/* Hamburger */
.rw-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    gap: 5px;
}
.rw-hamburger span {
    display: block;
    width: 25px; height: 3px;
    background: var(--brand-primary);
    border-radius: 2px;
    transition: all 0.3s;
}
.rw-hamburger.active span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.rw-hamburger.active span:nth-child(2) { opacity: 0; }
.rw-hamburger.active span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

@media (max-width: 768px) {
    .rw-hamburger { display: flex; }
    .rw-nav-cta { display: none; }
    .rw-nav-list {
        display: none;
        flex-direction: column;
        width: 100%;
        order: 3;
        background: white;
        border-top: 1px solid var(--border);
        padding: 0.75rem 0;
    }
    .rw-nav-list.open { display: flex; }
    .rw-nav-list a { padding: 0.75rem 0; border-radius: 0; border-bottom: 1px solid var(--border); }
}

/* ============================================================
   HERO BLOCK  (.block-hero)
   ============================================================ */
.block-hero {
    min-height: 85vh;
    display: flex;
    align-items: center;
    background-size: cover;
    background-position: center;
    position: relative;
}
.block-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(7,26,38,0.55) 0%, rgba(7,26,38,0.1) 100%);
    pointer-events: none;
}
/* Kein Bild — Fallback-Gradient */
.block-hero:not([style*="background-image"]) {
    background: linear-gradient(135deg, var(--brand-primary) 0%, var(--brand-primary-light) 100%);
    min-height: 60vh;
}
.block-hero:not([style*="background-image"])::after { display: none; }

.block-hero .container { position: relative; z-index: 2; }

/* hero-content-inner — weißes Glasmorphism-Panel */
.hero-content-inner {
    background: rgba(255,255,255,0.93);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    padding: 3rem;
    border-radius: var(--radius-lg);
    max-width: 650px;
    box-shadow: var(--shadow-hover);
}
.hero-content-inner h1 { color: var(--brand-primary); font-size: clamp(2rem, 4.5vw, 3.5rem); }
.hero-text {
    font-size: 1.15rem;
    color: var(--text-medium);
    margin: 1.25rem 0 2rem;
    line-height: 1.7;
}
.hero-text p { margin-bottom: 0.5rem; }

@media (max-width: 768px) {
    .block-hero { min-height: 70vh; }
    .hero-content-inner { padding: 2rem 1.5rem; }
}

/* ============================================================
   TEXT BLOCK  (.block-text)
   ============================================================ */
.block-text { padding: var(--section-padding) 0; }
.block-text h2 { margin-bottom: 1.5rem; }
.block-text .text-content {
    max-width: 820px;
    font-size: 1.05rem;
    line-height: 1.85;
    color: var(--text-dark);
}
.block-text .text-button-wrap { margin-top: 2rem; }

/* Zentrierte Variante */
.block-text.align-center .text-content { margin: 0 auto; text-align: center; }
.block-text.align-center .text-button-wrap { text-align: center; }

/* ============================================================
   TEXT MIT BILD  (.block-text-image)
   Unsere render.php gibt: .text-image-grid, .text-side, .image-side
   ============================================================ */
.block-text-image { padding: var(--section-padding) 0; }

.text-image-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    align-items: center;
}
/* Bild links: image-side soll als erstes stehen */
.block-text-image.image-left .text-image-grid { direction: rtl; }
.block-text-image.image-left .text-image-grid > * { direction: ltr; }

.text-side { font-size: 1.05rem; line-height: 1.8; }
.text-side h2 { margin-bottom: 1rem; color: var(--brand-primary); }
.text-side p { color: var(--text-medium); }
.text-image-button-wrap { margin-top: 2rem; }

.image-side img {
    width: 100%;
    border-radius: var(--radius-lg);
    object-fit: cover;
    aspect-ratio: 3/2;
    box-shadow: var(--shadow);
}

@media (max-width: 768px) {
    .text-image-grid,
    .block-text-image.image-left .text-image-grid {
        grid-template-columns: 1fr;
        direction: ltr;
    }
    /* Bild immer oben auf Mobil */
    .image-side { order: -1; }
}

/* ============================================================
   KARTEN-REIHE  (.block-cards)
   Unsere render.php: .block-cards, .cards-grid, .card, .card-image,
   .card-body, .card-text, .btn
   ============================================================ */
.block-cards { padding: var(--section-padding) 0; background: var(--bg-page-alt); }
.block-cards > .container > h2 { text-align: center; margin-bottom: 0.75rem; }
.block-cards > .container > .block-intro { text-align: center; margin-bottom: 2.5rem; }

.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}
/* Genau 3 Karten = 3 gleiche Spalten */
.cards-count-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .cards-count-3 { grid-template-columns: 1fr; } }
@media (min-width: 600px) and (max-width: 900px) { .cards-count-3 { grid-template-columns: repeat(2, 1fr); } }

.card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    display: flex;
    flex-direction: column;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-hover); }

/* Bild oben */
.card-image { width: 100%; height: 210px; overflow: hidden; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s; }
.card:hover .card-image img { transform: scale(1.04); }

/* Icon-Fallback (falls kein Bild) */
.card-icon { font-size: 3rem; text-align: center; padding: 2rem 0 0.5rem; }

/* card-body (unser interner Name) entspricht dem alten card-content */
.card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}
.card-body h3 { font-size: 1.3rem; color: var(--brand-primary); margin-bottom: 0.75rem; }
.card-text { color: var(--text-medium); flex: 1; margin-bottom: 1.5rem; line-height: 1.7; }
/* Karten-Button: .btn kommt aus render.php */
.card-body .btn {
    align-self: flex-start;
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

/* delay-Animationen für die Karten */
.delay-0 { transition-delay: 0s; }
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

/* ============================================================
   GALERIE  (.block-gallery)
   ============================================================ */
.block-gallery { padding: var(--section-padding) 0; background: var(--bg-page-alt); }
.block-gallery > .container > h2 { margin-bottom: 0.75rem; }
.gallery-description { color: var(--text-medium); margin-bottom: 2rem; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}
.gallery-item img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    transition: transform 0.3s;
}
.gallery-item img:hover,
.gallery-item .lightbox-trigger img:hover { transform: scale(1.03); cursor: pointer; }

/* ============================================================
   FAQ  (.block-faq)
   Unsere render.php nutzt native <details><summary>
   ============================================================ */
.block-faq { padding: var(--section-padding) 0; }
.block-faq > .container > h2 { margin-bottom: 0.75rem; }
.faq-description { color: var(--text-medium); margin-bottom: 2rem; }

.faq-list { max-width: 820px; }
/* details-Element als Accordion */
.faq-item {
    border-bottom: 1px solid var(--border);
    cursor: pointer;
}
.faq-item summary {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem 0;
    font-weight: 600;
    font-size: 1.05rem;
    color: var(--brand-primary);
    list-style: none;
    gap: 1rem;
    cursor: pointer;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after {
    content: '+';
    font-size: 1.6rem;
    color: var(--brand-accent);
    flex-shrink: 0;
    transition: transform 0.3s;
}
.faq-item[open] summary::after { content: '−'; }
.faq-answer {
    padding: 0 0 1.25rem;
    color: var(--text-medium);
    line-height: 1.8;
    font-size: 1rem;
}
.faq-answer p { margin-bottom: 0.5rem; }

/* ============================================================
   BUTTON BLOCK  (.block-button)
   ============================================================ */
.block-button { padding: var(--section-padding) 0; }
.block-button.align-center { text-align: center; }
.block-button.align-center .button-block-inner { display: flex; flex-direction: column; align-items: center; gap: 1.5rem; }
.block-button h2 { margin-bottom: 1rem; }
.button-text { color: var(--text-medium); font-size: 1.05rem; }

/* ============================================================
   TABELLE  (.block-table)
   ============================================================ */
.block-table { padding: var(--section-padding) 0; }
.block-table > .container > h2 { margin-bottom: 0.75rem; }
.table-description { color: var(--text-medium); margin-bottom: 2rem; }
.table-wrap {
    overflow-x: auto;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow);
}
.cms-table { width: 100%; border-collapse: collapse; background: white; }
.cms-table th {
    background: var(--brand-primary);
    color: white;
    padding: 1rem 1.25rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.95rem;
    white-space: nowrap;
}
.cms-table td {
    padding: 0.85rem 1.25rem;
    border-bottom: 1px solid var(--border);
    font-size: 0.95rem;
}
.cms-table.striped tr:nth-child(even) td { background: var(--bg-page-alt); }
.cms-table.compact td, .cms-table.compact th { padding: 0.6rem 1rem; }
.cms-table tbody tr:hover td { background: rgba(230,126,34,0.06); transition: background 0.15s; }
/* Fußzeile */
.cms-table tfoot td {
    background: var(--bg-page-alt);
    font-weight: 600;
    border-top: 2px solid var(--border);
}

/* ============================================================
   KONTAKTFORMULAR  (.block-contact-form)
   ============================================================ */
.block-contact-form { padding: var(--section-padding) 0; }
.contact-description { color: var(--text-medium); margin-bottom: 2rem; }
.contact-form { max-width: 640px; }
.form-group { margin-bottom: 1.5rem; }
.form-group label {
    display: block;
    font-weight: 600;
    color: var(--brand-primary);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}
.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    font-family: var(--font-body);
    font-size: 1rem;
    color: var(--text-dark);
    background: white;
    transition: border-color 0.2s, box-shadow 0.2s;
    -webkit-appearance: none;
}
.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--brand-accent);
    box-shadow: 0 0 0 3px rgba(230,126,34,0.12);
}
.form-group textarea { resize: vertical; min-height: 130px; }

/* ============================================================
   GOOGLE MAPS  (.block-google-maps)
   ============================================================ */
.block-google-maps { padding: var(--section-padding) 0; }
.block-google-maps > .container > h2 { margin-bottom: 1.5rem; }
.map-frame iframe {
    width: 100%;
    height: 420px;
    border-radius: var(--radius-lg);
    border: none;
    box-shadow: var(--shadow);
    display: block;
}

/* ============================================================
   BEWERTUNGEN  (.block-reviews)
   ============================================================ */
.block-reviews { padding: var(--section-padding) 0; background: var(--bg-page-alt); overflow: hidden; }
.block-reviews > .container > h2 { text-align: center; margin-bottom: 2.5rem; }

/* Ticker-Modus */
.reviews-ticker-wrap { overflow: hidden; }
.reviews-ticker { display: flex; gap: 1.5rem; animation: rw-ticker 40s linear infinite; width: max-content; }
.reviews-ticker:hover { animation-play-state: paused; }
@keyframes rw-ticker {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* Grid-Modus */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 1.5rem; }

.review-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: 1.75rem;
    box-shadow: var(--shadow);
    flex: 0 0 340px; /* für Ticker */
}
.review-stars { color: var(--brand-accent); font-size: 1.2rem; margin-bottom: 0.75rem; letter-spacing: 2px; }
.review-text { color: var(--text-medium); margin-bottom: 1rem; font-style: italic; line-height: 1.7; }
.review-author strong { color: var(--brand-primary); font-weight: 700; }
.review-date { font-size: 0.83rem; color: var(--text-light); margin-left: 0.5rem; }
.reviews-cta { text-align: center; margin-top: 2.5rem; }

/* ============================================================
   FOOTER
   ============================================================ */
.rw-footer {
    background: var(--brand-primary-dark);
    color: rgba(255,255,255,0.8);
    padding: 4rem 0 2rem;
}
.rw-footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 2.5rem;
    margin-bottom: 3rem;
}
.rw-footer-logo {
    max-height: 55px;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1); /* macht dunkles Logo hell */
}
.rw-footer-brand p { font-size: 0.9rem; color: rgba(255,255,255,0.55); margin-top: 0.5rem; }

.rw-footer h4 { color: white; font-size: 1rem; margin-bottom: 1rem; }

.rw-footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; padding: 0; }
.rw-footer-links a { color: rgba(255,255,255,0.6); font-size: 0.95rem; transition: color 0.2s; }
.rw-footer-links a:hover { color: var(--brand-accent); }

.rw-footer-address { font-style: normal; font-size: 0.9rem; color: rgba(255,255,255,0.6); line-height: 1.9; }
.rw-footer-address a { color: rgba(255,255,255,0.6); transition: color 0.2s; }
.rw-footer-address a:hover { color: var(--brand-accent); }

.rw-social { display: flex; gap: 0.75rem; margin-top: 1rem; }
.rw-social a {
    display: inline-flex; align-items: center; justify-content: center;
    width: 38px; height: 38px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    color: white;
    transition: background 0.2s;
}
.rw-social a:hover { background: var(--brand-accent); }

.rw-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: rgba(255,255,255,0.35);
}

/* ============================================================
   RESPONSIVE — allgemein
   ============================================================ */
@media (max-width: 768px) {
    :root { --section-padding: 50px; }
    .hero-content-inner { padding: 1.75rem; }
    .text-image-grid,
    .block-text-image.image-left .text-image-grid { grid-template-columns: 1fr; direction: ltr; }
    .image-side { order: -1; }
    .cards-grid, .cards-count-3 { grid-template-columns: 1fr; }
    .rw-footer-grid { grid-template-columns: 1fr; }
    .rw-footer-logo { max-height: 45px; }
}
@media (min-width: 600px) and (max-width: 900px) {
    .cards-count-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ============================================================
   HILFKLASSEN
   ============================================================ */
.text-center { text-align: center; }
.block-intro { color: var(--text-medium); font-size: 1.1rem; max-width: 720px; margin: 0 auto 2.5rem; text-align: center; }
