.blog-index main { max-width: 1120px; margin: 0 auto 56px; padding: 0 20px; }

.mag-top {
  position: sticky; top: 0; z-index: 40;
  --head-ink: #2b1a02;
  background: linear-gradient(150deg, #ffc814 0%, #ff9605 100%); color: var(--head-ink);
  box-shadow: 0 2px 14px -6px rgb(120 70 0 / 45%);
}
.mag-top-inner {
  width: 100%; padding-inline: max(24px, (100% - 1346px) / 2);
  display: flex; align-items: center; gap: 22px; min-height: 66px;
}
.mag-logo { display: flex; align-items: center; gap: 9px; flex: 1 1 0; min-width: 0; text-decoration: none; }
.mag-top .mag-logo .blog-logo { height: 30px; width: auto; display: block; filter: brightness(0); opacity: .9; }

.mag-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; flex: 1 1 0; }
.icon-btn, .mag-actions .theme-toggle {
  -webkit-appearance: none; appearance: none; cursor: pointer; font-family: inherit;
  display: inline-flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; padding: 0; flex: none;
  color: inherit; background: none; border: 0; border-radius: 10px;
  transition: background .15s ease;
}
.icon-btn svg, .mag-actions .theme-toggle svg {
  width: 20px; height: 20px; display: block;
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1);
}
.icon-btn:hover, .mag-actions .theme-toggle:hover { background: rgb(255 255 255 / 42%); }
.search-btn[aria-expanded='true'] { background: #fff; color: var(--head-ink); }
.search-btn:hover svg { transform: rotate(90deg) scale(1.12); }
.search-btn[aria-expanded='true']:hover svg { transform: rotate(-90deg) scale(1.12); }
.mag-actions .theme-toggle:hover svg { transform: rotate(-25deg) scale(1.12); }
.icon-btn:active, .mag-actions .theme-toggle:active { transform: scale(.92); }

.icon-swap svg { animation: icon-swap .34s cubic-bezier(.34, 1.56, .64, 1) both; }
@keyframes icon-swap {
  from { opacity: 0; transform: rotate(-90deg) scale(.6) }
  to { opacity: 1; transform: none }
}
@media (prefers-reduced-motion: reduce) {
  .icon-btn svg, .mag-actions .theme-toggle svg, .icon-swap svg { animation: none; transition: none }
}

.cat-bar {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  flex: 0 1 auto; min-width: 0;
  overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.cat-bar::-webkit-scrollbar { display: none; }
.topic {
  -webkit-appearance: none; appearance: none; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: baseline; gap: 6px;
  font-family: inherit; font-size: 14.5px; font-weight: 650; white-space: nowrap;
  color: rgb(43 26 2 / 78%); background: none; border: 0;
  padding: 9px 13px; border-radius: 10px; line-height: 1;
  transition: color .15s ease, background .15s ease;
}
.topic:hover { color: var(--head-ink); background: rgb(255 255 255 / 42%); }
.topic.is-active { color: var(--head-ink); background: #fff; font-weight: 800; }

html { overflow-y: scroll; scrollbar-gutter: stable; }

.search-overlay { max-width: 800px; margin: 0 auto; padding: 26px 20px 60px; }
.search-overlay[hidden] { display: none; }
body.searching main, body.searching .hero { display: none; }

.search-overlay { animation: search-in .34s cubic-bezier(.33, .96, .49, 1.01) both; }
.search-box { animation: search-box-in .42s cubic-bezier(.33, .96, .49, 1.01) both; }
.search-results .s-row { animation: row-in .34s cubic-bezier(.33, .96, .49, 1.01) both; }
.s-row:nth-child(1) { animation-delay: .02s }
.s-row:nth-child(2) { animation-delay: .05s }
.s-row:nth-child(3) { animation-delay: .08s }
.s-row:nth-child(4) { animation-delay: .11s }
.s-row:nth-child(5) { animation-delay: .14s }
.s-row:nth-child(n + 6) { animation-delay: .16s }

@keyframes search-in {
  from { opacity: 0 }
  to { opacity: 1 }
}
@keyframes search-box-in {
  from { opacity: 0; transform: translateY(-14px) scale(.985) }
  to { opacity: 1; transform: none }
}
@keyframes row-in {
  from { opacity: 0; transform: translateY(10px) }
  to { opacity: 1; transform: none }
}
@media (prefers-reduced-motion: reduce) {
  .search-overlay, .search-box, .search-results .s-row { animation: none }
}

.search-box { position: relative; }
.search-input {
  width: 100%; font-family: inherit; font-size: 17px; font-weight: 600;
  color: var(--ink); background: var(--surface);
  border: 1.5px solid var(--line-strong); border-radius: 12px;
  padding: 15px 46px 15px 18px; outline: none;
  transition: border-color .15s ease;
}
.search-input:focus { border-color: var(--blue); }
.search-input::placeholder { color: var(--muted); font-weight: 500; }
.search-input::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  -webkit-appearance: none; appearance: none; cursor: pointer;
  width: 26px; height: 26px; padding: 0; border: 0; background: none; color: var(--muted);
}
.search-clear[hidden] { display: none; }
.search-clear svg { width: 22px; height: 22px; display: block; }

.search-none { margin: 22px 2px; color: var(--muted); font-size: 15.5px; line-height: 1.5; }
.search-count { margin: 22px 2px 4px; color: var(--muted); font-size: 14px; font-weight: 650; }

.search-results { display: flex; flex-direction: column; }
.s-row {
  display: flex; align-items: flex-start; gap: 20px;
  padding: 22px 2px; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--line);
}
.s-row:last-child { border-bottom: 0; }
.s-text { flex: 1; min-width: 0; }
.s-title { display: block; font-size: 21px; font-weight: 800; line-height: 1.24; letter-spacing: -.015em; color: var(--ink); }
.s-row:hover .s-title { color: var(--blue-ink); }
.s-desc { display: block; margin-top: 6px; color: var(--ink-soft); font-size: 15px; line-height: 1.5; }
.s-cat { display: block; margin-top: 8px; color: var(--muted); font-size: 14px; }
.s-img { flex: none; width: 168px; aspect-ratio: 16 / 11; border-radius: 12px; overflow: hidden; background: var(--surface-soft); }
.s-img img { width: 100%; height: 100%; object-fit: cover; display: block; }

.blog-index .hero { max-width: 1120px; margin: 0 auto; padding: clamp(22px, 2.8vw, 32px) 20px 0; }
.blog-index .hero.hero-quiet { padding-top: clamp(14px, 2vw, 22px); padding-bottom: 0; }
.hero-quiet .hero-inner {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.blog-index .hero-inner { max-width: 720px; }
.blog-index .hero h1 {
  margin: 5px 0 0; font-size: clamp(24px, 3vw, 32px); line-height: 1.12;
  letter-spacing: -.025em; font-weight: 850; color: var(--ink); overflow-wrap: break-word;
}
.blog-index .hero .lead { max-width: 42em; margin: 9px 0 0; font-size: 15.5px; line-height: 1.55; color: var(--ink-soft); }

.sec-head { display: flex; align-items: center; justify-content: center; gap: 16px; margin: 38px 0 18px; }
.sec-head h1, .sec-head h2, .sec-head .sec-label {
  margin: 0; font-size: clamp(23px, 3vw, 30px); font-weight: 900; letter-spacing: -.02em; color: var(--ink);
}

.pop-collage {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: clamp(18px, 3vw, 34px);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: clamp(18px, 2.4vw, 26px);
}
.pop-lead, .pop-row { text-decoration: none; color: inherit; display: block; }
.pop-lead, .pop-row-text { text-align: center; }
.pop-lead-img { display: block; border-radius: 14px; overflow: hidden; aspect-ratio: 16 / 11; background: var(--surface-soft); }
.pop-lead-img img,
.pop-row-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.pop-lead:hover .pop-lead-img img,
.pop-row:hover .pop-row-img img { transform: scale(1.05); }

.pop-title { display: block; margin: 7px 0 6px; color: var(--ink); font-weight: 800; letter-spacing: -.015em; line-height: 1.24; }
.pop-lead .pop-title { font-size: clamp(20px, 2.3vw, 26px); }
.pop-row .pop-title { font-size: 17px; }
.pop-lead:hover .pop-title, .pop-row:hover .pop-title { color: var(--blue-ink); }
.pop-cat { display: block; color: var(--muted); font-size: 14px; }

.pop-side { display: flex; flex-direction: column; justify-content: space-between; gap: 18px; }
.pop-row { display: flex; align-items: flex-start; gap: 16px; }
.pop-row-text { flex: 1; min-width: 0; }
.pop-row-img { flex: none; width: 92px; height: 92px; border-radius: 12px; overflow: hidden; background: var(--surface-soft); }

.pop-tg {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px; border-radius: var(--radius); text-decoration: none;
  background: linear-gradient(150deg, #ffc814 0%, #ff9605 100%); color: #2b1a02;
  transition: transform .18s ease, box-shadow .18s ease;
}
.pop-tg:hover { transform: translateY(-2px); box-shadow: 0 10px 22px -12px rgb(120 70 0 / 65%); }
.pop-tg-icon {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 42px; height: 42px; border-radius: 50%; background: rgb(255 255 255 / 55%);
}
.pop-tg-icon svg { width: 22px; height: 22px; display: block; }
.pop-tg-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pop-tg-text strong { font-size: 15.5px; font-weight: 800; letter-spacing: -.01em; }
.pop-tg-text span { font-size: 13.5px; line-height: 1.45; opacity: .82; }
.pop-tg-go {
  margin-left: auto; flex: none; padding: 10px 16px; border-radius: 10px;
  background: #fff; font-size: 14px; font-weight: 800; white-space: nowrap;
}

.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(292px, 1fr)); gap: 24px; }
.card {
  display: flex; flex-direction: column; text-decoration: none; color: inherit;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-soft); border-color: var(--line-strong); }
