/* ============================================================
   TOP10FONDS.DE — Custom Theme Styles
   ============================================================ */

:root {
  --c-primary: #1B2A4A;
  --c-primary-light: #2C4066;
  --c-primary-dark: #111D35;
  --c-accent: #D4A843;
  --c-accent-light: #E8C76B;
  --c-bg: #FFFFFF;
  --c-bg-alt: #F8F9FA;
  --c-bg-dark: #F1F3F5;
  --c-text: #1a1a1a;
  --c-text-muted: #6b7280;
  --c-text-light: #9CA3AF;
  --c-border: #E5E7EB;
  --c-border-dark: #D1D5DB;
  --c-success: #10B981;
  --c-danger: #EF4444;
  --c-warning: #F59E0B;
  --font-sans: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

/* ---- Base ---- */
* { box-sizing: border-box; }

body {
  font-family: var(--font-sans);
  color: var(--c-text);
  background: var(--c-bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---- Navigation ---- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(27, 42, 74, 0.97);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.site-nav a { transition: color 0.2s; }

.nav-logo {
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
}

.nav-logo .logo-accent { color: var(--c-accent); }

.nav-link {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(255,255,255,0.7);
  padding: 0.5rem 0.75rem;
  border-radius: 0.375rem;
  transition: all 0.2s;
}
.nav-link:hover {
  color: #fff;
  background: rgba(255,255,255,0.08);
}

/* Mobile menu */
.mobile-menu { display: none; }
.mobile-menu.active { display: block; }

/* ---- Hero ---- */
.hero {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 50%, rgba(212,168,67,0.08) 0%, transparent 70%);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.375rem 1rem;
  background: rgba(212,168,67,0.15);
  border: 1px solid rgba(212,168,67,0.3);
  border-radius: 9999px;
  color: var(--c-accent-light);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* ---- Category Cards ---- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

.category-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 1rem;
  padding: 1.75rem;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.category-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--card-accent, var(--c-accent));
  opacity: 0;
  transition: opacity 0.3s;
}

.category-card:hover {
  border-color: var(--c-border-dark);
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.category-card:hover::before { opacity: 1; }

.category-emoji {
  font-size: 2.5rem;
  line-height: 1;
  margin-bottom: 1rem;
}

.category-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-primary);
  margin: 0 0 0.5rem;
}

.category-card p {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin: 0 0 1.25rem;
  line-height: 1.5;
}

.category-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--c-primary);
  transition: gap 0.2s;
}

.category-card:hover .category-cta { gap: 0.625rem; color: var(--c-accent); }

/* ---- Fund Ranking Cards ---- */
.fund-list { display: flex; flex-direction: column; gap: 1.25rem; }

.fund-card {
  display: flex;
  gap: 1.25rem;
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 1rem;
  padding: 1.5rem;
  transition: all 0.25s;
  position: relative;
}

.fund-card:hover {
  border-color: var(--c-border-dark);
  box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.fund-card.fund-rank-1 {
  border-color: var(--c-accent);
  background: linear-gradient(135deg, rgba(212,168,67,0.03) 0%, var(--c-bg) 100%);
}

.fund-card.fund-rank-1 .fund-rank-number {
  background: linear-gradient(135deg, var(--c-accent) 0%, #C4942E 100%);
  color: #fff;
}

.fund-rank-number {
  flex-shrink: 0;
  width: 3rem;
  height: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
  background: var(--c-bg-alt);
  color: var(--c-primary);
}

.fund-info { flex: 1; min-width: 0; }

.fund-name {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--c-primary);
  margin: 0 0 0.125rem;
}

.fund-kvg {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin: 0 0 0.25rem;
}

.fund-ids {
  font-size: 0.75rem;
  font-family: var(--font-mono);
  color: var(--c-text-light);
  margin: 0 0 0.75rem;
}

.fund-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 0.5rem;
  margin-bottom: 0.75rem;
}

.fund-metric {
  padding: 0.5rem 0.75rem;
  background: var(--c-bg-alt);
  border-radius: 0.5rem;
  text-align: center;
}

.fund-metric-label {
  font-size: 0.6875rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fund-metric-value {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--c-text);
  margin-top: 0.125rem;
}

.fund-metric-value.positive { color: var(--c-success); }
.fund-metric-value.negative { color: var(--c-danger); }

.fund-description {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  line-height: 1.6;
  margin: 0;
}

.fund-rating {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  margin-top: 0.5rem;
  font-size: 0.8125rem;
  color: var(--c-warning);
}

/* ---- Comparison Table ---- */
.comparison-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--c-border);
}

.comparison-section h2 {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--c-primary);
  margin-bottom: 1.5rem;
}

.table-wrapper {
  overflow-x: auto;
  border: 1px solid var(--c-border);
  border-radius: 0.75rem;
  -webkit-overflow-scrolling: touch;
}

.fund-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8125rem;
  white-space: nowrap;
}

.fund-table thead {
  background: var(--c-primary);
  color: #fff;
}

.fund-table th {
  padding: 0.75rem 1rem;
  font-weight: 600;
  text-align: left;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.fund-table th:first-child { border-radius: 0.75rem 0 0 0; }
.fund-table th:last-child { border-radius: 0 0.75rem 0 0; }

.fund-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--c-border);
}

.fund-table tbody tr:hover { background: var(--c-bg-alt); }
.fund-table tbody tr:last-child td { border-bottom: none; }

.fund-table .rank-cell {
  font-weight: 800;
  color: var(--c-primary);
  text-align: center;
}

