/*
Theme Name:     Wertesehnsucht
Theme URI:      https://www.frankbilstein.de/software/wertesehnsucht
Description:    Nostalgisches Zeitungs-Theme im 80er-Zeitungslook. 3x3 Kategorie-Grid plus Fußball-Kachel mit Ergebnissen/Tabellen aller drei Bundesligen.
Version:        1.6.0
Author:         Frank Bilstein
Author URI:     https://www.frankbilstein.de
License:        CC BY-NC-ND 4.0 – Keine Weitergabe
License URI:    https://creativecommons.org/licenses/by-nc-nd/4.0/
Text Domain:    wertesehnsucht
Requires PHP:   8.4
Requires at least: 6.9.0
Tags:           newspaper, retro, blog, nostalgic
*/

/* ============================================================
   DESIGN SYSTEM – WERTESEHNSUCHT
   80er Zeitungslook
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,700;0,900;1,400;1,700&family=Merriweather:ital,wght@0,400;0,700;0,900;1,400;1,700&family=IM+Fell+English:ital@0;1&family=Special+Elite&display=swap');

:root {
    /* === ZEITUNG FARBEN === */
    --ws-paper:         #f5f0e8;       /* vergilbtes Papier */
    --ws-paper-dark:    #ede5d0;       /* dunkleres Papier für Karten */
    --ws-paper-shadow:  #d4c9b0;       /* Schatten/Falten */
    --ws-ink:           #1a1208;       /* Druckerschwärze */
    --ws-ink-light:     #3d3020;       /* helleres Schwarz */
    --ws-ink-faded:     #6b5d4a;       /* verblasste Schrift */
    --ws-rule:          #2a1f0e;       /* Trennlinien */
    --ws-red:           #8b1a1a;       /* Rubrik-Rot (klassisch) */
    --ws-sepia:         #704214;       /* Sepia-Ton */
    --ws-cream:         #faf6ed;       /* helles Creme */

    /* === TYPOGRAFIE === */
    --font-masthead:    'Playfair Display', serif;        /* Zeitungstitel - Masthead */
    --font-headline:    'Merriweather', serif;             /* Schlagzeilen – kräftig, gut lesbar, weniger eckig als Playfair */
    --font-body:        'IM Fell English', serif;         /* Fließtext */
    --font-caption:     'Special Elite', cursive;         /* Bildunterschriften */

    /* === LAYOUT === */
    --ws-max-width:     1280px;
    --ws-column-gap:    16px;
    --ws-border:        2px solid var(--ws-rule);
    --ws-border-thin:   1px solid var(--ws-rule);
    --ws-border-thick:  4px solid var(--ws-rule);

    /* === SCHATTEN & TEXTUR === */
    --ws-shadow:        2px 2px 0 var(--ws-paper-shadow);
    --ws-shadow-deep:   4px 4px 8px rgba(0,0,0,0.3);
}

/* ============================================================
   RESET & BASIS
   ============================================================ */

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    background-color: #2a2010;
    background-image:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 29px,
            rgba(0,0,0,0.08) 29px,
            rgba(0,0,0,0.08) 30px
        );
    font-family: var(--font-body);
    color: var(--ws-ink);
    line-height: 1.6;
    min-height: 100vh;
}

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

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

a:hover {
    color: var(--ws-red);
    text-decoration: underline;
}

/* ============================================================
   PAPIER-TEXTUR HELPER
   ============================================================ */

.paper-texture {
    background-color: var(--ws-paper);
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E"),
        linear-gradient(
            180deg,
            var(--ws-cream) 0%,
            var(--ws-paper) 20%,
            var(--ws-paper-dark) 80%,
            var(--ws-paper-shadow) 100%
        );
}

/* ============================================================
   WRAPPER
   ============================================================ */

#ws-wrapper {
    max-width: var(--ws-max-width);
    margin: 20px auto;
    box-shadow: 0 0 40px rgba(0,0,0,0.7), 0 0 80px rgba(0,0,0,0.4);
}

/* ============================================================
   KOPFZEILE / MASTHEAD
   ============================================================ */

#ws-topbar {
    background-color: var(--ws-ink);
    color: var(--ws-paper);
    padding: 4px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: var(--font-caption);
    font-size: 0.75rem;
    letter-spacing: 1px;
    border-bottom: 2px solid var(--ws-red);
}

