/* EMRGNG theme styles.
   theme.json supplies the brand palette as --wp--preset--color--*.
   This file adds the semantic tokens that flip between light and dark, plus the
   layouts core blocks can't express on their own (hero, Recent rail, cards). */

/* ------------------------------------------------------------------ tokens */

:root {
  --e-bg: #0a0a0a;
  --e-surface: #131317;
  --e-surface-2: #1a1a21;
  --e-border: rgba(255, 255, 255, 0.09);
  --e-border-strong: rgba(255, 255, 255, 0.16);
  --e-text: #e9e9ee;
  --e-text-dim: #a0a0ad;
  --e-muted: #85858f;
  --e-lavender: #8a84f0;
  --e-teal: #00e5b2;
  --e-deep-teal: #2faea3;
  --e-gold: #f0b64a;
  --e-on-accent: #0a0a0a;

  --e-maxw: 1240px;
  --e-gutter: 24px;
  --e-r-card: 12px;
  --e-r-ctl: 10px;

  --e-font-display: var(--wp--preset--font-family--display, Archivo, Helvetica, Arial, sans-serif);
  --e-font-body: var(--wp--preset--font-family--body, system-ui, sans-serif);
  --e-font-mono: var(--wp--preset--font-family--mono, ui-monospace, Menlo, monospace);
}

@media (prefers-color-scheme: light) {
  :root {
    --e-bg: #f5f5f7;
    --e-surface: #ffffff;
    --e-surface-2: #f0f0f4;
    --e-border: rgba(16, 16, 30, 0.11);
    --e-border-strong: rgba(16, 16, 30, 0.2);
    --e-text: #17171c;
    --e-text-dim: #45454f;
    --e-muted: #63636e;
    --e-lavender: #5b53d6;
    --e-teal: #04996f;
    --e-deep-teal: #1d8378;
    --e-gold: #9a6208;
    --e-on-accent: #ffffff;
  }
}

:root[data-theme="light"] {
  --e-bg: #f5f5f7;
  --e-surface: #ffffff;
  --e-surface-2: #f0f0f4;
  --e-border: rgba(16, 16, 30, 0.11);
  --e-border-strong: rgba(16, 16, 30, 0.2);
  --e-text: #17171c;
  --e-text-dim: #45454f;
  --e-muted: #63636e;
  --e-lavender: #5b53d6;
  --e-teal: #04996f;
  --e-deep-teal: #1d8378;
  --e-gold: #9a6208;
  --e-on-accent: #ffffff;
}

:root[data-theme="dark"] {
  --e-bg: #0a0a0a;
  --e-surface: #131317;
  --e-surface-2: #1a1a21;
  --e-border: rgba(255, 255, 255, 0.09);
  --e-border-strong: rgba(255, 255, 255, 0.16);
  --e-text: #e9e9ee;
  --e-text-dim: #a0a0ad;
  --e-muted: #85858f;
  --e-lavender: #8a84f0;
  --e-teal: #00e5b2;
  --e-deep-teal: #2faea3;
  --e-gold: #f0b64a;
  --e-on-accent: #0a0a0a;
}

/* ------------------------------------------------------------------- base */

body {
  background: var(--e-bg);
  color: var(--e-text);
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

img, svg, video, iframe { max-width: 100%; }
a:where(:not(.wp-element-button)):hover { color: var(--e-lavender); }

:focus-visible {
  outline: 2px solid var(--e-teal);
  outline-offset: 3px;
  border-radius: 4px;
}

.emrgng-shell {
  max-width: var(--e-maxw);
  margin-inline: auto;
  padding-inline: var(--e-gutter);
}

/* WordPress's flow layout sets `margin-block-start: 24px` on every child after the
   first. Wherever this theme takes over with its own grid or flex layout that margin
   fights `gap` and knocks items out of alignment, so clear it — but only inside those
   containers. Article bodies keep flow spacing, which is what it's for. */
.emrgng-header .emrgng-shell > *,
.emrgng-header-tools > *,
.emrgng-hero > *,
.emrgng-featured ul.wp-block-post-template > *,
.emrgng-featured .wp-block-post > *,
.emrgng-featured-text > *,
.emrgng-featured-meta > *,
.emrgng-recent > *,
.emrgng-recent .wp-block-post > *,
.emrgng-recent-row > *,
.emrgng-cards ul.wp-block-post-template > *,
.emrgng-cards .wp-block-post > *,
.emrgng-card-body > *,
.emrgng-article-head > *,
.emrgng-article-meta > *,
.emrgng-topics > *,
.emrgng-footer-grid > *,
.emrgng-footer-note > * {
  margin-block: 0;
}

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

.emrgng-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in srgb, var(--e-bg) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--e-border);
}

