/*
Theme Name: Raillog
Theme URI: https://raillog.uz.ua
Author: Raillog (Dmytro Haiduk)
Description: Тема новинного порталу Raillog.
Version: 5.0
Requires at least: 6.0
Requires PHP: 7.4
Text Domain: raillog
*/

/* ==========================================================================
   root
   ========================================================================== */
: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;
}

/* ==========================================================================
   Dark Theme Overrides
   ========================================================================== */
html[data-theme="dark"] {
  --rl-ink: #f1f5f9;
  --rl-text: #e2e8f0;
  --rl-muted: #94a3b8;
  --rl-blue: #3b82f6;
  --rl-blue-dark: #60a5fa;
  --rl-bg: #0f172a;        /* Темно-синій фоновий колір */
  --rl-card: #1e293b;      /* Колір карток та блоків */
  --rl-border: #334155;    /* Колір рамок та розділювачів */

  --rl-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) {
    --rl-ink: #f1f5f9;
    --rl-text: #e2e8f0;
    --rl-muted: #94a3b8;
    --rl-blue: #3b82f6;
    --rl-blue-dark: #60a5fa;
    --rl-bg: #0f172a;
    --rl-card: #1e293b;
    --rl-border: #334155;
    --rl-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
  }
}

body, .rl-card, .rl-header, .rl-panel, .sub-menu, .rl-comment-body, .rl-toc, input, select, textarea, button {
  transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

html[data-theme="dark"] .rl-header,
html[data-theme="dark"] .rl-search-form,
html[data-theme="dark"] .sub-menu {
  background-color: var(--rl-card) !important;
  border-color: var(--rl-border) !important;
}

html[data-theme="dark"] .rl-google-follow-box,
html[data-theme="dark"] .rl-social-box {
  background-color: var(--rl-card) !important;
  border-color: var(--rl-border) !important;
}

html[data-theme="dark"] .rl-google-follow-text,
html[data-theme="dark"] .rl-social-title {
  color: var(--rl-ink) !important;
}

html[data-theme="dark"] .rl-google-follow-btn {
  background-color: #334155 !important;
  color: #60a5fa !important;
  border-color: #475569 !important;
}

html[data-theme="dark"] .rl-comment-body {
  background-color: var(--rl-card);
  border-color: var(--rl-border);
}

html[data-theme="dark"] .rl-comment-author .fn,
html[data-theme="dark"] .rl-comment-content {
  color: var(--rl-text);
}

html[data-theme="dark"] .rl-service-icon {
  background: #1e3a8a;
  color: #93c5fd;
}

html[data-theme="dark"] .rl-doc-icon {
  background: #451a1a;
  color: #fca5a5;
}

html[data-theme="dark"] .rl-entry-content {
  color: var(--rl-text);
}

/* Стилі кнопки-перемикача теми */
.rl-theme-toggle {
  background: transparent;
  border: 1px solid var(--rl-border);
  color: var(--rl-text);
  padding: 6px 10px;
  border-radius: 20px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.rl-theme-toggle:hover {
  background: var(--rl-border);
}

.rl-theme-toggle .icon-sun { display: none; }
.rl-theme-toggle .icon-moon { display: inline-block; }

html[data-theme="dark"] .rl-theme-toggle .icon-sun { display: inline-block; }
html[data-theme="dark"] .rl-theme-toggle .icon-moon { display: none; }

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .rl-theme-toggle .icon-sun { display: inline-block; }
  html:not([data-theme="light"]) .rl-theme-toggle .icon-moon { display: none; }
}

*, *::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;
}

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

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

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.rl-topbar {
  background: #1a1d20;
  color: var(--rl-muted);
  font-size: 12px;
}

.rl-topbar .rl-container {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  height: 32px;
  align-items: center;
}

.rl-header {
  background: var(--rl-card);
  border-bottom: 1px solid var(--rl-border);
  position: sticky;
  top: 0;
  z-index: 50;
}

