/*
Theme Name: Георгий Коваленко — Писатель
Theme URI: https://geokov.ru
Author: Георгий Коваленко
Author URI: https://geokov.ru
Description: Авторская тема для сайта уральского писателя Георгия Коваленко. Тёмная атмосферная палитра, уральский дух, литературная элегантность.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kovalenko
Tags: dark, literary, writer, author, portfolio, blog
*/

/* ============================================================
   DESIGN TOKENS — OKLCH color system
   ============================================================ */

html, body {
    overflow-x: hidden;
    max-width: 100vw;
}

:root {
  /* Neutral ramp — off-black to off-white */
  --n-950: oklch(10% 0.005 240);
  --n-900: oklch(14% 0.007 240);
  --n-850: oklch(18% 0.008 240);
  --n-800: oklch(22% 0.009 240);
  --n-700: oklch(32% 0.010 240);
  --n-600: oklch(44% 0.010 240);
  --n-500: oklch(90% 0.000 240);
  --n-400: oklch(90% 0.000 240);
  --n-300: oklch(78% 0.007 240);
  --n-200: oklch(88% 0.005 240);
  --n-100: oklch(94% 0.003 240);
  --n-050: oklch(97.5% 0.002 240);

  /* Accent — deep Ural blue, grounded and earthy */
  --a-900: oklch(22% 0.08 248);
  --a-800: oklch(30% 0.12 248);
  --a-700: oklch(40% 0.14 248);
  --a-600: oklch(50% 0.16 248);
  --a-500: oklch(58% 0.17 248);
  --a-400: oklch(66% 0.16 248);
  --a-300: oklch(76% 0.12 248);
  --a-200: oklch(86% 0.07 248);

  /* Semantic roles */
  --color-bg:           var(--n-950);
  --color-surface:      var(--n-900);
  --color-surface-2:    var(--n-850);
  --color-border:       var(--n-800);
  --color-muted:        var(--n-500);
  --color-body:         var(--n-200);
  --color-heading:      var(--n-050);
  --color-accent:       var(--a-500);
  --color-accent-hover: var(--a-400);
  --color-accent-dim:   var(--a-800);

  /* Semantic states */
  --color-success: oklch(62% 0.14 148);
  --color-warning: oklch(72% 0.14  72);
  --color-danger:  oklch(58% 0.18  24);

  /* Typography */
  /*--font-serif:  'Zen Kaku Gothic Antique', serif;*/
  --font-sans:   system-ui, -apple-system, 'Zen Kaku Gothic Antique', sans-serif;
  --font-mono:   'Zen Kaku Gothic Antique', monospace;

  /* Type scale (ratio ~1.25) */
  --text-xs:   14px;
  --text-sm:   14px;
  --text-base: 14px;
  --text-lg:   14px;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-4xl:  2.25rem;
  --text-5xl:  3rem;
  --text-6xl:  3.75rem;

  /* Spacing rhythm — 4px base */
  --sp-1:  0.25rem;
  --sp-2:  0.5rem;
  --sp-3:  0.75rem;
  --sp-4:  1rem;
  --sp-5:  1.25rem;
  --sp-6:  1.5rem;
  --sp-8:  2rem;
  --sp-10: 2.5rem;
  --sp-12: 3rem;
  --sp-16: 4rem;
  --sp-20: 5rem;
  --sp-24: 6rem;

  /* Radius */
  --r-sm: 4px;
  --r-md: 8px;
  --r-lg: 16px;

  /* Elevation */
  --shadow-sm:  0 1px 3px oklch(0% 0 0 / 0.3), 0 0 0 1px var(--color-border);
  --shadow-md:  0 4px 12px oklch(0% 0 0 / 0.4), 0 0 0 1px var(--color-border);
  --shadow-lg:  0 8px 32px oklch(0% 0 0 / 0.5), 0 0 0 1px var(--color-border);
  --shadow-glow: 0 0 40px oklch(50% 0.17 248 / 0.15);

  /* Transitions */
  --ease-std: cubic-bezier(0.16, 1, 0.3, 1);
  --t-fast: 120ms var(--ease-std);
  --t-std:  200ms var(--ease-std);
  --t-slow: 320ms var(--ease-std);

  /* Layout */
  --max-content: 1200px;
  --max-text:    72ch;
  --header-h:    72px;
}

/* ============================================================
   RESET & BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background-color: var(--color-bg);
  color: var(--color-body);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img, video, svg { display: block; max-width: 100%; }
a { color: var(--color-accent); text-decoration: none; }
a:hover { color: var(--color-accent-hover); }
a:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; border-radius: var(--r-sm); }

ul, ol { list-style: none; }
button { cursor: pointer; font: inherit; border: none; background: none; }
input, textarea, select { font: inherit; }

/* ============================================================
   SKIP LINK (accessibility)
   ============================================================ */
