/* ==========================================================================
   ipoteka.net.ua — Newsup Child Theme Stylesheet
   Palette: Media Terracotta (#FAF8F5, #1E293B, #1E3A5F, #D95D39, #C2410C)
   Typography: e-Ukraine + e-Ukraine Head
   ========================================================================== */

:root {
  --bg-page: #faf8f5;
  --bg-surface: #ffffff;
  --bg-subtle: #f2ede6;
  --text-primary: #18181b;
  --text-secondary: #3f3f46;
  --text-muted: #71717a;
  --border: #e7e1d8;
  --border-strong: #d4cbc0;

  --brand-blue: #1e3a5f;
  --brand-blue-hover: #152b47;
  --brand-navy: #1e293b;
  --brand-footer-accent: #d95d39;
  --brand-blue-soft: #eef2f7;
  --brand-red: #c2410c;
  --brand-red-dark: #9a3412;
  --brand-red-soft: #fff1eb;
  --brand-yellow: #d95d39;
  --brand-yellow-soft: #fff5f0;
  --brand-yellow-border: #f4b49c;
  --eoselya-text: #9a3412;

  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --shadow-xs: 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.05);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);

  --container-max: 1260px;
  --transition: 0.18s ease;
}

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

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

body {
  margin: 0;
  font-family: 'e-Ukraine', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.96875rem;
  line-height: 1.62;
  color: var(--text-primary);
  background-color: var(--bg-page);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
.brand-title,
.hero-lead-title,
.section-title,
.archive-title,
.article-title {
  font-family: 'e-Ukraine Head', 'e-Ukraine', -apple-system, BlinkMacSystemFont, sans-serif;
}

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

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

a:hover {
  color: var(--brand-blue-hover);
}

button {
  font-family: inherit;
  cursor: pointer;
}

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

.skip-link:focus {
  position: fixed;
  top: 8px;
  left: 8px;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 9999;
  padding: 10px 16px;
  background: var(--brand-navy);
  color: #ffffff;
  border-radius: var(--radius-sm);
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 20px;
}

.num-tabular {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Top Bar & Embedded GTranslate Switcher
   ========================================================================== */
.topbar {
  background-color: var(--brand-navy);
  color: #cbd5e1;
  font-size: 0.8125rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 38px;
  padding: 4px 0;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.topbar-date {
  color: #94a3b8;
  font-variant-numeric: tabular-nums;
}

.topbar-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #f8fafc;
  font-weight: 500;
}

.topbar-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--brand-yellow);
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 14px;
}

.topbar-links a {
  color: #cbd5e1;
  font-size: 0.8125rem;
}

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

.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  padding: 2px;
  gap: 2px;
}

.lang-switcher a,
.lang-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: #cbd5e1;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 999px;
  line-height: 1.2;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
}

.lang-switcher a.gt-current-lang,
.lang-switcher a:hover,
.lang-btn.is-active,
.lang-btn:hover {
  background: var(--brand-red);
  color: #ffffff;
}

/* Hide any leftover floating GTranslate globe */
.gglobe,
.gsatelites,
.gt_float_switcher {
  display: none !important;
}

.grecaptcha-badge {
  visibility: hidden !important;
}

/* ==========================================================================
   Main Header & Primary Navigation
   ========================================================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-surface);
  border-bottom: 2px solid var(--brand-navy);
  box-shadow: var(--shadow-xs);
}

.admin-bar .site-header {
  top: 32px;
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 70px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text-primary);
  flex-shrink: 0;
}

.brand-link:hover {
  color: var(--text-primary);
}

.brand-logo {
  width: 42px;
  height: 42px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #1e293b;
  white-space: nowrap;
}

.brand-title .brand-lead {
  color: #c2410c;
}

.brand-tagline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  font-size: 0.6875rem;
  color: var(--text-muted);
  font-weight: 500;
  white-space: nowrap;
}

.brand-tagline::before {
  content: '';
  width: 14px;
  height: 2px;
  background: var(--brand-red);
  border-radius: 1px;
  flex-shrink: 0;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.primary-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 2px;
}

.primary-nav li {
  position: relative;
}

.primary-nav a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.84375rem;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  transition: background var(--transition), color var(--transition);
}

.primary-nav a:hover,
.primary-nav .current-menu-item > a,
.primary-nav .current-category-ancestor > a,
.primary-nav a.is-active {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.primary-nav a.nav-eoselya,
.primary-nav li.nav-eoselya > a {
  background: var(--brand-yellow-soft);
  color: var(--eoselya-text);
  border: 1px solid var(--brand-yellow-border);
}

.primary-nav a.nav-eoselya:hover,
.primary-nav li.nav-eoselya > a:hover {
  background: var(--brand-red);
  border-color: var(--brand-red);
  color: #ffffff;
}

.primary-nav a.nav-forum {
  color: var(--brand-blue);
}

/* Submenu support for WP menus */
.primary-nav .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  flex-direction: column;
  align-items: stretch;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 6px;
  box-shadow: var(--shadow-md);
  z-index: 120;
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
  display: flex;
}