#ws-topbar .ws-motto {
    font-style: italic;
    color: var(--ws-paper-shadow);
}

#ws-masthead {
    background-color: var(--ws-paper);
    background-image: linear-gradient(180deg, var(--ws-cream) 0%, var(--ws-paper) 100%);
    padding: 16px 20px 0;
    border-bottom: var(--ws-border-thick);
    position: relative;
    overflow: hidden;
}

/* Wasserzeichen-Effekt */
#ws-masthead::before {
    content: "WERTESEHNSUCHT";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-20deg);
    font-family: var(--font-masthead);
    font-size: 8rem;
    color: rgba(0,0,0,0.03);
    white-space: nowrap;
    pointer-events: none;
    z-index: 0;
}

.ws-masthead-inner {
    position: relative;
    z-index: 1;
    text-align: center;
    padding-bottom: 12px;
}

.ws-site-title {
    font-family: var(--font-masthead);
    font-size: clamp(3.5rem, 8vw, 7rem);
    line-height: 0.9;
    color: var(--ws-ink);
    letter-spacing: -1px;
    text-shadow: 3px 3px 0 var(--ws-paper-shadow);
    display: block;
}

.ws-site-title a {
    color: inherit;
    text-decoration: none;
}

.ws-site-title a:hover {
    color: var(--ws-red);
    text-decoration: none;
}

.ws-masthead-rule {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 8px 0;
}

.ws-masthead-rule::before,
.ws-masthead-rule::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--ws-rule);
}

.ws-site-tagline {
    font-family: var(--font-caption);
    font-size: 0.8rem;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: var(--ws-ink-faded);
}

/* Masthead Datums-/Ausgabe-Zeile */
.ws-edition-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: var(--ws-border-thin);
    border-bottom: var(--ws-border-thin);
    padding: 4px 0;
    font-family: var(--font-caption);
    font-size: 0.72rem;
    color: var(--ws-ink-faded);
    letter-spacing: 0.5px;
    margin-top: 8px;
}

.ws-edition-bar .ws-price {
    font-weight: bold;
    color: var(--ws-red);
}

/* ============================================================
   HERO BILD BEREICH
   ============================================================ */

#ws-hero {
    position: relative;
    width: 100%;
    height: 380px;
    overflow: hidden;
    border-bottom: var(--ws-border-thick);
}

#ws-hero img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: sepia(30%) contrast(1.1) brightness(0.9);
}

#ws-hero .ws-hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(10,8,3,0.85));
    padding: 40px 30px 24px;
}

#ws-hero .ws-hero-kicker {
    font-family: var(--font-caption);
    font-size: 0.75rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ws-red);
    display: block;
    margin-bottom: 6px;
}

#ws-hero .ws-hero-headline {
    font-family: var(--font-headline);
    font-size: clamp(1.8rem, 3.5vw, 3rem);
    color: var(--ws-paper);
    line-height: 1.15;
    font-weight: 900;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.8);
    max-width: 70%;
}

#ws-hero .ws-hero-sub {
    font-family: var(--font-body);
    font-style: italic;
    color: var(--ws-paper-shadow);
    font-size: 1rem;
    margin-top: 8px;
    max-width: 60%;
}

/* ============================================================
   NAVIGATION
   ============================================================ */

#ws-nav {
    background-color: var(--ws-ink);
    border-bottom: 2px solid var(--ws-red);
}

#ws-nav ul {
    list-style: none;
    display: flex;
    justify-content: center;
    gap: 0;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
}

#ws-nav ul li a {
    display: block;
    padding: 8px 18px;
    font-family: var(--font-caption);
    font-size: 0.78rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--ws-paper-shadow);
    border-right: 1px solid rgba(255,255,255,0.1);
    transition: background 0.15s, color 0.15s;
}

#ws-nav ul li a:hover,
#ws-nav ul li.current-menu-item a {
    background-color: var(--ws-red);
    color: var(--ws-paper);
    text-decoration: none;
}

/* ============================================================
   HAUPT-GRID: 3×3 ZEITUNGSFENSTER
   ============================================================ */

#ws-main {
    background-color: var(--ws-paper);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    padding: 0;
}