.emrgng-header .emrgng-shell {
  display: flex;
  align-items: center;
  gap: 28px;
  min-height: 68px;
}

.emrgng-header .wp-block-site-logo img { height: 30px; width: auto; }

.emrgng-nav { margin-inline: auto; }

.emrgng-nav .wp-block-navigation__container { gap: 26px; }

.emrgng-nav a {
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--e-text-dim);
  padding-block: 6px;
  border-bottom: 2px solid transparent;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.emrgng-nav a:hover { color: var(--e-text); border-bottom-color: var(--e-lavender); }
.emrgng-nav .current-menu-item a { color: var(--e-text); border-bottom-color: var(--e-lavender); }

.emrgng-header-tools {
  display: flex;
  align-items: center;
  gap: 6px;
  padding-left: 22px;
  border-left: 1px solid var(--e-border);
}

.emrgng-header-tools .wp-block-social-links { gap: 4px; }

.emrgng-header-tools .wp-social-link {
  background: none !important;
  color: var(--e-muted) !important;
  transition: color 0.15s ease;
}

.emrgng-header-tools .wp-social-link:hover { color: var(--e-text) !important; transform: none; }

.emrgng-iconbtn {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: none;
  color: var(--e-muted);
  cursor: pointer;
  padding: 0;
}

.emrgng-iconbtn:hover {
  color: var(--e-text);
  background: var(--e-surface-2);
  border-color: var(--e-border);
}

.emrgng-iconbtn svg { width: 17px; height: 17px; }

/* ------------------------------------------------------- shared type bits */

.emrgng-eyebrow {
  font-family: var(--e-font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--e-teal);
  margin: 0;
}

.emrgng-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.emrgng-section-head h2 { font-size: 1.6rem; margin: 0; }

.emrgng-more {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--e-lavender);
  transition: gap 0.15s ease;
}

.emrgng-more:hover { gap: 11px; color: var(--e-lavender); }
.emrgng-more svg { width: 14px; height: 14px; }

/* Category colour-coding. WordPress puts category-<slug> on every post wrapper,
   so the tag colour follows the post without any per-post markup. */
.wp-block-post .wp-block-post-terms a { color: var(--e-lavender); }
.wp-block-post.category-ai .wp-block-post-terms a { color: var(--e-lavender); }
.wp-block-post.category-robotics .wp-block-post-terms a { color: var(--e-gold); }
.wp-block-post.category-frontier-tech .wp-block-post-terms a { color: var(--e-deep-teal); }
.wp-block-post.category-web3 .wp-block-post-terms a { color: var(--e-teal); }
.wp-block-post-terms a:hover { text-decoration: none; opacity: 0.8; }

.wp-block-post-date { font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------------- the hero */

.emrgng-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 34px;
  align-items: stretch;
  padding-block: 36px 26px;
}

/* The featured story must fill the hero row so its image can stretch to match the
   Recent rail — otherwise it sits short and leaves a gap under the fold. */
.emrgng-featured,
.emrgng-featured ul.wp-block-post-template { height: 100%; }

.emrgng-featured ul.wp-block-post-template { margin: 0; padding: 0; }

.emrgng-featured .wp-block-post {
  display: grid;
  grid-template-columns: 1.16fr 1.4fr;
  gap: 34px;
  align-items: stretch;
  list-style: none;
  height: 100%;
}

/* Grid items default to min-width:auto, which stops them shrinking below their
   content and pushes the page into horizontal scroll on narrow screens. */
