/*
Theme Name: Spielwelt
Theme URI: http://ludomax.de
Author: Ludomax
Description: Spielregeln & Spielwissen Portal Theme
Version: 1.0.0
Text Domain: spielwelt
*/

/* === Reset & Base === */
:root {
    --clr-teal: #0FA3A3;
    --clr-teal-dark: #0B8585;
    --clr-teal-light: #e6f7f7;
    --clr-brown: #7B4B3A;
    --clr-brown-light: #a06b55;
    --clr-cream: #faf8f5;
    --clr-white: #ffffff;
    --c-text: #2d2d2d;
    --c-text-light: #5a5a5a;
    --c-border: #e2ddd8;
    --c-bg-alt: #f3efeb;
    --wrap-width: 1140px;
    --font-heading: 'DM Serif Display', Georgia, serif;
    --font-body: 'DM Sans', 'Segoe UI', sans-serif;
}

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

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

body {
    font-family: var(--font-body);
    color: var(--c-text);
    background: var(--clr-cream);
    line-height: 1.7;
}

a { color: var(--clr-teal); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--clr-teal-dark); }

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

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--c-text);
    line-height: 1.3;
    margin-bottom: 0.5em;
}

h1 { font-size: 2.2rem; }
h2 { font-size: 1.7rem; }
h3 { font-size: 1.35rem; }

p { margin-bottom: 1rem; }

/* === Layout === */
.content-wrap {
    max-width: var(--wrap-width);
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* === Masthead === */
.masthead {
    background: var(--clr-white);
    border-bottom: 3px solid var(--clr-teal);
    padding: 0.8rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.masthead .content-wrap {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.brand-mark {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex-shrink: 0;
}

.brand-mark img {
    height: 48px;
    width: auto;
}

.brand-mark span {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--clr-teal-dark);
}

/* === Header Search === */
.header-search {
    display: flex;
    align-items: center;
    background: var(--c-bg-alt);
    border: 1px solid var(--c-border);
    overflow: hidden;
    flex: 0 1 280px;
    margin-left: auto;
}

.header-search input {
    border: none;
    background: transparent;
    padding: 0.4rem 0.7rem;
    font-family: var(--font-body);
    font-size: 0.9rem;
    flex: 1;
    min-width: 0;
    outline: none;
}

.header-search button {
    border: none;
    background: var(--clr-teal);
    color: var(--clr-white);
    padding: 0.4rem 0.65rem;
    cursor: pointer;
    font-size: 0.9rem;
    line-height: 1;
    flex-shrink: 0;
    transition: background 0.2s;
}

.header-search button:hover {
    background: var(--clr-teal-dark);
}

/* === Navigation === */
.site-nav ul {
    list-style: none;
    display: flex;
    gap: 1.8rem;
}

.site-nav a {
    color: var(--c-text);
    font-weight: 500;
    font-size: 0.95rem;
    padding: 0.3rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s;
}

.site-nav a:hover,
.site-nav .current-menu-item a {
    border-color: var(--clr-teal);
    color: var(--clr-teal);
}

/* === Dropdown Menu === */
.site-nav li {
    position: relative;
}

.site-nav ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    flex-direction: column;
    background: var(--clr-white);
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    min-width: 180px;
    padding: 0.4rem 0;
    gap: 0;
    z-index: 100;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.site-nav li:hover > ul {
    display: flex;
}

.site-nav ul ul a {
    padding: 0.45rem 1rem;
    font-size: 0.88rem;
    border-bottom: none;
    white-space: nowrap;
}

.site-nav ul ul a:hover {
    background: var(--clr-teal-light);
    color: var(--clr-teal);
}

.ham-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--c-text);
    padding: 0.3rem;
}

/* === Main Content === */
.page-main {
    padding: 2.5rem 0;
    min-height: 60vh;
}

/* === Hero Banner (Front Page) === */
.hero-banner {
    background: linear-gradient(135deg, var(--clr-teal-light) 0%, var(--clr-cream) 100%);
    padding: 3rem 0;
    margin-bottom: 0;
}

