/* ==========================================================================
   B4blaze News — ultra-lean CSS (no Bootstrap). Core Web Vitals first.
   Brand: black + blaze red (from B4blaze logo) · Malayalam-ready type
   ========================================================================== */

:root {
  --b4-black: #0a0a0a;
  --b4-ink: #111111;
  --b4-red: #e10600;
  --b4-red-dark: #b80000;
  --b4-red-soft: #ff1a14;
  --b4-white: #ffffff;
  --b4-bg: #ececec;
  --b4-muted: #5c5c5c;
  --b4-line: #e0e0e0;
  --b4-card: #ffffff;
  --b4-breaking: #ffcc00;
  --b4-breaking-ink: #111111;
  --font-ui: "Anek Malayalam", system-ui, sans-serif;
  --font-ml: "Anek Malayalam", system-ui, sans-serif;
  --container: 1200px;
  --radius: 2px;
  --shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  --nav-h: 46px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

body {
  margin: 0;
  font-family: var(--font-ml);
  font-size: 16px;
  line-height: 1.55;
  color: var(--b4-ink);
  background: var(--b4-bg);
  text-rendering: optimizeLegibility;
}

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

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--b4-red);
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  line-height: 1.25;
  margin: 0 0 0.4em;
  font-weight: 700;
}

p { margin: 0 0 1em; }

ul, ol { margin: 0; padding: 0; list-style: none; }

button, input {
  font: inherit;
}

.screen-reader-text,
.skip-link {
  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;
  z-index: 10000;
  width: auto;
  height: auto;
  clip: auto;
  padding: 10px 14px;
  background: var(--b4-red);
  color: #fff;
}

.container {
  width: min(100% - 24px, var(--container));
  margin-inline: auto;
}

.narrow {
  width: min(100% - 24px, 760px);
}

.hide-mobile { display: none !important; }

@media (min-width: 992px) {
  .hide-mobile { display: revert !important; }
  .hide-desktop { display: none !important; }
}

/* ---------- Header / Logo strip ---------- */
.site-header {
  background: var(--b4-black);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

/* Sentinel for stuck-state (1px) — sticky itself is pure CSS (compositor). */
.header-pin-sentinel {
  height: 1px;
  margin: 0;
  padding: 0;
  pointer-events: none;
  visibility: hidden;
}

.header-pin {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--b4-black);
  /* Native sticky = compositor-only; avoid transform/will-change (breaks sticky). */
  contain: layout style;
  transition: box-shadow 0.2s var(--ease);
}

.header-pin.is-stuck {
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.header-pin.is-stuck .logo-header__inner {
  min-height: 46px;
  padding: 4px 0;
}

.header-pin.is-stuck .brand img,
.header-pin.is-stuck .site-logo img {
  height: 30px;
  max-width: 120px;
}

@media (min-width: 992px) {
  .header-pin.is-stuck .logo-header {
    padding: 6px 0;
  }

  .header-pin.is-stuck .brand img,
  .header-pin.is-stuck .site-logo img {
    height: 42px;
    max-width: 180px;
  }

  .header-pin.is-stuck .main-nav {
    min-height: 40px;
  }

  .header-pin.is-stuck .main-nav .nav-list a {
    padding-top: 10px;
    padding-bottom: 10px;
  }
}

.logo-header {
  display: block;
  padding: 0;
  background: var(--b4-black);
  line-height: 0;
  border-bottom: 1px solid #1c1c1c;
  position: relative;
  z-index: 70;
  transition: padding 0.2s var(--ease);
}

.logo-header__inner {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  min-height: 56px;
  padding: 6px 0;
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  min-width: 0;
}

.brand .custom-logo-link,
.brand .site-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.brand img,
.site-logo img,
.brand .custom-logo {
  width: auto;
  max-width: 130px;
  height: 36px;
  object-fit: contain;
  object-position: center;
  display: block;
  transition: height 0.2s var(--ease), max-width 0.2s var(--ease);
}

.header-ad img {
  margin-left: auto;
  max-height: 90px;
  width: auto;
}

.search-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  touch-action: manipulation;
}

