:root {
    /* светлая тема по умолчанию */
    --bg: #F5F1EB;          /* фон страницы */
    --bg-alt: #FFFFFF;      /* фон карточек */
    --bg-paper: #F3E1DA;    /* мягкий красный фон для секций */
    
    --text-main: #151515;
    --text-muted: #5A5A5A;
    --text-invert: #FDFDFD;

    --accent: #B01F2A;      /* насыщенный бордово-красный */
    --accent-soft: #E05057;
    --accent-dark: #3E1014;

    --border-subtle: #E0D4CF;

    --radius-lg: 18px;
    --radius-md: 10px;
    --radius-sm: 4px;
    
    --header-h: 64px; 

    --font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Inter", sans-serif;
}


/* Тёмная тема: переопределяем переменные на уровне body */
body.is-dark {
    --bg: #160D11;          /* общий фон */
    --bg-alt: #1F1317;      /* блоки/карточки */
    --bg-paper: #2B1519;    /* фон геро-зоны */

    --text-main: #F7F4F4;
    --text-muted: #B7A6AA;
    --text-invert: #060405;

    --accent: #E05057;      /* яркий красный на тёмном */
    --accent-soft: #FF7C84;
    --accent-dark: #000000;

    --border-subtle: #3B2227;
}



/* Светлая тема по умолчанию */
body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--text-main);
    max-width: 100%;

}

/* Prevent padding/margins from increasing layout width and causing overflow/zoom */
*, *::before, *::after { box-sizing: border-box; }



.site-wrapper {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Prevent the whole page from scrolling horizontally while allowing
   slider elements to peek outside their container. */
.site-wrapper { overflow-x: hidden; }

/* HEADER */

.site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 999;
    transition: transform 0.3s ease, background-color 0.3s ease;
}

/* When hidden */
.site-header.hidden {
    transform: translateY(-100%);
}



.brand {
    display: inline-flex;        /* было flex */
    flex-direction: row;         /* было column */
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: var(--text-main);
    margin-left: 8px;
}

.brand-text {
    font-size: 1.4rem;
    letter-spacing: 0.08em;
    margin-top: 0;               /* было 4px */
    line-height: 1;
}

.brand-mark {
    margin-bottom: -4px;   /* optional visual tweak */
}
/* Иконка */
.brand .site-logo-mark{
  height: 22px;
  width: auto;
  display: block;
  margin-right: 0; /* если где-то был margin */
}

/* Текст */
.brand .brand-text{
  display: inline-block;
  white-space: nowrap; /* чтобы "kontekst" не переносился */
}


/* NAV LINKS */
.site-nav a {
    position: relative;
    font-size: 1.15rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    color: var(--text-main);
    text-decoration: none;
    padding: 6px 2px;
}

/* underline по умолчанию: скрыт */
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 2px;   /* было -6px */
    width: 0;
    height: 2px;
    background: var(--accent);
    transition: width .18s ease-out;
}
/* hover: показываем линию */
.site-nav a:hover::after {
    width: 100%;
}

/* ACTIVE: всегда красная и линия на 100% + легкое "свечение" */
.site-nav a.active,
.site-nav a[aria-current="page"] {
    color: var(--accent);
    font-weight: 650;
}

.site-nav a.active::after,
.site-nav a[aria-current="page"]::after {
    width: 100%;
}

/* glow аккуратный, чтобы не выглядел неоном */
.site-nav a.active,
.site-nav a[aria-current="page"] {
    text-shadow: 0 0 6px rgba(176, 31, 42, 0.25);
}

.theme-toggle {
    margin-right: 12px;
    margin-top: 0;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 16px;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;

}

.theme-toggle:hover {
    background: var(--accent);
    color: var(--text-invert);
    transform: scale(1.05);
}

body.is-dark .theme-toggle {
    background: var(--accent);
    color: var(--text-invert);
}

.gh-head-actions {
    justify-self: end !important;
}


/* MAIN */

