:root {
  --cream: #FAF7F0;
  --ink: #2B3B2E;
  --ink-soft: #4A5A46;
  --terracotta: #B5654A;
  --terracotta-deep: #9C4F38;
  --line: rgba(43, 59, 46, 0.12);
  --font-display: 'Fraunces', serif;
  --font-body: 'Inter', sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.55;
}

h1, h2, h3 { line-height: 1.2; }

img { max-width: 100%; display: block; }
a { color: inherit; }

/* ---------- Header ---------- */

header {
  padding: 24px;
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  border-bottom: 1px solid var(--line);
}

.brand {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: 20px;
  text-decoration: none;
}

.brand-mark { color: var(--terracotta); }

footer {
  border-top: 1px solid var(--line);
  padding: 28px 24px;
}

.footer-inner {
  max-width: 1160px;
  margin: 0 auto;
  font-size: 13px;
  color: var(--ink-soft);
}

/* ---------- Главная: галерея ---------- */

.intro {
  max-width: 1160px;
  margin: 0 auto;
  padding: 56px 24px 8px;
}

.intro h1 {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: clamp(28px, 4vw, 40px);
  margin: 0 0 12px;
  max-width: 20ch;
}

.intro p {
  color: var(--ink-soft);
  font-size: 15px;
  max-width: 55ch;
  margin: 0;
}

.gallery {
  max-width: 1160px;
  margin: 0 auto;
  padding: 40px 24px 40px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.card {
  background: #fff;
  border-radius: 5px;
  overflow: hidden;
  box-shadow: 0 1px 0 var(--line);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  text-decoration: none;
  display: block;
}

.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 32px rgba(43,59,46,0.14);
}

.card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  display: block;
}

/* ---------- Пагинация ---------- */

.pagination {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 80px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pagination a {
  display: inline-block;
  min-width: 36px;
  padding: 8px 12px;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 4px;
  text-decoration: none;
  color: var(--ink-soft);
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

.pagination a:hover {
  background: rgba(43, 59, 46, 0.06);
  color: var(--ink);
}

.pagination a.active {
  background: var(--terracotta);
  border-color: var(--terracotta);
  color: #fff;
}

/* ---------- Страница композиции: две колонки ---------- */

.plot {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

.breadcrumb {
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 24px;
}

.breadcrumb a {
  color: var(--ink-soft);
  text-decoration: none;
}

.breadcrumb a:hover { color: var(--ink); }

.plot-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 80px;
}

/* Картинка слева: прилипает при скролле */

.plot-hero {
  margin: 0;
  position: sticky;
  top: 24px;
  display: flex;
  justify-content: center;
}

.plot-hero img {
  max-width: 100%;
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 5px;
}

/* Текст справа */

.plot-info h1 {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: clamp(26px, 3vw, 36px);
  margin: 0 0 20px;
}

.lead {
  font-size: 16px;
  color: var(--ink-soft);
  margin: 0 0 40px;
}

.plot-info h2 {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: 22px;
  margin: 0 0 16px;
}

.species-list {
  list-style: none;
  padding: 0;
  margin: 0 0 32px;
  border-top: 1px solid var(--line);
}

.species-list li {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.species-list a {
  color: var(--terracotta-deep);
  text-decoration: none;
}

.species-list a:hover {
  text-decoration: underline;
}

.back {
  margin: 0;
}

.back a {
  font-size: 14px;
  color: var(--terracotta-deep);
  text-decoration: none;
}

.back a:hover { text-decoration: underline; }

/* ---------- Хаб растения ---------- */

.hub {
  max-width: 1160px;
  margin: 0 auto;
  padding: 48px 24px 0;
}

.hub-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 48px;
  align-items: start;
  margin-bottom: 64px;
}

.hub-visual {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hub-hero {
  margin: 0;
  display: flex;
  justify-content: center;
}

.hub-hero img {
  max-width: 100%;
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  display: block;
  border-radius: 5px;
}

.hub-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hub-gallery img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 4px;
  display: block;
}

.hub-info h1 {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: clamp(26px, 3vw, 36px);
  margin: 0 0 20px;
}

.facts {
  list-style: none;
  padding: 0;
  margin: 32px 0 0;
  border-top: 1px solid var(--line);
}

.facts li {
  display: flex;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}

.facts li span:first-child {
  color: var(--ink-soft);
}

.divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 0 0 48px;
}

.hub-compositions h2 {
  font-family: var(--font-display);
  font-weight: 450;
  font-size: 26px;
  margin: 0 0 24px;
}

.hub-compositions .gallery {
  padding-left: 0;
  padding-right: 0;
}

/* ---------- Адаптив ---------- */

@media (max-width: 860px) {
  .plot-grid,
  .hub-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .plot-hero {
    position: static;
  }

  .plot-hero img {
    max-height: none;
  }

  .hub-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 720px) {
  .gallery { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 460px) {
  .gallery { grid-template-columns: 1fr; }
}