/*
Theme Name: Rost & Leidenschaft
Theme URI: https://rost-und-leidenschaft.de
Author: Timo Glittenberg
Description: Maßgeschneidertes Garage-Vintage-Theme für den DIY-Autorestaurations-Blog "Rost & Leidenschaft". Dunkel, robust, mobile-first, affiliate-tauglich mit eingebauter Produktbox und Werbekennzeichnung.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.8
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: rost-und-leidenschaft
Tags: blog, dark, one-column, custom-logo, custom-menu, featured-images, translation-ready
*/

/* ==========================================================================
   Schriften (selbst gehostet — DSGVO-konform, kein Google-CDN)
   ========================================================================== */

@font-face {
  font-family: 'Alfa Slab One';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/alfa-slab-one-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/barlow-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url('assets/fonts/barlow-400i.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('assets/fonts/barlow-600.woff2') format('woff2');
}
@font-face {
  font-family: 'Barlow';
  font-style: normal;
  font-weight: 800;
  font-display: swap;
  src: url('assets/fonts/barlow-800.woff2') format('woff2');
}

/* ==========================================================================
   Design-Variablen
   ========================================================================== */

:root {
  --bg: #161310;
  --bg-raised: #201c17;
  --bg-sunken: #100e0c;
  --ink: #f0e8da;
  --ink-soft: #cfc5b4;
  --muted: #998d7b;
  --rust: #d4540a;
  --rust-bright: #f0691f;
  --rust-deep: #9c3d06;
  --line: #322c24;
  --line-strong: #463d31;
  --font-display: 'Alfa Slab One', 'Rockwell', serif;
  --font-body: 'Barlow', 'Segoe UI', sans-serif;
  --maxw: 72rem;
  --maxw-text: 46rem;
  --radius: 4px;
  --stripes: repeating-linear-gradient(
    -45deg,
    var(--rust) 0 10px,
    transparent 10px 20px
  );
}

/* ==========================================================================
   Basis
   ========================================================================== */

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background-color: var(--bg);
  /* feine Werkstatt-Körnung über dem Grundton */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.05'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--rust-bright); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 0.6em;
  letter-spacing: 0.01em;
  text-wrap: balance;
}

h1 { font-size: clamp(1.9rem, 5.5vw, 3rem); }
h2 { font-size: clamp(1.4rem, 3.8vw, 1.9rem); }
h3 { font-size: clamp(1.15rem, 3vw, 1.35rem); }

p { margin: 0 0 1.2em; }

::selection { background: var(--rust); color: #fff; }

/* Tastatur-Springlink für Screenreader */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--rust);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}
.skip-link:focus { left: 0; }

.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;
}

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 1.1rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */

.site-header {
  background: var(--bg-sunken);
  border-bottom: 3px solid var(--rust);
  position: relative;
}
/* Warnstreifen-Kante unter dem Header — Werkstatt-Signatur */
.site-header::after {
  content: '';
  display: block;
  height: 6px;
  background: var(--stripes);
  opacity: 0.55;
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.1rem;
  max-width: var(--maxw);
  margin: 0 auto;
}

.site-branding { display: flex; align-items: center; gap: 0.8rem; min-width: 0; }
.site-branding a { text-decoration: none; display: flex; align-items: center; gap: 0.8rem; }
.custom-logo { width: auto; height: 56px; }
.site-title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin: 0;
  color: var(--ink);
  white-space: nowrap;
}
.site-title .amp { color: var(--rust); }
.site-tagline {
  display: none;
  color: var(--muted);
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 0;
}

.nav-toggle {
  background: none;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: 700 0.8rem/1 var(--font-body);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.55rem 0.8rem;
  cursor: pointer;
}
.nav-toggle:hover, .nav-toggle[aria-expanded="true"] { border-color: var(--rust); color: var(--rust-bright); }

