/*
Theme Name: teurepappe
Description: Deutschsprachiges Theme für teurepappe.de (Pokémon-Karten: Kaufberatung, Ratgeber, Sets, Markt) mit Unterbereich "Sammlung". Basis: K-10000-collection.
Version: 2.0.0
Author: Lennart Albrecht
Text Domain: teurepappe
*/

/* Farben, Schriften und Radien kommen aus css/tokens.css (CI). */

/* ---------- Basis ---------- */
html { scroll-behavior: smooth; }

body {
    background: var(--tp-bg);
    color: var(--tp-text);
    font-family: var(--tp-font-body);
    font-size: 1.0625rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5 {
    font-family: var(--tp-font-heading);
    font-weight: 700;
    color: inherit;
}

h1 { font-size: clamp(1.9rem, 4vw, 2.75rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.85rem); }
h3 { font-size: 1.25rem; }

a {
    color: var(--tp-link);
    text-underline-offset: 3px;
    transition: color var(--tp-transition), opacity var(--tp-transition);
}
a:hover { opacity: 0.85; }
a:focus-visible, .btn:focus-visible, .nav-link:focus-visible {
    outline: 3px solid var(--tp-cobalt);
    outline-offset: 2px;
    box-shadow: none;
}
.tp-dark a:focus-visible { outline-color: var(--tp-mint); }

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    z-index: 2000;
    background: var(--tp-cobalt);
    color: #fff;
    padding: 0.6rem 1rem;
}
.skip-link:focus { left: 0.5rem; top: 0.5rem; }

.tp-num { font-family: var(--tp-font-mono); font-variant-numeric: tabular-nums; }

.page-title { margin-bottom: 1.5rem; }
.section { margin-bottom: 3.5rem; }
.section-title { margin-bottom: 1.25rem; }
.section-lead { color: var(--tp-text-muted); margin-bottom: 1.25rem; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }

/* ---------- Buttons ---------- */
.btn {
    font-family: var(--tp-font-body);
    font-weight: 600;
    border-radius: var(--tp-radius);
    padding: 0.65rem 1.25rem;
    border: 1px solid transparent;
    transition: background var(--tp-transition), color var(--tp-transition), border-color var(--tp-transition);
}

.btn-primary {
    background: var(--tp-cobalt);
    border-color: var(--tp-cobalt);
    color: #fff;
}
.btn-primary:hover, .btn-primary:focus {
    background: #2A45E6;
    border-color: #2A45E6;
    color: #fff;
    opacity: 1;
}

.btn-secondary {
    background: transparent;
    border-color: currentColor;
    color: var(--tp-text);
}
.btn-secondary:hover, .btn-secondary:focus {
    background: var(--tp-ink);
    border-color: var(--tp-ink);
    color: var(--tp-paper);
    opacity: 1;
}
.tp-dark .btn-secondary { color: var(--tp-paper); }
.tp-dark .btn-secondary:hover { background: var(--tp-paper); border-color: var(--tp-paper); color: var(--tp-ink); }

/* ---------- Header ---------- */
.site-header {
    background: var(--tp-ink);
    border-bottom: 1px solid var(--tp-border);
    position: relative;
    z-index: 100;
}
.site-header .navbar { padding: 0.75rem 0; }
.site-logo img { display: block; height: 40px; width: auto; }

.site-header .navbar-toggler { border-color: var(--tp-border); }
.site-header .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='%23F5F7FC' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

.site-header .navbar-nav { gap: 0.25rem; padding-top: 0.75rem; }
@media (min-width: 992px) { .site-header .navbar-nav { padding-top: 0; } }

.site-header .nav-link {
    color: var(--tp-paper);
    font-weight: 500;
    padding: 0.5rem 0.85rem;
    border-radius: var(--tp-radius-sm);
}
.site-header .nav-link:hover, .site-header .nav-link.active {
    color: var(--tp-mint);
    opacity: 1;
}
.site-header .dropdown-menu {
    background: var(--tp-navy);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
}
.site-header .dropdown-item { color: var(--tp-paper); }
.site-header .dropdown-item:hover { background: var(--tp-ink); color: var(--tp-mint); }

/* ---------- Inhalt ---------- */
.content-area { min-height: 320px; padding-top: 2rem; padding-bottom: 4rem; }

