/* Макет «Подарочная статья» (template-parts/gift-article.php), 26.10.2026.
   Родня /podarok/ (assets/podarok-hub.css): та же сетка, шрифты и палитра
   из style.css, но журнальнее — с мета-строкой, выносками и цитатами. */

.cm-ga { --g-hdr: 83px; --g-pad: clamp(18px, 4.4vw, 64px); --g-sec: clamp(60px, 7.5vw, 112px); font-variant-numeric: lining-nums; background: #fff; color: var(--cm-text); }
/* Высота шапки — как в style.css (.cm-hdr__inner + рамка 1 px): 83 px, на ≤899 px — 69 px;
   админ-бар WordPress сдвигает шапку на 32 px (на ≤782 px — на 46 px, на ≤600 px уезжает). */
@media (max-width: 899px) { .cm-ga { --g-hdr: 69px; } }
body.admin-bar .cm-ga { --g-hdr: 115px; }
@media screen and (max-width: 899px) { body.admin-bar .cm-ga { --g-hdr: 101px; } }
@media screen and (max-width: 782px) { body.admin-bar .cm-ga { --g-hdr: 115px; } }
@media screen and (max-width: 600px) { body.admin-bar .cm-ga { --g-hdr: 69px; } }
.cm-ga__wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--g-pad); }
.cm-ga__narrow { max-width: 860px; }
.cm-ga :where(section h2, section h3) { color: var(--cm-ink); text-wrap: balance; font-family: var(--cm-serif); font-weight: 600; }
.cm-ga :where(section h2) { font-size: clamp(30px, 3.4vw, 46px); line-height: 1.08; margin: 0; scroll-margin-top: calc(var(--g-hdr) + 76px); }
.cm-ga :where(section h3) { font-size: clamp(22px, 1.9vw, 26px); line-height: 1.2; margin: 34px 0 10px; }
.cm-ga p { font-size: 17px; line-height: 1.72; margin: 0 0 16px; }
.cm-ga strong { color: var(--cm-ink-soft); font-weight: 600; }
.cm-ga section a:not(.cm-btn) { color: var(--cm-ink); text-decoration: underline; text-decoration-color: var(--cm-gold-soft); text-underline-offset: 3px; text-decoration-thickness: 1px; transition: color .2s; }
.cm-ga section a:not(.cm-btn):hover { color: var(--cm-gold); }
.cm-ga .cm-btn { flex: 0 0 auto; padding: 18px 28px; border-radius: 8px; text-decoration: none; }
.cm-ga .cm-btn--dark, .cm-ga .cm-btn--dark:hover { color: #fff; }
.cm-ga .cm-btn--onDark { background: #fff; color: var(--cm-ink-soft); }
.cm-ga .cm-btn--onDark:hover { background: var(--cm-gold); color: #fff; }
.cm-ga .cm-btn--onDarkGhost { color: #fff; border: 1px solid rgba(255, 255, 255, .4); }
.cm-ga .cm-btn--onDarkGhost:hover { border-color: #fff; }

.cm-ga__num { display: inline-flex; align-items: center; font-family: var(--cm-serif); font-size: 15px; font-weight: 600; letter-spacing: .2em; color: var(--cm-gold); margin-bottom: 14px; }
.cm-ga__num::after { content: ""; width: 34px; height: 1px; background: var(--cm-gold-soft); margin-left: 12px; }
.cm-ga__centerhead .cm-ga__num::before { content: ""; width: 34px; height: 1px; background: var(--cm-gold-soft); margin-right: 12px; }

/* Обложка */
.cm-ga__hero { background: var(--cm-cream2); border-bottom: 1px solid #efe9de; }
.cm-ga__herogrid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: clamp(32px, 5vw, 80px); align-items: center; padding-top: clamp(28px, 4vw, 56px); padding-bottom: clamp(40px, 5vw, 72px); }
.cm-ga__back { display: inline-flex; align-items: center; gap: 9px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #a6a6a6; }
.cm-ga__back:hover { color: var(--cm-gold); }
.cm-ga__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin-top: clamp(26px, 3.6vw, 48px); font-size: 11.5px; letter-spacing: .14em; text-transform: uppercase; font-weight: 600; color: #a6a6a6; }
.cm-ga__cat { color: var(--cm-gold); }
.cm-ga__dot { width: 4px; height: 4px; border-radius: 50%; background: #d8d2c6; }
.cm-ga__title { margin: 18px 0 0; font-family: var(--cm-serif); font-weight: 600; font-size: clamp(36px, 3.9vw, 56px); line-height: 1.06; color: var(--cm-ink); text-wrap: balance; }
.cm-ga__lead { margin: 24px 0 0 !important; max-width: 560px; padding-left: 18px; border-left: 1px solid var(--cm-gold); font-family: var(--cm-serif); font-style: italic; font-size: clamp(20px, 1.8vw, 24px) !important; line-height: 1.4 !important; color: var(--cm-ink); }
.cm-ga__acts { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.cm-ga__herofig { margin: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 5; background: #efe9de; box-shadow: 0 30px 60px -40px rgba(60, 45, 20, .45); }
.cm-ga__herogrid--solo { grid-template-columns: minmax(0, 860px); }
.cm-ga__herofig img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Оглавление */
.cm-ga__toc { position: sticky; top: var(--g-hdr); z-index: 60; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(8px); -webkit-backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--cm-line); }
.cm-ga__toc ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cm-ga__toc ul::-webkit-scrollbar { display: none; }
.cm-ga__toc a { display: block; white-space: nowrap; padding: 17px 14px; font-size: 12px; letter-spacing: .12em; text-transform: uppercase; font-weight: 600; color: #8f887c; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.cm-ga__toc a:hover, .cm-ga__toc a.is-on { color: var(--cm-ink); border-bottom-color: var(--cm-gold); }
.cm-ga__toc li:first-child a { padding-left: 0; }
/* Десять глав «родителей» на десктопе помещаются в строку без прокрутки ленты. */
@media (min-width: 1100px) { .cm-ga__toc a { padding-left: 10px; padding-right: 10px; letter-spacing: .09em; } }

/* Вступление */
.cm-ga__intro { padding: var(--g-sec) 0 calc(var(--g-sec) * .7); text-align: center; }
.cm-ga__introlead { font-family: var(--cm-serif); font-size: clamp(25px, 2.5vw, 34px) !important; line-height: 1.32 !important; color: var(--cm-ink); margin: 0 auto 30px !important; }
.cm-ga__introlead strong { font-weight: 600; }
.cm-ga__introrest { max-width: 680px; margin: 0 auto; }
.cm-ga__introrest p { color: var(--cm-muted); }

/* Главы */
.cm-ga__sec { padding: var(--g-sec) 0; }
.cm-ga__sec--cream { background: var(--cm-cream2); border-top: 1px solid #f0ebe1; border-bottom: 1px solid #f0ebe1; }
.cm-ga__split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(32px, 6vw, 110px); align-items: start; }
.cm-ga__head { position: sticky; top: calc(var(--g-hdr) + 90px); }
.cm-ga__prose { max-width: 680px; }
.cm-ga__prose > :first-child, .cm-ga__a > :first-child { margin-top: 0; }
.cm-ga__centerhead { max-width: 780px; margin: 0 auto clamp(36px, 4.4vw, 56px); text-align: center; }
.cm-ga__centerpre { margin-top: 22px; }
.cm-ga__centerpre p { color: var(--cm-muted); }
.cm-ga__center { text-align: center; margin-top: 40px; }
.cm-ga__block { max-width: 820px; margin: clamp(36px, 4vw, 52px) auto 0; }
.cm-ga__block > h3 { text-align: center; margin-top: 0; }

/* Абзацы-исключения */
.cm-ga__pull { margin: 30px 0 !important; padding: 4px 0 4px 24px; border-left: 2px solid var(--cm-gold); font-family: var(--cm-serif); font-size: clamp(22px, 2vw, 27px) !important; line-height: 1.34 !important; color: var(--cm-ink); }
.cm-ga__pull strong { font-weight: 600; }
.cm-ga__quote { margin: 18px 0 22px; padding: 22px 26px; background: #fff; border: 1px solid #ece6db; border-radius: 12px; position: relative; }
.cm-ga__quote::before { content: "“"; position: absolute; top: -18px; left: 20px; font-family: var(--cm-serif); font-size: 64px; line-height: 1; color: var(--cm-gold); }
.cm-ga__quote p { margin: 0 !important; font-family: var(--cm-serif); font-style: italic; font-size: 20px !important; line-height: 1.45 !important; color: var(--cm-ink); }
.cm-ga__sec--cream .cm-ga__quote { background: #fff; }
.cm-ga__ctas { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0 !important; }
.cm-ga__center .cm-ga__ctas, .cm-ga__final .cm-ga__ctas, .cm-ga__block .cm-ga__ctas { justify-content: center; margin-left: auto !important; margin-right: auto !important; }
.cm-ga__checks { list-style: none; margin: 8px 0 22px; padding: 0; display: grid; gap: 2px; }
.cm-ga__checks li { position: relative; padding: 12px 0 12px 34px; border-bottom: 1px solid var(--cm-line-warm); font-size: 16.5px; line-height: 1.55; }
.cm-ga__checks li::before { content: ""; position: absolute; left: 0; top: 15px; width: 18px; height: 18px; border: 1px solid var(--cm-gold); border-radius: 50%; background: radial-gradient(circle, var(--cm-gold) 0 3px, transparent 3.5px); }
.cm-ga__steps { list-style: none; margin: 18px 0 24px; padding: 0; counter-reset: s; display: grid; gap: 0; }
.cm-ga__steps li { counter-increment: s; position: relative; padding: 0 0 24px 58px; font-size: 16px; line-height: 1.6; }
.cm-ga__steps li::before { content: counter(s, decimal-leading-zero); position: absolute; left: 0; top: -3px; font-family: var(--cm-serif); font-size: 28px; line-height: 1; font-weight: 600; color: var(--cm-gold); }
.cm-ga__steps li::after { content: ""; position: absolute; left: 16px; top: 34px; bottom: 6px; width: 1px; background: rgba(179, 151, 99, .35); }
.cm-ga__steps li:last-child::after { display: none; }
.cm-ga__steps strong { display: block; margin-bottom: 2px; }

/* Таблица */
.cm-ga__tablewrap { overflow-x: auto; margin: 14px 0 22px; }
.cm-ga__table { width: 100%; border-collapse: collapse; font-size: 16px; background: #fff; border: 1px solid #ece6db; border-radius: 12px; overflow: hidden; }
.cm-ga__table th, .cm-ga__table td { padding: 15px 18px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--cm-line-warm); }
.cm-ga__table tbody th { font-weight: 600; color: var(--cm-ink-soft); }
.cm-ga__table thead th { font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: #a49a8a; background: #faf7f0; }
.cm-ga__table tbody tr:last-child td { border-bottom: 0; }
.cm-ga__table:not(:has(tr > :nth-child(3))) td:last-child { font-family: var(--cm-serif); font-size: 20px; font-weight: 600; color: var(--cm-ink); }

/* Карточки */
.cm-ga__cards { display: grid; gap: clamp(14px, 2vw, 24px); }
.cm-ga__cards--3 { grid-template-columns: repeat(3, 1fr); }
.cm-ga__cards--2 { grid-template-columns: repeat(2, 1fr); max-width: 1040px; margin: 0 auto; }
.cm-ga__cards--1 { grid-template-columns: 1fr; max-width: 680px; margin: 0 auto; }
.cm-ga__card { background: #fff; border: 1px solid #ece6db; border-radius: 14px; padding: clamp(26px, 3vw, 38px); position: relative; overflow: hidden; }
.cm-ga__card::before { content: ""; position: absolute; left: 0; top: 0; height: 3px; width: 56px; background: var(--cm-gold); }
.cm-ga__card h3 { margin: 0 0 14px !important; font-size: 24px !important; }
.cm-ga__card p { font-size: 16px; }
.cm-ga__card p:last-child { margin-bottom: 0; }

/* Тёмная полоса */
.cm-ga__dark { background: var(--cm-ink-soft); color: #cfc8bb; padding: var(--g-sec) 0; }
.cm-ga__dark h2, .cm-ga__dark h3, .cm-ga__dark strong { color: #fff !important; }
.cm-ga__dark p, .cm-ga__dark li { color: #cfc8bb; }
.cm-ga__dark a:not(.cm-btn) { color: #fff !important; }
.cm-ga__darkgrid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.cm-ga__darkgrid--solo { grid-template-columns: minmax(0, 760px); }
.cm-ga__darkpre { margin-top: 24px; }
.cm-ga__dark .cm-ga__pull { border-left-color: var(--cm-gold); color: #fff; }
.cm-ga__darkfig { margin: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 1152 / 1086; }
.cm-ga__darkfig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-ga__darkblock { margin-top: clamp(48px, 6vw, 80px); padding-top: clamp(36px, 4vw, 52px); border-top: 1px solid rgba(255, 255, 255, .12); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 0 clamp(32px, 6vw, 110px); }
.cm-ga__darkblock > h3 { margin: 0 !important; grid-row: span 20; }
.cm-ga__darkblock > :not(h3) { grid-column: 2; }
.cm-ga__dark .cm-ga__steps li::after { background: rgba(203, 180, 140, .35); }

/* Серии */
.cm-ga__series { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(18px, 2.4vw, 32px); align-items: start; }
.cm-ga__serie { border: 1px solid #ece6db; border-radius: 18px; overflow: hidden; background: var(--cm-cream2); }
.cm-ga__serie figure { margin: 0; aspect-ratio: 16 / 11; overflow: hidden; background: #efe9de; }
.cm-ga__serie figure img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-ga__seriebody { padding: clamp(26px, 3vw, 42px); }
.cm-ga__serie h3 { margin: 0 0 18px !important; font-size: clamp(26px, 2.3vw, 31px) !important; }
.cm-ga__serie p, .cm-ga__serie li { font-size: 16px; }
.cm-ga__serie--sig { background: var(--cm-ink-soft); border-color: var(--cm-ink-soft); }
.cm-ga__serie--sig h3, .cm-ga__serie--sig strong { color: #fff !important; }
.cm-ga__serie--sig p, .cm-ga__serie--sig li { color: #cfc8bb; }
.cm-ga__serie--sig .cm-ga__checks li { border-bottom-color: rgba(255, 255, 255, .12); }
.cm-ga__serie--sig .cm-ga__checks li::before { border-color: var(--cm-gold-soft); }

/* Кадр + текст */
.cm-ga__media { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 100px); align-items: center; }
/* Длинный текст рядом с кадром: кадр держится в поле зрения, пока читается глава. */
.cm-ga__media:has(.cm-ga__prose > :nth-child(9)) { align-items: start; }
.cm-ga__media:has(.cm-ga__prose > :nth-child(9)) .cm-ga__mediafig { position: sticky; top: calc(var(--g-hdr) + 80px); }
.cm-ga__media--rev .cm-ga__mediafig { order: 2; }
.cm-ga__mediafig { margin: 0; border-radius: 16px; overflow: hidden; aspect-ratio: 4 / 5; background: #efe9de; }
.cm-ga__mediafig img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cm-ga__media h2 { margin-bottom: 24px; }

/* Вопросы */
.cm-ga__faq { border-top: 1px solid var(--cm-ink); }
.cm-ga__q { border-bottom: 1px solid var(--cm-line-warm); }
.cm-ga__q summary { cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 22px 0; font-family: var(--cm-serif); font-size: clamp(20px, 1.7vw, 23px); line-height: 1.3; font-weight: 600; color: var(--cm-ink); transition: color .2s; }
.cm-ga__q summary:hover { color: var(--cm-gold); }
.cm-ga__q summary::-webkit-details-marker { display: none; }
.cm-ga__q summary::after { content: ""; flex: 0 0 30px; height: 30px; border: 1px solid var(--cm-line-warm); border-radius: 50%; background: linear-gradient(var(--cm-gold), var(--cm-gold)) center / 11px 1px no-repeat, linear-gradient(var(--cm-gold), var(--cm-gold)) center / 1px 11px no-repeat; transition: transform .3s; }
.cm-ga__q[open] summary::after { transform: rotate(45deg); }
.cm-ga__a { padding: 0 0 22px; max-width: 640px; }
.cm-ga__a p { font-size: 16px; color: var(--cm-muted); margin-bottom: 10px; }

/* Финал */
.cm-ga__final { padding: var(--g-sec) 0; text-align: center; background: var(--cm-cream2); border-top: 1px solid #f0ebe1; }
.cm-ga__final h2 { margin-bottom: 28px !important; }
.cm-ga__final p { color: var(--cm-muted); max-width: 680px; margin-left: auto; margin-right: auto; }
.cm-ga__final .cm-ga__pull { border: 0; padding: 0; margin: 34px auto !important; font-style: italic; font-size: clamp(24px, 2.4vw, 32px) !important; }
.cm-ga__final .cm-ga__pull::before { content: ""; display: block; width: 1px; height: 40px; background: var(--cm-gold); margin: 0 auto 24px; }
.cm-ga__final .cm-ga__pull strong { font-weight: 500; }
.cm-ga__final em { color: var(--cm-ink); }

.cm-ga__share { margin-top: clamp(40px, 5vw, 64px); }
.cm-ga .cm-single__related { padding-bottom: 90px; }
.cm-ga__relgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cm-ga__fallback { padding: 48px var(--g-pad); }

@media (max-width: 960px) {
	.cm-ga__herogrid { grid-template-columns: 1fr; padding-top: 0; }
	.cm-ga__herofig { order: -1; aspect-ratio: 4 / 3; margin: 0 calc(var(--g-pad) * -1); border-radius: 0; box-shadow: none; }
	.cm-ga__back { margin-top: 18px; }
	.cm-ga__split, .cm-ga__media, .cm-ga__darkgrid, .cm-ga__darkblock { grid-template-columns: 1fr; }
	.cm-ga__darkblock > h3 { grid-row: auto; margin-bottom: 18px !important; }
	.cm-ga__darkblock > :not(h3) { grid-column: 1; }
	.cm-ga__head { position: static; }
	.cm-ga__media--rev .cm-ga__mediafig { order: 0; }
	.cm-ga__mediafig { aspect-ratio: 4 / 3; position: static !important; }
	.cm-ga__cards--3 { grid-template-columns: 1fr 1fr; }
	.cm-ga__relgrid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
}
@media (max-width: 720px) {
	.cm-ga p { font-size: 16px; }
	.cm-ga__cards--3, .cm-ga__cards--2, .cm-ga__series { grid-template-columns: 1fr; }
	.cm-ga__acts .cm-btn, .cm-ga__ctas .cm-btn { width: 100%; text-align: center; }
	.cm-ga__toc a { padding: 15px 11px; font-size: 11px; }
	.cm-ga__quote { padding: 20px; }
	.cm-ga__centerpre, .cm-ga__introrest { text-align: left; }
	.cm-ga__table th, .cm-ga__table td { padding: 12px 12px; }
	.cm-ga__table:not(:has(tr > :nth-child(3))) td:last-child { font-size: 18px; }
	.cm-ga__table { font-size: 14px; }
}

/* Горизонтальный кадр 3:2 — рамка под его пропорцию, а не под портретную.
   Стоит после медиазапросов, чтобы перекрыть и мобильные 4:3. */
.cm-ga__fig--wide { aspect-ratio: 3 / 2; }
/* Кадр полосой над карточками главы. */
.cm-ga__bandfig { margin: 0 auto clamp(36px, 4vw, 56px); max-width: 880px; aspect-ratio: 3 / 2; border-radius: 16px; overflow: hidden; background: #efe9de; }
.cm-ga__bandfig img { width: 100%; height: 100%; object-fit: cover; display: block; }
