/* SOFANY — /catalog/chesterfield/ в стиле .ui-* (css/sf-ui.css). Макет design-mockups/chesterfield-mock.html,
   «да, верстай» владельца 01.10.2026. Собирается tools/build-chesterfield-page.py. Всё под main.cfx. */

/* первый экран */
.cfx .cf-hero { min-height: min(80vh, 760px); }
.cfx .cf-stats { display: flex; flex-wrap: wrap; gap: 20px 44px; margin-top: 34px; }
.cfx .cf-stats b { display: block; font-family: 'Unbounded', sans-serif; font-weight: 200; font-size: 34px; color: #F5ECE2; line-height: 1; }
.cfx .cf-stats span { display: block; margin-top: 8px; font-size: 12px; color: #A08E7C; }

/* типы */
#models { scroll-margin-top: 90px; }
.cfx .cf-types { display: flex; flex-wrap: wrap; gap: 10px; }
.cfx .cf-type { display: flex; align-items: center; gap: 12px; padding: 7px 18px 7px 7px; border-radius: 999px; border: 1px solid var(--ui-line);
  background: var(--ui-card); font: 400 14px 'Onest', system-ui, sans-serif; color: var(--ui-nav); cursor: pointer; transition: border-color .15s, background .15s; }
.cfx .cf-type:hover { border-color: rgba(200,118,60,.5); }
.cfx .cf-type svg { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--ui-field); color: var(--ui-accent); flex: none; transition: background .15s, color .15s; }
.cfx .cf-type small { font-size: 12px; color: var(--ui-muted); }
.cfx .cf-type[aria-pressed="true"] { border-color: var(--ui-accent); background: rgba(200,118,60,.12); color: var(--ui-strong); }
.cfx .cf-type[aria-pressed="true"] svg { background: var(--ui-accent); color: #fff; }

/* мозаика карточек: две большие, дальше по четыре */
.cfx .cf-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.cfx .cf-card { position: relative; display: block; aspect-ratio: 4 / 3.75; border-radius: 22px; overflow: hidden; background: #1A120D; isolation: isolate; }
.cfx .cf-grid:not(.is-filtered) .cf-card.is-big { grid-column: span 2; aspect-ratio: 16 / 10.2; }
.cfx .cf-card[hidden] { display: none; }
.cfx .cf-grid.is-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }   /* /catalog/children/: три модели в ряд */
.cfx .cf-grid:not(.is-filtered) .cf-card.is-wide { grid-column: 1 / -1; aspect-ratio: 21 / 8; }   /* последняя одиночная — во всю ширину (/catalog/sofas/) */
.cfx .cf-grid:not(.is-filtered) .cf-card.is-wide .ui-card-t b { font-size: 28px; }
.cfx .cf-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: opacity .45s ease, transform .6s ease; }
.cfx .cf-card img + img { opacity: 0; }
.cfx .cf-card::after { content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(15,10,8,0) 48%, rgba(15,10,8,.6) 72%, rgba(15,10,8,.92) 100%); }
@media (hover: hover) {
  .cfx .cf-card:hover img + img { opacity: 1; }
  .cfx .cf-card:hover img:first-of-type:not(:last-of-type) { opacity: 0; }
  .cfx .cf-card:hover > i { background: var(--ui-accent); border-color: var(--ui-accent); }
}
.cfx .cf-card .ui-card-t { left: 22px; right: 70px; bottom: 20px; }
.cfx .cf-card .ui-card-t small { font-size: 12px; }
.cfx .cf-card .ui-card-t b { font-size: 18px; }
.cfx .cf-grid:not(.is-filtered) .cf-card.is-big .ui-card-t b { font-size: 28px; }
.cfx .cf-card .ui-card-t em { white-space: nowrap; font-style: normal; color: #F4D27A; font-size: 15px; }
.cfx .cf-card > i { position: absolute; right: 20px; bottom: 20px; width: 40px; height: 40px; border-radius: 50%; border: 1px solid rgba(245,236,226,.45);
  display: flex; align-items: center; justify-content: center; color: #F5ECE2; font-style: normal; transition: background .2s, border-color .2s; }
.cfx .cf-ser { position: absolute; top: 16px; left: 16px; padding: 6px 12px; border-radius: 999px; background: rgba(15,10,8,.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #F5ECE2; font: 400 12px 'Onest', system-ui, sans-serif; letter-spacing: .04em; }

/* что внутри */
.cfx .cf-anat { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: stretch; }
.cfx .cf-anat-ph { position: relative; margin: 0; border-radius: 24px; overflow: hidden; min-height: 560px; background: #1A120D; }
.cfx .cf-anat-ph img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cfx .cf-anat-ph figcaption { position: absolute; left: 20px; bottom: 20px; padding: 8px 14px; border-radius: 999px; background: rgba(15,10,8,.55);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); color: #F5ECE2; font-size: 13px; }
.cfx .cf-anat-l { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.cfx .cf-anat-l .ui-feat { display: flex; flex-direction: column; }
.cfx .cf-anat-l .ui-feat b { margin-top: auto; padding-top: 22px; font-family: 'Unbounded', sans-serif; font-weight: 200; font-size: 30px; color: var(--ui-strong); line-height: 1; }
.cfx .cf-anat-l .ui-feat b small { display: block; font: 400 12px 'Onest', system-ui, sans-serif; color: var(--ui-muted); margin-top: 8px; }

/* рядом в коллекции */
.cfx .cf-near { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.cfx .cf-near a { display: block; border-radius: 18px; overflow: hidden; background: var(--ui-card); border: 1px solid var(--ui-line); transition: border-color .15s; }
.cfx .cf-near a:hover { border-color: rgba(200,118,60,.5); }
.cfx .cf-near img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; background: #fff; }
.cfx .cf-near div { padding: 16px 18px 18px; }
.cfx .cf-near b { display: block; font-family: 'Unbounded', sans-serif; font-weight: 300; font-size: 16px; color: var(--ui-strong); }
.cfx .cf-near span { display: block; font-size: 13px; color: var(--ui-muted); margin-top: 4px; }
.cfx .cf-near em { white-space: nowrap; display: block; font-style: normal; font-size: 14px; color: var(--ui-accent); margin-top: 8px; }
html[data-theme="light"] .cfx .cf-near em { color: #A55E2A; }

/* текст */
.cfx .ui-prose-aside .ui-h2 { font-size: clamp(24px, 2vw, 30px) !important; }
.cfx .ui-prose-body h3 { font-size: 24px !important; line-height: 1.25 !important; margin: 52px 0 18px !important; scroll-margin-top: 110px; }

@media (max-width: 1200px) {
  .cfx .cf-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cfx .cf-grid:not(.is-filtered) .cf-card.is-big { grid-column: span 3; aspect-ratio: 16 / 8; }
  .cfx .cf-anat-l { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1023px) {
  .cfx .cf-hero { min-height: 0; }
  .cfx .cf-stats { gap: 18px 0; }
  .cfx .cf-stats > div { flex: 0 0 50%; }
  .cfx .cf-stats b { font-size: 26px; }
  .cfx .cf-types { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .cfx .cf-types::-webkit-scrollbar { display: none; }
  .cfx .cf-type { flex: none; }
  .cfx .cf-grid, .cfx .cf-grid.is-3 { grid-template-columns: minmax(0, 1fr); gap: 14px; margin-top: 20px; }
  .cfx .cf-card, .cfx .cf-grid:not(.is-filtered) .cf-card.is-big, .cfx .cf-grid:not(.is-filtered) .cf-card.is-wide { grid-column: auto; aspect-ratio: 4 / 3.3; border-radius: 18px; }
  .cfx .cf-card .ui-card-t { left: 18px; right: 64px; bottom: 16px; }
  .cfx .cf-card .ui-card-t b, .cfx .cf-grid:not(.is-filtered) .cf-card.is-big .ui-card-t b { font-size: 20px; }
  .cfx .cf-card > i { display: flex; right: 16px; bottom: 16px; }
  .cfx .cf-anat { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cfx .cf-anat-ph { min-height: 300px; border-radius: 20px; }
  .cfx .cf-anat-l { gap: 12px; }
  .cfx .cf-near { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
  .cfx .cf-near div { padding: 12px 14px 14px; }
  .cfx .cf-near b { font-size: 14px; }
  .cfx .ui-prose-body h3 { font-size: 20px !important; margin-top: 40px !important; }
}
