/*
Theme Name: PixelKritik
Theme URI: https://example.com/pixelkritik
Author: PixelKritik Redaktion
Author URI: https://example.com
Description: Redaktionelles Theme fuer Spieletests (PC & Nintendo Switch) mit eigenem Testbericht-Post-Type, Plattform-Taxonomie und Wertungs-Metaboxen. Zeitungsaehnliches Layout, gebaut fuer den Classic Editor.
Version: 1.0.4
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: pixelkritik
*/

/* ============================================================
   1. DESIGN-TOKENS
   ============================================================ */
:root {
  --ink: #0d0d0d;
  --paper: #f5f0e8;
  --accent: #e03c1f;
  --accent2: #1a6bff;
  --muted: #7a7060;
  --border: #d4ccb8;
  --card-bg: #fff9ef;
  --good: #1d8a4a;
  --warn: #e8820c;
}

/* ============================================================
   2. RESET / BASIS
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
  font-weight: 300;
  line-height: 1.7;
}
a { color: var(--accent); }
img { max-width: 100%; height: auto; }
.pk-wrap { max-width: 1200px; margin: 0 auto; }

/* ============================================================
   3. HEADER
   ============================================================ */
.pk-header {
  border-bottom: 3px solid var(--ink);
  background: var(--paper);
  position: sticky;
  top: 0;
  z-index: 100;
}
.pk-header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.pk-logo {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.8rem;
  letter-spacing: 0.05em;
  color: var(--ink);
  text-decoration: none;
  line-height: 1;
  padding: 0.6rem 0;
}
.pk-logo span { color: var(--accent); }
.pk-nav { display: flex; gap: 1.8rem; flex-wrap: wrap; }
.pk-nav a {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  padding-bottom: 2px;
  transition: border-color 0.2s, color 0.2s;
}
.pk-nav a:hover,
.pk-nav .current-menu-item a { border-color: var(--accent); color: var(--accent); }
.pk-nav ul { list-style: none; display: flex; gap: 1.8rem; margin: 0; padding: 0; }

/* ============================================================
   4. TICKER
   ============================================================ */
.pk-ticker {
  background: var(--accent);
  color: #fff;
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  padding: 0.5rem 0;
  overflow: hidden;
  white-space: nowrap;
}
.pk-ticker-inner { display: inline-block; animation: pk-scroll 30s linear infinite; }
@keyframes pk-scroll {
  0% { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   5. HERO (Titelstory)
   ============================================================ */
.pk-hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 2px solid var(--ink);
  min-height: 460px;
}
.pk-hero-text {
  padding: 3rem 2.5rem;
  border-right: 2px solid var(--ink);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}
.pk-hero-badge {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.8rem;
}
.pk-hero-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.05;
  margin: 0 0 1rem;
}
.pk-hero-title a { color: inherit; text-decoration: none; }
.pk-hero-sub {
  font-size: 1rem;
  color: var(--muted);
  max-width: 42ch;
  margin-bottom: 2rem;
}
.pk-hero-visual {
  background: var(--ink);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.pk-hero-visual img { width: 100%; height: 100%; object-fit: cover; opacity: 0.9; }
.pk-hero-visual-fallback {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #1a1a2e, #16213e 45%, #0f3460 75%, #533483);
  display: flex; align-items: center; justify-content: center;
  font-size: 5rem;
}

/* Score-Pille */
.pk-score-pill { display: inline-flex; align-items: center; gap: 0.6rem; }
.pk-score-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--accent);
}
.pk-score-meta { font-size: 0.75rem; color: var(--muted); }
.pk-score-meta strong { display: block; font-size: 1.05rem; color: var(--ink); font-weight: 500; }

/* ============================================================
   6. SECTION-KOPF
   ============================================================ */