.site-nav { display: none; width: 100%; }
.site-nav.is-open { display: block; }
.site-nav ul { list-style: none; margin: 0; padding: 0.4rem 0 1rem; }
.site-nav a {
  display: block;
  padding: 0.65rem 0.2rem;
  color: var(--ink-soft);
  text-decoration: none;
  font-weight: 600;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  font-size: 0.92rem;
  border-bottom: 1px solid var(--line);
}
.site-nav a:hover,
.site-nav .current-menu-item > a,
.site-nav .current_page_item > a { color: var(--rust-bright); }

@media (min-width: 56rem) {
  .site-tagline { display: block; }
  .nav-toggle { display: none; }
  .site-nav { display: block; width: auto; }
  .site-nav ul { display: flex; gap: 1.6rem; padding: 0; }
  .site-nav a { border-bottom: 2px solid transparent; padding: 0.4rem 0; }
  .site-nav .current-menu-item > a { border-bottom-color: var(--rust); }
}

/* ==========================================================================
   Hero (Startseite)
   ========================================================================== */

.hero {
  padding: 3rem 0 3.4rem;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(ellipse 90% 70% at 80% -10%, rgba(212, 84, 10, 0.16), transparent 60%);
}
.hero .kicker {
  color: var(--rust-bright);
  font-weight: 800;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  font-size: 0.8rem;
  margin-bottom: 0.9rem;
}
.hero h1 { max-width: 22ch; }
.hero p.lead {
  color: var(--ink-soft);
  font-size: 1.15rem;
  max-width: 52ch;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }

.btn {
  display: inline-block;
  background: var(--rust);
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
  text-decoration: none;
  padding: 0.8rem 1.5rem;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--rust-deep);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}
.btn:hover { color: #fff; transform: translateY(1px); box-shadow: 0 2px 0 var(--rust-deep); }
.btn.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--line);
  box-shadow: none;
}
.btn.btn-ghost:hover { border-color: var(--rust); color: var(--rust-bright); transform: none; }

/* ==========================================================================
   Beitragslisten / Karten
   ========================================================================== */

.section-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin: 2.6rem 0 1.4rem;
}
.section-head h2 { margin: 0; font-size: 1.3rem; }
.section-head::after {
  content: '';
  flex: 1;
  height: 4px;
  background: var(--stripes);
  opacity: 0.3;
}

.post-grid {
  display: grid;
  gap: 1.4rem;
  grid-template-columns: 1fr;
  padding: 0 0 3rem;
}
@media (min-width: 40rem)  { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 64rem)  { .post-grid { grid-template-columns: repeat(3, 1fr); } }

.post-card {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.post-card:hover { border-color: var(--rust); transform: translateY(-3px); }
.post-card .card-thumb { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.post-card .card-thumb-fallback {
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    radial-gradient(circle at 30% 30%, rgba(212,84,10,0.25), transparent 60%),
    var(--bg-sunken);
  color: var(--rust);
  font-family: var(--font-display);
  font-size: 2.6rem;
}
.post-card .card-body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: 0.5rem; flex: 1; }
.post-card h2, .post-card h3 { font-size: 1.18rem; margin: 0; }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--rust-bright); }
.post-card .card-excerpt { color: var(--ink-soft); font-size: 0.96rem; margin: 0; flex: 1; }
.post-card .card-meta { color: var(--muted); font-size: 0.82rem; letter-spacing: 0.04em; }

.cat-chip {
  display: inline-block;
  align-self: flex-start;
  background: rgba(212, 84, 10, 0.14);
  border: 1px solid rgba(212, 84, 10, 0.5);
  color: var(--rust-bright);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.22rem 0.6rem;
  border-radius: 99px;
}
.cat-chip:hover { background: var(--rust); color: #fff; }

/* Archiv-Kopf */
.archive-head { padding: 2.4rem 0 0.4rem; }
.archive-head .kicker {
  color: var(--muted); text-transform: uppercase; letter-spacing: 0.2em;
  font-size: 0.78rem; font-weight: 800; margin-bottom: 0.4rem;
}
.archive-head .archive-description { color: var(--ink-soft); max-width: 60ch; }

/* Seitennummerierung */
.pagination { display: flex; flex-wrap: wrap; gap: 0.5rem; padding: 0 0 3rem; }
.pagination .page-numbers {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.45rem 0.85rem;
  font-weight: 600;
}
.pagination .page-numbers.current { background: var(--rust); border-color: var(--rust); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--rust); color: var(--rust-bright); }