.primary-nav .sub-menu a {
  padding: 8px 12px;
  font-size: 0.8125rem;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  transition: border-color var(--transition), color var(--transition), background var(--transition);
}

.icon-btn:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
}

.menu-toggle {
  display: none;
}

/* Search Drawer */
.search-drawer {
  display: none;
  border-top: 1px solid var(--border);
  background: var(--bg-page);
  padding: 14px 0;
}

.search-drawer.is-open {
  display: block;
}

.search-form {
  display: flex;
  gap: 10px;
  max-width: 720px;
  margin: 0 auto;
}

.search-input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  color: var(--text-primary);
  background: var(--bg-surface);
}

.search-input:focus {
  outline: 2px solid var(--brand-blue);
  outline-offset: 1px;
  border-color: var(--brand-blue);
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-blue);
  color: #ffffff;
  font-size: 0.9375rem;
  font-weight: 600;
  transition: background var(--transition);
}

.btn-primary:hover {
  background: var(--brand-blue-hover);
  color: #ffffff;
}

/* Mobile Nav Drawer */
.mobile-drawer {
  display: none;
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 12px 0 18px;
}

.mobile-drawer.is-open {
  display: block;
}

.mobile-nav-list,
.mobile-nav-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.mobile-nav-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.mobile-nav-list a:hover,
.mobile-nav-list .current-menu-item > a {
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

/* ==========================================================================
   Breaking News Ticker
   ========================================================================== */
.ticker-bar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
}

.ticker-inner {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 42px;
  padding: 6px 0;
  overflow: hidden;
}

.ticker-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  background: var(--brand-red-soft);
  color: var(--brand-red-dark);
  border: 1px solid var(--brand-yellow-border);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  white-space: nowrap;
  flex-shrink: 0;
}

.ticker-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--brand-red);
}

.ticker-viewport {
  position: relative;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  mask-image: linear-gradient(90deg, transparent 0%, #000 18px, #000 calc(100% - 18px), transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 18px, #000 calc(100% - 18px), transparent 100%);
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 32px;
  width: max-content;
  animation: tickerScroll 48s linear infinite;
}

.ticker-viewport:hover .ticker-track {
  animation-play-state: paused;
}

.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
}

.ticker-item:hover {
  color: var(--brand-blue);
}

.ticker-item time {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

@keyframes tickerScroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .ticker-track {
    animation: none;
  }
}

/* ==========================================================================
   Pills, Section Headers & Main Container
   ========================================================================== */
.cat-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  line-height: 1.4;
}

.cat-pill.is-featured,
.cat-pill.is-eoselya {
  background: var(--brand-yellow-soft);
  color: var(--eoselya-text);
  border: 1px solid var(--brand-yellow-border);
}

.section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--brand-navy);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.section-title::before {
  content: '';
  width: 4px;
  height: 20px;
  border-radius: 2px;
  background: var(--brand-blue);
}

.section-title.is-red::before {
  background: var(--brand-red);
}

.section-more {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--brand-blue);
  white-space: nowrap;
}

.page-main {
  padding: 28px 0 56px;
}

/* ==========================================================================
   Hero Grid
   ========================================================================== */
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 24px;
  margin-bottom: 28px;
}

.hero-lead-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition);
}

.hero-lead-card:hover {
  box-shadow: var(--shadow-md);
}

.hero-lead-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--bg-subtle);
  overflow: hidden;
}