.pk-section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  padding: 2rem 2rem 1rem;
  border-bottom: 1px solid var(--border);
}
.pk-section-head h2 {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.8rem;
  letter-spacing: 0.06em;
  margin: 0;
}
.pk-section-head span {
  font-size: 0.72rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ============================================================
   7. REVIEW-GRID & KARTEN
   ============================================================ */
.pk-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-bottom: 2px solid var(--ink);
}
.pk-card {
  position: relative;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem;
  background: var(--card-bg);
  transition: background 0.2s;
  color: var(--ink);
  display: block;
}
.pk-card:last-child { border-right: none; }
.pk-card:hover { background: #fff; }
/* Titel-Link: erbt Farbe, kein Unterstrich */
.pk-card-title a { color: inherit; text-decoration: none; }
/* Stretched-Link: macht die GANZE Karte klickbar,
   ohne dass verschachtelte <a>-Tags noetig sind */
.pk-card-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.pk-card-thumb {
  width: 100%;
  aspect-ratio: 16/9;
  border-radius: 3px;
  margin-bottom: 1rem;
  object-fit: cover;
  background: linear-gradient(135deg, #1a1a2e, #0f3460);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.6rem;
}
.pk-card-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.35rem;
  line-height: 1.2;
  margin: 0 0 0.4rem;
}
.pk-card-snippet {
  font-size: 0.85rem;
  color: var(--muted);
  line-height: 1.5;
  margin-bottom: 1.2rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.pk-card-footer { display: flex; align-items: center; justify-content: space-between; }
.pk-card-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.2rem;
  line-height: 1;
}
.pk-card-meta { font-size: 0.72rem; color: var(--muted); text-align: right; }

/* ============================================================
   8. PLATTFORM-LABEL
   ============================================================ */
.pk-platform {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.25rem 0.6rem;
  border-radius: 2px;
  display: inline-block;
  margin-bottom: 0.9rem;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
}
.pk-platform.pc { background: var(--accent2); }
.pk-platform.nintendo-switch,
.pk-platform.switch { background: #e4000f; }

/* Wertungsfarben */
.pk-s-top  { color: var(--accent); }
.pk-s-high { color: var(--good); }
.pk-s-mid  { color: var(--warn); }
.pk-s-low  { color: var(--muted); }

/* ============================================================
   9. EINZELANSICHT TESTBERICHT
   ============================================================ */
.pk-single {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 2rem 5rem;
}
.pk-single-header {
  border-bottom: 2px solid var(--ink);
  padding-bottom: 2rem;
  margin-bottom: 2.5rem;
}
.pk-meta-row {
  display: flex;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.pk-meta-row .pk-platform { margin-bottom: 0; }
.pk-single-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  line-height: 1.05;
  margin: 0 0 0.5rem;
}
.pk-single-subtitle {
  font-family: 'DM Serif Display', Georgia, serif;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--muted);
  margin-bottom: 1.5rem;
}

/* Wertungsleiste */
.pk-scores {
  display: flex;
  gap: 2rem;
  padding: 1.5rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 4px;
  margin: 1.5rem 0;
  flex-wrap: wrap;
}
.pk-score-block { text-align: center; }
.pk-score-block .num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 3rem;
  line-height: 1;
  color: var(--accent);
}
.pk-score-block .lbl {
  font-size: 0.68rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
}
.pk-score-divider { width: 1px; background: rgba(255,255,255,0.15); }

/* Artikeltext */
.pk-body { font-size: 0.97rem; color: #2a2520; }
.pk-body::after { content: ""; display: table; clear: both; }
.pk-body h2, .pk-body h3 {
  font-family: 'DM Serif Display', Georgia, serif;
  margin: 2rem 0 0.7rem;
}
.pk-body h2 { font-size: 1.6rem; }
.pk-body h3 { font-size: 1.35rem; }
.pk-body p { margin-bottom: 1rem; max-width: 65ch; }
.pk-body img { border-radius: 3px; height: auto; }

/* Bilder, figure & Bildunterschriften im Artikel */
.pk-body figure {
  margin: 1.8rem 0;
}
.pk-body figure img,
.pk-body .wp-caption img {
  display: block;
  width: 100%;
  border-radius: 3px;
}
.pk-body figcaption,
.pk-body .wp-caption-text,
.pk-body .gallery-caption {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--muted);
  text-align: center;
  margin-top: 0.5rem;
}
.pk-body .wp-caption { max-width: 100%; height: auto; }

/* Ausrichtung einzelner Bilder */
.pk-body .aligncenter { display: block; margin: 1.5rem auto; }
.pk-body .alignleft  { float: left;  margin: 0.4rem 1.6rem 1rem 0; max-width: 50%; }
.pk-body .alignright { float: right; margin: 0.4rem 0 1rem 1.6rem; max-width: 50%; }
.pk-body .alignnone  { margin: 1.2rem 0; }

