/* ==========================================================================
   AI Nowadays — Corporate Professional × Bauhaus × Editorial
   Trust-forward surfaces, geometric discipline, magazine typography.
   ========================================================================== */

:root {
  --ink: #0a1628;
  --ink-soft: #152a4a;
  --slate: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --border-strong: #cbd5e1;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --surface-warm: #f1f5f9;
  /* Bauhaus primaries — used sparingly as structure & accent */
  --bauhaus-red: #c41e1e;
  --bauhaus-yellow: #e8b923;
  --bauhaus-blue: #1e4db8;
  --accent: #1e4db8;
  --accent-hover: #163a8c;
  --font-serif: "Newsreader", "Georgia", serif;
  --font-sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  --container: 1140px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 2px;
  --radius: 4px;
  /* Includes 4px Bauhaus strip below the bar */
  --header-h: 76px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.6;
  color: var(--slate);
  background: var(--surface-alt);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Bauhaus grid trace — very subtle */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.4;
  background-image:
    linear-gradient(90deg, rgba(10, 22, 40, 0.04) 1px, transparent 1px);
  background-size: 72px 100%;
}

img {
  display: block;
  max-width: 100%;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

code {
  font-family: ui-monospace, "Cascadia Code", monospace;
  font-size: 0.86em;
  padding: 0.15em 0.4em;
  background: var(--surface-warm);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--font-serif);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(2.35rem, 4.8vw, 3.75rem);
  font-weight: 650;
}

h2 {
  font-size: clamp(1.85rem, 3.2vw, 2.65rem);
}

h3 {
  font-size: clamp(1.2rem, 2vw, 1.55rem);
}

p {
  margin: 0;
}

.container {
  width: min(100% - 40px, var(--container));
  margin-inline: auto;
}

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  transform: translateY(-200%);
  padding: 10px 16px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  transition: transform 180ms var(--ease);
}

.skip-link:focus {
  transform: translateY(0);
}

:focus-visible {
  outline: 2px solid var(--bauhaus-blue);
  outline-offset: 2px;
}

/* ========== Header — corporate bar + Bauhaus rule ========== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 1px 0 rgba(10, 22, 40, 0.06);
}

.site-header::after {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(
    90deg,
    var(--ink) 0 32%,
    var(--bauhaus-red) 32% 48%,
    var(--bauhaus-yellow) 48% 64%,
    var(--bauhaus-blue) 64% 100%
  );
}

.header__inner {
  width: min(100% - 40px, 1240px);
  margin-inline: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: var(--header-h);
  padding: 0;
}

.site-header.is-scrolled {
  box-shadow: 0 4px 24px rgba(10, 22, 40, 0.06);
}

.site-header.is-scrolled .header__inner {
  min-height: 64px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand__mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  background: var(--ink);
  color: var(--surface);
  font-family: var(--font-sans);
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  border-radius: var(--radius-sm);
  position: relative;
}

.brand__mark::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: var(--bauhaus-yellow);
  border-radius: var(--radius-sm) 0 var(--radius-sm) 0;
}

.brand__text {
  font-family: var(--font-serif);
  font-size: 1.35rem;
  font-weight: 650;
  color: var(--ink);
  letter-spacing: -0.03em;
}

.brand__text span {
  font-weight: 500;
  color: var(--muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 2px;
}

.main-nav a {
  padding: 10px 14px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
  border-radius: var(--radius-sm);
  transition: color 160ms, background 160ms;
}

.main-nav a:hover {
  color: var(--ink);
  background: var(--surface-warm);
}

.main-nav a.is-active {
  color: var(--ink);
  background: var(--surface-alt);
  box-shadow: inset 0 0 0 1px var(--border);
}

.main-nav a:last-child {
  margin-left: 8px;
  background: var(--ink);
  color: var(--surface);
}

.main-nav a:last-child:hover {
  background: var(--ink-soft);
  color: var(--surface);
}

.main-nav a:last-child.is-active {
  background: var(--bauhaus-blue);
  box-shadow: none;
  color: var(--surface);
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.nav-toggle span {
  width: 18px;
  height: 2px;
  background: var(--ink);
}

@media (max-width: 880px) {
  .main-nav {
    position: fixed;
    left: 16px;
    right: 16px;
    top: calc(var(--header-h) + 8px);
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 16px 48px rgba(10, 22, 40, 0.12);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-6px);
    transition: opacity 200ms, transform 200ms;
  }

  .main-nav.is-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .main-nav a:last-child {
    margin-left: 0;
    text-align: center;
  }

  .nav-toggle {
    display: flex;
  }
}

/* ========== Editorial labels & sections ========== */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.eyebrow::before {
  content: "";
  width: 24px;
  height: 3px;
  background: var(--bauhaus-red);
  border-radius: var(--radius-sm);
}

