/* Content blocks for inner pages (Nunjucks macros: src/_includes/macros/blocks.njk).
   Built after the original roxmotor.ru blocks: header, text, media-text, flow-icon, media-accordion,
   table, accordion-tabs, text-buttons, media-content, plus request-form sections. */

:root { --card-bg: rgba(247, 249, 250, .07); --card-line: rgba(247, 249, 250, .23); }

/* ---------- Generic section spacing ---------- */
.sec { padding: 40px 0; }
.sec_tight { padding: 24px 0; }
.sec + .sec { padding-top: 0; }
.sec__title { margin-bottom: 32px; text-align: center; }
.sec__title_left { text-align: left; }
.narrow { max-width: 864px; margin-left: auto; margin-right: auto; }
@media (min-width: 960px) {
  .sec { padding: 64px 0; }
  .sec__title { margin-bottom: 48px; }
}

/* ---------- Page header (original: web_block_header) ---------- */
.phead { padding: calc(var(--header-h) + 40px) 0 40px; text-align: center; }
.phead__caption { margin-bottom: 16px; color: var(--t2); }
.phead__title { max-width: 1100px; margin: 0 auto; overflow-wrap: anywhere; }
@media (max-width: 599.98px) { .phead__title.h1 { font-size: min(40px, 10.5vw); } }
.phead__text { max-width: 760px; margin: 24px auto 0; color: var(--t1); }
.phead__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 32px; }
.phead + .sec { padding-top: 0; }
@media (min-width: 960px) {
  .phead { padding: calc(var(--header-h) + 72px) 0 64px; }
  .phead__text { margin-top: 32px; }
}

/* Breadcrumbs */
.crumbs { list-style: none; padding: 0; margin-top: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 8px; margin-bottom: 24px; font-size: 14px; color: var(--t3); }
.crumbs a { color: var(--t2); transition: color .2s; }
.crumbs a:hover { color: var(--gold); }
.crumbs li + li::before { content: "/"; margin-right: 8px; color: var(--t3); }
.crumbs_left { justify-content: flex-start; }

/* ---------- Rich text (original: web_block_text) ---------- */
.rtext { color: var(--t1); font-size: 16px; line-height: 1.5; }
.rtext > * + * { margin-top: 16px; }
.rtext h2, .rtext h3 { color: var(--white); font-family: var(--f-display); font-weight: var(--fw-thin); line-height: 1.15; }
.rtext h2 { margin-top: 40px; font-size: 28px; }
.rtext h3 { margin-top: 32px; font-size: 22px; font-weight: var(--fw-light); }
.rtext a { color: var(--white); text-decoration: underline; text-underline-offset: 3px; }
.rtext a:hover { color: var(--gold); }
.rtext strong, .rtext b { color: var(--white); }
.rtext ul, .rtext ol { padding-left: 32px; }
.rtext ul { list-style: none; }
.rtext ul li, .glist li { position: relative; }
.rtext li + li, .glist li + li { margin-top: 12px; }
.rtext ul li::before, .glist li::before { content: ""; position: absolute; left: -25px; top: .5em; width: 10px; height: 10px; border: 2px solid var(--gold); transform: translateY(-30%); }
.rtext ol { list-style: decimal; }
.rtext small, .rtext .note { display: block; font-size: 13px; line-height: 1.4; color: var(--t3); }
.glist { padding-left: 32px; }
@media (min-width: 960px) {
  .rtext { font-size: 18px; line-height: 1.45; }
  .rtext > * + * { margin-top: 20px; }
  .rtext h2 { font-size: 40px; margin-top: 56px; }
  .rtext h3 { font-size: 28px; margin-top: 40px; }
}

/* ---------- Media + text card (original: web_block_media-text) ---------- */
.mtcard { display: grid; grid-template-columns: minmax(0, 1fr); overflow: hidden; border-radius: 4px; background: var(--card-bg); }
.mtcard__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--card); }
.mtcard__media > picture, .mtcard__media > img, .macc2__media > picture, .acover__img > picture { position: absolute; inset: 0; display: block; width: 100%; height: 100%; }
.mtcard__media img { width: 100%; height: 100%; object-fit: cover; }
.mtcard__body { display: flex; flex-direction: column; justify-content: center; padding: 32px 24px; }
.mtcard__caption { margin-bottom: 12px; color: var(--t2); }
.mtcard__title { margin-bottom: 20px; }
.mtcard__text { font-size: 16px; line-height: 1.45; color: var(--t1); }
.mtcard__text > * + * { margin-top: 12px; }
.mtcard__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
@media (min-width: 960px) {
  .mtcard { grid-template-columns: 1fr 1fr; min-height: 480px; }
  .mtcard__media { aspect-ratio: auto; min-height: 100%; }
  .mtcard_reverse .mtcard__media { order: 2; }
  .mtcard__body { padding: 48px 56px; }
  .mtcard__title { margin-bottom: 24px; }
  .mtcard__text { font-size: 18px; }
}