.breadcrumbs { margin-bottom: 1.5rem; font-size: 0.875rem; color: var(--tp-text-muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 0.35rem; list-style: none; margin: 0; padding: 0; }
.breadcrumbs li + li::before { content: "›"; margin-right: 0.35rem; color: var(--tp-slate-light); }
.breadcrumbs a { color: var(--tp-text-muted); }

/* Hero */
.hero {
    background:
        radial-gradient(120% 140% at 85% 0%, var(--tp-navy) 0%, var(--tp-ink) 65%);
    border-radius: calc(var(--tp-radius) * 2);
    padding: clamp(2rem, 6vw, 4.5rem);
    margin-bottom: 3.5rem;
    color: var(--tp-text);
    position: relative;
    overflow: hidden;
}
.hero::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.045) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    mask-image: linear-gradient(180deg, transparent, #000 40%, transparent);
}
.hero > * { position: relative; z-index: 1; }
.hero .eyebrow {
    font-family: var(--tp-font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--tp-mint);
    margin-bottom: 0.75rem;
}
.hero h1 { color: var(--tp-paper); margin-bottom: 1rem; }
.hero .lead { max-width: 40rem; color: var(--tp-ice); font-size: 1.2rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-top: 1.75rem; }

/* Bereichs-Kacheln */
.area-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    height: 100%;
    padding: 1.25rem;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    color: var(--tp-text);
    text-decoration: none;
    transition: border-color var(--tp-transition), transform var(--tp-transition);
}
.area-card:hover { border-color: var(--tp-cobalt); transform: translateY(-2px); opacity: 1; }
.area-title { font-family: var(--tp-font-heading); font-weight: 700; font-size: 1.15rem; }
.area-text { color: var(--tp-text-muted); font-size: 0.95rem; }

.services-teaser {
    background: var(--tp-mist);
    border-radius: var(--tp-radius);
    padding: clamp(1.5rem, 4vw, 2.5rem);
}
.services-teaser p { max-width: 42rem; }

/* ---------- Artikel ---------- */
.article { max-width: var(--tp-article-max, none); } /* volle Containerbreite wie die Startseite; für schmalere Lesespalte z. B. --tp-article-max: 46rem setzen */
.article-header h1 { margin-bottom: 0.75rem; }
.article-meta {
    display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem;
    color: var(--tp-text-muted); font-size: 0.9rem; margin-bottom: 1rem;
}
.notice {
    font-size: 0.9rem;
    color: var(--tp-text-muted);
    background: var(--tp-mist);
    border-radius: var(--tp-radius-sm);
    padding: 0.6rem 0.9rem;
}
.notice-affiliate { border-left: 3px solid var(--tp-cobalt); }
.notice-ai { border-left: 3px solid var(--tp-slate-light); }

.kurzfazit {
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-left: 4px solid var(--tp-teal-deep);
    border-radius: var(--tp-radius);
    padding: 1.1rem 1.4rem;
    margin: 1.5rem 0 2rem;
}
.kurzfazit-label {
    display: block;
    font-family: var(--tp-font-mono);
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--tp-teal-deep);
    margin-bottom: 0.4rem;
}
.kurzfazit > :last-child { margin-bottom: 0; }

.article-content { font-size: 1.125rem; }
.article-content h2 { margin: 2.5rem 0 1rem; }
.article-content h3 { margin: 2rem 0 0.75rem; }
.article-content img { max-width: 100%; height: auto; border-radius: var(--tp-radius); }
.article-content table {
    width: 100%; border-collapse: collapse; margin: 1.5rem 0; font-size: 0.98rem;
}
.article-content th, .article-content td { padding: 0.65rem 0.8rem; border-bottom: 1px solid var(--tp-border); text-align: left; }
.article-content thead th { background: var(--tp-mist); font-family: var(--tp-font-heading); font-size: 0.9rem; }
.article-content tbody tr:nth-child(even) { background: rgba(227, 232, 243, 0.4); }
.article-footer { margin-top: 3rem; display: grid; gap: 0.75rem; }

.tp-up { color: var(--tp-up); font-family: var(--tp-font-mono); }
.tp-down { color: var(--tp-down); font-family: var(--tp-font-mono); }

/* ---------- Beitrags-Kacheln ---------- */
.blog-wrapper a { text-decoration: none; }
.post-box {
    height: 100%;
    padding: 1.25rem 1.4rem 1.4rem;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    transition: border-color var(--tp-transition);
}
.post-box:hover { border-color: var(--tp-cobalt); }
.post-box-title { font-size: 1.15rem; margin-bottom: 0.4rem; }
.post-box-title a { color: var(--tp-text); }
.post-box-meta { font-size: 0.85rem; color: var(--tp-text-muted); margin-bottom: 0.75rem; }
.post-box-excerpt { color: var(--tp-text); font-size: 0.98rem; }
.post-box-more { font-weight: 600; }
.post-box-more::after { content: " →"; }

