/* ============================================================
   everythingreps — Blog (index + single) + in-post product blocks
   Loaded only on blog pages, or on any post/page that uses
   [er_products] (see inc/blog.php). Tokens from tokens.css;
   product cards themselves come from pages.css.
   ============================================================ */

/* ---------- shared shell ---------- */
.er-blog, .er-post { background: hsl(var(--paper)); color: hsl(var(--ink)); }
.er-blog__w, .er-post__w { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 clamp(20px,4vw,56px); box-sizing: border-box; }

/* ============================================================
   1. Index — one grid, image over text
   ============================================================ */
.er-blog { padding: clamp(40px,6vw,86px) 0 clamp(72px,9vw,132px); }
.jr-mast { padding-bottom: clamp(48px,6vw,80px); }
.jr-mast h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.6rem,5.4vw,4rem); line-height: 1; letter-spacing: -0.045em; margin: 0; }
.jr-mast p { margin: 18px 0 0; font-size: 0.9375rem; line-height: 1.6; color: hsl(var(--muted-foreground)); max-width: 60ch; }

.jr-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); column-gap: clamp(24px,3vw,44px); row-gap: clamp(44px,5vw,72px); }
.jr-c__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: hsl(var(--surface-muted)); }
.jr-c__media img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 900ms var(--ease-out-quart); }
.jr-c__media:hover img { transform: scale(1.035); }
.jr-c__date { display: block; margin: 20px 0 0; font-size: 0.8125rem; color: hsl(var(--muted-foreground) / 0.9); }
.jr-c h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.3rem; line-height: 1.3; letter-spacing: -0.025em; margin: 9px 0 0; }
.jr-c h2 a { color: inherit; text-decoration: none; }
.jr-c h2 a:hover { text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.jr-c__ex { margin: 9px 0 0; font-size: 0.9375rem; line-height: 1.6; color: hsl(var(--muted-foreground)); text-wrap: pretty; }
.jr-more { display: inline-flex; align-items: center; gap: 9px; margin-top: 18px; font-size: 0.875rem; color: hsl(var(--ink) / 0.8); text-decoration: none; }
.jr-more svg { width: 17px; height: 17px; flex: none; transition: transform var(--duration-base) var(--ease-out-quart); }
.jr-more:hover { color: hsl(var(--ink)); }
.jr-more:hover svg { transform: translateX(5px); }

.jr-nav { display: flex; justify-content: space-between; gap: 16px; margin-top: clamp(56px,6vw,84px); padding-top: 24px; border-top: 1px solid hsl(var(--line) / 0.8); font-size: 0.9375rem; }
.jr-nav a { color: hsl(var(--ink)); text-decoration: none; }
.jr-nav a:hover { opacity: 0.65; }

/* ============================================================
   2. Single post
   ============================================================ */
.er-post { padding: clamp(26px,3.4vw,48px) 0 clamp(72px,9vw,120px); }
.ar-mast, .ar-toc, .ar-more, .ar-help { max-width: 672px; margin-left: auto; margin-right: auto; }
.ar-hero { max-width: 672px; margin: clamp(28px,3.4vw,40px) auto 0; }
.ar-hero img { display: block; width: 100%; height: auto; }

.ar-back { display: inline-flex; align-items: center; gap: 8px; font-size: 0.875rem; color: hsl(var(--muted-foreground)); text-decoration: none; }
.ar-back svg { width: 15px; height: 15px; transform: rotate(180deg); }
.ar-back:hover { color: hsl(var(--ink)); }
.ar-mast h1 { font-family: var(--font-display); font-weight: 600; font-size: clamp(2rem,4vw,2.95rem); line-height: 1.06; letter-spacing: -0.035em; margin: 22px 0 0; text-wrap: balance; }
.ar-meta { display: flex; align-items: center; gap: 10px; margin: 18px 0 0; font-size: 0.875rem; color: hsl(var(--muted-foreground)); }
.ar-meta i { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.55; }

/* contents */
.ar-toc { margin: clamp(32px,4vw,44px) auto clamp(36px,4.4vw,52px); padding: 20px 0; border-top: 1px solid hsl(var(--line) / 0.8); border-bottom: 1px solid hsl(var(--line) / 0.8); }
.ar-toc > summary { display: flex; align-items: center; justify-content: space-between; cursor: pointer; list-style: none; font-size: 0.9375rem; font-weight: 600; color: hsl(var(--ink)); }
.ar-toc > summary::-webkit-details-marker { display: none; }
.ar-toc > summary svg { width: 17px; height: 17px; color: hsl(var(--muted-foreground)); transition: transform var(--duration-base) var(--ease-out-quart); }
.ar-toc[open] > summary svg { transform: rotate(180deg); }
.ar-toc ol { columns: 2; column-gap: 44px; margin: 18px 0 0; padding: 0; list-style: none; counter-reset: t; }
.ar-toc li { counter-increment: t; break-inside: avoid; margin: 0 0 10px; }
.ar-toc a { display: flex; gap: 11px; font-size: 0.9375rem; line-height: 1.5; color: hsl(var(--ink) / 0.82); text-decoration: none; }
.ar-toc a::before { content: counter(t,decimal-leading-zero); font-size: 0.75rem; line-height: 1.7; color: hsl(var(--muted-foreground) / 0.8); font-variant-numeric: tabular-nums; }
.ar-toc a:hover { color: hsl(var(--ink)); text-decoration: underline; text-underline-offset: 3px; }

/* prose — the editor's own markup, one 672px measure, wide blocks break out */
.ar-prose { display: grid; grid-template-columns: 1fr min(672px,100%) 1fr; }
.ar-prose > * { grid-column: 2; min-width: 0; }
.ar-prose > .pb--grid, .ar-prose > .pb--strip, .ar-prose > .alignwide, .ar-prose > .alignfull { grid-column: 1 / -1; }
.ar-prose > p { font-size: 1.0625rem; line-height: 1.75; margin: 0 0 22px; text-wrap: pretty; }
.ar-prose > p:first-of-type { font-size: clamp(1.125rem,1.5vw,1.25rem); line-height: 1.6; letter-spacing: -0.012em; margin-bottom: 24px; }
.ar-prose h2 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.375rem,1.9vw,1.6rem); line-height: 1.25; letter-spacing: -0.028em; margin: clamp(46px,5vw,64px) 0 20px; scroll-margin-top: calc(var(--topbar-h) + 92px); }
.ar-prose h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.0625rem; line-height: 1.4; letter-spacing: -0.018em; margin: 30px 0 0; }
.ar-prose h3 + p { margin-top: 9px; color: hsl(var(--muted-foreground)); }
.ar-prose strong, .ar-prose b { font-weight: 600; }
.ar-prose a { color: hsl(var(--ink)); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; text-decoration-color: hsl(var(--ink) / 0.34); }
.ar-prose a:hover { text-decoration-color: hsl(var(--ink)); }
.ar-prose ul, .ar-prose ol { margin: 0 0 24px; padding: 0 0 0 2px; list-style: none; display: grid; gap: 13px; }
.ar-prose li { position: relative; padding-left: 22px; font-size: 1.0625rem; line-height: 1.65; text-wrap: pretty; }
.ar-prose ul > li::before { content: ""; position: absolute; left: 0; top: 0.85em; width: 9px; height: 1px; background: hsl(var(--ink) / 0.42); }
.ar-prose ol { counter-reset: n; }
.ar-prose ol > li { counter-increment: n; }
.ar-prose ol > li::before { content: counter(n) "."; position: absolute; left: 0; top: 0; font-size: 0.9375rem; color: hsl(var(--muted-foreground)); font-variant-numeric: tabular-nums; }
.ar-prose figure { margin: clamp(30px,3.6vw,42px) 0; }
.ar-prose figure img, .ar-prose > img { display: block; width: 100%; height: auto; }
.ar-prose figcaption { margin: 11px 0 0; font-size: 0.8125rem; line-height: 1.5; color: hsl(var(--muted-foreground)); }
.ar-prose blockquote { margin: clamp(28px,3.2vw,38px) 0; padding: 0 0 0 20px; border-left: 1px solid hsl(var(--ink) / 0.3); }
.ar-prose blockquote p { font-size: 1.125rem; line-height: 1.6; margin: 0; }
.ar-prose hr { margin: clamp(34px,4vw,46px) 0; border: 0; border-top: 1px solid hsl(var(--line) / 0.8); }
.ar-prose table { width: 100%; border-collapse: collapse; margin: 0 0 24px; font-size: 0.9375rem; }
.ar-prose th, .ar-prose td { text-align: left; padding: 11px 12px 11px 0; border-bottom: 1px solid hsl(var(--line) / 0.8); }
.ar-prose th { font-weight: 600; }