/* ---------- Feature cards with icons (original: web_block_flow-icon) ---------- */
.features { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.feature { display: flex; flex-direction: column; align-items: center; padding: 32px 24px; border-radius: 4px; background: var(--card-bg); text-align: center; }
.feature__icon { width: 40px; height: 40px; margin-bottom: 20px; color: var(--gold); }
.feature__icon .icon { width: 40px; height: 40px; stroke-width: 1.2; }
.feature__value { margin-bottom: 8px; color: var(--gold); }
.feature__title { margin-bottom: 12px; }
.feature__text { max-width: 320px; font-size: 14px; line-height: 1.45; color: var(--t2); }
.feature__action { margin-top: auto; padding-top: 24px; }
.features_left .feature { align-items: flex-start; text-align: left; }
@media (min-width: 600px) { .features { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .features { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 24px; }
  .feature { padding: 40px 32px; }
  .feature__text { font-size: 16px; }
}

/* ---------- Accordion (details/summary; used alone or with a picture) ---------- */
.acc__item { border-bottom: 1px solid var(--line); }
.acc__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 0; cursor: pointer; list-style: none; font-size: 16px; line-height: 1.4; transition: color .2s; }
.acc__head::-webkit-details-marker { display: none; }
.acc__head:hover { color: var(--gold); }
.acc__icon { position: relative; flex: none; width: 24px; height: 24px; }
.acc__icon::before, .acc__icon::after { content: ""; position: absolute; left: 3px; right: 3px; top: 11px; height: 2px; background: currentColor; transition: transform .3s var(--ease); }
.acc__icon::after { transform: rotate(90deg); }
.acc__item[open] .acc__icon::after { transform: rotate(0); }
.acc__body { padding: 0 0 20px; font-size: 15px; line-height: 1.5; color: var(--t1); }
.acc__body > * + * { margin-top: 12px; }
@media (min-width: 960px) {
  .acc__head { padding: 20px 0; font-size: 18px; }
  .acc__body { font-size: 16px; padding-bottom: 24px; }
}

/* Media + accordion (original: web_block_media-accordion) */
.macc2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.macc2__media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; border-radius: 4px; background: var(--card); }
.macc2__media img { width: 100%; height: 100%; object-fit: cover; }
.macc2__title { margin-bottom: 16px; }
@media (min-width: 960px) {
  .macc2 { grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
  .macc2_reverse .macc2__media { order: -1; }
  .macc2__media { aspect-ratio: 5 / 4; position: sticky; top: calc(var(--header-h) + 24px); }
}

/* ---------- Table (original: web_block_table) ---------- */
.dtable__title { margin-bottom: 24px; text-align: center; }
.dtable__wrap { overflow-x: auto; }
.dtable { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 14px; line-height: 1.4; }
.dtable th { padding: 12px 8px; border-bottom: 2px solid var(--t2); font-weight: var(--fw-medium); text-align: left; white-space: nowrap; }
.dtable td { padding: 12px 8px; border-bottom: 1px solid var(--line); color: var(--t1); }
.dtable th:not(:first-child), .dtable td:not(:first-child) { text-align: right; }
.dtable td:last-child { color: var(--white); font-weight: var(--fw-medium); }
.dtable__note { margin-top: 24px; font-size: 13px; line-height: 1.45; color: var(--t3); }
.dtable__note p + p { margin-top: 8px; }
@media (min-width: 960px) { .dtable { font-size: 16px; } }

/* ---------- Tabs (original: web_block_accordion-tabs) ---------- */
.tabs__list { display: flex; justify-content: center; gap: 32px; margin-bottom: 32px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs__list::-webkit-scrollbar { display: none; }
.tabs__tab { position: relative; flex: none; padding: 12px 0; font-size: 16px; color: var(--t2); transition: color .2s; }
.tabs__tab::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: var(--gold); transform: scaleX(0); transition: transform .25s var(--ease); }
.tabs__tab[aria-selected="true"] { color: var(--white); }
.tabs__tab[aria-selected="true"]::after { transform: scaleX(1); }
.tabs__tab:hover { color: var(--white); }
.tabs__panel[hidden] { display: none; }
@media (min-width: 960px) { .tabs__tab { font-size: 18px; } }

/* ---------- Document links (original: web_block_text-buttons) ---------- */
.docs { display: grid; gap: 48px; }
.doc { text-align: center; }
.doc__title { margin-bottom: 24px; }
.doc__link { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 4px; background: var(--card-bg); font-size: 12px; font-weight: var(--fw-medium); letter-spacing: 1px; text-transform: uppercase; text-align: left; transition: background-color .2s, color .2s; }
.doc__link .icon { flex: none; width: 20px; height: 20px; }
.doc__link:hover { background: rgba(213, 185, 112, .16); color: var(--gold); }
@media (min-width: 960px) { .docs { gap: 64px; } .doc__link { font-size: 14px; letter-spacing: 1.2px; } }

/* ---------- Article cover (original: web_block_media-content) ---------- */
.acover { padding: calc(var(--header-h) + 24px) 0 0; text-align: center; }
.acover__img { position: relative; max-width: 720px; margin: 0 auto; aspect-ratio: 3 / 2; overflow: hidden; background: var(--card); }
.acover__img img { width: 100%; height: 100%; object-fit: cover; }
.acover__meta { margin-top: 32px; color: var(--t3); }
.acover__title { max-width: 1000px; margin: 12px auto 0; }
@media (min-width: 960px) { .acover { padding-top: calc(var(--header-h) + 48px); } .acover__meta { margin-top: 48px; } }

/* ---------- Small print (original: web_block_text-disclaimer) ---------- */
.fineprint { font-size: 12px; line-height: 1.45; color: var(--t3); }
.fineprint p + p { margin-top: 8px; }
@media (min-width: 960px) { .fineprint { font-size: 14px; } }

/* ---------- Request-form section (original: web_block_widget_forms) ---------- */
.leadsec__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.leadsec__caption { margin-bottom: 24px; color: var(--t3); }
.leadsec__text { margin-top: 24px; font-size: 16px; line-height: 1.45; color: var(--t2); }
.leadsec__text > * + * { margin-top: 12px; }
.leadsec__note { margin-top: 24px; font-size: 12px; color: var(--t3); }
@media (min-width: 960px) {
  .leadsec__grid { grid-template-columns: 48% 40%; justify-content: space-between; gap: 0; }
  .leadsec__text { margin-top: 36px; font-size: 20px; line-height: 1.3; }
}

/* Boxed form fields (page forms) — same look as the test-drive form on the model pages */
.lead-form .form { gap: 20px; }
.form__fields { display: grid; gap: 20px; }
.form__hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; }
.form__status { font-size: 14px; color: var(--t2); }
.form__status.is-error { color: #ff7b7b; }
.form.is-busy .form__submit { opacity: .7; cursor: progress; }
.lead-form.is-done > .h3, .lead-form.is-done > .modal__lead, .lead-form.is-done > .lead-form__lead { display: none; }
.lead-form__title { margin-bottom: 12px; }
.lead-form__lead { margin-bottom: 24px; }
.field__chevron.icon { position: absolute; right: 0; top: 16px; pointer-events: none; color: var(--t2); }
.field__input_area { height: auto; min-height: 96px; padding-top: 22px; resize: vertical; line-height: 1.4; }
input[type="date"].field__input { color-scheme: dark; }
.field_select .field__input { padding-right: 32px; cursor: pointer; }
.field_select .field__label { transform: translateY(-16px); font-size: 12px; color: var(--t2); }

.form_boxed .field__input,
.leadsec .field__input {
  height: 48px;
  padding: 12px 16px;
  border: 1px solid var(--card-line);
  border-radius: 4px;
  background: var(--card-bg);
  font-size: 16px;
  line-height: 22px;
  transition: border-color .2s;
}
.leadsec .field__input:hover { border-color: rgba(247, 249, 250, .43); }
.leadsec .field__input:focus { border-color: var(--gold); }
.leadsec .field__input_area { height: auto; min-height: 112px; }
.leadsec .field__label { left: 17px; top: 13px; right: 48px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--t2); transform: none !important; font-size: 16px !important; line-height: 22px; transition: opacity .15s; }
.leadsec input.field__input:not(:placeholder-shown) + .field__label,
.leadsec textarea.field__input:not(:placeholder-shown) + .field__label,
.leadsec .field.has-value .field__label { opacity: 0; }
.leadsec input.field__input:focus + .field__label, .leadsec textarea.field__input:focus + .field__label { opacity: .5; }
.leadsec input.field__input:not(:placeholder-shown):focus + .field__label { opacity: 0; }
/* date: the browser shows its own dd.mm.yyyy mask, so the label sits above the box */
.leadsec .field_date { display: flex; flex-direction: column; }
.leadsec .field_date .field__label { position: static; order: -1; margin-bottom: 6px; font-size: 12px !important; line-height: 1.3; opacity: 1 !important; }
.leadsec .field__chevron.icon { right: 12px; top: 12px; color: var(--white); }
.leadsec .field__error { margin-top: 6px; }
.leadsec .check { align-items: center; gap: 16px; font-size: 12px; }
.leadsec .check input { width: 28px; height: 28px; margin: 0; border: 1px solid var(--card-line); border-radius: 4px; background: var(--card-bg); appearance: none; -webkit-appearance: none; cursor: pointer; display: grid; place-content: center; }
.leadsec .check input::after { content: ""; width: 14px; height: 8px; border-left: 2px solid var(--gold); border-bottom: 2px solid var(--gold); transform: rotate(-45deg) translate(1px, -2px); opacity: 0; transition: opacity .15s; }
.leadsec .check input:checked::after { opacity: 1; }
.leadsec .check a { color: var(--white); text-decoration: underline; text-underline-offset: 2px; }
.leadsec .check a:hover { color: var(--gold); }
.leadsec .check.is-invalid input { border-color: #e5484d; }
.leadsec .form__submit { min-height: 66px; padding: 27px 36px; }
.leadsec .form-success { padding: 40px 24px; border: 1px solid var(--line); border-radius: 4px; background: var(--card-bg); text-align: center; }
@media (min-width: 600px) {
  .leadsec .form__fields { grid-template-columns: 1fr 1fr; }
  .leadsec .field_wide, .leadsec .field:has(.field__input_area) { grid-column: 1 / -1; }
}
@media (max-width: 599.98px) { .leadsec .form__submit { width: 100%; } }

/* Modal forms: two columns of fields on wider screens are not needed; keep them stacked */
.lead-form_modal .form__fields { gap: 16px; }

/* ---------- Stub / 404 ---------- */
.stub__title { margin-top: 12px; }
.stub__actions .btn_solid { border-color: var(--gold); }

/* ---------- Page first screen and shared bits (finance, owner pages) ---------- */
/* Full-width first screen under the solid header (original: web_block_media-brand at the top of a page) */
.media-brand_top { margin-top: var(--header-h); }
.media-brand__actions { display: flex; flex-wrap: wrap; gap: 16px; }
.media-brand__actions .btn { margin-top: 24px; }
.media-brand_top .media-brand__title { margin-top: 0; }
@media (min-width: 960px) {
  .media-brand_top { min-height: calc(100vh - var(--header-h)); min-height: calc(100svh - var(--header-h)); }
  .media-brand_top .media-brand__inner { max-width: calc((100% + var(--gutter)) / 12 * 6 - var(--gutter)); }
  .media-brand__actions .btn { margin-top: 36px; }
}
@media (max-width: 959.98px) { .media-brand__actions .btn { width: 100%; } }

/* the <picture> wrapper must fill the image box, otherwise wide crops leave an empty band */
.media-brand__img > picture, .media-half__img > picture { display: block; width: 100%; height: 100%; }
.media-half__text { margin-top: 8px; color: var(--t1); }
@media (min-width: 960px) {
  .media-half__text { max-width: 560px; margin-top: 24px; }
}

/* Feature cards: inline icons that are not in the shared sprite */
.feature__icon svg { width: 40px; height: 40px; }
@media (max-width: 599.98px) {
  /* swipe row on phones, like the original slider */
  .features_swipe { display: flex; gap: 12px; margin: 0 calc(var(--pad) * -1); padding: 0 var(--pad); overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding: 0 var(--pad); scrollbar-width: none; }
  .features_swipe::-webkit-scrollbar { display: none; }
  .features_swipe .feature { flex: 0 0 86%; scroll-snap-align: start; }
}

/* Footnotes stay readable without JavaScript (the "Развернуть" button needs main.js) */
html:not(.js) .disclaimer__text { display: block; -webkit-line-clamp: unset; }
html:not(.js) .disclaimer__btn { display: none; }

/* Centred text with buttons (original: web_block_text on offer pages) */
.ctext { max-width: 864px; margin: 0 auto; text-align: center; }
.ctext__lead { color: var(--t1); }
.ctext__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 16px; margin-top: 32px; }
@media (max-width: 599.98px) { .ctext { text-align: left; } .ctext__actions .btn { width: 100%; } }
@media (min-width: 960px) { .ctext__actions { margin-top: 44px; } }