.skip-link {
  position: absolute;
  left: var(--sp-4);
  top: var(--sp-4);
  transform: translateY(-200%);
  background: var(--color-accent);
  color: var(--n-950);
  padding: var(--sp-2) var(--sp-4);
  border-radius: var(--r-sm);
  font-weight: 600;
  z-index: 9999;
  transition: transform var(--t-fast);
}
.skip-link:focus { transform: translateY(0); }

/* ============================================================
   LAYOUT UTILITIES
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}
/*.container--text {
  max-width: var(--max-text);
}*/
.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0,0,0,0);
  white-space: nowrap;
  border: 0;
}

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: oklch(10% 0.005 240 / 0.85);
  backdrop-filter: blur(16px) saturate(1.4);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  align-items: center;
}

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-8);
  width: 100%;
  max-width: var(--max-content);
  margin-inline: auto;
  padding-inline: var(--sp-6);
}

.site-logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  line-height: 1.2;
}
.site-logo__name {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--color-heading);
  letter-spacing: 0.02em;
}
.site-logo__tagline {
  font-size: var(--text-xs);
  color: var(--color-muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Main nav */
.main-nav { display: flex; align-items: center; gap: var(--sp-1); }
.main-nav__list { display: flex; align-items: center; gap: var(--sp-1); }
.main-nav__link {
  display: inline-flex;
  align-items: center;
  padding: var(--sp-2) var(--sp-3);
  font-size: var(--text-sm);
  color: var(--n-300);
  border-radius: var(--r-sm);
  transition: color var(--t-fast), background var(--t-fast);
  letter-spacing: 0.02em;
}
.main-nav__link:hover,
.main-nav__link:focus-visible {
  color: var(--color-heading);
  background: var(--n-800);
  outline: none;
}
.main-nav__link--active {
  color: var(--color-accent);
  background: var(--color-accent-dim);
}

/* Mobile menu toggle */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 40px; height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--r-sm);
  transition: background var(--t-fast);
}
.nav-toggle:hover { background: var(--n-800); }
.nav-toggle span {
  display: block;
  width: 22px; height: 2px;
  background: var(--n-300);
  border-radius: 2px;
  transition: transform var(--t-std), opacity var(--t-fast);
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================================================
   HERO — HOMEPAGE (updated with portrait)
   ============================================================ */
.hero {
    position: relative;
    min-height: 650px;
    display: flex;
    align-items: center;
    overflow: hidden;
}

.hero__bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 80% 60% at 60% 40%, oklch(26% 0.10 248 / 0.25) 0%, transparent 65%),
        radial-gradient(ellipse 50% 80% at 10% 70%, oklch(18% 0.06 255 / 0.30) 0%, transparent 60%),
        var(--color-bg);
}

.hero__bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60'%3E%3Crect width='60' height='60' fill='none'/%3E%3Ccircle cx='1' cy='1' r='0.5' fill='oklch(56%25 0.01 240 / 0.15)'/%3E%3C/svg%3E");
    opacity: 0.4;
}

.hero__content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 1fr 420px;
    gap: var(--sp-16);
    align-items: center;
    width: 100%;
}

.hero__text {
    max-width: 680px;
}

.hero__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: var(--sp-2);
    font-size: var(--text-xs);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--sp-6);
}

.hero__eyebrow::before {
    content: '';
    display: block;
    width: 32px;
    height: 1px;
    background: var(--color-accent);
}

.hero__title {
    font-family: var(--font-serif);
    font-size: clamp(var(--text-4xl), 7vw, var(--text-6xl));
    font-weight: 400;
    line-height: 1.1;
    color: var(--color-heading);
    margin-bottom: var(--sp-6);
    letter-spacing: -0.01em;
}

.hero__title em {
    font-style: normal;
    color: var(--color-accent);
}

.hero__quote {
    font-family: var(--font-serif);
    font-size: var(--text-lg);
    font-style: italic;
    color: var(--n-400);
    margin-bottom: 110px;
	margin-top: 110px;
    max-width: 85ch;
    border-left: 2px solid var(--color-border);
    padding-left: var(--sp-5);
}

.hero__actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-4);
    align-items: center;
}

/* Portrait */
.hero__portrait {
    position: relative;
        height: 410px;
    border-radius: 225px;
    overflow: hidden;
    box-shadow: var(--shadow-lg), var(--shadow-glow);
}

.hero__portrait img {
    width: 100%;
    height: auto;
    /*aspect-ratio: 4 / 5;*/
    object-fit: cover;
    display: block;
}

/* Decorative accent behind portrait */
.hero__portrait::before {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: inherit;
    padding: 1px;
    background: linear-gradient(
        160deg,
        oklch(58% 0.17 248 / 0.4) 0%,
        transparent 50%,
        oklch(30% 0.12 248 / 0.2) 100%
    );
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    pointer-events: none;
}

