/* ELITES blog - list, post cards, single post */

/* ── List page ─────────────────────────────────────────────────────────── */
.ns-blog-list h1 {
  max-width: none;
  margin-bottom: clamp(28px, 4vw, 48px);
}

.ns-blog-list {
  display: grid;
  gap: clamp(24px, 3vw, 40px);
}

.ns-blog-list > :not(h1):not(.ns-blog-pages):not(.ns-blog-empty) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: clamp(20px, 2.4vw, 32px);
}

/* ── Post cards ────────────────────────────────────────────────────────── */
.ns-post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .22s var(--e-ui), box-shadow .22s var(--e-ui);
}

.ns-post-card:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 8px 28px color-mix(in srgb, var(--ink) 6%, transparent);
}

.ns-post-card.ns-pinned {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
  position: relative;
}

.ns-post-card.ns-pinned::before {
  content: "Закріплено";
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  padding: 4px 10px;
  font-size: .72rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  background: var(--accent);
}

.ns-post-cover-link {
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--line);
}

.ns-post-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s var(--e-out);
}

.ns-post-card:hover .ns-post-cover-img {
  transform: scale(1.03);
}

.ns-post-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: .55em;
  padding: clamp(18px, 2.2vw, 24px);
}

.ns-post-meta {
  font-size: .8rem;
  letter-spacing: .05em;
  color: var(--graphite);
  margin: 0;
}

.ns-post-title {
  font-family: var(--font-display);
  font-size: clamp(1.12rem, 1.6vw, 1.36rem);
  font-weight: 600;
  line-height: 1.22;
  letter-spacing: -.012em;
  margin: 0;
}

.ns-post-title a {
  text-decoration: none;
  color: inherit;
  transition: color .18s var(--e-ui);
}

.ns-post-title a:hover {
  color: var(--accent);
}

.ns-post-excerpt {
  font-size: .95rem;
  line-height: 1.6;
  color: var(--graphite);
  margin: 0;
  flex: 1;
}

.ns-post-cats {
  font-size: .78rem;
  letter-spacing: .04em;
  margin: 0;
}

.ns-post-cats a {
  color: var(--accent);
  text-decoration: none;
}

.ns-post-cats a:hover {
  text-decoration: underline;
}

.ns-post-cats a + a::before {
  content: " · ";
  color: var(--graphite);
}

/* ── Pagination & empty state ────────────────────────────────────────── */
.ns-blog-pages {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  align-items: center;
  padding-top: clamp(8px, 1.5vw, 16px);
  border-top: 1px solid var(--line);
}

.ns-blog-pages a {
  font-size: .9rem;
  text-decoration: none;
  color: var(--accent);
  font-weight: 600;
}

.ns-blog-pages a:hover {
  text-decoration: underline;
}

.ns-blog-empty {
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--graphite);
  margin: 0;
  padding: clamp(32px, 5vw, 56px) 0;
  text-align: center;
  max-width: 42ch;
}

/* ── Single post ───────────────────────────────────────────────────────── */
.ns-post {
  padding: calc(var(--sp-section) * .72) var(--gutter) var(--sp-section);
  max-width: calc(760px + var(--gutter) * 2);
  margin: 0 auto;
}

.ns-crumbs {
  font-size: .8rem;
  letter-spacing: .06em;
  color: var(--graphite);
  margin-bottom: clamp(20px, 2.4vw, 34px);
}

.ns-crumbs a {
  text-decoration: none;
  color: inherit;
}

.ns-crumbs a:hover {
  color: var(--accent);
}

.ns-post-h1 {
  font-family: var(--font-display);
  font-size: clamp(2.05rem, 5.6vw, 3.4rem);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -.028em;
  margin: 0 0 .45em;
  max-width: 18ch;
}

.ns-post .ns-post-meta,
.ns-post > .ns-post-meta {
  font-size: .83rem;
  letter-spacing: .05em;
  color: var(--graphite);
  margin: 0 0 clamp(24px, 3vw, 36px);
}

.ns-post-cover-link,
.ns-post > .ns-post-cover-link {
  display: block;
  margin-bottom: clamp(24px, 3vw, 40px);
  overflow: hidden;
}

.ns-post-cover-link img,
.ns-post > .ns-post-cover-link img {
  width: 100%;
  height: auto;
  display: block;
}

/* ── Post body typography ──────────────────────────────────────────────── */
.ns-post-body {
  font-size: 1.02rem;
  line-height: 1.72;
  max-width: 62ch;
}