.rl-header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 64px;
  position: relative;
}

.rl-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  font-weight: 800;
  color: var(--rl-ink);
  margin-right: 8px;
  flex-shrink: 0;
  text-decoration: none;
}

.rl-logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--rl-blue);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}

.rl-nav {
  flex: 1;
}

.rl-nav .rl-menu-list {
  display: flex;
  align-items: center;
  gap: 20px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rl-nav .rl-menu-list > li {
  position: relative;
}

.rl-nav a {
  text-decoration: none;
  color: var(--rl-text);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 0;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.rl-nav a:hover,
.rl-nav a.current-menu-item {
  color: var(--rl-blue);
}

.rl-arrow {
  transition: transform 0.2s ease;
}

.rl-nav .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: var(--rl-card);
  border-radius: 12px;
  box-shadow: var(--rl-shadow);
  border: 1px solid var(--rl-border);
  padding: 8px 0;
  margin: 0;
  list-style: none;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 100;
}

.rl-nav .sub-menu li a {
  padding: 8px 18px;
  font-size: 14px;
  color: var(--rl-text);
  width: 100%;
  box-sizing: border-box;
}

.rl-nav .sub-menu li a:hover {
  background-color: var(--rl-bg);
  color: var(--rl-blue);
}

@media (min-width: 992px) {
  .rl-nav .menu-item-has-children:hover > .sub-menu,
  .rl-nav .sub-menu.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .rl-nav .menu-item-has-children:hover .rl-arrow {
    transform: rotate(180deg);
  }
}

.rl-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-left: auto;
}

.rl-icon-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rl-text);
  background: transparent;
  border: none;
  cursor: pointer;
}

.rl-icon-btn:hover {
  background: var(--rl-bg);
}

.rl-burger {
  display: none;
}

.rl-search-form {
  display: none;
  border-top: 1px solid var(--rl-border);
  background: var(--rl-card);
}

.rl-search-form.is-open {
  display: block;
}

/* --- Мобільна навігація (< 992px) --- */
@media (max-width: 991px) {
  .rl-burger {
    display: flex;
  }

  .rl-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 64px;
    background: var(--rl-card);
    border-bottom: 1px solid var(--rl-border);
    padding: 12px 24px;
    box-shadow: var(--rl-shadow);
  }

  .rl-nav.is-open {
    display: block;
  }

  .rl-nav .rl-menu-list {
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
  }

  .rl-nav .rl-menu-list > li {
    width: 100%;
    border-bottom: 1px solid var(--rl-border);
  }

  .rl-nav .rl-menu-list > li:last-child {
    border-bottom: none;
  }

  .rl-nav a {
    justify-content: space-between;
    padding: 12px 0;
  }

  .rl-nav .sub-menu {
    position: static;
    box-shadow: none;
    border: none;
    padding: 0 0 8px 16px;
    opacity: 1;
    visibility: visible;
    transform: none;
    display: none;
  }

  .rl-nav .menu-item-has-children.is-open > .sub-menu {
    display: block;
  }

  .rl-nav .menu-item-has-children.is-open .rl-arrow {
    transform: rotate(180deg);
  }
}

/* ==========================================================================
   Hero Section (Swiper)
   ========================================================================== */
.rl-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  margin-bottom: 30px;
  margin-top: 20px;
}

@media (min-width: 992px) {
  .rl-hero {
    grid-template-columns: 2fr 1fr;
    height: 400px;
  }
}

.rl-hero-main-swiper {
  width: 100%;
  height: 100%;
  border-radius: 16px;
  overflow: hidden;
  position: relative;
}

.rl-hero-main {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.rl-hero-media {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.rl-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.85) 100%);
  z-index: 2;
  pointer-events: none;
}
@media (max-width: 992px){
	.rl-hero-overlay {
	  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 1%, rgba(0, 0, 0, 0.85) 90%);
	}
}