.hero-banner .content-wrap {
    display: flex;
    align-items: center;
    gap: 2.5rem;
}

.hero-text {
    flex: 1;
}

.hero-text h1 {
    font-size: 2.4rem;
    margin-bottom: 0.7rem;
    color: var(--c-text);
}

.hero-text p {
    font-size: 1.1rem;
    color: var(--c-text-light);
    margin-bottom: 1.5rem;
    max-width: 520px;
}

.hero-img {
    flex: 0 0 380px;
    border-bottom: 3px solid var(--clr-teal);
    overflow: hidden;
}

.hero-img img {
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
}

/* === Hero Search === */
.hero-search {
    display: flex;
    max-width: 480px;
}

.hero-search input {
    flex: 1;
    padding: 0.75rem 1rem;
    border: 2px solid var(--c-border);
    border-right: none;
    font-family: var(--font-body);
    font-size: 1rem;
    outline: none;
    background: var(--clr-white);
}

.hero-search input:focus {
    border-color: var(--clr-teal);
}

.hero-search button {
    padding: 0.75rem 1.5rem;
    background: var(--clr-teal);
    color: var(--clr-white);
    border: 2px solid var(--clr-teal);
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
}

.hero-search button:hover {
    background: var(--clr-teal-dark);
    border-color: var(--clr-teal-dark);
}

/* === Home Sections === */
.home-section {
    padding: 3rem 0;
}

.home-section.bg-alt {
    background: var(--c-bg-alt);
}

.section-heading {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--clr-teal);
    display: inline-block;
}

.section-cta {
    margin-top: 1.5rem;
    text-align: center;
}

.section-cta a {
    font-weight: 600;
    font-size: 1.05rem;
}

/* === Kategorie Tiles === */
.kat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1rem;
}

.kat-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1.5rem 1rem;
    background: var(--clr-white);
    border-bottom: 3px solid var(--c-border);
    text-align: center;
    transition: border-color 0.2s;
}

.kat-tile:hover {
    border-color: var(--clr-teal);
}

.kat-tile__icon {
    font-size: 2.2rem;
    margin-bottom: 0.5rem;
    display: block;
}

.kat-tile__name {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    color: var(--c-text);
    display: block;
    margin-bottom: 0.2rem;
}

.kat-tile__count {
    font-size: 0.8rem;
    color: var(--c-text-light);
}

/* === Filter Bar (Archive) === */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.filter-tag {
    padding: 0.35rem 0.9rem;
    background: var(--clr-white);
    border: 1px solid var(--c-border);
    font-size: 0.85rem;
    color: var(--c-text);
    transition: background 0.2s, border-color 0.2s;
}

.filter-tag:hover,
.filter-tag.is-active {
    background: var(--clr-teal);
    border-color: var(--clr-teal);
    color: var(--clr-white);
}

/* === Archive Intro === */
.archive-intro {
    color: var(--c-text-light);
    font-size: 1.05rem;
    margin-bottom: 2rem;
    max-width: 680px;
}

/* === Cards === */
.game-card {
    background: var(--clr-white);
    border-bottom: 3px solid var(--c-border);
    padding: 1.2rem;
    margin-bottom: 1.5rem;
    transition: border-color 0.2s;
}

.game-card:hover {
    border-color: var(--clr-teal);
}

.game-card__thumb {
    margin-bottom: 0.8rem;
    overflow: hidden;
}

.game-card__thumb img {
    width: 100%;
    aspect-ratio: 16/10;
    object-fit: cover;
}

.game-card__title {
    font-size: 1.15rem;
    margin-bottom: 0.3rem;
}

.game-card__title a {
    color: var(--c-text);
}

.game-card__title a:hover {
    color: var(--clr-teal);
}

.game-card__excerpt {
    color: var(--c-text-light);
    font-size: 0.9rem;
    line-height: 1.6;
}

.game-card__meta {
    font-size: 0.8rem;
    color: var(--c-text-light);
    margin-top: 0.5rem;
    display: flex;
    gap: 1rem;
}

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

