/* Coffee Informer: Cafe design (DESIGN.md). Tokens first, then layout, listings, post. */

:root {
  --ci-primary: #5D4432;
  --ci-secondary: #E9E3DD;
  --ci-surface: #F9F7F5;
  --ci-text: #3E2B1E;
  --ci-white: #FFFFFF;
  --ci-success: #16A34A;
  --ci-warning: #D97706;
  --ci-danger: #DC2626;
  --ci-font: "Poppins", ui-sans-serif, system-ui, sans-serif;
  --ci-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --ci-radius-sm: 4px;
  --ci-radius-md: 8px;
  --ci-s1: 2px; --ci-s2: 4px; --ci-s3: 8px; --ci-s4: 12px;
  --ci-s5: 16px; --ci-s6: 24px; --ci-s7: 32px; --ci-s8: 48px;
  --ci-container: 1240px;
  --ci-gutter: 40px;
}
@media (max-width: 768px) { :root { --ci-gutter: 16px; } }

/* ---------- Base ---------- */
/* In-page links (table of contents, "jump to" links) glide instead of jumping; off for reduced motion. */
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body { font-family: var(--ci-font); color: var(--ci-text); background: var(--ci-surface); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, .entry-title { text-wrap: balance; color: var(--ci-text); }
:focus-visible { outline: 2px solid var(--ci-primary); outline-offset: 2px; }
::selection { background: var(--ci-secondary); color: var(--ci-text); }
button, .button, input[type="submit"], .wp-block-button__link { border-radius: var(--ci-radius-sm); }
input, textarea, select { border-radius: var(--ci-radius-sm); border-color: var(--ci-secondary); }

/* One shared container: header, content and footer share a left edge. */
.site.grid-container, .inside-header, .inside-site-info, .inside-footer-widgets { max-width: var(--ci-container); margin-left: auto; margin-right: auto; }
.inside-header { padding-left: var(--ci-gutter); padding-right: var(--ci-gutter); }

/* Label: JetBrains Mono, small caps-style. */
.ci-label, .ci-toc__summary, .ci-inline-card__kicker, .ci-topic__count, .ci-listing-head__meta {
  font-family: var(--ci-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase;
}
.ci-label { color: var(--ci-primary); }
.ci-label a { color: inherit; text-decoration: none; }
.ci-label a:hover { text-decoration: underline; }

/* ---------- Header ---------- */
.main-navigation .main-nav ul li a { font-weight: 500; }
@media (max-width: 768px) {
  .inside-header { padding-top: var(--ci-s4); padding-bottom: var(--ci-s4); flex-wrap: nowrap; }
  .site-logo { margin: 0; }
  .site-logo .header-image { width: 168px; height: auto; }
  .has-inline-mobile-toggle .mobile-menu-control-wrapper { margin-left: auto; }
}

/* ---------- Reading progress (scroll-driven CSS, no JS) ---------- */
.ci-progress { display: none; }
@supports (animation-timeline: scroll()) {
  .ci-progress {
    display: block; position: fixed; top: var(--wp-admin--admin-bar--height, 0px); left: 0; right: 0; height: 3px; z-index: 1000;
    background: var(--ci-text); transform-origin: 0 50%; transform: scaleX(0);
    animation: ci-progress linear both; animation-timeline: scroll(root);
  }
  @keyframes ci-progress { to { transform: scaleX(1); } }
}

/* ---------- Listings: home, categories, search ---------- */
.ci-listing .site-content { display: block; }
.ci-listing .content-area { width: 100%; }
.ci-listing .site-main { margin: 0; padding: 0 var(--ci-gutter); }
.ci-listing.separate-containers .site-main > * { margin-bottom: 0; }

.ci-hub, .ci-listing-head { padding: var(--ci-s8) 0 var(--ci-s7); }
.ci-hub__title { font-size: 3rem; line-height: 1.1; font-weight: 700; max-width: 18ch; margin: 0 0 var(--ci-s5); }
.ci-hub__lede { font-size: 1.125rem; line-height: 1.6; max-width: 56ch; margin: 0 0 var(--ci-s6); }
.ci-listing-head__title { font-size: 2.5rem; line-height: 1.15; margin: 0 0 var(--ci-s3); }
.ci-listing-head__meta { color: var(--ci-primary); margin: 0 0 var(--ci-s5); }
.ci-listing-head__desc { max-width: 64ch; margin-bottom: var(--ci-s5); }
.ci-listing-head__desc p:last-child { margin-bottom: 0; }

.ci-btn {
  display: inline-block; padding: var(--ci-s4) var(--ci-s6); border-radius: var(--ci-radius-sm);
  background: var(--ci-primary); color: var(--ci-white); font-weight: 500; text-decoration: none;
  transition: background-color 150ms ease;
}
/* Keep the text white in every link state: GeneratePress's `a:hover, a:focus, a:active` colour
   (dark brown) otherwise wins after a click or tap and leaves dark text on the brown button. */
a.ci-btn, a.ci-btn:visited, a.ci-btn:focus, a.ci-btn:active { color: var(--ci-white); }
a.ci-btn:hover, a.ci-btn:focus-visible, a.ci-btn:active { background: var(--ci-text); color: var(--ci-white); }

.ci-topics { margin-top: var(--ci-s6); }
.ci-topics ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--ci-s3); }
.ci-topics li { margin: 0; }
.ci-topic {
  display: inline-flex; align-items: center; gap: var(--ci-s3); padding: var(--ci-s3) var(--ci-s4);
  border: 1px solid var(--ci-secondary); border-radius: var(--ci-radius-md); background: var(--ci-white);
  color: var(--ci-text); font-size: 0.9375rem; font-weight: 500; text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease;
}
.ci-topic:hover { border-color: var(--ci-primary); color: var(--ci-text); }
.ci-topic[aria-current="page"] { background: var(--ci-primary); border-color: var(--ci-primary); color: var(--ci-white); }
.ci-topic__count { color: var(--ci-primary); letter-spacing: 0; }
.ci-topic[aria-current="page"] .ci-topic__count { color: var(--ci-secondary); }