/* ==========================================================================
   Einzelner Beitrag / Seite
   ========================================================================== */

.entry { padding: 2.6rem 0 3rem; }
.entry-header { max-width: var(--maxw-text); margin: 0 auto 1.8rem; }
.entry-header .entry-meta {
  color: var(--muted);
  font-size: 0.88rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  align-items: center;
  margin-top: 0.8rem;
}
.entry-thumb { max-width: var(--maxw-text); margin: 0 auto 2rem; }
.entry-thumb img { border-radius: var(--radius); border: 1px solid var(--line); }

.entry-content { max-width: var(--maxw-text); margin: 0 auto; }
.entry-content h2 {
  margin-top: 2.2em;
  padding-top: 1.1em;
  border-top: 1px solid var(--line);
}
.entry-content h2::before {
  content: '// ';
  color: var(--rust);
}
.entry-content h3 { margin-top: 1.8em; color: var(--ink); }
.entry-content ul, .entry-content ol { padding-left: 1.3rem; margin: 0 0 1.4em; }
.entry-content li { margin-bottom: 0.45em; }
.entry-content li::marker { color: var(--rust); font-weight: 800; }
.entry-content img { border-radius: var(--radius); border: 1px solid var(--line); margin: 1.6em auto; }
.entry-content strong { color: var(--ink); }

.entry-content blockquote {
  margin: 1.8em 0;
  padding: 1rem 1.3rem;
  border-left: 4px solid var(--rust);
  background: var(--bg-raised);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-style: italic;
  color: var(--ink-soft);
}
.entry-content blockquote p:last-child { margin-bottom: 0; }

.entry-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.6em 0;
  font-size: 0.95rem;
}
.entry-content th, .entry-content td {
  border: 1px solid var(--line);
  padding: 0.6rem 0.8rem;
  text-align: left;
}
.entry-content th {
  background: var(--bg-sunken);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  color: var(--rust-bright);
}
.entry-content tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

.wp-caption { max-width: 100%; }
.wp-caption-text, figcaption { color: var(--muted); font-size: 0.85rem; text-align: center; margin-top: -0.8em; }

/* Hinweis-/Infokasten (z. B. Sicherheitshinweise) */
.entry-content .hinweis-box,
.hinweis-box {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-left: 4px solid var(--rust);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 1rem 1.3rem;
  margin: 1.8em 0;
}
.hinweis-box .hinweis-titel {
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.82rem;
  color: var(--rust-bright);
  margin-bottom: 0.3rem;
}
.hinweis-box p:last-child { margin-bottom: 0; }

/* ==========================================================================
   Affiliate-Produktbox + Werbekennzeichnung
   ========================================================================== */

.produktbox {
  position: relative;
  background: var(--bg-raised);
  border: 2px solid var(--rust);
  border-radius: var(--radius);
  padding: 1.5rem 1.3rem 1.4rem;
  margin: 2.2em 0;
}
/* Warnstreifen oben — signalisiert ehrlich: hier wird empfohlen/verlinkt */
.produktbox::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--stripes);
  opacity: 0.8;
  border-radius: var(--radius) var(--radius) 0 0;
}
.produktbox .werbung-label {
  position: absolute;
  top: -0.85rem;
  right: 0.9rem;
  background: var(--rust);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 0.25rem 0.65rem;
  border-radius: 3px;
}
.produktbox-grid { display: grid; gap: 1.2rem; grid-template-columns: 1fr; align-items: center; }
@media (min-width: 36rem) {
  .produktbox-grid.has-image { grid-template-columns: 140px 1fr; }
}
.produktbox img { margin: 0; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.produktbox h3, .produktbox .produktbox-titel {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin: 0.2rem 0 0.5rem;
  padding: 0;
  border: 0;
}
.produktbox h3::before { content: none; }
.produktbox p { color: var(--ink-soft); font-size: 0.97rem; margin-bottom: 0.9em; }
.produktbox ul { list-style: none; padding: 0; margin: 0 0 1em; }
.produktbox ul li { padding-left: 1.4rem; position: relative; margin-bottom: 0.35em; font-size: 0.95rem; }
.produktbox ul li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--rust-bright);
  font-weight: 800;
}
.produktbox .btn { font-size: 0.85rem; }
.produktbox .preis-hinweis { color: var(--muted); font-size: 0.78rem; margin: 0.6em 0 0; }