.rl-hero-content {
  position: relative;
  z-index: 3;
  padding: 24px;
  color: #ffffff;
}

.rl-hero-content h1 {
  font-size: 22px;
  line-height: 1.3;
  margin: 8px 0 6px 0;
  font-weight: 700;
  color: #ffffff;
}

.rl-hero-content h1 a {
  color: #ffffff;
  text-decoration: none;
}

.rl-hero-content .rl-meta {
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
}

.rl-hero-main-swiper .swiper-pagination {
  bottom: 10px !important;
  z-index: 5;
}

.rl-hero-main-swiper .swiper-pagination-bullet {
  background: #ffffff;
  opacity: 0.5;
}

.rl-hero-main-swiper .swiper-pagination-bullet-active {
  opacity: 1;
  background: var(--rl-blue);
}

.rl-hero-side-swiper {
  width: 100%;
  height: 100%;
}

.rl-hero-side-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  height: 100%;
  box-sizing: border-box;
}

.rl-hero-side-item:hover {
  background-color: var(--rl-border);
}

.swiper-slide-thumb-active .rl-hero-side-item {
  background-color: var(--rl-border);
}

.swiper-slide-thumb-active .rl-hero-side-body h3 {
  color: var(--rl-blue);
}

.rl-hero-side-thumb {
  width: 90px;
  height: 80px;
  flex-shrink: 0;
  border-radius: 6px;
  overflow: hidden;
  background: var(--rl-border);
}

.rl-hero-side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rl-thumb-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--rl-muted);
}

.rl-hero-side-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.rl-hero-side-body h3 {
  font-size: 14px;
  line-height: 1.3;
  margin: 2px 0;
  font-weight: 600;
  color: var(--rl-ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rl-hero-side-body .rl-meta {
  font-size: 11px;
  color: var(--rl-muted);
}

/* ==========================================================================
   Services
   ========================================================================== */
.rl-services-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 16px;
}

.rl-service-card {
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 20px 14px;
  text-align: center;
  text-decoration: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.rl-service-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--rl-shadow);
}

.rl-service-icon {
  width: 44px;
  height: 44px;
  margin: 0 auto 12px;
  border-radius: 10px;
  background: #eaf0fe;
  color: var(--rl-blue);
  display: flex;
  align-items: center;
  justify-content: center;
}

.rl-service-card span {
  font-size: 13px;
  font-weight: 600;
  color: var(--rl-ink);
}

@media (max-width: 900px) {
  .rl-services-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 560px) {
  .rl-services-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   News Grid
   ========================================================================== */
.rl-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.rl-news-card {
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
	  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05); /* Легка тінь як на скриншоті */
	  height: 100%;

}

.rl-news-media {
  position: relative !important;
  width: 100%;
  overflow: hidden;
  border-radius: var(--rl-radius) var(--rl-radius) 0 0;
	  aspect-ratio: 16 / 10; /* Фіксує співвідношення сторін для всіх фото */
	  background-color: #e9ecef; /* Сірий фон-заглушка, якщо немає фото */
}

.rl-news-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--rl-border);
}

.rl-news-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rl-news-thumb .rl-badge,
.rl-card .rl-badge {
  position: absolute;
  bottom: 12px;
  left: 12px;
  z-index: 3;
  display: inline-block;
  width: auto;
  max-width: calc(100% - 24px);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  padding: 4px 10px;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.rl-news-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
	  justify-content: space-between;
  flex-grow: 1;
}
.rl-news-body .rl-meta {
  font-size: 12px;
  color: #8c98a4;
  display: flex;
  gap: 12px;
  margin-top: auto;
}
.rl-news-body h3 {
  font-size: 14px;
  line-height: 1.4;
  margin: 0 0 8px 0;
}

.rl-news-body h3 a {
  color: var(--rl-ink);
  text-decoration: none;
}

.rl-news-body h3 a:hover {
  color: var(--rl-blue);
}

