/* =========================================================
   Блог Ocean Rider
   ========================================================= */
.blog{padding:calc(var(--nav-h) + 48px) 0 100px;background:var(--bg)}
.blog-head{margin-bottom:40px}
.blog-head .section-eyebrow{margin-bottom:12px}
.blog-crumbs{display:flex;flex-wrap:wrap;gap:8px;font-size:13px;color:var(--text-3);margin-bottom:24px}
.blog-crumbs a{transition:color .2s}
.blog-crumbs a:hover{color:var(--red-accent)}
.blog-empty{padding:60px 0;color:var(--text-2)}

/* --- обложка главной блога --- */
.blog-hero{display:grid;grid-template-columns:1.4fr 1fr;gap:48px;align-items:center;margin-bottom:56px}
.blog-hero-img{display:block;aspect-ratio:16/10;border-radius:8px;overflow:hidden;background:var(--paper-2)}
.blog-hero-img img{width:100%;height:100%;object-fit:cover;transition:transform .6s}
.blog-hero:hover .blog-hero-img img{transform:scale(1.03)}
.blog-hero-body h2{font-size:clamp(28px,3vw,42px);font-weight:300;line-height:1.15;letter-spacing:-.02em;margin:12px 0 16px}
.blog-hero-body h2 a:hover{color:var(--red-accent)}
.blog-hero-body p{color:var(--text-2);margin:0 0 24px}

/* --- плитки разделов --- */
.blog-rubrics{display:grid;grid-template-columns:repeat(7,1fr);gap:16px;padding:32px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line);margin-bottom:56px}
.rubric{display:flex;flex-direction:column;gap:10px;text-align:center}
.rubric-img{display:block;aspect-ratio:1;border-radius:8px;overflow:hidden;background:transparent;outline:2px solid transparent;outline-offset:3px;transition:outline-color .2s}
.rubric-img img{width:100%;height:100%;object-fit:contain;padding:12%;transition:transform .5s}
.rubric-ph{display:flex;width:100%;height:100%;align-items:center;justify-content:center;font-size:40px;font-weight:200;color:var(--red-accent);background:var(--paper-2)}
.rubric:hover .rubric-img img{transform:scale(1.06)}
.rubric-ph{display:flex;width:100%;height:100%;align-items:center;justify-content:center;font-size:40px;font-weight:200;color:var(--red-accent)}
.rubric-title{font-size:14px;font-weight:500;line-height:1.3;transition:color .2s}
.rubric small{font-size:12px;color:var(--text-3);margin-top:-6px}
.rubric:hover .rubric-title,.rubric.active .rubric-title{color:var(--red-accent)}
.rubric.active .rubric-img{outline-color:var(--red-accent)}