.search-toggle:hover,
.search-toggle[aria-expanded="true"] {
  background: rgba(255, 255, 255, 0.1);
  color: var(--b4-red-soft);
}

.mobile-search {
  border-top: 1px solid #222;
  background: #111;
  padding: 10px 12px 12px;
}

.mobile-search[hidden] {
  display: none !important;
}

.mobile-search__form {
  display: flex;
  align-items: stretch;
  height: 40px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}

.mobile-search__form input {
  flex: 1;
  border: 0;
  padding: 0 14px;
  min-width: 0;
  outline: none;
  font-size: 15px;
  background: #fff;
}

.mobile-search__form button {
  flex: 0 0 44px;
  border: 0;
  background: var(--b4-red);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

@media (min-width: 992px) {
  .logo-header {
    padding: 10px 0;
  }

  .logo-header__inner {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    min-height: 0;
    padding: 0;
  }

  .brand {
    justify-content: flex-start;
  }

  .brand img,
  .site-logo img,
  .brand .custom-logo {
    height: 58px;
    max-width: 220px;
    object-position: left center;
  }
}

/* Breaking ticker — single-line horizontal marquee */
.breaking-bar {
  background: var(--b4-breaking);
  color: var(--b4-breaking-ink);
  font-size: 14px;
  border-top: 0;
  border-bottom: 2px solid #e0a800;
  height: 36px;
  max-height: 36px;
  overflow: hidden;
}

.breaking-bar__inner {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0;
  height: 36px;
  max-height: 36px;
  overflow: hidden;
}

.breaking-bar__label {
  flex: 0 0 auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  background: var(--b4-red);
  color: #fff;
  font-weight: 800;
  font-family: var(--font-ui);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0 14px 0 12px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
  clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 0 100%);
  padding-right: 22px;
}

.breaking-bar__track {
  flex: 1 1 auto;
  position: relative;
  display: block;
  min-width: 0;
  height: 36px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 12px, #000 calc(100% - 12px), transparent);
}

.breaking-bar__marquee {
  position: absolute;
  top: 0;
  left: 0;
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: nowrap !important;
  align-items: center;
  width: max-content;
  max-width: none;
  height: 36px;
  margin: 0;
  padding: 0;
  white-space: nowrap !important;
  will-change: transform;
  animation: b4-breaking-scroll 45s linear infinite;
}

.breaking-bar__track:hover .breaking-bar__marquee {
  animation-play-state: paused;
}

.breaking-bar__text {
  display: inline-block !important;
  flex: 0 0 auto;
  white-space: nowrap !important;
  color: var(--b4-breaking-ink);
  font-weight: 600;
  font-size: 14px;
  line-height: 36px;
  height: 36px;
  padding: 0 4px 0 12px;
  max-width: none;
  overflow: visible;
}

.breaking-bar__dot {
  display: inline-block !important;
  flex: 0 0 auto;
  padding: 0 8px;
  color: var(--b4-red);
  font-weight: 800;
  line-height: 36px;
}

.breaking-bar__text:hover {
  color: var(--b4-red-dark);
}

