/*
Theme Name: FitRank Speed v1
Theme URI: https://fitranking.de
Author: FitRank
Author URI: https://fitranking.de
Description: Premium Speed-optimiertes Theme für FitRank - Clean White + Rot Akzente, Editorial Style, Amazon Affiliate ready. PageSpeed 95+.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.9
Requires PHP: 7.4
License: GPL v2 or later
Text Domain: fitrank-speed-v1
*/

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
  --red: #E31837;
  --red-dark: #B8122C;
  --red-light: #FFF0F2;
  --black: #0A0A0A;
  --gray-900: #1A1A1A;
  --gray-800: #2D2D2D;
  --gray-700: #4A4A4A;
  --gray-500: #767676;
  --gray-300: #D4D4D4;
  --gray-200: #E8E8E8;
  --gray-100: #F5F5F5;
  --white: #FFFFFF;
  --green: #2D8F4E;
  --gold: #E6A817;

  --font-display: 'Oswald', 'Impact', sans-serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-serif: 'Source Serif Pro', Georgia, serif;

  --container: 1200px;
  --container-narrow: 760px;
  --radius: 4px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.12);
  --transition: all 0.2s ease;
}

/* ============================================
   RESET & BASE
   ============================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--gray-900);
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--red); text-decoration: none; transition: var(--transition); }
a:hover { color: var(--red-dark); }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--black);
  text-transform: uppercase;
}

h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.6rem); margin-top: 2.5rem; margin-bottom: 1rem; }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.6rem); margin-top: 2rem; margin-bottom: 0.75rem; }
h4 { font-size: 1.2rem; margin-top: 1.5rem; margin-bottom: 0.5rem; }

p { margin-bottom: 1.25rem; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 1rem 0 1.5rem 1.5rem; }
li { margin-bottom: 0.5rem; }

blockquote {
  border-left: 4px solid var(--red);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  background: var(--gray-100);
}

/* ============================================
   LAYOUT
   ============================================ */
.container { max-width: var(--container); margin: 0 auto; padding: 0 20px; }
.container-narrow { max-width: var(--container-narrow); margin: 0 auto; padding: 0 20px; }

/* ============================================
   HEADER
   ============================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--gray-200);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  max-width: var(--container);
  margin: 0 auto;
}

.site-logo {
  font-family: var(--font-display);
  font-size: 1.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: -0.02em;
  color: var(--black);
  display: flex;
  align-items: center;
  gap: 4px;
}
.site-logo:hover { color: var(--black); }
.site-logo .accent { color: var(--red); }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 32px;
  margin: 0;
}
.main-nav li { margin: 0; }
.main-nav a {
  color: var(--gray-900);
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  position: relative;
  padding: 4px 0;
}
.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red);
  transition: width 0.25s ease;
}
.main-nav a:hover { color: var(--red); }
.main-nav a:hover::after { width: 100%; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  flex-direction: column;
  gap: 5px;
}
.mobile-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--black);
  transition: var(--transition);
}

@media (max-width: 768px) {
  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; background: var(--white); border-bottom: 1px solid var(--gray-200); }
  .main-nav.active { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; padding: 16px 20px; }
  .main-nav li { border-bottom: 1px solid var(--gray-200); }
  .main-nav li:last-child { border-bottom: none; }
  .main-nav a { display: block; padding: 14px 0; }
  .mobile-toggle { display: flex; }
}

/* ============================================
   HERO / PAGE HEADER
   ============================================ */
.hero {
  padding: 60px 20px 40px;
  background: linear-gradient(180deg, var(--white) 0%, var(--gray-100) 100%);
  border-bottom: 3px solid var(--red);
}
.hero-inner { max-width: var(--container-narrow); margin: 0 auto; text-align: center; }
.hero-badge {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 6px 14px;
  border-radius: 2px;
  margin-bottom: 20px;
}
.hero h1 { margin-bottom: 16px; }
.hero-lead {
  font-size: 1.2rem;
  color: var(--gray-700);
  max-width: 600px;
  margin: 0 auto 24px;
  font-family: var(--font-serif);
}
.hero-meta {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--gray-500);
}
.hero-meta span { display: flex; align-items: center; gap: 6px; }

