/*
Theme Name: TripRank
Theme URI: https://triprank.am1rft.com
Author: Amir
Description: Custom theme for the TripRank journal. Dark instrument-cluster aesthetic — blue-black cabin, cool steel, ice-blue accent. Built for the TripRank brand: calm, premium, automotive-editorial.
Version: 3.6.1
Requires at least: 6.0
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: triprank
*/

:root {
  /* Matched to the iOS app's design tokens (trBg / trSurface / trT1-T3) */
  --bg: #060504;
  --bg-panel: rgba(255, 255, 255, 0.04);
  --bg-panel-raised: rgba(255, 255, 255, 0.07);
  --hairline: rgba(255, 255, 255, 0.10);
  --steel: rgba(245, 242, 236, 0.48);
  --steel-light: rgba(245, 242, 236, 0.64);
  --white: #F5F2EC;
  /* Accent: overridden by the Customizer pick (TripRank Media -> Accent Color).
     Defaults to the app's red. */
  --ice: #FF4F4F;
  --ice-dark: #CC2424;
  --ice-dim: rgba(255, 79, 79, 0.16);
  --redline: #E8921A;

  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-body: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;

  --container: 1120px;
  --prose: 720px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--white);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 0.5em;
  color: var(--white);
}

h1 { font-size: clamp(2rem, 3.5vw + 1rem, 3.25rem); }
h2 { font-size: clamp(1.4rem, 2vw + 0.8rem, 2rem); }
h3 { font-size: 1.2rem; }

p { color: var(--steel-light); margin: 0 0 1em; }
a { color: inherit; text-decoration: none; }

a:focus-visible, button:focus-visible {
  outline: 2px solid var(--ice);
  outline-offset: 2px;
}

::selection { background: var(--ice-dim); color: var(--white); }

.mono {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ice);
  margin-bottom: 0.6em;
}

.wrap {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.tick-rule {
  width: 100%;
  height: 20px;
  background-image: repeating-linear-gradient(
    to right,
    var(--hairline) 0px,
    var(--hairline) 1px,
    transparent 1px,
    transparent 12px
  );
  background-position: bottom;
  background-size: 100% 1px;
  background-repeat: repeat-x;
  position: relative;
  opacity: 0.9;
}
.tick-rule::before {
  content: '';
  position: absolute;
  bottom: 0; left: 0;
  width: 100%; height: 1px;
  background: var(--hairline);
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 3px;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  border: 1px solid var(--hairline);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}
.btn-primary { background: var(--white); color: var(--bg); border-color: var(--white); }
.btn-primary:hover { background: var(--ice); border-color: var(--ice-dark); }
.btn-secondary { color: var(--white); background: transparent; }
.btn-secondary:hover { border-color: var(--ice); color: var(--ice); }

.panel {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
}

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--hairline);
  position: sticky;
  top: 0;
  background: rgba(6, 5, 4, 0.86);
  backdrop-filter: blur(10px);
  z-index: 40;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
  gap: 24px;
}
.wordmark {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--white);
}
.primary-nav ul {
  display: flex;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.primary-nav a {
  font-size: 0.9rem;
  color: var(--steel-light);
  transition: color 0.2s ease;
}
.primary-nav a:hover,
.primary-nav .current-menu-item > a { color: var(--white); }
.header-cta { padding: 8px 16px; font-size: 0.85rem; }
@media (max-width: 720px) {
  .primary-nav { display: none; }
}

/* ---------- Breadcrumbs ---------- */
.breadcrumbs { padding: 24px 0 0; }
.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.02em;
}
.breadcrumbs li { display: flex; align-items: center; gap: 6px; }
.breadcrumbs a { color: var(--steel); }
.breadcrumbs a:hover { color: var(--ice); }
.breadcrumbs [aria-current="page"] { color: var(--steel-light); }
.breadcrumbs .crumb-sep { color: var(--hairline); }

/* ---------- Blog index ---------- */
.page-hero { padding: 64px 0 32px; }
.page-hero .hero-sub { max-width: 46ch; font-size: 1.05rem; }