@keyframes b4-breaking-scroll {
  from { transform: translate3d(0, 0, 0); }
  to { transform: translate3d(-50%, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .breaking-bar__marquee {
    animation: b4-breaking-scroll 90s linear infinite;
  }
}

/* ---------- Nav ---------- */
.main-nav {
  background: var(--b4-black);
  min-height: var(--nav-h);
  position: relative;
  z-index: 50;
  border-top: 3px solid var(--b4-red);
  transition: min-height 0.2s var(--ease);
}

.main-nav__inner {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: var(--nav-h);
  position: relative;
}

.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  border: 0;
  border-radius: 4px;
  background: var(--b4-red);
  cursor: pointer;
  padding: 10px 11px;
  touch-action: manipulation;
}

.nav-toggle__bar {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 1px;
}

.nav-panel--mobile {
  display: none;
  flex-direction: column;
  width: 100%;
  background: var(--b4-black);
  border-top: 1px solid #222;
  padding: 8px 0 16px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  z-index: 60;
}

.nav-panel--mobile.is-open {
  display: flex;
}

.nav-list {
  display: flex;
  flex-direction: column;
  width: 100%;
  flex: 0 0 auto;
}

.nav-list a {
  display: flex;
  align-items: center;
  color: #fff;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  min-height: 52px;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  touch-action: manipulation;
  -webkit-tap-highlight-color: rgba(225, 6, 0, 0.25);
}

.nav-list a:hover,
.nav-list .current-menu-item > a {
  color: #fff;
  background: rgba(225, 6, 0, 0.35);
}

.nav-search {
  display: flex;
  align-items: stretch;
  flex: 0 0 auto;
  width: 100%;
  max-width: 100%;
  height: 40px;
  margin-top: 12px;
  background: #fff;
  border-radius: 20px;
  overflow: hidden;
}

.nav-search input {
  flex: 1 1 auto;
  width: auto;
  height: 40px;
  max-height: 40px;
  border: 0;
  padding: 0 12px;
  min-width: 0;
  outline: none;
  background: #fff;
  line-height: 40px;
  font-size: 15px;
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}

.nav-search button {
  flex: 0 0 42px;
  width: 42px;
  max-width: 42px;
  height: 40px;
  max-height: 40px;
  border: 0;
  background: var(--b4-red);
  color: #fff;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  align-self: stretch;
  border-radius: 0;
}

.nav-search button svg {
  display: block;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .nav-panel--desktop {
    display: flex !important;
    flex-direction: row;
    position: static;
    background: transparent;
    box-shadow: none;
    padding: 0;
    align-items: center;
    justify-content: space-between;
    width: 100%;
  }

  .main-nav .nav-list {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 0;
    width: auto;
  }

  .main-nav .nav-list a {
    border: 0;
    padding: 13px 14px;
    font-size: 14px;
  }

  .nav-search {
    margin: 0;
    width: 200px;
    flex: 0 0 200px;
  }
}

/* ---------- Section titles ---------- */
.section-title {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 16px;
  border-bottom: 3px solid var(--b4-red);
  overflow: hidden;
}

.section-title__text,
.section-title__text a {
  display: inline-block;
  margin: 0;
  padding: 0 12px 8px 0;
  font-size: clamp(18px, 2.2vw, 23px);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.01em;
  color: var(--b4-red);
  font-family: var(--font-ui);
  position: relative;
}

.section-title__text::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 100%;
  height: 3px;
  background: var(--b4-black);
}

/* ---------- Posts ---------- */
.post {
  margin-bottom: 14px;
}

.post-title {
  font-size: 15px;
  font-weight: 700;
  margin: 8px 0 0;
  font-family: var(--font-ui);
}

.post-title a {
  color: var(--b4-ink);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.post-thumb {
  display: block;
  overflow: hidden;
  background: #e8e8e8;
  aspect-ratio: 16 / 9;
  position: relative;
}

.post-thumb img,
.post-thumb .thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 0.45s var(--ease);
  background: #e8e8e8;
}

.post-thumb img.b4-thumb {
  opacity: 1;
  min-height: 100%;
}

.post-thumb:hover img {
  transform: scale(1.04);
}

.thumb-placeholder {
  display: block;
  background: linear-gradient(135deg, #d0d0d0, #ececec);
  min-height: 100px;
}

/* Featured */
.post--featured .post-title {
  font-size: clamp(16px, 1.6vw, 20px);
  -webkit-line-clamp: 4;
}

/* List */
.post--list {
  display: grid;
  grid-template-columns: 38% 1fr;
  gap: 10px;
  align-items: start;
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--b4-line);
}

.post--list .post-thumb {
  aspect-ratio: 16 / 9;
}

.post--list .post-title {
  margin: 0;
  font-size: 14px;
  -webkit-line-clamp: 4;
}

/* Grid */
.post-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px 10px;
}

.post--grid .post-title {
  font-size: 14px;
  margin-top: 6px;
}

@media (min-width: 768px) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 14px 12px;
  }
  .post--grid .post-title { font-size: 15px; }
}