.rl-news-body .rl-meta {
  margin-top: auto;
  font-size: 12px;
  color: var(--rl-muted);
}

@media (max-width: 900px) {
  .rl-news-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 560px) {
  .rl-news-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Bottom Row: Popular / Library / Poll
   ========================================================================== */
.rl-bottom-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 20px;
}

.rl-panel {
  padding: 20px;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
}

.rl-panel h2 {
  font-size: 16px;
  margin-bottom: 14px;
}

.rl-popular-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rl-popular-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.rl-popular-rank {
  font-size: 18px;
  font-weight: 800;
  color: var(--rl-muted);
  width: 24px;
  flex-shrink: 0;
}

.rl-popular-body a {
  font-size: 13px;
  font-weight: 600;
  color: var(--rl-ink);
  text-decoration: none;
}

.rl-popular-body a:hover {
  color: var(--rl-blue);
}

.rl-popular-body .rl-meta {
  margin-top: 2px;
  font-size: 11px;
}

.rl-doc-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.rl-doc-item {
  display: flex;
  gap: 10px;
  align-items: flex-start; /* Вирівнює іконку та вміст по верхньому краю */
}

.rl-doc-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: #fdeceb;
  color: #c0392b;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-top: 1px;
}

.rl-doc-body {
  min-width: 0;
}

.rl-doc-body a {
  font-size: 13px;
  font-weight: 600;
  color: var(--rl-ink);
  text-decoration: none;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s ease;
}

.rl-doc-body a:hover {
  color: var(--rl-blue);
}

.rl-doc-meta {
  font-size: 11px;
  color: var(--rl-muted);
  margin-top: 3px;
}

.rl-poll-question {
  font-size: 13px;
  font-weight: 600;
  color: var(--rl-ink);
  margin-bottom: 12px;
}

.rl-poll-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.rl-poll-option {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: var(--rl-text);
}

.rl-poll-option input {
  width: 16px;
  height: 16px;
  accent-color: var(--rl-blue);
}

.rl-poll-submit {
  background: var(--rl-blue);
  color: #ffffff;
  border: none;
  border-radius: 8px;
  padding: 10px 18px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.rl-poll-submit:hover {
  background: var(--rl-blue-dark);
}

.rl-panel-foot {
  margin-top: 12px;
  font-size: 12px;
}

.rl-panel-foot a {
  color: var(--rl-blue);
  font-weight: 600;
  text-decoration: none;
}

@media (max-width: 900px) {
  .rl-bottom-grid {
    grid-template-columns: 1fr;
  }
}

/* ==========================================================================
   Gallery Strip (Актуальне)
   ========================================================================== */
.rl-gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.rl-gallery-item {
  aspect-ratio: 4 / 3;
  border-radius: var(--rl-radius);
  overflow: hidden;
  background: var(--rl-border);
}

.rl-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.rl-gallery-item:hover img {
  transform: scale(1.05);
}

@media (max-width: 900px) {
  .rl-gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ==========================================================================
   Footer
   ========================================================================== */
.rl-footer {
  margin-top: 64px;
  background: #28324c;
  color: #e9ecef;
  padding: 48px 0 24px;
}

.rl-footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 32px;
}

.rl-footer h4 {
  color: #ffffff;
  font-size: 14px;
  margin-bottom: 14px;
}

.rl-footer .rl-logo {
  color: #ffffff;
}

.rl-footer-desc {
  margin-top: 12px;
  font-size: 14px;
  line-height: 1.6;
  max-width: 320px;
}

.rl-footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
}

.rl-footer-links li {
  margin-bottom: 10px;
}

.rl-footer-links a {
  font-size: 14px;
  color: var(--wp--preset--color--cyan-bluish-gray);
  text-decoration: none;
  transition: color 0.2s ease;
}

.rl-footer-links a:hover {
  color: #ffffff;
}

.rl-footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  margin-top: 36px;
  padding-top: 20px;
  font-size: 12px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: #e9ecef;
}

