/*
 Theme Name:  Westwood Logistics – Twenty Twenty-Four Child
 Theme URI:   https://westwood-logistics.de
 Description: Modernes Dark-UI mit Space Grotesk, Hero-Parallax & Glassmorphism
 Author:      Joe + ChatGPT
 Template:    twentytwentyfour
 Version:     5.0
 Text Domain: westwood-twentytwentyfour-child
*/

/* ---------------------------------------------------------
 * Space Grotesk – lokale Fonts (WOFF2)
 * ------------------------------------------------------ */

@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk-v22-latin_latin-ext-300.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk-v22-latin_latin-ext-regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk-v22-latin_latin-ext-500.woff2") format("woff2");
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk-v22-latin_latin-ext-600.woff2") format("woff2");
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Space Grotesk";
    src: url("fonts/space-grotesk-v22-latin_latin-ext-700.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* ---------------------------------------------------------
 * Design Tokens
 * ------------------------------------------------------ */

:root {
    --wl-color-bg:           #02030a;
    --wl-color-bg-alt:       #05071a;
    --wl-color-surface:      rgba(12, 18, 40, 0.78);
    --wl-color-surface-strong:rgba(15, 24, 52, 0.9);
    --wl-color-border-soft:  rgba(255, 255, 255, 0.10);
    --wl-color-border-strong:rgba(255, 255, 255, 0.18);

    --wl-color-text:         #f7f9ff;
    --wl-color-text-soft:    #c6cce6;
    --wl-color-text-muted:   #8d93b0;

    --wl-color-accent:       #5df2c3; /* Neon-Mint */
    --wl-color-accent-soft:  #9ff7dd;
    --wl-color-accent-alt:   #ffc96d; /* Amber */

    --wl-color-danger:       #ff6b7a;
    --wl-color-focus:        #ffd98c;

    --wl-font-sans: "Space Grotesk", system-ui, -apple-system, BlinkMacSystemFont,
                    "Segoe UI", "Inter", "Roboto", sans-serif;
    --wl-font-mono: "JetBrains Mono", Menlo, Monaco, Consolas, monospace;

    --wl-radius-lg:          22px;
    --wl-radius-md:          16px;
    --wl-radius-sm:          10px;

    --wl-shadow-soft:        0 22px 60px rgba(0, 0, 0, 0.65);

    --wl-spacing-xs:         0.35rem;
    --wl-spacing-sm:         0.6rem;
    --wl-spacing-md:         1rem;
    --wl-spacing-lg:         1.7rem;
    --wl-spacing-xl:         2.6rem;

    --wl-max-width:          1100px;
}

/* ---------------------------------------------------------
 * Global Reset & Body
 * ------------------------------------------------------ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: var(--wl-font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--wl-color-text);
    background:
        radial-gradient(circle at 10% 0%, #101d3d 0, transparent 55%),
        radial-gradient(circle at 90% 100%, #153546 0, transparent 55%),
        linear-gradient(135deg, #02030a, #05071a);
}

/* Block-Theme Wrapper */

.wp-site-blocks {
    max-width: 100%;
}

/* Hauptbereich: nur Padding auf <main>,
   die eigentliche Breitenbegrenzung passiert auf normalen Gruppen,
   NICHT auf alignfull-Blöcken wie dem Hero. */

main {
    padding-inline: 1.25rem;
}

/* Inhalt in Container-Breite, aber nur für Gruppen ohne alignfull */
main > .wp-block-group:not(.alignfull) {
    max-width: var(--wl-max-width);
    margin-inline: auto;
}


/* Bilder */

img {
    max-width: 100%;
    height: auto;
    border-radius: calc(var(--wl-radius-sm) - 2px);
}

/* ---------------------------------------------------------
 * Typografie
 * ------------------------------------------------------ */

h1,
h2,
h3,
h4 {
    font-family: var(--wl-font-sans);
    font-weight: 600;
    letter-spacing: 0.04em;
    color: var(--wl-color-text);
    margin-top: 0;
    margin-bottom: 0.55em;
}

h1 {
    font-size: clamp(2.6rem, 4vw, 3.4rem);
    line-height: 1.08;
}
h2 {
    font-size: clamp(1.9rem, 2.4vw, 2.3rem);
}
h3 {
    font-size: 1.4rem;
}
h4 {
    font-size: 1.1rem;
}

p {
    margin-top: 0;
    margin-bottom: 0.9em;
    color: var(--wl-color-text-soft);
    font-weight: 400;
}

/* Standard-Posttitel */

.wp-block-post-title {
    margin-bottom: 0.4rem;
}

/* Listen */

.wp-block-list {
    padding-left: 1.1rem;
}

/* Bildunterschriften */

.wp-element-caption {
    font-size: 0.85rem;
    color: var(--wl-color-text-muted);
}

/* ---------------------------------------------------------
 * Links, Buttons, Fokus
 * ------------------------------------------------------ */

a {
    color: var(--wl-color-accent-soft);
    text-decoration: none;
    transition: color 0.18s ease, text-shadow 0.18s ease;
}

a:hover,
a:focus-visible {
    color: var(--wl-color-accent);
    text-shadow: 0 0 14px rgba(93, 242, 195, 0.65);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--wl-color-focus);
    outline-offset: 3px;
}