/* ---------- Section cards (original: media-flow cards on landing pages) ---------- */
.ncards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; }
.ncards_two { max-width: 1104px; margin-left: auto; margin-right: auto; }
.ncard { display: flex; flex-direction: column; min-width: 0; }
.ncard__img { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; border-radius: 4px; background: var(--card); }
.ncard__img > picture { position: absolute; inset: 0; display: block; }
.ncard__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.ncard:hover .ncard__img img { transform: scale(1.05); }
.ncard__body { display: flex; flex: 1; flex-direction: column; padding-top: 20px; }
.ncard__title { transition: color .2s; }
.ncard:hover .ncard__title { color: var(--gold); }
.ncard__text { display: block; margin-top: 12px; font-size: 15px; line-height: 1.45; color: var(--t2); }
.ncard__more { margin-top: auto; padding-top: 16px; }
@media (min-width: 600px) { .ncards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 24px; } }
@media (min-width: 960px) {
  .ncards { grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 48px 32px; }
  .ncard__body { padding-top: 24px; }
  .ncard__text { font-size: 16px; }
}

/* ---------- Our service centre box ---------- */
.sbox { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; padding: 32px 24px; border-radius: 4px; background: var(--card-bg); }
.sbox__caption { margin-bottom: 12px; color: var(--t3); }
.sbox__text { margin-top: 16px; font-size: 16px; line-height: 1.45; color: var(--t2); }
.sbox__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 28px; }
.sbox__list { display: grid; align-content: center; gap: 20px; margin: 0; }
.sbox__row { display: flex; align-items: flex-start; gap: 16px; }
.sbox__row dt { flex: none; color: var(--gold); }
.sbox__row dd { margin: 0; font-size: 16px; line-height: 1.45; color: var(--t1); }
.sbox__row a { color: var(--white); transition: color .2s; }
.sbox__row a:hover { color: var(--gold); }
@media (max-width: 599.98px) { .sbox__actions .btn { width: 100%; } }
@media (min-width: 960px) {
  .sbox { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 64px; padding: 56px; }
  .sbox__row dd { font-size: 18px; }
}

