/* ============================================================
   rebbica — monochrome editorial (LMP parity: gurugayan.com)
   Flat black/white magazine. Fjalla One uppercase titles &
   widget-titles, Roboto Condensed body, Slabo 27px black sticky
   header nav, Noto Serif accents. Single-column feed with the
   title + byline ABOVE the media, "Continue Reading…", a right
   sidebar (About / Newsletter / Categories) and a centered black
   footer. One blue accent (#3096C6) reserved for prose links.
   Personality: quiet, typographic, newsprint-clean.
   ============================================================ */
@import url("https://fonts.googleapis.com/css2?family=Fjalla+One&family=Noto+Serif:ital,wght@0,400;0,700;1,400&family=Roboto+Condensed:ital,wght@0,400;0,700;1,400;1,700&family=Slabo+27px&display=swap");

/* ---------- 1. TOKENS ---------- */
:root {
  --color-bg: #ffffff;
  --color-surface: #ffffff;
  --color-surface-alt: #f7f7f7;
  --color-text: #444444;
  --color-text-muted: #ababab;
  --color-text-soft: #999999;
  --color-heading: #121212;
  --color-ink: #000000;
  --color-accent: #3096c6;          /* prose links only */
  --color-accent-contrast: #ffffff;
  --color-border: #eeeeee;
  --color-border-dash: #dddddd;
  --color-rule: #ababab;            /* widget-title underline bar */

  /* monochrome theme — categories are not colour-coded */
  --color-cat-technology: #121212;
  --color-cat-business: #121212;
  --color-cat-entertainment: #121212;
  --color-cat-lifestyle: #121212;

  --plate: #f2f2f2;
  --s1: #cfcfcf;
  --s2: #9f9f9f;
  --s3: #e4e4e4;

  --font-display: "Fjalla One", "Arial Narrow", sans-serif;
  --font-body: "Roboto Condensed", system-ui, sans-serif;
  --font-serif: "Noto Serif", Georgia, serif;
  --font-nav: "Slabo 27px", Georgia, serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, monospace;

  --step--1: 0.875rem;                                   /* 14px meta */
  --step-0: 1.0625rem;                                   /* 17px body */
  --step-1: 1.125rem;                                    /* 18px */
  --step-2: clamp(1.35rem, 1.2rem + 0.7vw, 1.5rem);      /* 24px */
  --step-3: clamp(1.55rem, 1.35rem + 0.9vw, 1.75rem);    /* 28px widget/section */
  --step-4: clamp(1.9rem, 1.5rem + 1.8vw, 2.25rem);      /* 36px grid title */
  --step-5: clamp(2rem, 1.6rem + 2.3vw, 2.5rem);         /* 40px feed / h1 */

  --leading-tight: 1.12;
  --leading-body: 1.65;

  --space-2xs: 0.25rem;
  --space-xs: 0.5rem;
  --space-sm: 0.75rem;
  --space-md: 1.25rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --container-max: 1230px;
  --container-narrow: 760px;

  --radius-sm: 2px;
  --radius-md: 2px;
  --radius-lg: 2px;
  --radius-full: 50%;

  --shadow-sm: none;
  --shadow-md: none;
  --transition: 0.25s ease;
}

/* ---------- 2. GLOBAL ---------- */
body {
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: var(--leading-body);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-heading);
  line-height: var(--leading-tight);
  letter-spacing: 0.01em;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition), opacity var(--transition),
    border-color var(--transition), background-color var(--transition);
}

::selection {
  background: var(--color-heading);
  color: #ffffff;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.skip-link:focus-visible {
  background: var(--color-ink);
  color: #ffffff;
}

/* ---------- 3. LAYOUT ---------- */

/* Header: sticky black bar (LMP fixed 80px; sticky avoids the missing
   .header-offset spacer and the JS-shrink-to-60 is ignored anyway). */
.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
  background: var(--color-ink);
  color: #ffffff;
}

.site-header__inner {
  position: relative;
  max-width: var(--container-max);
  margin: 0 auto;
  min-height: 80px;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
}

.site-brand {
  position: relative;
  z-index: 2;
}

.site-brand__link {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}

.site-brand__logo {
  display: none;
}

.site-brand__name {
  font-family: var(--font-nav);
  font-size: 1.35rem;
  color: #ffffff;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.site-brand__tagline {
  display: none;
}