.affiliate-hinweis {
  max-width: var(--maxw-text);
  margin: 2.4em auto 0;
  padding: 0.9rem 1.1rem;
  border: 1px dashed var(--line-strong, #463d31);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.55;
}
.affiliate-hinweis strong { color: var(--ink-soft); }

/* ==========================================================================
   Autor-/Abschlussbox, Kommentare
   ========================================================================== */

.entry-footer {
  max-width: var(--maxw-text);
  margin: 2.5rem auto 0;
  padding-top: 1.4rem;
  border-top: 4px solid;
  border-image: var(--stripes) 1;
  color: var(--muted);
  font-size: 0.9rem;
}

.comments-area { max-width: var(--maxw-text); margin: 3rem auto 0; }
.comments-area .comment-list { list-style: none; padding: 0; }
.comments-area .comment-body {
  background: var(--bg-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  margin-bottom: 1rem;
}
.comments-area .comment-meta { color: var(--muted); font-size: 0.85rem; }
.comments-area .reply a { font-size: 0.85rem; }

input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea {
  width: 100%;
  background: var(--bg-sunken);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--ink);
  font: inherit;
  padding: 0.65rem 0.85rem;
}
input:focus, textarea:focus { outline: 2px solid var(--rust); outline-offset: 1px; border-color: var(--rust); }
input[type="submit"] {
  width: auto;
  background: var(--rust);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 0.75rem 1.4rem;
  cursor: pointer;
  box-shadow: 0 3px 0 var(--rust-deep);
}

.search-form { display: flex; gap: 0.6rem; margin: 1.5rem 0; }
.search-form input[type="search"] { flex: 1; }

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  margin-top: 2rem;
  background: var(--bg-sunken);
  border-top: 3px solid var(--rust);
  padding: 2.2rem 0 2.6rem;
  color: var(--muted);
  font-size: 0.92rem;
}
.site-footer .footer-inner {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.site-footer .footer-brand {
  font-family: var(--font-display);
  color: var(--ink-soft);
  font-size: 1.05rem;
}
.site-footer .footer-brand .amp { color: var(--rust); }
.site-footer nav ul { list-style: none; display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin: 0; padding: 0; }
.site-footer a { color: var(--ink-soft); text-decoration: none; }
.site-footer a:hover { color: var(--rust-bright); }
.site-footer .footer-note { font-size: 0.82rem; max-width: 60ch; }

@media (min-width: 56rem) {
  .site-footer .footer-inner { flex-direction: row; justify-content: space-between; align-items: flex-start; }
}

/* ==========================================================================
   404 & Kleinkram
   ========================================================================== */

.error-404 { text-align: center; padding: 5rem 1rem; }
.error-404 .code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 18vw, 8rem);
  color: var(--rust);
  line-height: 1;
  text-shadow: 4px 4px 0 var(--bg-sunken), 6px 6px 0 var(--rust-deep);
}

.alignleft { float: left; margin: 0.4em 1.4em 1em 0; }
.alignright { float: right; margin: 0.4em 0 1em 1.4em; }
.aligncenter { margin-left: auto; margin-right: auto; }

@media (max-width: 36rem) {
  .alignleft, .alignright { float: none; margin: 1.4em auto; }
}

/* Druck: dunkles Design tintensparend invertieren */
@media print {
  body { background: #fff; color: #000; }
  .site-header, .site-footer, .nav-toggle, .produktbox .btn { display: none; }
}
