/* Блог amagi.social (/blog/, /ru/blog/, /uk/blog/). Страницы отдаёт Parse Server (server/src/site/blog_render.ts),
   общий стиль — site.css. */
.blog { padding: 56px 0 96px; }
.blog-hero { max-width: 760px; margin-bottom: 44px; }
.blog-hero .kicker, .post-head .kicker {
  display: inline-flex; align-items: center; gap: 10px; font-size: 13px; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sky); margin: 0 0 14px;
}
.blog-hero .kicker::before, .post-head .kicker::before { content: ""; width: 28px; height: 2px; border-radius: 2px; background: linear-gradient(90deg, #3d8bff, transparent); }
.blog h1 {
  font-size: clamp(38px, 5.4vw, 64px); line-height: 1.04; letter-spacing: -0.04em; margin: 0;
  background: linear-gradient(180deg, #fff 30%, #b9cff0); -webkit-background-clip: text; background-clip: text; color: transparent; padding-bottom: 0.05em;
}
.blog-hero p { color: var(--muted); font-size: 19px; margin: 16px 0 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.tags a, .tag { display: inline-block; padding: 6px 13px; border-radius: 999px; font-size: 13.5px; font-weight: 650; text-decoration: none; color: var(--sky); background: rgba(61, 139, 255, 0.12); border: 1px solid rgba(127, 176, 234, 0.25); }
.tags a:hover, .tags a[aria-current] { color: #fff; background: rgba(61, 139, 255, 0.3); }

.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.post-card {
  position: relative; display: flex; flex-direction: column; border-radius: 22px; overflow: hidden; background: var(--surface); border: 1px solid var(--border);
  transition: transform 0.35s cubic-bezier(.2, .8, .2, 1), border-color 0.3s, box-shadow 0.3s;
}
.post-card:hover { transform: translateY(-4px); border-color: rgba(127, 176, 234, 0.45); box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4); }
.post-card:first-child { grid-column: span 3; display: grid; grid-template-columns: 1.25fr 1fr; }
.post-card:first-child .post-card-body { padding: 36px; justify-content: center; }
.post-card:first-child h2 { font-size: clamp(26px, 3vw, 38px); }
.post-card img, .post-card .cover { width: 100%; height: 100%; aspect-ratio: 16 / 9; object-fit: cover; display: block; background: linear-gradient(135deg, #1f5fae, #061e40); }
.post-card .cover-ph { aspect-ratio: 16 / 9; display: grid; place-items: center; background: radial-gradient(circle at 30% 20%, #2f7cf6, #0b2450 70%); }
.post-card .cover-ph img { width: 56px; height: auto; aspect-ratio: auto; background: none; }
.post-card-body { display: flex; flex-direction: column; gap: 10px; padding: 22px 22px 26px; flex: 1; }
.post-card h2, .post-card h3 { font-size: 22px; line-height: 1.2; letter-spacing: -0.02em; margin: 0; }
.post-card h2 a, .post-card h3 a { color: var(--text); text-decoration: none; }
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card p { margin: 0; color: var(--muted); font-size: 15.5px; }
.post-meta, .post-card time { font-size: 13px; color: var(--sky); font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.badge-ai { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: #cfe0ff; background: rgba(138, 125, 255, 0.18); border: 1px solid rgba(138, 125, 255, 0.35); border-radius: 999px; padding: 3px 10px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 40px; }
.empty { color: var(--muted); padding: 40px 0; }

/* Статья */
.post { max-width: 780px; margin: 0 auto; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--muted); margin: 0 0 26px; padding: 0; list-style: none; }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--border); }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--text); }
.post-head { margin-bottom: 30px; }
.post-head .lead, .post-head .excerpt { font-size: 20px; color: var(--muted); margin: 18px 0 0; line-height: 1.55; }
.post-head .post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 20px; }
.post-cover { width: 100%; border-radius: 22px; margin: 6px 0 36px; aspect-ratio: 16 / 9; object-fit: cover; border: 1px solid var(--border); }
.prose { font-size: 18px; line-height: 1.75; color: #dbe6f7; }
.prose > * + * { margin-top: 1.1em; }
.prose h2 { font-size: 30px; letter-spacing: -0.025em; line-height: 1.2; margin-top: 1.8em; color: #fff; }
.prose h3 { font-size: 23px; letter-spacing: -0.02em; margin-top: 1.6em; color: #fff; }
.prose p, .prose ul, .prose ol, .prose blockquote, .prose pre { margin-bottom: 0; }
.prose a { color: var(--sky); text-underline-offset: 3px; }
.prose strong { color: #fff; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin: 0.4em 0; }
.prose li::marker { color: #3d8bff; }
.prose blockquote { margin-left: 0; padding: 16px 22px; border-left: 3px solid #3d8bff; background: rgba(61, 139, 255, 0.08); border-radius: 0 16px 16px 0; color: var(--text); }
.prose img { max-width: 100%; height: auto; border-radius: 16px; border: 1px solid var(--border); }
.prose code { font: 0.9em ui-monospace, SFMono-Regular, Menlo, monospace; padding: 2px 6px; border-radius: 6px; background: rgba(127, 176, 234, 0.12); }
.prose pre { padding: 18px; border-radius: 14px; overflow-x: auto; background: #050d1d; border: 1px solid var(--border); }
.prose pre code { padding: 0; background: none; }
.prose hr { border: 0; height: 1px; background: var(--border); margin: 2.2em 0; }
.prose table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; font-size: 16px; }
.prose th, .prose td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.post-foot { margin-top: 56px; padding: 30px; border-radius: 22px; background: radial-gradient(120% 140% at 0% 0%, rgba(47, 124, 246, 0.25), rgba(10, 26, 56, 0.55) 60%); border: 1px solid rgba(127, 176, 234, 0.22); }
.post-foot h2 { margin: 0 0 8px; font-size: 24px; }
.post-foot p { margin: 0 0 18px; color: var(--muted); }
.langs-alt { display: flex; gap: 10px; flex-wrap: wrap; font-size: 14px; margin-top: 12px; }
.related { margin-top: 64px; }
.related h2 { font-size: 26px; margin: 0 0 20px; }
.related .post-grid { grid-template-columns: repeat(3, 1fr); }
.related .post-card:first-child { grid-column: auto; display: flex; }
.related .post-card:first-child .post-card-body { padding: 22px 22px 26px; }
.related .post-card:first-child h2, .related .post-card:first-child h3 { font-size: 22px; }

@media (max-width: 900px) {
  .post-grid, .related .post-grid { grid-template-columns: 1fr; }
  .post-card:first-child { grid-column: auto; display: flex; }
  .post-card:first-child .post-card-body { padding: 22px 22px 26px; }
  .prose { font-size: 17px; }
  .blog { padding-top: 36px; }
}

/* ---------- Оформление блога как у главной (16.10.2026) ---------- */
body.blog-page { --gutter: 22px; overflow-x: clip; }
body.blog-page .wrap { max-width: 1240px; padding-inline: max(var(--gutter), env(safe-area-inset-left)) max(var(--gutter), env(safe-area-inset-right)); }
.blog { padding-block: 56px 96px; }

/* Шапка: логотип, разделы главной, «Скачать», меню телефона */
.blog-header { background: rgba(2, 8, 20, 0.86); }
.blog-header .wrap { flex-wrap: nowrap; min-height: 72px; gap: 20px; }
.blog-header .brand img { height: 30px; width: auto; }
.blog-header .site-nav { margin: 0 auto; gap: 2px; flex-wrap: nowrap; }
.blog-header .site-nav a { white-space: nowrap; font-size: 15px; padding: 8px 13px; }
.blog-header .site-nav a[aria-current] { color: var(--text); background: rgba(127, 176, 234, 0.12); }
.head-end { display: flex; align-items: center; gap: 10px; flex: none; }
.blog-header .cta-mini {
  display: inline-flex; align-items: center; min-height: 42px; padding: 0 18px; border-radius: 999px; font-weight: 700; font-size: 15px; text-decoration: none; white-space: nowrap;
  color: #fff; background: linear-gradient(135deg, #2f7cf6, #1f5fae 60%, #3a3fd8); box-shadow: 0 6px 20px rgba(47, 124, 246, 0.4);
}
.nav-menu { display: none; position: relative; }
.nav-menu summary { list-style: none; width: 44px; height: 44px; border-radius: 13px; border: 1px solid var(--border); display: grid; place-content: center; gap: 5px; cursor: pointer; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu summary span { display: block; width: 20px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.25s, opacity 0.25s; }
.nav-menu[open] summary span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-menu[open] summary span:nth-child(2) { opacity: 0; }
.nav-menu[open] summary span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.nav-panel {
  position: fixed; top: calc(72px + env(safe-area-inset-top)); inset-inline: 12px; z-index: 30; padding: 10px; border-radius: 20px;
  background: rgba(4, 14, 32, 0.98); border: 1px solid var(--border); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
}
.nav-panel nav { display: grid; }
.nav-panel nav a { display: flex; align-items: center; min-height: 50px; padding: 0 16px; border-radius: 12px; color: var(--text); text-decoration: none; font-size: 17px; font-weight: 650; }
.nav-panel nav a:hover, .nav-panel nav a[aria-current] { background: rgba(127, 176, 234, 0.1); }
.nav-langs { display: flex; gap: 6px; padding: 10px 6px 4px; border-top: 1px solid var(--border); margin-top: 6px; }
.nav-langs a { flex: 1; display: grid; place-items: center; min-height: 44px; border-radius: 12px; color: var(--muted); text-decoration: none; font-weight: 650; font-size: 14px; }
.nav-langs a[aria-current] { color: #fff; background: rgba(61, 139, 255, 0.22); }

/* Карточки: обложка-заглушка — экран приложения в рамке телефона */
.post-card .cover-ph { position: relative; overflow: hidden; aspect-ratio: 16 / 9; display: block; background: radial-gradient(120% 120% at 20% 0%, #2f7cf6, #123a7a 45%, #071a3a 80%); }
.post-card .cover-ph::after { content: ""; position: absolute; inset: 0; background: url("/assets/bird-white.svg") 8% 14% / 34px auto no-repeat; opacity: 0.85; }
.post-card .cover-ph .ph-shot {
  position: absolute; left: 50%; top: 12%; width: 36%; height: auto; aspect-ratio: 300 / 650; object-fit: cover; object-position: top;
  border-radius: 18px; border: 3px solid #9ab1d3; box-shadow: 0 0 0 4px #0a1426, 0 30px 60px rgba(0, 0, 0, 0.5); background: #061e40;
  transform: translateX(-50%) rotate(-6deg); transition: transform 0.5s cubic-bezier(.2, .8, .2, 1);
}
.post-card:hover .cover-ph .ph-shot { transform: translateX(-50%) rotate(-3deg) translateY(-6px); }
.post-card:first-child .cover-ph { aspect-ratio: auto; min-height: 340px; height: 100%; }
.post-card:first-child .cover-ph .ph-shot { width: 30%; top: 10%; }
.read-more { margin-top: auto; padding-top: 6px; color: var(--sky); font-weight: 700; font-size: 15px; }
.post-card p { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tags a { min-height: 36px; display: inline-flex; align-items: center; }

/* Статья */
.post h1 { font-size: clamp(32px, 5.6vw, 58px); }
.crumbs { row-gap: 4px; }
.crumbs li { overflow-wrap: anywhere; }
.post-foot .btn { min-height: 48px; }
.prose { overflow-wrap: break-word; }

/* Подвал */
.blog-footer { padding: 56px 0 30px; }
.foot-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; }
.foot-brand p { margin: 14px 0 18px; max-width: 340px; color: var(--muted); }
.blog-footer .foot-logo { height: 40px; margin: 0; }
.foot-col { display: flex; flex-direction: column; }
.foot-col h2 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: #6f86aa; margin: 0 0 8px; }
.foot-col a { display: flex; align-items: center; min-height: 40px; font-size: 15px; }
.foot-bottom { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-top: 36px; padding-top: 22px; border-top: 1px solid var(--border); }
.foot-bottom .langs { margin: 0; }
.foot-bottom .langs a { display: inline-flex; align-items: center; min-height: 40px; }

@media (max-width: 1099px) {
  .blog-header .site-nav { display: none; }
  .nav-menu { display: block; }
  .foot-grid { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: span 2; }
}
@media (max-width: 719px) {
  .blog { padding-block: 34px 72px; }
  .blog-header .wrap { min-height: 64px; gap: 10px; }
  .nav-panel { top: calc(64px + env(safe-area-inset-top)); }
  .blog-header .brand img { height: 26px; }
  .blog-header .cta-mini { min-height: 40px; padding: 0 14px; font-size: 14px; }
  .blog-hero { margin-bottom: 28px; }
  .blog-hero p { font-size: 17px; }
  .post-card:first-child .cover-ph { min-height: 0; aspect-ratio: 16 / 9; }
  .post-card .cover-ph .ph-shot, .post-card:first-child .cover-ph .ph-shot { width: 34%; top: 12%; }
  .post-head .excerpt { font-size: 18px; }
  .prose h2 { font-size: 25px; }
  .post-foot { padding: 24px 20px; }
}
@media (max-width: 420px) {
  .blog-header .cta-mini { display: none; }
  .foot-grid { grid-template-columns: 1fr; }
  .foot-brand { grid-column: auto; }
}

/* Обложка статьи без картинки — баннер с экраном приложения; сетка карточек без пустых мест */
.post-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.post-card:first-child { grid-column: 1 / -1; }
.related .post-grid { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.post-cover.cover-ph { position: relative; overflow: hidden; aspect-ratio: 21 / 9; border-radius: 22px; margin: 6px 0 36px; border: 1px solid var(--border);
  background: radial-gradient(120% 140% at 15% 0%, #2f7cf6, #123a7a 45%, #071a3a 85%); }
.post-cover.cover-ph::after { content: ""; position: absolute; inset: 0; background: url("/assets/bird-white.svg") 5% 12% / 40px auto no-repeat; opacity: 0.85; }
.post-cover.cover-ph .ph-shot { position: absolute; left: 62%; top: 10%; width: 24%; height: auto; aspect-ratio: 300 / 650; object-fit: cover; object-position: top;
  border-radius: 20px; border: 3px solid #9ab1d3; box-shadow: 0 0 0 4px #0a1426, 0 30px 60px rgba(0, 0, 0, 0.5); background: #061e40; transform: rotate(-6deg); }
.post-head .post-meta { align-items: center; }
.post-meta .tags { margin: 0; }
.post-meta .tags a { text-transform: none; letter-spacing: 0; }
@media (max-width: 719px) {
  .post-grid { grid-template-columns: 1fr; }
  .post-cover.cover-ph { aspect-ratio: 16 / 9; }
  .post-cover.cover-ph .ph-shot { left: 52%; width: 36%; }
}
/* Две статьи под главной — по половине ширины, без пустого места справа. */
@media (min-width: 720px) {
  .post-grid:has(> .post-card:nth-child(3):last-child) { grid-template-columns: 1fr 1fr; }
}
.nav-panel .nav-download { display: flex; width: 100%; min-height: 50px; margin-top: 8px; border-radius: 14px; }
.nav-panel { background: #040e20; }