/* ============================================
   CONTENT
   ============================================ */
.content-area {
  padding: 50px 20px;
}
.content-wrap { max-width: var(--container-narrow); margin: 0 auto; }

.entry-content > * { margin-bottom: 1.25rem; }
.entry-content h2 { position: relative; padding-left: 16px; }
.entry-content h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 8px;
  bottom: 8px;
  width: 4px;
  background: var(--red);
}

/* ============================================
   PRODUCT BOX (Amazon Affiliate)
   ============================================ */
.product-box {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 24px;
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin: 30px 0;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
  position: relative;
}
.product-box:hover { box-shadow: var(--shadow-md); border-color: var(--gray-300); }

.product-box.winner {
  border: 2px solid var(--red);
  box-shadow: 0 0 0 4px var(--red-light);
}
.product-box.winner::before {
  content: '🏆 TESTSIEGER';
  position: absolute;
  top: -12px;
  left: 24px;
  background: var(--red);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 4px 12px;
  border-radius: 2px;
}

.product-box-image {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-100);
  border-radius: var(--radius);
  padding: 12px;
  aspect-ratio: 1;
}
.product-box-image img { width: 100%; height: 100%; object-fit: contain; }

.product-box-content {
  display: flex;
  flex-direction: column;
}
.product-box-title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--black);
  margin-bottom: 6px;
  line-height: 1.2;
}
.product-box-brand {
  font-size: 0.85rem;
  color: var(--gray-500);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 10px;
}
.product-rating {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.stars { color: var(--gold); font-size: 1.1rem; letter-spacing: 2px; }
.rating-value { font-weight: 600; color: var(--gray-900); }
.rating-count { color: var(--gray-500); font-size: 0.85rem; }

.product-features {
  list-style: none;
  margin: 10px 0;
  padding: 0;
  font-size: 0.9rem;
}
.product-features li {
  padding: 2px 0 2px 20px;
  position: relative;
  margin-bottom: 4px;
}
.product-features li::before {
  content: '✓';
  position: absolute;
  left: 0;
  color: var(--green);
  font-weight: 700;
}

.product-box-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--gray-200);
}
.product-price {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--black);
}
.product-price-old {
  font-size: 0.9rem;
  color: var(--gray-500);
  text-decoration: line-through;
  margin-right: 6px;
}