.site-main {
    flex: 1;
}
.site-header { min-height: var(--header-h); height: auto; }
.site-main { padding-top: var(--header-h); }


/* HERO */

.hero {
    position: relative;
    padding-top: 24px;   /* было 80 – поднимаем выше */
    padding-bottom: 32px;
}

/* Центровка featured */
.hero-center {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;   /* центрируем */
    padding: 0 20px;
}

.hero.hero--avant {
    border-bottom: 1px solid var(--border-subtle);
    background: linear-gradient(90deg, var(--bg-paper) 0, var(--bg-alt) 45%);
    position: relative;
}

.hero-feature.hero-feature--center {
    max-width: 640px;
    padding: 24px 26px 22px;
    background: var(--bg-alt);
    border-radius: 0;
    border: 3px solid var(--accent);
    box-shadow: 12px 12px 0 var(--accent-dark);
    position: relative;
}

.hero-feature.hero-feature--center::before {
    content: "";
    position: absolute;
    top: -10px;
    left: 18px;
    width: 120px;
    height: 6px;
    background: var(--accent);  /* красная полоска */
}

    .hero-brand-ribbon {
        top: 10px;
        right: 10px;
        max-width: 220px;
    }

    .hero-feature-wrapper {
  width: 100%;
  display: flex;
  justify-content: center;
  margin-top: 18px; /* было 0 */
}

.hero-prev::before {
  transform: rotate(135deg);
}

.hero-next::before {
  transform: rotate(-45deg);
}


/* Чтобы и в тёмной теме выглядело выразительно */
body.is-dark .hero-tagline-block {
    background: var(--accent);
    color: var(--text-invert);
    box-shadow: 4px 4px 0 #000;
}

/* Текст внутри featured */

.hero-eyebrow {
    font-size: 11px;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--accent);
}

.hero-title {
    margin: 10px 0 8px;
    font-size: 26px;
    line-height: 1.2;
    text-transform: none;
}

.hero-excerpt {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.hero-meta {
    margin-top: 10px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.18em;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
}

.hero-button {
    display: inline-flex;
    margin-top: 16px;
    padding: 8px 16px;
    border-radius: 0;
    background: var(--accent);
    color: #ffffff;
    text-decoration: none;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
}


.site-nav::-webkit-scrollbar {
    display: none;
}

@media(max-width:768px){
    .hero {
        margin-top: 24px;
        padding: 0 12px;
    }

    .hero-feature {
        padding: 18px 16px;
    }

    .hero-tagline-block {
        max-width: 100%;
    }

    .section-latest {
        margin: 32px auto 48px;
        padding: 0 16px;
    }
}


.site-header {
  background: transparent;
  border-bottom: 0;
}

/* FIX: состояние после скролла */
.site-header.scrolled {
  background: var(--bg-alt);
  border-bottom: 3px solid var(--accent);
}

/* логотип слева, навигация в центре, кнопка справа */
.site-header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 12px;
    padding-bottom: 8px;
      overflow-x: hidden;

}


    .site-nav {
    display: flex;
    gap: 40px;   /* previously 18px — more breathing room */
    font-size: 14px;
    letter-spacing: 0.03em;  /* optional slight spacing between letters */
}

.site-header,
.site-header-inner,
.site-nav {
  max-width: 100%;
}

.site-nav {
  scrollbar-width: none;          /* Firefox */
  -ms-overflow-style: none;       /* IE / Edge legacy */
}

.site-nav::-webkit-scrollbar {
  display: none;                  /* Chrome, Safari, iOS */
}

.post-content .kg-width-wide,
.post-content .kg-gallery-card.kg-width-wide {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.post-content .kg-width-full,
.post-content .kg-gallery-card.kg-width-full {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    transform: none;
}

.post-cover {
  position: relative; /* FIX: якорь для ::after */
  width: 100%;
  height: 48vh;
  max-height: 520px;
  min-height: 240px;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  margin-bottom: 32px;
  border-bottom: 3px solid var(--accent);
}

.post-cover::after {
  content: "";
  position: absolute; /* FIX: реально накрывает обложку */
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,.35),
    rgba(0,0,0,.15),
    rgba(0,0,0,0)
  );
  pointer-events: none;
}