.section {
  padding: clamp(56px, 9vw, 96px) 0;
}

.section--tight {
  padding-top: 40px;
}

.section--offset {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: 720px;
  margin-bottom: clamp(28px, 4vw, 40px);
}

.section-head--split {
  max-width: none;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(240px, 0.75fr);
  gap: 28px 48px;
  align-items: end;
}

.section-head--split p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.section-head--compact {
  margin-bottom: 28px;
}

@media (max-width: 800px) {
  .section-head--split {
    grid-template-columns: 1fr;
  }
}

.text-link {
  font-weight: 700;
  font-size: 0.9375rem;
  color: var(--accent);
  border-bottom: 1px solid rgba(30, 77, 184, 0.35);
  padding-bottom: 1px;
  transition: color 160ms, border-color 160ms;
}

.text-link:hover {
  color: var(--accent-hover);
  border-color: var(--accent-hover);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: background 160ms, transform 160ms;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn--primary {
  background: var(--ink);
  color: var(--surface);
}

.btn--primary:hover {
  background: var(--ink-soft);
}

/* ========== Home hero — editorial + geometric band ========== */
.editorial-front {
  padding: calc(var(--header-h) + 48px) 0 56px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.editorial-front__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 720px) {
  .editorial-front__grid {
    grid-template-columns: 1fr;
  }

  .bauhaus-stack {
    flex-direction: row !important;
    max-width: none;
  }
}

.editorial-front__head {
  max-width: 820px;
}

.editorial-front__deck {
  margin-top: 20px;
  font-size: 1.125rem;
  line-height: 1.65;
  color: var(--muted);
  max-width: 640px;
}

.bauhaus-stack {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-width: 120px;
}

.bauhaus-stack__block {
  height: 36px;
  border-radius: var(--radius-sm);
}

.bauhaus-stack__block--1 {
  background: var(--ink);
}

.bauhaus-stack__block--2 {
  background: var(--bauhaus-red);
}

.bauhaus-stack__block--3 {
  background: var(--bauhaus-yellow);
}

.bauhaus-stack__block--4 {
  background: var(--bauhaus-blue);
}

.ef-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 32px 0 24px;
}

.ef-cats a {
  padding: 8px 14px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 160ms, background 160ms;
}

.ef-cats a:hover {
  border-color: var(--ink);
  background: var(--surface);
}

.ef-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(280px, 0.48fr);
  gap: 28px;
  align-items: start;
}

@media (max-width: 960px) {
  .ef-grid {
    grid-template-columns: 1fr;
  }
}

.ef-lead {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 12px 40px rgba(10, 22, 40, 0.06);
}

.ef-lead__image {
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
}

.ef-lead__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.ef-lead:hover .ef-lead__image img {
  transform: scale(1.02);
}

.ef-lead__body {
  padding: clamp(22px, 3vw, 32px);
  border-top: 4px solid var(--ink);
}

.ef-cat {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--bauhaus-blue);
}

.ef-lead__title {
  margin-top: 12px;
}

.ef-lead__title a:hover {
  color: var(--accent);
}

.ef-lead__excerpt {
  margin-top: 12px;
  color: var(--muted);
  font-size: 1.02rem;
}

.ef-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 20px;
  margin-top: 18px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--muted);
}

.ef-sidebar {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface-alt);
}

.ef-divider {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 20px 0;
}

.ef-side-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 100px;
  gap: 16px;
  align-items: start;
}

.ef-side-item__body h3 {
  margin-top: 8px;
  font-size: 1.05rem;
}