.ci-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--ci-s6); padding-bottom: var(--ci-s8); }
@media (max-width: 1024px) { .ci-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 640px) { .ci-grid { grid-template-columns: 1fr; gap: var(--ci-s5); } }

.ci-card {
  position: relative; display: flex; flex-direction: column; margin: 0;
  background: var(--ci-white); border: 1px solid var(--ci-secondary); border-radius: var(--ci-radius-md); overflow: hidden;
  transition: border-color 150ms ease;
}
.ci-card:hover { border-color: var(--ci-primary); }
.ci-card:focus-within { outline: 2px solid var(--ci-primary); outline-offset: 2px; }
.ci-card__media { position: relative; aspect-ratio: 3 / 2; overflow: hidden; background: var(--ci-secondary); }
.ci-card__img { position: absolute; inset: 0; display: block; width: 100%; height: 100%; object-fit: cover; }
.ci-card__body { display: flex; flex-direction: column; gap: var(--ci-s3); padding: var(--ci-s5) var(--ci-s6) var(--ci-s6); }
.ci-card__title { font-size: 1.1875rem; line-height: 1.35; font-weight: 600; margin: 0; }
.ci-card__title a { color: var(--ci-text); text-decoration: none; }
.ci-card__title a::after { content: ""; position: absolute; inset: 0; } /* whole card is the link */
.ci-card__title a:focus-visible { outline: none; }
.ci-card:hover .ci-card__title a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ci-card__excerpt { margin: 0; font-size: 0.9375rem; line-height: 1.6; color: var(--ci-primary); }

.ci-card--lead { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); }
.ci-card--lead .ci-card__media { aspect-ratio: auto; min-height: 360px; }
.ci-card--lead .ci-card__body { justify-content: center; padding: var(--ci-s7) var(--ci-s8) var(--ci-s7) var(--ci-s7); gap: var(--ci-s4); }
.ci-card--lead .ci-card__title { font-size: 2rem; line-height: 1.2; }
.ci-card--lead .ci-card__excerpt { font-size: 1rem; }
@media (max-width: 768px) {
  .ci-card--lead { display: flex; }
  .ci-card--lead .ci-card__media { aspect-ratio: 3 / 2; min-height: 0; }
  .ci-card--lead .ci-card__body { padding: var(--ci-s5) var(--ci-s6) var(--ci-s6); }
  .ci-card--lead .ci-card__title { font-size: 1.5rem; }
  .ci-hub, .ci-listing-head { padding: var(--ci-s7) 0 var(--ci-s6); }
  .ci-hub__title { font-size: 2.125rem; }
  .ci-listing-head__title { font-size: 2rem; }
}

.ci-listing .paging-navigation { background: transparent; padding: 0 0 var(--ci-s8); }
.ci-listing .nav-links .page-numbers { display: inline-block; min-width: 40px; padding: var(--ci-s3) var(--ci-s4); border-radius: var(--ci-radius-sm); text-align: center; text-decoration: none; }
.ci-listing .nav-links .page-numbers.current { background: var(--ci-primary); color: var(--ci-white); }

