/*
Theme Name: Ксения Абрамова
Description: Сайт психолога Ксении Абрамовой: лендинг на главной, статьи — записи WordPress. Тексты главной — «Внешний вид → Настроить → Главная страница».
Version: 1.0.6
Requires at least: 6.5
Requires PHP: 8.0
Text Domain: ksenia
*/

:root {
  --cream: #f6f2ea;
  --cream-tint: #efe9de;
  --paper: #fbf9f4;
  --ink: #2f2e29;
  --ink-soft: #5d5b52;
  --muted: #858174;
  --olive: #66694d;
  --olive-dark: #50533b;
  --olive-pale: #8c8f72;
  --line: #ddd6c8;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans: 'Manrope', -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  --script: 'Marck Script', cursive;

  --container: 1200px;
  --gutter: clamp(16px, 4vw, 40px);
  --section-y: clamp(56px, 8vw, 104px);
  --radius: 4px;
}

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

html { scroll-behavior: smooth; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font: 400 16px/1.65 var(--sans);
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, ul, figure, blockquote { margin: 0; }
ul { padding: 0; list-style: none; }

[hidden] { display: none !important; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

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

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

/* --- Типографика --- */

.eyebrow {
  font-size: 12px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 16px;
}

.section-title {
  font: 400 clamp(32px, 4vw, 44px)/1.15 var(--serif);
  margin-bottom: 24px;
}

.muted { color: var(--muted); font-size: 14px; }

.icon {
  width: 20px; height: 20px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.4;
  stroke-linecap: round; stroke-linejoin: round;
}

/* --- Кнопки --- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px;
  padding: 12px 28px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font: 500 15px/1.3 var(--sans);
  text-decoration: none;
  transition: background-color .2s, color .2s, border-color .2s;
}
.btn--primary { background: var(--olive); color: #fff; }
.btn--primary:hover { background: var(--olive-dark); }
.btn--outline { border-color: var(--ink-soft); color: var(--ink); background: transparent; }
.btn--outline:hover { border-color: var(--olive); color: var(--olive-dark); }
.btn--small { min-height: 42px; padding: 8px 20px; font-size: 14px; }
.btn__arrow { transition: transform .2s; }
.btn:hover .btn__arrow { transform: translateX(3px); }

.link-arrow {
  display: inline-flex; gap: 8px;
  color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 5px; text-decoration-color: var(--line);
}
.link-arrow:hover { color: var(--olive-dark); text-decoration-color: currentColor; }

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

.site-header {
  position: sticky; top: 0; z-index: 10;
  background: rgba(251, 249, 244, .94);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 32px;
  min-height: 72px;
}
.logo { display: flex; align-items: center; gap: 12px; text-decoration: none; line-height: 1.1; }
.logo__mark { flex: none; width: 40px; height: 40px; }
.logo__mark circle { fill: var(--olive); }
.logo__mark path { fill: none; stroke: var(--cream); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.logo__text { display: flex; flex-direction: column; }
.logo__name { font: 500 24px/1.1 var(--serif); }
.logo__role { font-size: 13px; color: var(--ink-soft); }

.site-nav { display: flex; gap: 32px; margin-left: auto; font-size: 14px; }
.site-nav a { text-decoration: none; color: var(--ink-soft); padding: 6px 0; }
.site-nav a:hover { color: var(--ink); }

.nav-toggle { display: none; }

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

.hero { background: var(--cream); overflow: hidden; }
.hero__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  align-items: stretch;
  min-height: min(640px, calc(100vh - 72px));
}
.hero__text { padding: clamp(48px, 7vw, 96px) 0; align-self: center; }
.hero__title {
  font: 400 clamp(40px, 5.4vw, 64px)/1.08 var(--serif);
  margin-bottom: 24px;
  max-width: 14ch;
}
.hero__lead { font-size: 18px; color: var(--ink-soft); max-width: 34em; margin-bottom: 36px; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 16px; margin-bottom: 32px; }
.hero__facts { display: flex; flex-wrap: wrap; gap: 12px 28px; font-size: 14px; color: var(--ink-soft); }
.hero__facts li { display: flex; align-items: center; gap: 8px; }

/* Колонка фото доходит до края окна, а сам кадр 4:5 стоит у правой границы контейнера — рядом с текстом.
   Кадр от верха, чтобы не попадал угол исходника. */
.hero__photo {
  --bleed: max(var(--gutter), (100vw - var(--container)) / 2);
  position: relative; margin-right: calc(-1 * var(--bleed));
}
.hero__photo img {
  position: absolute; top: 0; bottom: 0; right: var(--bleed);
  width: auto; height: 100%; max-width: calc(100% - var(--bleed)); aspect-ratio: 4 / 5;
  object-fit: cover; object-position: 50% 12%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 22%);
  mask-image: linear-gradient(to right, transparent 0, #000 22%);
}

/* --- Секции --- */

.section { padding: var(--section-y) 0; }
.section--tint { background: var(--cream-tint); }

/* Запросы */
.topics { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: 48px 64px; }
.topics__intro p { color: var(--ink-soft); margin-bottom: 28px; }
.topics__list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 40px; }
.topic { display: flex; gap: 20px; }
.topic__icon {
  display: grid; place-items: center; flex: none;
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--olive-pale); color: #fff;
}
.topic__icon svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; }
.topic h3 { font: 600 16px/1.4 var(--sans); margin: 4px 0 6px; }
.topic p { font-size: 14px; color: var(--ink-soft); }