.ws-newspaper-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: auto;
    border-left: var(--ws-border-thick);
    border-top: var(--ws-border-thick);
}

/* ============================================================
   EINZELNES KATEGORIE-FENSTER
   ============================================================ */

.ws-kategorie-fenster {
    border-right: var(--ws-border-thick);
    border-bottom: var(--ws-border-thick);
    padding: 0;
    background-color: var(--ws-paper);
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 480px;
}

/* Kategorie-Header im Fenster */
.ws-fenster-header {
    background-color: var(--ws-ink);
    padding: 6px 12px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    border-bottom: 2px solid var(--ws-red);
}

.ws-fenster-kname {
    grid-column: 2;
    font-family: var(--font-caption);
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ws-paper);
    text-align: center;
    white-space: nowrap;
}

.ws-fenster-dots {
    grid-column: 3;
    display: flex;
    justify-content: flex-end;
    gap: 3px;
}

.ws-fenster-dots span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--ws-paper-shadow);
}

/* Artikel im Fenster */
.ws-artikel {
    padding: 14px;
    flex: 1;
    display: flex;
    flex-direction: column;
    border-bottom: 1px dashed var(--ws-paper-shadow);
}

.ws-artikel:last-child {
    border-bottom: none;
}

.ws-artikel-bild {
    width: 100%;
    height: 160px;
    object-fit: cover;
    margin-bottom: 10px;
    filter: sepia(15%) contrast(1.05);
    border: 1px solid var(--ws-paper-shadow);
}

.ws-artikel-kbutton {
    display: inline-block;
    background-color: var(--ws-ink);
    color: var(--ws-paper);
    font-family: var(--font-caption);
    font-size: 0.6rem;
    letter-spacing: 2px;
    text-transform: uppercase;
    padding: 3px 8px;
    margin-bottom: 8px;
    align-self: center;
}

.ws-artikel-kbutton:hover {
    background-color: var(--ws-red);
    color: var(--ws-paper);
    text-decoration: none;
}

.ws-artikel-titel {
    font-family: var(--font-headline);
    font-size: 1.05rem;
    font-weight: 700;
    line-height: 1.25;
    margin-bottom: 6px;
    color: var(--ws-ink);
}

.ws-artikel-titel a {
    color: inherit;
}

.ws-artikel-titel a:hover {
    color: var(--ws-red);
    text-decoration: none;
}

.ws-artikel-text {
    font-family: var(--font-body);
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--ws-ink-light);
    font-style: italic;
    flex: 1;
}


/* Platzhalter wenn keine Artikel */
.ws-fenster-leer {
    padding: 30px 14px;
    text-align: center;
    font-family: var(--font-body);
    font-style: italic;
    color: var(--ws-paper-shadow);
    font-size: 0.85rem;
}

/* ============================================================
   FUSSBALL-KACHEL (volle Breite, letzte Position im Grid)
   Bindet das BLT-Plugin (Bundesliga Tipps & Ergebnisse) ein –
   Ligen-Tabs, Spieltag-Ergebnisse und Tabellen für 1./2./3. Liga.
   ============================================================ */

.ws-kategorie-fenster.ws-fussball-fenster {
    grid-column: 1 / -1;
    min-height: 0;
}

.ws-fussball-inhalt {
    padding: 16px;
    background-color: var(--ws-paper);
}

/* BLT-Plugin-Widget optisch an den Zeitungslook angleichen */
.ws-fussball-inhalt .blt-widget {
    font-family: var(--font-body);
}

/* ============================================================
   HORIZONTALE TRENNLINIE MIT ORNAMENT
   ============================================================ */

.ws-ornament-rule {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    background: var(--ws-paper);
    border-bottom: var(--ws-border-thin);
}

.ws-ornament-rule::before,
.ws-ornament-rule::after {
    content: '────────────◆────────────';
    flex: 1;
    font-size: 0.7rem;
    color: var(--ws-paper-shadow);
    letter-spacing: 0;
}

/* ============================================================
   FOOTER
   ============================================================ */

#ws-footer {
    background-color: var(--ws-ink);
    color: var(--ws-paper-shadow);
    padding: 20px;
    border-top: 4px solid var(--ws-red);
}