@media (max-width: 900px) {
  .rl-footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 28px;
  }
  .rl-footer-bottom {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
}

/* ==========================================================================
   Inner Pages (Single / Post / TOC)
   ========================================================================== */

.rl-single-card {
  background: var(--rl-card);
  /*border: 1px solid var(--rl-border);*/
  border-radius: var(--rl-radius);
  padding: 32px;
  margin-top: 24px;
}

.rl-page-head {
  margin-bottom: 20px;
}

.rl-page-head .rl-entry-title {
  font-size: 26px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--rl-ink);
  margin: 12px 0 10px 0;
}

.rl-breadcrumbs {
  font-size: 12px;
  color: var(--rl-muted);
  margin-bottom: 10px;
}

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

.rl-breadcrumbs .rl-sep {
  margin: 0 4px;
  color: var(--rl-muted);
}

.rl-post-thumbnail {
  margin: 20px 0 28px 0;
  border-radius: var(--rl-radius);
  overflow: hidden;
  max-height: 480px;
  background: var(--rl-bg);
  display: flex;
  justify-content: center;
  align-items: center;
}

.rl-post-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.rl-single-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.rl-entry-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--rl-text);
}

.rl-entry-content p {
  margin-bottom: 20px;
}

.rl-entry-content h2, 
.rl-entry-content h3 {
  margin: 32px 0 16px 0;
  font-weight: 700;
  color: var(--rl-ink);
}

.rl-entry-content p:first-child, 
.rl-entry-content h2:first-child, 
.rl-entry-content h3:first-child,
.rl-entry-content h4:first-child {
  margin-top: 0px;
}

/* Блок змісту (Table of Contents) */
.rl-toc {
  background: var(--rl-bg);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 16px 20px;
}

.rl-toc-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--rl-ink);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--rl-border);
}

.rl-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.rl-toc-item a {
  font-size: 14px;
  color: var(--rl-text);
  text-decoration: none;
  line-height: 1.4;
  transition: color 0.2s ease;
  display: block;
}

.rl-toc-item a:hover {
  color: var(--rl-blue);
}

.rl-toc-h3 {
  padding-left: 14px;
  font-size: 13px;
}

@media (max-width: 991px) {
  .rl-single-card {
    padding: 20px;
  }

  .rl-single-sidebar {
    order: 1;
  }
  
  .rl-entry-content {
    order: 2;
  }
}

@media (min-width: 992px) {
  .rl-single-layout {
    grid-template-columns: 1fr 280px;
    gap: 32px;
  }

  .rl-entry-content {
    order: 1;
  }

  .rl-single-sidebar {
    order: 2;
  }

  .rl-sticky-toc {
    position: sticky;
    top: 84px;
  }
}

.rl-comments-wrapper {
  margin-top: 24px;
}

.rl-meta-article {
	width: 100%;
    background-color: var(--rl-bg);
    padding: 15px;
    border-radius: 15px;
    display: block;
}

/* ==========================================================================
   Blockquotes
   ========================================================================== */
.rl-entry-content blockquote {
  position: relative;
  margin: 28px 0;
  padding: 20px 48px 20px 24px;
  background: var(--rl-bg);
  border-left: 4px solid var(--rl-blue);
  border-radius: 0 var(--rl-radius) var(--rl-radius) 0;
  font-style: italic;
  color: var(--rl-ink);
  overflow: hidden;
}

.rl-entry-content blockquote::before {
  content: "“";
  position: absolute;
  right: 22px;
  bottom: -22px;
  font-size: 70px;
  line-height: 1;
  font-family: Georgia, serif;
  color: var(--rl-blue);
  opacity: 0.15;
  pointer-events: none;
  user-select: none;
}

.rl-entry-content blockquote p {
  margin: 0;
  font-size: 15px;
  line-height: 1.6;
  position: relative;
  z-index: 2;
}

.rl-entry-content blockquote p + p {
  margin-top: 10px;
}