.hero-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.hero-lead-card:hover .hero-lead-media img {
  transform: scale(1.02);
}

.hero-lead-body {
  padding: 22px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.post-meta-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.hero-lead-title {
  margin: 0;
  font-size: 1.5625rem;
  line-height: 1.28;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.hero-lead-title a {
  color: inherit;
}

.hero-lead-title a:hover {
  color: var(--brand-red);
}

.hero-lead-excerpt {
  margin: 0;
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.hero-side-panel {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  box-shadow: var(--shadow-xs);
  display: flex;
  flex-direction: column;
}

.hero-side-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.hero-side-heading {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-navy);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-side-heading::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand-red);
}

.hero-side-list {
  display: flex;
  flex-direction: column;
  flex: 1;
  justify-content: space-between;
}

.hero-side-item {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
  align-items: start;
}

.hero-side-item:last-child {
  border-bottom: 0;
  padding-bottom: 2px;
}

.hero-side-thumb {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
}

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

.hero-side-title {
  margin: 4px 0 4px;
  font-size: 0.90625rem;
  line-height: 1.38;
  font-weight: 700;
  color: var(--text-primary);
}

.hero-side-title a {
  color: inherit;
}

.hero-side-title a:hover {
  color: var(--brand-red);
}

.hero-side-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   6 Quick Topics Strip
   ========================================================================== */
.topics-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 32px;
}

.topic-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 6px;
  padding: 14px 16px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--brand-blue);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  box-shadow: var(--shadow-xs);
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}

.topic-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
  border-color: var(--brand-red);
  color: var(--brand-red);
}

.topic-card.is-eoselya,
.topic-card.is-analytics {
  border-top-color: var(--brand-red);
  background: linear-gradient(180deg, var(--brand-yellow-soft) 0%, #ffffff 45%);
}

.topic-name {
  font-size: 0.90625rem;
  font-weight: 700;
  line-height: 1.3;
}

.topic-count {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Content + Sidebar Layout & Post Cards
   ========================================================================== */
.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 330px;
  gap: 28px;
  align-items: start;
}

.content-layout > * {
  min-width: 0;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition), transform var(--transition);
}

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

.post-card-media {
  aspect-ratio: 16 / 10;
  background: var(--bg-subtle);
  overflow: hidden;
}

.post-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-card-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.post-card-title {
  margin: 0;
  font-size: 1.03125rem;
  line-height: 1.38;
  font-weight: 700;
  color: var(--text-primary);
}

.post-card-title a {
  color: inherit;
}

.post-card-title a:hover {
  color: var(--brand-red);
}

.post-card-excerpt {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.posts-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.post-row-card {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 20px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px;
  box-shadow: var(--shadow-xs);
  transition: box-shadow var(--transition);
}

.post-row-card:hover {
  box-shadow: var(--shadow-md);
}

.post-row-card.no-thumb {
  grid-template-columns: minmax(0, 1fr);
}

.post-row-media {
  aspect-ratio: 16 / 10;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
}

.post-row-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.post-row-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}

/* ==========================================================================
   Sidebar, Widgets & Safe AdSense / WP QUADS Containers
   ========================================================================== */
.sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.widget-box,
.mg-widget {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 18px;
  box-shadow: var(--shadow-xs);
  overflow: hidden;
  max-width: 100%;
}

.widget-title,
.mg-wid-title h6 {
  margin: 0 0 14px;
  font-family: 'e-Ukraine Head', 'e-Ukraine', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  color: var(--brand-navy);
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.mg-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mg-widget li {
  font-size: 0.875rem;
  line-height: 1.45;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.mg-widget li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

/* Newsup Tabbed Widget Compatibility (Without Bootstrap) */
.tabbed-container .nav-tabs {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}

.tabbed-container .nav-tabs li {
  border: 0;
  padding: 0;
}

.tabbed-container .nav-tabs a {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--bg-page);
  border: 1px solid var(--border);
}

.tabbed-container .nav-tabs li.active a,
.tabbed-container .nav-tabs a.active,
.tabbed-container .nav-tabs a:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

.tabbed-container .tab-pane {
  display: none;
}

.tabbed-container .tab-pane.active {
  display: block;
}

.tabbed-container .small-post {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}

.tabbed-container .small-post:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.tabbed-container .img-small-post {
  width: 72px;
  height: 54px;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
}

.tabbed-container .img-small-post img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tabbed-container .small-post-content h5 {
  margin: 0;
  font-size: 0.84375rem;
  line-height: 1.38;
  font-weight: 600;
}

.tabbed-container .small-post-content h5 a {
  color: var(--text-primary);
}

.tabbed-container .small-post-content h5 a:hover {
  color: var(--brand-red);
}

.tabbed-container .mg-blog-category {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}

.tabbed-container .newsup-categories {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
}

.mg-widget .search-form {
  max-width: 100%;
}

.mg-widget .wp-block-search__inside-wrapper {
  display: flex;
  gap: 8px;
}

.mg-widget .wp-block-search__input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
}

