/*
 Theme Name:   Bricks Child Theme
 Theme URI:    https://bricksbuilder.io/
 Description:  Use this child theme to extend Bricks.
 Author:       Bricks
 Author URI:   https://bricksbuilder.io/
 Template:     bricks
 Version:      1.1
 Text Domain:  bricks
*/

/* --------------------------------------------------------------------------
   Fonts: self-hosted variable subsets (cyrillic + latin).
   Four files, 116 KB total. unicode-range means a Bulgarian page downloads
   one cyrillic and one latin subset per family, not all four.
   -------------------------------------------------------------------------- */

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/lora-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Lora';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('fonts/lora-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/golos-text-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}

@font-face {
  font-family: 'Golos Text';
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url('fonts/golos-text-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Design tokens (plan §2)
   -------------------------------------------------------------------------- */

:root {
  /* palette */
  --paper: #FAF7F2;
  --surface: #FFFFFF;
  --ink: #1A1A17;
  --ink-2: #5A5B54;
  --line: #E6E1D7;
  --forest: #2E4A3A;
  --band: #1F3327;
  --clay: #A6603C;

  /* type */
  --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
  --font-sans: 'Golos Text', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --fs-h1: clamp(2.1rem, 1.55rem + 2.4vw, 3.3rem);
  --fs-h2: clamp(1.5rem, 1.3rem + 0.9vw, 2rem);
  --fs-h3: 1.35rem;
  --fs-body: 1.125rem;
  --lh-body: 1.68;
  --fs-meta: 0.8125rem;
  --measure: 68ch;
  --tracking-kicker: 0.08em;

  /* spacing: 8px rhythm, sections at 96 / 64 / 48 */
  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-s: 0.75rem;
  --space-m: 1rem;
  --space-l: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;

  /* layout */
  --container: 1280px;
  --gutter: clamp(1rem, 2.2vw, 1.5rem);
  --radius: 4px;
  --shadow: 0 10px 30px rgba(26, 26, 23, 0.08);
}

/* --------------------------------------------------------------------------
   Base typography
   -------------------------------------------------------------------------- */

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

body {
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: var(--fs-h1);
  line-height: 1.1;
}

h2 {
  font-size: var(--fs-h2);
  line-height: 1.2;
}

h3 {
  font-size: var(--fs-h3);
  line-height: 1.3;
}

h4,
h5,
h6 {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 600;
  letter-spacing: 0;
  line-height: 1.4;
}

p {
  margin: 0;
}

p + p {
  margin-top: 1.05em;
}

a {
  color: var(--forest);
  text-decoration-line: underline;
  text-decoration-thickness: 2px;
  text-decoration-color: var(--clay);
  text-underline-offset: 3px;
  text-decoration-skip-ink: auto;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
  color: var(--clay);
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--forest);
  outline-offset: 3px;
}

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

img {
  max-width: 100%;
  height: auto;
  vertical-align: middle;
}

figure {
  margin: 0;
}

figcaption {
  margin-top: var(--space-xs);
  color: var(--ink-2);
  font-size: var(--fs-meta);
  line-height: 1.5;
}

hr {
  margin: var(--space-2xl) 0;
  border: 0;
  border-top: 1px solid var(--line);
}

blockquote {
  margin: var(--space-2xl) 0;
  padding: 0 0 0 var(--space-l);
  border-left: 2px solid var(--forest);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.4;
}

ul,
ol {
  padding-left: 1.1em;
}

li + li {
  margin-top: 0.35em;
}

small {
  color: var(--ink-2);
  font-size: var(--fs-meta);
}

mark {
  background: rgba(166, 96, 60, 0.16);
  color: inherit;
}

/* --------------------------------------------------------------------------
   Layout primitives used by the templates
   -------------------------------------------------------------------------- */

.nd-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.nd-section {
  padding-block: clamp(3rem, 6vw, 6rem);
}

.nd-band {
  background: var(--band);
  color: var(--paper);
}

.nd-band :focus-visible {
  outline-color: var(--paper);
}

.nd-kicker {
  color: var(--clay);
  font-size: var(--fs-meta);
  font-weight: 500;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
}

.nd-meta {
  color: var(--ink-2);
  font-size: var(--fs-meta);
  line-height: 1.5;
}

.nd-rule {
  border-top: 1px solid var(--line);
}

/* --------------------------------------------------------------------------
   Motion: only under a non-reduced-motion preference (plan §5)
   -------------------------------------------------------------------------- */

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

/* ==========================================================================
   Redesign components (plan §2). One stylesheet, class-driven.
   Bricks elements carry these classes; no per-element style data.
   ========================================================================== */

/* ---------- layout ---------- */

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

.nd-sec {
  padding-block: clamp(3rem, 6vw, 6rem);
}

.nd-sec--tight {
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.nd-hr {
  border-top: 1px solid var(--line);
}

.nd-band {
  background: var(--band);
  color: var(--paper);
}

.nd-band .nd-kicker {
  color: #d79a72;
}

.nd-band a:hover {
  color: #fff;
}

/* ---------- header ---------- */

.nd-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: var(--band);
  border-bottom: 1px solid var(--line);
  transition: box-shadow 0.2s ease;
}

@supports (backdrop-filter: blur(8px)) {
  .nd-header {
    background: color-mix(in srgb, var(--band) 92%, transparent);
    backdrop-filter: blur(12px);
  }
}

.nd-header__in {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  min-height: 64px;
  padding-block: 0.5rem;
  transition: min-height 0.2s ease;
}

.nd-brand {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nd-brand:hover {
  color: var(--ink);
}

.nd-brand small {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-2);
  margin-top: -2px;
}

.nd-nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  margin-inline: auto;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

.nd-nav::-webkit-scrollbar {
  display: none;
}

.nd-nav a {
  position: relative;
  display: inline-block;
  padding-block: 0.35rem;
  font-size: 0.9375rem;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nd-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--clay);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.2s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nd-nav a:hover::after,
.nd-nav a[aria-current="page"]::after {
  transform: scaleX(1);
}

.nd-tools {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-left: auto;
}

.nd-icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--ink);
  text-decoration: none;
  background: transparent;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nd-icon-btn:hover {
  background: var(--surface);
  border-color: var(--line);
  color: var(--ink);
}

@media (max-width: 767px) {
  .nd-header__in {
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    min-height: 56px;
  }

  .nd-nav {
    order: 3;
    width: 100%;
    margin-inline: 0;
    gap: 1.1rem;
    padding-block: 0.25rem 0.6rem;
    border-top: 1px solid var(--line);
  }

  .nd-nav a {
    font-size: 0.875rem;
  }

  .nd-tools {
    margin-left: auto;
  }
}

/* ---------- footer ---------- */

.nd-footer {
  padding-block: clamp(3rem, 6vw, 4.5rem) 2rem;
  border-top: 1px solid var(--line);
  margin-top: clamp(3rem, 6vw, 6rem);
}

.nd-footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: start;
}

.nd-footer__brand {
  font-family: var(--font-serif);
  font-size: 1.4rem;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}