.ef-side-item__body p {
  margin-top: 8px;
  font-size: 0.875rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ef-side-item__image {
  display: block;
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
}

.ef-side-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ef-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  margin-top: 28px;
}

@media (max-width: 1024px) {
  .ef-strip {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 540px) {
  .ef-strip {
    grid-template-columns: 1fr;
  }
}

.ef-strip-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.ef-strip-item__image {
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}

.ef-strip-item__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ef-strip-item__body {
  padding: 14px 16px 18px;
}

.ef-strip-item__body h3 {
  margin-top: 8px;
  font-size: 0.95rem;
  line-height: 1.25;
}

/* Category grid (default / fallback) */
.category-grid:not(.category-grid--carousel) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

/* Topic carousel — horizontal LTR scroll */
.category-carousel-shell {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-top: 4px;
}

.category-carousel {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 4px;
  scroll-behavior: smooth;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  outline: none;
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    black 12px,
    black calc(100% - 12px),
    transparent 100%
  );
}

.category-carousel:focus-visible {
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--bauhaus-blue);
  border-radius: var(--radius);
}

.category-grid--carousel {
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  gap: 16px;
  padding: 4px 2px 12px;
  width: max-content;
  min-height: 100%;
}

.category-grid--carousel .category-card {
  flex: 0 0 clamp(260px, 72vw, 320px);
  width: clamp(260px, 72vw, 320px);
  max-width: 320px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
}

.category-carousel__btn {
  flex-shrink: 0;
  align-self: center;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(10, 22, 40, 0.06);
  transition: background 160ms, border-color 160ms, color 160ms, opacity 160ms;
}

.category-carousel__btn:hover:not(:disabled) {
  background: var(--surface-alt);
  border-color: var(--border-strong);
  color: var(--bauhaus-blue);
}

.category-carousel__btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .category-carousel-shell {
    gap: 8px;
  }

  .category-carousel__btn {
    width: 40px;
    height: 40px;
  }

  .category-grid--carousel .category-card {
    flex-basis: min(280px, 85vw);
    width: min(280px, 85vw);
  }
}

.category-card {
  display: grid;
  gap: 10px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.04);
  transition: border-color 180ms, box-shadow 180ms;
  min-height: 188px;
  position: relative;
}

.category-card::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--ink);
  border-radius: var(--radius) 0 0 var(--radius);
}

.category-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 12px 32px rgba(10, 22, 40, 0.08);
}

.category-card__count {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 650;
  color: var(--ink);
}

.category-card p {
  color: var(--muted);
  font-size: 0.9375rem;
}

.category-card__link {
  margin-top: 4px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 0.8125rem;
  color: var(--accent);
}

.category-card__link svg {
  width: 16px;
  height: 16px;
}

.category-card--1::before {
  background: var(--ink);
}

.category-card--2::before {
  background: var(--bauhaus-red);
}

.category-card--3::before {
  background: var(--bauhaus-yellow);
}

.category-card--4::before {
  background: var(--bauhaus-blue);
}

/* Category columns */
.category-posts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.cat-col {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: var(--surface);
}

.cat-col__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--surface-warm);
}

.cat-col__name {
  font-family: var(--font-serif);
  font-weight: 650;
  color: var(--ink);
  font-size: 1.05rem;
}

.cat-col__link svg {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.cat-row {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--border);
  align-items: center;
}

.cat-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.cat-row__thumb {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 1;
  border: 1px solid var(--border);
}

.cat-row__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cat-row__info span {
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cat-row__info p {
  margin-top: 4px;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9375rem;
  line-height: 1.35;
}

/* Post cards */
.feature-grid,
.post-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 20px;
}

.post-grid--latest .post-card {
  grid-column: span 6;
}

.post-grid--detail .post-card {
  grid-column: span 4;
}

@media (max-width: 960px) {
  .post-grid--latest .post-card {
    grid-column: span 12;
  }

  .post-grid--detail .post-card {
    grid-column: span 12;
  }
}

.post-card {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.04);
  transition: border-color 180ms, box-shadow 180ms;
}

.post-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 14px 36px rgba(10, 22, 40, 0.08);
}

.post-card--wide {
  grid-column: span 12;
  flex-direction: row;
  align-items: stretch;
}

@media (max-width: 820px) {
  .post-card--wide {
    flex-direction: column;
  }
}