.mg-widget .wp-block-search__button {
  height: 40px;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-blue);
  color: #ffffff;
  font-weight: 600;
  font-family: inherit;
}

.ranked-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ranked-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.ranked-item:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.ranked-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 6px;
  background: var(--brand-blue-soft);
  color: var(--brand-blue);
  font-size: 0.8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.ranked-link {
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

.ranked-link:hover {
  color: var(--brand-red);
}

.ranked-meta {
  display: block;
  margin-top: 4px;
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Anti-overlap & Anti-CLS Ad Container Protection */
.ad-slot,
.quads-location,
.mg-widget ins.adsbygoogle {
  max-width: 100% !important;
  overflow: hidden !important;
}

.ad-slot {
  background: var(--bg-subtle);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 12px;
}

.ad-slot-sidebar {
  min-height: 250px;
}

.ad-slot-banner {
  min-height: 96px;
  margin: 28px 0;
}

.ad-label {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* Prevent full-width ad overlays from breaking article images/footer */
.article-body .quads-location,
.article-body ins.adsbygoogle {
  position: relative !important;
  z-index: 1 !important;
  margin: 1.5em auto !important;
  max-width: 100% !important;
  overflow: hidden !important;
  background: transparent;
}

.portal-note {
  background: linear-gradient(135deg, var(--brand-navy) 0%, #273549 100%);
  color: #e2e8f0;
  border: 0;
}

.portal-note .widget-title {
  color: #ffffff;
  border-bottom-color: rgba(255, 255, 255, 0.16);
}

.portal-note p {
  margin: 0 0 12px;
  font-size: 0.875rem;
  line-height: 1.55;
}

.portal-note a {
  color: #fdba74;
  font-weight: 600;
  font-size: 0.875rem;
}

/* ==========================================================================
   Thematic Blocks & Pagination
   ========================================================================== */
.thematic-section {
  margin-top: 36px;
}

.posts-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
}

.pagination,
.navigation.pagination .nav-links {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 28px;
}

.page-link,
.page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.page-link:hover,
.page-numbers:hover {
  border-color: var(--brand-blue);
  color: var(--brand-blue);
}

.page-link.is-current,
.page-numbers.current {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

/* ==========================================================================
   Breadcrumbs & Archive Header
   ========================================================================== */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.breadcrumbs a {
  color: var(--text-secondary);
}

.breadcrumbs a:hover {
  color: var(--brand-red);
}

.breadcrumbs-sep,
.rank-math-breadcrumb .separator {
  color: var(--border-strong);
  margin: 0 4px;
}

.rank-math-breadcrumb p {
  margin: 0;
}

.archive-hero {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius-md);
  padding: 22px 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xs);
}

.archive-title {
  margin: 0 0 8px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--brand-navy);
}

.archive-title:last-child {
  margin-bottom: 0;
}

.archive-desc {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 0.96875rem;
  max-width: 72ch;
}

.archive-desc:last-child {
  margin-bottom: 0;
}

.sidebar-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sidebar-tags .tag-chip {
  font-size: 0.78125rem;
  padding: 5px 10px;
}

.sidebar-tags .tag-chip.is-active {
  background: var(--brand-blue);
  color: #ffffff;
}

.archive-desc p {
  margin: 0 0 8px;
}

.archive-desc p:last-child {
  margin-bottom: 0;
}

.filter-pills {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-pill {
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-page);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.filter-pill.is-active,
.filter-pill:hover {
  background: var(--brand-blue);
  border-color: var(--brand-blue);
  color: #ffffff;
}

/* ==========================================================================
   Single Article, Page & Gutenberg Support
   ========================================================================== */
.article-shell {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 32px 36px;
  box-shadow: var(--shadow-xs);
}

.article-header {
  margin-bottom: 22px;
}

.article-title {
  margin: 12px 0 14px;
  font-size: 2rem;
  line-height: 1.24;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--brand-navy);
}

.article-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 0.875rem;
  color: var(--text-muted);
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.google-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  min-height: 32px;
  border-radius: 6px;
  background: #f1f4fb;
  border: 1px solid #e2e8f0;
  color: #0f172a;
  font-size: 0.78125rem;
  font-weight: 600;
  line-height: 1.25;
  text-decoration: none;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.google-source-btn:hover {
  background: #e4ebf7;
  border-color: #cbd5e1;
  color: #0f172a;
}

.google-source-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

.article-cover {
  margin: 0 0 24px;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--bg-subtle);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-cover figcaption {
  padding: 8px 12px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  background: var(--bg-page);
  border-top: 1px solid var(--border);
}

/* Auto Table of Contents */
.toc-box {
  background: var(--bg-page);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand-red);
  border-radius: var(--radius-md);
  padding: 16px 20px;
  margin-bottom: 26px;
}