/* end of post */
.ar-help { margin: clamp(40px,4.6vw,56px) auto 0; padding: 22px 0 0; border-top: 1px solid hsl(var(--line) / 0.8); font-size: 1rem; line-height: 1.7; color: hsl(var(--muted-foreground)); }
.ar-more { margin: clamp(48px,5vw,68px) auto 0; }
.ar-more h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; letter-spacing: -0.02em; margin: 0 0 4px; }
.ar-more ul { margin: 0; padding: 0; list-style: none; }
.ar-more li { border-bottom: 1px solid hsl(var(--line) / 0.7); }
.ar-more a { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 17px 0; color: hsl(var(--ink)); text-decoration: none; font-size: 1.0625rem; line-height: 1.4; }
.ar-more a:hover { color: hsl(var(--ink) / 0.6); }
.ar-more time { flex: none; font-size: 0.8125rem; color: hsl(var(--muted-foreground)); }

/* ============================================================
   3. Product blocks — [er_products]
   ============================================================ */
.pb { margin: clamp(40px,4.6vw,60px) 0; }
.pb__head { display: flex; align-items: baseline; justify-content: space-between; gap: 18px; margin: 0 0 22px; }
.pb__head h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.028em; margin: 0; }
.pb__head p { margin: 7px 0 0; font-size: 0.9375rem; line-height: 1.55; color: hsl(var(--muted-foreground)); }
.pb__all { flex: none; display: inline-flex; align-items: center; gap: 8px; font-size: 0.9375rem; color: hsl(var(--ink)); text-decoration: none; }
.pb__all svg { width: 16px; height: 16px; transition: transform var(--duration-base) var(--ease-out-quart); }
.pb__all:hover svg { transform: translateX(4px); }