.hero__scroll {
    position: absolute;
    bottom: var(--sp-8);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--sp-2);
    color: var(--color-muted);
    font-size: var(--text-xs);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero__scroll-line {
    width: 1px;
    height: 48px;
    background: linear-gradient(to bottom, var(--color-accent), transparent);
    animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* ── Responsive adjustments for hero portrait ── */
@media (max-width: 1024px) {
    .hero__content {
        grid-template-columns: 1fr 320px;
        gap: var(--sp-10);
    }
}

@media (max-width: 768px) {
    .hero__content {
        grid-template-columns: 1fr;
        gap: var(--sp-10);
        text-align: center;
    }
	
	.hero__actions { display: flex;
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 45px; 
	}

    .hero__text {
        max-width: 100%;
        order: 2;
    }

    .hero__portrait {
        order: 1;
        max-width: 260px;
        margin-inline: auto;
		margin-top: 50px;
    }

    .hero__eyebrow { display: flex;
        justify-content: center;
        flex-direction: column-reverse; }
    .hero__quote { 
        border-left: none; 
        padding-left: 0;
        margin-inline: auto;
		margin-bottom: 40px;
        margin-top: 40px;
    }
    .hero__actions { justify-content: center; }
	
	.hero__scroll {display: none;}
}

@media (max-width: 480px) {
    .hero__portrait { max-width: 300px; margin-top: 50px; height: 300px; }
    .hero__actions { display: flex;
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 45px; }
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-6);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  font-weight: 500;
  letter-spacing: 0.03em;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  min-height: 44px;
  position: relative;
  overflow: hidden;
}
.btn:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }
.btn:active { transform: scale(0.98); }

.btn--primary {
  background: var(--color-accent);
  color: var(--n-950);
}
.btn--primary:hover {
  background: var(--color-accent-hover);
  color: var(--n-950);
  box-shadow: 0 0 24px oklch(58% 0.17 248 / 0.35);
}

.btn--ghost {
  background: transparent;
  color: var(--n-300);
  border: 1px solid var(--color-border);
}
.btn--ghost:hover {
  background: var(--n-800);
  color: var(--color-heading);
  border-color: var(--n-700);
}

.btn--text {
  padding-inline: 0;
  color: var(--color-accent);
  gap: var(--sp-1);
}
.btn--text:hover { color: var(--color-accent-hover); }
.btn--text::after { content: '→'; transition: transform var(--t-fast); }
.btn--text:hover::after { transform: translateX(4px); }

/* ============================================================
   SECTION CHROME
   ============================================================ */
.section { padding-block: var(--sp-24); }
.section--sm { padding-block: var(--sp-16); }
.section--alt { background: var(--color-surface); }

.section-header {
  margin-bottom: var(--sp-12);
}
.section-header--center { text-align: center; }

.section-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-4);
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--color-accent);
}

@media(max-width: 768px) {
	.section-eyebrow {
		display: flex;
        justify-content: center;
        flex-direction: column-reverse;
	}
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-serif);
  font-weight: 400;
  color: var(--color-heading);
  line-height: 1.25;
}
.section-title { font-size: clamp(var(--text-3xl), 4vw, var(--text-4xl)); margin-bottom: var(--sp-4); }
.section-subtitle { font-size: var(--text-lg); color: var(--n-400); max-width: 60ch; }
.section-header--center .section-subtitle { margin-inline: auto; }

@media (max-width: 768px) {
	.section-title {
		    display: flex;
    font-size: clamp(var(--text-3xl), 4vw, var(--text-4xl));
    margin-bottom: var(--sp-4);
    justify-content: center;
	}
}

/* Divider */
.divider {
  width: 100%;
  height: 1px;
  background: var(--color-border);
  margin-block: 0;
}

/* ============================================================
   FEATURED BOOK STRIP (homepage)
   ============================================================ */
