/* Blog hub — compact square tiles with text overlay (RU + EN). */
body.blog-hub {
  --bh-bg: #12110f;
  --bh-surface: #1c1a18;
  --bh-surface-2: #252220;
  --bh-ink: #f5f2ec;
  --bh-muted: rgba(245, 242, 236, 0.72);
  --bh-border: rgba(245, 242, 236, 0.12);
  --bh-accent: #ff3d2e;
  background:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(255, 61, 46, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 90% 0%, rgba(255, 61, 46, 0.06), transparent 50%),
    var(--bh-bg);
  color: var(--bh-ink);
}

body.blog-hub .sp-wrap {
  max-width: 1200px;
}

body.blog-hub .sp-breadcrumbs {
  color: var(--bh-muted);
}
body.blog-hub .sp-breadcrumbs a {
  color: var(--bh-muted);
}
body.blog-hub .sp-breadcrumbs a:hover {
  color: var(--bh-accent);
}
body.blog-hub .sp-breadcrumbs li + li::before {
  color: rgba(245, 242, 236, 0.28);
}

.blog-hub-hero {
  padding: clamp(28px, 4vw, 40px) 0 18px;
}
.blog-hub-hero .sp-kicker {
  color: var(--bh-accent);
  letter-spacing: 0.14em;
}
.blog-hub-hero .sp-title {
  margin: 0 0 10px;
  font-family: Unbounded, Manrope, sans-serif;
  font-weight: 700;
  font-size: clamp(1.65rem, 4.2vw, 2.55rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--bh-ink);
}
.blog-hub-hero .sp-lead {
  max-width: 48ch;
  margin: 0;
  font-family: Manrope, system-ui, sans-serif;
  font-size: clamp(0.95rem, 1.6vw, 1.05rem);
  font-style: normal;
  font-weight: 400;
  line-height: 1.45;
  color: var(--bh-muted);
}

.blog-hub-panel {
  position: relative;
  padding-bottom: 64px;
}

.blog-filter-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.blog-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
}
.blog-filters__label {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0.35rem 0.85rem;
  border: 1px solid var(--bh-border);
  border-radius: 999px;
  background: transparent;
  color: var(--bh-muted);
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
  user-select: none;
}
.blog-filters__label:hover {
  border-color: rgba(255, 61, 46, 0.45);
  color: var(--bh-ink);
}
.blog-hub-panel:has(#bh-all:checked) .blog-filters__label[for="bh-all"],
.blog-hub-panel:has(#bh-lending:checked) .blog-filters__label[for="bh-lending"],
.blog-hub-panel:has(#bh-seo:checked) .blog-filters__label[for="bh-seo"],
.blog-hub-panel:has(#bh-cases:checked) .blog-filters__label[for="bh-cases"],
.blog-hub-panel:has(#bh-niches:checked) .blog-filters__label[for="bh-niches"] {
  background: var(--bh-accent);
  border-color: var(--bh-accent);
  color: #14090b;
}

.blog-tiles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Compact square tile: image fills, text overlays bottom — not a tall feed card */
.blog-tile {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  min-width: 0;
  text-decoration: none;
  color: inherit;
  background: var(--bh-surface);
  border: 1px solid var(--bh-border);
  border-radius: 14px;
  overflow: hidden;
  transition:
    border-color 0.22s ease,
    transform 0.28s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.28s ease;
  animation: blog-tile-in 0.55s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.blog-tile:nth-child(1) { animation-delay: 0.02s; }
.blog-tile:nth-child(2) { animation-delay: 0.05s; }
.blog-tile:nth-child(3) { animation-delay: 0.08s; }
.blog-tile:nth-child(4) { animation-delay: 0.11s; }
.blog-tile:nth-child(5) { animation-delay: 0.14s; }
.blog-tile:nth-child(6) { animation-delay: 0.17s; }
.blog-tile:nth-child(7) { animation-delay: 0.2s; }
.blog-tile:nth-child(8) { animation-delay: 0.23s; }
.blog-tile:nth-child(9) { animation-delay: 0.26s; }
.blog-tile:nth-child(n + 10) { animation-delay: 0.28s; }

.blog-tile:hover {
  border-color: rgba(255, 61, 46, 0.55);
  transform: translateY(-3px);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.28);
}
.blog-tile:focus-visible {
  outline: 2px solid var(--bh-accent);
  outline-offset: 3px;
}

.blog-tile__media {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: var(--bh-surface-2);
  z-index: 0;
}

.blog-tile__body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 48px 14px 14px;
  background: linear-gradient(
    to top,
    rgba(10, 9, 8, 0.88) 0%,
    rgba(10, 9, 8, 0.55) 55%,
    rgba(10, 9, 8, 0) 100%
  );
  pointer-events: none;
}

.blog-tile__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.blog-tile time {
  font-family: Manrope, system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(245, 242, 236, 0.78);
}
.blog-tile__topic {
  font-family: "JetBrains Mono", ui-monospace, monospace;
  font-size: 0.62rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #ffb4a9;
}
.blog-tile h2 {
  margin: 0;
  font-family: Unbounded, Manrope, sans-serif;
  font-weight: 600;
  font-size: clamp(0.88rem, 1.35vw, 1.05rem);
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.35);
}

/* Keep deck in DOM for SEO/a11y; hide so it does not stretch the tile */
.blog-tile__deck {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.blog-hub-panel:has(#bh-lending:checked) .blog-tile:not([data-topic="lending"]),
.blog-hub-panel:has(#bh-seo:checked) .blog-tile:not([data-topic="seo"]),
.blog-hub-panel:has(#bh-cases:checked) .blog-tile:not([data-topic="cases"]),
.blog-hub-panel:has(#bh-niches:checked) .blog-tile:not([data-topic="niches"]) {
  display: none;
}

@keyframes blog-tile-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .blog-tiles {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 560px) {
  .blog-tiles {
    grid-template-columns: 1fr;
    gap: 12px;
  }
  .blog-hub-hero {
    padding-top: 22px;
  }
  .blog-tile h2 {
    -webkit-line-clamp: 4;
  }
}

@media (prefers-reduced-motion: reduce) {
  .blog-tile {
    animation: none;
  }
  .blog-tile:hover {
    transform: none;
  }
}