.toc-box[hidden] {
  display: none;
}

.toc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toc-title {
  margin: 0;
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.toc-toggle {
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  font-size: 0.8125rem;
  font-weight: 600;
  padding: 2px 6px;
}

.toc-list {
  margin: 10px 0 0;
  padding-left: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 20px;
}

.toc-list.is-collapsed {
  display: none;
}

.toc-list li {
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

.toc-list li.toc-sub {
  padding-left: 10px;
  font-size: 0.8125rem;
}

.toc-list a {
  color: var(--text-secondary);
  font-weight: 500;
}

.toc-list a:hover {
  color: var(--brand-red);
  text-decoration: underline;
}

/* Article Typography & Gutenberg Blocks */
.article-body {
  font-size: 1.03125rem;
  line-height: 1.75;
  color: var(--text-primary);
  max-width: 72ch;
}

.article-body p {
  margin: 0 0 1.15em;
}

.article-body h2 {
  margin: 1.85em 0 0.65em;
  font-size: 1.4375rem;
  line-height: 1.3;
  font-weight: 700;
  color: var(--brand-navy);
  scroll-margin-top: 90px;
}

.article-body h3 {
  margin: 1.5em 0 0.5em;
  font-size: 1.1875rem;
  line-height: 1.35;
  font-weight: 700;
  color: var(--text-primary);
  scroll-margin-top: 90px;
}

.article-body ul,
.article-body ol {
  margin: 0 0 1.25em;
  padding-left: 1.4em;
}

.article-body li {
  margin-bottom: 0.45em;
}

.article-body figure {
  margin: 1.5em 0;
}

.article-body figcaption {
  margin-top: 6px;
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.article-body blockquote,
.article-quote {
  margin: 1.5em 0;
  padding: 16px 20px;
  background: var(--brand-blue-soft);
  border-left: 4px solid var(--brand-blue);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-style: italic;
  color: var(--brand-navy);
}

.article-body table,
.article-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  text-align: left;
  margin: 1.5em 0;
  display: block;
  overflow-x: auto;
}

.article-body table th,
.article-table th {
  background: var(--brand-navy);
  color: #ffffff;
  font-weight: 600;
  padding: 11px 14px;
}

.article-body table td,
.article-table td {
  padding: 10px 14px;
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.article-body table tr:nth-child(even) td {
  background: var(--bg-page);
}

/* Contact Form 7 Styling */
.wpcf7-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 18px;
  max-width: 560px;
}

.wpcf7-form p {
  margin: 0;
}

.wpcf7-form label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  color: var(--brand-navy);
  margin-bottom: 4px;
}

.wpcf7-form input[type='text'],
.wpcf7-form input[type='email'],
.wpcf7-form input[type='tel'],
.wpcf7-form textarea,
.wpcf7-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: 0.9375rem;
  background: var(--bg-surface);
  color: var(--text-primary);
}