.emrgng-hero > *,
.emrgng-featured .wp-block-post > *,
.emrgng-featured-text > * {
  min-width: 0;
}

.emrgng-featured-text .wp-block-post-title,
.emrgng-cards .wp-block-post-title,
.emrgng-recent .wp-block-post-title { overflow-wrap: break-word; }

.emrgng-featured-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 14px;
  padding-top: 8px;
}

.emrgng-featured-text .wp-block-post-title {
  font-size: clamp(1.8rem, 2.7vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.028em;
  text-wrap: balance;
  margin: 0;
}

.emrgng-featured-text .wp-block-post-excerpt {
  color: var(--e-text-dim);
  font-size: 0.97rem;
  max-width: 42ch;
  margin: 0;
}

.emrgng-featured-text .wp-block-post-excerpt__more-link { display: none; }

.emrgng-featured-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 4px;
}

.emrgng-featured-image { display: flex; }

.emrgng-featured-image .wp-block-post-featured-image {
  flex: 1;
  margin: 0;
  width: 100%;
  min-height: 300px;
  border-radius: var(--e-r-card);
  overflow: hidden;
  border: 1px solid var(--e-border);
  background: var(--e-surface-2);
}

.emrgng-featured-image .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* --------------------------------------------------------- "Recent" rail */

/* The rail is absolutely placed inside its column so it can never inflate the hero
   row — otherwise a tall list pushes the featured story and image up, leaving dead
   space above the fold. min-height sets how many items are visible at rest. */
.emrgng-recent-col {
  position: relative;
  /* height:100% rather than relying on align-items:stretch — a grid item with a
     min-height doesn't reliably stretch to the row, but a percentage resolves
     against the grid area and does. min-height sets the row floor. */
  height: 100%;
  min-height: 470px;
}

.emrgng-recent {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--e-border);
  border-radius: var(--e-r-card);
  background: var(--e-surface);
}

.emrgng-recent-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--e-border);
  flex: none;
}

.emrgng-recent-head .emrgng-recent-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--e-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--e-text);
}

.emrgng-pulse {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--e-teal);
  animation: emrgng-pulse 2.4s ease-out infinite;
  flex: none;
}

@keyframes emrgng-pulse {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--e-teal) 55%, transparent); }
  70%  { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

.emrgng-recent-head .emrgng-more { font-size: 0.78rem; }
.emrgng-recent-head .emrgng-more svg { width: 12px; height: 12px; }

.emrgng-recent .wp-block-query { flex: 1; min-height: 0; display: flex; }

.emrgng-recent ul.wp-block-post-template {
  margin: 0;
  padding: 0;
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--e-border-strong) transparent;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent);
}

.emrgng-recent ul.wp-block-post-template::-webkit-scrollbar { width: 8px; }

.emrgng-recent ul.wp-block-post-template::-webkit-scrollbar-thumb {
  background: var(--e-border-strong);
  border-radius: 8px;
  border: 2px solid var(--e-surface);
}

.emrgng-recent .wp-block-post {
  list-style: none;
  padding: 12px 16px;
  transition: background 0.15s ease;
}

.emrgng-recent .wp-block-post + .wp-block-post { border-top: 1px solid var(--e-border); }
.emrgng-recent .wp-block-post:hover { background: var(--e-surface-2); }

.emrgng-recent-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 5px;
}

.emrgng-recent .wp-block-post-title {
  font-family: var(--e-font-body);
  font-size: 0.845rem;
  line-height: 1.4;
  font-weight: 500;
  color: var(--e-text);
  margin: 0;
}

.emrgng-recent-foot {
  flex: none;
  border-top: 1px solid var(--e-border);
  padding: 11px 16px;
  text-align: center;
  background: var(--e-surface-2);
}

.emrgng-recent-foot a {
  font-family: var(--e-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--e-lavender);
  font-weight: 600;
}

.emrgng-recent-foot a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ------------------------------------------------------------- ad slots */