.nd-footer__about {
  margin-top: 0.85rem;
  max-width: 32ch;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.nd-footer__title {
  margin: 0 0 1rem;
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.nd-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-footer li + li {
  margin-top: 0.5rem;
}

.nd-footer a {
  color: var(--ink);
  font-size: 0.9375rem;
  text-decoration: none;
}

.nd-footer a:hover {
  color: var(--clay);
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.nd-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.75rem 2rem;
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8125rem;
}

.nd-footer__bottom a {
  color: var(--ink-2);
}

.nd-footer__list a {
  display: block;
  padding-block: 0.22rem;
}

.nd-search {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  max-width: 230px;
  padding: 0.15rem 0.2rem 0.15rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  transition: border-color 0.2s ease;
}

.nd-search:focus-within {
  border-color: var(--forest);
}

.nd-search input {
  width: 100%;
  min-width: 0;
  padding: 0.45rem 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.875rem;
  outline: none;
}

.nd-search input::placeholder {
  color: var(--ink-2);
}

.nd-search button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  cursor: pointer;
  transition: background 0.2s ease;
}

.nd-search button:hover {
  background: var(--forest);
}

.nd-nav__item {
  display: contents;
}

/* --- home structure fixes: loops wrap items, CSS owns the grid --- */

.screen-reader-text {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  border: 0;
  white-space: nowrap;
}

.nd-hero-wrap {
  padding-block: clamp(1.5rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3rem);
}

.nd-hero__side > div:first-child .nd-card--sm {
  border-top: 0;
  padding-top: 0;
}

.nd-chips > div,
.nd-strip__links > div,
.nd-nav > div {
  display: contents;
}

.nd-grid > div,
.nd-band-list > div {
  min-width: 0;
}

.nd-grid__item {
  display: flex;
}

.nd-grid__item > .nd-card {
  flex: 1;
}

.nd-band-grid {
  counter-reset: nd-rank;
}

.nd-card--rank {
  flex-direction: row;
  align-items: baseline;
  gap: 1rem;
  border-top: 1px solid rgba(250, 247, 242, 0.16);
}

.nd-card--rank::before {
  content: counter(nd-rank, decimal-leading-zero);
  counter-increment: nd-rank;
  flex: 0 0 auto;
  min-width: 2ch;
  color: #d79a72;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-variant-numeric: tabular-nums;
  font-weight: 400;
}

.nd-band-list > div:first-child .nd-card--rank {
  border-top: 0;
  padding-top: 0;
}

.nd-card--rank .nd-card__body {
  min-width: 0;
}

.nd-card--rank .nd-card__title {
  font-size: 1.05rem;
  line-height: 1.35;
}

.nd-card--rank .nd-card__title a {
  color: var(--paper);
}

.nd-card--rank .nd-card__meta {
  margin-top: 0.15rem;
  color: rgba(250, 247, 242, 0.6);
  font-size: 0.75rem;
}

/* most-read rows: one list of ten, two columns on desktop (01–05 left, 06–10 right) */

.nd-band-list {
  display: block;
}

.nd-band-list > div .nd-card--rank {
  border-top: 1px solid rgba(250, 247, 242, 0.16);
}

.nd-band-list > div:first-child .nd-card--rank {
  border-top: 0;
  padding-top: 0;
}

.nd-band-grid {
  counter-reset: nd-rank;
}
.nd-kicker,
.nd-kicker ul {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-kicker li {
  margin: 0;
  line-height: 1.4;
}

/* cards show one category only — the taxonomy element prints every term otherwise */
.nd-card .nd-kicker li:not(:first-child) {
  display: none;
}

.nd-kicker .bricks-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
}

.nd-kicker a,
.nd-kicker a.bricks-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--clay);
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  text-decoration: none;
}

.nd-kicker a:hover,
.nd-kicker a.bricks-button:hover {
  color: var(--ink);
}

.nd-band .nd-kicker a:hover {
  color: #fff;
}

.nd-kicker + .nd-card__title {
  margin-top: 0.15rem;
}

.nd-card__meta > span {
  display: inline;
}

.nd-readtime {
  white-space: nowrap;
}

.nd-hero__dek {
  display: -webkit-box;
  overflow: hidden;
  max-width: 60ch;
  margin-top: 0.15rem;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.nd-card--sm .nd-hero__dek {
  display: none;
}

.nd-strip__media {
  position: absolute;
  inset: 0;
}

.nd-strip__media-item {
  position: absolute;
  inset: 0;
  display: block;
}

.nd-strip__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nd-strip__kicker {
  display: inline-block;
  margin-bottom: 0.75rem;
  color: #d79a72;
  text-decoration: none;
}

.nd-strip__kicker:hover {
  color: #fff;
}

@media (max-width: 900px) {
  .nd-footer__grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .nd-footer__grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- cards ---------- */

.nd-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.nd-card:hover {
  color: inherit;
}

.nd-card__media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #efeae2;
}

.nd-card__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nd-card:hover .nd-card__media img {
  transform: scale(1.03);
}

.nd-card__body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.nd-card__title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.3rem;
  line-height: 1.25;
  letter-spacing: -0.012em;
  font-weight: 600;
}

.nd-card__title a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--clay), var(--clay));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  transition: background-size 0.25s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nd-card:hover .nd-card__title a {
  background-size: 100% 2px;
}

.nd-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.6rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.nd-card__meta .sep {
  opacity: 0.45;
}

.nd-card__media--video::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(15, 20, 16, 0.05), transparent 55%);
}

/* small horizontal story (hero side rail) */

.nd-card--sm {
  flex-direction: row;
  gap: 1rem;
  align-items: flex-start;
  padding-block: 1.1rem;
  border-top: 1px solid var(--line);
}

.nd-card--sm:first-child {
  border-top: 0;
  padding-top: 0;
}

.nd-card--sm .nd-card__media {
  flex: 0 0 104px;
  aspect-ratio: 1 / 1;
}

.nd-card--sm .nd-card__title {
  font-size: 1.05rem;
  line-height: 1.3;
}

.nd-card--sm .nd-card__meta {
  font-size: 0.75rem;
}

/* ranked row on the dark band */

.nd-card--rank {
  flex-direction: row;
  align-items: baseline;
  gap: 1rem;
  padding-block: 0.85rem;
  border-top: 1px solid rgba(250, 247, 242, 0.16);
}

.nd-card--rank:first-child {
  border-top: 0;
  padding-top: 0;
}

.nd-rank {
  flex: 0 0 auto;
  min-width: 2ch;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 400;
  color: #d79a72;
  font-variant-numeric: tabular-nums;
}

.nd-card--rank .nd-card__title {
  font-size: 1.05rem;
  line-height: 1.35;
}

.nd-card--rank .nd-card__title a {
  color: var(--paper);
}

.nd-card--rank .nd-card__title a:hover {
  color: #fff;
}

.nd-card--rank .nd-card__meta {
  color: rgba(250, 247, 242, 0.6);
  font-size: 0.75rem;
}

/* editorial strip */

.nd-strip {
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  min-height: clamp(300px, 38vw, 470px);
  background: var(--ink);
}

.nd-strip__img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nd-strip__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to top,
    rgba(10, 14, 11, 0.9) 0%,
    rgba(10, 14, 11, 0.55) 38%,
    rgba(10, 14, 11, 0.05) 72%
  );
}

.nd-strip__in {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-block: clamp(2rem, 4vw, 3.5rem);
}

.nd-strip__title {
  margin: 0 0 0.4rem;
  max-width: 20ch;
  color: var(--paper);
  font-size: clamp(1.8rem, 1.3rem + 1.7vw, 3rem);
  line-height: 1.1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.nd-strip__links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.75rem;
  margin-top: 1.25rem;
}