/* === Spielregel Single Layout === */
.spielregel-layout {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
}

.spielregel-sidebar {
    flex: 0 0 260px;
    position: sticky;
    top: 80px;
}

.spielregel-layout .entry-body {
    flex: 1;
    min-width: 0;
}

/* === Single Post/Page === */
.entry-header {
    margin-bottom: 2rem;
}

.entry-header h1 {
    margin-bottom: 0.5rem;
}

.entry-meta {
    color: var(--c-text-light);
    font-size: 0.85rem;
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.entry-hero {
    margin-bottom: 2rem;
    border-bottom: 3px solid var(--clr-teal);
}

.entry-hero img {
    width: 100%;
    aspect-ratio: 21/9;
    object-fit: cover;
}

.entry-body {
    max-width: 780px;
    font-size: 1.05rem;
}

.entry-body h2 {
    margin-top: 2rem;
    padding-bottom: 0.3rem;
    border-bottom: 2px solid var(--c-border);
}

.entry-body h3 { margin-top: 1.5rem; }

.entry-body ul, .entry-body ol {
    margin: 1rem 0 1rem 1.5rem;
}

.entry-body li { margin-bottom: 0.4rem; }

.entry-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
}

.entry-body th, .entry-body td {
    padding: 0.6rem 0.8rem;
    text-align: left;
    border-bottom: 1px solid var(--c-border);
}

.entry-body th {
    background: var(--c-bg-alt);
    font-weight: 600;
}

/* === Related Games Section === */
.related-games {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid var(--c-border);
}

.related-games h2 {
    margin-bottom: 1.2rem;
}

/* === Breadcrumb === */
.breadcrumb-bar {
    background: var(--c-bg-alt);
    padding: 0.6rem 0;
    font-size: 0.85rem;
    color: var(--c-text-light);
}

.breadcrumb-bar a {
    color: var(--c-text-light);
}

.breadcrumb-bar a:hover {
    color: var(--clr-teal);
}

/* === Footer === */
.page-footer {
    background: var(--c-text);
    color: var(--clr-cream);
    padding: 2.5rem 0 1.5rem;
    margin-top: 3rem;
}

.footer-grid {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
    flex-wrap: wrap;
}

.footer-col {
    flex: 1;
    min-width: 200px;
}

.footer-col h4 {
    color: var(--clr-cream);
    font-size: 1rem;
    margin-bottom: 0.8rem;
    font-family: var(--font-body);
    font-weight: 600;
}

.footer-col a {
    color: rgba(250, 248, 245, 0.7);
    display: block;
    padding: 0.2rem 0;
    font-size: 0.9rem;
}

.footer-col a:hover { color: var(--clr-cream); }

.footer-bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(250, 248, 245, 0.15);
    text-align: center;
    font-size: 0.8rem;
    color: rgba(250, 248, 245, 0.5);
}

/* === Druckbare Spielhilfen (Homepage) === */
.druckbar-intro {
    max-width: 680px;
    color: var(--c-text-light);
    font-size: 1.05rem;
    margin-bottom: 2rem;
}

.druckbar-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.druckbar-card {
    background: var(--clr-white);
    padding: 1.8rem 1.5rem;
    border-bottom: 3px solid var(--c-border);
    transition: border-color 0.2s;
}

.druckbar-card:hover {
    border-color: var(--clr-teal);
}

.druckbar-card__icon {
    margin-bottom: 1rem;
}

.druckbar-card__title {
    font-size: 1.15rem;
    margin-bottom: 0.5rem;
}

.druckbar-card p {
    color: var(--c-text-light);
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 0;
}

@media (max-width: 768px) {
    .druckbar-grid { grid-template-columns: 1fr; }
}

