/* Каталог типовых проектов: список с фильтрами и карточка проекта.
   Токены повторяют home.css: на страницах каталога он не подключён,
   своих цветов, теней и радиусов здесь нет. */

:root {
  --sand: #faf7f2;
  --paper: #ffffff;
  --ink: #191411;
  --ink-soft: #6d635a;
  --line: #e9e1d6;
  --line-soft: #f1ebe2;
  --clay: #b4552e;
  --clay-deep: #8f3f1e;
  --clay-tint: #fbf0e8;
  --r-8: 8px;
  --r-12: 12px;
  --r-16: 16px;
  --shadow-1: 0 1px 2px rgba(25, 20, 17, .04), 0 8px 24px rgba(25, 20, 17, .06);
  color-scheme: light;
}

/* Кнопки — те же, что на главной: home.css на каталог не подключён. */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 22px;
  border-radius: var(--r-12);
  font-weight: 600;
  font-size: 16px;
  line-height: 1.25;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: transform 180ms ease-out;
}

.btn-primary {
  background: var(--clay);
  color: #fff;
}

.btn-primary:hover {
  background: var(--clay-deep);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-secondary:hover {
  background: var(--clay-tint);
  color: var(--clay-deep);
  transform: translateY(-1px);
}

.catalog-header {
  padding-top: 40px;
}

.catalog-header h1 {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.catalog-sub {
  margin: 0;
  color: var(--ink-soft);
  font-size: 18px;
  max-width: 68ch;
}

.wait-note {
  margin: 24px 0 0;
  padding: 12px 16px;
  background: var(--clay-tint);
  color: var(--clay-deep);
  border-radius: var(--r-12);
}

.catalog-filters {
  margin-top: 32px;
  display: grid;
  gap: 16px;
}

.filter-group {
  margin: 0;
  padding: 0;
  border: none;
}

.filter-title {
  font-size: 15px;
  font-weight: 600;
  padding: 0;
  margin-bottom: 8px;
}

.filter-tiles {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* Плитки-радио как .tile на главной: тот класс живёт в home.css,
   который на каталог не подключён, поэтому повторяем его приём. */
.filter-tiles .tile {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 48px;
  padding: 8px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-8);
  cursor: pointer;
  transition: border-color 180ms ease-out;
}

.filter-tiles .tile input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.filter-tiles .tile:has(input:checked) {
  border-color: var(--clay);
  background: var(--clay-tint);
}

.filter-tiles .tile:hover {
  border-color: var(--clay);
}

.filter-tiles .tile-text {
  font-size: 15px;
  font-weight: 500;
  line-height: 1.25;
}

.project-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: 1fr;
  margin: 32px 0 64px;
}

/* Обложка серии в карточке: пропорции 3:2 и object-fit, чтобы фото разной
   высоты не прыгали в сетке; не у серий есть фото, блок выводится по условию. */
.project-cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--r-12);
  margin-bottom: 12px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
  box-shadow: var(--shadow-1);
}

.project-code {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--clay-deep);
}

.project-title {
  margin: 0;
  font-size: 21px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.project-summary,
.project-size {
  margin: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.project-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 4px 0 8px;
}

.price-from {
  font-size: 27px;
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.price-rate {
  color: var(--ink-soft);
  font-size: 15px;
}

.project-card .btn {
  margin-top: auto;
  align-self: flex-start;
}

.catalog-empty {
  margin: 32px 0 64px;
  max-width: 560px;
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-12);
}

.catalog-empty p {
  margin: 0 0 16px;
  color: var(--ink-soft);
}

/* Карточка проекта */

.project-page {
  max-width: 720px;
  padding: 40px 0 64px;
}

.project-head h1 {
  margin: 0 0 8px;
  font-size: 42px;
  line-height: 1.15;
  letter-spacing: -0.02em;
}

.project-head .project-code {
  margin-bottom: 8px;
}

/* Иллюстрация серии в шапке проекта: фиксируем 3:2, чтобы вёрстка не прыгала
   при загрузке (width/height заданы в разметке); подпись — как служебный текст. */
.project-hero {
  margin: 16px 0 24px;
}

.project-hero img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  border-radius: var(--r-16);
}

.project-hero figcaption {
  margin-top: 8px;
  font-size: 14px;
  color: var(--ink-soft);
}

.project-specs {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 16px 0 0;
  padding: 0;
  color: var(--ink-soft);
  font-size: 15px;
}

.project-construct,
.project-features,
.project-estimate {
  margin-top: 40px;
}

.project-construct h2,
.project-features h2,
.project-estimate h2 {
  margin: 0 0 12px;
  font-size: 27px;
  letter-spacing: -0.02em;
}

.project-construct p {
  margin: 0;
}

.features-list {
  list-style: disc;
  margin: 0;
  padding-left: 20px;
}

.features-list li {
  padding: 2px 0;
}

.project-estimate {
  padding: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-16);
  box-shadow: var(--shadow-1);
}

.stages-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
}

.stages-table th,
.stages-table td {
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
  text-align: left;
}

.stages-table th[scope="col"] {
  color: var(--ink-soft);
  font-weight: 600;
}

.stages-table th[scope="row"] {
  font-weight: 400;
}

.stages-table th[scope="col"]:nth-child(2),
.stages-table td:nth-child(2),
.stages-table th[scope="col"]:nth-child(3),
.stages-table td:nth-child(3) {
  text-align: right;
}

.stages-table tbody tr:last-child th,
.stages-table tbody tr:last-child td {
  border-bottom: none;
}

.stages-total th,
.stages-total td {
  font-weight: 700;
}

.rates-note {
  margin: 12px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
  margin-top: 40px;
}

@media (min-width: 768px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1120px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 767px) {
  .catalog-header h1,
  .project-head h1 {
    font-size: 32px;
  }

  .project-actions .btn {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn {
    transition: none;
  }
}
