/* ─── Inner pages — page head, prose, article, listings, 404, closing CTA ── */

.page-head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: clamp(20px, 2.4vw, 32px);
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(56px, 8vw, 128px) var(--gutter) clamp(32px, 4vw, 56px);
}

.page-head__title {
  font-size: clamp(56px, 9vw, 144px);
  font-weight: 900;
  letter-spacing: -0.03em;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.page-head__intro {
  max-width: 640px;
  font-size: var(--t-lg);
  line-height: 1.45;
  color: var(--ink-2);
}

/* ─── Prose (post/page content) ─── */
.prose {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 var(--gutter);
  font-size: 17px;
  line-height: 1.65;
  letter-spacing: -0.02em;
  color: color-mix(in srgb, var(--text-color) 88%, var(--text-muted));

  > * + * {
    margin-top: 1.1em;
  }

  h2,
  h3 {
    margin-top: 2em;
    color: var(--ink);
  }

  h2 {
    font-family: var(--font-display);
    font-weight: 900;
    text-transform: uppercase;
    font-size: clamp(32px, 3.6vw, 48px);
    line-height: 0.85;
    letter-spacing: -0.01em;
    text-wrap: balance;
  }

  h3 {
    font-size: var(--t-lg);
  }

  h4 {
    font-size: 17px;
    margin-top: 1.6em;
    color: var(--ink);
  }

  a {
    color: var(--ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;

    &:hover {
      color: var(--accent-text);
    }
  }

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

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

  li::marker {
    color: var(--accent);
  }

  blockquote {
    padding: clamp(20px, 3vw, 32px);
    border-radius: var(--radius-card);
    background: var(--block);
    font-size: var(--t-lg);
    line-height: 1.4;
    color: var(--ink);
  }

  img,
  figure {
    margin-inline: auto;
  }

  figcaption {
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-muted);
  }

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

  table {
    width: 100%;
    border-collapse: collapse;
    font-size: 15px;

    th,
    td {
      padding: 10px 12px;
      border-bottom: 1px solid var(--line);
      text-align: left;
    }
  }

  strong {
    color: var(--ink);
  }
}

/* ─── Single article ─── */
.article__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: clamp(56px, 8vw, 128px) var(--gutter) clamp(32px, 4vw, 56px);
}

.article__cat:hover {
  color: var(--accent-text);
}

.article__title {
  font-size: clamp(44px, 6.4vw, 104px);
  font-weight: 900;
  text-wrap: balance;
  overflow-wrap: anywhere;
}

.article__meta {
  display: flex;
  gap: 8px;
  font-size: var(--t-sm);
  color: var(--ink-2);
}

.article__media {
  margin: 0 0 clamp(40px, 5vw, 72px);
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--stage-2);

  @media (min-width: 992px) {
    aspect-ratio: 21 / 9;
  }
}

.article__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article__body,
.page-article__body {
  padding-bottom: clamp(56px, 7vw, 112px);
}

.article__tags {
  max-width: 720px;
  margin: -32px auto 0;
  padding: 0 var(--gutter) clamp(56px, 7vw, 112px);
}

.related {
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-top: 1px solid var(--line);
}

.related__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 16px;
}

.related__title {
  font-size: var(--d-lg);
}

/* ─── Listings (blog, archive, search) ─── */
.listing {
  display: flex;
  flex-direction: column;
  gap: clamp(28px, 3vw, 40px);
  max-width: var(--container);
  margin: 0 auto;
  padding-bottom: var(--section-y);

  > .card-grid,
  > .filter-pills,
  > .search-pill,
  > .pager,
  > .empty-state {
    margin-inline: var(--gutter);
  }
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pager {
  .nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }

  .page-numbers {
    display: grid;
    place-items: center;
    min-width: 44px;
    height: 44px;
    padding: 0 14px;
    border-radius: var(--radius-pill);
    background: var(--block);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    transition: background var(--hover-duration) ease-out, color var(--hover-duration) ease-out;

    &:hover,
    &.current {
      background: var(--ink);
      color: var(--on-dark);
    }

    &.dots {
      background: transparent;
    }
  }
}

/* Pill search form. */
.search-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  max-width: 520px;
  padding: 6px 6px 6px 22px;
  border-radius: var(--radius-pill);
  background: var(--block);

  &:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
  }
}

.search-pill__input {
  flex: 1;
  min-width: 0;
  padding: 8px 0;
  border: 0;
  background: transparent;
  outline: none;

  &::placeholder {
    color: var(--text-muted);
  }

  &::-webkit-search-cancel-button {
    -webkit-appearance: none;
  }
}

.search-pill__submit {
  display: grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--ink);
  color: var(--on-dark);
  transition: background var(--hover-duration) ease-out;

  &:hover {
    background: var(--accent);
  }
}

/* Empty state card. */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  padding: clamp(28px, 4vw, 56px);
  border-radius: var(--radius-card);
  background: var(--block);
}

.empty-state__title {
  font-size: var(--d-sm);
  font-weight: 900;
}

.empty-state__text {
  max-width: 520px;
  color: var(--ink-2);
}

/* ─── 404 ─── */
.not-found {
  position: relative;
  display: grid;
  place-items: center;
  min-height: calc(100vh - var(--header-h));
  padding: var(--section-y) var(--gutter);
  overflow: hidden;
  text-align: center;
}

.not-found__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 28px;
  max-width: 720px;
  padding: clamp(28px, 5vw, 64px);
  border-radius: clamp(24px, 3vw, 40px);
  background: var(--block);

  .search-pill {
    background: var(--base);
  }
}

.not-found__code {
  font-size: clamp(120px, 24vw, 320px);
  font-weight: 900;
  line-height: 0.8;
  letter-spacing: -0.04em;
}

.not-found__text {
  max-width: 460px;
  font-size: var(--t-lg);
  color: var(--ink-2);
}

.not-found__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 16px 28px;
}

/* ─── Closing CTA band (sunburst) ─── */
.closing-cta {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 36px;
  padding: clamp(96px, 12vw, 200px) var(--gutter);
  border-top: 1px solid var(--line);
  overflow: hidden;
  text-align: center;
}

.closing-cta__title {
  position: relative;
  font-size: var(--d-xl);
  letter-spacing: -0.03em;
}

.closing-cta .btn {
  position: relative;
}

/* Sunburst: thin ink lines radiating from the center at 16% opacity. */
.closing-cta__sunburst,
.not-found__sunburst {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 260vmax;
  height: 260vmax;
  transform: translate(-50%, -50%);
  background: repeating-conic-gradient(from 0deg, color-mix(in srgb, var(--text-color) 16%, transparent) 0deg 0.25deg, transparent 0.25deg 6deg);
  pointer-events: none;
}