/* ---------- Single post ---------- */
.ci-post.separate-containers .inside-article { border-radius: var(--ci-radius-md); }
.ci-post .entry-header { margin-bottom: var(--ci-s6); }
.ci-post-label { margin-bottom: var(--ci-s4); }
.ci-post .entry-title { max-width: 24ch; margin-bottom: var(--ci-s4); }
.ci-byline { margin: 0; font-size: 0.9375rem; color: var(--ci-primary); }
.ci-byline a { color: var(--ci-text); font-weight: 500; text-decoration: none; }
.ci-byline a:hover { text-decoration: underline; }

.ci-hero { margin: 0 0 var(--ci-s7); }
.ci-hero__img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: var(--ci-radius-md); background: var(--ci-secondary); }

.ci-post .entry-content h2 { margin-top: 2em; scroll-margin-top: var(--ci-s6); }
.ci-post .entry-content h3 { margin-top: 1.6em; scroll-margin-top: var(--ci-s6); }
/* Keep reading box: no heading gap inside it, and a tighter gap above it. */
.ci-post .entry-content .ci-keep { margin-top: var(--ci-s7); }
.ci-post .entry-content .ci-keep__heading { margin-top: 0; }
.ci-post .entry-content a:not(.wp-block-button__link):not(.ci-inline-card__link):not(.ci-keep__link) { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.ci-post .entry-content img { border-radius: var(--ci-radius-md); }
.ci-post .entry-content blockquote { border-left: 0; margin: var(--ci-s7) 0; padding: var(--ci-s5) var(--ci-s6); background: var(--ci-surface); border-radius: var(--ci-radius-md); font-style: normal; }

.ci-toc { margin: var(--ci-s7) 0; padding: var(--ci-s5) var(--ci-s6); background: var(--ci-surface); border: 1px solid var(--ci-secondary); border-radius: var(--ci-radius-md); }
.ci-toc__summary { cursor: pointer; color: var(--ci-text); display: flex; align-items: center; gap: var(--ci-s4); list-style: none; }
.ci-toc__summary::-webkit-details-marker { display: none; }
.ci-toc__summary::after { content: "−"; margin-left: auto; font-size: 1rem; color: var(--ci-primary); }
.ci-toc:not([open]) .ci-toc__summary::after { content: "+"; }
.ci-toc__count { color: var(--ci-primary); text-transform: none; letter-spacing: 0; font-size: 0.75rem; }
.ci-toc__list { margin: var(--ci-s4) 0 0 1.25em; padding: 0; }
.ci-toc__list li { margin: 0 0 var(--ci-s3); padding-left: var(--ci-s2); font-size: 0.9375rem; line-height: 1.45; }
.ci-toc__list li::marker { color: var(--ci-primary); font-family: var(--ci-mono); font-size: 0.8125rem; }
.ci-post .entry-content .ci-toc__list a { color: var(--ci-text); text-decoration: none; }
.ci-post .entry-content .ci-toc__list a:hover { text-decoration: underline; }

.ci-inline-card { margin: var(--ci-s7) 0; }
.ci-inline-card__link {
  display: flex; align-items: center; gap: var(--ci-s5); padding: var(--ci-s4);
  background: var(--ci-secondary); border-radius: var(--ci-radius-md); color: var(--ci-text); text-decoration: none;
}
.ci-inline-card__img { flex: 0 0 auto; width: 80px; height: 80px; object-fit: cover; border-radius: var(--ci-radius-sm); }
.ci-post .entry-content .ci-inline-card__img { border-radius: var(--ci-radius-sm); }
.ci-inline-card__text { display: flex; flex-direction: column; gap: var(--ci-s2); }
.ci-inline-card__kicker { color: var(--ci-primary); }
.ci-inline-card__title { font-weight: 600; line-height: 1.35; }
.ci-inline-card__link:hover .ci-inline-card__title { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Sidebar ---------- */
.sidebar .widget { border-radius: var(--ci-radius-md); padding: var(--ci-s6); }
.sidebar .widget a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.sidebar .widget-title { font-family: var(--ci-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ci-primary); margin-bottom: var(--ci-s5); }

/* Author box: small round photo beside the intro instead of a 300px picture. */
.sidebar .widget .image-hover { float: left; margin: 0 var(--ci-s5) var(--ci-s3) 0; }
.sidebar .widget .image-hover img { display: block; width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.sidebar .sidebar-caption { margin: 0 0 var(--ci-s5); font-size: 0.875rem; line-height: 1.6; }
.sidebar .widget_block input[type="button"] { clear: both; display: block; padding: var(--ci-s3) var(--ci-s5); font-size: 0.875rem; }

/* "More in <category>": compact thumbnail list. */
.rpwwt-widget ul { margin: 0; }
.rpwwt-widget ul li { display: flex; gap: var(--ci-s4); align-items: center; margin: 0 0 var(--ci-s5); }
.rpwwt-widget ul li:last-child { margin-bottom: 0; }
.rpwwt-widget ul li a { display: flex; gap: var(--ci-s4); align-items: center; color: var(--ci-text); text-decoration: none; font-size: 0.9375rem; font-weight: 500; line-height: 1.4; }
.rpwwt-widget ul li a:hover .rpwwt-post-title { text-decoration: underline; }
.rpwwt-widget ul li img { flex: 0 0 auto; width: 75px; height: 75px; margin: 0; object-fit: cover; border-radius: var(--ci-radius-sm); float: none; }
.rpwwt-widget ul li a:not(:has(img))::before { content: ""; flex: 0 0 75px; height: 75px; border-radius: var(--ci-radius-sm); background: var(--ci-secondary); }

/* "On this page": sticky while reading, with the section you are in highlighted. */
.ci-side-toc { padding: var(--ci-s5) var(--ci-s6) var(--ci-s6); }
.ci-side-toc__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--ci-s4); margin: 0 0 var(--ci-s3); }
.ci-side-toc__title { font-family: var(--ci-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ci-text); }
.ci-side-toc__left { font-family: var(--ci-mono); font-size: 0.75rem; color: var(--ci-primary); white-space: nowrap; }
.ci-side-toc__bar { height: 3px; background: var(--ci-secondary); border-radius: 2px; overflow: hidden; margin-bottom: var(--ci-s5); }
.ci-side-toc__bar span { display: block; height: 100%; background: var(--ci-primary); transform-origin: 0 50%; transform: scaleX(0); }
.ci-side-toc__list { position: relative; list-style: none; margin: 0; padding: 0; max-height: calc(100vh - 180px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; }
.ci-side-toc__list li { margin: 0; }
.ci-side-toc__list a {
  display: block; padding: 6px 0 6px var(--ci-s4); border-left: 2px solid var(--ci-secondary);
  font-size: 0.875rem; line-height: 1.4; color: var(--ci-primary); text-decoration: none;
  transition: color 150ms ease, border-color 150ms ease;
}
.ci-side-toc__list a:hover { color: var(--ci-text); }
.ci-side-toc__list a.is-active { color: var(--ci-text); font-weight: 600; border-left-color: var(--ci-primary); }

@media (min-width: 769px) {
  .ci-post #right-sidebar .inside-right-sidebar { height: 100%; }
  .ci-post #right-sidebar .inside-right-sidebar > :last-child { position: sticky; top: var(--ci-s6); }
}

/* Contents box in the article: jump target for the phone button. */
.ci-toc { scroll-margin-top: var(--ci-s5); }
.ci-toc__list a { display: inline-block; padding: 2px 0; }

/* Phone "Contents" button, shown after the reader passes the contents box. */
.ci-toc-fab {
  position: fixed; left: var(--ci-s5); bottom: var(--ci-s5); z-index: 50; /* back-to-top sits bottom right */
  padding: var(--ci-s3) var(--ci-s5); border-radius: var(--ci-radius-md);
  background: var(--ci-text); color: var(--ci-white); font-size: 0.875rem; font-weight: 500; text-decoration: none;
  box-shadow: 0 2px 8px rgb(62 43 30 / 0.25);
}
.ci-toc-fab:hover, .ci-toc-fab:focus-visible { background: var(--ci-primary); color: var(--ci-white); }
.ci-toc-fab[hidden] { display: none; }
@media (min-width: 769px) { .ci-toc-fab { display: none !important; } }
/* Phones: on posts with the Contents button, it replaces back-to-top. */
@media (max-width: 768px) { body:has(.ci-toc-fab) .generate-back-to-top { display: none; } }

/* No page-wide smooth scrolling: it fights GeneratePress's animated back-to-top button. */

/* Comments: visible labels instead of placeholder-only fields. */
.comment-form label.screen-reader-text {
  position: static !important; clip: auto; clip-path: none; width: auto; height: auto; overflow: visible;
  display: block; margin: 0 0 var(--ci-s2); font-size: 0.875rem; font-weight: 500; color: var(--ci-text); word-wrap: normal !important;
}
.separate-containers .comments-area { border-radius: var(--ci-radius-md); }

/* GeneratePress meta (pages, legacy templates) in the label style. */
.cat-links, .tags-links, .comments-link {
  font-family: var(--ci-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ci-primary);
}
.entry-meta a { color: var(--ci-primary); }
.post-navigation, .post-navigation a { font-family: var(--ci-font); font-size: 0.9375rem; letter-spacing: 0; text-transform: none; }
.ci-post footer.entry-meta { margin-top: var(--ci-s6); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}

/* ---------- Top picks hub: page content built from .ci-picks lists ---------- */
.entry-content:has(.ci-picks) > * { max-width: 72ch; }
.entry-content ul.ci-picks { list-style: none; margin: 0 0 var(--ci-s7); padding: 0; border-top: 1px solid var(--ci-secondary); }
.entry-content ul.ci-picks li {
  position: relative; margin: 0; padding: var(--ci-s4) 0; border-bottom: 1px solid var(--ci-secondary);
  font-size: 0.9375rem; line-height: 1.5; color: var(--ci-primary);
}
.entry-content ul.ci-picks li a { font-size: 1.0625rem; font-weight: 600; color: var(--ci-text); text-decoration: none; }
.entry-content ul.ci-picks li a::after { content: ""; position: absolute; inset: 0; } /* whole row is the link */
.entry-content ul.ci-picks li:hover a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.entry-content ul.ci-picks li a:focus-visible { outline: none; }
.entry-content ul.ci-picks li:focus-within { outline: 2px solid var(--ci-primary); outline-offset: 2px; border-radius: var(--ci-radius-sm); }
.entry-content .ci-picks + .wp-block-heading { margin-top: var(--ci-s8); }

/* ---------- Page speed: skip rendering below-the-fold blocks until they scroll near ---------- */
.ci-keep, .comments-area, .ci-footer, .site-footer { content-visibility: auto; contain-intrinsic-size: auto 600px; }
.ci-keep { contain-intrinsic-size: auto 1400px; }
.ci-grid > .ci-card:nth-child(n+5) { content-visibility: auto; contain-intrinsic-size: auto 520px; }
@media (max-width: 768px) {
  .ci-post #right-sidebar { content-visibility: auto; contain-intrinsic-size: auto 1200px; }
}

/* ---------- Amazon call-to-action (replaces the old image buttons) ----------
   Amazon's own button yellow so readers recognise it as "buy here"; dark text for contrast. */
.ci-amz-cta { margin: var(--ci-s5) 0 var(--ci-s6); text-align: center; }
.entry-content a.ci-amz-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--ci-s3);
  width: min(100%, 320px); min-height: 48px; padding: var(--ci-s4) var(--ci-s6);
  background: #FFD814; border: 1px solid #FCD200; border-radius: 999px;
  color: #0F1111; font-size: 1rem; font-weight: 600; line-height: 1.2; text-decoration: none;
  box-shadow: 0 1px 2px rgba(15, 17, 17, 0.15);
  transition: background-color 150ms ease, border-color 150ms ease;
}
.entry-content a.ci-amz-btn::after { content: "\2192" / ""; transition: transform 150ms ease; }
.entry-content a.ci-amz-btn:hover, .entry-content a.ci-amz-btn:focus-visible { background: #F7CA00; border-color: #F2C200; color: #0F1111; }
.entry-content a.ci-amz-btn:hover::after { transform: translateX(3px); }
.entry-content td a.ci-amz-btn { width: auto; min-height: 40px; padding: var(--ci-s3) var(--ci-s4); font-size: 0.875rem; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) { .entry-content a.ci-amz-btn::after { transition: none; } }

/* ---------- Tables: fit phones (inc/tables.php labels cells, ci-post.js stacks wide ones) ---------- */
.entry-content .wp-block-table { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.entry-content table { font-size: 0.9375rem; line-height: 1.5; }
.entry-content table th, .entry-content table td { overflow-wrap: break-word; vertical-align: top; }
@media (max-width: 640px) {
  .entry-content table { font-size: 0.875rem; }
  .entry-content table th, .entry-content table td { padding: var(--ci-s3); }

  /* Wide tables become one card per row. */
  .entry-content table.is-stacked,
  .entry-content table.is-stacked tbody,
  .entry-content table.is-stacked tr,
  .entry-content table.is-stacked td,
  .entry-content table.is-stacked th { display: block; width: auto; }
  .entry-content table.is-stacked { border: 0; background: none; font-size: 0.9375rem; }
  .entry-content table.is-stacked thead,
  .entry-content table.is-stacked tr.ci-head-row { display: none; }
  .entry-content .wp-block-table:has(> .is-stacked) { overflow: visible; border: 0; }
  .entry-content table.is-stacked tr {
    margin: 0 0 var(--ci-s4); padding: var(--ci-s3) var(--ci-s5);
    background: var(--ci-white); border: 1px solid var(--ci-secondary); border-radius: var(--ci-radius-md);
  }
  .entry-content .is-style-stripes table.is-stacked tbody tr:nth-child(odd) { background: var(--ci-white); }
  .entry-content table.is-stacked td,
  .entry-content table.is-stacked th {
    display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: var(--ci-s4);
    padding: var(--ci-s3) 0; border: 0; border-top: 1px solid var(--ci-secondary); text-align: left;
  }
  .entry-content table.is-stacked td::before,
  .entry-content table.is-stacked th::before {
    content: attr(data-label); font-family: var(--ci-mono); font-size: 0.75rem; font-weight: 500;
    letter-spacing: 0.06em; text-transform: uppercase; color: var(--ci-primary); padding-top: 0.15em;
  }
  .entry-content table.is-stacked [data-label=""] { display: block; }
  .entry-content table.ci-table--long.is-stacked td,
  .entry-content table.ci-table--long.is-stacked th { grid-template-columns: minmax(0, 1fr); gap: var(--ci-s1); }
  .entry-content table.is-stacked [data-label=""]::before { content: none; }
  .entry-content table.is-stacked td:empty { display: none; }
  .entry-content table.is-stacked tr > :first-child { border-top: 0; }

  /* First cell is the card title (unless the table has a single row of values). */
  .entry-content table.is-stacked:not(.ci-table--one) tr > :first-child {
    display: block; padding: var(--ci-s2) 0 var(--ci-s3); font-size: 1.0625rem; font-weight: 600; line-height: 1.35; color: var(--ci-text);
  }
  .entry-content table.is-stacked:not(.ci-table--one) tr > :first-child::before { content: none; }

  /* Ranked lists: the number sits as a badge beside the title. */
  .entry-content table.is-stacked.ci-table--ranked tr { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--ci-s4); }
  .entry-content table.is-stacked.ci-table--ranked tr > * { grid-column: 1 / -1; }
  .entry-content table.is-stacked.ci-table--ranked tr > :first-child {
    grid-column: 1; align-self: center; justify-self: start; display: grid; grid-template-columns: 1fr; place-items: center; width: 2rem; height: 2rem; padding: 0;
    border-radius: 999px; background: var(--ci-secondary); font-family: var(--ci-mono); font-size: 0.875rem; font-weight: 500;
  }
  .entry-content table.is-stacked.ci-table--ranked tr > :nth-child(2) {
    grid-column: 2; display: block; align-self: center; padding: var(--ci-s2) 0; border-top: 0;
    font-size: 1.0625rem; font-weight: 600; line-height: 1.35;
  }
  .entry-content table.is-stacked.ci-table--ranked tr > :nth-child(2)::before { content: none; }
  .entry-content table.is-stacked.ci-table--ranked tr > :nth-child(3) { border-top: 1px solid var(--ci-secondary); margin-top: var(--ci-s3); }
}

/* ---------- Sale alerts signup (inc/alerts.php) ---------- */
.ci-alerts { margin: var(--ci-s7) 0; padding: var(--ci-s6); background: var(--ci-secondary); border-radius: var(--ci-radius-md); color: var(--ci-text); }
.ci-alerts__kicker { margin: 0 0 var(--ci-s3); font-family: var(--ci-mono); font-size: 0.75rem; font-weight: 500; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ci-primary); }
.ci-alerts__heading, .ci-post .entry-content .ci-alerts__heading { margin: 0 0 var(--ci-s3); font-size: 1.375rem; line-height: 1.25; font-weight: 700; }
.ci-alerts__lede { margin: 0 0 var(--ci-s5); font-size: 0.9375rem; line-height: 1.6; max-width: 60ch; }
.ci-alerts__form { margin: 0; }
.ci-alerts__label { display: block; margin: 0 0 var(--ci-s2); font-size: 0.8125rem; font-weight: 500; }
.ci-alerts__row { display: flex; gap: var(--ci-s3); }
.ci-alerts__input {
  flex: 1 1 auto; min-width: 0; min-height: 48px; padding: 0 var(--ci-s5); font: inherit; font-size: 1rem;
  background: var(--ci-white); color: var(--ci-text); border: 1px solid #CDBFB3; border-radius: var(--ci-radius-sm);
}
.ci-alerts__input:focus-visible { outline: 2px solid var(--ci-primary); outline-offset: 1px; border-color: var(--ci-primary); }
.ci-alerts__btn {
  flex: 0 0 auto; min-height: 48px; padding: 0 var(--ci-s6); font: inherit; font-weight: 600; font-size: 1rem;
  background: var(--ci-primary); color: var(--ci-white); border: 0; border-radius: var(--ci-radius-sm); cursor: pointer;
  transition: background-color 150ms ease;
}
.ci-alerts__btn:hover { background: var(--ci-text); }
.ci-alerts__btn:active { transform: translateY(1px); }
.ci-alerts__btn:disabled { opacity: 0.7; cursor: progress; }
.ci-alerts__fine { margin: var(--ci-s3) 0 0; font-size: 0.8125rem; line-height: 1.5; color: var(--ci-primary); }
.ci-alerts__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.ci-alerts__status { margin: 0; padding: var(--ci-s4) var(--ci-s5); background: var(--ci-white); border-left: 3px solid var(--ci-success); border-radius: var(--ci-radius-sm); font-weight: 500; line-height: 1.5; }
.ci-alerts__status.is-error { border-left-color: var(--ci-danger); margin-top: var(--ci-s4); }
@media (max-width: 560px) {
  .ci-alerts { padding: var(--ci-s5); }
  .ci-alerts__row { flex-direction: column; }
  .ci-alerts__btn { width: 100%; }
}