.rl-entry-content blockquote cite,
.rl-entry-content blockquote footer {
  display: block;
  margin-top: 12px;
  font-size: 13px;
  font-style: normal;
  font-weight: 600;
  color: var(--rl-muted);
  position: relative;
  z-index: 2;
}

.rl-entry-content blockquote cite::before,
.rl-entry-content blockquote footer::before {
  content: "— ";
}

/* ==========================================================================
   Lists inside Post Content (ul, ol, li)
   ========================================================================== */

.rl-entry-content ul,
.rl-entry-content ol {
  margin: 20px 0;
  padding: 0;
  list-style: none !important;
}

.rl-entry-content li {
  position: relative;
  font-size: 16px;
  line-height: 1.6;
  color: var(--rl-text);
  margin-bottom: 8px;
}

.rl-entry-content ul {
  padding-left: 20px;
}

.rl-entry-content ul > li::before {
  content: "" !important;
  position: absolute;
  left: -16px;
  top: 11px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background-color: var(--rl-muted);
  display: block;
}

.rl-entry-content ul ul,
.rl-entry-content ol ul,
.rl-entry-content ul ol {
  margin: 6px 0 6px 0;
  padding-left: 20px;
}

.rl-entry-content ul > li > ul > li::before {
  background-color: transparent !important;
  border: 1px solid var(--rl-muted);
  width: 5px;
  height: 5px;
}

.rl-entry-content ol {
  counter-reset: rl-list-counter;
  padding-left: 32px;
}

.rl-entry-content ol > li {
  counter-increment: rl-list-counter;
}