.post-list { display: flex; flex-direction: column; gap: 16px; padding-bottom: 72px; }
.post-row {
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 24px;
  padding: 28px;
  transition: border-color 0.2s ease;
}
a.post-row:hover { border-color: var(--ice); }
.post-row .post-date { color: var(--steel); font-size: 0.8rem; margin: 6px 0 0; }
.post-row h2 { font-size: 1.15rem; margin-bottom: 6px; }
.post-row .excerpt { margin: 0; font-size: 0.95rem; }
@media (max-width: 640px) {
  .post-row { grid-template-columns: 1fr; }
}

/* Pagination */
.pagination { padding-bottom: 72px; }
.nav-links { display: flex; gap: 8px; flex-wrap: wrap; }
.nav-links .page-numbers {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  padding: 8px 14px;
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--steel-light);
}
.nav-links .page-numbers.current { color: var(--bg); background: var(--ice); border-color: var(--ice); }
.nav-links a.page-numbers:hover { border-color: var(--ice); color: var(--ice); }

/* ---------- Single post / page ---------- */
.post-head { max-width: var(--prose); padding-top: 56px; padding-bottom: 8px; }
.post-meta { font-family: var(--font-mono); color: var(--steel); font-size: 0.85rem; }

.entry-content {
  max-width: var(--prose);
  padding-bottom: 48px;
}
.entry-content p { font-size: 1.02rem; }
.entry-content h2 { margin-top: 1.6em; font-size: 1.4rem; }
.entry-content h3 { margin-top: 1.3em; }
.entry-content ul, .entry-content ol { color: var(--steel-light); padding-left: 1.2em; }
.entry-content li { margin-bottom: 0.5em; }
.entry-content strong { color: var(--white); }
.entry-content a { color: var(--ice); border-bottom: 1px solid var(--ice-dim); }
.entry-content a:hover { border-bottom-color: var(--ice); }
.entry-content blockquote,
.entry-content .wp-block-quote {
  border-left: 2px solid var(--ice);
  padding-left: 16px;
  margin-left: 0;
  margin-right: 0;
  font-style: normal;
}
.entry-content blockquote p { color: var(--steel-light); }
.entry-content img { max-width: 100%; height: auto; border-radius: 4px; }
.entry-content figure { margin: 1.5em 0; }
.entry-content figcaption {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--steel);
  margin-top: 8px;
}
.entry-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  padding: 0.1em 0.4em;
}
.entry-content pre {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 16px;
  overflow-x: auto;
}
.entry-content pre code { background: none; border: none; padding: 0; }
.entry-content table {
  border-collapse: collapse;
  width: 100%;
  font-size: 0.92rem;
}
.entry-content th, .entry-content td {
  border: 1px solid var(--hairline);
  padding: 10px 12px;
  text-align: left;
}
.entry-content th {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
}
.entry-content hr {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 2em 0;
}
.alignwide { max-width: var(--container); }
.alignfull { max-width: 100vw; width: 100vw; margin-left: calc(50% - 50vw); }

.post-foot { max-width: var(--prose); padding-bottom: 64px; }
.post-foot .back-link { margin-top: 24px; }

/* ---------- Footer ---------- */
.site-footer { padding-bottom: 40px; }
.footer-inner {
  display: grid;
  grid-template-columns: 1.6fr 1.3fr 1fr 1fr;
  gap: 32px;
  padding: 56px 24px 40px;
}
.footer-col { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--steel-light); font-size: 0.9rem; }
.footer-col a:hover { color: var(--ice); }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer-label {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
  margin: 0;
}
.footer-note { font-size: 0.85rem; margin: 4px 0 0; }
.copyright {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--steel);
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- Search / 404 ---------- */
.search-form {
  display: flex;
  gap: 10px;
  max-width: 480px;
}
.search-form input[type="search"] {
  flex: 1;
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 3px;
  color: var(--white);
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 10px 14px;
}
.search-form input[type="search"]:focus {
  outline: none;
  border-color: var(--ice);
}
.empty-state { padding: 24px 0 96px; max-width: 60ch; }