.term-header { margin-bottom: 2rem; }
.term-description { color: var(--tp-text-muted); }

/* ---------- Sammlung ---------- */
.category-teaser-wrapper, .card-teaser-wrapper { margin-bottom: 2rem; }
.category-teaser { margin-bottom: 1rem; }

.category-teaser a {
    display: block;
    width: 100%;
    border-radius: var(--tp-radius);
    text-decoration: none;
    overflow: hidden;
}
.category-teaser .teaser-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 56px;
    padding: 0.9rem 1.1rem;
    background: var(--tp-surface);
    border: 1px solid var(--tp-border);
    border-radius: var(--tp-radius);
    color: var(--tp-text);
    font-family: var(--tp-font-heading);
    font-weight: 600;
    transition: border-color var(--tp-transition), background var(--tp-transition);
}
.category-teaser a:hover .teaser-title { border-color: var(--tp-cobalt); }
.category-teaser .teaser-title small {
    background: var(--tp-mist);
    color: var(--tp-slate);
    border-radius: 999px;
    padding: 0.1rem 0.6rem;
    font-size: 0.8rem;
}

.card-box { margin-bottom: 1rem; }
.card-box.archived, .detail-wrapper.archived { opacity: 0.45; filter: grayscale(1); }

.card-box a {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: var(--tp-radius);
    text-decoration: none;
    background: var(--tp-ink);
    aspect-ratio: 63 / 88;
}
.card-box img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card-box .teaser-title {
    position: absolute;
    left: 0; right: 0; bottom: 0;
    padding: 1.6rem 0.75rem 0.6rem;
    background: linear-gradient(0deg, rgba(10, 18, 38, 0.92) 0%, rgba(10, 18, 38, 0) 100%);
    color: var(--tp-paper);
    font-family: var(--tp-font-heading);
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.25;
}
.card-box .teaser-title small { font-family: var(--tp-font-body); font-weight: 400; color: var(--tp-ice); }
.card-box .badges { position: absolute; top: 0.6rem; left: 0.6rem; display: flex; flex-direction: column; align-items: flex-start; gap: 0.35rem; }

.badge {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: var(--tp-radius-sm);
    background: var(--tp-ice);
    color: var(--tp-ink);
    font-family: var(--tp-font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    line-height: 1.4;
}
.badge.success { background: var(--tp-mint); color: var(--tp-ink); }
.badge.alert { background: var(--tp-coral); color: var(--tp-ink); }
.badge.language-badge { padding: 0; background: none; max-width: 25px; }

/* Detailseite Karte */
.detail-wrapper h1 { margin-bottom: 0.75rem; }
.single-cards .thumb-wrapper { position: relative; }
.single-cards .thumb-wrapper img { width: 100%; height: auto; border-radius: var(--tp-radius); }
.single-cards .thumb-wrapper .special-info {
    position: absolute; bottom: 0; width: 100%;
    padding: 0.4rem 0.6rem;
    background: rgba(10, 18, 38, 0.85);
    color: var(--tp-paper);
    text-align: center;
    border-radius: 0 0 var(--tp-radius) var(--tp-radius);
    font-size: 0.9rem;
}
.badges { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }

.card-infos { margin: 1.5rem 0; display: grid; gap: 0; }
.card-info { display: flex; gap: 1rem; padding: 0.55rem 0; border-bottom: 1px solid var(--tp-border); }
.card-info dt { flex: 0 0 9rem; font-weight: 500; color: var(--tp-text-muted); }
.card-info dd { margin: 0; }

.grading-infos {
    background: var(--tp-mist);
    border-radius: var(--tp-radius);
    padding: 1rem 1.25rem;
    margin-top: 1.25rem;
}
.grading-infos p { margin-bottom: 0.4rem; }
.grading-infos p:last-child { margin-bottom: 0; }
.card-guide { margin-top: 1rem; }

/* Fortschritt */
.progress-block { max-width: 26rem; margin-bottom: 1.25rem; }
.progressbar { background: var(--tp-mist); border-radius: 999px; overflow: hidden; height: 10px; }
.progressbar-label { display: block; font-weight: 600; margin-bottom: 0.35rem; }
.progressbar .current-progress { background: var(--tp-mint); height: 100%; border-radius: 999px; }

/* 404 */
.not-found { max-width: 36rem; padding: 3rem 0; }
.not-found .btn { margin: 0 0.5rem 0.5rem 0; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--tp-ink);
    color: var(--tp-text);
    padding: 3rem 0 2rem;
}
.footer-claim { color: var(--tp-text-muted); margin-top: 1rem; max-width: 26rem; }
.footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; justify-content: flex-start; }
@media (min-width: 992px) { .footer-menu { justify-content: flex-end; } }
.footer-menu a { color: var(--tp-paper); text-decoration: none; }
.footer-menu a:hover { color: var(--tp-mint); opacity: 1; }
.footer-legal {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--tp-border);
    font-size: 0.82rem;
    color: var(--tp-text-muted);
}
.footer-legal p { margin-bottom: 0.4rem; max-width: 60rem; }
.footer-legal a { color: var(--tp-ice); }
.footer-copy { margin-top: 1rem; }

