/*
Theme Name: Red Iron Peak
Theme URI: https://redironpeak.com/
Author: Red Iron Peak
Description: Apple-inspired editorial theme for red light therapy reviews and guides. Frosted navigation, type-first sections, and image-forward review cards.
Version: 2.2.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: red-iron-peak
*/

/* ---------------------------------------------------------------------------
   Design tokens — Apple-style system
   --primary / --primary-foreground are overridden by the theme settings page.
--------------------------------------------------------------------------- */
:root {
  --background: #ffffff;
  --foreground: #1d1d1f;
  --primary: #e52529;
  --primary-foreground: #ffffff;
  --secondary: #f5f5f7;
  --muted-foreground: #55555a;
  --border: #d2d2d7;
  --dark: #000000;
  --dark-foreground: #f5f5f7;
  --dark-muted: #a9a9ae;
  --accent-on-dark: #ff6659;
  --radius: 18px;
  --radius-lg: 28px;
  --shadow: 0 4px 14px rgba(0, 0, 0, 0.05);
  --shadow-hover: 0 10px 28px rgba(0, 0, 0, 0.09);
  --hairline: rgba(0, 0, 0, 0.09);
  --nav-height: 52px;
  --ease: cubic-bezier(0.28, 0.11, 0.32, 1);
}

/* ---------------------------------------------------------------------------
   Base
--------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--background);
  color: var(--foreground);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: anywhere;
}
h1, h2, h3, h4 { line-height: 1.1; letter-spacing: -0.018em; font-weight: 700; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
button, input, textarea, select { font: inherit; }
button, [type="submit"] {
  background: var(--primary);
  color: var(--primary-foreground);
  border: 0;
  border-radius: 980px;
  padding: 9px 22px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: opacity 0.25s var(--ease);
}
button:hover, [type="submit"]:hover { opacity: 0.85; }
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 4px;
  border-radius: 4px;
}
section[id] { scroll-margin-top: calc(var(--nav-height) + 24px); }

.container { max-width: 1080px; margin-inline: auto; padding-inline: 24px; }

/* ---------------------------------------------------------------------------
   Announcement strip + frosted sticky header
--------------------------------------------------------------------------- */
.promo {
  background: var(--secondary);
  color: var(--foreground);
  text-align: center;
  padding: 9px 20px;
  font-size: 12px;
  letter-spacing: 0.01em;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(251, 251, 253, 0.82);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--hairline);
  transition: box-shadow 0.3s var(--ease);
}
.site-header.is-scrolled { box-shadow: 0 1px 0 var(--hairline), 0 8px 24px rgba(0, 0, 0, 0.05); }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
.header-inner {
  min-height: var(--nav-height);
  max-width: 1080px;
  margin-inline: auto;
  padding-inline: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.branding { display: flex; align-items: center; }
.brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}
.brand span { color: var(--primary); }
.brand-mark { width: 12px; height: 12px; color: var(--primary); flex: none; }
.custom-logo { max-height: 32px; width: auto; }

.menu { list-style: none; padding: 0; margin: 0; display: flex; align-items: center; font-size: 12px; }
.menu > li { position: relative; }
.menu > li > a {
  display: inline-block;
  padding: 0 11px;
  line-height: var(--nav-height);
  color: rgba(0, 0, 0, 0.72);
  transition: color 0.2s var(--ease);
}
.menu > li > a:hover { color: var(--foreground); }
.current-menu-item > a, .current_page_item > a { color: var(--primary) !important; }
.sub-menu {
  display: none;
  position: absolute;
  top: calc(var(--nav-height) - 12px);
  left: 50%;
  transform: translateX(-50%);
  background: rgba(251, 251, 253, 0.96);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  backdrop-filter: saturate(180%) blur(20px);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
  padding: 10px 0;
  list-style: none;
  min-width: 200px;
  z-index: 20;
}
.sub-menu li a { display: block; padding: 8px 22px; font-size: 13px; color: rgba(0, 0, 0, 0.72); white-space: nowrap; }
.sub-menu li a:hover { color: var(--foreground); background: rgba(0, 0, 0, 0.03); }
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { display: block; }