.post-card--wide .post-card__media {
  flex: 0 0 44%;
  aspect-ratio: auto;
  min-height: 240px;
}

.post-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.post-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 560ms var(--ease);
}

.post-card:hover .post-card__media img {
  transform: scale(1.03);
}

.post-card__body {
  padding: 20px 22px 22px;
  display: grid;
  gap: 10px;
  flex: 1;
}

.post-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.post-card__body h3 a:hover {
  color: var(--accent);
}

.post-card__body p {
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.post-card__link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-top: 4px;
}

.post-card__link svg {
  width: 16px;
  height: 16px;
}

.post-card--catalog .post-card__body {
  padding: 18px 20px 20px;
}

.post-card--catalog .post-card__body p {
  -webkit-line-clamp: 4;
  font-size: 0.9rem;
}

.post-card--catalog .post-card__media {
  aspect-ratio: 3 / 2;
}

/* ========== Page hero ========== */
.page-hero {
  padding: calc(var(--header-h) + 40px) 0 32px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-hero__inner {
  max-width: 720px;
}

.page-hero__inner p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
}

/* ========== Archive — sticky index + uniform grid ========== */
.catalog-page {
  padding-bottom: 64px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.catalog-sidebar__sticky {
  position: sticky;
  top: calc(var(--header-h) + 16px);
}

.catalog-toolbar {
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.catalog-toolbar__count {
  font-weight: 700;
  color: var(--ink);
  font-size: 0.9375rem;
}

.catalog-filter--sidebar {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(10, 22, 40, 0.04);
}

.catalog-sidebar__intro {
  padding-bottom: 16px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.catalog-sidebar__lede {
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.6;
}

.catalog-sidebar__stat {
  margin-top: 12px;
  font-size: 0.8125rem;
  color: var(--slate);
}

.catalog-sidebar__label {
  display: block;
  margin-top: 16px;
  margin-bottom: 4px;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.catalog-filter__btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  text-align: left;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--surface-alt);
  color: var(--slate);
  font-weight: 600;
  font-size: 0.875rem;
  transition: background 160ms, border-color 160ms, color 160ms;
}

.catalog-filter__btn:hover {
  background: var(--surface-warm);
  color: var(--ink);
}

.catalog-filter__btn.is-active {
  background: var(--surface);
  border-color: var(--ink);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.catalog-filter__count {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--muted);
  flex-shrink: 0;
}

.catalog-filter__btn.is-active .catalog-filter__count {
  color: var(--bauhaus-blue);
}

/* Professional archive grid (replaces masonry) */
.archive-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: 20px;
}

.archive-grid .post-card {
  grid-column: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

@media (max-width: 900px) {
  .catalog-layout {
    grid-template-columns: 1fr;
  }

  .catalog-sidebar__sticky {
    position: relative;
    top: 0;
  }

  .catalog-filter--sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .catalog-sidebar__intro {
    grid-column: 1 / -1;
  }

  .catalog-filter__btn {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
  }
}

@media (max-width: 520px) {
  .catalog-filter--sidebar {
    grid-template-columns: 1fr;
  }
}

/* ========== Article ========== */
.article-hero {
  padding: calc(var(--header-h) + 36px) 0 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.article-hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.82fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
}

@media (max-width: 900px) {
  .article-hero__grid {
    grid-template-columns: 1fr;
  }
}

.article-back {
  display: inline-block;
  margin-bottom: 14px;
  font-weight: 700;
  font-size: 0.875rem;
  color: var(--accent);
}

.article-hero__copy p {
  margin-top: 16px;
  color: var(--muted);
  font-size: 1.0625rem;
  line-height: 1.65;
  max-width: 54ch;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-top: 22px;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--muted);
}

.article-hero__image {
  margin: 0;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 48px rgba(10, 22, 40, 0.08);
}

.article-hero__image img {
  width: 100%;
  display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  gap: clamp(32px, 5vw, 56px);
  padding: 48px 0 80px;
  align-items: start;
  max-width: calc(var(--container) + 80px);
  margin-inline: auto;
  width: min(100% - 40px, calc(var(--container) + 80px));
}

@media (max-width: 900px) {
  .article-layout {
    grid-template-columns: 1fr;
  }
}

.article-aside {
  position: sticky;
  top: calc(var(--header-h) + 16px);
  display: grid;
  gap: 14px;
}

.aside-card {
  padding: 18px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
}

.aside-card__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 8px;
}

