/* ============================================================
   ДА, МИНСК! — Шаблон статьи. Скоуп .ym-article
   Светлая + тёмная палитра. Не конфликтует с .ym-home и темой.
   ============================================================ */

/* СБРОС зажима ширины блочной темы (theme.json content-size ~680px).
   Действует даже если страницу рисует тема, а не наш шаблон:
   снимаем max-width с любого родителя/обёртки вокруг .ym-article. */
.wp-block-post-content:has(.ym-article),
.entry-content:has(.ym-article),
.is-layout-constrained:has(> .ym-article),
.wp-site-blocks:has(.ym-article){
	max-width:none !important;
	width:auto !important;
}
.ym-article{
	max-width:none !important;
	width:auto !important;
	margin-left:0 !important;
	margin-right:0 !important;
}
/* у layout-constrained тема режет всех прямых детей — снимаем для hero/тела */
.is-layout-constrained > .ym-article,
.entry-content > .ym-article,
.wp-block-post-content > .ym-article{
	max-width:none !important;
}
/* ТЕЛО статьи возвращаем в читаемую колонку (как было ~760px) */
.ym-article .ym-body{
	max-width:none !important;
	width:auto !important;
}
.ym-article .ym-body > *,
body.ymart-single .ym-article .ym-body > *{
	max-width:760px !important;
	margin-left:auto !important;
	margin-right:auto !important;
	padding-left:22px !important;
	padding-right:22px !important;
	box-sizing:border-box;
}

.ym-article{
  --ink:#1d1714;--ink-soft:#544a42;--cream:#f3e9d8;--paper:#fbf6ec;
  --sage:#7f8f6e;--sage-deep:#566049;--terra:#cf6a36;--terra-deep:#a8511f;
  --plum:#5a2a44;--rye:#c9a24b;--line:rgba(29,23,20,.12);
  --shadow:0 22px 60px -22px rgba(29,23,20,.4);
  --card:#fff;--code-bg:#f4ece0;
  font-family:'Manrope',sans-serif;color:var(--ink);background:var(--paper);
  line-height:1.75;font-size:19px;-webkit-font-smoothing:antialiased;
  transition:background .35s ease,color .35s ease;
}
/* --- ТЁМНАЯ ТЕМА: не инверсия, а тёплый dark-набор токенов --- */
.ym-article.dark{
  --ink:#f3e9d8;--ink-soft:#c4b6a4;--cream:#2a2018;--paper:#1a1411;
  --line:rgba(243,233,216,.14);--card:#241c16;--code-bg:#241c16;
  --shadow:0 22px 60px -22px rgba(0,0,0,.7);
  /* акценты остаются брендовыми, чуть ярче для контраста на тёмном */
  --terra:#e07a44;--terra-deep:#e8895a;--rye:#d8b45e;--plum:#8a4a68;
}
.ym-article *{margin:0;padding:0;box-sizing:border-box}
.ym-article h1,.ym-article h2,.ym-article h3,.ym-article h4{
  font-family:'Unbounded',sans-serif;font-weight:700;line-height:1.12;letter-spacing:-.02em;color:var(--ink)
}
.ym-article img{display:block;max-width:100%}
.ym-article a{color:var(--terra-deep);text-decoration:none;border-bottom:1.5px solid rgba(207,106,54,.35);transition:border-color .2s,color .2s}
.ym-article a:hover{border-color:var(--terra)}
.ym-article .ym-wrap{max-width:760px;margin:0 auto;padding:0 22px}

/* ===================== HERO ШАПКА ===================== */
.ym-article .ym-hero{position:relative;padding:64px 0 40px}
.ym-article .ym-hero .ym-wrap{max-width:1180px;margin:0 auto;position:relative;padding:0 22px}
.ym-article .ym-hero-grid{display:grid;grid-template-columns:1.1fr .9fr;gap:48px;align-items:center}

