/* Блог «Легенды»: список статей, статья, вставки. Цвета и шрифты — из brand.css (брендбук 2024).
   Фирменная деталь статьи — «бирка» с коротким ответом: в комиссионке бирка висит на каждом товаре,
   здесь на ней вместо цены — ответ на вопрос статьи. */

/* ——— Шапка списка и статьи: тёмная полоса, как у внутренних страниц ——— */
.blog-hero,.post-hero{position:relative;background:linear-gradient(105deg,var(--brand-night),var(--brand-night-deep) 70%,#1f2622);color:var(--brand-paper)}
.blog-hero__inner{padding:26px 0 44px}
.blog-hero h1{max-width:780px;margin:0;font-family:var(--font-display);font-size:48px;line-height:1.06;color:var(--brand-paper)}
.blog-hero__lead{max-width:640px;margin:16px 0 0;font-size:17px;line-height:1.55;color:#cfd6d0}
.blog-cats{display:flex;flex-wrap:wrap;gap:8px;margin-top:26px}
.blog-cats a{padding:8px 14px;border:1px solid var(--brand-night-line);border-radius:999px;font-size:14px;color:#dce1dc;text-decoration:none;transition:background .2s,border-color .2s}
.blog-cats a:hover{border-color:rgba(174,202,185,.5)}
.blog-cats a[aria-current]{background:var(--brand-paper);border-color:var(--brand-paper);color:var(--brand-black)}

/* ——— Карточки ——— */
.blog-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:28px 24px}
.blog-card{position:relative;display:flex;flex-direction:column;background:#fff;border:1px solid var(--line);border-radius:var(--radius);overflow:hidden;transition:box-shadow .2s,transform .2s}
.blog-card:hover{box-shadow:var(--shadow);transform:translateY(-2px)}
.blog-card__image{aspect-ratio:16/9;background:#e3e7e1;overflow:hidden}
.blog-card__image img{display:block;width:100%;height:100%;object-fit:cover}
.blog-card__body{display:flex;flex-direction:column;gap:10px;padding:20px 22px 24px}
.blog-card__meta{display:flex;gap:14px;margin:0;font-size:12px;letter-spacing:.06em;text-transform:uppercase;color:#6b766f}
.blog-card__meta span+span:before{content:"·";margin-right:14px}
.blog-card__title{margin:0;font-family:var(--font-text);font-size:20px;font-weight:600;line-height:1.25;color:var(--ink)}
.blog-card__title a{color:inherit;text-decoration:none}
.blog-card__title a:after{content:"";position:absolute;inset:0}
.blog-card__title a:focus-visible{outline:none}
.blog-card:focus-within{outline:2px solid var(--brand-focus);outline-offset:3px}
.blog-card__lead{margin:0;font-size:15px;line-height:1.5}
.blog-card--wide{grid-column:1/-1;display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr)}
.blog-card--wide .blog-card__image{aspect-ratio:auto;min-height:340px}
.blog-card--wide .blog-card__body{justify-content:center;padding:40px 44px}
.blog-card--wide .blog-card__title{font-family:var(--font-display);font-size:34px;line-height:1.1;font-weight:700}
.blog-card--wide .blog-card__lead{font-size:17px}
.blog-empty{font-size:17px}
.blog-list .nav-links{display:flex;gap:8px;justify-content:center;margin-top:36px}
.blog-list .page-numbers{padding:8px 14px;border:1px solid var(--line);border-radius:10px;color:var(--ink);text-decoration:none}
.blog-list .page-numbers.current{background:var(--brand-black);color:var(--brand-paper);border-color:var(--brand-black)}

/* ——— Статья: шапка ——— */
.post-hero{padding-bottom:0}
.post-hero__inner{padding:24px 0 36px}
.post-hero__inner>*{max-width:860px}
.post-chip{display:inline-block;margin-bottom:18px;padding:6px 12px;border:1px solid rgba(174,202,185,.4);border-radius:999px;font-size:13px;color:var(--brand-accent);text-decoration:none}
.post-chip:hover{background:rgba(174,202,185,.12)}
.post-hero__title{margin:0;font-family:var(--font-display);font-size:50px;line-height:1.05;color:var(--brand-paper);text-wrap:balance}
.post-hero__lead{margin:18px 0 0;font-size:19px;line-height:1.5;color:#d4dad5;max-width:720px}
.post-meta{display:flex;flex-wrap:wrap;gap:6px 18px;margin:22px 0 0;font-size:14px;color:#a5b0a9}
.post-meta span+span:before{content:"";display:inline-block;width:4px;height:4px;margin:0 18px 3px 0;border-radius:50%;background:#5f6b64}
.post-cover{position:relative;margin:0 auto -56px;border-radius:20px;overflow:hidden;aspect-ratio:21/9;background:#2a302c;box-shadow:0 24px 50px rgba(20,25,22,.25)}
.post-cover img{display:block;width:100%;height:100%;object-fit:cover}
.post-hero:has(.post-cover)+.post-layout{padding-top:96px}

/* ——— Статья: колонки ——— */
.post-layout{display:grid;grid-template-columns:minmax(0,720px) 300px;justify-content:space-between;gap:56px;padding-top:48px}
.post-main{min-width:0}
.post-aside__sticky{position:sticky;top:110px;display:grid;gap:18px}

/* «Бирка» */
.post-tag{position:relative;margin:0 0 34px;padding:26px 28px 26px 74px;background:#e6ede4;border-radius:6px 18px 18px 6px;clip-path:polygon(22px 0,100% 0,100% 100%,22px 100%,0 calc(100% - 22px),0 22px)}
.post-tag:before{content:"";position:absolute;left:22px;top:0;bottom:0;border-left:1.5px dashed rgba(84,98,90,.35)}
.post-tag__hole{position:absolute;left:36px;top:50%;width:16px;height:16px;margin-top:-8px;border-radius:50%;background:var(--brand-paper);box-shadow:inset 0 1px 2px rgba(0,0,0,.18)}
.post-tag__hole:after{content:"";position:absolute;right:12px;top:7px;width:46px;height:1.5px;background:#8a6f4e;transform:rotate(-14deg);transform-origin:right}
.post-tag__label{margin:0 0 8px;font-size:12px;font-weight:700;letter-spacing:.16em;text-transform:uppercase;color:var(--brand-green)}
.post-tag__answer{margin:0;font-size:19px;line-height:1.5;color:var(--ink)}

/* Оглавление */
.post-toc{font-size:14px}
.post-toc ol{margin:0;padding:0;list-style:none;counter-reset:toc}
.post-toc li{counter-increment:toc}
.post-toc a{display:grid;grid-template-columns:22px 1fr;gap:4px;padding:7px 0;color:var(--muted);text-decoration:none;line-height:1.35;border-left:2px solid transparent;transition:color .2s}
.post-toc a:before{content:counter(toc);font-variant-numeric:tabular-nums;color:#9aa49e}
.post-toc a:hover{color:var(--ink)}
.post-toc a[aria-current]{color:var(--ink);font-weight:600;border-left-color:var(--brand-green);margin-left:-14px;padding-left:12px}
.post-toc a[aria-current]:before{color:var(--brand-green)}
.post-toc__title{margin:0 0 6px;font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:#7c8780}
.post-toc--inline{display:none;margin:0 0 30px;border:1px solid var(--line);border-radius:14px;background:#fff}
.post-toc--inline summary{display:flex;align-items:center;gap:10px;padding:14px 18px;font-weight:600;cursor:pointer;list-style:none}
.post-toc--inline summary::-webkit-details-marker{display:none}
.post-toc--inline summary span{margin-left:auto;font-weight:400;font-size:13px;color:#7c8780}
.post-toc--inline summary .icon{width:18px;height:18px;transition:transform .2s}
.post-toc--inline[open] summary .icon{transform:rotate(180deg)}
.post-toc--inline ol{padding:0 18px 12px}
.post-aside__cta{padding:22px;border-radius:16px;background:var(--brand-night);color:var(--brand-paper)}
.post-aside__cta p{margin:0 0 14px;font-size:14px;color:#c4ccc6}
.post-aside__cta .post-aside__title{margin-bottom:6px;font-size:18px;font-weight:600;color:var(--brand-paper)}
.post-aside__cta .btn{width:100%;justify-content:center}

/* ——— Текст статьи ——— */
.post-content{font-size:18px;line-height:1.7;color:#2f3331}
.post-content>*:first-child{margin-top:0}
.post-content p,.post-content ul,.post-content ol{margin:0 0 20px}
.post-content p{color:#2f3331}
.post-content h2{margin:52px 0 18px;font-family:var(--font-display);font-size:32px;line-height:1.12;color:var(--ink);scroll-margin-top:110px}
.post-content h3{margin:34px 0 12px;font-size:21px;font-weight:600;line-height:1.3;color:var(--ink)}
.post-content a{color:var(--brand-blue);text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:3px}
.post-content a:hover{color:var(--brand-green)}
.post-content ul,.post-content ol{padding-left:24px}
.post-content li{margin-bottom:8px;padding-left:4px}
.post-content li::marker{color:var(--brand-green);font-weight:600}
.post-content strong{color:var(--ink)}
.post-content table{width:100%;margin:28px 0;border-collapse:collapse;font-size:15px;line-height:1.45;background:#fff;border-radius:14px;overflow:hidden;box-shadow:0 0 0 1px var(--line)}
.post-content th{padding:14px 16px;background:var(--brand-night);color:var(--brand-paper);font-weight:600;text-align:left;vertical-align:bottom}
.post-content td{padding:13px 16px;border-top:1px solid var(--line);vertical-align:top}
.post-content tr:nth-child(even) td{background:#f8f7f3}
.post-content td:first-child{font-weight:600;color:var(--ink)}

/* ——— Вставки ——— */
.lg-cta{display:flex;align-items:center;gap:28px;margin:40px 0;padding:28px 30px;border-radius:18px;background:var(--brand-night) url("../img/brand/pattern-tile.svg") right -20px top -10px/132px 120px;background-blend-mode:normal;color:var(--brand-paper);position:relative;overflow:hidden}
.lg-cta:before{content:"";position:absolute;inset:0;background:linear-gradient(90deg,var(--brand-night) 55%,rgba(27,32,29,.92));pointer-events:none}
.lg-cta>*{position:relative}
.lg-cta__body{flex:1;min-width:0}
.lg-cta p{margin:0}
.lg-cta .lg-cta__eyebrow{font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--brand-accent)}
.lg-cta .lg-cta__title{margin:8px 0 6px;font-size:22px;font-weight:600;line-height:1.25;color:var(--brand-paper)}
.lg-cta .lg-cta__text{font-size:15px;line-height:1.5;color:#c4ccc6}
.lg-cta__actions{display:grid;gap:10px;justify-items:center;flex:none;max-width:230px}
.lg-cta__actions .btn{width:auto;min-width:210px;justify-content:center;white-space:nowrap}
.lg-cta .lg-cta__hint{font-size:12.5px;line-height:1.4;text-align:center;text-wrap:balance;color:#a9b4ad}

.lg-note{display:grid;grid-template-columns:24px 1fr;gap:14px;margin:30px 0;padding:20px 22px;border-radius:14px;background:#fff;box-shadow:inset 3px 0 0 var(--brand-green),0 0 0 1px var(--line)}
.lg-note--warn{background:#fbf6ee;box-shadow:inset 3px 0 0 #b07d3c,0 0 0 1px #eadfcc}
.lg-note>.icon{width:22px;height:22px;margin-top:2px;color:var(--brand-green)}
.lg-note--warn>.icon{color:#a06f30}
.lg-note p{margin:0 0 8px;font-size:16px;line-height:1.55}
.lg-note p:last-child{margin-bottom:0}
.lg-note .lg-note__label{margin-bottom:4px;font-size:12px;font-weight:700;letter-spacing:.14em;text-transform:uppercase;color:var(--brand-green)}
.lg-note--warn .lg-note__label{color:#8b5f27}

.lg-checklist{margin:36px 0;padding:26px 28px;border-radius:18px;background:#fff;box-shadow:0 0 0 1px var(--line)}
.lg-checklist__head{display:flex;align-items:baseline;justify-content:space-between;gap:16px;margin-bottom:12px}
.lg-checklist__title{margin:0!important;font-size:20px;font-weight:600;color:var(--ink)}
.lg-checklist__count{margin:0!important;white-space:nowrap;font-size:14px;font-variant-numeric:tabular-nums;color:#7c8780}
.lg-checklist.is-done .lg-checklist__count{color:var(--brand-green);font-weight:600}
.post-content .lg-checklist ul{margin:0;padding:0;list-style:none}
.post-content .lg-checklist li{margin:0;padding:0;border-top:1px solid #eceee9}
.lg-checklist label{display:grid;grid-template-columns:22px 1fr;gap:14px;padding:12px 0;font-size:16px;line-height:1.5;cursor:pointer}
.lg-checklist input{appearance:none;width:20px;height:20px;margin:2px 0 0;border:1.5px solid #9aa49e;border-radius:6px;background:#fff;cursor:pointer;transition:background .15s,border-color .15s}
.lg-checklist input:checked{border-color:var(--brand-green);background:var(--brand-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f5f2ed' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12 5 5 9-10'/%3E%3C/svg%3E") center/14px no-repeat}
.lg-checklist input:focus-visible{outline:2px solid var(--brand-focus);outline-offset:2px}
.lg-checklist input:checked+span{color:#7c8780;text-decoration:line-through;text-decoration-color:rgba(84,98,90,.45)}

.lg-figure{margin:36px 0}
.lg-figure img{display:block;width:100%;height:auto;border-radius:16px}
.lg-figure figcaption{margin-top:10px;font-size:14px;line-height:1.45;color:#6b766f}

.lg-terms{margin:36px 0;padding:26px 28px;border-radius:18px;background:#e9eee7}
.lg-terms__title{margin:0 0 14px!important;font-size:20px;font-weight:600;color:var(--ink)}
.post-content .lg-terms ul{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px 24px;margin:0 0 18px;padding:0;list-style:none}
.post-content .lg-terms li{display:grid;grid-template-columns:22px 1fr;gap:12px;margin:0;padding:0;font-size:15px;line-height:1.45}
.lg-terms li .icon{width:20px;height:20px;margin-top:2px;color:var(--brand-green)}
.lg-terms li b{display:block;color:var(--ink)}
.post-content .lg-terms .text-button{color:var(--brand-green);text-decoration:none;font-weight:600}

.lg-branches{margin:36px 0;padding:26px 28px;border-radius:18px;background:#fff;box-shadow:0 0 0 1px var(--line)}
.lg-branches__title{margin:0 0 6px!important;font-size:20px;font-weight:600;color:var(--ink)}
.lg-branches__text{margin:0 0 16px!important;font-size:15px!important;color:var(--muted)!important}
.post-content .lg-branches ul{display:flex;flex-wrap:wrap;gap:8px;margin:0;padding:0;list-style:none}
.post-content .lg-branches li{margin:0;padding:0}
.post-content .lg-branches a{display:flex;align-items:baseline;gap:8px;padding:8px 14px;border:1px solid var(--line);border-radius:999px;font-size:15px;color:var(--ink);text-decoration:none;transition:border-color .2s}
.post-content .lg-branches a:hover{border-color:var(--brand-green)}
.lg-branches small{font-size:12px;color:#7c8780}

/* ——— Низ статьи ——— */
.post-faq{margin-top:56px}
.post-faq h2,.post-next h2{margin:0 0 20px;font-family:var(--font-display);font-size:32px;line-height:1.12;color:var(--ink)}
.post-faq .faq-item{margin-bottom:10px}
.post-next{margin-top:56px}
.post-next .link-tiles{grid-template-columns:repeat(2,minmax(0,1fr))}
.post-author{display:grid;grid-template-columns:44px 1fr;gap:16px;align-items:start;margin-top:48px;padding-top:28px;border-top:1px solid var(--line)}
.post-author p{margin:0;font-size:14px;line-height:1.55}
.post-author b{display:block;margin-bottom:2px;font-size:15px;color:var(--ink)}
.blog-more .blog-grid{grid-template-columns:repeat(3,minmax(0,1fr))}

/* ——— Обратные ссылки на страницах каталога ——— */
.blog-links{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;margin:0;padding:0;list-style:none}
.blog-links a{display:grid;grid-template-columns:72px 1fr;grid-template-rows:auto auto;gap:4px 16px;align-items:center;height:100%;padding:14px;border:1px solid var(--line);border-radius:14px;background:#fff;color:var(--ink);text-decoration:none;transition:border-color .2s,box-shadow .2s}
.blog-links a:hover{border-color:var(--brand-green);box-shadow:var(--shadow)}
.blog-links__img{grid-row:1/3;width:72px;height:72px;border-radius:10px;overflow:hidden;background:#e3e7e1}
.blog-links__img img{display:block;width:100%;height:100%;object-fit:cover}
.blog-links__title{align-self:end;font-weight:600;line-height:1.3}
.blog-links__meta{align-self:start;font-size:13px;color:#7c8780}

/* ——— Адаптив ——— */
@media(max-width:1100px){
	.post-layout{grid-template-columns:minmax(0,1fr) 260px;gap:40px}
	.blog-grid,.blog-more .blog-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
	.blog-links{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
	.post-layout{grid-template-columns:minmax(0,1fr)}
	.post-aside{display:none}
	.post-toc--inline{display:block}
	.post-cover{aspect-ratio:16/9}
	.post-hero__title{font-size:38px}
	.blog-hero h1{font-size:38px}
	.blog-card--wide{grid-template-columns:1fr}
	.blog-card--wide .blog-card__image{min-height:0;aspect-ratio:16/9}
	.blog-card--wide .blog-card__body{padding:24px 22px 28px}
	.blog-card--wide .blog-card__title{font-size:28px}
	.post-cover{margin-bottom:-40px;border-radius:16px}
	.post-hero:has(.post-cover)+.post-layout{padding-top:72px}
}
@media(max-width:640px){
	.blog-grid,.blog-more .blog-grid,.blog-links{grid-template-columns:1fr}
	.blog-hero__inner{padding:20px 0 32px}
	.blog-hero h1,.post-hero__title{font-size:31px;line-height:1.1}
	.blog-hero__lead,.post-hero__lead{font-size:16px}
	.post-hero__inner{padding:18px 0 28px}
	.post-meta{font-size:13px}
	.post-meta span+span:before{margin-right:12px}
	.post-cover{aspect-ratio:3/2;border-radius:14px;margin-bottom:-28px}
	.post-hero:has(.post-cover)+.post-layout{padding-top:56px}
	.post-tag{padding:20px 20px 20px 60px;clip-path:polygon(16px 0,100% 0,100% 100%,16px 100%,0 calc(100% - 16px),0 16px)}
	.post-tag:before{left:16px}
	.post-tag__hole{left:27px;width:14px;height:14px;margin-top:-7px}
	.post-tag__answer{font-size:17px}
	.post-content{font-size:17px;line-height:1.65}
	.post-content h2,.post-faq h2,.post-next h2{margin-top:40px;font-size:26px}
	.post-faq h2,.post-next h2{margin-top:0}
	/* Таблица на телефоне — карточки: строка = карточка, первая ячейка — заголовок, остальные с подписью колонки. */
	.post-content table,.post-content tbody,.post-content tr,.post-content td{display:block;width:100%}
	.post-content table{background:none;box-shadow:none;border-radius:0;font-size:15px}
	.post-content thead{display:none}
	.post-content tr{margin-bottom:12px;border-radius:14px;background:#fff;box-shadow:0 0 0 1px var(--line);overflow:hidden}
	.post-content tr:nth-child(even) td{background:none}
	.post-content td{display:grid;grid-template-columns:38% 1fr;gap:10px;padding:10px 14px;border-top:1px solid #eceee9}
	.post-content td:before{content:attr(data-label);font-size:13px;font-weight:600;color:#6b766f}
	.post-content td:first-child{display:block;border-top:0;padding:12px 14px;background:var(--brand-night)!important;color:var(--brand-paper);font-size:16px}
	.post-content td:first-child:before{display:none}
	.post-content td:not([data-label]){display:block}
	.post-content td:not([data-label]):before{display:none}
	.lg-cta{flex-direction:column;align-items:stretch;gap:18px;padding:22px 20px}
	.lg-cta__actions{justify-items:stretch;max-width:none}
	.lg-cta__actions .btn{width:100%;min-width:0}
	.lg-checklist,.lg-terms,.lg-branches{padding:20px 18px}
	.post-content .lg-terms ul{grid-template-columns:1fr}
	.post-next .link-tiles{grid-template-columns:1fr}
}
@media(prefers-reduced-motion:reduce){.blog-card,.blog-card:hover{transition:none;transform:none}}
