/* ==========================================================================
   Borisenko — тема Publii
   ========================================================================== */

:root {
  --paper:      #F7F5F0;
  --paper-warm: #FBFAF6;
  --tint:       #E5E4DD;
  --ink:        #1C1E1A;
  --ink-soft:   #5B5F58;
  --line:       #D3D1C7;
  --forest:     #3C4A38;
  --bronze:     #A07D55;

  --display: "Playfair Display", Georgia, "Times New Roman", serif;
  --body: "Golos Text", "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;

  --wrap: 1240px;
  --gap: clamp(1.5rem, 5vw, 4rem);
  --section-y: clamp(4rem, 10vw, 8.5rem);
  --radius: 10px;
}

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

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: clamp(1rem, 0.96rem + 0.2vw, 1.0625rem);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }

h1, h2, h3 {
  font-family: var(--display);
  font-weight: 400;
  line-height: 1.08;
  letter-spacing: -0.012em;
  margin: 0;
  text-wrap: balance;
}

h1 { font-size: clamp(2.25rem, 1.3rem + 3.6vw, 3.75rem); }
h2 { font-size: clamp(1.875rem, 1.1rem + 3.1vw, 3.5rem); }
h3 { font-size: clamp(1.375rem, 1.1rem + 1.1vw, 1.875rem); }

h4 {
  font-family: var(--body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0;
}

em, .accent { font-style: italic; color: var(--bronze); }

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

/* --- Утилиты --- */

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gap);
}

.section { padding-block: var(--section-y); scroll-margin-top: 90px; }
.section--tint { background: var(--tint); }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 1.75rem;
}

.eyebrow--light { color: rgba(247, 245, 240, 0.65); }

.lede {
  font-size: clamp(1.0625rem, 1rem + 0.45vw, 1.3125rem);
  line-height: 1.6;
  color: var(--ink-soft);
  max-width: 52ch;
}

.muted { color: var(--ink-soft); }

/* --- Шапка --- */

.masthead {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}

.masthead__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 76px;
}

.wordmark {
  font-family: var(--display);
  font-size: 1.25rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.wordmark span { color: var(--bronze); }

.masthead__right {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
}

.lang {
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-decoration: none;
  color: var(--ink-soft);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.lang:hover { color: var(--ink); border-color: var(--bronze); }

.nav nav ul {
  display: flex;
  align-items: center;
  gap: clamp(1rem, 2.5vw, 2.25rem);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.9375rem;
}

.nav nav ul ul { display: none; }

.nav a {
  text-decoration: none;
  color: var(--ink-soft);
  padding-block: 0.4rem;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}

.nav a:hover,
.nav a:focus-visible,
.nav .active > a { color: var(--ink); border-bottom-color: var(--bronze); }

/* --- Первый экран --- */

.hero { padding-block: clamp(2rem, 4vw, 3.5rem) clamp(2.5rem, 6vw, 4.5rem); }

.hero__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin: 0 0 2.25rem;
}

.hero h1 { max-width: 22ch; margin-bottom: 1.75rem; }
.hero__text { padding-top: 0.5rem; }


.hero__top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.6fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: start;
}

.hero__image {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (max-width: 900px) {
  .hero__top { grid-template-columns: 1fr; }
  .hero__image { aspect-ratio: 4 / 3; object-position: 70% 75%; }
}

/* --- Две двери --- */

.doors {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: clamp(2.5rem, 5vw, 4rem);
  border-top: 1px solid var(--line);
}

.door {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  --pad: clamp(1.5rem, 2.6vw, 2.25rem);
  padding: var(--pad);
  overflow: hidden;
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.door__image {
  width: calc(100% + 2 * var(--pad));
  max-width: none;
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) 0.5rem;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.door:hover,
.door:focus-visible {
  transform: translateY(-4px);
  border-color: var(--bronze);
  box-shadow: 0 18px 40px -28px rgba(28, 30, 26, 0.55);
}

.door__label {
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.door h2 { font-size: clamp(1.5rem, 1.15rem + 1.2vw, 2rem); }

.door p { color: var(--ink-soft); font-size: 1rem; }

.door__go {
  margin-top: auto;
  padding-top: 1rem;
  font-weight: 500;
  font-size: 0.9375rem;
  color: var(--forest);
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.door__go::after { content: "→"; transition: transform 0.22s ease; }
.door:hover .door__go::after { transform: translateX(6px); }

/* --- Обо мне --- */

.about { background: var(--tint); }

.about__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(2rem, 6vw, 5rem);
  align-items: start;
}

.about__portrait {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--forest);
}

.about__body h2 { margin-bottom: 1.75rem; max-width: 16ch; }

.rich { color: var(--ink-soft); }
.rich p { margin-bottom: 1.1em; }

.facts {
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
}

.facts li {
  display: grid;
  grid-template-columns: 5rem 1fr;
  gap: 1.5rem;
  align-items: baseline;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: 0.9688rem;
  color: var(--ink-soft);
}

.facts b {
  font-family: var(--display);
  font-size: 1.75rem;
  font-weight: 400;
  color: var(--ink);
  line-height: 1;
}

/* --- Карточки новостей --- */

.posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
  gap: 1.5rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.post {
  background: var(--paper-warm);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.75rem;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.post:hover { border-color: var(--bronze); transform: translateY(-3px); }

.post__image {
  width: calc(100% + 3.5rem);
  margin: -1.75rem -1.75rem 0.25rem;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: var(--radius) var(--radius) 0 0;
}

.post time {
  font-size: 0.8125rem;
  color: var(--ink-soft);
  letter-spacing: 0.05em;
}

.post h3 { font-size: 1.3125rem; }
.post p { font-size: 0.9375rem; color: var(--ink-soft); }

/* --- Статья и страница --- */

.article { padding-block: clamp(3rem, 7vw, 5.5rem); }

.article__head { max-width: 46rem; margin-inline: auto; }
.article__head h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); margin-bottom: 1.25rem; }

.article__meta {
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.5rem;
}

.article__image { margin: clamp(2rem, 4vw, 3rem) auto; border-radius: var(--radius); max-width: 60rem; }

.article__body {
  max-width: 44rem;
  margin-inline: auto;
  font-size: 1.0625rem;
  line-height: 1.75;
}

.article__body h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 600; margin: 2.25em 0 0.6em; }
.article__body h3 { font-size: 1.375rem; font-weight: 600; margin: 2.1em 0 0.5em; }
.article__body ul,
.article__body ol { padding-left: 1.25rem; margin: 0 0 1.2em; }
.article__body li { margin-bottom: 0.5em; }
.article__body img { border-radius: var(--radius); margin: 2rem 0; }
.article__body a { color: var(--forest); text-underline-offset: 3px; }