/* Nav: truly centred over the bar (logo left, actions right). */
.site-nav {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  height: 100%;
  display: flex;
  align-items: center;
}

.site-nav__list {
  display: flex;
  align-items: center;
  list-style: none;
}

.site-nav__link {
  display: inline-block;
  padding: 0 18px;
  font-family: var(--font-nav);
  font-size: 12px;
  color: #ffffff;
  text-transform: uppercase;
  letter-spacing: 1px;
  line-height: 80px;
}

.site-nav__link:hover,
.site-nav__link[aria-current="page"] {
  color: var(--color-rule);
}

.site-header__actions {
  position: relative;
  z-index: 2;
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.search-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  color: #ffffff;
  font-family: var(--font-nav);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.search-link:hover {
  color: var(--color-rule);
}

.search-link__icon::before {
  content: "\2315";
  font-size: 1.15em;
  line-height: 1;
}

.search-link__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.header-cta {
  display: inline-block;
  font-family: var(--font-nav);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  padding: 0.45em 1.1em;
}

.header-cta:hover {
  border-color: #ffffff;
  color: var(--color-rule);
}

.decor--header {
  display: none;
}

/* Layout: content left, sidebar RIGHT */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: var(--space-xl);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-2xl);
}

.layout__primary {
  min-width: 0;
}

.layout__sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xl);
  align-self: start;
  min-width: 0;
}

/* Sidebar widgets — reordered: About → Newsletter → Categories,
   popular hidden (LMP has no "recently published" widget). */
.widget--about { order: 1; }
.widget--newsletter { order: 2; }
.widget--categories { order: 3; }
.widget--popular { display: none; }

.widget__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-3);
  color: var(--color-heading);
  text-align: center;
  padding-bottom: 15px;
  margin-bottom: 30px;
  position: relative;
  line-height: 1em;
  font-weight: 400;
}

.widget__title::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background: var(--color-rule);
}

.widget__body {
  font-size: var(--step-0);
  color: var(--color-text);
}

/* About widget: centred, with a decorative photo plate above the copy. */
.widget--about .widget__body {
  text-align: center;
}

.widget--about .widget__body::before {
  content: "";
  display: block;
  width: 100%;
  height: 170px;
  margin-bottom: 15px;
  background: var(--plate)
    url("/assets/images/placeholder-hero.svg") center / cover no-repeat;
  filter: grayscale(1) contrast(0.95);
}

.widget--about .widget__body p {
  margin-bottom: var(--space-sm);
}

.widget__link {
  display: inline-block;
  margin-top: var(--space-xs);
  font-weight: 700;
  color: var(--color-heading);
  border-bottom: 1px solid var(--color-heading);
}

.widget__link:hover {
  color: var(--color-accent);
  border-color: var(--color-accent);
}

/* Newsletter widget copy */
.widget__text {
  text-align: center;
  margin-bottom: var(--space-md);
  color: var(--color-text);
}

/* Categories widget: italic list, dashed rules, name + (count) */
.widget-categories {
  list-style: none;
}

.widget-categories__item {
  border-bottom: 1px dashed var(--color-border-dash);
}

.widget-categories__item:last-child {
  border-bottom: none;
}

.widget-categories__link {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-xs);
  padding: 0.5em 0;
  font-style: italic;
  color: var(--color-text-soft);
}

.widget-categories__link:hover .widget-categories__name {
  color: var(--color-accent);
}

.widget-categories__name {
  text-transform: uppercase;
  font-style: normal;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.widget-categories__count::before { content: "("; }
.widget-categories__count::after { content: ")"; }

.widget-categories__count {
  font-style: normal;
  color: var(--color-text-soft);
}

/* Footer: single centred black bar */
.site-footer {
  background: var(--color-ink);
  color: #ffffff;
  text-align: center;
  padding: var(--space-2xl) var(--space-md);
  margin-top: var(--space-lg);
}

.decor--footer { display: none; }

.site-footer__inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
}

.site-footer__brand {
  order: 1;
}

.site-footer__brand-link {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-3);
  color: #ffffff;
  letter-spacing: 0.03em;
}

.site-footer__brand-link:hover { color: var(--color-rule); }

.site-footer__about { display: none; }

/* Footer nav columns collapse into one inline centred link row */
.site-footer__nav {
  order: 2;
}

.site-footer__nav--explore { display: none; }

