.hhtm-magazine {
  /* Shared Heart House palette roles first; safe plugin fallbacks last. */
  --hhtm-primary: var(--hh-primary, var(--hh-color-primary, var(--heart-house-primary, #ef5b2a)));
  --hhtm-accent: var(--hh-accent, var(--hh-color-accent, var(--heart-house-accent, var(--hhtm-primary))));

  /* Contrast-safe content roles. Branding supplies the accent; the magazine owns readable foregrounds/surfaces. */
  --hhtm-ink: #151a1e;
  --hhtm-muted: #59656f;
  --hhtm-surface: #ffffff;
  --hhtm-soft: #f3f5f6;
  --hhtm-dark: #101519;
  --hhtm-on-accent: #ffffff;
  --hhtm-on-dark: #ffffff;
  --hhtm-border: rgba(17, 24, 39, .13);
  --hhtm-action: #9f3d20;
  --hhtm-action: color-mix(in srgb, var(--hhtm-accent) 64%, #101519 36%);
  --hhtm-action-hover: #7f3018;
  --hhtm-action-hover: color-mix(in srgb, var(--hhtm-accent) 54%, #101519 46%);
  --hhtm-radius: 16px;
  --hhtm-gap: clamp(14px, 1.45vw, 22px);
  --hhtm-columns: 4;
  width: 100%;
  margin-inline: auto;
  color: var(--hhtm-ink);
  container-type: inline-size;
}

.hhtm-width-contained { max-width: 1040px; }
.hhtm-width-wide { max-width: 1480px; }
.hhtm-width-full { max-width: none; }

/* Section heading: compact, editorial, unmistakably Heart House. */
.hhtm-section-head {
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(260px, 58ch);
  gap: clamp(18px, 3vw, 44px);
  align-items: end;
  justify-content: space-between;
  margin: 0 0 clamp(18px, 2.4vw, 30px);
  padding: clamp(13px, 1.4vw, 18px);
  border: 1px solid var(--hhtm-border);
  border-radius: 14px;
  background: var(--hhtm-surface);
  box-shadow: 0 6px 18px rgba(18,24,30,.055);
}
.hhtm-section-title {
  position: relative;
  color: var(--hhtm-ink) !important;
  margin: 0;
  padding-left: 16px;
  font-size: clamp(1.7rem, 2.8vw, 2.9rem);
  font-weight: 900;
  line-height: .98;
  letter-spacing: -.04em;
}
.hhtm-section-title::before {
  content: "";
  position: absolute;
  inset: .05em auto .05em 0;
  width: 6px;
  border-radius: 999px;
  background: var(--hhtm-accent);
}
.hhtm-section-intro {
  margin: 0;
  color: var(--hhtm-muted) !important;
  font-size: clamp(.9rem, 1.05vw, 1rem);
  line-height: 1.5;
}

/* Exact desktop column geometry. A leftover card never stretches into empty columns. */
.hhtm-items {
  display: grid;
  grid-template-columns: repeat(var(--hhtm-columns), minmax(0, 1fr));
  grid-auto-flow: row dense;
  gap: var(--hhtm-gap);
  align-items: stretch;
  justify-content: start;
}

/* Shared story card language: clean editorial base + Heart House energy. */
.hhtm-card {
  position: relative;
  color: var(--hhtm-ink) !important;
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--hhtm-border);
  border-radius: var(--hhtm-radius);
  background: var(--hhtm-surface);
  box-shadow: 0 8px 22px rgba(18, 24, 30, .07);
  isolation: isolate;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}
.hhtm-card::before {
  content: "";
  position: absolute;
  z-index: 5;
  inset: 0 auto auto 0;
  width: clamp(42px, 28%, 92px);
  height: 4px;
  background: var(--hhtm-accent);
  transition: width .22s ease;
}
.hhtm-card::after {
  content: "";
  position: absolute;
  z-index: 1;
  right: -22px;
  bottom: -28px;
  width: 62px;
  height: 62px;
  border: 8px solid color-mix(in srgb, var(--hhtm-accent) 18%, transparent);
  transform: rotate(18deg);
  pointer-events: none;
}
.hhtm-card:hover {
  transform: translateY(-4px);
  border-color: color-mix(in srgb, var(--hhtm-accent) 68%, var(--hhtm-border));
  box-shadow: 0 16px 34px rgba(18, 24, 30, .13);
}
.hhtm-card:hover::before { width: 100%; }

.hhtm-media-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--hhtm-dark);
}
.hhtm-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform .32s ease, filter .32s ease;
}
.hhtm-image-placeholder {
  background:
    radial-gradient(circle at 18% 20%, var(--hhtm-accent) 0 3px, transparent 4px),
    linear-gradient(135deg, #252c31, #0e1215);
  background-size: 28px 28px, auto;
}
.hhtm-image-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,.48), rgba(0,0,0,.03) 56%, transparent);
  pointer-events: none;
}
.hhtm-kicker {
  position: absolute;
  z-index: 3;
  left: 12px;
  bottom: 11px;
  display: inline-flex;
  max-width: calc(100% - 24px);
  padding: 6px 9px;
  border-radius: 4px;
  background: var(--hhtm-action);
  color: var(--hhtm-on-accent) !important;
  box-shadow: 0 3px 10px rgba(0,0,0,.2);
  font-size: .64rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .075em;
  text-transform: uppercase;
}
.hhtm-featured-flag {
  position: absolute;
  z-index: 4;
  top: 13px;
  right: 0;
  padding: 7px 12px 7px 10px;
  border-radius: 999px 0 0 999px;
  background: var(--hhtm-dark);
  color: var(--hhtm-on-dark);
  box-shadow: 0 5px 14px rgba(0,0,0,.2);
  font-size: .64rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .075em;
  text-transform: uppercase;
}