/* переключатель темы — абсолютом в правом верхнем углу, на линии рубрики */
.ym-article .ym-theme-top{position:absolute;top:14px;right:22px;z-index:5;display:flex;align-items:center;gap:8px}
.ym-article .ym-theme-top .ym-theme-cta{font-size:.72rem;font-weight:700;color:var(--ink-soft);white-space:nowrap}
.ym-article .ym-theme{width:54px;height:30px;border-radius:30px;border:1px solid var(--line);
  background:var(--card);position:relative;cursor:pointer;transition:background .3s;padding:0;flex:none}
.ym-article .ym-theme .knob{position:absolute;top:3px;left:3px;width:22px;height:22px;border-radius:50%;
  background:var(--rye);display:flex;align-items:center;justify-content:center;font-size:12px;transition:transform .3s ease,background .3s}
.ym-article.dark .ym-theme .knob{transform:translateX(24px);background:var(--plum)}

.ym-article .ym-cat{display:inline-flex;align-items:center;gap:8px;background:var(--rye);color:#1d1714;
  font-size:.74rem;font-weight:800;letter-spacing:.06em;text-transform:uppercase;padding:6px 14px;border-radius:30px;margin-bottom:18px}
.ym-article h1.ym-title{font-size:clamp(1.9rem,4vw,2.9rem);margin-bottom:18px}
.ym-article .ym-summary{font-family:'Fraunces',serif;font-size:1.18rem;line-height:1.5;color:var(--ink-soft);
  font-style:italic;border-left:3px solid var(--terra);padding-left:18px;margin-bottom:24px}

/* наклонное фото с обводкой — стиль главной */
.ym-article .ym-hero-art{position:relative;height:440px}
.ym-article .ym-hero-art .ph{position:absolute;inset:0;border-radius:20px;overflow:hidden;
  box-shadow:var(--shadow);border:6px solid var(--paper);transform:rotate(2.5deg);transition:border-color .35s}
.ym-article.dark .ym-hero-art .ph{border-color:var(--card)}
.ym-article .ym-hero-art .ph img{width:100%;height:100%;object-fit:cover}
.ym-article .ym-hero-art .stamp{position:absolute;z-index:4;bottom:-14px;left:-14px;width:96px;height:96px;
  background:var(--terra);color:#fff;border-radius:50%;display:flex;flex-direction:column;align-items:center;justify-content:center;
  text-align:center;transform:rotate(-9deg);box-shadow:var(--shadow);font-weight:800;font-size:.64rem;line-height:1.25;letter-spacing:.03em}
.ym-article .ym-hero-art .stamp b{font-family:'Unbounded';font-size:1.3rem;display:block}

/* мета-строка: автор + действия */
.ym-article .ym-meta{display:flex;flex-direction:column;align-items:flex-start;gap:18px;margin-top:8px}
.ym-article .ym-author{display:flex;align-items:center;gap:12px}
.ym-article .ym-author img{width:46px;height:46px;border-radius:50%;object-fit:cover;flex:none;
  border:2px solid var(--paper);box-shadow:0 4px 12px -4px rgba(29,23,20,.4)}
.ym-article.dark .ym-author img{border-color:var(--card)}
.ym-article .ym-author .au-tx{min-width:0}
.ym-article .ym-author .au-tx b{display:block;font-family:'Unbounded';font-size:.95rem;font-weight:700;line-height:1.15}
.ym-article .ym-author .au-tx span{display:block;font-size:.8rem;color:var(--ink-soft);line-height:1.3;margin-top:1px}

/* действия: единый action-бар (лайк с призывом + шеринг на одной плашке) */
.ym-article .ym-act{display:inline-flex;width:fit-content;align-self:flex-start;align-items:stretch;gap:4px;background:var(--card);
  border:1px solid var(--line);border-radius:40px;padding:7px;box-shadow:0 10px 30px -18px rgba(29,23,20,.55)}
/* в футере центрируем плашку */
.ym-article .ym-foot .ym-act{align-self:center}
.ym-article .ym-like{display:inline-flex;align-items:center;gap:11px;height:50px;background:transparent;border:0;
  border-radius:32px;padding:0 12px 0 8px;cursor:pointer;color:var(--ink);transition:background .2s}