.emrgng-ad {
  display: grid;
  place-items: center;
  min-height: 74px;
  margin-block: 0 40px;
  border: 1px dashed var(--e-border-strong);
  border-radius: var(--e-r-ctl);
  color: var(--e-muted);
  font-family: var(--e-font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* Ad Inserter drops real markup in here; hide the placeholder text once it does. */
.emrgng-ad:has(iframe, ins, .hypelab-container) { border: 0; text-transform: none; }
.emrgng-ad:has(iframe, ins, .hypelab-container) .emrgng-ad-label { display: none; }

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

.emrgng-section { padding-bottom: 52px; }

.emrgng-cards ul.wp-block-post-template {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
  margin: 0;
  padding: 0;
}

.emrgng-cards .wp-block-post {
  display: flex;
  flex-direction: column;
  list-style: none;
  border: 1px solid var(--e-border);
  border-radius: var(--e-r-card);
  background: var(--e-surface);
  overflow: hidden;
  transition: transform 0.18s ease, border-color 0.18s ease;
}

.emrgng-cards .wp-block-post:hover {
  transform: translateY(-3px);
  border-color: var(--e-border-strong);
}

.emrgng-cards .wp-block-post-featured-image {
  margin: 0;
  aspect-ratio: 16 / 10;
  background: var(--e-surface-2);
}

.emrgng-cards .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.emrgng-card-body {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 17px 18px;
  flex: 1;
}

.emrgng-cards .wp-block-post-title {
  font-size: 1.12rem;
  line-height: 1.28;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin: 0;
}

.emrgng-cards .wp-block-post:hover .wp-block-post-title a { color: var(--e-lavender); }

.emrgng-cards .wp-block-post-excerpt {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--e-text-dim);
}

.emrgng-cards .wp-block-post-excerpt__more-link { display: none; }
.emrgng-cards .wp-block-post-date { margin-top: auto; padding-top: 6px; }

/* Archive and search reuse the card grid but breathe a little more. */
.emrgng-archive-head { padding-block: 34px 24px; }
.emrgng-archive-head h1 { font-size: 2rem; margin: 0 0 8px; }
.emrgng-archive-head p { color: var(--e-text-dim); margin: 0; }

.wp-block-query-pagination {
  margin-top: 36px;
  display: flex;
  gap: 14px;
  justify-content: center;
  font-family: var(--e-font-mono);
  font-size: 0.8rem;
}

.wp-block-query-pagination a:hover { color: var(--e-lavender); }
.wp-block-query-pagination .current { color: var(--e-teal); }

/* ------------------------------------------------------------- topics */

.emrgng-topics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.emrgng-topic {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 20px;
  border: 1px solid var(--e-border);
  border-radius: var(--e-r-card);
  background: var(--e-surface);
  overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}

.emrgng-topic::after {
  content: "";
  position: absolute;
  inset: auto -30% -60% auto;
  width: 160px;
  height: 160px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--e-hue) 0%, transparent 68%);
  opacity: 0.16;
  pointer-events: none;
}

.emrgng-topic:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--e-hue) 45%, var(--e-border));
}

.emrgng-topic--ai       { --e-hue: var(--e-lavender); }
.emrgng-topic--robotics { --e-hue: var(--e-gold); }
.emrgng-topic--frontier { --e-hue: var(--e-deep-teal); }
.emrgng-topic--web3     { --e-hue: var(--e-teal); }

.emrgng-topic svg.emrgng-glyph { width: 26px; height: 26px; color: var(--e-hue); }

.emrgng-topic h3 {
  font-family: var(--e-font-display);
  font-size: 1.18rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  margin: 0;
  color: var(--e-text);
}

.emrgng-topic p {
  margin: 0;
  font-size: 0.845rem;
  line-height: 1.5;
  color: var(--e-text-dim);
}

.emrgng-topic .emrgng-arrow {
  margin-top: 6px;
  color: var(--e-hue);
  display: inline-flex;
  transition: transform 0.18s ease;
}

.emrgng-topic:hover .emrgng-arrow { transform: translateX(5px); }
.emrgng-topic .emrgng-arrow svg { width: 17px; height: 17px; }