.featured-book {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--sp-12);
  align-items: center;
}
.featured-book__cover {
  /*width: 220px;*/
  flex-shrink: 0;
  border-radius: var(--r-md);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  overflow: hidden;
}
.featured-book__cover img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}
.featured-book__badge {
  display: inline-flex;
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-4);
}
.featured-book__title {
  font-size: clamp(var(--text-2xl), 3.5vw, var(--text-4xl));
  margin-bottom: var(--sp-4);
}
.featured-book__genre {
  font-size: var(--text-sm);
  color: var(--color-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  margin-bottom: var(--sp-5);
}
.featured-book__excerpt {
  font-size: var(--text-base);
  color: var(--n-400);
  line-height: 1.75;
  max-width: 55ch;
  margin-bottom: var(--sp-8);
}
.featured-book__actions { display: flex; gap: var(--sp-4); flex-wrap: wrap; }

@media (max-width: 768px) {
	.featured-book__info {
		display: flex;
    flex-direction: column;
    align-items: center;
	}
}

/* ============================================================
   NEWS CATEGORY FILTERS
   ============================================================ */
.news-categories {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    margin-bottom: var(--sp-8);
}

.category-button {
    display: inline-flex;
    align-items: center;
    padding: var(--sp-2) var(--sp-4);
    border-radius: var(--r-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    letter-spacing: 0.02em;
    color: var(--n-400);
    background: transparent;
    border: 1px solid var(--color-border);
    cursor: pointer;
    transition: 
        background var(--t-fast), 
        color var(--t-fast), 
        border-color var(--t-fast),
        box-shadow var(--t-fast);
    min-height: 36px;
    line-height: 1;
}

.category-button:hover {
    color: var(--color-heading);
    background: var(--n-800);
    border-color: var(--n-700);
}

.category-button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.category-button.active {
    color: var(--n-950);
    background: var(--color-accent);
    border-color: var(--color-accent);
    box-shadow: 0 0 16px oklch(58% 0.17 248 / 0.25);
}

.category-button.active:hover {
    background: var(--color-accent-hover);
    border-color: var(--color-accent-hover);
    color: var(--n-950);
}

@media (max-width: 480px) {
    .news-categories {
        gap: var(--sp-1);
    }
    .category-button {
        padding: var(--sp-2) var(--sp-3);
        font-size: var(--text-xs);
        min-height: 32px;
    }
}

/* ============================================================
   NEWS SECTION (homepage block)
   ============================================================ */
.news-section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: var(--sp-4);
  margin-bottom: var(--sp-10);
  flex-wrap: wrap;
}

@media (max-width: 768px) {
	.news-section-header {
		display: flex;
    flex-direction: column;
    align-items: center;
	}
}

/* ============================================================
   SINGLE POST — TWO-COLUMN LAYOUT (desktop only)
   ============================================================ */
.single-post-layout {
    display: block; /* Мобильная: обычный поток */
}

.single-post-sidebar {
    margin-bottom: var(--sp-10);
}

.single-post-content {
    max-width: var(--max-text);
}

/* Десктоп: две колонки 1/3 + 2/3 */
@media (min-width: 1024px) {
    .single-post-layout {
        display: grid;
        grid-template-columns: 1fr 2fr;
        gap: var(--sp-16);
        align-items: start;
    }

    .single-post-sidebar {
        position: sticky;
        top: calc(var(--header-h) + var(--sp-8));
        margin-bottom: 0;
        max-height: calc(100vh - var(--header-h) - var(--sp-16));
        overflow-y: auto;
    }

    /* Скроллбар для сайдбара, если контент длиннее viewport */
    .single-post-sidebar::-webkit-scrollbar {
        width: 4px;
    }
    .single-post-sidebar::-webkit-scrollbar-track {
        background: transparent;
    }
    .single-post-sidebar::-webkit-scrollbar-thumb {
        background: var(--color-border);
        border-radius: 2px;
    }

    .single-post-content {
        max-width: none; /* Ширина определяется колонкой grid */
    }
}

/* ============================================================
   STATS / NUMBERS
   ============================================================ */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: var(--sp-1);
}
.stat-item {
  padding: var(--sp-8) var(--sp-6);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
  text-align: center;
  background: var(--color-surface);
  transition: border-color var(--t-std), box-shadow var(--t-std);
}
.stat-item:hover {
  border-color: var(--a-700);
  box-shadow: var(--shadow-glow);
}
.stat-item__number {
  font-family: var(--font-serif);
  font-size: var(--text-5xl);
  color: var(--color-heading);
  line-height: 1;
  margin-bottom: var(--sp-2);
  display: block;
}
.stat-item__label {
  font-size: var(--text-sm);
  color: var(--color-muted);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* ============================================================
   TESTIMONIALS / REVIEWS
   ============================================================ */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: var(--sp-6);
}
.testimonial-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
  transition: border-color var(--t-std), box-shadow var(--t-std), transform var(--t-std);
}
.testimonial-card:hover {
  border-color: var(--a-700);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
}
.testimonial-card__quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-base);
  color: var(--n-300);
  line-height: 1.75;
  margin-bottom: var(--sp-6);
  position: relative;
  padding-top: var(--sp-5);
}
.testimonial-card__quote::before {
  content: '\201C';
  position: absolute;
  top: -8px;
  left: 0;
  font-size: 4rem;
  color: var(--color-accent);
  line-height: 1;
  font-family: var(--font-serif);
}
.testimonial-card__author { display: flex; flex-direction: column; gap: var(--sp-1); }
.testimonial-card__name { font-size: var(--text-sm); font-weight: 600; color: var(--color-heading); }
.testimonial-card__source { font-size: var(--text-xs); color: var(--color-muted); }

/* ============================================================
   ABOUT PAGE
   ============================================================ */