.nd-strip__links a {
  padding-bottom: 0.15rem;
  border-bottom: 1px solid rgba(250, 247, 242, 0.55);
  color: #fff;
  font-size: 0.9375rem;
  text-decoration: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.nd-strip__links a:hover {
  border-color: var(--clay);
  color: #fff;
}

/* ---------- home ---------- */

.nd-hero {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.75rem, 4vw, 3.5rem);
  align-items: start;
}

.nd-hero__lead .nd-card__media {
  aspect-ratio: 16 / 9;
}

.nd-hero__lead .nd-card__title {
  font-size: clamp(1.8rem, 1.25rem + 1.9vw, 2.95rem);
  line-height: 1.07;
}

.nd-hero__lead .nd-card__body {
  gap: 0.65rem;
}

.nd-hero__side {
  display: flex;
  flex-direction: column;
}

@media (max-width: 900px) {
  .nd-hero {
    grid-template-columns: 1fr;
  }

  .nd-hero__side {
    margin-top: 0.5rem;
  }

  .nd-hero__side .nd-card--sm:first-child {
    border-top: 1px solid var(--line);
    padding-top: 1.1rem;
  }
}

.nd-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  padding-block: 1.25rem;
  border-block: 1px solid var(--line);
}

.nd-chip {
  display: inline-block;
  padding: 0.4rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8125rem;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nd-chip:hover {
  border-color: var(--clay);
  color: var(--clay);
}

.nd-sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: clamp(1.25rem, 2.5vw, 2rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.nd-sec-title {
  margin: 0;
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem);
}

.nd-sec-head .nd-meta {
  white-space: nowrap;
}

.nd-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.5rem, 3vw, 2.5rem) clamp(1.25rem, 2.5vw, 2rem);
}

.nd-grid--2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.nd-band-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.nd-band-head {
  margin: 0 0 1.2rem;
  color: var(--paper);
  font-size: clamp(1.5rem, 1.2rem + 1vw, 2rem);
}

.nd-more {
  display: flex;
  justify-content: center;
  margin-top: clamp(2rem, 4vw, 3rem);
}

.nd-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.8rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nd-btn:hover {
  background: var(--ink);
  color: var(--paper);
}

.nd-btn--band {
  border-color: rgba(250, 247, 242, 0.4);
  color: var(--paper);
}

.nd-btn--band:hover {
  background: var(--paper);
  border-color: var(--paper);
  color: var(--ink);
}

@media (max-width: 1023px) {
  .nd-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nd-band-grid {
    grid-template-columns: 1fr;
  }

  .nd-band-grid .nd-band-col + .nd-band-col {
    margin-top: 1.5rem;
  }
}

@media (max-width: 639px) {
  .nd-grid {
    grid-template-columns: 1fr;
  }

  .nd-grid--2 {
    grid-template-columns: 1fr;
  }
}

/* ---------- archive ---------- */

.nd-archive-head {
  padding-block: clamp(2.5rem, 5vw, 4rem) clamp(1.5rem, 3vw, 2.5rem);
}

.nd-archive-title {
  margin: 0 0 0.75rem;
  font-size: clamp(2rem, 1.5rem + 2vw, 3rem);
}

.nd-archive-desc {
  max-width: var(--measure);
  color: var(--ink-2);
}

.nd-archive-desc p {
  margin: 0;
}

.nd-archive-count {
  margin-top: 0.9rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
}

/* Bricks query trail / pagination */

.nd-pagination {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.nd-pagination ul.page-numbers,
.nd-pagination ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  list-style: none;
}

.nd-pagination li {
  margin: 0;
}

.nd-pagination li > .page-numbers,
.nd-pagination li > a,
.nd-pagination li > span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font-size: 0.875rem;
  text-decoration: none;
}

.nd-pagination .current {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

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

/* ---------- single post ---------- */

.nd-single {
  display: grid;
  grid-template-columns: minmax(0, 720px);
  justify-content: center;
  gap: 0;
}

.nd-single__main {
  min-width: 0;
}

@media (min-width: 1200px) {
  .nd-single {
    grid-template-columns: minmax(0, 720px) 240px;
    gap: clamp(2rem, 5vw, 5rem);
  }
}

.nd-single__aside {
  display: none;
}

@media (min-width: 1200px) {
  .nd-single__aside {
    display: block;
  }
}

.nd-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 300;
  width: 100%;
  height: 2px;
  pointer-events: none;
}

.nd-progress > * {
  height: 2px;
  background: var(--forest);
}

.nd-crumbs {
  padding-block: 1.25rem 0;
  color: var(--ink-2);
  font-size: 0.75rem;
  line-height: 1.5;
}

.nd-crumbs ol,
.nd-crumbs ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-crumbs li {
  display: inline-flex;
  gap: 0.35rem;
  margin: 0;
  color: var(--ink-2);
}

.nd-crumbs li + li::before {
  content: "/";
  opacity: 0.45;
}

.nd-crumbs a {
  color: var(--ink-2);
  text-decoration: none;
}

.nd-crumbs a:hover {
  color: var(--clay);
}

.nd-kicker {
  display: inline-block;
  color: var(--clay);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: var(--tracking-kicker);
  text-transform: uppercase;
  text-decoration: none;
}

.nd-kicker a {
  color: inherit;
  text-decoration: none;
}

.nd-title {
  margin: 0.4rem 0 0.9rem;
  font-size: var(--fs-h1);
  line-height: 1.08;
}

.nd-dek {
  max-width: 60ch;
  margin: 0;
  color: var(--ink-2);
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 1rem + 0.4vw, 1.3rem);
  line-height: 1.5;
}

.nd-postmeta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.85rem;
  margin-top: 1.25rem;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.5;
}

.nd-postmeta .sep {
  opacity: 0.45;
}

.nd-avatar {
  display: inline-flex;
  overflow: hidden;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: var(--line);
}

.nd-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nd-figure {
  margin: clamp(1.5rem, 3vw, 2.5rem) 0 clamp(2rem, 4vw, 3rem);
}

.nd-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.nd-figure figcaption {
  margin-top: 0.6rem;
}

.nd-prose {
  max-width: var(--measure);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: 0.002em;
}

.nd-prose > * {
  margin-top: 1.25em;
  margin-bottom: 0;
}

.nd-prose > *:first-child {
  margin-top: 0;
}

.nd-prose h2,
.nd-prose h3,
.nd-prose h4 {
  margin-top: 2.2em;
  margin-bottom: 0.55em;
  line-height: 1.22;
}

.nd-prose h2,
.nd-prose h3 {
  font-family: var(--font-serif);
  font-weight: 600;
  letter-spacing: -0.012em;
}

.nd-prose h4 {
  font-family: var(--font-sans);
  font-weight: 600;
}

.nd-prose h2 {
  font-size: clamp(1.45rem, 1.25rem + 0.6vw, 1.85rem);
}

.nd-prose h3 {
  font-size: 1.25rem;
}

.nd-prose h4 {
  font-family: var(--font-sans);
  font-size: 1.0625rem;
}

.nd-prose p {
  margin: 0;
}

.nd-prose p + p {
  margin-top: 1.25em;
}

.nd-prose figure {
  margin-block: 2em;
}

.nd-prose img {
  display: block;
  width: 100%;
  height: auto;
}