/* Обо мне */
.about { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 4fr) minmax(0, 3fr); gap: 48px; align-items: start; }
.about__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 15%; }
.about__text p { color: var(--ink-soft); margin-bottom: 18px; }
.about__card { border-left: 1px solid var(--line); padding-left: 40px; }
.about__card h3 { font: 600 15px/1.4 var(--sans); margin-bottom: 14px; }
.format-list { display: grid; gap: 14px; margin-bottom: 32px; font-size: 15px; color: var(--ink-soft); }
.format-list li { display: flex; gap: 12px; }
.format-list .icon { margin-top: 2px; color: var(--olive); }
.format-list strong { color: var(--ink); font-weight: 600; }
.price { font: 500 34px/1.2 var(--serif); margin-bottom: 6px; }
.price__note { font: 400 15px var(--sans); color: var(--muted); }

/* Статьи */
.articles { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 3fr); gap: 48px; }
.articles__intro p { color: var(--ink-soft); margin-bottom: 28px; }
.articles__list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.article-card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 28px 24px;
  background: var(--paper);
  border-top: 3px solid var(--olive-pale);
  transition: transform .2s, box-shadow .2s;
}
.article-card:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(60, 55, 40, .08); }
.article-card h3 { font: 500 21px/1.25 var(--serif); }
.article-card h3 a { text-decoration: none; }
.article-card h3 a::after { content: ''; position: absolute; inset: 0; } /* вся карточка кликабельна */
.article-card p { font-size: 14px; color: var(--ink-soft); }

/* Запись */
.booking { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 3fr) minmax(0, 4fr); gap: 48px; align-items: center; }
.booking__text > p:not(.eyebrow) { color: var(--ink-soft); margin-bottom: 32px; }
.booking__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 15%; }
.values { display: grid; gap: 20px; margin-bottom: 32px; font-size: 14px; color: var(--ink-soft); }
.values li { display: flex; align-items: center; gap: 16px; }
.values .icon { width: 28px; height: 28px; color: var(--olive); }
.quote { border-top: 1px solid var(--line); padding-top: 24px; }
.quote p { font: 400 22px/1.35 var(--script); color: var(--ink-soft); }
.quote footer { margin-top: 12px; text-align: right; font: 400 20px var(--script); color: var(--muted); }

/* Подвал */
.site-footer { border-top: 1px solid var(--line); background: var(--paper); font-size: 13px; color: var(--ink-soft); }
.site-footer__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px 32px; padding-top: 28px; padding-bottom: 28px; }

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