/* Bewegung reduzieren */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { transition: none !important; }
}

/* ---------- Highlight-Effekte für Karten (ACF-Feld "Highlight") ---------- */
.card-box.is-highlight a,
.single-cards .thumb-wrapper.is-highlight {
    box-shadow: 0 0 0 1px rgba(39, 224, 163, 0.55), 0 8px 28px rgba(39, 224, 163, 0.22);
}

.card-box.is-highlight a::after,
.thumb-wrapper.is-highlight::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
}
.card-box.is-highlight .teaser-title,
.card-box.is-highlight .badges { z-index: 2; }
.thumb-wrapper.is-highlight { overflow: hidden; border-radius: var(--tp-radius); }
.thumb-wrapper.is-highlight .special-info { z-index: 2; }

/* Effekt 1: Glanz – ein heller Streifen wandert über die Karte */
.effect-shine a::after,
.thumb-wrapper.effect-shine::after {
    background: linear-gradient(115deg, transparent 32%, rgba(255, 255, 255, 0.6) 46%, rgba(255, 255, 255, 0.12) 52%, transparent 62%);
    background-size: 260% 100%;
    background-position: 160% 0;
    animation: tp-shine 3.8s ease-in-out infinite;
}
@keyframes tp-shine {
    0%   { background-position: 160% 0; }
    55%  { background-position: -60% 0; }
    100% { background-position: -60% 0; }
}

/* Effekt 2: Holo – schimmernder Regenbogen-Verlauf */
.effect-holo a::after,
.thumb-wrapper.effect-holo::after {
    background: linear-gradient(125deg, #ff6b78, #ffd36b, #6bffb0, #6bc8ff, #a58bff, #ff6bd6, #ff6b78);
    background-size: 300% 300%;
    mix-blend-mode: overlay;
    opacity: 0.55;
    animation: tp-holo 7s linear infinite;
}
@keyframes tp-holo {
    0%   { background-position: 0% 50%; }
    100% { background-position: 300% 50%; }
}

/* Effekt 3: Funkeln – kleine Lichtpunkte blinken auf */
.effect-sparkle a::after,
.thumb-wrapper.effect-sparkle::after {
    background-image:
        radial-gradient(circle at 18% 22%, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
        radial-gradient(circle at 78% 14%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 3px),
        radial-gradient(circle at 62% 46%, rgba(199, 213, 255, 0.95) 0 2px, transparent 3.5px),
        radial-gradient(circle at 26% 68%, rgba(255, 255, 255, 0.9) 0 1.5px, transparent 3px),
        radial-gradient(circle at 84% 78%, rgba(255, 255, 255, 0.95) 0 2px, transparent 3px),
        radial-gradient(circle at 46% 88%, rgba(199, 213, 255, 0.9) 0 1.5px, transparent 3px);
    animation: tp-sparkle 2.6s ease-in-out infinite;
}
@keyframes tp-sparkle {
    0%, 100% { opacity: 0.15; transform: scale(1); }
    40%      { opacity: 1; transform: scale(1.03); }
    70%      { opacity: 0.35; }
}

/* Bewegung reduzieren: statischer, dezenter Glanz statt Animation */
@media (prefers-reduced-motion: reduce) {
    .effect-shine a::after, .thumb-wrapper.effect-shine::after,
    .effect-holo a::after, .thumb-wrapper.effect-holo::after,
    .effect-sparkle a::after, .thumb-wrapper.effect-sparkle::after {
        animation: none !important;
    }
    .effect-shine a::after, .thumb-wrapper.effect-shine::after { background-position: 45% 0; opacity: 0.5; }
    .effect-sparkle a::after, .thumb-wrapper.effect-sparkle::after { opacity: 0.6; }
}