/* Buttons */

button,
input[type="submit"],
.wp-element-button,
.wp-block-button__link {
    font-family: var(--wl-font-sans);
    font-size: 0.95rem;
    padding: 0.65rem 1.6rem;
    border-radius: 999px;
    border: 1px solid var(--wl-color-accent);
    background: radial-gradient(circle at 20% 0, var(--wl-color-accent-soft), var(--wl-color-accent));
    color: #041016;
    cursor: pointer;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: transform 0.1s ease, box-shadow 0.1s ease, background 0.1s ease;
}

button:hover,
input[type="submit"]:hover,
.wp-element-button:hover,
.wp-block-button__link:hover {
    transform: translateY(-1px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}

/* Ghost-Button-Variante */

.wl-btn--ghost .wp-block-button__link,
.wl-btn--ghost.wp-block-button .wp-block-button__link {
    background: transparent;
    border-color: var(--wl-color-border-soft);
    color: var(--wl-color-accent-soft);
}

.wl-btn--ghost .wp-block-button__link:hover,
.wl-btn--ghost.wp-block-button .wp-block-button__link:hover {
    background: rgba(93, 242, 195, 0.1);
}

/* ---------------------------------------------------------
 * Formulare & Inputs
 * ------------------------------------------------------ */

input,
select,
textarea {
    font-family: var(--wl-font-sans);
    font-size: 0.95rem;
    padding: 0.45rem 0.7rem;
    border-radius: var(--wl-radius-sm);
    border: 1px solid var(--wl-color-border-soft);
    background: rgba(3, 5, 18, 0.9);
    color: var(--wl-color-text);
}

input::placeholder,
textarea::placeholder {
    color: var(--wl-color-text-muted);
}

input[type="checkbox"],
input[type="radio"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--wl-color-accent);
}

/* ---------------------------------------------------------
 * Header & Footer
 * ------------------------------------------------------ */

header {
    backdrop-filter: blur(20px);
    background:
        linear-gradient(
            to right,
            rgba(2, 3, 14, 0.96),
            rgba(7, 10, 35, 0.9)
        );
    border-bottom: 1px solid var(--wl-color-border-soft);
}

/* Footer */

footer {
    margin-top: var(--wl-spacing-xl);
    padding: var(--wl-spacing-lg) 1.5rem;
    background: rgba(3, 5, 18, 0.96);
    border-top: 1px solid var(--wl-color-border-soft);
    color: var(--wl-color-text-muted);
    font-size: 0.9rem;
}

/* ---------------------------------------------------------
 * Screenreader-Text
 * ------------------------------------------------------ */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ---------------------------------------------------------
 * HERO – Fullscreen + Parallax (Bild scrollt langsamer)
 * ------------------------------------------------------ */

/* Der Cover-Block mit Klasse "wl-hero-parallax" ist unser Hero */
.wl-hero-parallax {
    position: relative;
    width: 100vw;                         /* volle Breite */
    margin-left: calc(50% - 50vw);        /* aus dem Content-Container rausziehen */
    min-height: 50vh;                     /* ~ halbe Viewport-Höhe */
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}


/* Hero-Content zentriert in unserer Max-Width-„Bühne“ */
.wl-hero-parallax .wp-block-cover__inner-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: var(--wl-max-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
    padding-bottom: 3.5rem;
}