.ws-footer-inner {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.ws-footer-col h4 {
    font-family: var(--font-caption);
    font-size: 0.7rem;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--ws-paper);
    margin-bottom: 8px;
    padding-bottom: 4px;
    border-bottom: 1px solid var(--ws-red);
}

.ws-footer-col p,
.ws-footer-col ul {
    font-family: var(--font-body);
    font-size: 0.8rem;
    line-height: 1.6;
    font-style: italic;
}

.ws-footer-col ul {
    list-style: none;
}

.ws-footer-col ul li a {
    color: var(--ws-paper-shadow);
}

.ws-footer-col ul li a:hover {
    color: var(--ws-paper);
}

.ws-footer-bottom {
    text-align: center;
    font-family: var(--font-caption);
    font-size: 0.65rem;
    letter-spacing: 2px;
    color: var(--ws-ink-faded);
    text-transform: uppercase;
}

/* ============================================================
   EINZELNER ARTIKEL (single.php)
   ============================================================ */

.ws-article-wrap {
    width: 90%;
    margin: 8px auto;
    padding: 20px 30px 30px;
    background-color: var(--ws-paper);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='400' height='400'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='400' height='400' filter='url(%23noise)' opacity='0.03'/%3E%3C/svg%3E");
    box-shadow: var(--ws-shadow-deep);
}

.ws-article-kicker {
    display: block;
    text-align: center;
    margin-bottom: 14px;
}

.ws-article-title {
    font-family: var(--font-headline);
    font-size: clamp(1.8rem, 3vw, 2.8rem);
    font-weight: 900;
    line-height: 1.15;
    color: var(--ws-ink);
    margin-bottom: 20px;
}

.ws-article-featured-img {
    width: 100%;
    height: 320px;
    object-fit: cover;
    margin-bottom: 20px;
    filter: sepia(20%) contrast(1.05);
    border: 1px solid var(--ws-paper-shadow);
}

.ws-article-content {
    font-family: var(--font-body);
    font-size: 1rem;
    line-height: 1.75;
    color: var(--ws-ink-light);
}

.ws-article-content p {
    margin-bottom: 1.2em;
}

.ws-article-content h2 {
    font-family: var(--font-headline);
    font-size: 1.5rem;
    font-weight: 700;
    margin: 1.5em 0 0.5em;
    color: var(--ws-ink);
}

.ws-article-content h3 {
    font-family: var(--font-headline);
    font-size: 1.2rem;
    font-style: italic;
    margin: 1.2em 0 0.4em;
    color: var(--ws-ink);
}

.ws-article-content blockquote {
    border-left: 4px solid var(--ws-red);
    padding: 10px 20px;
    margin: 1.5em 0;
    background-color: var(--ws-paper-dark);
    font-style: italic;
    font-size: 1.05rem;
}

/* ============================================================
   RESPONSIVE – TABLET
   ============================================================ */

@media (max-width: 900px) {
    .ws-newspaper-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .ws-footer-inner {
        grid-template-columns: 1fr 1fr;
    }

    #ws-hero .ws-hero-headline {
        max-width: 90%;
    }

    #ws-hero .ws-hero-sub {
        max-width: 85%;
    }
}

/* ============================================================
   RESPONSIVE – MOBIL
   ============================================================ */

@media (max-width: 600px) {
    #ws-topbar {
        flex-direction: column;
        gap: 2px;
        padding: 6px 14px;
        text-align: center;
    }

    .ws-site-title {
        font-size: 3rem;
    }

    #ws-hero {
        height: 240px;
    }

    #ws-hero .ws-hero-headline {
        max-width: 100%;
        font-size: 1.3rem;
    }

    #ws-hero .ws-hero-sub {
        display: none;
    }

    .ws-newspaper-grid {
        grid-template-columns: 1fr;
    }

    .ws-kategorie-fenster {
        min-height: 360px;
    }

    #ws-nav ul {
        justify-content: flex-start;
        overflow-x: auto;
        flex-wrap: nowrap;
        padding: 0 10px;
    }

    #ws-nav ul li a {
        padding: 8px 12px;
        white-space: nowrap;
    }

    .ws-footer-inner {
        grid-template-columns: 1fr;
    }

    .ws-article-wrap {
        width: 94%;
        padding: 16px;
        margin: 10px auto;
    }
}