.hhtm-card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: clamp(14px, 1.45vw, 18px);
}
.hhtm-card-copy { min-width: 0; }
.hhtm-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 11px;
  margin: 0 0 8px;
  color: var(--hhtm-muted) !important;
  font-size: .68rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.hhtm-meta > * + *::before {
  content: "•";
  margin-right: 11px;
  color: var(--hhtm-accent);
}
.hhtm-card-title {
  margin: 0;
  color: var(--hhtm-ink) !important;
  font-size: clamp(1.05rem, 1.3vw, 1.42rem);
  font-weight: 850;
  line-height: 1.08;
  letter-spacing: -.025em;
}
.hhtm-columns-5 .hhtm-card-title { font-size: clamp(.98rem, 1.08vw, 1.25rem); }
.hhtm-magazine .hhtm-card-title a { color: var(--hhtm-ink) !important; text-decoration: none !important; }
.hhtm-excerpt,
.hhtm-answer {
  display: -webkit-box;
  overflow: hidden;
  margin: 9px 0 0;
  color: var(--hhtm-muted) !important;
  font-size: clamp(.82rem, .86vw, .91rem);
  line-height: 1.48;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.hhtm-answer strong { color: var(--hhtm-ink) !important; }
.hhtm-card-footer {
  display: flex;
  align-items: end;
  min-height: 42px;
  margin-top: auto;
  padding-top: 13px;
}
.hhtm-read-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid color-mix(in srgb, var(--hhtm-ink) 22%, transparent);
  border-radius: 8px;
  background: color-mix(in srgb, var(--hhtm-soft) 72%, transparent);
  color: var(--hhtm-ink) !important;
  font-size: .7rem;
  font-weight: 900;
  line-height: 1;
  letter-spacing: .05em;
  text-decoration: none;
  text-transform: uppercase;
  transition: background .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.hhtm-read-link::before {
  content: "";
  width: 4px;
  height: 13px;
  border-radius: 999px;
  background: var(--hhtm-accent);
}
.hhtm-read-arrow {
  display: inline-block;
  transition: transform .2s ease;
}
.hhtm-read-link:hover {
  border-color: var(--hhtm-action);
  background: var(--hhtm-action);
  color: var(--hhtm-on-accent) !important;
  transform: translateY(-1px);
}
.hhtm-read-link:hover::before { background: currentColor; }
.hhtm-read-link:hover .hhtm-read-arrow { transform: translateX(3px); }
.hhtm-card:hover .hhtm-image { transform: scale(1.045); }
.hhtm-card a:focus-visible,
.hhtm-cover:focus-visible,
.hhtm-read-link:focus-visible {
  outline: 3px solid var(--hhtm-accent);
  outline-offset: 4px;
}

/* Ringer-inspired dense editorial grids: restrained cards, strong hierarchy, predictable rhythm. */
.hhtm-layout-grid .hhtm-card,
.hhtm-layout-editorial .hhtm-card { box-shadow: 0 7px 20px rgba(18,24,30,.065); }
.hhtm-layout-grid .hhtm-media-link { aspect-ratio: 4 / 3; }
.hhtm-layout-editorial .hhtm-card:nth-child(4n+2):not(.is-featured) .hhtm-media-link,
.hhtm-layout-editorial .hhtm-card:nth-child(4n+3):not(.is-featured) .hhtm-media-link { aspect-ratio: 4 / 3; }

/* Featured is always explicit. Normal cards never grow because a row is incomplete. */
.hhtm-layout-editorial .hhtm-card.is-featured,
.hhtm-layout-feature .hhtm-card.is-featured,
.hhtm-layout-grid .hhtm-card.is-featured {
  grid-column: span 2;
  grid-row: span 2;
  border-color: var(--hhtm-accent);
  box-shadow: 0 17px 38px rgba(18,24,30,.15);
}
.hhtm-card.is-featured::before { width: 100%; height: 6px; }
.hhtm-card.is-featured .hhtm-card-body { padding: clamp(18px, 2vw, 25px); }
.hhtm-card.is-featured .hhtm-card-title {
  font-size: clamp(1.55rem, 2.25vw, 2.5rem);
  line-height: 1.01;
}
.hhtm-card.is-featured .hhtm-excerpt,
.hhtm-card.is-featured .hhtm-answer {
  max-width: 62ch;
  font-size: .98rem;
  -webkit-line-clamp: 4;
}
.hhtm-layout-feature .hhtm-card:not(.is-featured) .hhtm-excerpt,
.hhtm-layout-feature .hhtm-card:not(.is-featured) .hhtm-answer { display: none; }

/* Compact list. */
.hhtm-layout-list .hhtm-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.hhtm-layout-list .hhtm-card {
  display: grid;
  grid-template-columns: minmax(145px, 38%) 1fr;
  min-height: 180px;
}
.hhtm-layout-list .hhtm-media-link { aspect-ratio: auto; height: 100%; min-height: 180px; }
.hhtm-layout-list .hhtm-card-body { align-self: stretch; }
.hhtm-layout-list .hhtm-card.is-featured {
  grid-column: span 2;
  grid-template-columns: minmax(260px, 46%) 1fr;
  border-color: var(--hhtm-accent);
}
.hhtm-layout-list .hhtm-card.is-featured .hhtm-card-title { font-size: clamp(1.5rem, 2.35vw, 2.35rem); }

/* Existing Heart House CTA is intentionally allowed to span the section. */
.hhtm-inline-cta { grid-column: 1 / -1; min-width: 0; }

/* Sports Illustrated-inspired publication covers, translated into Heart House branding. */
.hhtm-layout-covers .hhtm-items {
  grid-template-columns: repeat(var(--hhtm-columns), minmax(0, 1fr));
  align-items: start;
}
.hhtm-cover-wrap { min-width: 0; perspective: 1200px; }
.hhtm-cover-wrap.is-featured { grid-column: span 2; }
.hhtm-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4.12;
  border: 1px solid rgba(0,0,0,.28);
  border-radius: 10px;
  background: var(--hhtm-dark);
  color: var(--hhtm-on-dark) !important;
  box-shadow: 0 14px 30px rgba(0,0,0,.21);
  text-decoration: none;
  transform-origin: center bottom;
  transition: transform .24s ease, box-shadow .24s ease;
}
.hhtm-cover::before {
  content: "";
  position: absolute;
  z-index: 4;
  top: 0;
  left: 0;
  width: 100%;
  height: 7px;
  background: var(--hhtm-accent);
}
.hhtm-cover::after {
  content: "";
  position: absolute;
  z-index: 2;
  top: -38px;
  right: -58px;
  width: 128px;
  height: 90px;
  background: var(--hhtm-accent);
  transform: rotate(34deg);
  opacity: .9;
}
.hhtm-cover .hhtm-image { position: absolute; inset: 0; width: 100%; height: 100%; }
.hhtm-cover-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(4,7,9,.26) 0%, rgba(4,7,9,.02) 34%, rgba(4,7,9,.6) 67%, rgba(4,7,9,.98) 100%);
}
.hhtm-cover-topline {
  position: absolute;
  z-index: 5;
  top: 13px;
  left: 13px;
  right: 13px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
  text-shadow: 0 2px 6px rgba(0,0,0,.55);
}
.hhtm-cover-brand { display: flex; max-width: 72%; flex-direction: column; gap: 0; }
.hhtm-cover-brand-main {
  font-size: clamp(1rem, 1.9vw, 1.8rem);
  font-weight: 950;
  line-height: .82;
  letter-spacing: -.04em;
}
.hhtm-cover-brand-sub {
  margin-top: 4px;
  font-size: clamp(.48rem, .7vw, .64rem);
  font-weight: 900;
  line-height: 1;
  letter-spacing: .22em;
}
.hhtm-cover-issue {
  max-width: 38%;
  font-size: .58rem;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: .03em;
  text-align: right;
  text-transform: uppercase;
}
.hhtm-cover-tagline {
  position: absolute;
  z-index: 5;
  top: 61px;
  left: 13px;
  padding: 5px 7px;
  border-left: 3px solid var(--hhtm-accent);
  background: rgba(8,12,15,.7);
  color: rgba(255,255,255,.94);
  font-size: .52rem;
  font-weight: 900;
  letter-spacing: .095em;
}
.hhtm-cover-featured {
  position: absolute;
  z-index: 6;
  top: 88px;
  left: 0;
  padding: 7px 11px;
  border-radius: 0 999px 999px 0;
  background: var(--hhtm-action);
  color: var(--hhtm-on-accent) !important;
  font-size: .62rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hhtm-cover-copy {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: clamp(14px, 1.75vw, 20px);
}
.hhtm-cover-kicker {
  align-self: flex-start;
  padding: 5px 8px;
  border-radius: 3px;
  background: var(--hhtm-action);
  color: var(--hhtm-on-accent) !important;
  font-size: .58rem;
  font-weight: 950;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hhtm-cover-title {
  font-size: clamp(1.3rem, 1.95vw, 2.2rem);
  font-weight: 950;
  line-height: .93;
  letter-spacing: -.045em;
  text-shadow: 0 2px 9px rgba(0,0,0,.65);
}
.hhtm-columns-5 .hhtm-cover-title { font-size: clamp(1.1rem, 1.55vw, 1.75rem); }
.hhtm-cover-wrap.is-featured .hhtm-cover-title { font-size: clamp(1.8rem, 3vw, 3.35rem); }
.hhtm-cover-hook {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255,255,255,.92);
  font-size: .78rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.hhtm-cover-action {
  align-self: flex-start;
  margin-top: 1px;
  padding-bottom: 3px;
  border-bottom: 3px solid var(--hhtm-accent);
  font-size: .68rem;
  font-weight: 950;
  letter-spacing: .075em;
  text-transform: uppercase;
}
/* Protect image-overlay copy from global theme link/heading colours (including !important link colours). */
.hhtm-magazine a.hhtm-cover,
.hhtm-magazine .hhtm-cover-brand-main,
.hhtm-magazine .hhtm-cover-brand-sub,
.hhtm-magazine .hhtm-cover-issue,
.hhtm-magazine .hhtm-cover-title,
.hhtm-magazine .hhtm-cover-hook,
.hhtm-magazine .hhtm-cover-action { color: var(--hhtm-on-dark) !important; }
.hhtm-magazine .hhtm-cover-tagline { color: #ffffff !important; }
.hhtm-magazine .hhtm-cover-kicker,
.hhtm-magazine .hhtm-cover-featured { color: var(--hhtm-on-accent) !important; }
.hhtm-cover:hover { transform: translateY(-6px) rotateX(1deg); box-shadow: 0 22px 42px rgba(0,0,0,.29); }
.hhtm-cover:hover .hhtm-image { transform: scale(1.045); }

/* Red Bull-inspired Masonry: image-led, energetic, intentionally varied rather than accidental stretching. */
.hhtm-layout-masonry .hhtm-items { grid-auto-flow: dense; align-items: stretch; }
.hhtm-layout-masonry .hhtm-card { min-height: 100%; }
.hhtm-layout-masonry .hhtm-card-body { flex: 1; }
.hhtm-layout-masonry .hhtm-masonry-standard .hhtm-media-link { aspect-ratio: 4 / 3; }
.hhtm-layout-masonry .hhtm-masonry-wide {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(230px, .82fr);
}
.hhtm-layout-masonry .hhtm-masonry-wide .hhtm-media-link { height: 100%; min-height: 260px; aspect-ratio: auto; }
.hhtm-layout-masonry .hhtm-masonry-wide .hhtm-card-title { font-size: clamp(1.4rem, 2vw, 2.05rem); }
.hhtm-layout-masonry .hhtm-masonry-wide .hhtm-card-body { padding: clamp(18px, 2vw, 26px); }
.hhtm-layout-masonry .hhtm-masonry-tall { grid-row: span 2; }
.hhtm-layout-masonry .hhtm-masonry-tall .hhtm-media-link { aspect-ratio: 4 / 5; }
.hhtm-layout-masonry .hhtm-masonry-tall .hhtm-card-body {
  background: linear-gradient(180deg, var(--hhtm-surface), color-mix(in srgb, var(--hhtm-soft) 82%, var(--hhtm-accent) 18%));
}
.hhtm-layout-masonry .hhtm-masonry-tall .hhtm-card-title { font-size: clamp(1.25rem, 1.75vw, 1.7rem); }
.hhtm-layout-masonry .hhtm-masonry-featured {
  grid-column: span 2;
  grid-row: span 2;
  border-color: var(--hhtm-accent);
  box-shadow: 0 18px 42px rgba(18,24,30,.17);
}
.hhtm-layout-masonry .hhtm-masonry-featured .hhtm-media-link { aspect-ratio: 16 / 9; }
.hhtm-layout-masonry .hhtm-masonry-featured .hhtm-card-title { font-size: clamp(1.75rem, 2.8vw, 2.9rem); }
.hhtm-layout-masonry .hhtm-masonry-featured .hhtm-card-body { padding: clamp(20px, 2.4vw, 29px); }
.hhtm-layout-masonry .hhtm-masonry-wide:nth-child(even) { grid-template-columns: minmax(230px, .82fr) minmax(0, 1.18fr); }
.hhtm-layout-masonry .hhtm-masonry-wide:nth-child(even) .hhtm-media-link { order: 2; }
.hhtm-layout-masonry .hhtm-masonry-wide:nth-child(even) .hhtm-card-body { order: 1; }
.hhtm-layout-masonry .hhtm-masonry-tall:nth-child(odd) .hhtm-kicker { border-radius: 999px 4px 4px 999px; }

/* Optional AEO quick-answer block on single posts. */
.hhtm-quick-answer {
  --hhtm-accent: var(--hh-accent, var(--hh-color-accent, var(--heart-house-accent, #ef5b2a)));
  margin: 0 0 1.5rem;
  padding: 18px 20px;
  border: 1px solid rgba(17,24,39,.10);
  border-left: 6px solid var(--hhtm-accent);
  border-radius: 0 13px 13px 0;
  background: #f3f5f6;
  color: #20262b !important;
  box-shadow: 0 7px 22px rgba(18,24,30,.06);
}
.hhtm-quick-answer > strong { display: block; margin-bottom: 5px; font-size: .78rem; text-transform: uppercase; letter-spacing: .065em; }
.hhtm-quick-answer p { margin: 0; line-height: 1.55; }

/* Last-resort theme collision guard: keep readable content colours inside Magazine-owned surfaces. */
.hhtm-magazine .hhtm-card .hhtm-meta,
.hhtm-magazine .hhtm-card .hhtm-excerpt,
.hhtm-magazine .hhtm-card .hhtm-answer { color: var(--hhtm-muted) !important; }
.hhtm-magazine .hhtm-card .hhtm-card-title,
.hhtm-magazine .hhtm-card .hhtm-card-title a,
.hhtm-magazine .hhtm-card .hhtm-answer strong { color: var(--hhtm-ink) !important; }
.hhtm-magazine .hhtm-card .hhtm-read-link { color: var(--hhtm-ink) !important; }
.hhtm-magazine .hhtm-card .hhtm-read-link:hover,
.hhtm-magazine .hhtm-card .hhtm-read-link:focus-visible { color: var(--hhtm-on-accent) !important; }

/* Multi-resolution responsiveness based on actual available component width. */
@container (max-width: 1280px) {
  .hhtm-columns-5 .hhtm-items,
  .hhtm-columns-5.hhtm-layout-covers .hhtm-items { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@container (max-width: 1080px) {
  .hhtm-columns-5 .hhtm-items,
  .hhtm-columns-4 .hhtm-items,
  .hhtm-columns-5.hhtm-layout-covers .hhtm-items,
  .hhtm-columns-4.hhtm-layout-covers .hhtm-items { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hhtm-layout-list .hhtm-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hhtm-layout-masonry .hhtm-masonry-wide { grid-template-columns: minmax(0, 1.08fr) minmax(205px, .92fr); }
}

@container (max-width: 820px) {
  .hhtm-columns-5 .hhtm-items,
  .hhtm-columns-4 .hhtm-items,
  .hhtm-columns-3 .hhtm-items,
  .hhtm-columns-5.hhtm-layout-covers .hhtm-items,
  .hhtm-columns-4.hhtm-layout-covers .hhtm-items,
  .hhtm-columns-3.hhtm-layout-covers .hhtm-items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hhtm-section-head { grid-template-columns: 1fr; gap: 8px; }
  .hhtm-section-intro { max-width: 64ch; }
  .hhtm-layout-editorial .hhtm-card.is-featured,
  .hhtm-layout-feature .hhtm-card.is-featured,
  .hhtm-layout-grid .hhtm-card.is-featured,
  .hhtm-layout-masonry .hhtm-masonry-featured,
  .hhtm-cover-wrap.is-featured { grid-column: span 2; grid-row: auto; }
  .hhtm-layout-masonry .hhtm-masonry-wide:not(.is-featured) {
    grid-column: span 1;
    display: flex;
  }
  .hhtm-layout-masonry .hhtm-masonry-wide:not(.is-featured) .hhtm-media-link { order: initial; min-height: 0; aspect-ratio: 4 / 3; }
  .hhtm-layout-masonry .hhtm-masonry-wide:not(.is-featured) .hhtm-card-body { order: initial; }
  .hhtm-layout-masonry .hhtm-masonry-tall:not(.is-featured) { grid-row: auto; }
  .hhtm-layout-masonry .hhtm-masonry-tall:not(.is-featured) .hhtm-media-link { aspect-ratio: 4 / 3; }
  .hhtm-layout-list .hhtm-items { grid-template-columns: 1fr; }
  .hhtm-layout-list .hhtm-card.is-featured { grid-column: auto; }
}

/* Phone landscape / narrow tablet: keep two cards only when the component has room. */
@container (max-width: 620px) {
  .hhtm-card-body { padding: 13px 14px 15px; }
  .hhtm-card-title { font-size: clamp(1rem, 3.2vw, 1.26rem); }
  .hhtm-excerpt,
  .hhtm-answer { font-size: .84rem; -webkit-line-clamp: 2; }
  .hhtm-layout-grid .hhtm-card:not(.is-featured) .hhtm-excerpt,
  .hhtm-layout-grid .hhtm-card:not(.is-featured) .hhtm-answer,
  .hhtm-layout-editorial .hhtm-card:not(.is-featured) .hhtm-excerpt,
  .hhtm-layout-editorial .hhtm-card:not(.is-featured) .hhtm-answer,
  .hhtm-layout-masonry .hhtm-card:not(.is-featured) .hhtm-excerpt,
  .hhtm-layout-masonry .hhtm-card:not(.is-featured) .hhtm-answer { display: none; }
  .hhtm-card-footer { min-height: 35px; padding-top: 10px; }
  .hhtm-read-link { padding: 7px 9px; font-size: .64rem; gap: 6px; }
  .hhtm-read-link::before { width: 3px; height: 11px; }
  .hhtm-layout-list .hhtm-card,
  .hhtm-layout-list .hhtm-card.is-featured { grid-template-columns: minmax(120px, 36%) 1fr; min-height: 150px; }
  .hhtm-layout-list .hhtm-media-link { min-height: 150px; }
  .hhtm-layout-list .hhtm-excerpt,
  .hhtm-layout-list .hhtm-answer { display: none; }

  .hhtm-layout-covers .hhtm-items {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(62%, 1fr);
    grid-template-columns: none !important;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scroll-snap-type: inline mandatory;
    scrollbar-width: thin;
    padding: 4px 8px 20px 2px;
  }
  .hhtm-cover-wrap,
  .hhtm-cover-wrap.is-featured { grid-column: auto; grid-row: auto; scroll-snap-align: start; }
}

/* Portrait phones: one readable card; no oversized variants. */
@container (max-width: 470px) {
  .hhtm-items { grid-template-columns: 1fr !important; }
  .hhtm-layout-editorial .hhtm-card.is-featured,
  .hhtm-layout-feature .hhtm-card.is-featured,
  .hhtm-layout-grid .hhtm-card.is-featured,
  .hhtm-layout-masonry .hhtm-masonry-featured,
  .hhtm-layout-masonry .hhtm-masonry-wide,
  .hhtm-layout-masonry .hhtm-masonry-tall { grid-column: auto; grid-row: auto; }
  .hhtm-layout-masonry .hhtm-masonry-featured,
  .hhtm-layout-masonry .hhtm-masonry-wide { display: flex; }
  .hhtm-layout-masonry .hhtm-masonry-wide .hhtm-media-link,
  .hhtm-layout-masonry .hhtm-masonry-tall .hhtm-media-link,
  .hhtm-layout-masonry .hhtm-masonry-featured .hhtm-media-link { order: initial; min-height: 0; aspect-ratio: 16 / 10; }
  .hhtm-layout-masonry .hhtm-masonry-wide .hhtm-card-body { order: initial; }
  .hhtm-card.is-featured .hhtm-card-title { font-size: clamp(1.45rem, 7.2vw, 2rem); }
  .hhtm-layout-list .hhtm-card,
  .hhtm-layout-list .hhtm-card.is-featured { grid-template-columns: 1fr; }
  .hhtm-layout-list .hhtm-media-link { min-height: 0; aspect-ratio: 16 / 9; }
  .hhtm-meta { font-size: .64rem; }
  .hhtm-kicker { left: 10px; bottom: 9px; }
  .hhtm-layout-covers .hhtm-items { grid-auto-columns: minmax(80%, 1fr) !important; }
  .hhtm-cover-copy { padding: 14px; }
  .hhtm-cover-brand-main { font-size: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  .hhtm-image,
  .hhtm-cover,
  .hhtm-card,
  .hhtm-card::before,
  .hhtm-read-link::before,
  .hhtm-read-arrow { transition: none; }
  .hhtm-card:hover,
  .hhtm-card:hover .hhtm-image,
  .hhtm-cover:hover,
  .hhtm-cover:hover .hhtm-image { transform: none; }
}

/* Gutenberg-only wrapper. */
.hhtm-editor-block { position: relative; min-height: 90px; }
.hhtm-editor-preview { padding: 10px 0; }
.hhtm-editor-preview .components-placeholder { min-height: 120px; }