.card .thumb { position: relative; display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--surface-soft); }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .5s ease; }
.card:hover .thumb img { transform: scale(1.06); }
.card .tag {
  position: absolute; left: 12px; top: 12px;
  font-size: 11.5px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase;
  color: #2b1a02; background: linear-gradient(150deg, #ffc814 0%, #ff9605 100%); padding: 5px 11px; border-radius: 999px;
  box-shadow: 0 4px 12px -4px rgb(120 70 0 / 45%);
}
.card .body { display: flex; flex-direction: column; gap: 7px; padding: 15px 17px 19px; flex: 1; text-align: center; }
.card .c-title { font-size: 18px; font-weight: 800; line-height: 1.27; letter-spacing: -.012em; color: var(--ink); }
.card:hover .c-title { color: var(--blue-ink); }

.card[hidden] { display: none; }
.feed-empty { margin: 28px 0; color: var(--muted); font-size: 16px; }
.more-wrap { display: flex; justify-content: center; margin: 34px 0 0; }
.btn-more {
  -webkit-appearance: none; appearance: none; cursor: pointer; font-family: inherit;
  font-size: 15.5px; font-weight: 800; color: var(--blue-ink);
  background: var(--surface); border: 1.5px solid var(--line-strong);
  padding: 14px 34px; border-radius: 999px;
  transition: background .16s ease, color .16s ease, transform .16s ease;
}
.btn-more:hover { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-1px); }
.btn-more[hidden] { display: none; }