/* --- теги: текстовые чипы --- */
.blog-tags{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:40px}
.tag-chip{display:inline-flex;align-items:center;gap:2px;height:36px;padding:0 16px;background:#fff;border:1px solid var(--line-2);border-radius:100px;font-size:14px;font-weight:500;color:var(--text-2);white-space:nowrap;transition:border-color .2s,color .2s,background .2s}
.tag-chip::before{content:"#";color:var(--text-3);font-weight:400}
.tag-chip:hover{border-color:var(--red-accent);color:var(--red-accent)}
.tag-chip:hover::before{color:inherit}
.tag-chip.active{background:var(--red-accent);border-color:var(--red-accent);color:#fff}
.tag-chip.active::before{color:rgba(255,255,255,.65)}
.tag-chip--sm{height:28px;padding:0 12px;font-size:12px}

/* --- секции и карточки --- */
.blog-block{margin-bottom:64px}
.blog-block-head{display:flex;justify-content:space-between;align-items:baseline;gap:20px;margin-bottom:24px}
.blog-block-title{font-size:28px;font-weight:300;letter-spacing:-.02em;margin-bottom:20px}
.blog-block-head .blog-block-title{margin:0}
.bgrid{display:grid;grid-template-columns:repeat(4,1fr);gap:32px 24px}
.bgrid--3{grid-template-columns:repeat(3,1fr)}
.bgrid--list{grid-template-columns:repeat(3,1fr);margin-bottom:48px}
.bcard{display:flex;flex-direction:column}
.bcard-img{display:block;aspect-ratio:3/2;border-radius:6px;overflow:hidden;background:var(--paper-2)}
.bcard-img img{width:100%;height:100%;object-fit:cover;transition:transform .5s}
.bcard:hover .bcard-img img{transform:scale(1.05)}
.bcard-body{display:flex;flex-direction:column;gap:8px;padding-top:16px;flex:1}
.bcard-eyebrow{font-size:11px;letter-spacing:.16em;text-transform:uppercase;font-weight:600;color:var(--red-accent)}
.bcard h3{font-size:19px;font-weight:500;line-height:1.3;letter-spacing:-.01em}
.bcard h3 a:hover{color:var(--red-accent)}
.bcard p{margin:0;font-size:14px;color:var(--text-2);line-height:1.6}
.bcard-meta{display:flex;flex-wrap:wrap;gap:6px 14px;margin-top:auto;padding-top:6px;font-size:12px;color:var(--text-3)}
.bcard-meta > * + *::before{content:"·";margin-right:14px}

/* --- пагинация --- */
.blog-pager{display:flex;justify-content:center;gap:6px}
.blog-pager a,.blog-pager span{min-width:40px;height:40px;display:inline-flex;align-items:center;justify-content:center;border:1px solid var(--line-2);border-radius:4px;font-size:14px}
.blog-pager a:hover{border-color:var(--red-accent);color:var(--red-accent)}
.blog-pager span{background:var(--text);border-color:var(--text);color:#fff}

/* =========================================================
   Статья
   ========================================================= */
.post{max-width:1440px}
.post-draft{padding:10px 16px;background:var(--red-tint);color:var(--red-accent);font-size:13px;font-weight:500;margin-bottom:20px}

/* общий аватар (шапка и карточка автора) */
.avatar{width:36px;height:36px;flex-shrink:0;border-radius:50%;object-fit:cover;background:var(--red-tint);color:var(--red-accent);display:inline-flex;align-items:center;justify-content:center;font-size:14px;font-weight:600;line-height:1}

/* --- страница статьи --- */
.blog--post.has-cover{padding-top:0}

/* --- hero с обложкой --- */
.post-hero{position:relative;display:grid;min-height:min(calc(100svh - var(--nav-h)),920px);margin-top:var(--nav-h);overflow:hidden;background:#0b0f14;color:#fff}
.post-hero-img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
.post-hero::after{content:"";position:absolute;inset:0;pointer-events:none;
  background:linear-gradient(180deg,rgba(0,0,0,.45) 0%,rgba(0,0,0,0) 22%,rgba(0,0,0,0) 45%,rgba(0,0,0,.55) 75%,rgba(0,0,0,.82) 100%)}
.post-hero-inner{position:relative;z-index:1;display:flex;flex-direction:column;width:100%;padding-top:28px;padding-bottom:64px}

.post-hero .blog-crumbs{margin-bottom:auto;padding-bottom:40px;color:rgba(255,255,255,.7)}
.post-hero .blog-crumbs a:hover{color:#fff}
.post-hero .post-draft{align-self:flex-start;background:var(--red-accent);color:#fff}
.post-hero .post-kicker-cat{padding:6px 10px;border-radius:3px;background:var(--red-accent);color:#fff}
.post-hero .post-kicker-cat:hover{background:#fff;color:var(--red-accent)}
.post-hero .post-kicker-tags{color:rgba(255,255,255,.78)}
.post-hero .post-kicker-tags a:hover{color:#fff}
.post-hero h1{max-width:1040px;margin-top:20px;color:#fff;font-size:clamp(36px,5.4vw,80px);text-shadow:0 2px 24px rgba(0,0,0,.25)}
.post-hero .post-lead{color:rgba(255,255,255,.86)}

@media (prefers-reduced-motion:no-preference){
  .post-hero-img{animation:post-hero-zoom 1.8s cubic-bezier(.2,.7,.2,1) both}
  @keyframes post-hero-zoom{from{transform:scale(1.06)}to{transform:none}}
}

/* --- шапка без обложки --- */
.post-head{margin-bottom:0}
.post-kicker{display:flex;flex-wrap:wrap;align-items:center;gap:8px 20px}
.post-kicker-cat{font-size:12px;letter-spacing:.16em;text-transform:uppercase;font-weight:600;color:var(--red-accent);transition:color .2s,background .2s}
.post-kicker-tags{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px;color:var(--text-3)}
.post-kicker-tags a{transition:color .2s}
.post-kicker-tags a:hover,.post-kicker-cat:hover{color:var(--text)}
.post-head h1,.post-hero h1{font-weight:300;line-height:1.05;letter-spacing:-.03em;text-wrap:balance}
.post-head h1{max-width:900px;margin:18px 0 0;font-size:clamp(34px,4.4vw,58px)}
.post-lead{max-width:720px;margin:20px 0 0;font-size:20px;font-weight:300;line-height:1.55;color:var(--text-2)}

/* --- байлайн --- */
.post-byline{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:16px 40px;margin:36px 0 56px;padding:18px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.has-cover .post-byline{margin-top:0;border-top:0;padding:22px 0}
.post-author{display:flex;align-items:center;gap:14px;min-width:0}
.post-author .avatar{width:48px;height:48px;flex:0 0 48px;font-size:18px}
.post-author-name{display:block;font-size:15px;font-weight:500;line-height:1.3;color:var(--text)}
.post-author-role{display:block;font-size:13px;line-height:1.4;color:var(--text-3)}
.post-facts{display:flex;flex-wrap:wrap;align-items:center;margin:0;padding:0;list-style:none;font-size:14px;color:var(--text-2)}
.post-facts li{display:inline-flex;align-items:center;white-space:nowrap}
.post-facts li + li::before{content:"";width:3px;height:3px;margin:0 14px;border-radius:50%;background:var(--text-3)}


/* --- текст слева, оглавление справа --- */
.post-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:80px;align-items:start}
.post-main{grid-column:1;grid-row:1;min-width:0;max-width:780px}
.post-aside{grid-column:2;grid-row:1;position:sticky;top:calc(var(--nav-live,var(--nav-h)) + 24px);max-height:calc(100vh - var(--nav-live,var(--nav-h)) - 48px);overflow-y:auto;display:flex;flex-direction:column;gap:28px;scrollbar-width:thin}

/* --- оглавление --- */
.toc summary{list-style:none;margin-bottom:14px;font-size:11px;letter-spacing:.16em;text-transform:uppercase;font-weight:600;color:var(--text-3);cursor:default}
.toc summary::-webkit-details-marker{display:none}
.toc ol{list-style:none;margin:0;padding:0;border-left:1px solid var(--line)}
.toc a{display:block;margin-left:-1px;padding:7px 0 7px 16px;border-left:2px solid transparent;font-size:14px;line-height:1.4;color:var(--text-2);transition:color .15s,border-color .15s}
.toc .lvl-3 a{padding-left:30px;font-size:13px}
.toc a:hover{color:var(--text)}
.toc a.active{color:var(--red-accent);border-left-color:var(--red-accent);font-weight:500}

.aside-cta{padding:20px;background:var(--paper);border-radius:8px}
.aside-cta p{margin:0 0 14px;font-size:14px;line-height:1.5;color:var(--text-2)}
.aside-cta .fav-cta{width:100%;margin:0}

/* --- текст статьи --- */
.post-prose{font-size:18px;line-height:1.75;color:var(--text-2)}
.post-prose > :first-child{margin-top:0}
.post-prose h2,.post-prose h3{scroll-margin-top:calc(var(--nav-live,var(--nav-h)) + 24px)}
.post-prose h2{font-size:30px;font-weight:400;letter-spacing:-.015em;color:var(--text);margin:56px 0 18px;line-height:1.2}
.post-prose h3{font-size:22px;font-weight:500;color:var(--text);margin:36px 0 12px}
.post-prose p,.post-prose ul,.post-prose ol{margin:0 0 22px}
.post-prose ul,.post-prose ol{padding-left:24px}
.post-prose li{margin-bottom:10px}
.post-prose li::marker{color:var(--red-accent)}
.post-prose a{color:var(--red-accent);border-bottom:1px solid currentColor}
.post-prose strong{font-weight:600;color:var(--text)}
.post-prose mark{background:none;color:var(--red-accent);font-weight:600}
.post-prose img{border-radius:6px;margin:8px 0}
.post-prose figure{margin:36px 0}
.post-prose figure img{width:100%;margin:0}
.post-prose figcaption{font-size:13px;color:var(--text-3);margin-top:8px}
.post-prose blockquote{margin:36px 0;padding:6px 0 6px 28px;border-left:3px solid var(--red-accent);font-size:22px;font-weight:300;line-height:1.5;color:var(--text)}
.post-prose table{width:100%;border-collapse:collapse;font-size:15px;margin:28px 0;display:block;overflow-x:auto}
.post-prose th,.post-prose td{padding:12px 16px;border-bottom:1px solid var(--line);text-align:left}
.post-prose th{color:var(--text);font-weight:600;background:var(--paper)}

/* --- Markdown: выноски и заглушки --- */
.post-prose .callout{margin:32px 0;padding:20px 24px;border-left:3px solid var(--text-3);background:var(--paper);border-radius:0 8px 8px 0;font-size:16px;line-height:1.65}
.post-prose .callout > :last-child{margin-bottom:0}
.post-prose .callout-title{margin:0 0 6px;font-size:12px;letter-spacing:.14em;text-transform:uppercase;font-weight:600;color:var(--text)}
.post-prose .callout-tip{border-left-color:var(--success);background:rgba(34,197,94,.06)}
.post-prose .callout-warn{border-left-color:var(--red-accent);background:var(--red-tint)}
.post-prose .callout-info{border-left-color:#3b82f6;background:rgba(59,130,246,.06)}
.post-prose .md-todo{margin:24px 0;padding:14px 18px;border:1px dashed var(--red-accent);border-radius:6px;font-size:14px;color:var(--red-accent)}
.post-prose:not(.is-draft) .md-todo{display:none}

/* --- теги внизу статьи --- */
.post-tags{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin:48px 0 0}
.post-tags-label{margin-right:6px;font-size:11px;letter-spacing:.16em;text-transform:uppercase;font-weight:600;color:var(--text-3)}

/* --- карточка автора --- */
.post .author-box{display:flex;align-items:flex-start;gap:24px;margin:56px 0 0;padding:32px 0;border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.post .author-box .avatar{width:72px;height:72px;flex:0 0 72px;margin:0;font-size:26px}
.author-box-body{flex:1;min-width:0;padding-top:2px}
.author-box-body small{display:block;margin-bottom:6px;font-size:11px;letter-spacing:.16em;text-transform:uppercase;font-weight:600;color:var(--text-3)}
.author-box-body strong{display:block;font-size:20px;font-weight:500;line-height:1.25;color:var(--text)}
.author-box-role{display:block;margin-top:4px;font-size:13px;color:var(--text-3)}
.author-box-body p{margin:12px 0 0;max-width:640px;font-size:14px;line-height:1.65;color:var(--text-2)}

/* --- CTA и похожие статьи --- */
.post-cta{display:flex;justify-content:space-between;align-items:center;gap:24px;padding:32px;margin:40px 0 0;background:var(--paper);border-left:3px solid var(--red-accent)}
.post-cta h2{font-size:22px;font-weight:400;margin-bottom:6px}
.post-cta p{margin:0;color:var(--text-2);font-size:14px}
.post-cta .fav-cta{margin:0;padding:14px 28px;white-space:nowrap}
.post-related{margin-top:96px}


/* --- товары и категории внутри статьи --- */
.post-prose .embed-products{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:16px;margin:36px 0}
.post-prose a.embed-product,.post-prose a.embed-cat{display:flex;color:var(--text);border:1px solid var(--line);border-radius:8px;overflow:hidden;background:#fff;line-height:1.4;transition:border-color .2s,box-shadow .2s}
.post-prose a.embed-product:hover,.post-prose a.embed-cat:hover{border-color:var(--line-2);box-shadow:0 12px 32px rgba(0,0,0,.08)}
.embed-product{flex-direction:column}
.embed-product-img{position:relative;display:block;aspect-ratio:4/3;background:var(--paper);overflow:hidden}
.post-prose .embed-product-img img{width:100%;height:100%;object-fit:contain;padding:8%;margin:0;border-radius:0;transition:transform .5s}
.embed-product:hover .embed-product-img img{transform:scale(1.04)}
.embed-badge{position:absolute;top:12px;left:12px;padding:4px 8px;border-radius:3px;background:var(--red-accent);color:#fff;font-size:11px;font-weight:600;letter-spacing:.08em;text-transform:uppercase}
.embed-product-body{display:flex;flex-direction:column;gap:8px;flex:1;padding:18px 20px 20px}
.embed-eyebrow{font-size:11px;letter-spacing:.16em;text-transform:uppercase;font-weight:600;color:var(--red-accent)}
.embed-title{font-size:18px;font-weight:500;line-height:1.3;color:var(--text)}
.embed-specs{display:flex;flex-wrap:wrap;gap:4px 14px;font-size:13px;color:var(--text-3)}
.embed-specs b{font-weight:600;color:var(--text)}
.embed-price{display:flex;align-items:baseline;gap:10px;margin-top:auto;padding-top:6px;font-size:20px;font-weight:500;color:var(--text)}
.embed-price s{font-size:14px;font-weight:400;color:var(--text-3)}
.embed-more{font-size:14px;font-weight:500;color:var(--red-accent)}

/* одна карточка — горизонтально */
.embed-products.is-single{grid-template-columns:1fr}
.embed-products.is-single .embed-product{flex-direction:row}
.embed-products.is-single .embed-product-img{flex:0 0 42%;aspect-ratio:auto;min-height:240px}
.embed-products.is-single .embed-product-body{justify-content:center;padding:28px 32px}
.embed-products.is-single .embed-title{font-size:22px}
.embed-products.is-single .embed-price{margin-top:8px}

/* баннер категории */
.post-prose a.embed-cat{margin:36px 0;background:var(--paper);border-color:transparent}
.embed-cat-img{position:relative;flex:0 0 42%;min-height:220px;overflow:hidden}
.post-prose .embed-cat-img img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;margin:0;border-radius:0;transition:transform .6s}
.embed-cat:hover .embed-cat-img img{transform:scale(1.04)}
.embed-cat-body{display:flex;flex-direction:column;justify-content:center;gap:10px;padding:28px 32px}
.embed-cat .embed-title{font-size:24px;font-weight:400;letter-spacing:-.01em}
.embed-text{font-size:15px;line-height:1.6;color:var(--text-2)}
.embed-cat-foot{display:flex;flex-wrap:wrap;align-items:center;gap:10px 18px;margin-top:8px;font-size:13px;color:var(--text-3)}
.embed-btn{display:inline-flex;align-items:center;height:42px;padding:0 20px;border-radius:4px;background:var(--text);color:#fff;font-size:14px;font-weight:500;transition:background .2s}
.embed-cat:hover .embed-btn{background:var(--red-accent)}


/* =========================================================
   Адаптив (от широкого к узкому — порядок важен)
   ========================================================= */
@media (max-width:1180px){
  .blog-rubrics{grid-template-columns:repeat(4,1fr)}
  .bgrid{grid-template-columns:repeat(3,1fr)}
  .blog-hero{gap:32px}
  .post-layout{grid-template-columns:minmax(0,1fr) 260px;gap:48px}
}

/* планшет/телефон: оглавление — свёрнутый блок над текстом */
@media (max-width:900px){
  .post-layout{grid-template-columns:1fr;gap:0}
  .post-main,.post-aside{grid-column:1;grid-row:auto;max-width:none}
  .post-aside{position:static;max-height:none;overflow:visible;margin-bottom:32px}
  .aside-cta{display:none}
  .toc{border:1px solid var(--line);border-radius:8px;padding:0 16px}
  .toc summary{display:flex;justify-content:space-between;align-items:center;margin:0;padding:16px 0;cursor:pointer}
  .toc summary::after{content:"+";font-size:20px;font-weight:300;letter-spacing:0;transition:transform .2s}
  .toc[open] summary::after{transform:rotate(45deg);color:var(--red-accent)}
  .toc ol{margin-bottom:14px}
}

@media (max-width:820px){
  .blog-hero{grid-template-columns:1fr;gap:20px}
  .bgrid,.bgrid--3,.bgrid--list{grid-template-columns:repeat(2,1fr)}
  .post-cta{flex-direction:column;align-items:flex-start}
}

@media (max-width:640px){
  .blog{padding-top:calc(var(--nav-h) + 28px)}

  /* разделы — горизонтальная лента, как у REI */
  .blog-rubrics{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;gap:12px;margin:0 -20px 40px;padding:24px 20px;scrollbar-width:none}
  .blog-rubrics::-webkit-scrollbar{display:none}
  .rubric{flex:0 0 112px;scroll-snap-align:start}

  .tag-chip{flex-shrink:0}
  .blog-tags{flex-wrap:nowrap;overflow-x:auto;margin:0 -20px 32px;padding:0 20px;scrollbar-width:none}
  .blog-tags::-webkit-scrollbar{display:none}

  .bgrid,.bgrid--3,.bgrid--list{grid-template-columns:1fr;gap:28px}
  .blog-block-head{flex-direction:column;gap:12px}

  /* шапка статьи */
  .post-head h1{margin-top:14px}
  .post-lead{font-size:17px;margin-top:14px}
  .post-byline{flex-direction:column;align-items:flex-start;gap:12px;margin-top:24px}
  .post-facts{font-size:13px}
  .post-facts li + li::before{margin:0 10px}

  .post-prose{font-size:16px}
  .post-prose h2{font-size:24px;margin-top:40px}
  .post-cta{padding:24px}
  .post-related{margin-top:64px}

  .post .author-box{gap:16px;margin-top:40px;padding:24px 0}
  .post .author-box .avatar{width:56px;height:56px;flex-basis:56px;font-size:22px}
  .author-box-body strong{font-size:18px}
  .post-hero{min-height:min(78svh,640px)}
  .post-hero-inner{padding-top:20px;padding-bottom:36px}
  .post-hero .blog-crumbs{padding-bottom:24px}
  .post-hero h1{font-size:clamp(30px,8.5vw,40px);margin-top:14px}
  .post-byline{flex-direction:column;align-items:flex-start;gap:12px;margin:24px 0 36px}
  .has-cover .post-byline{margin-top:0}
    .embed-products.is-single .embed-product,.post-prose a.embed-cat{flex-direction:column}
  .embed-products.is-single .embed-product-img{flex:none;aspect-ratio:4/3;min-height:0}
  .embed-cat-img{flex:none;aspect-ratio:16/9;min-height:0}
  .embed-products.is-single .embed-product-body,.embed-cat-body{padding:20px}

}