.about-hero {
    padding: 80px 0 40px;
    border-bottom: 2px solid var(--accent);
    text-align: center;
}

.about-title {
    font-size: 46px;
    font-weight: 700;
    letter-spacing: 0.04em;
    margin-bottom: 12px;
}

.about-subtitle {
    font-size: 16px;
    opacity: 0.8;
    max-width: 540px;
    margin: 0 auto;
}

.about-body {
    max-width: 820px;
    margin: 60px auto;
    padding: 0 24px;
}

.about-section {
    margin-bottom: 48px;
}

.about-section h2 {
    font-size: 20px;
    margin-bottom: 12px;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--accent);
}

.about-section p {
    line-height: 1.7;
    font-size: 16px;
}

.about-list {
    list-style: none;
    padding: 0;
}

.about-list li {
    margin-bottom: 10px;
    padding-left: 18px;
    position: relative;
}

.about-list li::before {
    content: "—";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: bold;
}

.about-content {
    margin-top: 60px;
    line-height: 1.7;
}
.page-main {
    max-width: 820px;
    margin: 80px auto 80px;
    padding: 0 24px;
}

.page-hero {
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 2px solid var(--accent);
}

.page-title {
    font-size: 32px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    margin: 0 0 8px;
}

.page-subtitle {
    font-size: 15px;
    opacity: 0.85;
    max-width: 640px;
}

.page-content {
    line-height: 1.7;
    font-size: 16px;
}


.hero-title { font-size: clamp(20px, 4.5vw, 28px); }
.about-title { font-size: clamp(28px, 7vw, 46px); }
.page-title { font-size: clamp(22px, 5vw, 32px); }

.hero-excerpt { font-size: clamp(13px, 3.2vw, 15px); }
.post-content { font-size: clamp(15px, 3.6vw, 17px); }

.site-header-inner,
.section-latest,
.post,
.page-main {
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.hero--slider {
  position: relative;
  overflow: hidden;
}





/* Адаптация для мобилы */

@media (max-width: 768px) {
  .site-header-inner {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-areas:
      "brand"
      "nav";
    align-items: center;
    row-gap: 6px;
    padding: 8px 12px;
  }

  .brand { grid-area: brand; }
  .site-nav { grid-area: nav; }

  /* 2) Уменьшаем бренд (иконка + текст) */
  .brand {
    margin-left: 0;
    gap: 8px;
  }

  .brand .site-logo-mark {
    height: 18px; /* было 22 */
  }

  .brand-text {
    font-size: 1.05rem; /* было 1.4rem */
    letter-spacing: 0.06em;
  }

  /* 3) Кнопку темы делаем компактнее */
  .theme-toggle {
    width: 28px;   /* было 34 */
    height: 28px;  /* было 34 */
    font-size: 14px;
    margin-right: 0;
  }

  /* 4) Навигация — полноценная полоса со скроллом и нормальной тап-зоной */
  .site-nav {
    width: 100%;
    justify-content: flex-start;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    gap: 14px;
    padding: 2px 2px 6px;
    scroll-snap-type: x mandatory;
  }

  .site-nav a {
    scroll-snap-align: start;
    padding: 10px 10px; /* увеличиваем область нажатия */
    font-size: 0.95rem;
  }

  /* underline чуть ближе к ссылке, чтобы не конфликтовал с линией хедера */
  .site-nav a::after {
    bottom: -8px;
  }
}

/* SECTION: Latest */

.section-latest {
    max-width: 1024px;
    margin: 0 auto;
    padding: 28px 20px 40px;
    position: relative;
}

/* Красная полоска слева — авангардный штрих */
.section-latest::before {
    content: "";
    position: absolute;
    left: 0;
    top: 24px;
    bottom: 32px;
    width: 6px;
    background: var(--accent);
}

.section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 16px;
    padding-left: 14px;
}