.article__body blockquote {
  margin: 2rem 0;
  padding-left: 1.5rem;
  border-left: 2px solid var(--bronze);
  font-family: var(--display);
  font-size: 1.25rem;
  line-height: 1.45;
}

.article__tags {
  max-width: 44rem;
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 0.625rem;
}

.tag-chip {
  font-size: 0.8125rem;
  padding: 0.375rem 0.875rem;
  border: 1px solid var(--line);
  border-radius: 100px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: border-color 0.18s ease, color 0.18s ease;
}

.tag-chip:hover { border-color: var(--bronze); color: var(--ink); }


/* заголовки внутри страниц и статей: одинаковая насыщенность на всех уровнях */
.article__body h2,
.article__body h3,
.article__body h4,
.article__body h5,
.article__body h6 { font-weight: 600; }

.article__body h4,
.article__body h5,
.article__body h6 {
  font-family: var(--display);
  font-size: 1.375rem;
  line-height: 1.15;
  letter-spacing: -0.012em;
  margin: 2.1em 0 0.5em;
  text-transform: none;
}

/* --- Призыв к действию --- */

.cta { background: var(--forest); color: var(--paper); }

.cta h2 { max-width: 18ch; margin-bottom: 1.5rem; }
.cta p { color: rgba(247, 245, 240, 0.78); max-width: 52ch; }

.cta__actions { margin-top: 2.5rem; }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 2rem;
  background: var(--paper);
  color: var(--forest);
  font-family: var(--body);
  font-weight: 500;
  font-size: 1rem;
  text-decoration: none;
  border: 1px solid var(--paper);
  border-radius: var(--radius);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.button:hover { transform: translateY(-2px); opacity: 0.92; }

.button--outline {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.button--outline:hover { background: var(--ink); color: var(--paper); }

.cta__note {
  margin-top: 1.75rem;
  font-size: 0.9375rem;
  color: rgba(247, 245, 240, 0.6);
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem;
  margin-top: 1.75rem;
  font-size: 1rem;
}

.contact-links a {
  color: var(--paper);
  text-decoration: none;
  border-bottom: 1px solid rgba(247, 245, 240, 0.4);
  padding-bottom: 2px;
  transition: border-color 0.18s ease;
}

.contact-links a:hover { border-bottom-color: var(--paper); }

/* --- Подвал --- */

.footer {
  background: #23251F;
  color: rgba(247, 245, 240, 0.72);
  padding-block: clamp(3rem, 6vw, 5rem);
  font-size: 0.9375rem;
}

.footer__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 2.5rem;
}

.footer h4 { color: var(--paper); margin-bottom: 1.25rem; }

.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.625rem; }
.footer nav ul ul { display: none; }
.footer a { color: inherit; text-decoration: none; transition: color 0.18s ease; }
.footer a:hover { color: var(--paper); }

.footer__bottom {
  margin-top: 3rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(247, 245, 240, 0.16);
  font-size: 0.8125rem;
  color: rgba(247, 245, 240, 0.5);
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 2.5rem;
  justify-content: space-between;
}

/* --- Пагинация --- */

.pagination {
  margin-top: 3rem;
  display: flex;
  gap: 0.5rem;
  justify-content: center;
  list-style: none;
  padding: 0;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  text-decoration: none;
  font-size: 0.9375rem;
}

.pagination a:hover { border-color: var(--bronze); }

/* --- Доступность --- */

:focus-visible { outline: 2px solid var(--forest); outline-offset: 3px; }

.skip {
  position: absolute;
  left: -9999px;
  background: var(--forest);
  color: var(--paper);
  padding: 0.75rem 1.25rem;
  z-index: 100;
}

.skip:focus { left: 0; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* --- Адаптив --- */

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 340px; }
}

@media (max-width: 640px) {
  .masthead__inner { min-height: 64px; flex-wrap: wrap; gap: 0.5rem 1rem; }
  .nav nav ul { gap: 1rem; font-size: 0.875rem; flex-wrap: wrap; }
  .facts li { grid-template-columns: 4rem 1fr; gap: 1rem; }
  .button { width: 100%; }
}