.nd-prose figcaption {
  margin-top: 0.5rem;
  color: var(--ink-2);
  font-size: var(--fs-meta);
  line-height: 1.5;
}

.nd-prose blockquote {
  margin: 2em 0;
  padding-left: 1.25rem;
  border-left: 2px solid var(--forest);
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-style: italic;
  line-height: 1.4;
}

.nd-prose blockquote p {
  margin: 0;
}

.nd-prose ul,
.nd-prose ol {
  padding-left: 1.25em;
}

.nd-prose li + li {
  margin-top: 0.4em;
}

.nd-prose a {
  color: var(--forest);
}

.nd-prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

.nd-prose th,
.nd-prose td {
  padding: 0.55em 0.6em;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.nd-prose th {
  border-bottom-color: var(--ink-2);
  font-weight: 600;
}

.nd-prose pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: var(--radius);
  background: #f2ede5;
  font-size: 0.875rem;
  line-height: 1.5;
}

.nd-prose code {
  font-size: 0.9em;
}

.nd-prose :not(pre) > code {
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: #f2ede5;
}

.nd-prose iframe,
.nd-prose video {
  max-width: 100%;
}

.nd-prose hr {
  margin-block: 2.5em;
}

.nd-updated {
  margin-top: 2.5rem;
  padding-block: 1rem;
  border-block: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 0.8125rem;
}

.nd-author {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2rem;
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--line);
}

.nd-author__avatar {
  flex: 0 0 48px;
  overflow: hidden;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: var(--line);
}

.nd-author__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nd-author__name {
  display: block;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  text-decoration: none;
}

.nd-author__bio {
  margin-top: 0.25rem;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.nd-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.25rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--line);
  font-size: 0.8125rem;
}