/* Screen-reader text (WP standard class) */
.screen-reader-text {
  clip: rect(1px, 1px, 1px, 1px);
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden;
  word-wrap: normal !important;
}

/* ---------- v1.1: landing pages, download, featured images ---------- */
.post-hero-img { max-width: var(--prose); margin: 0 auto; padding: 8px 24px 24px; }
.post-hero-img img { width: 100%; height: auto; border-radius: 4px; border: 1px solid var(--hairline); }

.land-hero { padding: 72px 0 40px; }
.land-hero .hero-sub { max-width: 52ch; font-size: 1.05rem; }
.land-content { max-width: var(--container); margin: 0 auto; padding: 0 24px 56px; }
.land-content h2 { margin-top: 1.8em; }
.land-content > p { max-width: 68ch; }
.land-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin: 28px 0;
  padding: 0;
  list-style: none;
}
.land-item {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 22px;
}
.land-item h3 { font-size: 1.05rem; margin-bottom: 8px; }
.land-item p { font-size: 0.92rem; margin: 0; }
@media (max-width: 880px) { .land-grid { grid-template-columns: 1fr; } }

.store-links { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }

.cta-band { margin: 0 auto 72px; max-width: var(--container); padding: 0 24px; }
.cta-band-inner {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  padding: 44px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.cta-band-inner h2 { margin: 0; }
@media (max-width: 720px) { .cta-band-inner { flex-direction: column; align-items: flex-start; } }

.faq-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; padding-bottom: 40px; }
.faq-item { background: var(--bg-panel); border: 1px solid var(--hairline); border-radius: 4px; padding: 24px; }
.faq-item h3 { font-size: 1rem; margin-bottom: 8px; }
.faq-item p { font-size: 0.92rem; margin: 0; }
@media (max-width: 720px) { .faq-list { grid-template-columns: 1fr; } }

/* ---------- v1.3: homepage, promo banner, footer journal list ---------- */

.home-hero { padding: 64px 0 8px; }
.home-hero-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.home-hero-copy .hero-sub { max-width: 46ch; font-size: 1.05rem; }
.home-hero-copy .hero-actions { display: flex; gap: 14px; margin-top: 28px; flex-wrap: wrap; }
.home-hero-copy .hero-badges { margin-top: 24px; }
.home-hero-media img {
  width: 100%;
  height: auto;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  display: block;
}
.media-placeholder { padding: 48px 28px; text-align: center; }
.media-placeholder .eyebrow { margin-bottom: 10px; }
.media-placeholder p:last-child { font-size: 0.88rem; margin: 0; }
@media (max-width: 880px) { .home-hero-grid { grid-template-columns: 1fr; } }

.stats-band { padding: 40px 0; }
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}
.stat-value { font-family: var(--font-mono); color: var(--white); font-size: 1rem; margin-top: 6px; }
@media (max-width: 880px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }

.explain { padding-top: 24px; padding-bottom: 8px; }
.explain-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; }
.explain-grid p:last-child { font-size: 0.95rem; }
.explain-cta { padding-top: 28px; }
@media (max-width: 880px) { .explain-grid { grid-template-columns: 1fr; } }

/* Reusable app-promotion banner (homepage, features, landing pages, end of posts) */
.promo-banner { padding: 56px 0; }
.promo-banner-inner {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
}
.promo-banner-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.promo-banner-copy { padding: 40px; }
.promo-banner-copy h2 { margin-bottom: 8px; }
.promo-banner-copy .store-links { display: flex; gap: 14px; margin-top: 22px; flex-wrap: wrap; }
@media (max-width: 780px) {
  .promo-banner-inner { grid-template-columns: 1fr; }
  .promo-banner-media img { max-height: 220px; }
}

.home-journal { padding: 24px 0 72px; }
.home-journal-head { padding-bottom: 8px; }
.home-journal-head .eyebrow { margin-bottom: 4px; }