/* --------------------------------------------------------- newsletter */

.emrgng-newsletter {
  padding: 38px 40px;
  border-radius: 16px;
  border: 1px solid color-mix(in srgb, var(--e-lavender) 30%, var(--e-border));
  background:
    radial-gradient(90% 130% at 88% 50%, color-mix(in srgb, var(--e-lavender) 26%, transparent) 0%, transparent 66%),
    var(--e-surface);
}

.emrgng-newsletter h2 {
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  letter-spacing: -0.025em;
  margin: 12px 0 0;
  text-wrap: balance;
}

.emrgng-newsletter p {
  margin: 12px 0 0;
  color: var(--e-text-dim);
  max-width: 46ch;
}

.emrgng-newsletter .emrgng-embed { margin-top: 22px; max-width: 430px; }
.emrgng-newsletter iframe { max-width: 100%; border: 0; }

.emrgng-fineprint {
  margin-top: 12px !important;
  font-family: var(--e-font-mono);
  font-size: 0.72rem;
  color: var(--e-muted) !important;
}

.emrgng-share {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 20px 26px;
  margin-top: 20px;
  border: 1px solid var(--e-border);
  border-radius: var(--e-r-card);
  background: var(--e-surface);
}

.emrgng-share .emrgng-glyph { color: var(--e-lavender); flex: none; width: 26px; height: 26px; }
.emrgng-share-copy { flex: 1; }

.emrgng-share-copy strong {
  display: block;
  font-family: var(--e-font-display);
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.emrgng-share-copy span { font-size: 0.845rem; color: var(--e-text-dim); }

.emrgng-btn-ghost {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 10px 18px;
  border-radius: var(--e-r-ctl);
  border: 1px solid var(--e-lavender);
  color: var(--e-lavender);
  font-size: 0.875rem;
  font-weight: 600;
  background: none;
  cursor: pointer;
  flex: none;
  transition: background 0.15s ease;
}

.emrgng-btn-ghost:hover { background: color-mix(in srgb, var(--e-lavender) 12%, transparent); }
.emrgng-btn-ghost svg { width: 14px; height: 14px; }

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

.emrgng-article { padding-block: 40px 20px; }

.emrgng-article-head {
  max-width: 760px;
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: flex-start;
}

.emrgng-article-head .wp-block-post-title {
  font-size: clamp(2rem, 3.4vw, 2.9rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  text-wrap: balance;
  margin: 0;
}

.emrgng-dek {
  font-size: 1.15rem;
  line-height: 1.5;
  color: var(--e-text-dim);
  margin: 0;
}

.emrgng-article-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--e-font-mono);
  font-size: 0.78rem;
  color: var(--e-muted);
}

.emrgng-article-hero {
  margin: 30px auto;
  max-width: 1240px;
}

.emrgng-article-hero .wp-block-post-featured-image {
  margin: 0;
  /* Uncropped, a 1200x750 upload renders ~775px tall at full width and buries the
     article. Cap the shape and let the image cover it. */
  aspect-ratio: 16 / 8;
  max-height: 520px;
  border-radius: var(--e-r-card);
  overflow: hidden;
  border: 1px solid var(--e-border);
}

.emrgng-article-hero .wp-block-post-featured-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.emrgng-article-body {
  max-width: 760px;
  margin-inline: auto;
  font-size: 1.06rem;
  line-height: 1.72;
}

.emrgng-article-body p { margin-block: 0 1.35em; }
.emrgng-article-body a { color: var(--e-lavender); text-decoration: underline; text-underline-offset: 3px; }

.emrgng-article-body h2,
.emrgng-article-body h3 { margin-block: 1.8em 0.6em; }

.emrgng-article-body blockquote {
  margin: 1.6em 0;
  padding-left: 20px;
  border-left: 3px solid var(--e-lavender);
  color: var(--e-text-dim);
}

.emrgng-article-tags {
  max-width: 760px;
  margin: 34px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--e-border);
}