.site-footer__heading {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.site-footer__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4em 1.6em;
  list-style: none;
  font-family: var(--font-nav);
  font-size: 14px;
}

.site-footer__list a { color: #ffffff; }
.site-footer__list a:hover { color: var(--color-rule); }

.site-footer__social {
  order: 3;
}

.social-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
  list-style: none;
}

.social-list__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: #ffffff;
  font-size: 1rem;
}

.social-list__link:hover { color: var(--color-rule); }

.site-footer__legal {
  order: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  margin-top: var(--space-xs);
}

.site-footer__copyright {
  font-size: 15px;
  color: #ffffff;
}

.site-footer__legal-links {
  display: flex;
  gap: 1.4em;
  list-style: none;
  font-size: 14px;
}

.site-footer__legal-links a {
  color: #ffffff;
  text-decoration: underline;
}

.site-footer__legal-links a:hover { color: var(--color-rule); }

/* ---------- 4. COMPONENTS ---------- */

/* Sections: bare, no chrome */
.section {
  margin-bottom: var(--space-2xl);
}

.section__header {
  margin-bottom: var(--space-lg);
  display: flex;
  align-items: baseline;
  gap: var(--space-sm);
}

.section__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-3);
  color: var(--color-heading);
}

.section__link {
  margin-left: auto;
  font-size: var(--step--1);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-soft);
  white-space: nowrap;
}

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

/* Homepage: featured + latest read as one continuous single-column feed;
   their literal section headings are dropped (LMP shows none), and the
   trailing "Browse by category" block is hidden (the sidebar carries it). */
.section--hero .section__header,
.section--featured .section__header,
.section--latest .section__header {
  display: none;
}

.section--categories { display: none; }

/* Hero: full-width (of the content column) static slide with an
   overlaid uppercase title — the carousel reduced to slide 1. */
.section--hero {
  position: relative;
  margin-bottom: var(--space-2xl);
}

.decor--hero { display: none; }

.post-card--hero {
  position: relative;
  display: block;
  background: var(--color-ink);
  overflow: hidden;
}

.post-card--hero .post-card__media {
  margin: 0;
}

.post-card--hero .post-card__image {
  display: block;
  width: 100%;
  height: clamp(300px, 34vw, 430px);
  object-fit: cover;
  opacity: 0.72;
}

.post-card--hero .post-card__body {
  display: block;
  position: absolute;
  inset: auto 0 0 0;
  padding: var(--space-xl) var(--space-lg) var(--space-lg);
  background: linear-gradient(to top, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0));
}

.post-card--hero .post-card__title {
  font-size: var(--step-5);
  text-transform: uppercase;
  color: #ffffff;
  max-width: 22ch;
}

.post-card--hero .post-card__title a { color: #ffffff; }
.post-card--hero .post-card__title a:hover { opacity: 0.7; }

.post-card--hero .post-card__meta {
  margin-bottom: var(--space-sm);
}

.post-card--hero .post-card__category,
.post-card--hero .post-card__date {
  color: rgba(255, 255, 255, 0.85);
}

.post-card--hero .post-card__excerpt,
.post-card--hero .post-card__byline { display: none; }

/* Post grids: the feed contexts are single-column stacks. */
.post-grid {
  display: grid;
  gap: var(--space-2xl);
}

.post-grid--featured,
.post-grid--latest,
.post-grid--listing,
.post-grid--results,
.post-grid--author-posts {
  grid-template-columns: minmax(0, 1fr);
}

/* The workhorse card — title + byline ABOVE the media (LMP signature).
   Frozen markup keeps title/meta/byline inside __body while __media is a
   sibling, so promote the body's children with display:contents and order
   the grandchildren around the media. */
.post-card {
  display: flex;
  flex-direction: column;
  padding: 0 0 var(--space-2xl);
  border-bottom: 1px solid var(--color-border);
}

.post-card__body {
  display: contents;
}

.post-card__title {
  order: 1;
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-5);
  line-height: 1.1;
  color: var(--color-heading);
  margin-bottom: var(--space-sm);
}

.post-card__title a:hover { color: var(--color-ink); opacity: 0.7; }

/* byline + meta collapse into one thin detail line above the media */
.post-card__byline {
  order: 2;
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step--1);
  color: var(--color-text-muted);
  margin-bottom: 0.15em;
}