@media (min-width: 1100px) {
  .post-grid { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Home layout — dense portal ---------- */
.home-main,
.archive-main,
.single-main,
.page-main,
.search-main,
.error-main {
  padding: 12px 0 32px;
}

.home-row--top {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
  background: var(--b4-card);
  padding: 14px;
  border-radius: 4px;
  align-items: start;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
  border-top: 3px solid var(--b4-red);
}

/* Top stories — balanced 3-column portal block */
.top-stories,
.top-side,
.top-list {
  min-width: 0;
}

.top-stories > .post--featured {
  margin-bottom: 14px;
}

.top-stories > .post--featured .post-thumb {
  aspect-ratio: 16 / 10;
}

.top-stories > .post--featured .post-title {
  font-size: clamp(17px, 1.7vw, 21px);
  margin-top: 10px;
}

.top-stories > .post--list:last-child,
.top-list > .post--list:last-child {
  border-bottom: 0;
  margin-bottom: 0;
  padding-bottom: 0;
}

.top-side {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.top-side .post--featured {
  margin-bottom: 0;
  flex: 1 1 auto;
}

.top-side .post--featured .post-thumb {
  aspect-ratio: 16 / 10;
}

.top-side .post--featured .post-title {
  font-size: clamp(15px, 1.35vw, 17px);
  margin-top: 8px;
  -webkit-line-clamp: 3;
}

.top-list .post--list {
  grid-template-columns: 34% 1fr;
  gap: 10px;
}

.top-list .post--list .post-title {
  font-size: 13px;
  -webkit-line-clamp: 3;
}

.home-section {
  background: var(--b4-card);
  padding: 14px 14px 16px;
  margin-bottom: 16px;
  border-radius: 4px;
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.04);
}

.home-section .post--grid {
  transition: transform 0.2s var(--ease);
}

.home-section .post--grid:hover {
  transform: translateY(-2px);
}

.home-section .post-thumb {
  border-radius: 3px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.more-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  background: #f7f7f7;
  border-radius: 3px;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}

.more-link:hover {
  background: var(--b4-red);
  color: #fff !important;
}

.split-row {
  display: grid;
  gap: 14px;
}

.split-feature .post-title {
  font-size: clamp(16px, 1.8vw, 20px);
}

@media (min-width: 768px) {
  .split-row {
    grid-template-columns: 1.15fr 1fr;
    gap: 18px;
    align-items: start;
  }
}

.more-link-wrap {
  margin: 12px 0 0;
  text-align: right;
  border-top: 1px solid var(--b4-line);
  padding-top: 10px;
}

.more-link {
  font-family: var(--font-ui);
  font-weight: 700;
  color: var(--b4-red);
  font-size: 14px;
}

@media (min-width: 768px) and (max-width: 991px) {
  .home-row--top {
    grid-template-columns: 1.2fr 1fr;
    gap: 16px;
  }

  .top-list {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 16px;
  }

  .top-list .section-title {
    grid-column: 1 / -1;
  }
}

@media (min-width: 992px) {
  .home-row--top {
    grid-template-columns: 1.25fr 1fr 1fr;
    padding: 16px;
    gap: 20px;
  }
}

/* ---------- Single article ---------- */
.single-layout {
  display: grid;
  gap: 28px;
}

@media (min-width: 992px) {
  .single-layout {
    grid-template-columns: minmax(0, 1fr) 300px;
    align-items: start;
  }
}

.article {
  background: var(--b4-card);
  padding: 18px 16px 28px;
  border-radius: var(--radius);
}

@media (min-width: 768px) {
  .article { padding: 24px 28px 36px; }
}

.breadcrumbs {
  font-size: 13px;
  margin-bottom: 12px;
  color: var(--b4-red-dark);
  font-family: var(--font-ui);
  font-weight: 600;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.breadcrumbs li:not(:last-child)::after {
  content: "|";
  margin-left: 6px;
  color: var(--b4-muted);
}

.article-title {
  font-size: clamp(22px, 3.2vw, 32px);
  color: var(--b4-black);
  margin-bottom: 10px;
}

.article-dek {
  font-size: 17px;
  color: var(--b4-red-dark);
  font-style: italic;
  border-bottom: 1px solid var(--b4-line);
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 13px;
  color: var(--b4-muted);
  margin-bottom: 14px;
  font-family: var(--font-ui);
}

.article-author a {
  color: var(--b4-red);
  font-weight: 700;
}

.share-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-ui);
  color: #fff !important;
  border-radius: 3px;
}

.share-fb { background: #1877f2; }
.share-x { background: #111; }
.share-wa { background: #25d366; }
.share-li { background: #0a66c2; }

.article-hero {
  margin: 0 0 20px;
}

.article-hero figcaption {
  font-size: 13px;
  color: var(--b4-muted);
  margin-top: 8px;
}

.article-content {
  font-size: 17px;
  line-height: 1.75;
  color: #1a1a1a;
}

.article-content p { margin-bottom: 1.15em; }

.article-content h2,
.article-content h3 {
  margin-top: 1.4em;
  color: var(--b4-black);
}

.article-content a {
  color: var(--b4-red);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.article-content img {
  margin: 1em auto;
  border-radius: var(--radius);
}

.article-content blockquote {
  margin: 1.2em 0;
  padding: 12px 16px;
  border-left: 4px solid var(--b4-red);
  background: #fafafa;
  font-style: italic;
}

.article-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 24px 0;
}

.article-tags a {
  display: inline-block;
  padding: 4px 10px;
  background: #f0f0f0;
  border-radius: 3px;
  font-size: 13px;
  font-family: var(--font-ui);
  font-weight: 600;
}

.article-tags a:hover {
  background: var(--b4-red);
  color: #fff;
}

.author-box {
  margin: 28px 0;
  padding: 16px;
  border: 1px solid var(--b4-line);
  border-radius: var(--radius);
}

.author-box h3 {
  font-size: 14px;
  text-transform: uppercase;
  color: var(--b4-red);
  margin-bottom: 12px;
}

.author-box__inner {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.author-box__avatar-link {
  flex: 0 0 auto;
  line-height: 0;
}

.author-box__avatar {
  border-radius: 50%;
  display: block;
}

.author-box__name a {
  color: var(--b4-black);
  font-size: 16px;
}

.author-box__name a:hover {
  color: var(--b4-red);
}

.author-box__more {
  display: inline-block;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  font-family: var(--font-ui);
  color: var(--b4-red);
}

.related-news { margin-top: 28px; }

/* Always 3-column related grid (mobile + desktop), small thumbs */
.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 10px;
}

@media (min-width: 768px) {
  .related-grid {
    gap: 16px 14px;
  }
}

.post--related {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

.post-thumb--related {
  display: block;
  aspect-ratio: 16 / 9;
  max-height: 88px;
  overflow: hidden;
  background: #ececec;
  border-radius: var(--radius);
  margin-bottom: 6px;
}

@media (min-width: 768px) {
  .post-thumb--related {
    max-height: 110px;
  }
}

.post-thumb--related img,
.post-thumb--related .thumb-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post--related .post-title {
  font-size: 12px;
  line-height: 1.35;
  margin: 0;
  flex: 1;
}

@media (min-width: 768px) {
  .post--related .post-title { font-size: 14px; }
}

.post--related .post-title a {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.single-sidebar .widget {
  background: var(--b4-card);
  padding: 14px;
  margin-bottom: 16px;
  border-radius: var(--radius);
}

.widget-title {
  font-size: 15px;
  color: var(--b4-red);
  text-transform: uppercase;
  border-bottom: 2px solid var(--b4-red);
  padding-bottom: 6px;
  margin-bottom: 12px;
}

/* ---------- Archive / search ---------- */
.archive-header {
  margin-bottom: 18px;
}

.archive-desc {
  color: var(--b4-muted);
  margin-top: 8px;
}

.search-form {
  display: flex;
  gap: 0;
  max-width: 420px;
  margin: 12px 0 0;
  border: 1px solid var(--b4-line);
  border-radius: 4px;
  overflow: hidden;
  background: #fff;
}

.search-form input {
  flex: 1;
  border: 0;
  padding: 10px 12px;
  outline: none;
  min-width: 0;
}

.search-form button {
  border: 0;
  background: var(--b4-red);
  color: #fff;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
  font-family: var(--font-ui);
}

.navigation.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 28px 0 8px;
}

.navigation.pagination .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  background: #fff;
  border: 1px solid var(--b4-line);
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 14px;
}

.navigation.pagination .current,
.navigation.pagination a:hover {
  background: var(--b4-red);
  border-color: var(--b4-red);
  color: #fff;
}

/* ---------- 404 ---------- */
.error-code {
  font-size: 72px;
  font-weight: 800;
  color: var(--b4-red);
  margin: 40px 0 8px;
  font-family: var(--font-ui);
  line-height: 1;
}

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

.btn-primary {
  display: inline-block;
  margin: 12px 0;
  padding: 10px 18px;
  background: var(--b4-red);
  color: #fff !important;
  font-weight: 700;
  font-family: var(--font-ui);
  border-radius: 3px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--b4-black);
  color: #ddd;
  padding-top: 36px;
  margin-top: 20px;
}

.footer-grid {
  display: grid;
  gap: 24px;
  grid-template-columns: 1fr;
  padding-bottom: 28px;
}

@media (min-width: 768px) {
  .footer-grid {
    grid-template-columns: 1.3fr repeat(3, minmax(0, 1fr));
    gap: 28px 24px;
  }

  .footer-col:empty {
    display: none;
  }
}

.footer-tagline {
  color: #aaa;
  font-size: 14px;
  margin-top: 10px;
}

.site-footer .widget-title {
  color: #fff;
  border-bottom-color: var(--b4-red);
  margin-bottom: 12px;
}

.footer-links a,
.site-footer .widget a {
  display: block;
  color: #bbb;
  padding: 6px 0;
  font-size: 14px;
  line-height: 1.35;
}

.footer-links a:hover,
.site-footer .widget a:hover {
  color: #fff;
}

.footer-col--cats .footer-links li + li {
  border-top: 1px solid #222;
}

.footer-bottom {
  border-top: 1px solid #222;
  padding: 16px 0;
  font-size: 13px;
  color: #888;
}

.footer-bottom__inner {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

.footer-bottom-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: center;
}

.footer-bottom-links a {
  color: #ccc;
  font-weight: 600;
}

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

.footer-bottom-links .sep {
  color: #555;
}

.footer-copy {
  margin: 0;
  color: #888;
}

.footer-social {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.footer-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  background: #1a1a1a;
  border: 1px solid #333;
  border-radius: 50%;
  color: #fff;
  line-height: 0;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}

.footer-social__link svg {
  display: block;
}

.footer-social__link:hover {
  background: var(--b4-red);
  border-color: var(--b4-red);
  color: #fff;
  transform: translateY(-2px);
}

.footer-social__link--facebook:hover { background: #1877f2; border-color: #1877f2; }
.footer-social__link--twitter:hover { background: #111; border-color: #fff; }
.footer-social__link--instagram:hover { background: #e4405f; border-color: #e4405f; }
.footer-social__link--youtube:hover { background: #ff0000; border-color: #ff0000; }
.footer-social__link--whatsapp:hover { background: #25d366; border-color: #25d366; }
.footer-social__link--telegram:hover { background: #229ed9; border-color: #229ed9; }
.footer-social__link--linkedin:hover { background: #0a66c2; border-color: #0a66c2; }
.footer-social__link--threads:hover { background: #111; border-color: #fff; }

.footer-brand img,
.footer-brand .custom-logo {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
}

.logo-header .brand img,
.footer-brand img {
  filter: none;
}

/* Ad slots */
.b4-ad {
  margin: 14px 0;
  text-align: center;
  overflow: hidden;
  clear: both;
}

.b4-ad--header {
  margin: 0;
}

.b4-ad img,
.b4-ad iframe {
  margin-inline: auto;
  max-width: 100%;
}

@media (min-width: 768px) {
  .footer-bottom__inner {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
  }
}

/* ---------- WP content helpers ---------- */
.aligncenter { margin-left: auto; margin-right: auto; }
.alignleft { float: left; margin: 0 1em 1em 0; }
.alignright { float: right; margin: 0 0 1em 1em; }
.wp-caption-text { font-size: 13px; color: var(--b4-muted); }

/* Admin bar offset for CSS sticky pin */
.admin-bar .header-pin { top: 32px; }
@media (max-width: 782px) {
  .admin-bar .header-pin { top: 46px; }
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
