/* ==================================================================
   Мягкие панели по комнатам и типам — вёрстка заказчика
   (soft-panels-catalog), перенесённая на сайт 18.09.2026.

   Оформление не менялось. Все классы с приставкой sp-catalog,
   с темой они не пересекаются.

   Единственная правка: путь к фоновому изображению — картинки лежат
   в assets/img/links, а не рядом с файлом стилей.
   ================================================================== */

/*
 * Мягкие панели — каталог по комнатам, типам и материалам.
 * Все стили ограничены .sp-catalog. JavaScript и библиотеки не нужны.
 * Подключение: <link rel="stylesheet" href="assets/css/catalog.css">
 */

.sp-catalog {
  --sp-ink: #272b37;
  --sp-accent: #f8661b;
  --sp-peach: #fff0e4;
  --sp-paper: #f5f1ec;
  --sp-card: rgba(255, 255, 255, .97);
  --sp-heading-font: Georgia, "Times New Roman", serif;
  --sp-body-font: Arial, Helvetica, sans-serif;
  --sp-max-width: 1452px;
  --sp-gutter: 40px;
  --sp-gap: 12px;
  --sp-radius: 16px;

  position: relative;
  isolation: isolate;
  width: 100%;
  padding: 22px 0 14px;
  color: var(--sp-ink);
  background: var(--sp-paper);
  font-family: var(--sp-body-font);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.4;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
}

.sp-catalog *,
.sp-catalog *::before,
.sp-catalog *::after {
  box-sizing: border-box;
}

/* Separate decorative background: all visible headings/labels are live text. */
.sp-catalog::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background-image: url("../img/links/catalog-background.webp");
  background-position: center top;
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

.sp-catalog__container {
  width: calc(100% - var(--sp-gutter) * 2);
  max-width: var(--sp-max-width);
  margin: 0 auto;
}

.sp-catalog__header {
  margin: 0;
  text-align: center;
}

.sp-catalog .sp-catalog__title {
  margin: 0;
  padding: 0;
  color: var(--sp-ink);
  font-family: var(--sp-heading-font);
  font-size: 52px;
  font-weight: 700;
  line-height: 1.06;
  letter-spacing: -1.2px;
  text-transform: none;
  text-wrap: balance;
}

.sp-catalog__header::after {
  content: "";
  display: block;
  width: 62px;
  height: 2px;
  margin: 16px auto 12px;
  background: var(--sp-accent);
}

.sp-catalog__group {
  display: block;
  margin: 0;
}

.sp-catalog__group--types { margin-top: 22px; }
.sp-catalog__group--materials { margin-top: 16px; }
.sp-catalog__group--furniture { margin-top: 10px; }

.sp-catalog__group-header {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 48px;
  margin: 0 0 8px;
}

.sp-catalog__group-icon {
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, .95);
  border-radius: 50%;
  color: var(--sp-ink);
  background: linear-gradient(145deg, #ffead7, #fff0e5);
  box-shadow: 0 2px 5px rgba(97, 63, 34, .025);
}

.sp-catalog__group-icon svg {
  display: block;
  width: 25px;
  height: 25px;
}

.sp-catalog .sp-catalog__heading {
  margin: 0;
  padding: 0;
  color: var(--sp-ink);
  font-family: var(--sp-heading-font);
  font-size: 30px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: -.55px;
  text-transform: none;
}

.sp-catalog .sp-catalog__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--sp-gap);
  list-style: none;
  margin: 0;
  padding: 0;
}