.post-card__meta {
  order: 3;
  display: flex;
  align-items: center;
  gap: 0.5em;
  font-size: var(--step--1);
  color: var(--color-text-muted);
  margin-bottom: var(--space-md);
}

.post-card__avatar {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.post-card__author,
.post-card__date,
.post-card__category { color: var(--color-text-muted); }

.post-card__author::before { content: "by "; }
.post-card__category::before { content: "in "; }

.post-card__author:hover,
.post-card__category:hover { color: var(--color-accent); }

.post-card__reading-time { display: none; }

.post-card__media {
  order: 4;
  overflow: hidden;
  background: var(--plate);
  margin-bottom: var(--space-md);
}

.post-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.post-card__excerpt {
  order: 5;
  color: var(--color-text);
}

/* "Continue Reading…" affordance (LMP .read-more) */
.post-card__excerpt::after {
  content: "Continue Reading...";
  display: block;
  margin-top: var(--space-sm);
  font-weight: 700;
  font-style: italic;
  font-size: 1.05rem;
  color: #555555;
}

.post-card:hover .post-card__excerpt::after { color: var(--color-accent); }

/* Mini cards (only used inside the hidden popular widget) — reset */
.post-card--mini { display: none; }

/* Related grid: two columns, media on TOP (LMP related layout), no excerpt */
.post-grid--related {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-lg) var(--space-lg);
}

.post-grid--related .post-card {
  border-bottom: none;
  padding-bottom: 0;
}

.post-grid--related .post-card__media {
  order: -1;
  margin-bottom: var(--space-sm);
}

.post-grid--related .post-card__title {
  order: 0;
  font-size: 1.4rem;
  margin-bottom: 0.4em;
}

.post-grid--related .post-card__byline {
  order: 1;
  margin-bottom: 0;
}

.post-grid--related .post-card__meta,
.post-grid--related .post-card__excerpt { display: none; }

/* Category cards (only surface if a theme reveals the categories block;
   hidden on home but styled for completeness). */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  list-style: none;
}

.category-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  text-align: center;
}

.category-card:hover { border-color: var(--color-heading); }

.category-card__name {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-1);
  color: var(--color-heading);
}

.category-card__count {
  font-size: var(--step--1);
  color: var(--color-text-soft);
}

/* Page headers (category / archive / author / search / static) */
.page-header {
  margin-bottom: var(--space-xl);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--color-border);
  text-align: center;
}

.page-header__eyebrow {
  font-family: var(--font-nav);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-xs);
}

.page-header__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-5);
  color: var(--color-heading);
}

.page-header__description {
  margin-top: var(--space-sm);
  color: var(--color-text);
  max-width: 60ch;
  margin-inline: auto;
}

.page-header__count {
  margin-top: var(--space-xs);
  font-size: var(--step--1);
  font-style: italic;
  color: var(--color-text-soft);
}

/* Pagination — Newer / Older only (numbered window hidden), black bar */
.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  margin-top: var(--space-xl);
  background: var(--color-ink);
  padding: 0;
}

.pagination__list { display: none; }

.pagination__link {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 1em 1.4em;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 1rem;
  color: #ffffff;
}

.pagination__link:hover { color: var(--color-rule); }

.pagination__link[aria-disabled="true"] {
  opacity: 0.35;
  pointer-events: none;
}

/* Relabel to match LMP wording without touching markup */
.pagination__link--prev { font-size: 0; }
.pagination__link--prev::after {
  content: "\2039  Newer Posts";
  font-size: 1rem;
}

.pagination__link--next { font-size: 0; }
.pagination__link--next::after {
  content: "Older Posts  \203A";
  font-size: 1rem;
}

/* Breadcrumbs — LMP article has none */
.breadcrumbs { display: none; }

/* ---- Article page ---- */
.post {
  margin-bottom: var(--space-2xl);
}

.post__header {
  margin-bottom: var(--space-lg);
}

.post__category {
  display: none;   /* category is carried in the meta row below */
}

.post__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-5);
  line-height: 1.1;
  color: var(--color-heading);
  margin-bottom: var(--space-md);
}

.post__standfirst { display: none; }   /* LMP article has no standfirst */

.post__meta {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: #181818;
  font-size: var(--step--1);
  margin-bottom: var(--space-lg);
}

.post__avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  object-fit: cover;
}

.post__author {
  font-weight: 700;
  color: #181818;
}

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

.post__meta-text {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  flex-wrap: wrap;
}