/* Footer: recent posts genuinely visible, not just a menu link */
.footer-col-journal ul { list-style: none; margin: 0 0 12px; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-col-journal ul li a {
  color: var(--steel-light);
  font-size: 0.88rem;
  line-height: 1.35;
  display: block;
}
.footer-col-journal ul li a:hover { color: var(--ice); }
.footer-all-posts { font-family: var(--font-mono); font-size: 0.78rem; color: var(--ice); }
@media (max-width: 880px) {
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .footer-inner { grid-template-columns: 1fr; }
}

/* ---------- v2.1: fuller layout — hero visuals, ambient grid, padding ---------- */

/* Ambient background grid — telemetry-graph texture so wide margins aren't dead space */
body {
  background-image:
    linear-gradient(var(--bg-panel) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-panel) 1px, transparent 1px);
  background-size: 56px 56px;
  background-attachment: fixed;
}
/* Solid surfaces stay solid over the grid */
.site-header, .promo-banner-inner, .panel, .land-item, .faq-item, .item { background-clip: padding-box; }

/* Two-column landing/download hero */
.land-hero { padding: 72px 0 56px; }
.land-hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 56px;
  align-items: center;
}
.land-hero-visual .hero-thumb img,
.land-hero-visual .hero-cluster {
  width: 100%;
  border-radius: 4px;
}
.land-hero-visual .hero-thumb img {
  height: auto;
  border: 1px solid var(--hairline);
  display: block;
}
.hero-cluster { padding: 24px; background: var(--bg-panel); border: 1px solid var(--hairline); }
.hero-cluster svg { width: 100%; height: auto; display: block; }
@media (max-width: 880px) {
  .land-hero-grid { grid-template-columns: 1fr; gap: 32px; }
}

/* Side rails: tick columns on very wide screens so page edges aren't empty */
@media (min-width: 1480px) {
  body::before, body::after {
    content: '';
    position: fixed;
    top: 0;
    bottom: 0;
    width: 14px;
    z-index: 1;
    pointer-events: none;
    background-image: repeating-linear-gradient(
      to bottom,
      var(--hairline) 0px,
      var(--hairline) 1px,
      transparent 1px,
      transparent 12px
    );
  }
  body::before { left: 40px; }
  body::after  { right: 40px; }
}

/* Generous padding pass */
.land-item { padding: 28px; }
.faq-item { padding: 28px; }
.item { padding: 28px; }
.post-row { padding: 32px; }
.promo-banner-copy { padding: 48px; }
.land-content { padding-bottom: 72px; }
.land-content h2 { margin-top: 2em; }
.land-grid { gap: 20px; margin: 36px 0; }
.entry-content > p:first-child { font-size: 1.08rem; }

/* ---------- v2.2: dynamic thumbnails in every post list ---------- */
.post-row {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  align-items: center;
  padding: 24px;
}
.post-thumb img,
.post-thumb-fallback {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--hairline);
  display: block;
}
.post-thumb-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-panel);
}
.post-thumb-fallback svg { width: 72%; height: auto; }
.post-row-body .post-row-meta {
  display: flex;
  gap: 16px;
  align-items: baseline;
}
.post-row-body .post-date { margin: 0; }
.post-row-body h2 { margin: 6px 0; }
@media (max-width: 720px) {
  .post-row { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- v2.4: feature child-page grid ---------- */
.feature-children-section { padding: 56px 0 24px; border-top: 1px solid var(--hairline); }
.feature-children {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-top: 28px;
}
.fc-card { overflow: hidden; transition: border-color 0.2s ease; }
.fc-card:hover { border-color: var(--ice); }
.fc-thumb img { width: 100%; aspect-ratio: 1200 / 630; object-fit: cover; display: block; }
.fc-body { padding: 22px 24px; }
.fc-body h3 { margin-bottom: 6px; font-size: 1.05rem; }
.fc-body p { font-size: 0.92rem; margin: 0; }
@media (max-width: 720px) { .feature-children { grid-template-columns: 1fr; } }

/* ---------- v2.6: depth pass — tonal zones, glow, layered surfaces ---------- */

:root {
  --ice-glow: rgba(255, 79, 79, 0.06); /* overridden by accent injection */
  --zone-raised: #12100d;   /* warm lifted band (from the app's trSurface2 family) */
  --zone-map: #0b0e16;      /* cool blue-dark zone (from trMapBg) */
}

/* Body: instrument-backlight glow at top, vertical falloff, edge vignette — over the grid */
body {
  background-image:
    radial-gradient(ellipse 80% 45% at 50% -8%, var(--ice-glow), transparent 60%),
    linear-gradient(90deg, rgba(0,0,0,0.55), transparent 10%, transparent 90%, rgba(0,0,0,0.55)),
    linear-gradient(180deg, #0a0908 0%, #060504 480px),
    linear-gradient(var(--bg-panel) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-panel) 1px, transparent 1px);
  background-size: auto, auto, auto, 56px 56px, 56px 56px;
  background-attachment: fixed, fixed, scroll, fixed, fixed;
}

/* Panels: gradient surface + top-edge highlight + soft drop — layered, not painted-on */
.panel, .land-item, .faq-item, .item, .fc-card, .promo-banner-inner, .hero-cluster, .media-placeholder {
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.028));
  border-color: rgba(255,255,255,0.10);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 12px 32px rgba(0,0,0,0.38);
}