.about-grid {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: var(--sp-16);
  align-items: start;
}
.about-photo-wrap {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-8));
}
.about-photo {
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}
.about-photo img {
  width: 100%;
  aspect-ratio: 3/4;
  object-fit: cover;
}
.about-photo-caption {
  margin-top: var(--sp-4);
  font-size: var(--text-sm);
  color: var(--color-muted);
  text-align: center;
  font-style: italic;
}
.about-content h2 {
  font-size: var(--text-3xl);
  margin-top: var(--sp-10);
  margin-bottom: var(--sp-4);
}
.about-content h2:first-child { margin-top: 0; }
.about-content p {
  font-size: var(--text-base);
  color: var(--n-300);
  line-height: 1.8;
  margin-bottom: var(--sp-5);
}
.about-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: var(--sp-4) var(--sp-6);
  margin-block: var(--sp-8);
  background: var(--color-surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.about-content blockquote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-lg);
  margin-bottom: 0;
  color: var(--n-200);
}
.awards-list { display: flex; flex-direction: column; gap: var(--sp-4); margin-bottom: var(--sp-8); }
.award-item {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  padding: var(--sp-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-md);
}
.award-item__year {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--color-accent);
  flex-shrink: 0;
  line-height: 1;
  min-width: 3rem;
}
.award-item__info { display: flex; flex-direction: column; gap: var(--sp-1); }
.award-item__title { font-size: var(--text-base); color: var(--color-heading); font-weight: 500; }
.award-item__desc { font-size: var(--text-sm); color: var(--color-muted); }

/* ============================================================
   SINGLE BOOK PAGE
   ============================================================ */
.single-book-hero {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: var(--sp-12);
  align-items: start;
  padding-block: var(--sp-16);
}
.single-book__cover {
  position: sticky;
  top: calc(var(--header-h) + var(--sp-8));
  border-radius: var(--r-md);
  overflow: hidden;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}
.single-book__cover img {
  width: 100%;
  aspect-ratio: 2/3;
  object-fit: cover;
}
.single-book__meta { display: flex; flex-direction: column; gap: var(--sp-2); margin-block: var(--sp-6); }
.single-book__meta-item {
  display: flex;
  gap: var(--sp-3);
  font-size: var(--text-sm);
  color: var(--color-muted);
}
.single-book__meta-label { color: var(--n-400); min-width: 80px; }
.single-book__buy-links { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-6); }

.book-excerpt {
  padding: var(--sp-12) 0;
  border-top: 1px solid var(--color-border);
}
.book-excerpt__title {
  font-size: var(--text-2xl);
  margin-bottom: var(--sp-8);
}
.book-excerpt__text {
  font-family: var(--font-serif);
  font-size: var(--text-lg);
  line-height: 1.85;
  color: var(--n-300);
  max-width: var(--max-text);
  column-count: 1;
}
.book-excerpt__text p { margin-bottom: var(--sp-5); }
.book-excerpt__text p:first-of-type::first-letter {
  float: left;
  font-size: 4.5em;
  line-height: 0.8;
  margin: 0.05em 0.1em 0 0;
  color: var(--color-accent);
  font-family: var(--font-serif);
}

/* Натуральный размер обложки без принудительного растяжения */
.single-book__cover {
    width: fit-content;
    max-width: 280px;   
}

.single-book__cover img {
    width: auto;    
    max-width: 100%;   
    height: auto;       
    aspect-ratio: auto; 
    object-fit: unset;  
}

