/*
Theme Name: RailLog
Theme URI: https://example.com/raillog
Author: RailLog
Description: Тема новинного порталу залізничних перевезень RailLog. Головна сторінка з великою новиною, стрічкою за категоріями, сервісами, останніми новинами, популярним, бібліотекою документів, опитуванням та галереєю.
Version: 1.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: raillog
*/

/* ==========================================================================
   0. Variables & Reset
   ========================================================================== */
:root {
  --rl-ink: #1a1d20;
  --rl-text: #212529;
  --rl-muted: #6c757d;
  --rl-blue: #0056b3;
  --rl-blue-dark: #004085;
  --rl-bg: #f8f9fa;
  --rl-card: #ffffff;
  --rl-border: #e9ecef;

  --rl-cat-passenger: #2563eb;
  --rl-cat-freight: #b45309;
  --rl-cat-infra: #0f766e;
  --rl-cat-electric: #7c3aed;

  --rl-radius: 12px;
  --rl-shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --rl-container: 1200px;
  --rl-font-body: "Inter", "Segoe UI", Arial, sans-serif;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 80px; /* Запобігає перекриттю заголовка фіксованою шапкою */
}

body {
  margin: 0;
  background: var(--rl-bg);
  color: var(--rl-text);
  font-family: var(--rl-font-body);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

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

a {
  color: var(--rl-blue);
  text-decoration: none;
}

/* 
   Скидання базових списків (для меню та карток).
   ВАЖЛИВО: не чіпає контент статей (.rl-entry-content)
*/
ul:not(.rl-entry-content ul) {
  list-style: none;
  margin: 0;
  padding: 0;
}

h1, h2, h3, h4 {
  margin: 0;
  color: var(--rl-ink);
  font-weight: 700;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

:focus-visible {
  outline: 2px solid var(--rl-blue);
  outline-offset: 2px;
}

/* Utility Classes */
.rl-container {
  max-width: var(--rl-container);
  margin: 0 auto;
  padding: 0 24px;
}

.rl-section {
  margin-top: 40px;
}

.rl-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rl-section-head h2 {
  font-size: 20px;
}

.rl-see-all {
  font-size: 13px;
  color: var(--rl-blue);
  font-weight: 600;
  white-space: nowrap;
}

.rl-see-all:hover {
  text-decoration: underline;
}

.rl-badge-wrapper *,
.rl-badge {
  display: inline-block !important;
  width: auto !important;
  margin: 0 !important;
  padding: 4px 10px !important;
  border-radius: 6px !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  text-transform: uppercase;
  letter-spacing: .02em;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rl-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.rl-meta {
  font-size: 12px;
  color: var(--rl-muted);
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: 8px;
}

.rl-card {
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  box-shadow: var(--rl-shadow);
}

/* Category color helpers */
.is-cat-passenger { background: var(--rl-cat-passenger); }
.is-cat-freight { background: var(--rl-cat-freight); }
.is-cat-infra { background: var(--rl-cat-infra); }
.is-cat-electric { background: var(--rl-cat-electric); }

@media (max-width: 900px) {
  .rl-container {
    padding: 0 16px;
  }
}