/* Overlay für Farb-Atmosphäre */
.wl-hero-parallax .wp-block-cover__background {
    background:
        radial-gradient(circle at 5% 0%, rgba(93, 242, 195, 0.26), transparent 60%),
        radial-gradient(circle at 100% 100%, rgba(255, 201, 109, 0.32), transparent 60%),
        rgba(2, 3, 14, 0.78) !important;
}

/* Das eigentliche Hintergrundbild: vollflächig + etwas größer
   -> verhindert Balken links/rechts und oben/unten */
.wl-hero-parallax .wp-block-cover__image-background {
    position: absolute;
    inset: -10% 0;           /* oben etwas rausziehen für Spielraum */
    width: 100%;
    height: 120%;
    object-fit: cover;       /* echte Vollflächigkeit */
    transform-origin: center center;
    will-change: transform;
}

/* Scroll-gekoppeltes Parallax, nur wo unterstützt */
@supports (scroll-timeline-name: auto) {
    /* Das Scroll-Timeline kommt vom Hero selbst */
    .wl-hero-parallax {
        scroll-timeline-name: --wl-hero-scroll;
        scroll-timeline-axis: block;
    }

    .wl-hero-parallax .wp-block-cover__image-background {
        animation-name: wl-hero-parallax-move;
        animation-timeline: --wl-hero-scroll;
        animation-duration: 1s;
        animation-timing-function: linear;
    }

    @keyframes wl-hero-parallax-move {
        from {
            transform: translateY(-8%) scale(1.05);
        }
        to {
            transform: translateY(8%) scale(1.05);
        }
    }
}


/* ---------------------------------------------------------
 * Home-Sektionen
 * ------------------------------------------------------ */

.wl-home-section {
    margin: 3rem auto;
    max-width: var(--wl-max-width);
}

.wl-home-section > p {
    max-width: 40rem;
}

/* ---------------------------------------------------------
 * Glass-Kacheln für Queries (Routen + Blog auf Startseite)
 * ------------------------------------------------------ */

/* Post-Template auf der Home als Grid ausrichten */
body.home .wp-block-query.alignwide .wp-block-post-template {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--wp--preset--spacing--30, 1.5rem);
    padding: 0;
}

/* Einzelne Karten (li) als Glassmorphism-Card */
body.home .wp-block-query.alignwide .wp-block-post-template > li {
    list-style: none;
    border-radius: var(--wl-radius-md);
    border: 1px solid var(--wl-color-border-soft);
    background:
        radial-gradient(circle at 0 0, rgba(93, 242, 195, 0.18), transparent 55%),
        rgba(6, 10, 30, 0.82);
    box-shadow: var(--wl-shadow-soft);
    backdrop-filter: blur(18px);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Featured Image als Kartenkopf */

body.home .wp-block-query.alignwide .wp-block-post-featured-image {
    margin: 0;
}

body.home .wp-block-query.alignwide .wp-block-post-featured-image img {
    border-radius: var(--wl-radius-md) var(--wl-radius-md) 0 0;
}

/* Innerer Content-Block innerhalb der Karte */

body.home .wp-block-query.alignwide .wp-block-post-template > li > .wp-block-group {
    padding: 0.9rem 1.1rem 1.2rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Titel und Excerpt-Verhalten */

body.home .wp-block-query.alignwide .wp-block-post-template > li .wp-block-post-title {
    text-align: left;
    min-height: 3em; /* gleiche Titelhöhe für saubere Linien */
}

body.home .wp-block-query.alignwide .wp-block-post-template > li .wp-block-post-excerpt {
    margin-top: auto; /* Excerpt an Kartenende */
}

/* Responsive: 3 / 2 / 1 Spalte */

@media (max-width: 1000px) {
    body.home .wp-block-query.alignwide .wp-block-post-template {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 700px) {
    body.home .wp-block-query.alignwide .wp-block-post-template {
        grid-template-columns: 1fr;
    }
}

/* ---------------------------------------------------------
 * Routen-Einzelansicht: Meta-Box
 * ------------------------------------------------------ */

.wl-tour-meta {
    margin-top: var(--wl-spacing-xl);
    margin-bottom: var(--wl-spacing-lg);
    padding: 1.7rem 1.9rem;
    border-radius: var(--wl-radius-lg);
    border: 1px solid var(--wl-color-border-strong);
    background:
        radial-gradient(circle at 0 0, rgba(93, 242, 195, 0.18), transparent 55%),
        rgba(6, 10, 30, 0.88);
    box-shadow: var(--wl-shadow-soft);
    backdrop-filter: blur(18px);
}

.wl-tour-meta__headline {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 1.2rem;
    margin-bottom: 1rem;
}

.wl-tour-meta__headline::before {
    content: "🛣️";
    font-size: 1.2rem;
}

.wl-tour-meta__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 0.9rem 1.2rem;
}

.wl-tour-meta__item {
    padding: 0.4rem 0.4rem;
    border-radius: 10px;
    border: 1px solid var(--wl-color-border-soft);
    background: rgba(3, 5, 18, 0.78);
}

.wl-tour-meta__item--full {
    grid-column: 1 / -1;
}

.wl-tour-meta__label {
    display: block;
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--wl-color-text-muted);
    margin-bottom: 0.1rem;
}

.wl-tour-meta__value {
    font-size: 0.96rem;
}

/* ---------------------------------------------------------
 * Routen-Archiv /route/ (Tabelle)
 * ------------------------------------------------------ */

.wl-route-filter {
    display: none; /* Filter-Panel aktuell nicht im Einsatz */
}

.wl-route-layout {
    display: block;
}

.wl-route-table-wrapper {
    margin-top: 1.5rem;
}

/* Tabelle im Glas-Look */

.wl-route-table table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
    background:
        radial-gradient(circle at 0 0, rgba(93, 242, 195, 0.14), transparent 55%),
        rgba(6, 10, 30, 0.9);
    border-radius: var(--wl-radius-md);
    overflow: hidden;
    box-shadow: var(--wl-shadow-soft);
}