@media (max-width: 1100px) {
  .site-nav { gap: 22px; }
  .site-header__cta { display: none; }
  .articles { grid-template-columns: 1fr; }
  .articles__intro { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 24px; }
  .articles__intro p { margin-bottom: 16px; }
  .articles__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .about { grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); }
  .about__card { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line); padding: 32px 0 0; display: grid; grid-template-columns: 1fr 1fr; gap: 0 48px; }
  .about__card h3:nth-of-type(2) { grid-row: 1; grid-column: 2; }
  .about__card .price, .about__card .muted { grid-column: 2; }
  .about__card .format-list { grid-row: 2 / span 3; }
  .booking { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
  .booking__values { grid-column: 1 / -1; display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
  .booking__values .values { margin: 0; }
  .booking__values .quote { border-top: 0; border-left: 1px solid var(--line); padding: 0 0 0 32px; }
}

@media (max-width: 860px) {
  .nav-toggle {
    display: grid; place-items: center;
    margin-left: auto; width: 44px; height: 44px;
    background: none; border: 0; cursor: pointer; color: var(--ink);
  }
  .nav-toggle__bar, .nav-toggle__bar::before, .nav-toggle__bar::after {
    display: block; width: 22px; height: 1.5px; background: currentColor; position: relative;
    transition: transform .2s;
  }
  .nav-toggle__bar::before, .nav-toggle__bar::after { content: ''; position: absolute; left: 0; }
  .nav-toggle__bar::before { top: -7px; }
  .nav-toggle__bar::after { top: 7px; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar { background: transparent; }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::before { transform: translateY(7px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] .nav-toggle__bar::after { transform: translateY(-7px) rotate(-45deg); }

  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 8px var(--gutter) 16px;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a { padding: 12px 0; font-size: 16px; border-bottom: 1px solid var(--line); }
  .site-nav a:last-child { border-bottom: 0; }

  .hero__inner { grid-template-columns: 1fr; min-height: 0; }
  .hero__photo { order: -1; margin: 0 calc(-1 * var(--gutter)); height: min(70vh, 520px); }
  .hero__photo img {
    left: 0; right: 0; width: 100%; max-width: none; aspect-ratio: auto;
    -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 70%, transparent 100%);
    object-position: 50% 20%;
  }
  .hero__text { padding-top: 8px; margin-top: -24px; position: relative; }

  .topics { grid-template-columns: 1fr; }
  .about { grid-template-columns: 1fr; }
  .about__photo { max-width: 420px; }
  .booking { grid-template-columns: 1fr; }
  .booking__photo { display: none; }
}

@media (max-width: 600px) {
  .topics__list, .articles__list { grid-template-columns: 1fr; }
  .about__card, .booking__values { display: block; }
  .about__card .format-list { margin-bottom: 28px; }
  .booking__values .values { margin-bottom: 32px; }
  .booking__values .quote { border-left: 0; border-top: 1px solid var(--line); padding: 24px 0 0; }
  .hero__actions .btn { width: 100%; }
  .site-footer__inner { flex-direction: column; }
}

/* Подвал прижат к низу и на коротких страницах */
body { min-height: 100vh; display: flex; flex-direction: column; }
body > main { flex: 1 0 auto; }

/* --- Внутренние страницы: список статей, статья, обычная страница --- */

.page__header { margin-bottom: 40px; }
.page__lead { color: var(--ink-soft); margin-bottom: 32px; }
.articles__list--page { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.article-card h2 { font: 500 23px/1.25 var(--serif); }
.article-card h2 a { text-decoration: none; }
.article-card h2 a::after { content: ''; position: absolute; inset: 0; }
.article-card__date { font-size: 13px; color: var(--muted); }

.pagination { margin-top: 48px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; }
.pagination .page-numbers {
	display: grid; place-items: center; min-width: 42px; height: 42px; padding: 0 12px;
	border: 1px solid var(--line); text-decoration: none; color: var(--ink-soft);
}
.pagination .page-numbers.current { background: var(--olive); border-color: var(--olive); color: #fff; }

.entry { max-width: calc(760px + 2 * var(--gutter)); }
.entry__header { margin-bottom: 40px; }
.entry__header .eyebrow a { text-decoration: none; }
.entry__title { font: 400 clamp(34px, 4.6vw, 52px)/1.12 var(--serif); margin-bottom: 16px; }
.entry__cover { margin-bottom: 40px; }
.entry__cta {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 20px 32px;
	margin-top: 56px; padding: 32px; background: var(--cream-tint);
}
.entry__cta p { font: 400 22px/1.35 var(--serif); flex: 1 1 280px; }
.entry__nav { display: flex; justify-content: space-between; gap: 24px; margin-top: 40px; font-size: 14px; }
.entry__nav a { color: var(--ink-soft); }
.entry__nav span:only-child:last-child:not(:first-child) { margin-left: auto; }

/* Текст статьи из редактора */
.entry__content { font-size: 17px; line-height: 1.75; }
.entry__content > * + * { margin-top: 1.1em; }
.entry__content h2 { font: 500 32px/1.2 var(--serif); margin-top: 1.8em; }
.entry__content h3 { font: 600 19px/1.35 var(--sans); margin-top: 1.6em; }
.entry__content ul { list-style: disc; padding-left: 1.4em; }
.entry__content ol { padding-left: 1.4em; }
.entry__content li + li { margin-top: .4em; }
.entry__content a { color: var(--olive-dark); text-underline-offset: 3px; }
.entry__content blockquote {
	margin-left: 0; padding-left: 24px; border-left: 2px solid var(--olive-pale);
	font: 400 24px/1.4 var(--serif); color: var(--ink-soft);
}
.entry__content figure { margin-left: 0; margin-right: 0; }
.entry__content figcaption { font-size: 13px; color: var(--muted); margin-top: 8px; }
.entry__content img { height: auto; }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-left: auto; margin-right: auto; }

@media (max-width: 860px) {
	.articles__list--page { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
	.articles__list--page { grid-template-columns: 1fr; }
	.entry__cta { padding: 24px; }
	.entry__cta .btn { width: 100%; }
	.entry__nav { flex-direction: column; }
	.alignleft, .alignright { float: none; margin: 1em 0; }
}