.sp-catalog .sp-catalog__item {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Prevent legacy theme list decorations from appearing on the cards. */
.sp-catalog__item::before,
.sp-catalog__item::after { content: none; }

.sp-catalog .sp-catalog__card {
  --sp-thumb-width: 108px;
  --sp-thumb-height: 84px;
  --sp-arrow-size: 40px;
  display: grid;
  grid-template-columns: var(--sp-thumb-width) minmax(0, 1fr) var(--sp-arrow-size);
  align-items: center;
  column-gap: 16px;
  min-width: 0;
  min-height: 100px;
  height: 100%;
  margin: 0;
  padding: 8px 14px 8px 10px;
  border: 1px solid rgba(255, 255, 255, .84);
  border-radius: var(--sp-radius);
  color: var(--sp-ink);
  background: var(--sp-card);
  box-shadow: 0 12px 28px -9px rgba(64, 45, 24, .14);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.sp-catalog__picture {
  display: block;
  position: relative;
  width: var(--sp-thumb-width);
  height: var(--sp-thumb-height);
  overflow: hidden;
  border-radius: 13px;
  background: #e5ddd3;
}

.sp-catalog .sp-catalog__image {
  display: block;
  width: 100%;
  max-width: none;
  height: 100%;
  margin: 0;
  border: 0;
  border-radius: inherit;
  object-fit: cover;
  object-position: center;
  transition: transform .35s ease;
}

.sp-catalog__label {
  display: block;
  min-width: 0;
  color: inherit;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.38;
  overflow-wrap: break-word;
}

.sp-catalog__arrow {
  display: grid;
  place-items: center;
  width: var(--sp-arrow-size);
  height: var(--sp-arrow-size);
  border-radius: 50%;
  color: var(--sp-accent);
  background: linear-gradient(135deg, #fff2e8, #ffecd9);
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

.sp-catalog__arrow svg {
  display: block;
  width: 23px;
  height: 23px;
}

.sp-catalog__group--types .sp-catalog__card {
  --sp-thumb-width: 100px;
  --sp-thumb-height: 76px;
  --sp-arrow-size: 36px;
  min-height: 92px;
  column-gap: 12px;
  padding-right: 10px;
}

.sp-catalog__group--types .sp-catalog__label {
  font-size: 15.5px;
}

.sp-catalog__group--materials .sp-catalog__grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sp-catalog__group--materials .sp-catalog__card {
  --sp-thumb-width: 116px;
  --sp-thumb-height: 56px;
  --sp-arrow-size: 38px;
  min-height: 70px;
  padding-block: 6px;
  column-gap: 18px;
}

.sp-catalog__group--furniture .sp-catalog__card {
  --sp-thumb-width: 96px;
  --sp-thumb-height: 54px;
  --sp-arrow-size: 34px;
  min-height: 70px;
  padding-block: 7px;
  padding-right: 10px;
  column-gap: 12px;
}

.sp-catalog__group--furniture .sp-catalog__label {
  font-size: 13px;
  line-height: 1.35;
}

.sp-catalog__group--furniture .sp-catalog__arrow svg {
  width: 21px;
  height: 21px;
}

/* Keyboard navigation remains visible on the entire clickable tile. */
.sp-catalog .sp-catalog__card:focus-visible {
  outline: 3px solid var(--sp-accent);
  outline-offset: 4px;
}

.sp-catalog .sp-catalog__card:active {
  transform: translateY(0) scale(.992);
}

@media (hover: hover) and (pointer: fine) {
  .sp-catalog .sp-catalog__card:hover {
    transform: translateY(-3px);
    border-color: rgba(248, 102, 27, .28);
    box-shadow: 0 16px 30px -10px rgba(91, 59, 32, .22);
  }
  .sp-catalog__card:hover .sp-catalog__image { transform: scale(1.045); }
  .sp-catalog__card:hover .sp-catalog__arrow {
    color: #fff;
    background: var(--sp-accent);
    transform: translateX(2px);
  }
}

/* Laptop: three columns for room/type categories, two for furniture. */
@media (max-width: 1519px) {
  .sp-catalog { --sp-gutter: 40px; padding-block: 32px; }
  .sp-catalog .sp-catalog__title { font-size: 46px; }
  .sp-catalog__header::after { margin-bottom: 22px; }
  .sp-catalog .sp-catalog__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sp-catalog__group--furniture .sp-catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-catalog__group--furniture .sp-catalog__label { font-size: 16px; }
  .sp-catalog__group--materials,
  .sp-catalog__group--furniture { margin-top: 24px; }
  .sp-catalog__group--materials .sp-catalog__card {
    --sp-thumb-width: 88px;
    column-gap: 14px;
  }
}

/* Tablet: all lists remain visible; no carousels hide category links. */
@media (max-width: 1139px) {
  .sp-catalog { --sp-gutter: 28px; }
  .sp-catalog .sp-catalog__title { font-size: 41px; letter-spacing: -.8px; }
  .sp-catalog .sp-catalog__heading { font-size: 28px; }
  .sp-catalog .sp-catalog__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sp-catalog__group--materials .sp-catalog__item:last-child { grid-column: 1 / -1; }
  .sp-catalog .sp-catalog__card {
    --sp-thumb-width: 96px;
    --sp-arrow-size: 36px;
    column-gap: 14px;
  }
  .sp-catalog__group--materials .sp-catalog__card { --sp-thumb-width: 108px; }
  .sp-catalog__group--furniture .sp-catalog__label { font-size: 15px; }
  .sp-catalog::before { background-size: auto 100%; opacity: .7; }
}

/* Narrow tablet. */
@media (min-width: 671px) and (max-width: 819px) {
  .sp-catalog .sp-catalog__card {
    --sp-thumb-width: 80px;
    --sp-arrow-size: 32px;
    column-gap: 12px;
    padding-inline: 8px;
  }
  .sp-catalog__label,
  .sp-catalog__group--types .sp-catalog__label,
  .sp-catalog__group--materials .sp-catalog__label,
  .sp-catalog__group--furniture .sp-catalog__label { font-size: 14px; }
}

/* Mobile: one full-width card per row, with comfortably sized touch targets. */
@media (max-width: 670px) {
  .sp-catalog {
    --sp-gutter: 18px;
    --sp-gap: 10px;
    --sp-radius: 15px;
    padding: 30px 0 36px;
  }
  .sp-catalog::before {
    background-position: center top;
    background-size: auto 940px;
    opacity: .44;
  }
  .sp-catalog .sp-catalog__title {
    max-width: 500px;
    margin-inline: auto;
    font-size: 34px;
    line-height: 1.12;
    letter-spacing: -.7px;
  }
  .sp-catalog__header::after { width: 48px; margin: 17px auto 24px; }
  .sp-catalog__group--types,
  .sp-catalog__group--materials,
  .sp-catalog__group--furniture { margin-top: 28px; }
  .sp-catalog__group-header { gap: 12px; margin-bottom: 12px; min-height: 42px; }
  .sp-catalog__group-icon { flex-basis: 42px; width: 42px; height: 42px; }
  .sp-catalog__group-icon svg { width: 23px; height: 23px; }
  .sp-catalog .sp-catalog__heading { font-size: 24px; line-height: 1.15; letter-spacing: -.4px; }
  .sp-catalog .sp-catalog__grid { grid-template-columns: minmax(0, 1fr); }
  .sp-catalog__group--materials .sp-catalog__item:last-child { grid-column: auto; }
  .sp-catalog .sp-catalog__card {
    --sp-thumb-width: 88px;
    --sp-thumb-height: 66px;
    --sp-arrow-size: 34px;
    min-height: 84px;
    column-gap: 14px;
    padding: 8px 11px 8px 8px;
    box-shadow: 0 8px 18px -9px rgba(64, 45, 24, .15);
  }
  .sp-catalog__picture { border-radius: 10px; }
  .sp-catalog__label,
  .sp-catalog__group--types .sp-catalog__label,
  .sp-catalog__group--furniture .sp-catalog__label {
    font-size: 15px;
    line-height: 1.4;
  }
  .sp-catalog__group--materials .sp-catalog__card,
  .sp-catalog__group--furniture .sp-catalog__card {
    --sp-thumb-height: 58px;
    min-height: 76px;
  }
}

@media (max-width: 359px) {
  .sp-catalog { --sp-gutter: 12px; }
  .sp-catalog .sp-catalog__title { font-size: 30px; }
  .sp-catalog .sp-catalog__heading { font-size: 22px; }
  .sp-catalog .sp-catalog__card {
    --sp-thumb-width: 72px;
    --sp-arrow-size: 30px;
    column-gap: 10px;
  }
  .sp-catalog__label,
  .sp-catalog__group--types .sp-catalog__label,
  .sp-catalog__group--furniture .sp-catalog__label { font-size: 14px; }
}

/* Optional modifier: use <section class="sp-catalog sp-catalog--plain">. */
.sp-catalog.sp-catalog--plain { background: transparent; }
.sp-catalog--plain::before { display: none; }
.sp-catalog--plain .sp-catalog__card { border-color: #eee8e1; }

@media (prefers-reduced-motion: reduce) {
  .sp-catalog *,
  .sp-catalog *::before,
  .sp-catalog *::after { transition: none !important; }
}

@media print {
  .sp-catalog { padding-block: 0; background: #fff; }
  .sp-catalog::before { display: none; }
  .sp-catalog .sp-catalog__card { box-shadow: none; border-color: #ddd; }
  .sp-catalog__group { break-inside: avoid; }
}

/* ------------------------------------------------------------------
   Свёрнутый вид (18.09.2026)

   Показываем пару рядов, остальное — по кнопке. Скрытая часть именно
   обрезана по высоте: ссылки остаются в разметке и в потоке документа,
   display: none к ним не применяется — блок делался ради перелинковки,
   и поисковик должен видеть все ссылки.
   ------------------------------------------------------------------ */
.sp-catalog__body {
	position: relative;
	transition: max-height .3s ease;
}

.sp-catalog--collapsible:not(.is-open) .sp-catalog__body {
	/* Запасное значение на случай, если скрипт не успел посчитать точную
	   высоту: примерно два ряда карточек. */
	max-height: 520px;
	overflow: hidden;
}

/* Мягкое затухание внизу — видно, что дальше есть продолжение. */
.sp-catalog--collapsible:not(.is-open) .sp-catalog__body::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 96px;
	pointer-events: none;
	background: linear-gradient(to bottom, rgba(247, 243, 239, 0), rgba(247, 243, 239, .96));
}

.sp-catalog__more-wrap {
	display: flex;
	justify-content: center;
	margin-top: 18px;
}

.sp-catalog .sp-catalog__more {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 48px;
	padding: 12px 26px;
	border: 1px solid rgba(40, 43, 53, .18);
	border-radius: 999px;
	background: rgba(255, 255, 255, .92);
	color: var(--sp-ink);
	font-family: var(--sp-body-font);
	font-size: 16px;
	line-height: 1.2;
	cursor: pointer;
	transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.sp-catalog .sp-catalog__more:hover,
.sp-catalog .sp-catalog__more:focus-visible {
	border-color: var(--sp-accent);
	background: #fff;
	color: var(--sp-accent);
}

.sp-catalog .sp-catalog__more:focus-visible {
	outline: 3px solid rgba(248, 102, 27, .35);
	outline-offset: 2px;
}

.sp-catalog__more[hidden] { display: none; }

.sp-catalog__more-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	transition: transform .25s ease;
}

.sp-catalog.is-open .sp-catalog__more-icon { transform: rotate(180deg); }

@media (max-width: 670px) {
	.sp-catalog__more-wrap { margin-top: 14px; }
	.sp-catalog .sp-catalog__more { font-size: 15px; padding: 11px 20px; min-height: 46px; }
	.sp-catalog--collapsible:not(.is-open) .sp-catalog__body { max-height: 470px; }
}

@media (prefers-reduced-motion: reduce) {
	.sp-catalog__body,
	.sp-catalog__more-icon { transition: none; }
}