.wpcf7-form input[type='submit'] {
  height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--brand-blue);
  color: #ffffff;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
}

.wpcf7-form input[type='submit']:hover {
  background: var(--brand-blue-hover);
}

/* Article Footer: Tags & Share */
.article-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 22px;
}

.tag-chip {
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 500;
}

.tag-chip:hover {
  background: var(--brand-yellow-soft);
  color: var(--brand-red);
}

.share-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.share-label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--brand-navy);
}

.share-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 13px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 0.8125rem;
  font-weight: 600;
}

.share-btn:hover {
  border-color: var(--brand-red);
  color: var(--brand-red);
  background: var(--brand-yellow-soft);
}

.related-block {
  margin-top: 32px;
}

/* 404 Page */
.error-404-box {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 28px;
  text-align: center;
  max-width: 680px;
  margin: 24px auto;
}

.error-404-code {
  font-family: 'e-Ukraine Head', sans-serif;
  font-size: 4rem;
  font-weight: 700;
  color: var(--brand-red);
  line-height: 1;
  margin-bottom: 12px;
}

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer {
  background: var(--brand-navy);
  color: #cbd5e1;
  padding: 44px 0 24px;
  border-top: 3px solid var(--brand-footer-accent);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr 1.4fr;
  gap: 28px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.footer-brand-title {
  font-family: 'e-Ukraine Head', sans-serif;
  font-size: 1.125rem;
  font-weight: 700;
  color: #ffffff;
}

.footer-brand-title .footer-lead {
  color: #e86f4c;
}

.footer-text {
  margin: 0 0 10px;
  font-size: 0.875rem;
  line-height: 1.55;
  color: #94a3b8;
}

.footer-heading {
  margin: 0 0 14px;
  font-size: 0.875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #ffffff;
}

.footer-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.footer-links a {
  color: #cbd5e1;
  font-size: 0.875rem;
}

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

.footer-disclaimer {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-left: 3px solid var(--brand-footer-accent);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: #cbd5e1;
}

.footer-disclaimer strong {
  display: block;
  color: #ffffff;
  margin-bottom: 6px;
}

.footer-disclaimer a {
  color: #fdba74;
}

.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 18px;
  font-size: 0.8125rem;
  color: #94a3b8;
}

.footer-bottom a {
  color: #cbd5e1;
}

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

/* ==========================================================================
   Responsive Breakpoints (1280px, 1024px, 768px, 540px, 390px, 375px)
   ========================================================================== */
@media (max-width: 1360px) {
  .header-main {
    gap: 10px;
  }

  .brand-logo {
    width: 36px;
    height: 36px;
  }

  .brand-title {
    font-size: 1.0625rem;
  }

  .brand-tagline {
    font-size: 0.625rem;
  }

  .primary-nav a {
    padding: 7px 7px;
    font-size: 0.78125rem;
  }
}

@media (max-width: 1200px) {
  .primary-nav {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
  }

  .topics-strip {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .content-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .admin-bar .site-header {
    top: 46px;
  }

  .topbar-badge,
  .topbar-links {
    display: none;
  }

  .posts-grid,
  .posts-grid-3,
  .toc-list {
    grid-template-columns: 1fr;
  }

  .post-row-card {
    grid-template-columns: 1fr;
  }

  .article-shell {
    padding: 22px 18px;
  }

  .article-title {
    font-size: 1.5rem;
  }

  .hero-lead-title {
    font-size: 1.25rem;
  }
}

@media (max-width: 540px) {
  .container {
    padding: 0 14px;
  }

  .header-main {
    min-height: 62px;
    gap: 10px;
  }

  .brand-link {
    gap: 9px;
    min-width: 0;
    flex: 1;
  }

  .brand-text {
    min-width: 0;
  }

  .brand-logo {
    width: 32px;
    height: 32px;
  }

  .brand-title {
    font-size: 0.96875rem;
  }

  .brand-tagline {
    font-size: 0.625rem;
  }

  .brand-tagline::before {
    width: 10px;
  }

  .header-actions {
    gap: 6px;
  }

  .icon-btn {
    width: 36px;
    height: 36px;
  }

  .topics-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .hero-side-item {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .ticker-label {
    padding: 3px 8px;
    font-size: 0.6875rem;
  }
}