/* Bildergalerien (klassischer [gallery]-Shortcode) */
.pk-body .gallery {
  display: grid;
  gap: 0.6rem;
  margin: 1.8rem 0;
}
.pk-body .gallery-columns-2 { grid-template-columns: repeat(2, 1fr); }
.pk-body .gallery-columns-3 { grid-template-columns: repeat(3, 1fr); }
.pk-body .gallery-columns-4 { grid-template-columns: repeat(4, 1fr); }
.pk-body .gallery-columns-5 { grid-template-columns: repeat(5, 1fr); }
.pk-body .gallery-item { margin: 0; text-align: center; }
.pk-body .gallery img {
  width: 100%;
  border-radius: 3px;
  border: 1px solid var(--border);
}

/* Vergleichstabellen (auch fuer .wp-block-table im Editor) */
.pk-body table,
.pk-body .wp-block-table table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
  font-size: 0.88rem;
}
.pk-body th {
  background: var(--ink);
  color: var(--paper);
  padding: 0.6rem 1rem;
  text-align: left;
  font-weight: 500;
}
.pk-body td {
  padding: 0.55rem 1rem;
  border-bottom: 1px solid var(--border);
}
.pk-body tr:nth-child(even) td { background: rgba(0,0,0,0.03); }

/* Fazit-Box */
.pk-verdict {
  border-left: 4px solid var(--accent);
  padding: 1rem 1.5rem;
  background: rgba(224,60,31,0.06);
  margin: 2rem 0;
}
.pk-verdict strong {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 0.3rem;
  color: var(--accent);
}

/* Pro / Contra */
.pk-proscons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin: 1.5rem 0;
}
.pk-pros, .pk-cons { padding: 1rem 1.2rem; border-radius: 3px; }
.pk-pros { background: rgba(29,138,74,0.08); border-top: 3px solid var(--good); }
.pk-cons { background: rgba(224,60,31,0.08); border-top: 3px solid var(--accent); }
.pk-pros h4, .pk-cons h4 {
  font-size: 0.72rem; letter-spacing: 0.15em; text-transform: uppercase;
  margin: 0 0 0.6rem;
}
.pk-pros h4 { color: var(--good); }
.pk-cons h4 { color: var(--accent); }
.pk-pros ul, .pk-cons ul { list-style: none; font-size: 0.85rem; margin: 0; padding: 0; }
.pk-pros li, .pk-cons li { margin-bottom: 0.3rem; }
.pk-pros li::before { content: "+ "; font-weight: 700; color: var(--good); }
.pk-cons li::before { content: "\2212 "; font-weight: 700; color: var(--accent); }

/* ============================================================
   10. ARCHIV-KOPF
   ============================================================ */
.pk-archive-head {
  padding: 2.5rem 2rem;
  border-bottom: 2px solid var(--ink);
  text-align: center;
}
.pk-archive-head h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
  margin: 0 0 0.5rem;
}
.pk-archive-head p { color: var(--muted); margin: 0; }

/* ============================================================
   11. BESTENLISTE & FILTER
   ============================================================ */
.pk-toplist-intro { max-width: 60ch; margin: 0 auto; }

/* Filterleiste */
.pk-filters {
  display: flex;
  align-items: flex-end;
  gap: 1.2rem;
  flex-wrap: wrap;
  padding: 1.5rem 2rem;
  border-bottom: 2px solid var(--ink);
  background: var(--card-bg);
}
.pk-filter { display: flex; flex-direction: column; gap: 0.3rem; }
.pk-filter span {
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pk-filter select {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.9rem;
  padding: 0.45rem 0.7rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: var(--paper);
  color: var(--ink);
  min-width: 11rem;
  cursor: pointer;
}
.pk-filter-reset {
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  background: none;
  color: var(--ink);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.pk-filter-reset:hover { background: var(--ink); color: var(--paper); }
.pk-filter-count {
  margin-left: auto;
  font-size: 0.78rem;
  color: var(--muted);
}

/* Rangliste */
.pk-toplist {
  list-style: none;
  margin: 0;
  padding: 0;
  border-bottom: 2px solid var(--ink);
}
.pk-rank-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1.4rem;
  padding: 1.1rem 2rem;
  border-bottom: 1px solid var(--border);
  background: var(--card-bg);
  transition: background 0.15s;
}
.pk-rank-row:hover { background: #fff; }
.pk-rank-num {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.3rem;
  line-height: 1;
  color: var(--muted);
  min-width: 3.4rem;
  text-align: right;
}
.pk-rank-top .pk-rank-num { color: var(--accent); }
.pk-rank-main { flex: 1; min-width: 0; }
.pk-rank-title {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 1.3rem;
  line-height: 1.2;
  margin: 0;
}
.pk-rank-title a { color: inherit; text-decoration: none; }
.pk-rank-title a::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
}
.pk-rank-meta {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--muted);
}
.pk-rank-meta .pk-platform { margin-bottom: 0; }
.pk-rank-score {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 2.5rem;
  line-height: 1;
}
.pk-no-results {
  padding: 3rem 2rem;
  text-align: center;
  color: var(--muted);
  border-bottom: 2px solid var(--ink);
}