.aside-card h2 {
  font-size: 1.15rem;
}

.aside-card p {
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.55;
}

.aside-card--note {
  background: var(--surface-alt);
  border-left: 4px solid var(--bauhaus-yellow);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--slate);
  background: var(--surface-alt);
}

.article-body {
  font-size: 1.0625rem;
  line-height: 1.75;
  color: var(--slate);
  max-width: 65ch;
}

.article-body > * + * {
  margin-top: 1.2em;
}

.article-body h2 {
  margin-top: 1.75em;
  font-size: clamp(1.4rem, 2.2vw, 1.75rem);
  padding-top: 0.5em;
  border-top: 1px solid var(--border);
}

.article-body ul {
  margin: 0;
  padding-left: 1.25em;
}

.article-body li {
  margin-top: 0.5em;
}

.article-body blockquote {
  margin: 1.5em 0;
  padding: 20px 24px;
  border-left: 4px solid var(--ink);
  background: var(--surface-alt);
  font-family: var(--font-serif);
  font-size: 1.125rem;
  color: var(--ink);
}

/* Newsletter */
.newsletter {
  padding: 72px 0 96px;
  background: var(--ink);
  color: rgba(248, 250, 252, 0.92);
  border-top: 4px solid var(--bauhaus-yellow);
}

.newsletter .eyebrow {
  color: rgba(248, 250, 252, 0.55);
}

.newsletter .eyebrow::before {
  background: var(--bauhaus-yellow);
}

.newsletter h2 {
  color: var(--surface);
}

.newsletter__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 400px);
  gap: 40px;
  align-items: center;
}

@media (max-width: 860px) {
  .newsletter__inner {
    grid-template-columns: 1fr;
  }
}

.newsletter__inner > div p {
  margin-top: 12px;
  color: rgba(248, 250, 252, 0.65);
  font-size: 1rem;
}

.newsletter-form label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(248, 250, 252, 0.5);
  margin-bottom: 8px;
}

.newsletter-form__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.newsletter-form input {
  flex: 1 1 200px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(248, 250, 252, 0.2);
  background: rgba(10, 22, 40, 0.5);
  color: var(--surface);
}

.newsletter-form input::placeholder {
  color: rgba(248, 250, 252, 0.35);
}

.newsletter .btn--primary {
  background: var(--surface);
  color: var(--ink);
}

.newsletter .btn--primary:hover {
  background: var(--bauhaus-yellow);
  color: var(--ink);
}

.form-note {
  margin-top: 10px;
  font-size: 0.875rem;
  color: rgba(248, 250, 252, 0.5);
}

/* Footer */
.site-footer {
  padding: 48px 0 24px;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 32px 48px;
  justify-content: space-between;
  align-items: flex-start;
}

.footer__inner p {
  max-width: 340px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9375rem;
}

.footer__inner nav {
  display: grid;
  gap: 8px;
}

.footer__inner nav a {
  font-weight: 600;
  font-size: 0.9375rem;
  color: var(--slate);
}

.footer__inner nav a:hover {
  color: var(--ink);
}

.footer__bottom {
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.footer__legal {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
}

.footer__legal a {
  font-weight: 600;
  color: var(--slate);
}

.footer__legal a:hover {
  color: var(--accent);
}

.brand--footer .brand__mark {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
}

.brand--footer .brand__text {
  color: var(--ink);
}

/* Legal pages */
.legal-body {
  max-width: 720px;
  margin-inline: auto;
}

.legal-body h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.legal-body h2:first-of-type {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.legal-body p,
.legal-body li {
  color: var(--slate);
  font-size: 1rem;
  line-height: 1.7;
}

.legal-body ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25em;
}

.legal-body li {
  margin-top: 0.5rem;
}

/* Empty & reveal */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 56px 24px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
}

[data-reveal] {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 480ms var(--ease), transform 480ms var(--ease);
}

[data-reveal].is-revealed {
  opacity: 1;
  transform: none;
}