.ns-post-body > *:first-child {
  margin-top: 0;
}

.ns-post-body h2 {
  font-size: clamp(1.5rem, 2.6vw, 2rem);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -.022em;
  margin: 1.8em 0 .55em;
  max-width: none;
}

.ns-post-body h3 {
  font-size: clamp(1.12rem, 1.5vw, 1.36rem);
  font-weight: 600;
  line-height: 1.22;
  margin: 1.5em 0 .5em;
}

.ns-post-body h4 {
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 1.3em 0 .45em;
}

.ns-post-body p {
  margin: 0 0 1.05em;
}

.ns-post-body ul,
.ns-post-body ol {
  margin: 0 0 1.2em;
  padding-left: 1.35em;
  list-style: disc;
}

.ns-post-body ol {
  list-style: decimal;
}

.ns-post-body li {
  margin-bottom: .45em;
}

.ns-post-body li::marker {
  color: var(--accent);
}

.ns-post-body blockquote {
  margin: 1.4em 0;
  padding: clamp(16px, 2vw, 22px) clamp(18px, 2.4vw, 28px);
  border-left: 3px solid var(--accent);
  background: var(--surface);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--graphite);
}

.ns-post-body blockquote p:last-child {
  margin-bottom: 0;
}

.ns-post-body img {
  width: 100%;
  height: auto;
  margin: 1.4em 0;
}

.ns-post-body figure {
  margin: 1.4em 0;
}

.ns-post-body figcaption {
  font-size: .83rem;
  color: var(--graphite);
  margin-top: .5em;
}

.ns-post-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ns-post-body a:hover {
  color: var(--accent-deep);
}

.ns-post-video {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 1.4em 0;
  background: var(--night);
  overflow: hidden;
}

.ns-post-video iframe,
.ns-post-video video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ── Post extras (toc, tags, share, related) ───────────────────────────── */
.ns-post-toc {
  margin: clamp(28px, 4vw, 44px) 0;
  padding: clamp(18px, 2.2vw, 26px);
  background: var(--surface);
  border: 1px solid var(--line);
  max-width: 62ch;
}

.ns-post-toc h2,
.ns-post-toc > strong,
.ns-post-toc > p:first-child {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 .75em;
  letter-spacing: -.01em;
}

.ns-post-toc ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.ns-post-toc li {
  margin-bottom: .4em;
}

.ns-post-toc a {
  font-size: .92rem;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color .18s var(--e-ui), border-color .18s var(--e-ui);
}

.ns-post-toc a:hover {
  color: var(--accent);
  border-bottom-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.ns-post-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: clamp(24px, 3vw, 36px) 0;
  max-width: 62ch;
}

.ns-post-tags a,
.ns-post-tags span {
  display: inline-block;
  padding: 6px 12px;
  font-size: .78rem;
  letter-spacing: .04em;
  text-decoration: none;
  color: var(--graphite);
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .18s var(--e-ui), color .18s var(--e-ui);
}

.ns-post-tags a:hover {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.ns-post-share {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 14px;
  align-items: center;
  margin: clamp(24px, 3vw, 36px) 0;
  padding-top: clamp(20px, 2.5vw, 28px);
  border-top: 1px solid var(--line);
  max-width: 62ch;
}

.ns-post-share > span,
.ns-post-share > p {
  font-size: .83rem;
  letter-spacing: .05em;
  color: var(--graphite);
  margin: 0;
}

.ns-post-share a {
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--accent);
}

.ns-post-share a:hover {
  text-decoration: underline;
}

.ns-post-related {
  margin: clamp(36px, 5vw, 56px) 0 0;
  padding-top: clamp(28px, 4vw, 40px);
  border-top: 1px solid var(--line);
}

.ns-post-related > h2,
.ns-post-related > p:first-child {
  font-family: var(--font-display);
  font-size: clamp(1.3rem, 2vw, 1.7rem);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 clamp(18px, 2.5vw, 28px);
  max-width: none;
}

.ns-post-related .ns-post-card {
  max-width: 360px;
}

.ns-post-related ul {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
  gap: clamp(16px, 2vw, 24px);
  margin: 0;
  padding: 0;
  list-style: none;
}

@media (max-width: 640px) {
  .ns-post-h1 {
    max-width: none;
  }

  .ns-blog-pages {
    flex-direction: column;
    align-items: flex-start;
  }
}