.section-head h2 {
    font-size: 18px;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 0.18em;
}
.section-link {
    font-size: 13px;
    color: var(--text-muted);
    text-decoration: none;
}

.section-link:hover {
    color: var(--accent-soft);
}

/* POST CARDS */

.post-card-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.post-card {
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    padding: 14px 14px 16px;
    background: var(--bg-alt);
}

.post-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.post-card-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 6px;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-muted);
}

.post-tag {
    color: var(--accent-soft);
}

.post-time {
    opacity: 0.75;
}

.post-card-title {
    margin: 4px 0 4px;
    font-size: 16px;
}

.post-card-excerpt {
    margin: 0;
    font-size: 13px;
    color: var(--text-muted);
}

/* POST PAGE */

.post {
    max-width: 720px;
    margin: 32px auto 40px;
    padding: 0 20px;
}

.post-header {
    margin-bottom: 22px;
}

.post-tag-large {
    display: inline-block;
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--accent-soft);
    margin-bottom: 6px;
}

.post-title {
    margin: 0 0 6px;
    font-size: 28px;
}

.post-meta {
    font-size: 13px;
    color: var(--text-muted);
    display: flex;
    gap: 6px;
}

.post-content {
  font-size: 16px;
  line-height: 1.7;
  color: var(--text-main);
}

body.is-dark .post-content {
  color: var(--text-main);
}
/* FOOTER */

.post-content a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  background-image: linear-gradient(currentColor, currentColor);
  background-size: 100% 2px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 2px;
  transition: transform .15s ease, background-size .15s ease, color .15s ease;
}

.post-content a:hover {
  color: var(--accent-soft);
  background-size: 100% 6px;   /* “полоса” становится толще */
}

.post-content a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Чтобы длинные ссылки не ломали верстку */
.post-content a {
  overflow-wrap: anywhere;
}

/* QUOTES */
.post-content blockquote {
  position: relative;
  margin: 22px 0;
  padding: 18px 18px 18px 22px;

  background: var(--bg-paper);
  border-left: 6px solid var(--accent);
  border-radius: 14px;

  font-size: 1.12em;      /* крупнее, чем основной текст */
  line-height: 1.6;
  color: var(--text-main);

  box-shadow: 6px 6px 0 var(--accent-dark);
}

/* Убираем стандартные отступы у параграфа внутри цитаты */
.post-content blockquote p {
  margin: 0;
}

/* Большие кавычки */
.post-content blockquote::before {
  content: "“";
  position: absolute;
  left: 10px;
  top: -18px;

  font-size: 56px;
  line-height: 1;
  color: var(--accent);
  opacity: 0.85;
}

/* Если в цитате есть подпись/источник (часто через <cite> или <footer>) */
.post-content blockquote cite,
.post-content blockquote footer {
  display: block;
  margin-top: 10px;
  font-size: 0.9em;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.inline-figure {
  width: 38%;
  margin: 6px 0 18px;
}

/* плавающее изображение */
.figure-right {
  float: right;
  margin-left: 24px;
}

.figure-left {
  float: left;
  margin-right: 24px;
}

/* картинка */
.inline-figure img {
  width: 100%;
  height: auto;
  display: block;
}

/* подпись */
.inline-figure figcaption {
  margin-top: 6px;
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-muted);

  /* чтобы была компактной и в несколько строк */
  max-width: 100%;
}

/* немного воздуха после картинки */
.inline-figure::after {
  content: "";
  display: block;
  clear: both;
}

.site-footer {
    border-top: 2px solid var(--accent);
    padding: 10px 24px;
    font-size: 11px;
}

.footer-inner {
    max-width: 1024px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    color: var(--text-muted);
}

@media (max-width: 768px) {
  :root { --header-h: 56px; }
}

@media (max-width: 768px) {
  .site-header-inner .theme-toggle {
    margin: 0;
  }
}