.ym-article .ym-like:hover{background:rgba(207,106,54,.08)}
.ym-article .ym-like .ym-draniki{width:38px;height:38px;flex:none;border-radius:50%;background:rgba(201,162,75,.18);
  display:flex;align-items:center;justify-content:center;font-size:1.25rem;line-height:1;transition:transform .3s,background .2s}
.ym-article .ym-like .ym-like-tx{display:flex;flex-direction:column;align-items:flex-start;line-height:1.12}
.ym-article .ym-like .ym-like-cta{font-size:.92rem;font-weight:800;color:var(--terra-deep);white-space:nowrap}
.ym-article .ym-like .ym-likes-n{font-size:.76rem;font-weight:700;color:var(--ink-soft);font-variant-numeric:tabular-nums}
.ym-article.dark .ym-like .ym-like-cta{color:var(--rye)}
.ym-article .ym-like.liked .ym-draniki{background:rgba(207,106,54,.25);transform:scale(1.08) rotate(-8deg)}
@keyframes ym-pop{0%{transform:scale(1)}40%{transform:scale(1.4) rotate(-12deg)}100%{transform:scale(1.08) rotate(-8deg)}}
.ym-article .ym-like.just .ym-draniki{animation:ym-pop .45s ease}

.ym-article .ym-act-div{width:1px;background:var(--line);margin:9px 2px;flex:none}

.ym-article .ym-share-wrap{position:relative;flex:none;display:flex}
.ym-article .ym-share-btn{display:inline-flex;align-items:center;justify-content:center;width:50px;height:50px;
  border-radius:32px;background:transparent;border:0;cursor:pointer;transition:background .2s}
.ym-article .ym-share-btn:hover{background:rgba(207,106,54,.08)}
.ym-article .ym-share-btn svg{width:20px;height:20px;fill:var(--ink)}
.ym-article .ym-share-menu{position:absolute;left:0;top:60px;background:var(--card);border:1px solid var(--line);
  border-radius:16px;box-shadow:var(--shadow);padding:8px;display:none;flex-direction:column;gap:2px;min-width:200px;z-index:30}
.ym-article .ym-share-menu.open{display:flex}
.ym-article .ym-share-menu a,.ym-article .ym-share-menu button{display:flex;align-items:center;gap:11px;padding:10px 12px;
  border-radius:10px;border:0;background:none;cursor:pointer;font:inherit;font-size:.9rem;font-weight:600;color:var(--ink);text-align:left;width:100%;transition:background .15s}
.ym-article .ym-share-menu a:hover,.ym-article .ym-share-menu button:hover{background:rgba(207,106,54,.1)}
.ym-article .ym-share-menu svg{width:18px;height:18px;fill:var(--ink-soft);flex:none}
/* футер-вариант: меню открывается вверх, чтобы не уезжало за низ */
.ym-article .ym-act-foot .ym-share-menu{top:auto;bottom:60px}

/* дата — мелкая тихая подпись под фото, справа */
.ym-article .ym-hero-art .ym-date{position:absolute;bottom:-26px;right:6px;font-size:.74rem;
  color:var(--ink-soft);opacity:.7;margin:0;font-style:italic;font-family:'Fraunces',serif}

/* обложка тела — шире колонки контента */
.ym-article .ym-cover{max-width:1080px;margin:0 auto;padding:0 22px}
.ym-article .ym-cover img{width:100%;border-radius:22px;aspect-ratio:16/9;object-fit:cover;box-shadow:var(--shadow)}