.pb--grid { padding: clamp(28px,3.2vw,38px) 0; border-top: 1px solid hsl(var(--line) / 0.8); border-bottom: 1px solid hsl(var(--line) / 0.8); }
.pb--row .prod-grid { grid-template-columns: 1fr 1fr; gap: 20px; }
.pb--row .pb__head h2, .pb--strip .pb__head h2 { font-size: 1.125rem; }
.pb--row .prod__name { font-size: 1.0625rem; }

.pb--strip .pb__scroll { display: flex; gap: 18px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding: 2px 0; scrollbar-width: none; -ms-overflow-style: none; }
.pb--strip .pb__scroll::-webkit-scrollbar { display: none; }
.pb--strip .card { flex: 0 0 clamp(210px,24%,258px); scroll-snap-align: start; }

.pb--inline { margin: clamp(28px,3.4vw,40px) 0; }
.pb--inline .pb__head { margin: 0 0 14px; }
.pb-in { display: grid; grid-template-columns: 132px minmax(0,1fr) auto; align-items: center; gap: 20px; padding: 14px 18px 14px 14px; background: hsl(var(--card)); border: 1px solid hsl(var(--line) / 0.74); border-radius: var(--radius-lg); box-shadow: var(--shadow-glass); transition: box-shadow var(--duration-base) var(--ease-out-quart), border-color var(--duration-base) var(--ease-out-quart); }
.pb-in:hover { box-shadow: var(--shadow-glass-hover); border-color: hsl(var(--ink) / 0.2); }
.pb-in__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; border-radius: var(--radius-sm); background: hsl(var(--surface-muted)); }
.pb-in__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pb-in__name { font-family: var(--font-display); font-weight: 600; font-size: 1.125rem; line-height: 1.3; letter-spacing: -0.022em; margin: 3px 0 0; }
.pb-in__name a { color: inherit; text-decoration: none; }
.pb-in__name a:hover { opacity: 0.7; }
.pb-in__stock { display: inline-flex; align-items: center; gap: 8px; margin: 8px 0 0; font-size: 0.8125rem; font-weight: 500; color: hsl(var(--muted-foreground)); }
.pb-in__buy { display: flex; align-items: center; gap: 16px; }
.pb-in__price { font-family: var(--font-display); font-weight: 700; font-size: 1.25rem; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.pb-in__price .woocommerce-Price-amount { font-size: inherit; }
.pb-in__price del { display: none; }

/* ============================================================
   4. Responsive
   ============================================================ */
@media (max-width: 940px) { .jr-grid { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 720px) {
  .ar-toc ol { columns: 1; }
  .pb__head { flex-direction: column; align-items: flex-start; gap: 12px; }
}
@media (max-width: 600px) { .jr-grid { grid-template-columns: 1fr; } .jr-mast p { max-width: 34ch; } }
@media (max-width: 560px) {
  .pb--grid .prod-grid, .pb--row .prod-grid { grid-template-columns: 1fr 1fr; gap: 14px; }
  .pb .prod__rate, .pb .usa-ship { display: none; }
  .pb--strip .card { flex: 0 0 62%; }
  .pb-in { grid-template-columns: 96px minmax(0,1fr); gap: 14px; padding: 12px; }
  .pb-in__buy { grid-column: 1 / -1; justify-content: space-between; padding-top: 4px; }
  .pb-in__buy .add-btn { flex: 1; justify-content: center; max-width: 180px; }
  .ar-more a { flex-direction: column; gap: 5px; }
}