.nd-share__label {
  color: var(--ink-2);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nd-share a {
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid var(--line);
  padding-bottom: 0.1rem;
}

.nd-share a:hover {
  color: var(--clay);
  border-color: var(--clay);
}

.nd-toc {
  position: sticky;
  top: 88px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  padding-bottom: 1rem;
  font-size: 0.875rem;
}

.nd-toc__title {
  margin: 0 0 0.75rem;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nd-toc a {
  display: block;
  padding: 0.3rem 0 0.3rem 0.75rem;
  border-left: 2px solid transparent;
  color: var(--ink-2);
  font-size: 0.8125rem;
  line-height: 1.45;
  text-decoration: none;
}

.nd-toc a:hover,
.nd-toc a.is-active,
.nd-toc .active > a {
  border-left-color: var(--clay);
  color: var(--ink);
}

.nd-toc ul,
.nd-toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-toc li li {
  margin-top: 0;
}

.nd-toc li li a {
  padding-left: 1.4rem;
  font-size: 0.78rem;
}

.nd-related {
  margin-top: clamp(2.5rem, 5vw, 4rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.nd-related__title {
  margin: 0 0 1.5rem;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nd-prevnext {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.nd-prevnext__item {
  min-width: 0;
}

.nd-prevnext__item--next {
  text-align: right;
}

.nd-prevnext .nd-label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink-2);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nd-prevnext a {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.35;
  text-decoration: none;
}

.nd-prevnext a:hover {
  color: var(--clay);
}

.nd-comments {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--line);
}

.nd-comments h2,
.nd-comments h3,
.nd-comments .comments-title {
  margin: 0 0 1.5rem;
  font-family: var(--font-serif);
  font-size: 1.35rem;
}

.nd-comments ol,
.nd-comments ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-comments li + li {
  margin-top: 0;
}

.nd-comments .comment-body {
  padding-block: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.9375rem;
}

.nd-comments .comment-meta {
  margin-bottom: 0.4rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
}

.nd-comments .comment-author {
  color: var(--ink);
  font-weight: 600;
}

.nd-comments .comment-author img {
  width: 28px;
  height: 28px;
  margin-right: 0.5rem;
  border-radius: 999px;
  vertical-align: middle;
}

.nd-comments .children {
  margin-left: 1.5rem;
}

.nd-comments .reply a {
  font-size: 0.8125rem;
  color: var(--ink-2);
}

.nd-comments .comment-form {
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.nd-comments .comment-form label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
}

.nd-comments input[type="text"],
.nd-comments input[type="email"],
.nd-comments input[type="url"],
.nd-comments textarea {
  width: 100%;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
}

.nd-comments textarea {
  min-height: 140px;
  resize: vertical;
}

.nd-comments .form-submit input,
.nd-comments .submit {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.nd-comments .form-submit input:hover,
.nd-comments .submit:hover {
  background: var(--forest);
  border-color: var(--forest);
}

/* ---------- search / 404 ---------- */

.nd-search-form {
  display: flex;
  gap: 0.5rem;
  max-width: 620px;
}

.nd-search-form input[type="search"],
.nd-search-form input[type="text"] {
  flex: 1;
  min-width: 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
}

.nd-search-form input:focus-visible {
  border-color: var(--forest);
  outline: 2px solid var(--forest);
  outline-offset: 1px;
}

.nd-search-form button {
  padding: 0.85rem 1.4rem;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--paper);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.nd-search-form button:hover {
  background: var(--forest);
  border-color: var(--forest);
}

.nd-404 {
  padding-block: clamp(3rem, 8vw, 7rem);
}

.nd-404__code {
  margin: 0;
  color: var(--clay);
  font-family: var(--font-serif);
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 0.9;
}

.nd-404__title {
  margin: 1rem 0 0.75rem;
  font-size: clamp(1.6rem, 1.3rem + 1vw, 2.2rem);
}

.nd-404__text {
  max-width: 52ch;
  color: var(--ink-2);
}

.nd-404__cats {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 2rem;
}

/* ---------- motion ---------- */

@keyframes nd-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes nd-reveal {
  from {
    clip-path: inset(0 0 6% 0);
    transform: scale(1.03);
  }
  to {
    clip-path: inset(0 0 0 0);
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .nd-reveal {
    animation: nd-rise 0.32s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  .nd-media-reveal img {
    animation: nd-reveal 0.48s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  .nd-hero__lead {
    animation: nd-rise 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) both;
  }

  .nd-hero__side {
    animation: nd-rise 0.45s cubic-bezier(0.22, 0.61, 0.36, 1) 0.06s both;
  }

  .nd-chips {
    animation: nd-rise 0.4s cubic-bezier(0.22, 0.61, 0.36, 1) 0.12s both;
  }
}

/* ---------- print ---------- */

@media print {
  .nd-header,
  .nd-footer,
  .nd-single__aside,
  .nd-progress {
    display: none !important;
  }
}


/* meta row: Bricks shortcode elements are width:100% by default */
.nd-card__meta .brxe-shortcode,
.nd-card__meta .nd-readtime {
  flex: 0 0 auto;
  width: auto;
}

/* legacy posts use <p><strong> as section headings: give them the heading voice */
.nd-prose p > strong:only-child {
  display: block;
  margin-top: 1.8em;
  margin-bottom: 0.55em;
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.nd-prose th {
  font-family: var(--font-sans);
  font-weight: 600;
}



/* ===== archive (merged from css/archive.css) ===== */

/* ==========================================================================
   Archive templates (category + author): ND Category Archive, ND Author Archive.
   Shared classes (.nd-wrap, .nd-grid, .nd-card, .nd-archive-head, .nd-pagination…)
   live in style.css; this file only adds the archive-specific missing pieces.
   ========================================================================== */

/* The post-taxonomy element renders its root as <ul class="nd-kicker">, so the
   flex/list rules in style.css (which target .nd-kicker ul) do not apply here. */

.nd-archive .nd-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-archive .nd-kicker li {
  margin: 0;
  line-height: 1.4;
}

/* Bricks sets .brxe-shortcode { width: 100% }; the reading-time shortcode must
   stay inline inside the card meta row. */

.nd-card__meta .nd-readtime {
  width: auto;
}

/* Bricks pagination outputs <ul class="page-numbers"> inside .bricks-pagination */

.nd-pagination .bricks-pagination > ul {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-pagination .bricks-pagination > ul > li {
  display: flex;
  margin: 0;
}

.nd-pagination .page-numbers {
  margin-right: 0;
}

.nd-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

/* Empty intro copy (author without bio, term without description) leaves no gap */

.nd-archive-desc:empty {
  display: none;
}


/* ===== search404 (merged from css/search404.css) ===== */

/* ==========================================================================
   Search results + 404.
   Base component classes (.nd-wrap, .nd-card, .nd-chips, .nd-pagination,
   .nd-search-form, .nd-404*) live in style.css; only the layout glue for
   these two templates belongs here.
   ========================================================================== */

/* ---------- search ---------- */

.nd-search-head .nd-search-form {
  margin-top: 1.5rem;
}

.nd-search-page .nd-pagination {
  margin-top: clamp(2rem, 4vw, 3rem);
}

/* style.css's `.nd-pagination .page-numbers` also matches Bricks' wrapper
   <ul class="page-numbers">, which would draw one full-width box round the whole
   row. Neutralise the box on the wrapper and keep it on the numeric items only. */

.nd-search-page .nd-pagination > .bricks-pagination > ul.page-numbers {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-width: 0;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  list-style: none;
}

.nd-search-page .nd-pagination > .bricks-pagination > ul.page-numbers > li {
  display: flex;
  margin: 0;
}

.nd-search-page .nd-pagination .page-numbers {
  margin-right: 0;
}

.nd-search-page .nd-pagination .page-numbers.dots {
  border-color: transparent;
  background: transparent;
}

.nd-noresults {
  padding-block: clamp(1.5rem, 4vw, 3rem);
  border-top: 1px solid var(--line);
}

.nd-noresults__title {
  margin: 0 0 0.5rem;
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.8rem);
}

.nd-noresults__text {
  max-width: var(--measure);
  color: var(--ink-2);
}

/* ---------- 404 ---------- */

.nd-404 .nd-search-form {
  margin-top: 1.5rem;
}

.nd-404__cats {
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
}

.nd-404__latest {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.nd-404__latest-title {
  margin: 0 0 clamp(1.25rem, 2.5vw, 2rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}


/* ===== single (merged from css/single.css) ===== */

/* ==========================================================================
   ND Single Post — template-specific wiring for the native Bricks elements.
   Base tokens and the .nd-* contract live in style.css; this file only adds
   what the single-post elements need and paper-background rail styling.
   ========================================================================== */

/* ---------- page shell ---------- */

/* Scope the shell to the single-post template root (a direct child of Bricks'
   content area) so other content templates reusing .nd-single are untouched. */
#brx-content > .nd-single {
  padding-inline: var(--gutter);
}

/* The spec nests a wrapper .nd-single around the grid .nd-single. Promote the
   inner wrapper's children (main + aside) into the outer grid so the tracks
   defined in style.css (720px / 720px + 240px >=1200px) are not nested twice. */
.nd-single > .nd-single {
  display: contents;
}

#brx-content > .nd-single .nd-single__main {
  padding-bottom: clamp(2rem, 4vw, 3rem);
}

.nd-single__aside {
  padding-block: 1.25rem clamp(2rem, 4vw, 3rem);
}

/* ---------- reading progress bar ---------- */

.nd-progress {
  border: 0;
  background: var(--line);
  color: var(--forest);
}

.nd-progress::-webkit-progress-bar {
  background: var(--line);
}

.nd-progress::-webkit-progress-value {
  background: var(--forest);
}

.nd-progress::-moz-progress-bar {
  background: var(--forest);
}

/* ---------- breadcrumbs ---------- */

.nd-crumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.nd-crumbs .item {
  color: var(--ink-2);
  text-decoration: none;
}

.nd-crumbs a.item:hover {
  color: var(--clay);
}

.nd-crumbs .separator {
  color: var(--ink-2);
  opacity: 0.45;
}

/* ---------- kicker (post taxonomy) ---------- */

.nd-single .nd-kicker {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.45rem 0 0;
  padding: 0;
  list-style: none;
}

.nd-single .nd-kicker li {
  margin: 0;
  list-style: none;
}

/* ---------- meta row ---------- */

.nd-postmeta .nd-avatar {
  flex: 0 0 28px;
}

.nd-postmeta .nd-avatar > figure {
  display: block;
  width: 100%;
  height: 100%;
  margin: 0;
}

.nd-postmeta .brxe-shortcode {
  display: inline;
  width: auto;
}

/* ---------- featured image ---------- */

/* The native image element renders a bare <img> when it has no caption, so the
   .nd-figure class lands on the image itself. */
img.nd-figure {
  display: block;
  width: 100%;
  height: auto;
  background: #efeae2;
}

figure.nd-figure img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- author box (native post-author element) ---------- */

.nd-author .avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  object-fit: cover;
}

.nd-author .content {
  min-width: 0;
}

.nd-author .author-name {
  margin: 0 0 0.25rem;
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  line-height: 1.35;
}

.nd-author .author-name a {
  color: var(--ink);
  text-decoration: none;
}

.nd-author .author-bio {
  margin: 0.25rem 0 0;
  color: var(--ink-2);
  font-size: 0.9375rem;
  line-height: 1.6;
}

.nd-author .author-bio:empty {
  display: none;
}

.nd-author .bricks-button {
  display: inline-flex;
  width: auto;
  margin-top: 0.6rem;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  color: var(--forest);
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.nd-author .bricks-button:hover {
  color: var(--clay);
}

/* ---------- sharing (native post-sharing element) ---------- */

/* The native element root is the <ul> itself. */
.nd-share {
  padding-inline: 0;
  margin: 0;
  list-style: none;
}

.nd-share ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-share li {
  margin: 0;
}

.nd-share li a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.nd-share li a:hover {
  border-color: var(--clay);
  color: var(--clay);
}

.nd-share svg {
  width: 15px;
  height: 15px;
  fill: currentColor;
}

/* ---------- related posts (native related-posts element) ---------- */

.nd-related .related-posts-title,
.nd-related__title {
  margin: 0 0 1.5rem;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.nd-related ul.related-posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem 1.25rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-related .repeater-item {
  min-width: 0;
}

.nd-related figure {
  margin: 0 0 0.6rem;
  overflow: hidden;
  aspect-ratio: 3 / 2;
  background: #efeae2;
}

.nd-related figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.nd-related .repeater-item:hover figure img {
  transform: scale(1.03);
}

.nd-related .post-content {
  min-width: 0;
}

.nd-related .post-content h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  line-height: 1.3;
}

.nd-related .post-content h3 a {
  color: var(--ink);
  text-decoration: none;
}

.nd-related .post-content h3 a:hover {
  color: var(--clay);
}

.nd-related .post-content > div:not(:first-child) {
  margin-top: 0.3rem;
  color: var(--ink-2);
  font-size: 0.75rem;
}

@media (max-width: 639px) {
  .nd-related ul.related-posts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 479px) {
  .nd-related ul.related-posts {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* ---------- prev / next (native post-navigation element) ---------- */

.nd-prevnext .label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nd-prevnext a.prev-post,
.nd-prevnext a.next-post {
  display: flex;
  flex-direction: column;
  color: var(--ink);
  text-decoration: none;
}

.nd-prevnext a.next-post {
  align-items: flex-end;
  text-align: right;
}

.nd-prevnext .title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.35;
}

.nd-prevnext a:hover .title {
  color: var(--clay);
}

@media (max-width: 639px) {
  .nd-prevnext {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .nd-prevnext a.next-post {
    align-items: flex-start;
    text-align: left;
  }
}

/* ---------- right rail: sticky TOC + most read ---------- */

.nd-toc {
  margin: 0 0 clamp(2rem, 4vw, 2.5rem);
  /* Opaque so the "Най-четени" list cannot bleed through the pinned TOC. */
  background: var(--surface);
  z-index: 2;
}

/* Keep the "Съдържание" heading out of the rail when the post has no headings.
   The container itself must stay visible: Bricks only initialises tocbot on
   visible elements (offsetParent !== null). */
.nd-toc:not(:has(.toc-list li)) {
  margin-bottom: 0;
}

.nd-toc:not(:has(.toc-list li)) .nd-toc__title {
  display: none;
}

.nd-reads {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  counter-reset: nd-reads;
}

.nd-reads__title {
  margin: 0 0 0.75rem;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  line-height: 1.4;
  text-transform: uppercase;
}

.nd-reads__list {
  display: flex;
  flex-direction: column;
}

.nd-reads__item {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
  padding-block: 0.6rem;
  border-top: 1px solid var(--line);
  counter-increment: nd-reads;
}

.nd-reads__list > .nd-reads__item:first-child {
  padding-top: 0;
  border-top: 0;
}

.nd-reads__item::before {
  content: counter(nd-reads, decimal-leading-zero);
  flex: 0 0 2ch;
  color: var(--clay);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-variant-numeric: tabular-nums;
}

.nd-reads__link {
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 0.95rem;
  line-height: 1.35;
  text-decoration: none;
}

.nd-reads__link:hover {
  color: var(--clay);
}


/* ===== sticky header + anchor offsets ===== */
/* Bricks' generated page CSS also targets #brx-header with one ID, so double it. */
#brx-header#brx-header {
  position: sticky;
  top: 0;
  z-index: 200;
}

#brx-header .nd-header {
  position: relative;
  top: auto;
}

.admin-bar #brx-header#brx-header {
  top: 32px;
}

.nd-prose h2,
.nd-prose h3,
.nd-prose h4 {
  scroll-margin-top: 96px;
}



/* ===== feedback round 3: dark header/footer, logo, back-to-top ===== */

/* dark header */
.nd-header {
  background: var(--band);
  border-bottom: 1px solid rgba(250, 247, 242, 0.14);
  color: var(--paper);
}

.nd-brand-logo {
  display: inline-flex;
  flex: 0 0 auto;
  text-decoration: none;
  color: inherit;
}

.nd-brand-logo img {
  display: block;
  width: auto;
  height: 34px;
  max-width: 190px;
}

.nd-header .nd-nav a {
  color: var(--paper);
}

.nd-header .nd-nav a:hover {
  color: #fff;
}

.nd-header .nd-nav a::after {
  background: var(--clay);
}

.nd-header .nd-search {
  border-color: rgba(250, 247, 242, 0.24);
  background: rgba(250, 247, 242, 0.07);
}

.nd-header .nd-search:focus-within {
  border-color: rgba(250, 247, 242, 0.5);
}

.nd-header .nd-search input {
  color: var(--paper);
}

.nd-header .nd-search input::placeholder {
  color: rgba(250, 247, 242, 0.6);
}

.nd-header .nd-search button {
  background: var(--surface);
  color: var(--band);
}

.nd-header .nd-search button:hover {
  background: var(--clay);
  color: #fff;
}

/* dark footer */
.nd-footer {
  margin-top: 0;
  border-top: 0;
  background: var(--band);
  color: var(--paper);
}

.nd-footer__logo {
  display: inline-flex;
  text-decoration: none;
  color: inherit;
}

.nd-footer__logo img {
  display: block;
  width: auto;
  height: 40px;
  max-width: 210px;
}

.nd-footer__about {
  color: rgba(250, 247, 242, 0.72);
}

.nd-footer__title {
  color: rgba(250, 247, 242, 0.55);
}

.nd-footer a {
  color: var(--paper);
}

.nd-footer a:hover {
  color: #fff;
  text-decoration-color: var(--clay);
}

.nd-footer__bottom {
  border-top-color: rgba(250, 247, 242, 0.16);
  color: rgba(250, 247, 242, 0.55);
}

.nd-footer__bottom a {
  color: rgba(250, 247, 242, 0.72);
}

/* floating back-to-top */
.nd-top.brxe-back-to-top {
  right: 28px;
  bottom: 28px;
  z-index: 150;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--band);
  color: var(--paper);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 10px 26px rgba(20, 25, 20, 0.22);
  transition: background 0.2s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.nd-top.brxe-back-to-top.visible {
  opacity: 1;
  visibility: visible;
}

.nd-top:hover,
.nd-top:focus-visible {
  background: var(--clay);
  color: #fff;
}

.nd-top svg {
  display: block;
  width: 16px;
  height: 16px;
}

/* card thumbnails are links now */
.nd-card__media > a {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.nd-card__media > a:focus-visible {
  outline: 2px solid var(--paper);
  outline-offset: -3px;
}



/* ==========================================================================
   Modern layer (round 6): motion, asymmetric layout, sticky rail, details.
   Progressive enhancement only — everything renders without JS.
   ========================================================================== */

:root {
  --nd-header-h: 64px;
  --nd-ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

/* ---------- type & rhythm refinements ---------- */

p,
.nd-prose p {
  text-wrap: pretty;
}

.nd-meta,
.nd-card__meta,
.nd-postmeta,
.nd-archive-count {
  font-variant-numeric: tabular-nums;
}

.nd-kicker {
  font-weight: 600;
}

.nd-sec-title {
  font-size: clamp(1.55rem, 1.2rem + 1.2vw, 2.2rem);
  letter-spacing: -0.022em;
}

.nd-sec-head {
  align-items: flex-end;
  padding-top: 1.35rem;
}

/* ---------- header: compact on scroll ---------- */

.nd-header__in {
  min-height: 64px;
  transition: min-height 0.28s var(--nd-ease);
}

.nd-brand-logo img {
  transition: height 0.28s var(--nd-ease);
}

#brx-header.is-scrolled .nd-header__in {
  min-height: 56px;
}

#brx-header.is-scrolled .nd-brand-logo img {
  height: 30px;
}

#brx-header.is-scrolled .nd-header {
  box-shadow: 0 10px 30px rgba(10, 15, 11, 0.22);
}

.nd-header .nd-nav a {
  font-size: 0.9125rem;
  letter-spacing: 0.005em;
}

/* search expands on focus on wide screens */
@media (min-width: 1024px) {
  .nd-header .nd-search {
    transition: max-width 0.3s var(--nd-ease), border-color 0.2s ease, background 0.2s ease;
  }

  .nd-header .nd-tools:has(input:focus) .nd-search {
    max-width: 330px;
  }
}

/* ---------- category rail: sticky on home, snap rail on mobile ---------- */

@media (min-width: 768px) {
  /* the chips wrapper is the sticky box: the inner .nd-chips shrink-wraps the rail */
  .nd-home > .nd-wrap:has(> .nd-chips) {
    position: sticky;
    top: var(--nd-header-h, 64px);
    z-index: 90;
    background: var(--surface);
    border-block: 1px solid var(--line);
    transition: top 0.28s var(--nd-ease);
  }

  .nd-home > .nd-wrap:has(> .nd-chips) .nd-chips {
    border-block: 0;
    padding-block: 0.95rem;
  }
}

@media (max-width: 767px) {
  .nd-chips {
    flex-wrap: nowrap;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    padding-inline: 1px;
    mask-image: linear-gradient(90deg, transparent, #000 18px, #000 calc(100% - 18px), transparent);
  }

  .nd-chips::-webkit-scrollbar {
    display: none;
  }

  .nd-chip {
    scroll-snap-align: start;
  }
}

.nd-chip {
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.nd-chip:hover {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--paper);
}

/* ---------- hero: asymmetric, larger display type ---------- */

@media (min-width: 1024px) {
  .nd-hero {
    grid-template-columns: minmax(0, 8fr) minmax(0, 4fr);
    gap: clamp(2rem, 4vw, 3.75rem);
  }
}

.nd-hero__lead .nd-card__title {
  font-size: clamp(2.1rem, 1.3rem + 2.6vw, 3.45rem);
  letter-spacing: -0.028em;
  line-height: 1.02;
}

.nd-hero__lead .nd-hero__dek {
  font-size: 1.0625rem;
}

.nd-hero__side .nd-card__media {
  flex: 0 0 120px;
  aspect-ratio: 4 / 3;
}

.nd-hero__side .nd-card--sm {
  padding-block: 1.25rem;
  transition: transform 0.28s var(--nd-ease);
}

.nd-hero__side .nd-card--sm:hover {
  transform: translateX(4px);
}

.nd-hero__side .nd-card--sm .nd-card__title {
  font-size: 1.0625rem;
}

/* hero image: gentle scroll-linked settle */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .home .nd-hero__lead .nd-card__media img {
      animation: nd-hero-settle linear both;
      animation-timeline: view();
      animation-range: entry 0% cover 45%;
    }

    @keyframes nd-hero-settle {
      from {
        transform: scale(1.07);
      }
      to {
        transform: scale(1);
      }
    }
  }
}

/* ---------- cards: hover lift, overlay, container query ---------- */

.nd-grid__item {
  container-type: inline-size;
}

.nd-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(to top, rgba(10, 14, 11, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.nd-card:hover .nd-card__media::after {
  opacity: 1;
}

.nd-grid__item .nd-card {
  transition: transform 0.35s var(--nd-ease);
}

@media (hover: hover) {
  .nd-grid__item .nd-card:hover {
    transform: translateY(-3px);
  }
}

@container (max-width: 380px) {
  .nd-card__title {
    font-size: 1.15rem;
  }

  .nd-card__meta {
    font-size: 0.75rem;
  }
}

/* ---------- most-read band: texture, divider, interactive rows ---------- */

.nd-band {
  position: relative;
  isolation: isolate;
}

.nd-band::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

.nd-band > * {
  position: relative;
  z-index: 1;
}

.nd-band-head {
  font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.5rem);
  letter-spacing: -0.02em;
}

.nd-band-col + .nd-band-col {
  padding-left: clamp(2rem, 5vw, 5rem);
  border-left: 1px solid rgba(250, 247, 242, 0.14);
}

.nd-band-list__item {
  transition: transform 0.26s var(--nd-ease);
}

@media (hover: hover) {
  .nd-band-list__item:hover {
    transform: translateX(4px);
  }
}

.nd-card--rank {
  position: relative;
  padding-right: 1.5rem;
}

.nd-card--rank::after {
  content: "→";
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%) translateX(-4px);
  color: #d79a72;
  font-family: var(--font-sans);
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s var(--nd-ease);
}

.nd-band-list__item:hover .nd-card--rank::after {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

.nd-card--rank::before {
  font-size: 1.15rem;
  opacity: 0.85;
}

/* ---------- archive header: title + count composition ---------- */

.nd-archive-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  column-gap: 1.5rem;
  padding-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: 1px solid var(--line);
}

.nd-archive-title {
  grid-column: 1;
  grid-row: 1;
  margin: 0;
  font-size: clamp(2.5rem, 1.9rem + 3.2vw, 4.4rem);
  letter-spacing: -0.035em;
  line-height: 0.96;
}

.nd-archive-count {
  grid-column: 2;
  grid-row: 1;
  justify-self: end;
  margin: 0 0 0.4rem;
  color: rgba(90, 91, 84, 0.9);
  font-size: 0.8125rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nd-archive-desc {
  grid-column: 1 / -1;
  grid-row: 2;
  margin-top: 1.25rem;
}

.nd-archive-desc:empty {
  display: none;
}

/* ---------- single post: editorial details ---------- */

.single-post .nd-prose > p:first-of-type::first-letter {
  float: left;
  padding: 0.08em 0.12em 0 0;
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 4.1em;
  font-weight: 600;
  line-height: 0.82;
}

@media (min-width: 1280px) {
  .single-post .nd-prose figure {
    margin-inline: calc(-1 * clamp(1.5rem, 4vw, 4.5rem));
  }
}

.single-post .nd-prose figcaption {
  padding-top: 0.1rem;
}

.nd-postmeta {
  letter-spacing: 0.005em;
}

.nd-toc {
  top: calc(var(--nd-header-h, 64px) + 28px);
}

.nd-author {
  margin-top: 2.25rem;
  padding-block: 1.75rem;
}

.nd-author__avatar {
  flex-basis: 56px;
  width: 56px;
  height: 56px;
}

.nd-related .related-posts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
  margin: 0;
  padding: 0;
  list-style: none;
}

.nd-related .related-posts > li {
  margin: 0;
  min-width: 0;
}

.nd-related .related-posts figure {
  overflow: hidden;
  aspect-ratio: 3 / 2;
  margin: 0 0 0.75rem;
  background: #efeae2;
}

.nd-related .related-posts figure img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--nd-ease);
}

.nd-related .related-posts > li:hover figure img {
  transform: scale(1.04);
}

.nd-related .post-content h3 {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.32;
}

.nd-related .post-content h3 a {
  color: var(--ink);
  text-decoration: none;
}

.nd-related .post-content h3 a:hover {
  color: var(--clay);
}

.nd-related .post-content .dynamic {
  margin-top: 0.35rem;
  color: var(--ink-2);
  font-size: 0.8125rem;
}

@media (max-width: 767px) {
  .nd-related .related-posts {
    grid-template-columns: 1fr;
  }
}

/* prose figures reveal while scrolling (scroll-driven, no JS) */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .single-post .nd-prose figure {
      animation: nd-figure-in linear both;
      animation-timeline: view();
      animation-range: entry 5% cover 25%;
    }

    @keyframes nd-figure-in {
      from {
        clip-path: inset(0 0 12% 0);
        opacity: 0.9;
      }
      to {
        clip-path: inset(0 0 0 0);
        opacity: 1;
      }
    }
  }
}

/* ---------- footer: watermark ---------- */

.nd-footer {
  position: relative;
  overflow: hidden;
}

.nd-footer > .nd-wrap {
  position: relative;
  z-index: 1;
}

.nd-footer::before {
  content: "НАШИЯ ДОМ";
  position: absolute;
  left: 50%;
  bottom: -0.32em;
  transform: translateX(-50%);
  z-index: 0;
  color: rgba(250, 247, 242, 0.05);
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 13vw, 11rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 0.8;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

/* ---------- reveal layer ---------- */

.has-js .nd-reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.55s var(--nd-ease) var(--reveal-delay, 0ms),
    transform 0.55s var(--nd-ease) var(--reveal-delay, 0ms);
  will-change: opacity, transform;
}

.has-js .nd-reveal.is-in {
  opacity: 1;
  transform: none;
  will-change: auto;
}

@media (prefers-reduced-motion: reduce) {
  .has-js .nd-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}


/* tighter compact state for the sticky header */
#brx-header.is-scrolled .nd-header__in {
  padding-block: 0.2rem;
}