.menu-toggle {
  display: none;
  background: transparent;
  color: var(--foreground);
  padding: 10px 2px;
  border-radius: 0;
}
.menu-toggle .bars { display: block; width: 18px; height: 18px; position: relative; }
.menu-toggle .bars span {
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: var(--foreground);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.2s var(--ease);
}
.menu-toggle .bars span:nth-child(1) { top: 3px; }
.menu-toggle .bars span:nth-child(2) { top: 8.5px; }
.menu-toggle .bars span:nth-child(3) { top: 14px; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .bars span:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

/* ---------------------------------------------------------------------------
   Hero — type-first, Apple product-page rhythm
--------------------------------------------------------------------------- */
.intro {
  position: relative;
  text-align: center;
  padding: clamp(88px, 14vh, 150px) 24px clamp(72px, 10vh, 110px);
  overflow: hidden;
}
.intro::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -280px;
  transform: translateX(-50%);
  width: min(1300px, 140vw);
  height: 640px;
  background: radial-gradient(closest-side, rgba(229, 37, 41, 0.13), rgba(229, 37, 41, 0.04) 55%, transparent 72%);
  pointer-events: none;
}
.intro > * { position: relative; }
.eyebrow {
  color: var(--primary);
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.16em;
  margin: 0 0 18px;
}
.intro h1 {
  font-size: clamp(42px, 6.4vw, 76px);
  letter-spacing: -0.025em;
  line-height: 1.05;
  margin: 0 auto 20px;
  max-width: 900px;
}
.intro-copy {
  max-width: 620px;
  margin: 0 auto;
  color: var(--muted-foreground);
  font-size: clamp(18px, 2.2vw, 22px);
  line-height: 1.55;
}
.hero-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px 44px; margin-top: 34px; }