/* Warm raised band: stats strip + footer sit on a lifted surface */
.stats-band {
  background: var(--zone-raised);
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
}
.site-footer {
  background: linear-gradient(180deg, transparent, rgba(255,255,255,0.02));
}

/* Cool map-blue zone: journal strips and blog lists read as a different room */
.home-journal, .post-list {
  background: var(--zone-map);
  border-top: 1px solid rgba(255,255,255,0.06);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.home-journal { padding-top: 56px; }
.post-list { padding-top: 40px; padding-bottom: 56px; }

/* Alternating feature groups on /features/ */
.feature-group:nth-of-type(even) { background: var(--zone-raised); }

/* Promo banner: accent presence without shouting */
.promo-banner-inner {
  border-top: 2px solid var(--ice);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 0 48px var(--ice-glow),
    0 12px 32px rgba(0,0,0,0.38);
}

/* Hero zones: glow behind the visual column */
.land-hero-visual, .home-hero-media { position: relative; }
.land-hero-visual::before, .home-hero-media::before {
  content: '';
  position: absolute;
  inset: -12% -8%;
  background: radial-gradient(ellipse at 60% 40%, var(--ice-glow), transparent 65%);
  z-index: 0;
  pointer-events: none;
}
.land-hero-visual > *, .home-hero-media > * { position: relative; z-index: 1; }

/* CTA band matches the banner treatment */
.cta-band-inner {
  background: linear-gradient(180deg, rgba(255,255,255,0.065), rgba(255,255,255,0.028));
  border-top: 2px solid var(--ice);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.07), 0 12px 32px rgba(0,0,0,0.38);
}

/* ---------- v2.7: fixed media sizing — layout is never driven by the image ---------- */