#brx-header.is-scrolled .nd-nav a {
  font-size: 0.875rem;
}

/* ==========================================================================
   Mobile navigation: search overlay + flyout drawer (native <dialog>)
   ========================================================================== */

.nd-tools-mobile {
  display: none;
  align-items: center;
  gap: 0.1rem;
}

.nd-tools-mobile .nd-icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  color: var(--paper);
}

.nd-tools-mobile .nd-icon-btn:hover {
  background: rgba(250, 247, 242, 0.1);
  border-color: transparent;
  color: #fff;
}

.nd-search-inline {
  display: flex;
}

html.nd-locked {
  overflow: hidden;
}

/* shared dialog reset */
.nd-drawer,
.nd-search-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  max-width: none;
  height: 100%;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  overflow: hidden;
}

.nd-drawer::backdrop,
.nd-search-overlay::backdrop {
  background: rgba(10, 15, 11, 0.5);
  backdrop-filter: blur(6px);
}

/* ---------- flyout drawer ---------- */

.nd-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  width: min(90vw, 430px);
  height: 100%;
  padding: 1.35rem clamp(1.1rem, 4vw, 1.6rem) 2rem;
  overflow-y: auto;
  background: var(--band);
  color: var(--paper);
  box-shadow: -24px 0 70px rgba(0, 0, 0, 0.35);
  animation: nd-drawer-in 0.38s var(--nd-ease) both;
}