/* Vision-Pro-inspired cinematic hero (homepage) — red light out of darkness */
.intro--dark {
  background: #000;
  color: var(--dark-foreground);
  padding-block: clamp(96px, 16vh, 170px);
}
.intro--dark::before {
  bottom: -240px;
  width: min(1500px, 160vw);
  height: 720px;
  background: radial-gradient(closest-side, rgba(229, 37, 41, 0.26), rgba(229, 37, 41, 0.07) 48%, transparent 70%);
}
.intro--dark .eyebrow { color: var(--accent-on-dark); }
.intro--dark h1 {
  font-size: clamp(44px, 7.2vw, 88px);
  letter-spacing: -0.028em;
  line-height: 1.04;
  margin-bottom: 24px;
  background: linear-gradient(180deg, #ffffff 25%, #b9b9be 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.intro--dark .intro-copy { color: var(--dark-muted); }
.intro--dark .link-cta { color: var(--accent-on-dark); }

/* Load-time entrance for hero blocks (CSS-only, no JS dependency for content) */
@keyframes rip-hero-in { from { opacity: 0; transform: translateY(26px); } to { opacity: 1; transform: none; } }
html.js .intro > *, html.js .archive-hero > * { opacity: 0; animation: rip-hero-in 0.9s var(--ease) forwards; }
html.js .intro > *:nth-child(1), html.js .archive-hero > *:nth-child(1) { animation-delay: 0.05s; }
html.js .intro > *:nth-child(2), html.js .archive-hero > *:nth-child(2) { animation-delay: 0.15s; }
html.js .intro > *:nth-child(3), html.js .archive-hero > *:nth-child(3) { animation-delay: 0.25s; }
html.js .intro > *:nth-child(4), html.js .archive-hero > *:nth-child(4) { animation-delay: 0.35s; }
.link-cta {
  color: var(--primary);
  font-size: clamp(17px, 2vw, 20px);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.link-cta .chev, .text-link .chev, .read-more .chev { transition: transform 0.3s var(--ease); }
.link-cta:hover .chev { transform: translateX(4px); }

/* ---------------------------------------------------------------------------
   Section scaffolding
--------------------------------------------------------------------------- */
.section-heading {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
  margin-bottom: 48px;
}
.section-heading h2 { font-size: clamp(30px, 4vw, 46px); letter-spacing: -0.02em; margin: 0; }
.section-heading .eyebrow { margin-bottom: 2px; }
.section-heading .text-link { font-size: 17px; }
.text-link { color: var(--primary); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
.text-link:hover .chev { transform: translateX(3px); }

/* ---------------------------------------------------------------------------
   Cards — image-forward, LTI style
--------------------------------------------------------------------------- */
.card-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.review-card {
  display: flex;
  flex-direction: column;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--background);
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
  min-width: 0;
}
.review-card:hover { transform: translateY(-4px); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), var(--shadow-hover); }
.review-card > a { display: flex; flex-direction: column; height: 100%; }
.card-media { overflow: hidden; background: var(--secondary); aspect-ratio: 16 / 10; }
.card-media--white { background: #fff; }
.card-image { width: 100%; height: 100%; object-fit: cover; transition: transform 0.7s var(--ease); filter: saturate(1.07) contrast(1.04); }
.card-image.contain { object-fit: contain; }
.review-card:hover .card-image { transform: scale(1.035); }
.card-body { padding: 26px 26px 28px; display: flex; flex: 1; flex-direction: column; }
.tag { align-self: flex-start; color: var(--primary); font-size: 13px; font-weight: 600; letter-spacing: 0.01em; }
.card-body h2, .card-body h3 {
  font-size: 22px;
  font-weight: 600;
  letter-spacing: -0.014em;
  line-height: 1.24;
  margin: 10px 0 9px;
  transition: color 0.25s var(--ease);
}
.review-card:hover .card-body h2, .review-card:hover .card-body h3 { color: var(--primary); }
.card-body p { color: var(--muted-foreground); font-size: 15px; line-height: 1.55; margin: 0 0 14px; }
.card-body .credit { font-size: 12px; color: var(--muted-foreground); opacity: 0.85; margin: 0; }
.read-more {
  margin-top: auto;
  padding-top: 16px;
  color: var(--primary);
  font-size: 15px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.read-more:hover .chev, .review-card:hover .read-more .chev { transform: translateX(3px); }

/* Featured lead tile — full-width horizontal card for the buying guide */
.card-grid--lead { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.review-card--featured { grid-column: 1 / -1; }
.review-card--featured > a { flex-direction: row; min-height: 420px; }
.review-card--featured .card-media { flex: 0 0 56%; position: relative; aspect-ratio: auto; }
.review-card--featured .card-media .card-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.review-card--featured .card-body { justify-content: center; padding: 40px 44px; }
.review-card--featured .card-body h2 { font-size: clamp(24px, 2.6vw, 32px); }
.review-card--featured .card-body p { font-size: 16px; max-width: 460px; }

/* ---------------------------------------------------------------------------
   Homepage bands
--------------------------------------------------------------------------- */
.picks { padding: 8px 0 clamp(72px, 10vh, 110px); }

.band-dark { background: var(--dark); color: var(--dark-foreground); }
.band-dark .section-heading h2 {
  color: #fff;
  font-size: clamp(34px, 4.5vw, 54px);
  letter-spacing: -0.024em;
  background: linear-gradient(180deg, #ffffff 25%, #b9b9be 115%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.band-dark .eyebrow { color: var(--accent-on-dark); }
.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 64px;
  padding-block: 8px clamp(72px, 10vh, 112px);
}
.trust-grid > div { border-top: 1px solid rgba(255, 255, 255, 0.22); padding-top: 18px; }
.trust-grid h2 { font-size: 19px; color: #fff; margin: 0 0 8px; letter-spacing: -0.01em; }
.trust-grid p { font-size: 15px; color: var(--dark-muted); margin: 0; line-height: 1.65; }

.latest { background: var(--secondary); }
.section-padding { padding-block: clamp(72px, 11vh, 120px); }
.latest .review-card { background: var(--background); }
.home-content { padding-block: 24px 88px; }

/* ---------------------------------------------------------------------------
   Footer — quiet Apple legal style
--------------------------------------------------------------------------- */
.site-footer {
  background: var(--secondary);
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: #515154;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-block: 44px;
  border-bottom: 1px solid var(--border);
}
.footer-grid .brand { font-size: 13px; }
.footer-grid p { font-size: 12px; line-height: 1.6; margin: 14px 0 0; max-width: 340px; }
.footer-grid h2 { font-size: 12px; color: var(--foreground); margin: 0 0 14px; letter-spacing: 0; }
.footer-grid .menu { flex-direction: column; align-items: start; gap: 10px; font-size: 12px; }
.footer-grid .menu > li > a { padding: 0; line-height: inherit; color: inherit; }
.footer-grid .menu > li > a:hover { color: var(--foreground); }
.social-links { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: 12px; }
.social-links a { color: inherit; }
.social-links a:hover { color: var(--foreground); }
.disclosure { padding-block: 22px 44px; line-height: 1.6; }

/* ---------------------------------------------------------------------------
   Archives & search
--------------------------------------------------------------------------- */
.archive-hero { background: var(--secondary); padding: clamp(56px, 9vh, 88px) 24px clamp(48px, 7vh, 72px); text-align: center; }
.archive-hero .eyebrow { margin-bottom: 14px; }
.archive-hero h1 { font-size: clamp(34px, 5vw, 56px); letter-spacing: -0.022em; margin: 0 auto 14px; }
.archive-hero .intro-copy { font-size: 18px; }
.archive-main { max-width: 1080px; margin-inline: auto; padding: clamp(40px, 6vh, 64px) 24px 96px; }
.pagination { margin-top: 56px; text-align: center; }
.nav-links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; font-size: 14px; }
.nav-links a, .nav-links .current { color: var(--primary); }
.nav-links .current { font-weight: 700; }
.page-numbers { padding: 4px 2px; }
.empty-state { text-align: center; padding: 56px 24px; color: var(--muted-foreground); }

/* ---------------------------------------------------------------------------
   Singular — article typography
--------------------------------------------------------------------------- */
.singular-main { padding-top: clamp(48px, 8vh, 84px); }
.article-header { max-width: 760px; text-align: center; margin: 0 auto 36px; }
.article-header h1 { font-size: clamp(32px, 4.8vw, 56px); letter-spacing: -0.022em; margin: 0 0 18px; }
.article-header .eyebrow { margin-bottom: 14px; }
.article-meta { color: var(--muted-foreground); font-size: 14px; }
.article-cover { max-width: 980px; margin: 0 auto 44px; padding-inline: 24px; }
.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 640px;
  object-fit: cover;
  object-position: center;
  border-radius: var(--radius-lg);
  background: var(--secondary);
  filter: saturate(1.07) contrast(1.04);
}
figcaption { color: var(--muted-foreground); font-size: 12px; margin-top: 10px; text-align: center; }

.article-content, .article-end, .comments-area {
  max-width: 700px;
  margin-inline: auto;
  font-size: 18px;
  line-height: 1.75;
}
.article-content h2 { font-size: 32px; letter-spacing: -0.018em; margin: 56px 0 18px; }
.article-content h3 { font-size: 23px; letter-spacing: -0.012em; margin: 44px 0 14px; }
.article-content a, .article-end a { color: var(--primary); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.article-content p { margin: 0 0 26px; }
.article-content figure { margin: 36px 0; }
.article-content blockquote {
  border-left: 3px solid var(--primary);
  padding: 4px 0 4px 24px;
  margin: 36px 0;
  color: var(--muted-foreground);
  font-style: italic;
}
.article-content table {
  width: 100%;
  display: block;
  overflow-x: auto;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15px;
  border-top: 1px solid var(--border);
}
.article-content thead th {
  color: var(--muted-foreground);
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
.article-content th, .article-content td {
  padding: 12px 24px 12px 0;
  border: 0;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}
.article-content td:first-child { font-weight: 600; }
.article-content tbody tr:last-child td { border-bottom: 1px solid var(--border); }
.wp-block-table { overflow-x: auto; }
.alignwide { max-width: 980px; }
.alignfull { width: 100%; }
.wp-block-columns { gap: 24px; }
.article-content pre { overflow: auto; background: var(--secondary); border-radius: var(--radius); padding: 20px; font-size: 14px; }
.article-content iframe { max-width: 100%; }
.article-content details { border-block: 1px solid var(--border); padding: 16px 0; }
.article-content summary { cursor: pointer; font-weight: 600; }
.article-end { margin-top: 56px; border-top: 1px solid var(--border); padding-top: 28px; font-size: 15px; color: var(--muted-foreground); }
.post-navigation { display: flex; gap: 24px; justify-content: space-between; flex-wrap: wrap; }

/* Share row */
.share-row { display: flex; justify-content: center; gap: 12px; margin: 48px auto 0; }
.share-btn {
  width: 42px; height: 42px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); background: var(--background);
  color: var(--muted-foreground); cursor: pointer; padding: 0;
  transition: color 0.25s var(--ease), border-color 0.25s var(--ease), transform 0.25s var(--ease);
}
.share-btn:hover { color: var(--foreground); border-color: var(--foreground); transform: translateY(-2px); background: var(--background); opacity: 1; }
.share-btn svg { width: 16px; height: 16px; fill: currentColor; }
.share-btn .icon-check { display: none; }
.share-btn.is-copied .icon-link { display: none; }
.share-btn.is-copied .icon-check { display: block; }
.share-btn.is-copied { color: var(--primary); border-color: var(--primary); }

/* Next-post tile — the binge loop */
.next-post {
  display: flex; margin-top: 28px; border-radius: var(--radius-lg); overflow: hidden; min-height: 240px;
  background: var(--background); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.next-post:hover { transform: translateY(-3px); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04), var(--shadow-hover); }
.next-post .card-media { flex: 0 0 40%; position: relative; }
.next-post .card-media .card-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.next-post .card-body { justify-content: center; padding: 30px 34px; }
.next-post .card-body h2 { font-size: clamp(20px, 2.2vw, 26px); }
.next-post:hover .card-body h2 { color: var(--primary); }
.comments-area { margin-top: 72px; }
.comment-list { padding-left: 24px; }
.comment-body { padding-block: 20px; border-bottom: 1px solid var(--border); }

input:not([type="checkbox"]):not([type="radio"]), textarea, select {
  max-width: 100%;
  border: 1px solid var(--border);
  background: var(--background);
  color: var(--foreground);
  padding: 11px 14px;
  border-radius: 12px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(229, 37, 41, 0.15);
}
textarea { width: 100%; }
.search-form { display: flex; justify-content: center; gap: 10px; margin: 24px auto; max-width: 480px; }
.search-form label { flex: 1; }
.search-form input { width: 100%; }

.screen-reader-text, .skip-link:not(:focus) {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; top: 10px; left: 10px; z-index: 9999;
  background: var(--background); color: var(--foreground); padding: 12px 18px; border-radius: 12px;
}

/* ---------------------------------------------------------------------------
   Reading progress bar (articles)
--------------------------------------------------------------------------- */
.reading-progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 110; pointer-events: none; }
.reading-progress span { display: block; height: 100%; width: 0; background: var(--primary); }

/* ---------------------------------------------------------------------------
   Scroll reveal (progressive enhancement — visible by default without JS)
--------------------------------------------------------------------------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
html.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------------------------------------------------------------------------
   Responsive
--------------------------------------------------------------------------- */
@media (max-width: 1000px) {
  .card-grid { gap: 20px; }
  .card-body { padding: 22px; }
  .trust-grid { gap: 24px 40px; }
  .footer-grid { gap: 32px; }
}
@media (max-width: 834px) {
  .review-card--featured > a { flex-direction: column; min-height: 0; }
  .review-card--featured .card-media { flex: none; aspect-ratio: 16 / 10; }
  .review-card--featured .card-body { padding: 24px; }
  .next-post { flex-direction: column; min-height: 0; }
  .next-post .card-media { flex: none; aspect-ratio: 16 / 10; }
  .next-post .card-body { padding: 24px; }
  .menu-toggle { display: block; }
  #primary-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(251, 251, 253, 0.98);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--hairline);
    box-shadow: var(--shadow);
    padding: 0 24px 20px;
  }
  #primary-nav.is-open { display: block; }
  .menu { flex-direction: column; align-items: stretch; gap: 0; font-size: 13px; }
  .menu > li > a { line-height: 1.4; padding: 13px 0; border-bottom: 1px solid var(--hairline); }
  .sub-menu {
    position: static;
    display: block;
    transform: none;
    background: none;
    box-shadow: none;
    border-radius: 0;
    padding: 0 0 6px 16px;
    min-width: 0;
  }
  .sub-menu li a { padding: 9px 0; border-bottom: 1px solid var(--hairline); }
  .card-grid { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .trust-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .article-content, .article-end, .comments-area { font-size: 17px; }
}
@media (max-width: 480px) {
  .container, .header-inner { padding-inline: 20px; }
  .intro h1 { font-size: 40px; }
  .hero-links { flex-direction: column; gap: 16px; align-items: center; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  html.js .intro > *, html.js .archive-hero > * { opacity: 1; animation: none; }
  .review-card, .card-image, .link-cta .chev, .text-link .chev, .read-more .chev, .site-header { transition: none; }
  .review-card:hover { transform: none; }
  .review-card:hover .card-image { transform: none; }
}

/* ---------------------------------------------------------------------------
   2.2.0 — Article reading layout: sticky "On this page" sidebar on wide
   screens, collapsible contents card below 1000px, summary deck under the
   title, takeaway / sources patterns, author card and related articles.
   Anchored headings land below the frosted header.
--------------------------------------------------------------------------- */
.article-deck {
  font-size: clamp(18px, 2.2vw, 21px);
  line-height: 1.55;
  color: var(--muted-foreground);
  max-width: 640px;
  margin: 0 auto 18px;
}
.article-content :is(h2, h3, h4)[id] { scroll-margin-top: calc(var(--nav-height) + 24px); }
.article-layout .article-content h2 { margin: 64px 0 20px; }
/* Keep comparison tables readable: cells keep whole words, and the table's own
   overflow-x scrolling takes over instead of mid-word wrapping. */
.article-content th, .article-content td { overflow-wrap: normal; }

/* Sticky sidebar TOC — desktop only */
.rip-toc { display: none; }
.rip-toc-mobile { display: none; }
@media (min-width: 1001px) {
  .article-layout.has-rip-toc {
    display: grid;
    grid-template-columns: 260px minmax(0, 700px);
    gap: clamp(40px, 5vw, 72px);
    justify-content: center;
    align-items: start;
  }
  .rip-toc {
    display: block;
    position: sticky;
    top: calc(var(--nav-height) + 24px);
    max-height: calc(100vh - var(--nav-height) - 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--background);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 20px 12px 16px 16px;
    scrollbar-width: thin;
  }
  .rip-toc-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--muted-foreground);
    margin: 0 0 10px;
    padding: 0 10px;
  }
  .rip-toc-list { list-style: none; margin: 0; padding: 0; }
  .rip-toc-list a {
    position: relative;
    display: block;
    padding: 6px 10px 6px 18px;
    font-size: 13.5px;
    line-height: 1.45;
    color: var(--muted-foreground);
    border-radius: 9px;
    transition: color 0.2s var(--ease), background-color 0.2s var(--ease);
  }
  .rip-toc-list a::before {
    content: "";
    position: absolute;
    left: 4px;
    top: 50%;
    translate: 0 -50%;
    width: 3px;
    height: 0;
    border-radius: 99px;
    background: var(--primary);
    transition: height 0.25s var(--ease);
  }
  .rip-toc-list a:hover { color: var(--foreground); background: rgba(0, 0, 0, 0.035); }
  .rip-toc-list a.is-active { color: var(--foreground); font-weight: 600; background: rgba(229, 37, 41, 0.05); }
  .rip-toc-list a.is-active::before { height: calc(100% - 14px); }
  .rip-toc-list a:focus-visible { outline-offset: 0; }
}

/* Collapsible contents card — small screens */
@media (max-width: 1000px) {
  .rip-toc-mobile {
    display: block;
    margin: 0 auto 32px;
    max-width: 700px;
    background: var(--background);
    border: 1px solid var(--hairline);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }
  .rip-toc-mobile summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 15px 18px;
    cursor: pointer;
    list-style: none;
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
  }
  .rip-toc-mobile summary::-webkit-details-marker { display: none; }
  .rip-toc-mobile .rip-toc-label { margin: 0; padding: 0; }
  .rip-toc-chev {
    width: 14px;
    height: 14px;
    color: var(--muted-foreground);
    transition: transform 0.3s var(--ease);
  }
  .rip-toc-mobile[open] .rip-toc-chev { transform: rotate(180deg); }
  .rip-toc-mobile .rip-toc-list {
    padding: 2px 10px 14px;
    max-height: min(56vh, 460px);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-top: 1px solid var(--hairline);
  }
  .rip-toc-mobile .rip-toc-list a {
    display: block;
    padding: 11px 12px;
    font-size: 15px;
    line-height: 1.45;
    color: var(--muted-foreground);
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  }
  .rip-toc-mobile .rip-toc-list li:last-child a { border-bottom: 0; }
  .rip-toc-mobile .rip-toc-list a.is-active { color: var(--foreground); font-weight: 600; }
}

/* One contents list, not two: the sidebar replaces the inline Rank Math TOC
   only on articles where the sidebar actually rendered (has-rip-toc). Both
   block class variants are covered (-toc / -toc-block). */
.article-layout.has-rip-toc :is(.wp-block-rank-math-toc, .wp-block-rank-math-toc-block) { display: none; }

/* Takeaway — practical recap after a major section (writer-applied class) */
.rip-takeaway {
  margin: 8px 0 28px;
  padding: 20px 24px;
  background: var(--secondary);
  border-radius: var(--radius);
}
.rip-takeaway .rip-takeaway-label {
  display: block;
  color: var(--primary);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  margin: 0 0 8px;
}
.rip-takeaway p { margin: 0; font-size: 16.5px; line-height: 1.6; }
.rip-takeaway p + p { margin-top: 10px; }

/* Sources — quiet card for citation lists (writer-applied class) */
.rip-sources {
  border: 1px solid var(--hairline);
  border-radius: var(--radius);
  padding: 8px 24px 16px;
  margin: 8px 0 8px;
}
.rip-sources h2, .rip-sources h3 { margin: 20px 0 10px; }
.rip-sources h3 { font-size: 17px; }
.rip-sources ul, .rip-sources ol { margin: 0; padding-left: 20px; }
.rip-sources li { font-size: 15px; line-height: 1.7; margin: 0 0 10px; }

/* Author card — rendered only when the author profile has a bio */
.rip-author-row { max-width: 700px; margin-top: 48px; }
.rip-author {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  padding: 24px;
  background: var(--secondary);
  border-radius: var(--radius);
}
.rip-author-avatar { width: 52px; height: 52px; border-radius: 50%; flex: none; }
.rip-author-name { margin: 0 0 5px; font-size: 16px; font-weight: 600; }
.rip-author-name a { color: inherit; text-decoration: none; }
.rip-author-name a:hover { color: var(--primary); }
.rip-author-bio { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted-foreground); }

/* Related articles — the binge loop, two cards wide */
.rip-related { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; margin-top: 28px; }
.rip-related .review-card h3 { font-size: 19px; margin: 10px 0 8px; }
.rip-related .review-card .card-body { padding: 20px 22px 22px; }
@media (max-width: 834px) {
  .rip-related { grid-template-columns: 1fr; max-width: 460px; margin-inline: auto; }
  .rip-author { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .rip-toc-list a, .rip-toc-list a::before, .rip-toc-chev { transition: none; }
}