/* ============================================================
   BLOG / NEWS
   ============================================================ */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: var(--sp-6);
}
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: border-color var(--t-std), box-shadow var(--t-std), transform var(--t-std);
  text-decoration: none;
  color: inherit;
}
.post-card:hover {
  border-color: var(--a-700);
  box-shadow: var(--shadow-glow);
  transform: translateY(-3px);
  color: inherit;
}
.post-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  transition: transform var(--t-slow);
}
.post-card:hover .post-card__img { transform: scale(1.04); }
.post-card__img-wrap { overflow: hidden; }
.post-card__body { padding: var(--sp-6); flex: 1; display: flex; flex-direction: column; gap: var(--sp-3); }
.post-card__meta { display: flex; gap: var(--sp-3); align-items: center; font-size: var(--text-xs); color: var(--color-muted); }
.post-card__cat {
  color: var(--color-accent);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-card__title {
  font-family: var(--font-serif);
  font-size: var(--text-xl);
  color: var(--color-heading);
  line-height: 1.3;
}
.post-card:hover .post-card__title { color: var(--color-accent-hover); }
.post-card__excerpt { font-size: var(--text-sm); color: var(--n-400); line-height: 1.7; flex: 1; }
.post-card__footer {
  padding: var(--sp-4) var(--sp-6);
  border-top: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.post-card__read-more { font-size: var(--text-sm); color: var(--color-accent); }

/* Single post / article */
.entry-header { margin-bottom: var(--sp-10); }
.entry-header .post-meta {
  display: flex; gap: var(--sp-4); flex-wrap: wrap;
  font-size: var(--text-sm); color: var(--color-muted);
  margin-bottom: var(--sp-4);
}
.entry-header .post-meta a { color: var(--color-accent); }
.entry-header h1 {
  font-size: clamp(var(--text-3xl), 5vw, var(--text-5xl));
  margin-bottom: var(--sp-4);
}
.entry-thumbnail {
    margin-bottom: var(--sp-10);
    border-radius: var(--r-lg);
    overflow: hidden;
    display: flex;
    max-height: 480px;
    flex-direction: row;
    align-content: center;
    align-items: center;
}
.entry-thumbnail img { width: 100%; object-fit: contain; }

.entry-content {
  font-size: var(--text-lg);
  line-height: 1.8;
  color: var(--n-300);
  max-width: 100%;
}
.entry-content h2 { font-size: var(--text-3xl); margin-top: var(--sp-10); margin-bottom: var(--sp-4); }
.entry-content h3 { font-size: var(--text-2xl); margin-top: var(--sp-8); margin-bottom: var(--sp-3); }
.entry-content p { margin-bottom: var(--sp-5); }
.entry-content a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 3px; }
.entry-content blockquote {
  border-left: 3px solid var(--color-accent);
  padding: var(--sp-4) var(--sp-6);
  margin-block: var(--sp-8);
  background: var(--color-surface);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--text-xl);
}
.entry-content ul, .entry-content ol {
  list-style: initial;
  padding-left: var(--sp-6);
  margin-bottom: var(--sp-5);
}
.entry-content li { margin-bottom: var(--sp-2); }
.entry-content img { border-radius: var(--r-md); margin-block: var(--sp-6); }
.entry-content hr { border: none; height: 1px; background: var(--color-border); margin-block: var(--sp-10); }

/* ============================================================
   CONTACT PAGE
   ============================================================ */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: var(--sp-16);
  align-items: start;
}
.contact-form { display: flex; flex-direction: column; gap: var(--sp-5); }
.form-group { display: flex; flex-direction: column; gap: var(--sp-2); }
.form-label {
  font-size: var(--text-sm);
  color: var(--n-300);
  font-weight: 500;
  letter-spacing: 0.03em;
}
.form-input,
.form-textarea {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  padding: var(--sp-3) var(--sp-4);
  color: var(--color-body);
  font-size: var(--text-base);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  width: 100%;
}
.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px oklch(58% 0.17 248 / 0.15);
}
.form-input::placeholder,
.form-textarea::placeholder { color: var(--color-muted); }
.form-textarea { resize: vertical; min-height: 180px; }
.form-error {
  font-size: var(--text-xs);
  color: var(--color-danger);
  display: none;
}
.form-group.has-error .form-input,
.form-group.has-error .form-textarea { border-color: var(--color-danger); }
.form-group.has-error .form-error { display: block; }

.contact-info { display: flex; flex-direction: column; gap: var(--sp-6); }
.contact-info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--r-lg);
  padding: var(--sp-8);
}
.contact-info-card h3 { font-size: var(--text-xl); margin-bottom: var(--sp-6); }
.contact-item {
  display: flex;
  gap: var(--sp-4);
  align-items: flex-start;
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--color-border);
}
.contact-item:last-child { border-bottom: none; }
.contact-item__icon {
  width: 40px; height: 40px;
  border-radius: var(--r-sm);
  background: var(--color-accent-dim);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--color-accent);
  font-size: 1.1rem;
}
.contact-item__label { font-size: var(--text-xs); color: var(--color-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.contact-item__value { font-size: var(--text-sm); color: var(--n-300); margin-top: var(--sp-1); }
.contact-item__value a { color: var(--color-accent); }

.social-links { display: flex; gap: var(--sp-3); flex-wrap: wrap; margin-top: var(--sp-2); }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-2) var(--sp-3);
  background: var(--n-800);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--n-300);
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  min-height: 44px;
}
.social-link:hover {
  background: var(--color-accent-dim);
  color: var(--color-accent);
  border-color: var(--a-700);
}

/* ============================================================
   PAGE HERO (inner pages)
   ============================================================ */
.page-hero {
  padding-block: var(--sp-16) var(--sp-12);
  border-bottom: 1px solid var(--color-border);
  position: relative;
  overflow: hidden;
}
.page-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 60% 100% at 80% 50%, oklch(26% 0.10 248 / 0.12) 0%, transparent 70%);
  pointer-events: none;
}
.page-hero__eyebrow {
  font-size: var(--text-xs);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--sp-4);
}
.page-hero h1 {
  font-size: clamp(var(--text-4xl), 5vw, var(--text-5xl));
  margin-bottom: var(--sp-4);
}
.page-hero__lead {
  font-size: var(--text-xl);
  color: var(--n-400);
  max-width: 65ch;
  line-height: 1.6;
}