/* === SVG Infographic === */
.infographic-wrap {
    background: var(--clr-white);
    border: 1px solid var(--c-border);
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.infographic-wrap svg {
    max-width: 100%;
    height: auto;
}

.btn-print {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.5rem 1.5rem;
    background: var(--clr-teal);
    color: var(--clr-white);
    font-weight: 500;
    font-size: 0.9rem;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
    text-align: center;
}

.btn-print:hover {
    background: var(--clr-teal-dark);
    color: var(--clr-white);
}

/* === Author Box === */
.author-box {
    display: flex;
    gap: 1.2rem;
    padding: 1.5rem;
    background: var(--c-bg-alt);
    margin-top: 2.5rem;
    border-bottom: 3px solid var(--clr-brown);
}

.author-box__photo img {
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.author-box__name {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.author-box__bio {
    font-size: 0.9rem;
    color: var(--c-text-light);
}

/* === Sidebar / Game Meta Widget === */
.game-meta-box {
    background: var(--clr-white);
    border-bottom: 3px solid var(--clr-brown);
    padding: 1.2rem;
    margin-bottom: 1rem;
}

.game-meta-box h3 {
    font-size: 1rem;
    margin-bottom: 0.8rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--c-border);
}

.game-meta-box dt {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--c-text-light);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.game-meta-box dd {
    margin: 0 0 0.8rem;
    font-size: 1rem;
}

/* === Pagination === */
.nav-links {
    display: flex;
    justify-content: center;
    gap: 0.3rem;
    margin-top: 2.5rem;
}

.nav-links a,
.nav-links span {
    padding: 0.4rem 0.8rem;
    font-size: 0.9rem;
    border: 1px solid var(--c-border);
    background: var(--clr-white);
    color: var(--c-text);
}

.nav-links .current {
    background: var(--clr-teal);
    border-color: var(--clr-teal);
    color: var(--clr-white);
}

.nav-links a:hover {
    border-color: var(--clr-teal);
    color: var(--clr-teal);
}

/* === Responsive === */
@media (max-width: 768px) {
    .header-search { display: none; }
    .site-nav { display: none; }
    .site-nav.is-open {
        display: block;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--clr-white);
        border-bottom: 3px solid var(--clr-teal);
        padding: 1rem 1.5rem;
    }
    .site-nav.is-open ul {
        flex-direction: column;
        gap: 0.5rem;
    }
    .site-nav ul ul {
        position: static;
        border: none;
        box-shadow: none;
        min-width: 0;
        padding-left: 1rem;
    }
    .site-nav li:hover > ul {
        display: flex;
    }
    .ham-btn { display: block; }

    h1 { font-size: 1.7rem; }

    .hero-banner .content-wrap {
        flex-direction: column;
        text-align: center;
    }
    .hero-text h1 { font-size: 1.8rem; }
    .hero-text p { margin-left: auto; margin-right: auto; }
    .hero-search { margin: 0 auto; }
    .hero-img { flex: none; width: 100%; }

    .card-grid { grid-template-columns: 1fr; }
    .kat-grid { grid-template-columns: repeat(2, 1fr); }

    .spielregel-layout {
        flex-direction: column;
    }
    .spielregel-sidebar {
        flex: none;
        width: 100%;
        position: static;
    }

    .footer-grid { flex-direction: column; }
}

@media (max-width: 480px) {
    .kat-grid { grid-template-columns: 1fr; }
}

/* === Print === */
@media print {
    .masthead, .page-footer, .breadcrumb-bar, .site-nav, .ham-btn,
    .btn-print, .header-search, .hero-search, .filter-bar,
    .related-games, .section-cta { display: none; }

    .infographic-wrap {
        border: none;
        padding: 0;
        page-break-inside: avoid;
    }

    .infographic-wrap svg {
        width: 100%;
        max-height: 90vh;
    }

    body {
        background: white;
        color: #000;
        font-size: 12pt;
    }

    .spielregel-layout { display: block; }
    .spielregel-sidebar { width: 100%; position: static; margin-bottom: 1rem; }

    .game-meta-box {
        border: 1px solid #ccc;
        page-break-inside: avoid;
    }

    a { color: #000; }

    .entry-body { max-width: none; }
}

/* Infographic print styles */
@media print {
    .spielfeld-infografik {
        page-break-inside: avoid;
        margin: 1em 0;
    }
    .spielfeld-infografik img {
        max-width: 100%;
        height: auto;
    }
    .spielfeld-infografik figcaption a {
        display: none;
    }
}

/* Infographic responsive */
.spielfeld-infografik img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}
.spielfeld-infografik figcaption {
    font-family: var(--font-body);
    font-size: 0.9em;
    color: var(--c-text-light);
    margin-top: 0.5em;
}

/* ========================================
   Spiele-Finder Widget
   ======================================== */
.spiele-finder { margin: 1.5rem 0; }

.sf-filters {
    background: var(--clr-white);
    border: 2px solid var(--c-border);
    border-radius: 6px;
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
}

.sf-filter-row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.sf-filter-group {
    flex: 1 1 140px;
    min-width: 120px;
}

.sf-filter-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-text-light);
    margin-bottom: 0.3rem;
}