.post__meta-row {
  display: flex;
  gap: 0.6em;
  color: var(--color-text-muted);
}

.post__reading-time::before { content: "\00b7\00a0"; }

.post__hero {
  margin: 0 0 var(--space-lg);
}

.post__hero-image {
  display: block;
  width: 100%;
  max-height: 460px;
  object-fit: cover;
  background: var(--plate);
}

.post__hero-caption {
  margin-top: var(--space-xs);
  font-size: 14px;
  color: var(--color-text-muted);
  font-style: italic;
}

/* Prose (article + static page body) */
.prose {
  max-width: var(--container-narrow);
  font-size: var(--step-0);
}

.prose > * + * { margin-top: var(--space-md); }

.prose h2 {
  font-family: var(--font-display);
  font-size: var(--step-4);
  color: var(--color-heading);
  margin-top: var(--space-xl);
}

.prose h3 {
  font-family: var(--font-display);
  font-size: var(--step-2);
  color: var(--color-heading);
  margin-top: var(--space-lg);
}

/* the one accent: bold blue prose links */
.prose a {
  color: var(--color-accent);
  font-weight: 700;
}

.prose a:hover { text-decoration: underline; }

.prose blockquote {
  font-family: var(--font-serif);
  font-style: italic;
  border-left: 3px solid var(--color-heading);
  padding: var(--space-xs) var(--space-md);
  color: var(--color-heading);
}

.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: var(--space-2xs); }

/* centred images capped at 450px (LMP body-image rule) */
.prose img,
.prose figure {
  display: block;
  max-width: 450px;
  margin-inline: auto;
  height: auto;
}

.prose figure img { max-width: 100%; }

.prose figcaption {
  text-align: center;
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: var(--space-xs);
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.prose th, .prose td {
  padding: 0.6em 0.9em;
  border: 1px solid var(--color-border);
  text-align: left;
}

.prose th {
  background: var(--color-surface-alt);
  font-family: var(--font-display);
  font-weight: 400;
  color: var(--color-heading);
}

.prose pre {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--step--1);
}

.prose :not(pre) > code {
  background: var(--color-surface-alt);
  border: 1px solid var(--color-border);
  padding: 0.1em 0.4em;
  font-family: var(--font-mono);
  font-size: 0.9em;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-xl) 0;
}

/* Article footer: tags ("Tags from the story :") + share */
.post__footer {
  max-width: var(--container-narrow);
  margin-top: var(--space-xl);
  padding-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2xs) var(--space-xs);
  list-style: none;
  margin-bottom: var(--space-md);
}

.tag-list::before {
  content: "Tags from the story :";
  font-weight: 700;
  color: var(--color-heading);
  margin-right: var(--space-2xs);
}

.tag {
  display: inline-block;
  font-size: 12px;
  text-transform: uppercase;
  color: #666666;
  background: #eeeeee;
  line-height: 24px;
  padding: 3px 15px;
  border-radius: 2px;
}

.tag:hover { background: var(--color-heading); color: #ffffff; }

/* tags index page reuses .tag-list without the article label */
body[data-page="archive"] .tag-list::before,
body[data-page="static"] .tag-list::before { content: none; }

.tag-list--cloud { gap: var(--space-xs); }
.tag-list--cloud .tag { font-size: 13px; }
.tag__count { color: var(--color-text-soft); margin-left: 0.3em; }

.share {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.share__label {
  font-size: 14px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.share__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 0.7em;
  border: 1px solid var(--color-border);
  color: var(--color-accent);
  font-size: 13px;
}

.share__link:hover {
  border-color: var(--color-ink);
  color: var(--color-ink);
}

/* Author box ("Written by" / name / bio) */
.author-card {
  max-width: var(--container-narrow);
  margin-top: var(--space-xl);
  display: flex;
  gap: var(--space-md);
  align-items: flex-start;
  border: 1px solid var(--color-border);
  padding: var(--space-lg);
}

.author-card__avatar {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex: none;
}

.author-card__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--color-text-muted);
}

.author-card__name {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-2);
  margin: 0.15em 0;
}

.author-card__name a:hover { color: var(--color-accent); }

.author-card__bio {
  color: var(--color-text);
  font-size: var(--step--1);
}