/* Text or a link under a media accordion */
.macc2__after { margin-top: 24px; }



/* Media-text card goes edge to edge on phones, as on the original */
@media (max-width: 599.98px) {
  .bleed-m { margin-left: calc(-1 * var(--pad)); margin-right: calc(-1 * var(--pad)); }
  .bleed-m.mtcard, .bleed-m .mtcard { border-radius: 0; }
  .bleed-m .mtcard__media { aspect-ratio: 3 / 2; }
  .bleed-m .mtcard__body { padding: 32px var(--pad) 40px; }
}

/* Table that fits a phone screen without sideways scrolling: headers wrap, smaller text */
.dtable_fit .dtable { min-width: 0; }
.dtable_fit .dtable th { white-space: normal; }
@media (max-width: 599.98px) {
  .dtable_fit .dtable { font-size: 13px; }
  .dtable_fit .dtable th, .dtable_fit .dtable td { padding: 10px 4px; }
  .dtable_fit .dtable th:first-child, .dtable_fit .dtable td:first-child { padding-left: 0; }
  .dtable_fit .dtable th:last-child, .dtable_fit .dtable td:last-child { padding-right: 0; }
}

/* Centred lead text under a section title */
.sec__lead { max-width: 760px; margin: -16px auto 32px; text-align: center; font-size: 16px; line-height: 1.45; color: var(--t2); }
@media (min-width: 960px) { .sec__lead { margin: -24px auto 48px; font-size: 18px; } }