.emrgng-article-tags .wp-block-post-terms a {
  display: inline-block;
  padding: 4px 11px;
  margin: 0 6px 6px 0;
  border: 1px solid var(--e-border-strong);
  border-radius: 999px;
  font-family: var(--e-font-mono);
  font-size: 0.72rem;
  color: var(--e-text-dim);
}

.emrgng-article-tags .wp-block-post-terms a:hover {
  color: var(--e-lavender);
  border-color: var(--e-lavender);
}

.emrgng-article-tags .wp-block-post-terms__separator { display: none; }

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

.emrgng-footer {
  border-top: 1px solid var(--e-border);
  margin-top: 34px;
  padding-block: 44px 30px;
}

.emrgng-footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1.5fr;
  gap: 36px;
}

.emrgng-footer .wp-block-site-logo img { height: 26px; width: auto; }

.emrgng-footer-brand p {
  margin: 14px 0 0;
  font-size: 0.845rem;
  line-height: 1.6;
  color: var(--e-muted);
  max-width: 30ch;
}

.emrgng-footer h2,
.emrgng-footer-col h4 {
  margin: 0 0 14px;
  font-family: var(--e-font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--e-muted);
  font-weight: 600;
}

.emrgng-footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.emrgng-footer-col a { font-size: 0.875rem; color: var(--e-text-dim); }

.emrgng-footer .wp-social-link {
  background: none !important;
  color: var(--e-muted) !important;
}

.emrgng-footer .wp-social-link:hover { color: var(--e-lavender) !important; transform: none; }

.emrgng-footer-note {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid var(--e-border);
  font-size: 0.78rem;
  color: var(--e-muted);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

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

.emrgng-notice {
  max-width: 620px;
  margin: 80px auto;
  text-align: center;
}

.emrgng-notice h1 { font-size: 2.4rem; margin: 0 0 12px; }
.emrgng-notice p { color: var(--e-text-dim); margin: 0 0 24px; }

.emrgng-notice .wp-block-search__input {
  background: var(--e-surface);
  border: 1px solid var(--e-border-strong);
  border-radius: var(--e-r-ctl);
  color: var(--e-text);
  padding: 11px 14px;
}

/* ---------------------------------------------------------- responsive */

@media (max-width: 1080px) {
  .emrgng-hero { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .emrgng-recent-col { position: static; height: auto; min-height: 0; }
  .emrgng-recent { position: static; }
  .emrgng-recent ul.wp-block-post-template { max-height: 320px; }
  .emrgng-featured-image .wp-block-post-featured-image { min-height: 260px; }
  .emrgng-topics { grid-template-columns: repeat(2, 1fr); }
  .emrgng-cards ul.wp-block-post-template { grid-template-columns: repeat(2, 1fr); }
  .emrgng-footer-grid { grid-template-columns: 1fr 1fr; }
}

/* The nav needs more room than the hero does, so it collapses first. */
@media (max-width: 900px) {
  .emrgng-nav { display: none; }
  .emrgng-header-tools { margin-left: auto; border-left: 0; padding-left: 0; }
  .emrgng-featured-text .wp-block-post-title { font-size: clamp(1.55rem, 3.4vw, 1.95rem); }
}

@media (max-width: 700px) {
  .emrgng-hero { padding-block: 26px 22px; gap: 22px; }
  .emrgng-featured .wp-block-post { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .emrgng-featured-text { padding-top: 0; }
  .emrgng-featured-text .wp-block-post-excerpt { max-width: none; }
  .emrgng-featured-image .wp-block-post-featured-image {
    min-height: 0;
    aspect-ratio: 16 / 10;
    flex: none;
  }
  .emrgng-cards ul.wp-block-post-template { grid-template-columns: 1fr; }
  .emrgng-newsletter { padding: 28px 24px; }
  .emrgng-share { flex-direction: column; align-items: flex-start; }
  .emrgng-article-body { font-size: 1rem; }
}

@media (max-width: 560px) {
  .emrgng-topics { grid-template-columns: 1fr; }
  .emrgng-footer-grid { grid-template-columns: 1fr; gap: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .emrgng-cards .wp-block-post:hover,
  .emrgng-topic:hover { transform: none; }
}