body:has(.cat-bar .is-active) .hero { padding-bottom: clamp(8px, 1.5vw, 14px); }

/* Небо с самолётиками — то же, что на баннере сайта; текст держится в чистой середине. */
.channel {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px;
  margin: 44px 0 0; padding: clamp(26px, 3vw, 36px) clamp(28px, 17%, 220px); border-radius: var(--radius);
  background: #0068ff url('/blog/cta-sky.svg?v=3') center / 100% 100% no-repeat;
  color: #fff; text-decoration: none;
}
.channel b, .channel > span:not(.go) { position: relative; text-shadow: 0 2px 10px rgb(8 40 100 / 35%); }
.channel b { font-size: clamp(21px, 2.2vw, 26px); font-weight: 850; letter-spacing: -.02em; text-wrap: balance; }
.channel > span:not(.go) { opacity: .92; font-size: 15px; line-height: 1.5; text-wrap: balance; }
.channel .go { margin-top: 6px; background: #fff; color: #1668ff; font-weight: 800; font-size: 15px; padding: 13px 24px; border-radius: 12px; white-space: nowrap; box-shadow: 0 8px 20px -12px rgb(0 20 60 / 65%); }
.channel:hover .go { background: var(--tint); }

@media (max-width: 860px) {
  .pop-collage { grid-template-columns: 1fr; }
  .pop-side { gap: 16px; }
}
@media (max-width: 720px) {
  /* Палец не попадает в 33 px: на узких экранах цели в шапке доводим до 44 px. */
  .topic { min-height: 44px; padding-block: 0; display: inline-flex; align-items: center; }
  .icon-btn, .mag-actions .theme-toggle { width: 44px; height: 44px; }
  .mag-top-inner { flex-wrap: wrap; gap: 8px 16px; padding: 8px 16px; min-height: 0; }
  .mag-logo, .mag-actions { flex: 1 1 auto; }
  .cat-bar { order: 3; flex-basis: 100%; justify-content: flex-start; margin: 0 -16px; padding: 0 16px 2px; }
  .mag-logo .blog-logo { height: 28px; }
  .sec-head { margin: 26px 0 14px; }
  .pop-row-img { width: 76px; height: 76px; }
}
@media (max-width: 620px) {
  .search-overlay { padding: 16px 16px 48px; }
  .s-row { gap: 14px; padding: 18px 0; }
  .s-title { font-size: 17px; }
  .s-desc { display: none; }
  .s-img { width: 96px; }
}
@media (max-width: 640px) {
  .sec-head { gap: 10px; }
  .sec-head h1, .sec-head h2, .sec-head .sec-label { font-size: 21px; }
  .blog-index main { padding: 0 18px 44px; }
  .blog-index .hero { padding: 22px 18px 0; }
  .cards { grid-template-columns: 1fr; }
  .channel { padding: 22px 20px; background-image: none; }
  .channel .go { width: 100%; white-space: normal; }
}