@media (max-width: 768px) {
  .theme-toggle {
    bottom: calc(12px + env(safe-area-inset-bottom));
    right: calc(12px + env(safe-area-inset-right));
  }
}


@media (max-width: 768px) {
  .site-header-inner {
    padding: 8px 16px;
    column-gap: 16px;
    position: relative;
  }

  .site-nav {
    display: flex;
    justify-content: flex-start;
    gap: 18px;
    margin-left: 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    white-space: nowrap;
    scroll-snap-type: x mandatory;
    padding: 0 10px;
  }

  .site-nav::-webkit-scrollbar { display: none; }

  .site-nav a {
    scroll-snap-align: start;
    padding: 12px 8px;
    font-size: 0.95rem;
  }

  .site-nav a::after {
    bottom: -10px;
  }

  /* подсказка, что меню можно листать */
  .site-header-inner::after {
    content: "";
    position: absolute;
    right: 0;
    top: 0;
    width: 32px;
    height: 100%;
    pointer-events: none;
    background: linear-gradient(90deg, transparent, var(--bg-alt));
  }

  .hero { margin-top: 24px; padding: 0 12px; padding-top: 12px; padding-bottom: 18px; }

  .hero-feature.hero-feature--center::before {
    top: 0;
    left: 16px;
    width: 96px;
  }

  .hero-feature.hero-feature--center {
    padding-top: 30px;
    box-shadow: 6px 6px 0 var(--accent-dark);
  }

  .hero-tagline-block { max-width: 100%; }

  .section-latest {
    margin: 32px auto 48px;
    padding: 0 16px;
  }
}

/* =========================
   HERO SLIDER — CANONICAL
   ========================= */

.hero--slider {
  position: relative;
  overflow: visible;            /* allow arrows + peek (restore so arrows are clickable) */
}

.hero--slider .hero-slider {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;

  /* Small gutters so content never fights edges */
  padding: 0 18px;

  overflow: visible;            /* let side cards "peek" */
}

.hero--slider .hero-track {
  display: flex;
  gap: 32px;
  align-items: stretch;

  transition: transform .5s ease;
  will-change: transform;
}

.hero--slider .hero-slide {
  flex: 0 0 60%;           /* smaller base so side slides are visibly smaller */
  opacity: 0.28;
  transform: scale(1) translateY(0);
  transition: transform .5s cubic-bezier(.2,.9,.2,1), opacity .25s ease;
  transform-origin: center center;
}

.hero--slider .hero-slide.is-inactive {
  transform: scale(.86) translateY(0);
  opacity: .28;
}

.hero--slider .hero-slide.is-active {
  opacity: 1;
  transform: scale(1.1) translateY(-8px);
  z-index: 3;
}

.hero--slider .hero-slide.is-prev-active {
  /* previous active that is moving away */
  transform: scale(.86) translateY(0);
  opacity: .28;
  z-index: 1;
}

/* --- Arrows: minimal, always visible, theme-aware --- */
.hero--slider .hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);

  width: 24px;
  height: 24px;
  padding: 0;

  background: none;             /* no circle */
  border: 0;
  cursor: pointer;

  opacity: 0.5;                 /* always transparent */
  transition: opacity .2s ease;

  display: flex;
  align-items: center;
  justify-content: center;

  z-index: 20;
}

/* Light theme needs a touch more contrast */
body:not(.is-dark) .hero--slider .hero-arrow {
  opacity: 0.65;
}

.hero--slider .hero-arrow:hover,
.hero--slider .hero-arrow:focus-visible {
  opacity: 0.9;
}

/* Arrow icon */
.hero--slider .hero-arrow::before {
  content: "";
  width: 10px;
  height: 10px;

  border: solid var(--text-main); /* theme-aware */
  border-width: 0 2px 2px 0;
}

.hero--slider .hero-prev::before { transform: rotate(135deg); }
.hero--slider .hero-next::before { transform: rotate(-45deg); }