@keyframes nd-drawer-in {
  from {
    transform: translateX(100%);
  }
  to {
    transform: translateX(0);
  }
}

.nd-drawer__head,
.nd-search__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.nd-drawer__title {
  margin: 0;
  color: rgba(250, 247, 242, 0.55);
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.nd-drawer .nd-icon-btn,
.nd-search-overlay .nd-icon-btn {
  color: var(--paper);
  border-color: transparent;
}

.nd-drawer .nd-icon-btn:hover,
.nd-search-overlay .nd-icon-btn:hover {
  background: rgba(250, 247, 242, 0.12);
  color: #fff;
}

.nd-drawer__nav {
  display: flex;
  flex-direction: column;
}

.nd-drawer__item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding-block: 0.8rem;
  border-top: 1px solid rgba(250, 247, 242, 0.14);
}

.nd-drawer__item:last-child {
  border-bottom: 1px solid rgba(250, 247, 242, 0.14);
}

.nd-drawer__link {
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: 1.32rem;
  font-weight: 600;
  letter-spacing: -0.012em;
  line-height: 1.2;
  text-decoration: none;
  transition: color 0.2s ease, transform 0.25s var(--nd-ease);
}

.nd-drawer__item:hover .nd-drawer__link {
  color: #fff;
  transform: translateX(3px);
}