/* ============================================================
   DRUCK-STILE
   ============================================================ */

@media print {
    #ws-nav,
    #ws-topbar,
    .ws-fussball-inhalt {
        display: none;
    }

    body {
        background: white;
    }

    #ws-wrapper {
        box-shadow: none;
        max-width: 100%;
        margin: 0;
    }
}

/* ============================================================
   SCRABBLE-KACHELN
   WerteSehnSucht Masthead + Kategorien + Shortcode
   ============================================================ */

/* Kachel-Container */
.ws-kachel-wrap {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 4px;
    line-height: 1;
}

/* Wort-Gruppe: hält die Buchstaben eines Worts zusammen, sodass der
   Zeilenumbruch auf schmalen Bildschirmen nur zwischen Wörtern
   passiert, nie mitten im Wort. Innenabstand identisch zum
   Container-Gap, damit sich am Erscheinungsbild nichts ändert. */
.ws-kachel-word {
    display: inline-flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 4px;
}

/* Einzelne Kachel */
.ws-kachel-buchstabe {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #1a1208;
    color: #f5f0e8;
    border: 2px solid #f5f0e8;
    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,0.1),
        2px 2px 4px rgba(0,0,0,0.6),
        0 0 0 1px #000;
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    position: relative;
    user-select: none;
    flex-shrink: 0;
}

/* Masthead-Kacheln: groß */
.ws-masthead-kacheln .ws-kachel-buchstabe {
    width: clamp(42px, 6.5vw, 82px);
    height: clamp(42px, 6.5vw, 82px);
    font-size: clamp(1.4rem, 4vw, 3.2rem);
    border-width: 2px;
}

/* Großbuchstabe in Kachel */
.ws-kachel-buchstabe.ws-gross {
    background: #f5f0e8;
    color: #1a1208;
    border-color: #1a1208;
    font-size: clamp(1.6rem, 4.5vw, 3.6rem);
}

/* Leerzeichen zwischen Wörtern */
.ws-kachel-space {
    width: clamp(8px, 1.5vw, 16px);
    display: inline-block;
}

/* Kategorie-Kacheln: mittel */
.ws-kat-kacheln .ws-kachel-buchstabe {
    width: 28px;
    height: 28px;
    font-size: 0.95rem;
    border-width: 1px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.5);
}

.ws-kat-kacheln .ws-kachel-buchstabe.ws-gross {
    width: 31px;
    height: 31px;
    font-size: 1.05rem;
}

.ws-kat-kacheln {
    justify-content: center;
    gap: 3px;
}

/* Fließtext Shortcode-Kacheln */
.ws-inline-kacheln {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 2px;
    vertical-align: middle;
    line-height: 1;
    margin: 0 2px;
}

.ws-inline-kacheln .ws-kachel-buchstabe {
    width: 1.6em;
    height: 1.6em;
    font-size: 0.85em;
    border-width: 1px;
    box-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

.ws-inline-kacheln .ws-kachel-buchstabe.ws-gross {
    width: 1.8em;
    height: 1.8em;
    font-size: 0.95em;
}

/* ============================================================
   HERO KONTRAST FIX
   ============================================================ */

#ws-hero .ws-hero-overlay {
    background: linear-gradient(
        transparent 0%,
        rgba(5,3,1,0.5) 40%,
        rgba(5,3,1,0.92) 100%
    );
    padding: 60px 30px 28px;
}

#ws-hero .ws-hero-headline {
    color: #ffffff;
    text-shadow:
        0 0 20px rgba(0,0,0,0.9),
        2px 2px 0 rgba(0,0,0,0.8),
        0 2px 8px rgba(0,0,0,1);
    font-weight: 900;
}

#ws-hero .ws-hero-headline a {
    color: #ffffff;
}

#ws-hero .ws-hero-kicker {
    color: #ff6b6b;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.9);
    background: rgba(0,0,0,0.4);
    padding: 2px 8px;
    display: inline-block;
}

/* ============================================================
   CUSTOMIZER LIVE-EDIT BEREICHE
   ============================================================ */

.customize-partial-refreshing {
    outline: 2px dashed #0891b2;
}