/* Place arrows slightly OUTSIDE slider so they don't cover cards */
.hero--slider .hero-prev { left: -18px; }
.hero--slider .hero-next { right: -18px; }

/* Accessibility */
.hero--slider .hero-arrow:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 4px;
}

/* Optional: if arrows ever get clipped by a parent container */
.hero--slider,
.hero--slider .hero-slider {
  overflow: visible;
}



@media (min-width: 768px) {
/* dots: только мобила */
.hero--slider .hero-dots {
  width: 100%;
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 12px;
}
.hero--slider .hero-dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--text-muted);
  opacity: .35;
}
.hero--slider .hero-dot.is-active { background: var(--accent); opacity: 1; }

  .hero--slider .hero-track {
    gap: 32px;
    align-items: stretch;
  }

  .hero--slider .hero-slide {
    flex: 0 0 72%;        /* ширина центральной карточки */
    opacity: .22;
    transform: scale(1);
    transition: opacity .25s ease, transform .25s ease;
  }

  .hero--slider .hero-slide.is-inactive {
    transform: scale(.86);
  }

  .hero--slider .hero-slide.is-active {
    opacity: 1;
    transform: scale(1.1);
    z-index: 2;
  }
}


@media (min-width: 768px) {
  .hero--slider .hero-dots { display: none; }
}

@media (max-width: 768px) {
  .hero--slider .hero-slider { padding: 0 12px; overflow: visible; }
  .hero--slider .hero-track { gap: 14px; }
  .hero--slider .hero-slide {
    flex: 0 0 88%;
    opacity: .35;
    transform: scale(1);
  }
  .hero--slider .hero-slide.is-inactive {
    transform: scale(.86);
  }
  .hero--slider .hero-slide.is-active { opacity: 1; transform: scale(1.1); }
  .hero--slider .hero-arrow { display: none; }

  /* затемнение краёв */
  .hero--slider .hero-slider::before,
  .hero--slider .hero-slider::after {
    content: "";
    position: absolute;
    top: 0;
    width: 28px;
    height: 100%;
    z-index: 2;
    pointer-events: none;
  }
  .hero--slider .hero-slider::before {
    left: 0;
    background: linear-gradient(to right, var(--bg), transparent);
  }
  .hero--slider .hero-slider::after {
    right: 0;
    background: linear-gradient(to left, var(--bg), transparent);
  }
}


/* MOBILE: не режем текст внутри карточки */
@media (max-width: 768px) {

  .hero-feature.hero-feature--center {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    padding: 18px 16px;   /* чуть компактнее, чтобы текст помещался */
  }

  .hero-title,
  .hero-excerpt {
    overflow-wrap: anywhere;  /* чтобы длинные слова/кавычки не ломали строку */
  }
}



@media (min-width: 769px) {
  .hero-dots {
    display: none;
  }
}

@media (max-width: 768px) {
  .site-nav a {
    padding-top: 6px;     /* было 8px */
    padding-bottom: 10px; /* было 8px */
  }
}

@media (min-width: 769px) {
  .hero--slider { overflow: visible; }
  .hero--slider [data-slider] { overflow: visible; }   /* если slider = data-slider */
  .hero--slider [data-track] { will-change: transform; }
}



@media (max-width: 768px) {
  .theme-toggle {
    position: fixed;
    right: calc(12px + env(safe-area-inset-right));
    bottom: calc(12px + env(safe-area-inset-bottom));
    z-index: 1200;

    width: 44px;
    height: 44px;
    border-radius: 50%;

    background: var(--accent);
    color: var(--text-invert);
    border: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    box-shadow: 0 6px 20px rgba(0,0,0,.25);
    margin: 0;
    transform: translateZ(0);

    opacity: 0.5;
    transition: opacity .2s ease, transform .2s ease;
  }

  .theme-toggle:active,
  .theme-toggle:focus-visible {
    opacity: 1;
  }

  .theme-toggle.is-hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
  }

  .theme-toggle:hover { transform: translateZ(0); } /* на мобиле не увеличиваем */
}

