/*
 * HeyStory layout stabilization layer.
 * Loaded after main.css so these rules can correct shared component,
 * responsive, and WordPress-generated markup without changing theme APIs.
 */

html {
  scrollbar-gutter: stable;
}

body {
  font-size: var(--body-size, 16px);
}

.story-grid {
  grid-template-columns: repeat(var(--story-columns, 3), minmax(0, 1fr));
}

.entry-content {
  font-size: var(--article-size, 20px);
}

.entry-content > * {
  max-width: var(--article-width, 70ch);
}

body {
  min-width: 320px;
  overflow-x: clip;
  text-rendering: optimizeLegibility;
}

img,
svg,
video,
iframe {
  max-width: 100%;
}

h1,
h2,
h3,
p,
.widget,
.comment-content {
  overflow-wrap: break-word;
}

[id] {
  scroll-margin-top: 130px;
}

.button {
  min-height: 44px;
  text-align: center;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
  transform: none;
}

.reaction-button.is-active {
  border-color: var(--color-primary);
  background: var(--surface-soft);
  color: var(--color-primary);
}

.card,
.widget,
.article-column,
.footer-grid > *,
.section-heading > * {
  min-width: 0;
}

/* Header, branding, and desktop dropdown menus. */
body.admin-bar .site-header {
  top: 32px;
}

.header-main {
  gap: clamp(14px, 2vw, 26px);
}

.site-branding,
.custom-logo-link {
  display: inline-flex;
  min-width: 0;
  flex: none;
  align-items: center;
}

.custom-logo {
  display: block;
  width: auto;
  max-width: min(190px, 28vw);
  max-height: 48px;
  object-fit: contain;
}