/* ============================================================
   BREADCRUMBS
   ============================================================ */
.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  align-items: center;
  font-size: var(--text-sm);
  color: var(--color-muted);
  margin-bottom: var(--sp-6);
}
.breadcrumbs a { color: var(--color-muted); }
.breadcrumbs a:hover { color: var(--color-accent); }
.breadcrumbs__sep { color: var(--n-700); }
.breadcrumbs__current { color: var(--n-400); }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: var(--sp-2);
  margin-top: var(--sp-12);
  flex-wrap: wrap;
}
.pagination__item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding-inline: var(--sp-3);
  border: 1px solid var(--color-border);
  border-radius: var(--r-sm);
  font-size: var(--text-sm);
  color: var(--n-300);
  transition: background var(--t-fast), border-color var(--t-fast), color var(--t-fast);
}
.pagination__item:hover {
  background: var(--n-800);
  border-color: var(--n-700);
  color: var(--color-heading);
}
.pagination__item--active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: var(--n-950);
}
.pagination__item--active:hover {
  background: var(--color-accent-hover);
  color: var(--n-950);
}

/* ============================================================
   SHORTCODE OVERRIDES — ensure brand consistency
   ============================================================ */
/* book_cards shortcode wrapper alignment */
.books-shortcode-section .book-cards-wrapper { padding: 0; }
/* news_cards shortcode in homepage section */
.news-shortcode-section .news-cards-wrapper { padding: 0; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--color-surface);
  border-top: 1px solid var(--color-border);
  padding-block: var(--sp-16) var(--sp-8);
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--sp-10);
  margin-bottom: var(--sp-12);
}
.footer-brand__name {
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--color-heading);
  margin-bottom: var(--sp-3);
}
.footer-brand__desc {
  font-size: var(--text-sm);
  color: var(--color-muted);
  line-height: 1.7;
  max-width: 35ch;
  margin-bottom: var(--sp-5);
}
.footer-col__title {
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--n-400);
  margin-bottom: var(--sp-5);
  font-family: var(--font-sans);
}
.footer-col ul { display: flex; flex-direction: column; gap: var(--sp-3); }
.footer-col a { font-size: var(--text-sm); color: var(--color-muted); transition: color var(--t-fast); }
.footer-col a:hover { color: var(--color-accent); }
.footer-bottom {
  border-top: 1px solid var(--color-border);
  padding-top: var(--sp-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4);
  flex-wrap: wrap;
}
.footer-bottom__copy { font-size: var(--text-sm); color: var(--color-muted); }
.footer-bottom__links { display: flex; gap: var(--sp-5); }
.footer-bottom__links a { font-size: var(--text-sm); color: var(--color-muted); }
.footer-bottom__links a:hover { color: var(--color-accent); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .about-grid { grid-template-columns: 260px 1fr; gap: var(--sp-10); }
  .single-book-hero { grid-template-columns: 240px 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .featured-book { grid-template-columns: 180px 1fr; gap: var(--sp-8); }
}

@media (max-width: 768px) {
  :root { --header-h: 60px; }
    
    .nav-toggle { 
        display: flex; 
        position: relative;
        z-index: 101; /* Поверх меню, чтобы бургер всегда был кликабелен */
    }
    
    .main-nav {
        position: fixed;
        top: var(--header-h);
        left: 0;
        right: 0;
        background: var(--n-900);
        flex-direction: column;
        align-items: stretch;
        padding: var(--sp-6);
        gap: var(--sp-2);
        transform: translateX(100%);
        transition: transform var(--t-std);
        border-top: 1px solid var(--color-border);
        z-index: 100;
        
        /* Ключевое: убираем из потока и скрываем от скринридеров */
        visibility: hidden;
        pointer-events: none;
    }
    
    .main-nav.is-open {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
    }
    
    .main-nav__list { 
        flex-direction: column; 
        align-items: stretch; 
    }
    
    .main-nav__link { 
        display: flex;
        padding: var(--sp-3) var(--sp-4);
        font-size: var(--text-base);
        justify-content: center;
    }
  .footer-grid { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .about-photo-wrap { position: static; max-width: 280px; }
  .single-book-hero { display: flex; grid-template-columns: 1fr; flex-direction: column; align-items: center; }
  .single-book__cover { position: static; max-width: 200px; }
  .featured-book { 
        grid-template-columns: 1fr; 
    }
    
    .featured-book__cover { 
        max-width: 180px; 
        margin-inline: auto; /* Центрируем обложку над текстом */
    }
    
    /* Ключевое исправление: убираем жёсткие пропорции на мобильных */
    .featured-book__cover img {
        width: 100%;
        height: auto;
        object-fit: contain; /* Или просто убираем cover */
    }
  .section { padding-block: var(--sp-16); }
  .section--sm { padding-block: var(--sp-10); }
  .page-hero { padding-block: var(--sp-10) var(--sp-8); }
}

@media (max-width: 480px) {
  .container { padding-inline: var(--sp-4); }
  .hero__actions { display: flex;
        flex-direction: row;
        align-items: flex-start;
        margin-bottom: 45px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .testimonials-grid { grid-template-columns: 1fr; }
  .posts-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* ============================================================
   REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero__scroll-line { animation: none; }
}

/* ============================================================
   PRINT
   ============================================================ */
@media print {
  .site-header, .site-footer, .nav-toggle, .hero__scroll { display: none; }
  body { background: #fff; color: #000; }
  a[href]::after { content: ' (' attr(href) ')'; font-size: 0.8em; }
}



/* ============================================================
   BOOK INFO (allinfo repeater) — shared styles
   ============================================================ */
.book-info-wrapper {
    font-family: "Zen Kaku Gothic Antique", var(--font-sans);
    text-align: left;
    margin: 0 auto;
    color: var(--color-body);
    font-size: var(--text-base);
    line-height: 1.7;
}

.book-info-item {
    margin-bottom: var(--sp-3);
    display: flex;
    align-items: baseline;
    gap: var(--sp-3);
}

.book-info-label {
    font-weight: 500;
    color: var(--n-400);
    flex-shrink: 0;
    min-width: 140px;
    letter-spacing: 0.02em;
}

.book-info-label:after {
    content: ":";
    margin-right: var(--sp-1);
}

.book-info-value {
    font-weight: 300;
    color: var(--n-200);
    line-height: 1.6;
}

.book-info-plain {
    margin-bottom: var(--sp-6);
    line-height: 1.8;
    color: var(--n-300);
    font-size: var(--text-lg);
}

@media (max-width: 768px) {
    .book-info-item {
        flex-direction: column;
        gap: var(--sp-1);
    }
    .book-info-label {
        min-width: unset;
        font-size: 13.5px;
        text-transform: uppercase;
        letter-spacing: 0.08em;
    }
}


/* ============================================================
   PROGRESS BLOCK
   ============================================================ */
.progress-block {
    display: flex;
    align-items: center;
    gap: var(--sp-12);
	
}

.section-ring {
	    display: flex;
    align-items: center;
    height: 750px;
    flex-direction: column;
}

.progress-ring-wrap {
    position: relative;
    width: 180px;
    height: 180px;
    flex-shrink: 0;
}

.progress-ring {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.progress-ring__bg {
    fill: none;
    stroke: var(--color-border);
    stroke-width: 8;
}

.progress-ring__fill {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 8;
    stroke-linecap: round;
    /* Длина окружности = 2πr = 2 × 3.14159 × 52 ≈ 326.73 */
    stroke-dasharray: 326.73;
    stroke-dashoffset: calc(326.73 - (326.73 * var(--progress, 0) / 100));
    transition: stroke-dashoffset 1s var(--ease-std);
}

.progress-ring__value {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.progress-ring__percent {
    font-family: var(--font-serif);
    font-size: var(--text-5xl);
    color: var(--color-heading);
    line-height: 1;
}

.progress-ring__unit {
    font-size: var(--text-xl);
    color: var(--color-muted);
    margin-top: var(--sp-2);
}

.progress-info {
    flex: 1;
}

.progress-stage {
    font-size: var(--text-xs);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: var(--sp-3);
}

.progress-title {
    font-size: 30px;
    margin-bottom: var(--sp-3);
}

.progress-chars {
    font-size: var(--text-sm);
    color: var(--color-muted);
    margin-bottom: var(--sp-6);
}

.progress-cover {
    max-height: 571px;
    border-radius: var(--r-md);
    box-shadow: var(--shadow-md);
}

.pr__bg {
    display: flex;
    align-items: center;
	width: 1520px;
    height: 650px;
    flex-direction: column;
    background:
        radial-gradient(ellipse 80% 60% at 60% 40%, oklch(26% 0.10 248 / 0.25) 0%, transparent 65%),
        radial-gradient(ellipse 50% 80% at 10% 70%, oklch(18% 0.06 255 / 0.30) 0%, transparent 60%),
        var(--color-bg);
}

@media (max-width: 768px) {
    .progress-block {
        flex-direction: column;
        text-align: center;
        gap: var(--sp-8);
		margin-bottom: 65px;
	margin-top: 65px;
    }
    .progress-ring-wrap {
        width: 150px;
        height: 150px;
    }
    .progress-ring__percent { font-size: var(--text-4xl); }
    .progress-cover { margin-inline: auto; height: 270px; }
	
	 .section-ring {
        display: contents;
        align-items: center;
        /* height: 932px; */
        flex-direction: column;
    }
}