@media (max-width: 768px) {
  .post-cover {
    height: 34vh;
    min-height: 180px;
    margin-bottom: 24px;
  }
}

@media (max-width: 768px) {
  .post-content blockquote {
    padding: 16px 14px 16px 18px;
    font-size: 1.06em;
    box-shadow: 4px 4px 0 var(--accent-dark);
  }

  .post-content blockquote::before {
    top: -14px;
    font-size: 46px;
  }
}

@media (max-width: 768px) {
  .site-nav {
    overflow-x: auto;
    overflow-y: hidden;

    scrollbar-width: none;     /* Firefox */
    -ms-overflow-style: none;  /* старый Edge/IE */
  }

  .site-nav::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;      /* важно: именно height для горизонтального */
  }
}

/* DESKTOP: viewport слайдера имеет поля под стрелки */
@media (min-width: 769px) {
  .hero--slider [data-slider]{
    position: relative;
    overflow: visible;
    padding: 0 96px 28px; /* 96px = зона для стрелки слева/справа */
  }

  /* трек не должен резаться */
  .hero--slider [data-track]{
    will-change: transform;
  }

  /* Стрелки живут в этих полях */
  .hero--slider [data-prev],
  .hero--slider [data-next]{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    z-index: 5;
  }

  .hero--slider [data-prev]{ left: 24px; }
  .hero--slider [data-next]{ right: 24px; }
}

@media (max-width: 768px) {
  .inline-figure {
    float: none;
    width: 100%;
    margin: 24px auto;
  }

  .figure-right,
  .figure-left {
    margin: 0;
  }

  .inline-figure figcaption {
    font-size: 13px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .hero--slider .hero-arrow {
    display: none;
  }
}
/* DESKTOP: не обрезаем карточки и тени */
@media (min-width: 769px) {
  .hero--slider {
    overflow: visible; /* ключ: чтобы не резало тень/бордер */
  }

  .hero--slider .hero-slider {
    overflow: visible; /* ключ: чтобы боковые карточки было видно */
    padding: 0 110px 28px; /* место под стрелки + запас под тень снизу */
  }
}
@media (min-width: 769px) {
  .hero--slider [data-slider]{
    position: relative;
    overflow: visible;
    padding: 0 110px 18px; /* поля слева/справа под стрелки + низ под точки */
  }

  .hero--slider [data-track]{
    overflow: visible;
  }

  .hero--slider [data-prev],
  .hero--slider [data-next]{
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    z-index: 5;
  }

  .hero--slider [data-prev]{ left: 24px; }
  .hero--slider [data-next]{ right: 24px; }

  /* точки — в потоке ниже, не мешают треку */
  .hero--slider [data-dots]{
    margin-top: 12px;
  }
}
@media (min-width: 769px) {
  .hero--slider [data-slider]{
    position: relative;
    overflow: visible;
    /* Use clamp so padding never forces the page wider than the viewport */
    padding: 0 clamp(18px, 6vw, 110px) 18px;
    box-sizing: border-box;
  }

  .hero--slider [data-prev]{ left: 24px; }
  .hero--slider [data-next]{ right: 24px; }
}

/* =========================
   THUMBS: HERO (Featured)
   ========================= */
.hero-card{
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 18px;
  align-items: stretch;
}

.hero-thumb{
  display: block;
  width: 190px;
  height: 140px;
  overflow: hidden;
  border: 2px solid var(--accent);
  box-shadow: 6px 6px 0 var(--accent-dark);
}

.hero-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-body{ min-width: 0; }

/* =========================
   THUMBS: LATEST
   ========================= */
.post-card-row{
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: start;
}

.post-card-thumb{
  width: 84px;
  height: 64px;
  overflow: hidden;
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-paper);
}

.post-card-thumb img{
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.post-card-body{ min-width: 0; }

@media (max-width: 768px){
  .hero-card{ grid-template-columns: 1fr; }
  .hero-thumb{ width: 100%; height: 160px; }
}