/* ===================== ТЕЛО СТАТЬИ ===================== */
.ym-article .ym-body{padding:10px 0 60px}
/* первая картинка/figure в теле — шире колонки текста (выходит за 760px) */
.ym-article .ym-body>figure:first-child,
.ym-article .ym-body>figure.alignwide,
.ym-article .ym-body>.wp-block-image:first-child{max-width:980px;padding-left:22px;padding-right:22px}
.ym-article .ym-body>*{max-width:760px;margin-left:auto;margin-right:auto;padding-left:22px;padding-right:22px}
.ym-article .ym-body>figure:first-child{margin-top:0;margin-bottom:2.4rem}
.ym-article .ym-body p{margin-bottom:1.5rem;font-size:1.12rem}
.ym-article .ym-body h2{font-size:clamp(1.5rem,3vw,2rem);margin:2.6rem auto 1rem}
.ym-article .ym-body h3{font-size:1.3rem;margin:2rem auto .8rem}
.ym-article .ym-body ul,.ym-article .ym-body ol{margin:0 auto 1.5rem;padding-left:46px}
.ym-article .ym-body li{margin-bottom:.6rem;font-size:1.1rem}
.ym-article .ym-body ul li::marker{color:var(--terra)}
.ym-article .ym-body blockquote{font-family:'Fraunces',serif;font-style:italic;font-size:1.4rem;line-height:1.45;
  color:var(--plum);border-left:4px solid var(--rye);padding:6px 0 6px 26px;margin:2.2rem auto}
.ym-article.dark .ym-body blockquote{color:var(--rye)}
.ym-article .ym-body figure{margin:2.4rem auto}
.ym-article .ym-body figure img{border-radius:18px;box-shadow:var(--shadow)}
.ym-article .ym-body figcaption{text-align:center;font-family:'Fraunces',serif;font-style:italic;font-size:.92rem;color:var(--ink-soft);margin-top:10px}
.ym-article .ym-body code{font-family:ui-monospace,'SF Mono',Menlo,monospace;background:var(--code-bg);
  padding:2px 7px;border-radius:6px;font-size:.92em}
.ym-article .ym-body pre{background:var(--code-bg);border:1px solid var(--line);border-radius:14px;padding:18px 20px;overflow:auto;margin:2rem auto}
.ym-article .ym-body pre code{background:none;padding:0}
.ym-article .ym-body hr{border:0;height:1px;background:var(--line);margin:2.6rem auto;max-width:120px}
.ym-article .ym-body img{border-radius:18px}

/* читательский прогресс-бар (growth: дочитываемость) */
.ym-article .ym-progress{position:fixed;top:0;left:0;height:3px;width:0;background:var(--terra);z-index:90;transition:width .1s linear}

/* ===================== ГРОУСХАК-ВРЕЗКИ (block patterns) ===================== */
/* Совет от местного (TERRA) */
.ym-article .ym-callout{max-width:760px;margin:2.4rem auto;padding:22px 24px;border-radius:18px;
  background:linear-gradient(135deg,rgba(207,106,54,.12),rgba(201,162,75,.1));border:1px solid rgba(207,106,54,.25);position:relative}
.ym-article .ym-callout .ym-co-label{display:inline-flex;align-items:center;gap:7px;font-family:'Unbounded';
  font-size:.72rem;font-weight:800;letter-spacing:.08em;text-transform:uppercase;color:var(--terra-deep);margin-bottom:10px}
.ym-article .ym-callout p{margin:0;font-size:1.05rem}
.ym-article .ym-callout p+p{margin-top:.8rem}