.wl-route-table thead th {
    text-align: left;
    padding: 0.75rem 1rem;
    background: linear-gradient(
        90deg,
        rgba(93, 242, 195, 0.16),
        rgba(6, 10, 30, 0.96)
    );
    border-bottom: 1px solid var(--wl-color-border-strong);
    font-weight: 600;
    letter-spacing: 0.07em;
    text-transform: uppercase;
    font-size: 0.78rem;
    color: var(--wl-color-text-muted);
}

.wl-route-table tbody td {
    padding: 0.6rem 1rem;
    border-bottom: 1px solid var(--wl-color-border-soft);
    vertical-align: middle;
}

.wl-route-table tbody tr:nth-child(even) {
    background: rgba(255, 255, 255, 0.015);
}

.wl-route-table tbody tr:hover {
    background: radial-gradient(circle at 0 0, rgba(93, 242, 195, 0.16), transparent 60%);
}

/* Titelspalte */

.wl-route-table__col-title .wp-block-post-title {
    font-weight: 600;
    font-size: 0.98rem;
}

/* Distanzspalte */

.wl-route-table__col-distance {
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

/* Pagination */

.wl-route-pagination {
    margin-top: 1.4rem;
    font-size: 0.9rem;
}

.wl-route-pagination .page-numbers {
    padding: 0.2rem 0.55rem;
    margin: 0 0.12rem;
    border-radius: 999px;
    border: 1px solid transparent;
}

.wl-route-pagination .page-numbers.current {
    border-color: var(--wl-color-accent);
}

/* Mobile: Route-Tabelle als Karten */

@media (max-width: 782px) {
    .wl-route-table table,
    .wl-route-table thead,
    .wl-route-table tbody,
    .wl-route-table th,
    .wl-route-table td,
    .wl-route-table tr {
        display: block;
    }

    .wl-route-table thead {
        display: none;
    }

    .wl-route-table tbody tr {
        margin-bottom: 1rem;
        border-radius: var(--wl-radius-md);
        border: 1px solid var(--wl-color-border-soft);
        overflow: hidden;
    }

    .wl-route-table tbody td {
        border-bottom: 0;
        padding: 0.45rem 0.9rem;
    }

    .wl-route-table tbody td::before {
        display: block;
        font-size: 0.74rem;
        text-transform: uppercase;
        letter-spacing: 0.07em;
        opacity: 0.75;
        margin-bottom: 0.1rem;
        color: var(--wl-color-text-muted);
    }

    .wl-route-table tbody td:nth-child(1)::before { content: "Linie"; }
    .wl-route-table tbody td:nth-child(2)::before { content: "Start/Ziel"; }
    .wl-route-table tbody td:nth-child(3)::before { content: "Region"; }
    .wl-route-table tbody td:nth-child(4)::before { content: "Distanz"; }
    .wl-route-table tbody td:nth-child(5)::before { content: "Schwierigkeit"; }
}