.rl-entry-content ol > li::before {
  content: counter(rl-list-counter) !important;
  position: absolute;
  left: -32px;
  top: 2px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background-color: var(--rl-border);
  color: var(--rl-blue);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.rl-pagination-wrapper .navigation.pagination {
  display: flex;
  justify-content: center;
}

.rl-pagination-wrapper .nav-links {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rl-pagination-wrapper .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 8px;
  background: var(--rl-card);
  border: 1px solid var(--rl-border);
  color: var(--rl-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
}

.rl-pagination-wrapper .page-numbers:hover {
  border-color: var(--rl-blue);
  color: var(--rl-blue);
}

.rl-pagination-wrapper .page-numbers.current {
  background: var(--rl-blue);
  color: #ffffff;
  border-color: var(--rl-blue);
}

/* ==========================================================================
   Search Form
   ========================================================================== */

.rl-search-form-inline {
  width: 100%;
}

.rl-search-input-group {
  display: flex;
  align-items: center;
  position: relative;
  width: 100%;
}

.rl-search-input-group input[type="search"] {
  width: 100%;
  height: 46px;
  padding: 10px 110px 10px 16px;
  font-size: 15px;
  color: var(--rl-ink);
  background-color: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.rl-search-input-group input[type="search"]:focus {
  border-color: var(--rl-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.rl-search-input-group button[type="submit"] {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 16px;
  background-color: var(--rl-blue);
  color: #ffffff;
  border: none;
  border-radius: calc(var(--rl-radius) - 3px);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.rl-search-input-group button[type="submit"]:hover {
  background-color: var(--rl-blue-dark);
}

.rl-search-input-group button[type="submit"] svg {
  flex-shrink: 0;
}

@media (max-width: 480px) {
  .rl-search-input-group input[type="search"] {
    padding-right: 54px;
  }
  
  .rl-search-input-group button[type="submit"] span {
    display: none;
  }
  
  .rl-search-input-group button[type="submit"] {
    padding: 0 12px;
  }
}

/* ==========================================================================
   Comments
   ========================================================================== */

.rl-comments-area {
  padding-top: 2rem;
  border-top: 1px solid var(--rl-border);
}

.rl-comments-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--rl-ink);
  margin-bottom: 2rem;
}

.rl-comment-list, 
.rl-comment-list .children {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rl-comment-list .children {
  margin-left: 2.5rem;
  border-left: 2px solid var(--rl-border);
  padding-left: 1.25rem;
}

.rl-comment-item {
  margin-bottom: 1.75rem;
}

.rl-comment-body {
  background-color: var(--rl-bg);
  border: 1px solid var(--rl-border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s ease;
  margin-bottom: 8px;
}

.rl-comment-body:hover {
  border-color: var(--rl-blue);
}

.rl-comment-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.rl-comment-author {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.rl-comment-author .rl-avatar {
  border-radius: 50%;
  object-fit: cover;
}

.rl-comment-author .fn {
  font-style: normal;
  font-weight: 600;
  color: var(--rl-ink);
  font-size: 0.95rem;
}

.rl-comment-author .fn a {
  color: inherit;
  text-decoration: none;
}

.rl-comment-metadata a {
  font-size: 0.825rem;
  color: var(--rl-muted);
  text-decoration: none;
}

.rl-comment-metadata a:hover {
  color: var(--rl-blue);
}

.rl-comment-content {
  font-size: 0.95rem;
  line-height: 1.6;
  color: var(--rl-text);
  margin-bottom: 0.75rem;
}

.rl-comment-content p:last-child {
  margin-bottom: 0;
}

.rl-comment-reply a {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--rl-blue);
  text-decoration: none;
  transition: color 0.15s ease;
}

.rl-comment-reply a:hover {
  color: var(--rl-blue-dark);
  text-decoration: underline;
}

/* ==========================================================================
   Comment Form
   ========================================================================== */
.rl-comment-form {
  background-color: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: var(--rl-radius);
  padding: 1.5rem;
  margin-top: 2.5rem;
  box-shadow: var(--rl-shadow);
}

.comment-reply-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--rl-ink);
  margin-bottom: 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#cancel-comment-reply-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: #ef4444;
  text-decoration: none;
}

.rl-comment-form p {
  margin-bottom: 1rem;
}

.rl-comment-form label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rl-text);
  margin-bottom: 0.375rem;
}

.rl-comment-form input[type="text"],
.rl-comment-form input[type="email"],
.rl-comment-form textarea {
  width: 100%;
  padding: 0.625rem 0.875rem;
  font-size: 0.95rem;
  border: 1px solid var(--rl-border);
  border-radius: 8px;
  background-color: var(--rl-card);
  color: var(--rl-ink);
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.3s ease;
}

.rl-comment-form input:focus,
.rl-comment-form textarea:focus {
  border-color: var(--rl-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}

.rl-comment-form .required {
  color: #ef4444;
}

.rl-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.625rem 1.25rem;
  background-color: var(--rl-blue);
  color: #ffffff;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.rl-btn-primary:hover {
  background-color: var(--rl-blue-dark);
}

@media (max-width: 640px) {
  .rl-comment-list .children {
    margin-left: 1rem;
    padding-left: 0.75rem;
  }
  
  .rl-comment-body {
    padding: 1rem;
  }
}

/* ==========================================================================
   RailLog Social Media Box
   ========================================================================== */

.rl-social-box {
  background-color: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-radius: 10px;
  padding: 1.125rem;
  margin-top: 1.25rem;
  /*box-shadow: var(--rl-shadow);*/
}

.rl-social-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--rl-ink);
  margin-bottom: 0.25rem;
}

.rl-social-desc {
  font-size: 0.825rem;
  color: var(--rl-muted);
  line-height: 1.35;
  margin-bottom: 0.875rem;
}