/* Prev / next */
.post-nav {
  max-width: var(--container-narrow);
  margin-top: var(--space-lg);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.post-nav__link {
  display: flex;
  flex-direction: column;
  gap: var(--space-2xs);
  padding: var(--space-md);
  border: 1px solid var(--color-border);
}

.post-nav__link:hover { border-color: var(--color-heading); }
.post-nav__link--next { text-align: right; }

.post-nav__label {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 11px;
  color: var(--color-text-muted);
}

.post-nav__link--prev .post-nav__label::before { content: "\2039  "; }
.post-nav__link--next .post-nav__label::after { content: "  \203A"; }

.post-nav__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-1);
  color: var(--color-heading);
}

/* Related section */
.section--related {
  max-width: none;
  margin-top: var(--space-2xl);
  margin-bottom: 0;
}

.section--related .section__title { font-size: var(--step-4); }

/* Author profile page */
.author-profile {
  display: flex;
  gap: var(--space-lg);
  align-items: center;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-lg);
  margin-bottom: var(--space-2xl);
}

.author-profile__avatar {
  width: 110px;
  height: 110px;
  border-radius: var(--radius-full);
  object-fit: cover;
  flex: none;
}

.author-profile__eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 12px;
  color: var(--color-text-muted);
}

.author-profile__name {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-4);
  color: var(--color-heading);
}

.author-profile__role {
  font-style: italic;
  color: var(--color-text-soft);
  margin-top: var(--space-2xs);
}

.author-profile__bio {
  margin-top: var(--space-sm);
  color: var(--color-text);
  max-width: 60ch;
}

.author-profile__social { margin-top: var(--space-md); }

.author-profile__social .social-list { justify-content: flex-start; }

.author-profile__social .social-list__link { color: var(--color-text-muted); }
.author-profile__social .social-list__link:hover { color: var(--color-accent); }

/* Authors index */
.author-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-lg);
  list-style: none;
}

.author-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-2xs);
  padding: var(--space-lg);
  border: 1px solid var(--color-border);
}

.author-tile:hover { border-color: var(--color-heading); }

.author-tile__avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-full);
  object-fit: cover;
  margin-bottom: var(--space-xs);
}

.author-tile__name {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-1);
  color: var(--color-heading);
}

.author-tile__name:hover,
.author-tile__name a:hover { color: var(--color-accent); }

.author-tile__role { font-size: var(--step--1); color: var(--color-text-soft); font-style: italic; }
.author-tile__count { font-size: 12px; color: var(--color-text-muted); margin-top: var(--space-2xs); }

/* Search */
.search-form {
  display: flex;
  gap: var(--space-xs);
  max-width: var(--container-narrow);
  margin: 0 auto var(--space-xl);
}

.search-form__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search-form__input {
  flex: 1;
  min-width: 0;
  padding: 0.75em 1em;
  border: 1px solid var(--color-border-dash);
  background: var(--color-bg);
  color: var(--color-heading);
  font-family: var(--font-body);
  font-size: var(--step-0);
  border-radius: 1px;
}

.search-form__input:focus {
  outline: none;
  border-color: var(--color-heading);
}

.search-form__submit,
.contact-form__submit,
.newsletter-form__submit {
  border: 0;
  background: var(--color-ink);
  color: #ffffff;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border-radius: 1px;
  transition: background var(--transition);
}

.search-form__submit { padding: 0.75em 1.8em; }
.search-form__submit:hover,
.contact-form__submit:hover,
.newsletter-form__submit:hover { background: #333333; }

.search-results__status {
  text-align: center;
  font-style: italic;
  color: var(--color-text-soft);
  margin-bottom: var(--space-lg);
}

.search-results__status:empty { display: none; }

.search-results__noscript {
  color: var(--color-text);
  border: 1px solid var(--color-border);
  padding: var(--space-md);
}

.search-results__noscript a { color: var(--color-accent); text-decoration: underline; }

/* Static page prose */
.prose--page { max-width: var(--container-narrow); }

/* Contact form */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  max-width: var(--container-narrow);
  margin: var(--space-lg) 0;
}

.form-field { display: flex; flex-direction: column; gap: var(--space-2xs); }

.form-field__label {
  font-weight: 700;
  color: var(--color-heading);
  font-size: var(--step--1);
}

.form-field__input,
.form-field__textarea,
.newsletter-form__input {
  padding: 0.7em 0.9em;
  border: 1px solid var(--color-border-dash);
  background: var(--color-bg);
  color: var(--color-heading);
  font-family: var(--font-body);
  font-size: var(--step-0);
  border-radius: 1px;
}