.sf-filter-group select {
    width: 100%;
    padding: 0.5rem 0.7rem;
    border: 1px solid var(--c-border);
    border-radius: 4px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--clr-cream);
    color: var(--c-text);
    cursor: pointer;
    transition: border-color 0.2s;
}

.sf-filter-group select:focus {
    outline: none;
    border-color: var(--clr-teal);
}

.sf-active-count {
    margin-top: 0.8rem;
    font-size: 0.9rem;
    color: var(--c-text-light);
}

.sf-count {
    font-weight: 700;
    color: var(--clr-teal);
}

/* Results Grid */
.sf-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
}

.sf-card {
    display: flex;
    flex-direction: column;
    background: var(--clr-white);
    border: 1px solid var(--c-border);
    border-radius: 6px;
    overflow: hidden;
    transition: border-color 0.2s;
    color: var(--c-text);
    text-decoration: none;
}

.sf-card:hover {
    border-color: var(--clr-teal);
    color: var(--c-text);
}

.sf-card__img { overflow: hidden; }

.sf-card__img img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    display: block;
}

.sf-card__body { padding: 0.8rem 1rem; }

.sf-card__title {
    font-family: var(--font-heading);
    font-size: 1.05rem;
    margin: 0 0 0.5rem;
    line-height: 1.3;
}

.sf-card__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.sf-tag {
    display: inline-block;
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--clr-teal-light);
    color: var(--clr-teal-dark);
    border-radius: 3px;
    font-weight: 500;
}

.sf-empty {
    text-align: center;
    padding: 2rem;
    color: var(--c-text-light);
    font-style: italic;
}

.sf-more-link {
    margin-top: 1rem;
    text-align: center;
}

.sf-more-link a {
    font-weight: 700;
    color: var(--clr-teal);
}

.finder-intro {
    color: var(--c-text-light);
    margin-bottom: 1rem;
}

/* Compact variant */
.spiele-finder--compact .sf-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 0.8rem;
}

.spiele-finder--compact .sf-card__body { padding: 0.6rem 0.8rem; }

/* ========================================
   Spieler-Info-Box (single spielregel)
   ======================================== */
.spieler-info-box {
    background: linear-gradient(135deg, var(--clr-teal-light) 0%, #f0fafa 100%);
    border-left: 4px solid var(--clr-teal);
    border-radius: 0 6px 6px 0;
    padding: 1rem 1.2rem;
    margin: 1.5rem 0;
}

.sib-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 1.2rem;
}

.sib-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    text-align: center;
}

.sib-icon {
    font-size: 1.5rem;
    line-height: 1;
    margin-bottom: 0.2rem;
}

.sib-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--c-text-light);
    font-weight: 500;
}

.sib-value {
    font-family: var(--font-heading);
    font-size: 1rem;
    color: var(--clr-teal-dark);
    font-weight: 700;
}

.sib-material {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(15, 163, 163, 0.2);
    font-size: 0.9rem;
    color: var(--c-text);
}

@media (max-width: 600px) {
    .sf-filter-row { flex-direction: column; }
    .sf-grid { grid-template-columns: 1fr; }
    .sib-grid { gap: 0.8rem; }
    .sib-item { min-width: 60px; }
}