.fund-table .perf-positive { color: var(--c-success); font-weight: 600; }
.fund-table .perf-negative { color: var(--c-danger); font-weight: 600; }

/* ---- Disclaimer ---- */
.disclaimer {
  background: var(--c-bg-alt);
  border: 1px solid var(--c-border);
  border-radius: 0.75rem;
  padding: 1.25rem 1.5rem;
  margin-top: 2.5rem;
}

.disclaimer p {
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ---- Page Content (static pages) ---- */
.page-content {
  max-width: 48rem;
  margin: 0 auto;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--c-text);
}

.page-content h1, .page-content h2, .page-content h3,
.page-content h4, .page-content h5, .page-content h6 {
  color: var(--c-primary);
  font-weight: 700;
  margin-top: 2rem;
  margin-bottom: 0.75rem;
}

.page-content h1 { font-size: 2rem; }
.page-content h2 { font-size: 1.5rem; }
.page-content h3 { font-size: 1.25rem; }

.page-content p { margin-bottom: 1.25rem; }

.page-content a {
  color: var(--c-primary);
  text-decoration: underline;
  text-decoration-color: var(--c-accent);
  text-underline-offset: 2px;
}

.page-content ul, .page-content ol {
  margin-bottom: 1.25rem;
  padding-left: 1.5rem;
}

.page-content li { margin-bottom: 0.5rem; }

.page-content blockquote {
  border-left: 3px solid var(--c-accent);
  margin: 1.5rem 0;
  padding: 0.75rem 1.25rem;
  background: var(--c-bg-alt);
  border-radius: 0 0.5rem 0.5rem 0;
}

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

.page-content table th,
.page-content table td {
  padding: 0.625rem 0.875rem;
  border: 1px solid var(--c-border);
  text-align: left;
}

.page-content table th {
  background: var(--c-bg-alt);
  font-weight: 600;
}

/* ---- Methodology Stars ---- */
.stars { color: var(--c-warning); letter-spacing: 1px; }

/* ---- Category Header on Post ---- */
.post-category-header {
  background: linear-gradient(135deg, var(--c-primary) 0%, var(--c-primary-dark) 100%);
  color: #fff;
  padding: 3rem 0;
  margin-bottom: 2.5rem;
}

.post-category-header h1 {
  font-size: 2rem;
  font-weight: 800;
  margin: 0 0 0.5rem;
}

.post-category-header .category-desc {
  font-size: 1.0625rem;
  opacity: 0.8;
  max-width: 40rem;
}

.post-category-header .category-emoji-large {
  font-size: 3rem;
  margin-bottom: 1rem;
  display: block;
}

/* ---- Stats bar ---- */
.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  margin-top: 1.5rem;
}

.stat-item {
  text-align: center;
}

.stat-value {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--c-accent-light);
}

.stat-label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  opacity: 0.6;
}

/* ---- Footer ---- */
.site-footer {
  background: var(--c-primary-dark);
  color: rgba(255,255,255,0.7);
}

.site-footer a {
  color: rgba(255,255,255,0.7);
  transition: color 0.2s;
}

.site-footer a:hover { color: var(--c-accent-light); }

.footer-disclaimer {
  font-size: 0.75rem;
  opacity: 0.5;
  line-height: 1.6;
}

/* ---- Breadcrumb ---- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.8125rem;
  color: var(--c-text-muted);
  margin-bottom: 1.5rem;
}

.breadcrumb a { color: var(--c-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-primary); }
.breadcrumb .sep { opacity: 0.4; }

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

.post-card {
  background: var(--c-bg);
  border: 1px solid var(--c-border);
  border-radius: 1rem;
  overflow: hidden;
  transition: all 0.3s;
}

.post-card:hover {
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  transform: translateY(-2px);
}

.post-card-image {
  width: 100%;
  height: 180px;
  object-fit: cover;
  background: var(--c-bg-dark);
}

.post-card-content { padding: 1.25rem; }

.post-card-content h3 {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--c-primary);
  margin: 0 0 0.5rem;
}

.post-card-content p {
  font-size: 0.875rem;
  color: var(--c-text-muted);
  margin: 0;
  line-height: 1.5;
}

/* ---- Methodology Section on Home ---- */
.methodology-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}

.methodology-item {
  text-align: center;
  padding: 1.5rem;
}

.methodology-icon {
  width: 3rem;
  height: 3rem;
  background: rgba(27,42,74,0.06);
  border-radius: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.25rem;
}

/* ---- Responsive ---- */
@media (max-width: 768px) {
  .category-grid {
    grid-template-columns: 1fr;
  }

  .fund-card {
    flex-direction: column;
    gap: 0.75rem;
  }

  .fund-rank-number {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1rem;
  }

  .fund-metrics {
    grid-template-columns: repeat(3, 1fr);
  }

  .post-category-header h1 {
    font-size: 1.5rem;
  }

  .hero h1 {
    font-size: 1.75rem !important;
  }

  .stats-bar {
    gap: 1rem;
  }

  .stat-item { flex: 1; min-width: 80px; }

  .table-wrapper { margin: 0 -1rem; border-radius: 0; border-left: 0; border-right: 0; }
}

@media (max-width: 480px) {
  .fund-metrics {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-grid {
    gap: 1rem;
  }
}

/* ---- Print ---- */
@media print {
  .site-nav, .site-footer, .mobile-menu-btn { display: none !important; }
  .fund-card { break-inside: avoid; }
}