.form-field__input:focus,
.form-field__textarea:focus,
.newsletter-form__input:focus {
  outline: none;
  border-color: var(--color-heading);
}

.contact-form__submit { align-self: flex-start; padding: 0.75em 2em; }

/* Newsletter form (sidebar) */
.newsletter-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.newsletter-form__label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.newsletter-form__input { text-align: center; }

.newsletter-form__submit { padding: 0.7em 1em; font-size: var(--step--1); }

/* Form status messages */
.form-status {
  padding: var(--space-xs) var(--space-sm);
  font-size: var(--step--1);
  border: 1px solid var(--color-border);
}

.form-status--ok { border-color: var(--color-heading); color: var(--color-heading); }
.form-status--error { border-color: #c0392b; color: #c0392b; }

/* 404 */
.error {
  text-align: center;
  padding: var(--space-3xl) 0;
}

.error__code {
  font-family: var(--font-display);
  font-size: clamp(4rem, 12vw, 8rem);
  line-height: 1;
  color: var(--color-heading);
}

.error__title {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-size: var(--step-4);
  margin-top: var(--space-sm);
}

.error__message {
  color: var(--color-text);
  margin: var(--space-sm) auto var(--space-lg);
  max-width: 46ch;
}

.error__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-sm);
}

.error__home,
.error__search {
  display: inline-block;
  padding: 0.7em 1.6em;
  font-family: var(--font-display);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: var(--step--1);
}

.error__home { background: var(--color-ink); color: #ffffff; }
.error__home:hover { background: #333333; }

.error__search { border: 1px solid var(--color-heading); color: var(--color-heading); }
.error__search:hover { background: var(--color-heading); color: #ffffff; }

/* ---------- 5. PAGE OVERRIDES ---------- */

/* Article page: narrow the layout gap under the sticky header */
body[data-page="article"] .layout { padding-top: var(--space-lg); }

/* On the article page the primary column need not be constrained to a
   grid; keep the sidebar to the right as elsewhere. */

/* Error page: drop the sidebar, single column */
body[data-page="error"] .layout { grid-template-columns: minmax(0, 1fr); }
body[data-page="error"] .layout__sidebar { display: none; }

/* Category / archive / author / search / static keep the sidebar. */

/* Monochrome: category data hooks intentionally do not recolour. */

/* ---------- 6. RESPONSIVE & STATES ---------- */

@media (max-width: 980px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-2xl);
  }

  .layout__sidebar {
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-lg);
  }

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

@media (max-width: 760px) {
  /* Header collapses: centred nav becomes a hamburger dropdown */
  .site-nav {
    position: static;
    transform: none;
    height: auto;
    margin-left: auto;
    margin-right: var(--space-sm);
  }

  .site-header__inner { min-height: 64px; }

  .site-nav.is-collapsible .nav-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5em;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.4);
    color: #ffffff;
    font-family: var(--font-nav);
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 0.5em 0.9em;
    cursor: pointer;
  }

  .site-nav.is-collapsible .nav-toggle__icon {
    width: 16px;
    height: 1px;
    background: #ffffff;
    box-shadow: 0 -5px 0 #ffffff, 0 5px 0 #ffffff;
  }

  .site-nav.is-collapsible .site-nav__list { display: none; }

  .site-nav.is-collapsible.is-open .site-nav__list {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 120;
    background: var(--color-ink);
    padding: var(--space-xs) 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
  }

  .site-nav.is-collapsible.is-open .site-nav__link {
    display: block;
    line-height: 2.6;
    padding: 0 var(--space-md);
    text-align: center;
  }

  .post-grid--related { grid-template-columns: minmax(0, 1fr); }
  .post-nav { grid-template-columns: minmax(0, 1fr); }
  .post-nav__link--next { text-align: left; }
  .author-grid,
  .category-grid { grid-template-columns: minmax(0, 1fr); }

  .author-profile { flex-direction: column; text-align: center; align-items: center; }
  .author-profile__social .social-list { justify-content: center; }

  .post-card__title,
  .post__title,
  .page-header__title { font-size: var(--step-4); }

  .search-form { flex-direction: column; }
}

/* Contract sync (category-showcase extension): rebbica keeps the optional
   per-category homepage showcase hidden (base.css default); the sidebar
   Categories widget already carries category navigation. */