.nd-drawer__count {
  flex: 0 0 auto;
  color: rgba(250, 247, 242, 0.4);
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
}

.nd-drawer__section {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  margin-top: 0.25rem;
  padding-top: 0.5rem;
}

.nd-drawer__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1.25rem;
}

.nd-drawer__pages a {
  color: rgba(250, 247, 242, 0.78);
  font-size: 0.9rem;
  text-decoration: none;
}

.nd-drawer__pages a:hover {
  color: #fff;
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

/* ---------- search overlay ---------- */

.nd-search-overlay {
  overflow-y: auto;
  background: var(--band);
}

.nd-search-overlay::backdrop {
  background: rgba(10, 15, 11, 0.62);
}

.nd-search__panel {
  width: min(92vw, 760px);
  margin: clamp(3.5rem, 14vh, 9rem) auto 0;
  padding-inline: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: clamp(1.5rem, 4vw, 2.5rem);
}

.nd-search__title {
  margin: 0;
  color: var(--paper);
  font-size: clamp(2.4rem, 1.8rem + 3vw, 4.2rem);
  letter-spacing: -0.035em;
  line-height: 0.96;
}

.nd-search-panel {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding-bottom: 0.85rem;
  border-bottom: 1px solid rgba(250, 247, 242, 0.35);
  transition: border-color 0.25s ease;
}

.nd-search-panel:focus-within {
  border-color: var(--paper);
}

.nd-search-panel input {
  flex: 1;
  min-width: 0;
  padding: 0.2rem 0;
  border: 0;
  background: transparent;
  color: var(--paper);
  font-family: var(--font-serif);
  font-size: clamp(1.35rem, 1rem + 1.5vw, 2rem);
  line-height: 1.3;
  outline: none;
}

.nd-search-panel input::placeholder {
  color: rgba(250, 247, 242, 0.42);
}

.nd-search-panel button {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid rgba(250, 247, 242, 0.4);
  border-radius: 999px;
  background: transparent;
  color: var(--paper);
  cursor: pointer;
  transition: background 0.22s ease, color 0.22s ease, border-color 0.22s ease;
}

.nd-search-panel button:hover {
  border-color: var(--paper);
  background: var(--paper);
  color: var(--band);
}

.nd-search__hint {
  margin: 0;
  color: rgba(250, 247, 242, 0.45);
  font-size: 0.8125rem;
}

/* ---------- mobile header ------------------------------------------------- */

@media (max-width: 767px) {
  .nd-header__in {
    flex-wrap: nowrap;
    gap: 0.75rem;
    min-height: 60px;
    padding-block: 0.35rem;
  }

  .nd-header__in .nd-brand-logo img {
    height: 30px;
  }

  .nd-nav,
  .nd-search-inline {
    display: none;
  }

  .nd-tools {
    margin-left: auto;
  }

  .nd-tools-mobile {
    display: flex;
  }
}

@media (min-width: 768px) {
  .nd-drawer,
  .nd-search-overlay {
    display: none !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .nd-drawer__panel {
    animation: none;
  }
}

/* mobile menus: dark-surface focus rings + safe area */
.nd-header :focus-visible,
.nd-drawer :focus-visible,
.nd-search-overlay :focus-visible {
  outline-color: var(--paper);
}

.nd-drawer__panel {
  padding-bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

.nd-search-overlay {
  overscroll-behavior: contain;
}