/* Ключевой вывод / TL;DR (PLUM) */
.ym-article .ym-key{max-width:760px;margin:2.4rem auto;padding:24px 26px;border-radius:18px;background:var(--plum);color:#fff}
.ym-article .ym-key .ym-co-label{color:var(--rye);display:block;font-family:'Unbounded';font-size:.72rem;
  font-weight:800;letter-spacing:.08em;text-transform:uppercase;margin-bottom:10px}
.ym-article .ym-key p,.ym-article .ym-key li{color:rgba(255,255,255,.92);font-size:1.05rem}
.ym-article .ym-key ul{margin:0;padding-left:22px}

/* CTA на квартиру (конверсия) */
.ym-article .ym-cta{max-width:760px;margin:3rem auto;padding:30px 28px;border-radius:22px;background:var(--ink);
  color:var(--cream);display:flex;gap:22px;align-items:center;flex-wrap:wrap;box-shadow:var(--shadow)}
.ym-article.dark .ym-cta{background:#000;border:1px solid var(--line)}
.ym-article .ym-cta .ym-cta-tx{flex:1;min-width:240px}
.ym-article .ym-cta h4{font-family:'Unbounded';color:var(--cream);font-size:1.25rem;margin-bottom:8px}
.ym-article .ym-cta p{color:rgba(243,233,216,.78);font-size:1rem;margin:0}
.ym-article .ym-cta .ym-cta-btn{background:var(--terra);color:#fff;padding:15px 28px;border-radius:40px;
  font-weight:800;border:0;white-space:nowrap;box-shadow:0 14px 30px -12px rgba(207,106,54,.7);transition:transform .2s}
.ym-article .ym-cta .ym-cta-btn:hover{transform:translateY(-2px)}

/* FAQ-аккордеон (featured snippets / SEO) */
.ym-article .ym-faq{max-width:760px;margin:2.4rem auto}
.ym-article .ym-faq details{border:1px solid var(--line);border-radius:14px;padding:0;margin-bottom:12px;background:var(--card);overflow:hidden}
.ym-article .ym-faq summary{list-style:none;cursor:pointer;padding:18px 22px;font-family:'Unbounded';
  font-weight:600;font-size:1.05rem;display:flex;justify-content:space-between;align-items:center;gap:14px}
.ym-article .ym-faq summary::-webkit-details-marker{display:none}
.ym-article .ym-faq summary::after{content:"+";font-size:1.5rem;color:var(--terra);transition:transform .25s;flex:none}
.ym-article .ym-faq details[open] summary::after{transform:rotate(45deg)}
.ym-article .ym-faq details p{padding:0 22px 20px;margin:0;color:var(--ink-soft);font-size:1.02rem}

/* подвал статьи: повтор лайка + автор */
.ym-article .ym-foot{max-width:760px;margin:0 auto;padding:34px 22px 60px;border-top:1px solid var(--line);text-align:center}
.ym-article .ym-foot .ym-foot-q{font-family:'Fraunces',serif;font-style:italic;font-size:1.15rem;color:var(--ink-soft);margin-bottom:18px}

@media(max-width:840px){
  .ym-article{font-size:18px}
  .ym-article .ym-body p,.ym-article .ym-body li{font-size:1.06rem}
  /* hero: одна колонка, фото сверху компактно, отступы как у контента */
  .ym-article .ym-hero{padding:46px 0 30px}
  .ym-article .ym-hero .ym-wrap{max-width:none;padding:0 22px}
  .ym-article .ym-theme-top{top:-2px;right:22px}
  .ym-article .ym-theme-top .ym-theme-cta{display:none}
  .ym-article .ym-hero-grid{grid-template-columns:1fr;gap:30px}
  .ym-article .ym-hero-art{height:230px;order:-1;margin-bottom:18px}
  .ym-article .ym-hero-art .ph{transform:rotate(1.5deg)}
  .ym-article .ym-hero-art .stamp{width:72px;height:72px;font-size:.55rem;bottom:-10px;left:-10px}
  .ym-article .ym-hero-art .stamp b{font-size:1rem}
  .ym-article .ym-hero-art .ym-date{bottom:-22px;right:2px}
  .ym-article h1.ym-title{font-size:1.7rem;margin-bottom:12px}
  .ym-article .ym-summary{font-size:1.04rem;margin-bottom:16px}
  .ym-article .ym-cat{margin-bottom:12px}
  .ym-article .ym-meta{gap:16px}
  .ym-article .ym-author .au-tx span{font-size:.78rem}
  .ym-article .ym-share-menu{left:0;right:auto}
  .ym-article .ym-body>figure:first-child,
  .ym-article .ym-body>.wp-block-image:first-child{max-width:100%}
}