.btn-amazon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--red);
  color: var(--white);
  padding: 12px 22px;
  font-weight: 700;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-amazon:hover { background: var(--red-dark); color: var(--white); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-amazon::after { content: '→'; transition: transform 0.2s; }
.btn-amazon:hover::after { transform: translateX(4px); }

@media (max-width: 600px) {
  .product-box { grid-template-columns: 1fr; }
  .product-box-image { max-width: 200px; margin: 0 auto; }
  .product-box-footer { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ============================================
   PROS & CONS BOX
   ============================================ */
.pros-cons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 30px 0;
}
.pros-cons-col {
  padding: 20px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--gray-200);
}
.pros-cons-col.pros { background: #F2F9F4; border-color: #CDE8D4; }
.pros-cons-col.cons { background: #FEF3F4; border-color: #F8D0D4; }
.pros-cons-col h4 {
  text-transform: uppercase;
  font-size: 0.95rem;
  margin-bottom: 12px;
  margin-top: 0;
  letter-spacing: 0.05em;
}
.pros-cons-col.pros h4 { color: var(--green); }
.pros-cons-col.cons h4 { color: var(--red); }
.pros-cons-col ul { list-style: none; margin: 0; padding: 0; }
.pros-cons-col li {
  padding: 6px 0 6px 24px;
  position: relative;
  font-size: 0.95rem;
  margin-bottom: 0;
}
.pros-cons-col.pros li::before { content: '+'; position: absolute; left: 0; color: var(--green); font-weight: 700; font-size: 1.2rem; line-height: 1; top: 6px; }
.pros-cons-col.cons li::before { content: '−'; position: absolute; left: 0; color: var(--red); font-weight: 700; font-size: 1.4rem; line-height: 1; top: 4px; }

@media (max-width: 600px) { .pros-cons { grid-template-columns: 1fr; } }

/* ============================================
   COMPARISON TABLE
   ============================================ */
.comparison-wrap { overflow-x: auto; margin: 30px 0; border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); }
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  font-size: 0.95rem;
  min-width: 600px;
}
.comparison-table th {
  background: var(--black);
  color: var(--white);
  padding: 16px 12px;
  text-align: left;
  font-family: var(--font-display);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 0.85rem;
}
.comparison-table td {
  padding: 16px 12px;
  border-bottom: 1px solid var(--gray-200);
  vertical-align: middle;
}
.comparison-table tr:hover td { background: var(--gray-100); }
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table .winner-row { background: var(--red-light); }
.comparison-table .winner-row:hover td { background: #FFE6EA; }

/* ============================================
   CTA BOXES
   ============================================ */
.cta-box {
  background: linear-gradient(135deg, var(--black) 0%, var(--gray-900) 100%);
  color: var(--white);
  padding: 40px 30px;
  border-radius: var(--radius-lg);
  margin: 40px 0;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-box::before {
  content: '';
  position: absolute;
  top: 0;
  right: 0;
  width: 200px;
  height: 200px;
  background: radial-gradient(circle, var(--red) 0%, transparent 70%);
  opacity: 0.3;
}
.cta-box h3 { color: var(--white); margin-top: 0; }
.cta-box p { color: var(--gray-300); font-size: 1.05rem; }

/* ============================================
   TESTIMONIAL / INFO BOXES
   ============================================ */
.info-box {
  background: var(--red-light);
  border-left: 4px solid var(--red);
  padding: 20px 24px;
  border-radius: 0 var(--radius) var(--radius) 0;
  margin: 24px 0;
}
.info-box h4 { margin-top: 0; color: var(--red-dark); }
.info-box p:last-child { margin-bottom: 0; }

/* ============================================
   POST META & CATEGORIES
   ============================================ */
.post-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--gray-500);
  margin: 16px 0;
}
.post-category {
  display: inline-block;
  background: var(--red);
  color: var(--white);
  padding: 4px 10px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-radius: 2px;
}

/* ============================================
   ARTICLE GRID / ARCHIVE
   ============================================ */
.post-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
  margin: 30px 0;
}
.post-card {
  background: var(--white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--gray-300); }
.post-card-image {
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--gray-100);
}
.post-card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.post-card:hover .post-card-image img { transform: scale(1.05); }
.post-card-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.post-card-title {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 10px;
  text-transform: uppercase;
  line-height: 1.25;
}
.post-card-title a { color: var(--black); }
.post-card-title a:hover { color: var(--red); }
.post-card-excerpt { color: var(--gray-700); font-size: 0.95rem; flex: 1; margin-bottom: 14px; }
.post-card-meta { font-size: 0.8rem; color: var(--gray-500); }

/* ============================================
   FOOTER
   ============================================ */
.site-footer {
  background: var(--black);
  color: var(--gray-300);
  padding: 50px 20px 20px;
  margin-top: 80px;
}
.footer-inner { max-width: var(--container); margin: 0 auto; }
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
.footer-col h5 {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}
.footer-col ul { list-style: none; margin: 0; padding: 0; }
.footer-col li { margin-bottom: 8px; }
.footer-col a { color: var(--gray-300); font-size: 0.9rem; }
.footer-col a:hover { color: var(--red); }
.footer-brand { font-family: var(--font-display); font-size: 1.8rem; font-weight: 700; text-transform: uppercase; color: var(--white); margin-bottom: 12px; }
.footer-brand .accent { color: var(--red); }
.footer-bottom {
  border-top: 1px solid var(--gray-800);
  padding-top: 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.85rem;
  color: var(--gray-500);
}
.affiliate-disclaimer {
  background: var(--gray-900);
  padding: 16px 20px;
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-bottom: 30px;
  color: var(--gray-300);
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; gap: 30px; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }

/* ============================================
   UTILITIES
   ============================================ */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}