/* ============================================================
   12. PAGINIERUNG
   ============================================================ */
.pk-pagination {
  display: flex; justify-content: center; gap: 0.5rem;
  padding: 2rem; flex-wrap: wrap;
}
.pk-pagination .page-numbers {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  padding: 0.3rem 0.9rem;
  border: 1.5px solid var(--ink);
  border-radius: 2px;
  text-decoration: none;
  color: var(--ink);
}
.pk-pagination .page-numbers.current,
.pk-pagination .page-numbers:hover { background: var(--ink); color: var(--paper); }

/* ============================================================
   13. BUTTONS / SONSTIGES
   ============================================================ */
.pk-back {
  display: inline-flex; align-items: center; gap: 0.4rem;
  font-size: 0.78rem; font-weight: 500;
  letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: 0.5rem 1.1rem;
  border-radius: 2px;
  text-decoration: none;
  margin-bottom: 2rem;
  transition: background 0.15s, color 0.15s;
}
.pk-back:hover { background: var(--ink); color: var(--paper); }

.pk-page { max-width: 760px; margin: 0 auto; padding: 3rem 2rem 5rem; }
.pk-page h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: clamp(2rem, 5vw, 3rem);
}

/* ============================================================
   14. FOOTER
   ============================================================ */
.pk-footer {
  border-top: 2px solid var(--ink);
  padding: 1.5rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted);
  flex-wrap: wrap;
  gap: 1rem;
}
.pk-footer strong {
  font-family: 'Bebas Neue', sans-serif;
  font-size: 1.1rem;
  color: var(--ink);
  letter-spacing: 0.05em;
}

/* ============================================================
   15. RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .pk-hero { grid-template-columns: 1fr; }
  .pk-hero-text { border-right: none; border-bottom: 2px solid var(--ink); }
  .pk-hero-visual { min-height: 240px; }
  .pk-grid { grid-template-columns: repeat(2, 1fr); }
  .pk-filter-count { margin-left: 0; width: 100%; }
}
@media (max-width: 560px) {
  .pk-header-inner { flex-direction: column; gap: 0.5rem; padding: 0.8rem 1rem; }
  .pk-logo { font-size: 2.2rem; }
  .pk-grid { grid-template-columns: 1fr; }
  .pk-proscons { grid-template-columns: 1fr; }
  .pk-scores { gap: 1rem; }
  .pk-score-block .num { font-size: 2.2rem; }
  /* Bestenliste auf schmalen Screens */
  .pk-filters { padding: 1.2rem 1rem; }
  .pk-filter { width: 100%; }
  .pk-filter select { width: 100%; min-width: 0; }
  .pk-rank-row { gap: 0.9rem; padding: 1rem 1rem; }
  .pk-rank-num { font-size: 1.8rem; min-width: 2.6rem; }
  .pk-rank-title { font-size: 1.1rem; }
  .pk-rank-score { font-size: 2rem; }
}

/* WordPress-Pflichtklassen */
.screen-reader-text {
  border: 0; clip: rect(1px,1px,1px,1px);
  clip-path: inset(50%); height: 1px; width: 1px;
  margin: -1px; overflow: hidden; padding: 0; position: absolute;
}
.alignleft { float: left; margin-right: 1.5rem; }
.alignright { float: right; margin-left: 1.5rem; }
.aligncenter { display: block; margin: 1rem auto; }
.sticky, .gallery-caption, .bypostauthor { display: block; }