.wordmark {
  min-width: 0;
  max-width: min(230px, 32vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.site-footer .wordmark {
  max-width: 100%;
}

.primary-nav {
  min-width: 0;
}

.primary-nav > ul {
  justify-content: center;
}

.primary-nav li {
  position: relative;
}

.primary-nav a {
  display: block;
  padding-block: 8px;
  line-height: 1.25;
}

.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a {
  color: var(--color-primary);
}

.primary-nav .sub-menu {
  position: absolute;
  z-index: 20;
  top: calc(100% + 10px);
  left: -18px;
  display: block;
  width: 220px;
  margin: 0;
  padding: 10px;
  visibility: hidden;
  list-style: none;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-hover);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

.primary-nav .sub-menu::before {
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: 11px;
  content: "";
}

.primary-nav .sub-menu a {
  padding: 10px 11px;
  border-radius: 9px;
  font-size: 13px;
}

.primary-nav .sub-menu a:hover {
  background: var(--surface-soft);
}

.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
}

.header-actions {
  flex: none;
}

.submit-story {
  white-space: nowrap;
}

.trending-inner,
.ticker {
  min-width: 0;
}

.trending-inner strong {
  flex: none;
}

.ticker {
  flex: 1;
}

.ticker a {
  max-width: 32ch;
  flex: none;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Hero, card grids, and section alignment. */
.hero-story {
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
}

.hero-media,
.hero-content {
  min-width: 0;
}

.hero-no-image {
  grid-template-columns: 1fr;
}

.hero-no-image .hero-content {
  width: 100%;
  max-width: 900px;
  padding-block: clamp(58px, 8vw, 100px);
}

.hero-no-image .hero-content h1 {
  max-width: 780px;
}

.hero-footer,
.card-footer,
.story-meta {
  min-width: 0;
}

.category-badge {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-chips {
  overscroll-behavior-inline: contain;
}

.section-heading {
  align-items: flex-end;
}

.story-grid {
  grid-template-columns: repeat(var(--story-columns, 3), minmax(0, 1fr));
}

.card-body {
  min-width: 0;
}

.card-no-image {
  background: linear-gradient(
    135deg,
    var(--surface-soft),
    color-mix(in srgb, var(--color-primary) 18%, var(--surface))
  );
}

.archive-hero + .content-section {
  padding-top: 38px;
}

.archive-hero h1 {
  max-width: 18ch;
}

.archive-description > :first-child {
  margin-top: 0;
}

.archive-description > :last-child {
  margin-bottom: 0;
}

.nav-links {
  flex-wrap: wrap;
}

.nav-links a,
.nav-links span {
  display: inline-grid;
  min-width: 42px;
  min-height: 42px;
  place-items: center;
  line-height: 1.2;
}

/* Newsletter and generated form markup. */
.newsletter > div {
  min-width: 0;
}

.newsletter form {
  width: min(100%, 430px);
  min-width: 340px;
  flex: none;
  align-items: stretch;
}

.newsletter label {
  min-width: 0;
  flex: 1;
}

.newsletter .button {
  flex: none;
  white-space: nowrap;
}

input,
select,
textarea {
  max-width: 100%;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.newsletter-compact form {
  width: 100%;
  min-width: 0;
  margin-top: 18px;
}

.newsletter-compact .button {
  width: 100%;
}

.newsletter-compact form label {
  display: block;
}

.sidebar .newsletter-compact {
  display: block;
  width: auto;
  margin: 0;
  padding: 24px;
}

.sidebar .newsletter-compact form {
  display: block;
}

.sidebar .newsletter-compact .button {
  margin-top: 2px;
}

/* Single-story grid and article content. */
.single-layout {
  grid-template-columns: 70px minmax(0, 760px) minmax(260px, 320px);
}

.floating-share {
  margin-top: 180px;
  padding-top: 0;
}

body.admin-bar .floating-share {
  top: 162px;
}

.breadcrumbs a {
  flex: none;
}

.breadcrumbs span:last-child {
  min-width: 0;
}

.author-row {
  flex-wrap: nowrap;
}

.author-row > div:not(.story-meta) {
  min-width: 0;
  flex: 1;
  margin-inline-end: auto;
}

.author-row > div:not(.story-meta) strong,
.author-row > div:not(.story-meta) a {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.author-row > .story-meta {
  flex: none;
  flex-direction: row;
  margin-right: 0;
}

.featured-image figcaption {
  line-height: 1.5;
}

.entry-content > :first-child {
  margin-top: 0;
}

.entry-content img,
.entry-content figure,
.entry-content iframe {
  max-width: 100%;
}

.entry-content pre,
.entry-content table {
  display: block;
  max-width: 100%;
  overflow-x: auto;
}

.entry-content pre {
  padding: 18px;
  border-radius: 12px;
  background: color-mix(in srgb, var(--text) 7%, var(--surface));
  font-size: 15px;
  line-height: 1.6;
}

.wp-block-embed,
.wp-block-image,
.wp-block-gallery {
  max-width: 100% !important;
}

.article-actions {
  flex-wrap: wrap;
}

.author-box > div {
  min-width: 0;
}

/* Comments, sidebar widgets, and ads. */
.page-content .comments-area {
  max-width: 760px;
  margin-right: auto;
  margin-left: auto;
}

.comment-list,
.comment-list .children {
  margin: 0;
  padding: 0;
  list-style: none;
}

.comment-list .children {
  margin-left: 28px;
}

.comment-author {
  display: flex;
  align-items: center;
  gap: 10px;
}

.comment-author img {
  flex: none;
  border-radius: 50%;
}

.comment-form-cookies-consent {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.comment-form-cookies-consent input {
  width: auto;
  margin-top: 6px;
}

.comment-form-cookies-consent label {
  margin: 0;
  font-weight: 400;
}

.comment-form .submit {
  width: auto;
  min-height: 44px;
  padding: 11px 18px;
  border: 1px solid var(--color-primary);
  border-radius: var(--radius-button);
  background: var(--color-primary);
  color: #fff;
  font-weight: 700;
}

.widget img,
.widget select,
.ad-slot img,
.ad-slot iframe {
  max-width: 100%;
}

.ad-slot {
  display: flex;
  width: 100%;
  max-width: 100%;
  min-height: var(--ad-min-height, 0);
  clear: both;
  flex-direction: column;
  justify-content: center;
  margin: clamp(24px, 4vw, 40px) auto;
  overflow: clip;
  contain: layout style;
}

.ad-label {
  flex: none;
  line-height: 1.4;
}

.ad-slot-content {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  text-align: center;
}

.ad-slot-content > *,
.ad-slot-content iframe,
.ad-slot-content img,
.ad-slot-content table,
.ad-slot-content [style*="width"] {
  max-width: 100% !important;
}

.ad-slot-content iframe {
  border: 0;
}

.ad-header,
.ad-footer {
  width: min(calc(100% - 48px), var(--container));
}

.article-content > .ad-slot {
  width: 100%;
  max-width: 70ch;
}

.article-content > .ad-before-content {
  margin-top: 0;
}

.article-content > .ad-after-content {
  margin-bottom: 0;
}

.sidebar > .ad-slot {
  width: 100%;
  margin: 0;
}

.popular-list li {
  grid-template-columns: 28px minmax(0, 1fr);
}

.popular-list li:last-child {
  border-bottom: 0;
}

/* Footer columns now adapt to the number of active widget areas. */
.footer-grid {
  grid-template-columns: minmax(240px, 1.35fr) repeat(auto-fit, minmax(160px, 1fr));
}

.footer-bottom ul {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.footer-bottom {
  align-items: flex-start;
}

.footer-navigation {
  max-width: min(100%, 820px);
}

.footer-navigation .menu {
  column-gap: 18px;
  row-gap: 9px;
  justify-content: flex-end;
}

.footer-navigation a {
  display: inline-flex;
  padding-block: 3px;
  line-height: 1.35;
}

/* Drawer, search dialog, and body-lock stability. */
.mobile-drawer,
.search-panel {
  z-index: 100000;
}

.drawer-panel,
.search-dialog {
  overscroll-behavior: contain;
}

.drawer-panel {
  overflow-y: auto;
  padding-bottom: max(22px, env(safe-area-inset-bottom));
}

.drawer-panel .wordmark {
  max-width: calc(100% - 60px);
}

.drawer-heading,
.search-heading {
  gap: 16px;
}

.search-dialog {
  max-height: min(80vh, 760px);
  max-height: min(80dvh, 760px);
  overflow-y: auto;
}

.search-heading h2,
.search-field input,
.search-result > span {
  min-width: 0;
}

.search-result {
  align-items: center;
}

.search-result img {
  flex: none;
}

.search-result a {
  overflow: hidden;
  text-overflow: ellipsis;
}

html.is-locked,
html.is-locked body {
  overflow: hidden;
}

.toast {
  z-index: 200000;
  bottom: max(28px, env(safe-area-inset-bottom));
  max-width: calc(100% - 32px);
  text-align: center;
}

@media (max-width: 1180px) {
  .single-layout {
    grid-template-columns: minmax(0, 760px) minmax(260px, 300px);
    gap: 30px;
  }

  .floating-share {
    display: none;
  }
}

@media (max-width: 1000px) {
  .header-main {
    gap: 8px;
  }

  .hero-story {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  }

  .single-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
    gap: 28px;
  }

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

  .newsletter {
    width: min(calc(100% - 36px), var(--container));
    padding: 36px;
  }

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

  .ad-header,
  .ad-footer {
    width: min(calc(100% - 36px), var(--container));
  }
}

@media (max-width: 820px) {
  .single-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .single-layout > .sidebar {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin-top: 26px;
  }

  .newsletter:not(.newsletter-compact) {
    display: block;
  }

  .newsletter:not(.newsletter-compact) form {
    width: 100%;
    min-width: 0;
    margin-top: 22px;
  }
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

@media (max-width: 700px) {
  .custom-logo {
    max-width: min(160px, 42vw);
    max-height: 42px;
  }

  .site-branding .wordmark {
    max-width: 42vw;
  }

  .ticker a {
    max-width: min(68vw, 36ch);
  }

  .ticker a:nth-child(n + 3) {
    display: none;
  }

  .hero-content,
  .hero-no-image .hero-content {
    padding: 28px 24px;
  }

  .hero-content h1 {
    font-size: clamp(32px, 10vw, 40px);
  }

  .hero-footer {
    flex-wrap: wrap;
  }

  .archive-hero + .content-section {
    padding-top: 26px;
  }

  .section-heading {
    align-items: center;
  }

  .section-heading > .text-link {
    flex: none;
    font-size: 13px;
  }

  .story-card {
    grid-template-columns: minmax(112px, 32%) minmax(0, 1fr);
  }

  .story-card:hover {
    transform: none;
  }

  .card-media,
  .card-no-image {
    min-height: 158px;
    aspect-ratio: auto;
  }

  .newsletter form {
    width: 100%;
    min-width: 0;
  }

  .newsletter .button {
    width: 100%;
  }

  .newsletter.newsletter-compact {
    width: auto;
    margin: 0;
  }

  .archive-hero h1 {
    max-width: 100%;
    font-size: clamp(36px, 11vw, 44px);
  }

  .single-layout > .sidebar {
    display: grid;
    grid-template-columns: 1fr;
    margin-top: 20px;
  }

  .article-header h1 {
    font-size: clamp(36px, 11vw, 44px);
  }

  .author-row {
    flex-wrap: wrap;
  }

  .author-row > .story-meta {
    width: 100%;
    order: 5;
  }

  .entry-content h2 {
    font-size: 29px;
  }

  .entry-content h3 {
    font-size: 24px;
  }

  .comment-list .children {
    margin-left: 14px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .footer-bottom ul {
    justify-content: flex-start;
  }

  .footer-navigation {
    width: 100%;
    margin-top: 14px;
  }

  .footer-navigation .menu {
    column-gap: 16px;
    row-gap: 8px;
  }

  .continue-reading {
    bottom: max(16px, env(safe-area-inset-bottom));
  }

  .continue-reading[hidden] {
    display: none;
  }

  .ad-header,
  .ad-footer {
    width: calc(100% - 32px);
  }

  .ad-slot {
    margin-block: 24px;
  }

  .search-dialog {
    max-height: calc(100dvh - 32px);
    margin-top: 16px;
    padding: 22px 18px;
  }
}

@media (max-width: 480px) {
  .story-card {
    display: flex;
  }

  .card-media,
  .card-no-image {
    height: auto;
    min-height: 0;
    aspect-ratio: 1.6;
  }

  .card-body {
    padding: 18px;
  }

  .card-title {
    font-size: 20px;
  }

  .card-excerpt {
    display: -webkit-box;
    margin-top: 4px;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .story-meta-compact > span:last-child {
    display: inline-flex;
  }

  .article-actions .button {
    width: 100%;
  }

  .author-box {
    display: block;
  }

  .author-box img {
    margin-bottom: 15px;
  }

  .comment-form {
    padding: 20px 16px;
  }
}

/*
 * v1.3 story-first editorial refresh.
 * These rules intentionally build on the stability layer above: no new assets,
 * no template assumptions, and all advertising placements retain their reserved
 * height through --ad-min-height.
 */
:root {
  --hs-paper: #f6f2ea;
  --hs-paper-deep: #e9e2d6;
  --hs-ink: #17211c;
  --hs-reading: var(--font);
  --hs-display: var(--font);
}

body {
  --bg: var(--hs-paper);
  --surface: #fffdf9;
  --surface-soft: #f2ece2;
  --text: var(--hs-ink);
  --muted: #667069;
  --faint: #899189;
  --border: #ded8ce;
  --shadow: 0 12px 32px rgba(23, 33, 28, 0.06);
  --shadow-hover: 0 20px 44px rgba(23, 33, 28, 0.13);
  background: var(--bg);
  color: var(--text);
  color-scheme: light;
}

body.dark-mode {
  --bg: #111712;
  --surface: #192019;
  --surface-soft: #222d23;
  --text: #f4f1e9;
  --muted: #b6bdb4;
  --faint: #8e988e;
  --border: #364037;
  --shadow: 0 14px 38px rgba(0, 0, 0, 0.25);
  --shadow-hover: 0 22px 54px rgba(0, 0, 0, 0.4);
  color-scheme: dark;
}

h1,
h2,
h3,
.wordmark,
.hero-content h1,
.article-header h1,
.archive-hero h1,
.section-heading h2,
.newsletter h2 {
  font-family: var(--hs-display);
}

/* A quiet masthead keeps the story, rather than the chrome, in charge. */
.site-header {
  background: color-mix(in srgb, var(--bg) 93%, transparent);
  border-bottom-color: color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--text) 3%, transparent);
}

.header-main {
  min-height: 72px;
}

.wordmark {
  font-size: clamp(22px, 2vw, 28px);
  font-weight: 700;
  letter-spacing: -1.4px;
}

.primary-nav > ul {
  gap: clamp(16px, 2.2vw, 30px);
}

.primary-nav a {
  letter-spacing: 0.01em;
}

.trending-bar {
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
  border-top: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
}

.trending-inner {
  height: 34px;
}

.trending-inner strong,
.eyebrow {
  letter-spacing: 0.16em;
}

/* Lead storytelling.  .story-lead is a ready hook for an expanded homepage lead. */
.home-hero {
  padding-top: clamp(26px, 4.5vw, 62px);
}

.hero-story,
.story-lead {
  grid-template-columns: minmax(0, 1.16fr) minmax(330px, 0.84fr);
  min-height: clamp(500px, 48vw, 650px);
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: calc(var(--radius-card) + 4px);
  background: var(--surface);
  box-shadow: 0 18px 44px rgba(23, 33, 28, 0.08);
}

.hero-media {
  position: relative;
}

.hero-media::after {
  position: absolute;
  inset: auto 0 0;
  height: 36%;
  content: "";
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.24));
  pointer-events: none;
}

.hero-content {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  justify-content: center;
  padding: clamp(34px, 5.4vw, 76px);
}

.hero-content h1 {
  max-width: 11ch;
  font-size: clamp(42px, 5.2vw, 76px);
  font-weight: 700;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-content p {
  max-width: 43ch;
  font-size: clamp(16px, 1.4vw, 18px);
  line-height: 1.7;
}

.hero-footer {
  margin-top: 8px;
  padding-top: 18px;
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

.hero-no-image,
.hero-no-image .hero-content {
  background: linear-gradient(135deg, var(--surface), var(--surface-soft));
}

.category-badge {
  border: 1px solid color-mix(in srgb, var(--color-primary) 28%, transparent);
  border-radius: 999px;
  background: color-mix(in srgb, var(--color-primary) 8%, var(--surface));
  letter-spacing: 0.1em;
}

.category-chips {
  gap: 8px;
  padding-top: 20px;
}

.category-chips a {
  padding: 8px 13px;
  border-color: color-mix(in srgb, var(--text) 12%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, var(--bg));
}

/* The feed uses strong imagery and type instead of a wall of floating boxes. */
.content-section {
  padding-top: clamp(56px, 7vw, 96px);
}

.section-heading {
  align-items: flex-end;
  margin-bottom: clamp(20px, 2.5vw, 32px);
  padding-bottom: 15px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 15%, transparent);
}

.section-heading h2 {
  font-size: clamp(30px, 3.2vw, 46px);
  font-weight: 700;
  letter-spacing: -0.045em;
}

.story-grid,
.story-feed {
  gap: clamp(22px, 2.6vw, 36px) clamp(18px, 2.4vw, 30px);
}

.story-card.card {
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.story-card:hover {
  border-color: transparent;
  box-shadow: none;
}

.card-media,
.card-no-image {
  border-radius: min(var(--radius-card), 18px);
  box-shadow: 0 10px 24px rgba(23, 33, 28, 0.08);
}

.card-media img {
  transition: transform 0.5s ease;
}

.card-no-image {
  background: linear-gradient(145deg, var(--surface-soft), color-mix(in srgb, var(--color-primary) 16%, var(--surface)));
}

.card-body {
  padding: 17px 2px 0;
}

.card-title {
  font-family: var(--hs-display);
  font-size: clamp(22px, 2vw, 27px);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.038em;
}

.card-excerpt {
  margin-bottom: 17px;
  color: var(--muted);
}

.card-footer {
  padding-top: 13px;
  border-top: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
}

@media (hover: hover) {
  .story-card:hover {
    transform: translateY(-3px);
  }

  .story-card:hover .card-media img {
    transform: scale(1.035);
  }
}

/* Editorial calls to action retain a distinct, human warmth. */
.newsletter {
  border: 0;
  border-radius: calc(var(--radius-card) + 4px);
  background: var(--hs-ink);
  color: #fff;
  box-shadow: 0 20px 46px rgba(23, 33, 28, 0.16);
}

.newsletter .eyebrow {
  color: color-mix(in srgb, var(--color-primary) 76%, #fff);
}

.newsletter p {
  color: color-mix(in srgb, #fff 74%, transparent);
}

.newsletter input {
  border-color: transparent;
  background: rgba(255, 255, 255, 0.96);
  color: #17211c;
}

.newsletter .button {
  box-shadow: none;
}

.archive-hero {
  max-width: min(calc(100% - 48px), var(--container));
  padding-top: clamp(58px, 9vw, 118px);
  padding-bottom: 26px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
}

.archive-hero h1 {
  max-width: 13ch;
  font-size: clamp(44px, 6vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.archive-hero p,
.archive-description {
  font-size: 17px;
  line-height: 1.7;
}

/* Long-form pages get a calmer reading measure and stronger hierarchy. */
.single-story {
  padding-top: clamp(32px, 5vw, 68px);
}

.single-layout {
  grid-template-columns: 58px minmax(0, 760px) minmax(260px, 310px);
  gap: clamp(26px, 3vw, 42px);
}

.floating-share {
  color: var(--faint);
}

.article-header {
  padding-bottom: 30px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 14%, transparent);
}

.article-header h1 {
  max-width: 13ch;
  font-size: clamp(48px, 6vw, 82px);
  font-weight: 700;
  line-height: 0.97;
  letter-spacing: -0.06em;
}

.article-deck {
  max-width: 52ch;
  font-size: clamp(18px, 1.8vw, 22px);
  line-height: 1.55;
}

.author-row {
  padding-top: 3px;
}

.featured-image {
  margin-top: 34px;
}

.featured-image img {
  border-radius: min(var(--radius-card), 20px);
  box-shadow: 0 18px 42px rgba(23, 33, 28, 0.12);
}

.entry-content {
  font-family: var(--hs-reading);
  font-size: clamp(19px, 1.55vw, 22px);
  line-height: 1.84;
}

.entry-content h2,
.entry-content h3 {
  font-family: var(--hs-display);
  letter-spacing: -0.035em;
}

.entry-content h2 {
  font-size: clamp(31px, 3.2vw, 42px);
  line-height: 1.08;
}

.entry-content h3 {
  font-size: clamp(25px, 2.5vw, 32px);
}

.entry-content blockquote {
  border-left-width: 3px;
  border-radius: 0 14px 14px 0;
  background: color-mix(in srgb, var(--color-primary) 7%, var(--surface));
  font-family: var(--hs-display);
  font-size: clamp(23px, 2.4vw, 30px);
  line-height: 1.3;
}

.article-actions {
  padding-block: 26px;
  border-block: 1px solid color-mix(in srgb, var(--text) 13%, transparent);
}

.author-box,
.sidebar .widget,
.comment-body,
.comment-form {
  border-color: color-mix(in srgb, var(--text) 11%, transparent);
  border-radius: min(var(--radius-card), 18px);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(23, 33, 28, 0.045);
}

.sidebar {
  gap: 26px;
}

.widget-title {
  font-family: var(--hs-display);
  font-size: 24px;
  letter-spacing: -0.03em;
}

/* AdsKeeper placements stay measurable, centered, and separate from stories. */
.ad-slot {
  position: relative;
  min-height: var(--ad-min-height, 0);
  padding: 14px 0;
  border-block: 1px solid color-mix(in srgb, var(--text) 9%, transparent);
  background: color-mix(in srgb, var(--surface) 72%, var(--bg));
}

.ad-label {
  margin-bottom: 9px;
  color: var(--faint);
  font-size: 10px;
  letter-spacing: 0.18em;
}

.ad-slot-content > * {
  margin-inline: auto;
}

.ad-after-title {
  width: min(100%, var(--article-width, 70ch));
  margin: 26px auto 34px;
}

.ad-home-feed {
  grid-column: 1 / -1;
  margin-block: 8px;
}

.article-content > .ad-before-content,
.article-content > .ad-in-content,
.article-content > .ad-after-content {
  width: 100%;
  max-width: 70ch;
  margin-inline: auto;
}

.article-content > .ad-before-content {
  margin-top: 6px;
  margin-bottom: clamp(30px, 5vw, 48px);
}

.article-content > .ad-in-content {
  margin-block: clamp(32px, 5vw, 52px);
}

.article-content > .ad-after-content {
  margin-top: clamp(34px, 5vw, 56px);
  margin-bottom: 0;
}

/* Optional v1.3 hooks for future template additions. */
.story-rail > * + * {
  margin-top: 26px;
}

.story-feed > .ad-home-feed {
  grid-column: 1 / -1;
}

.site-footer {
  margin-top: clamp(72px, 10vw, 130px);
  border-top: 4px solid var(--color-primary);
  background: #17211c;
}

.site-footer .wordmark,
.site-footer .widget-title {
  font-family: var(--hs-display);
}

@media (max-width: 1000px) {
  .hero-story,
  .story-lead {
    grid-template-columns: minmax(0, 1.05fr) minmax(300px, 0.95fr);
  }

  .single-layout {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 280px);
  }

  .ad-after-title {
    width: min(100%, 760px);
  }
}

@media (max-width: 820px) {
  .hero-story,
  .story-lead {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-media {
    min-height: 0;
    aspect-ratio: 1.65;
  }

  .hero-content h1,
  .article-header h1 {
    max-width: 15ch;
  }

  .single-layout > .sidebar {
    gap: 18px;
  }
}

@media (max-width: 700px) {
  .header-main {
    min-height: 64px;
  }

  .home-hero {
    padding-top: 20px;
  }

  .hero-story,
  .story-lead,
  .newsletter {
    border-radius: min(var(--radius-card), 18px);
  }

  .hero-content {
    padding: 30px 24px 32px;
  }

  .hero-content h1 {
    font-size: clamp(38px, 11vw, 52px);
  }

  .section-heading {
    align-items: center;
  }

  .section-heading h2 {
    font-size: 32px;
  }

  .story-card.card {
    overflow: hidden;
    border: 1px solid color-mix(in srgb, var(--text) 9%, transparent);
    border-radius: min(var(--radius-card), 16px);
    background: var(--surface);
  }

  .card-media,
  .card-no-image {
    border-radius: 0;
    box-shadow: none;
  }

  .card-body {
    padding: 16px;
  }

  .card-title {
    font-size: 21px;
  }

  .card-footer {
    padding-top: 10px;
  }

  .archive-hero {
    width: calc(100% - 32px);
    padding-top: 48px;
  }

  .archive-hero h1,
  .article-header h1 {
    font-size: clamp(40px, 12vw, 56px);
  }

  .article-header {
    padding-bottom: 24px;
  }

  .entry-content {
    font-size: 19px;
  }

  .entry-content blockquote {
    padding: 18px 20px;
  }

  .ad-slot {
    padding: 12px 0;
  }

  .ad-after-title {
    width: calc(100% - 32px);
    margin-block: 20px 30px;
  }

  .article-content > .ad-before-content,
  .article-content > .ad-in-content,
  .article-content > .ad-after-content {
    margin-inline: 0;
  }

  .article-content > .ad-in-content {
    margin-block: 30px;
  }
}

@media (max-width: 480px) {
  .story-card.card {
    display: flex;
  }

  .card-body {
    padding: 17px;
  }

  .card-excerpt {
    display: -webkit-box;
  }

  .article-actions .button {
    width: 100%;
  }
}

/* v1.3.1: centered, compact homepage hero card. */
.home-hero {
  width: min(calc(100% - 48px), 980px);
  max-width: 980px;
  padding-top: clamp(22px, 3vw, 36px);
}

.home-hero .hero-story,
.home-hero .story-lead {
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  min-height: clamp(330px, 34vw, 400px);
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(23, 33, 28, 0.09);
}

.home-hero .hero-media {
  min-height: 0;
}

.home-hero .hero-content {
  padding: clamp(28px, 4vw, 46px);
}

.home-hero .hero-content h1 {
  max-width: 14ch;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
}

.home-hero .hero-content p {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.62;
}

.home-hero .hero-footer {
  padding-top: 14px;
}

.category-chips.container,
.home-feed-section.container,
.popular-section.container,
.home-hero ~ .newsletter {
  width: min(calc(100% - 48px), 980px);
}

.home-feed-section,
.popular-section {
  padding-top: clamp(42px, 5vw, 58px);
}

.home-feed-section .section-heading h2,
.popular-section .section-heading h2 {
  font-size: clamp(27px, 2.7vw, 35px);
}

.home-feed-layout {
  gap: clamp(24px, 3vw, 38px);
}

.home-feed-layout .story-feed {
  gap: 24px 20px;
}

.home-feed-section .card-title,
.popular-section .card-title {
  font-size: clamp(20px, 2vw, 24px);
}

.home-feed-section .card-excerpt,
.popular-section .card-excerpt {
  margin-bottom: 14px;
  font-size: 13px;
}

.home-rail__module {
  padding: 19px;
}

.home-rail__module h2 {
  font-size: 22px;
}

@media (max-width: 820px) {
  .home-hero,
  .category-chips.container,
  .home-feed-section.container,
  .popular-section.container,
  .home-hero ~ .newsletter {
    width: calc(100% - 36px);
  }
}

@media (max-width: 700px) {
  .home-hero,
  .category-chips.container,
  .home-feed-section.container,
  .popular-section.container,
  .home-hero ~ .newsletter {
    width: calc(100% - 32px);
  }

  .home-hero .hero-story,
  .home-hero .story-lead {
    border-radius: 18px;
  }

  .home-hero .hero-media {
    aspect-ratio: 16 / 10;
  }

  .home-hero .hero-content {
    padding: 25px 22px 27px;
  }

  .home-hero .hero-content h1 {
    font-size: clamp(31px, 9vw, 40px);
  }

  .home-feed-section,
  .popular-section {
    padding-top: 40px;
  }
}

/* Compact publishing modules introduced by the story-first v1.3 templates. */
.header-ad-wrap {
  min-height: 0;
}

.header-ad-wrap .ad-header {
  width: min(calc(100% - 48px), var(--container));
  margin-block: 14px 2px;
}

/* Keep the lead memorable without turning the first screen into one giant card. */
.home-hero {
  padding-top: clamp(22px, 3vw, 42px);
}

.hero-story,
.story-lead {
  grid-template-columns: minmax(0, 1.05fr) minmax(310px, 0.95fr);
  min-height: clamp(390px, 37vw, 470px);
}

.hero-media {
  min-height: 0;
}

.hero-content {
  padding: clamp(30px, 4vw, 54px);
}

.hero-content h1 {
  max-width: 13ch;
  font-size: clamp(38px, 4.3vw, 62px);
}

.hero-content p {
  margin-bottom: 18px;
}

.content-section {
  padding-top: clamp(46px, 5vw, 68px);
}

.section-heading h2 {
  font-size: clamp(28px, 2.8vw, 39px);
}

.home-feed-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 284px);
  align-items: start;
  gap: clamp(28px, 4vw, 52px);
}

.home-feed-layout .story-feed {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.home-rail {
  position: sticky;
  top: 118px;
}

.home-rail__module,
.sidebar-panel {
  padding: 22px;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  border-radius: min(var(--radius-card), 16px);
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(23, 33, 28, 0.045);
}

.home-rail__module h2,
.sidebar-panel h2 {
  margin: 0 0 17px;
  font-family: var(--hs-display);
  font-size: 25px;
  line-height: 1.06;
  letter-spacing: -0.035em;
}

.editorial-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: editorial-list;
}

.editorial-list li {
  position: relative;
  min-height: 50px;
  padding-block: 0 15px;
  padding-inline-start: 37px;
  border-bottom: 1px solid color-mix(in srgb, var(--text) 9%, transparent);
  counter-increment: editorial-list;
}

.editorial-list li + li {
  padding-block-start: 15px;
}

.editorial-list li::before {
  position: absolute;
  top: 0;
  inset-inline-start: 0;
  color: var(--color-primary);
  content: counter(editorial-list, decimal-leading-zero);
  font-family: var(--hs-display);
  font-size: 21px;
  font-weight: 700;
}

.editorial-list li:last-child {
  padding-block-end: 0;
  border-bottom: 0;
}

.editorial-list a {
  display: block;
  font-family: var(--hs-display);
  font-size: 17px;
  font-weight: 700;
  line-height: 1.14;
}

.editorial-list a:hover {
  color: var(--color-primary);
}

.editorial-list span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.card-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.card-kicker .category-badge {
  margin-bottom: 0;
}

.card-kicker time {
  flex: none;
  color: var(--faint);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.single-layout {
  grid-template-columns: minmax(0, 720px) minmax(250px, 290px);
  gap: clamp(22px, 2.6vw, 36px);
}

.single-layout.has-share-rail {
  grid-template-columns: 48px minmax(0, 720px) minmax(250px, 290px);
}

.article-header h1 {
  max-width: 14ch;
  font-size: clamp(40px, 4.7vw, 64px);
}

.article-byline__identity {
  min-width: 0;
}

.article-byline .story-meta {
  margin-inline-start: 4px;
}

.featured-image {
  margin-top: 26px;
  margin-bottom: 32px;
}

.sidebar-panel + .newsletter,
.sidebar-panel + .widget {
  margin-top: 26px;
}

.footer-grid--editorial {
  grid-template-columns: minmax(0, 1.3fr) minmax(180px, 0.8fr) repeat(auto-fit, minmax(170px, 0.7fr));
}

.footer-reading-note .eyebrow {
  color: color-mix(in srgb, var(--color-primary) 76%, #fff);
}

.footer-reading-note p {
  max-width: 25ch;
  margin: 0;
}

@media (max-width: 1180px) {
  .single-layout.has-share-rail {
    grid-template-columns: minmax(0, 720px) minmax(250px, 290px);
  }
}

@media (max-width: 1000px) {
  .home-feed-layout {
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 28px;
  }

  .home-feed-layout .story-feed {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .single-layout {
    grid-template-columns: minmax(0, 1fr) minmax(230px, 260px);
  }
}

@media (max-width: 820px) {
  .home-feed-layout {
    grid-template-columns: 1fr;
  }

  .home-rail {
    position: static;
  }

  .home-rail__module {
    max-width: 640px;
  }

  .hero-story,
  .story-lead {
    min-height: 0;
  }

  .single-layout,
  .single-layout.has-share-rail {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .header-ad-wrap .ad-header {
    width: calc(100% - 32px);
    margin-top: 8px;
  }

  .home-feed-layout .story-feed {
    grid-template-columns: 1fr;
  }

  .home-rail__module,
  .sidebar-panel {
    padding: 19px;
  }

  .article-byline .story-meta {
    margin-inline-start: 0;
  }

  .footer-grid--editorial {
    grid-template-columns: 1fr;
  }
}

/* Final homepage scale: a centered, rounded hero card rather than a full-width feature. */
.home-hero {
  width: min(calc(100% - 48px), 980px);
  max-width: 980px;
  padding-top: clamp(22px, 3vw, 36px);
}

.home-hero .hero-story,
.home-hero .story-lead {
  grid-template-columns: minmax(0, 0.94fr) minmax(0, 1.06fr);
  min-height: clamp(330px, 34vw, 400px);
  border-radius: 22px;
  box-shadow: 0 14px 32px rgba(23, 33, 28, 0.09);
}

.home-hero .hero-content {
  padding: clamp(28px, 4vw, 46px);
}

.home-hero .hero-content h1 {
  max-width: 14ch;
  font-size: clamp(34px, 4vw, 52px);
  line-height: 1;
}

.home-hero .hero-content p {
  margin-bottom: 16px;
  font-size: 16px;
  line-height: 1.62;
}

.home-hero .hero-footer {
  padding-top: 14px;
}

.home-feed-section,
.popular-section {
  padding-top: clamp(42px, 5vw, 58px);
}

.home-feed-layout {
  gap: clamp(24px, 3vw, 38px);
}

.home-rail__module {
  padding: 19px;
}

.home-rail__module h2 {
  font-size: 22px;
}

@media (max-width: 820px) {
  .home-hero,
  .category-chips.container,
  .home-feed-section.container,
  .popular-section.container,
  .home-hero ~ .newsletter {
    width: calc(100% - 36px);
  }

  .home-feed-layout {
    gap: 26px;
  }
}

@media (max-width: 700px) {
  .home-hero,
  .category-chips.container,
  .home-feed-section.container,
  .popular-section.container,
  .home-hero ~ .newsletter {
    width: calc(100% - 32px);
  }

  .home-hero .hero-story,
  .home-hero .story-lead {
    border-radius: 18px;
  }

  .home-hero .hero-media {
    aspect-ratio: 16 / 10;
  }

  .home-hero .hero-content {
    padding: 25px 22px 27px;
  }

  .home-hero .hero-content h1 {
    font-size: clamp(31px, 9vw, 40px);
  }

  .home-feed-section,
  .popular-section {
    padding-top: 40px;
  }
}

/* UI Polish & Micro-Interactions */
.story-card, .magazine-lead__story, .magazine-support {
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.28s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.28s ease;
}

.floating-share {
  background: color-mix(in srgb, var(--surface) 85%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 999px;
  padding: 12px 6px;
  box-shadow: var(--shadow);
}

.category-chips a {
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}
.category-chips a:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--color-primary) 18%, transparent);
}

.search-loading {
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

body.dark-mode .floating-share {
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}