.rl-social-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.rl-social-btn {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.5rem 0.875rem;
  border-radius: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.rl-social-btn svg {
  flex-shrink: 0;
}

/* Telegram */
.rl-social-tg {
  background-color: #f0f9ff;
  color: #0284c7;
  border-color: #e0f2fe;
}
.rl-social-tg:hover {
  background-color: #0284c7;
  color: #ffffff;
  border-color: #0284c7;
}

/* Facebook */
.rl-social-fb {
  background-color: #eff6ff;
  color: #1d4ed8;
  border-color: #dbeafe;
}
.rl-social-fb:hover {
  background-color: #1d4ed8;
  color: #ffffff;
  border-color: #1d4ed8;
}

/* WhatsApp */
.rl-social-wa {
  background-color: #f0fdf4;
  color: #16a34a;
  border-color: #dcfce7;
}
.rl-social-wa:hover {
  background-color: #16a34a;
  color: #ffffff;
  border-color: #16a34a;
}

/* Instagram */
.rl-social-insta {
  background-color: #fdf2f8;
  color: #db2777;
  border-color: #fce7f3;
}
.rl-social-insta:hover {
  background-color: #db2777;
  color: #ffffff;
  border-color: #db2777;
}

/* Threads */
.rl-social-threads {
  background-color: #f8fafc;
  color: #0f172a;
  border-color: #e2e8f0;
}
.rl-social-threads:hover {
  background-color: #0f172a;
  color: #ffffff;
  border-color: #0f172a;
}

/* Темні приглушені адаптації соцмереж під Dark Theme */
html[data-theme="dark"] .rl-social-tg { background-color: #0c2a3a; color: #38bdf8; border-color: #0369a1; }
html[data-theme="dark"] .rl-social-tg:hover { background-color: #0284c7; color: #ffffff; }

html[data-theme="dark"] .rl-social-fb { background-color: #1e293b; color: #60a5fa; border-color: #1d4ed8; }
html[data-theme="dark"] .rl-social-fb:hover { background-color: #1d4ed8; color: #ffffff; }

html[data-theme="dark"] .rl-social-wa { background-color: #062e1b; color: #4ade80; border-color: #15803d; }
html[data-theme="dark"] .rl-social-wa:hover { background-color: #16a34a; color: #ffffff; }

html[data-theme="dark"] .rl-social-insta { background-color: #3b0764; color: #f472b6; border-color: #be185d; }
html[data-theme="dark"] .rl-social-insta:hover { background-color: #db2777; color: #ffffff; }

html[data-theme="dark"] .rl-social-threads { background-color: #1e293b; color: #f1f5f9; border-color: #334155; }
html[data-theme="dark"] .rl-social-threads:hover { background-color: #334155; color: #ffffff; }

/* ==========================================================================
   RailLog Google Source Banner (Sidebar Layout)
   ========================================================================== */

.rl-sticky-toc .rl-google-follow-box {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 0.875rem !important;
  
  width: 100% !important;
  box-sizing: border-box !important;
  float: none !important;
  
  background-color: var(--rl-card);
  border: 1px solid var(--rl-border);
  border-left: 4px solid #4285f4;
  border-radius: 10px;
  padding: 1rem;
  margin-top: 1.25rem;
  /*box-shadow: var(--rl-shadow);*/
}

.rl-sticky-toc > .rl-google-follow-box:first-child,
.rl-sticky-toc > .rl-google-follow-wrapper:first-child .rl-google-follow-box {
  margin-top: 0 !important;
}

.rl-sticky-toc .rl-google-follow-info {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
}

.rl-sticky-toc .rl-google-follow-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: 2px;
}

.rl-sticky-toc .rl-google-follow-text {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rl-ink);
  line-height: 1.35;
}

.rl-sticky-toc .rl-google-follow-btn {
  width: 100% !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--rl-bg);
  color: var(--rl-blue);
  border: 1px solid var(--rl-border);
  padding: 0.55rem 0.75rem;
  border-radius: 20px;
  font-size: 0.825rem;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.rl-sticky-toc .rl-google-follow-btn:hover {
  background-color: var(--rl-border);
  border-color: #4285f4;
  color: var(--rl-blue-dark);
  box-shadow: 0 2px 4px rgba(66, 133, 244, 0.15);
}

#wpadminbar {position:absolute;}