/* Post list rows: thumbnail slot locked to 160px tall, any image center-cropped into it */
.post-row .post-thumb img,
.post-row .post-thumb-fallback {
  width: 100%;
  height: 160px;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

/* Feature child cards: fixed 190px media band */
.fc-card .fc-thumb img {
  width: 100%;
  height: 190px;
  aspect-ratio: auto;
  object-fit: cover;
  object-position: center;
}

/* Hero visuals (landing/download/home): capped height, cropped, never taller than the copy column */
.land-hero-visual .hero-thumb img,
.home-hero-media img {
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  object-position: center;
}

/* Promo banner media column: hard band, image fills it */
.promo-banner-media {
  height: 100%;
  max-height: 320px;
  min-height: 220px;
  overflow: hidden;
}
.promo-banner-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
@media (max-width: 780px) {
  .promo-banner-media { max-height: 220px; min-height: 160px; }
}

/* Single post / page hero image: capped */
.post-hero-img img {
  width: 100%;
  max-height: 480px;
  object-fit: cover;
  object-position: center;
}

/* In-content images: never taller than a screen */
.entry-content img { max-height: 720px; width: auto; max-width: 100%; }

/* ---------- v2.8: promo banner layout — no empty media column ---------- */
.promo-banner { container-type: inline-size; }
.promo-banner-inner { grid-template-columns: 1fr; }               /* default: single column */
.promo-banner-inner.has-media { grid-template-columns: 1fr 1.2fr; } /* two columns only when media exists */
.promo-banner-inner.no-media .promo-banner-copy { max-width: 62ch; }

/* Stack by the banner's own width (matters inside the 720px post column) */
@container (max-width: 820px) {
  .promo-banner-inner.has-media { grid-template-columns: 1fr; }
  .promo-banner-media { max-height: 220px; }
}

/* ---------- v2.9: centered article column + banner media fixes ---------- */

/* Article pages: head, hero image, body, and foot all share one centered axis.
   Previously the hero image centered while text hugged the container's left edge. */
.post-head, .entry-content, .post-foot {
  margin-left: auto;
  margin-right: auto;
}

/* Banner media is now a link — keep it block-shaped and full-width in all states */
.promo-banner-media { display: block; }
.promo-banner-media img { display: block; width: 100%; }
@container (max-width: 820px) {
  .promo-banner-media { width: 100%; max-height: 240px; }
}

/* ---------- v2.10: banner media fills the card edge-to-edge ---------- */

/* The inner card inherited .wrap's 24px side padding — media should bleed to the
   card edges; only the copy needs padding (it already has its own). */
.promo-banner-inner { padding-left: 0; padding-right: 0; }

/* Stacked (inside posts / narrow containers): media is a fixed 260px band,
   flush with the card's top and sides, image center-cropped into it */
@container (max-width: 820px) {
  .promo-banner-media {
    width: 100%;
    height: 260px;
    max-height: none;
    min-height: 0;
    margin: 0;
  }
  .promo-banner-media img { height: 100%; object-fit: cover; }
}

/* ---------- v3.0: media sizing driven by Customizer variables ---------- */
/* Defaults mirror the Customizer defaults; the injected :root block overrides. */

.post-row .post-thumb img,
.post-row .post-thumb-fallback { height: var(--thumb-h, 160px); }

.fc-card .fc-thumb img { height: var(--card-img-h, 190px); }

.land-hero-visual .hero-thumb img,
.home-hero-media img { max-height: var(--hero-max, 440px); }

.post-hero-img img { max-height: var(--posthero-max, 480px); }

/* Banner media: ratio-controlled band (default 16:9), edge-to-edge */
@container (max-width: 820px) {
  .promo-banner-media {
    width: 100%;
    height: auto;
    max-height: none;
    min-height: 0;
    aspect-ratio: var(--banner-ratio, 16 / 9);
    margin: 0;
  }
  .promo-banner-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
}

/* ---------- v3.1: store badges ---------- */
.store-badges {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  padding: 10px 20px 10px 16px;
  border-radius: 8px;
  background: #000;
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  transition: border-color 0.2s ease, transform 0.15s ease;
}
.store-badge:hover { border-color: var(--ice); transform: translateY(-1px); }
.store-badge svg { width: 26px; height: 26px; flex: none; }
.store-badge-text { display: flex; flex-direction: column; line-height: 1.15; }
.store-badge-text small {
  font-size: 0.66rem;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.75);
}
.store-badge-text strong {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 600;
}
.store-more {
  font-family: var(--font-mono);
  font-size: 0.82rem;
  color: var(--ice);
  margin-left: 4px;
  white-space: nowrap;
}
.store-more:hover { text-decoration: underline; }

/* ---------- v3.2: per-post header image styles ---------- */
/* cover = existing behavior (cropped band at --posthero-max) */

.post-hero-img.hero-style-full img {
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 720px;
  object-fit: initial;
  display: block;
  margin: 0 auto;
}

/* Fit: whole image visible, letterboxed on a panel surface */
.post-thumb.thumb-style-contain {
  background: var(--bg-panel);
  border: 1px solid var(--hairline);
  border-radius: 4px;
  overflow: hidden;
}
.post-thumb.thumb-style-contain img {
  object-fit: contain;
  border: none;
}