/* Sidebar: stacked, desktop only (on phones the end-of-post box already shows). */
.sidebar .widget.ci-alerts-widget { padding: 0; background: transparent; }
.ci-alerts--side { margin: 0; padding: var(--ci-s6); }
.ci-alerts--side .ci-alerts__heading { font-size: 1.125rem; }
.ci-alerts--side .ci-alerts__lede { font-size: 0.875rem; }
.ci-alerts--side .ci-alerts__row { flex-direction: column; }
.ci-alerts--side .ci-alerts__btn { width: 100%; }
@media (max-width: 768px) { .ci-alerts-widget { display: none; } }

/* Home, category and search pages: band above the footer. */
.ci-alerts-band { padding: var(--ci-s8) var(--ci-gutter) 0; }
.ci-alerts-band__inner { max-width: var(--ci-container); margin: 0 auto; }
.ci-alerts--band { margin: 0; padding: var(--ci-s7); }
@media (max-width: 560px) { .ci-alerts--band { padding: var(--ci-s5); } }

/* ---------- Share bar + Google preferred source (inc/share.php) ---------- */
.ci-share { margin: var(--ci-s7) 0; padding-top: var(--ci-s6); border-top: 1px solid var(--ci-secondary); }
.ci-share__heading, .ci-post .entry-content .ci-share__heading {
  margin: 0 0 var(--ci-s4); font-family: var(--ci-mono); font-size: 0.75rem; font-weight: 500;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--ci-primary);
}
.ci-share__list, .ci-post .entry-content .ci-share__list { display: flex; flex-wrap: wrap; gap: var(--ci-s3); margin: 0; padding: 0; list-style: none; }
.ci-share__list li { margin: 0; }
.ci-share__btn, .ci-post .entry-content .ci-share__btn {
  display: inline-flex; align-items: center; gap: var(--ci-s3); min-height: 44px; padding: 0 var(--ci-s5);
  font: inherit; font-size: 0.875rem; font-weight: 500; line-height: 1; color: var(--ci-text); text-decoration: none;
  background: var(--ci-white); border: 1px solid #DCD2C8; border-radius: 999px; cursor: pointer;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease;
}
.ci-share__btn:hover { background: var(--ci-secondary); border-color: var(--ci-primary); color: var(--ci-text); }
.ci-share__btn:active { transform: translateY(1px); }
.ci-share__btn.is-done { border-color: var(--ci-success); color: var(--ci-success); }
.ci-share__icon { flex: 0 0 auto; width: 18px; height: 18px; }
.ci-share__btn--pinterest .ci-share__icon { color: #BD081C; }
.ci-share__btn--facebook .ci-share__icon { color: #0866FF; }
.ci-share__btn--reddit .ci-share__icon { color: #FF4500; }
.ci-share__btn--whatsapp .ci-share__icon { color: #128C4B; }

.ci-pref {
  display: flex; align-items: center; justify-content: space-between; gap: var(--ci-s5); flex-wrap: wrap;
  margin-top: var(--ci-s6); padding: var(--ci-s5) var(--ci-s6); background: var(--ci-white);
  border: 1px solid var(--ci-secondary); border-radius: var(--ci-radius-md);
}
.ci-pref__text, .ci-post .entry-content .ci-pref__text { flex: 1 1 280px; margin: 0; font-size: 0.9375rem; line-height: 1.55; }
.ci-pref__btn, .ci-post .entry-content .ci-pref__btn {
  display: inline-flex; align-items: center; gap: var(--ci-s3); min-height: 48px; padding: 0 var(--ci-s5);
  font-size: 0.9375rem; font-weight: 600; color: var(--ci-text); text-decoration: none; white-space: nowrap;
  background: var(--ci-white); border: 1px solid #CDBFB3; border-radius: 999px;
  transition: background-color 150ms ease, border-color 150ms ease;
}
.ci-pref__btn:hover { background: var(--ci-surface); border-color: var(--ci-primary); color: var(--ci-text); }
.ci-pref__icon { flex: 0 0 auto; width: 20px; height: 20px; color: #4285F4; }
@media (max-width: 560px) {
  .ci-share__btn, .ci-post .entry-content .ci-share__btn { padding: 0 var(--ci-s4); }
  .ci-pref { padding: var(--ci-s5); }
  .ci-pref__btn, .ci-post .entry-content .ci-pref__btn {
    width: 100%; justify-content: center; padding: var(--ci-s3) var(--ci-s5); white-space: normal; text-align: center; line-height: 1.3;
  }
}

/* Sale alerts slide-in on posts (inc/alerts.php, ci-alerts.js). A corner card, not a page cover. */
.ci-alerts-pop {
  position: fixed; z-index: 1000; right: var(--ci-s6); bottom: var(--ci-s6); width: min(380px, calc(100vw - 2 * var(--ci-s6)));
  isolation: isolate; border-radius: var(--ci-radius-md); background: var(--ci-secondary);
  box-shadow: 0 1px 2px rgba(62, 43, 30, 0.08), 0 12px 32px rgba(62, 43, 30, 0.18);
  opacity: 0; transform: translateY(16px); transition: opacity 200ms ease, transform 200ms ease;
}
.ci-alerts-pop[hidden] { display: none; }
.ci-alerts-pop.is-open { opacity: 1; transform: none; }
.ci-alerts-pop .ci-alerts { margin: 0; padding: var(--ci-s6); padding-right: var(--ci-s8); background: transparent; }
.ci-alerts-pop .ci-alerts__heading { font-size: 1.125rem; }
.ci-alerts-pop .ci-alerts__lede { font-size: 0.875rem; margin-bottom: var(--ci-s4); }
.ci-alerts-pop .ci-alerts__row { flex-direction: column; }
.ci-alerts-pop .ci-alerts__btn { width: 100%; }
.ci-alerts-pop__close {
  position: absolute; top: var(--ci-s3); right: var(--ci-s3); z-index: 1; display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0; background: transparent; color: var(--ci-primary); border: 0; border-radius: 50%; cursor: pointer;
  transition: background-color 150ms ease, color 150ms ease;
}
.ci-alerts-pop__close:hover { background: rgba(93, 68, 50, 0.1); color: var(--ci-text); }
@media (max-width: 560px) {
  .ci-alerts-pop { right: 0; bottom: 0; left: 0; width: auto; border-radius: var(--ci-radius-md) var(--ci-radius-md) 0 0; }
  .ci-alerts-pop .ci-alerts { padding: var(--ci-s5); padding-right: var(--ci-s8); }
  .ci-alerts-pop .ci-alerts__lede { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ci-alerts-pop { transition: none; transform: none; } }

/* Comment form: MailPoet's "add me to your mailing list" box (ticked by default in inc/alerts.php). */
.comment-form .comment-form-mailpoet { margin: var(--ci-s4) 0 var(--ci-s5); }
.comment-form .comment-form-mailpoet label {
  display: inline-flex; align-items: center; gap: var(--ci-s4); min-height: 44px; margin: 0;
  font-size: 0.9375rem; font-weight: 500; line-height: 1.4; color: var(--ci-text); cursor: pointer;
}
.comment-form .comment-form-mailpoet input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; flex: 0 0 auto; display: grid; place-content: center;
  width: 22px; height: 22px; margin: 0; background: var(--ci-white); border: 1.5px solid #CDBFB3; border-radius: var(--ci-radius-sm);
  cursor: pointer; transition: background-color 150ms ease, border-color 150ms ease;
}
.comment-form .comment-form-mailpoet input[type="checkbox"]::before {
  content: ""; width: 12px; height: 12px; background: var(--ci-white);
  clip-path: polygon(14% 52%, 0 66%, 38% 100%, 100% 22%, 86% 8%, 37% 70%); transform: scale(0); transition: transform 120ms ease;
}
.comment-form .comment-form-mailpoet input[type="checkbox"]:checked { background: var(--ci-primary); border-color: var(--ci-primary); }
.comment-form .comment-form-mailpoet input[type="checkbox"]:checked::before { transform: scale(1); }
.comment-form .comment-form-mailpoet input[type="checkbox"]:hover { border-color: var(--ci-primary); }
.comment-form .comment-form-mailpoet input[type="checkbox"]:focus-visible { outline: 2px solid var(--ci-primary); outline-offset: 2px; }
