/* CutPlan — Blog Stylesheet
   Light theme matching v5 marketing site */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --accent: #007F5F;
  --accent-hover: #007A58;
  --accent-dark: #141920;
  --accent-bg: rgba(0,168,120,0.06);
  --accent-bg-badge: rgba(0,168,120,0.15);
  --bg-base: #F6F4EF;
  --bg-alt: #EDEAE3;
  --card: #FFFFFF;
  --card-border: rgba(0,0,0,0.08);
  --text-primary: #141920;
  --text-secondary: #555F6D;
  --text-dim: #5C6672;
  --text-light: #2D3440;
  --max-w: 760px;
  --font-display: 'Syne', sans-serif;
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', 'SF Mono', 'Fira Code', Consolas, monospace;
  /* Nav/footer stay dark */
  --nav-bg: #1A1F2E;
  --nav-border: rgba(255,255,255,0.06);
  --nav-text: #FFFFFF;
  --nav-text-dim: rgba(255,255,255,0.55);
  --footer-bg: #141920;
  --footer-border: rgba(255,255,255,0.06);
  --footer-text: rgba(255,255,255,0.5);
}

html { font-size: 16px; scroll-behavior: smooth; }
/* Script-native companions: Syne/Outfit carry no Hebrew/Arabic glyphs, so
   these locales otherwise mix system-font headings with Latin display type */
html[lang="he"] { --font-display: 'Heebo', sans-serif; --font-sans: 'Heebo', -apple-system, sans-serif; }
html[lang="ar"] { --font-display: 'Rubik', sans-serif; --font-sans: 'Rubik', -apple-system, sans-serif; }
html[lang="fa"] { --font-display: 'Vazirmatn', sans-serif; --font-sans: 'Vazirmatn', -apple-system, sans-serif; }
body {
  font-family: var(--font-sans);
  color: var(--text-secondary);
  background: var(--bg-base);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* ── SKIP LINK ── */
.blog-skip-link {
  position: absolute;
  top: -100%;
  left: 0;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.875rem;
  z-index: 200;
  text-decoration: none;
  border-radius: 0 0 8px 0;
}
.blog-skip-link:focus {
  top: 0;
}

/* ── NAV (always dark) ── */
.blog-nav {
  background: var(--nav-bg);
  border-bottom: 1px solid var(--nav-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.blog-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.blog-nav-logo {
  font-family: var(--font-sans);
  font-weight: 800;
  font-size: 1.125rem;
  color: var(--nav-text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  letter-spacing: -0.01em;
}
.blog-nav-logo span { color: var(--nav-text-dim); font-weight: 400; font-size: 0.875rem; }
.blog-nav-cta {
  background: var(--accent);
  color: #fff;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s;
}
.blog-nav-cta:hover { background: var(--accent-hover); }

/* ── BREADCRUMB ── */
.blog-breadcrumb {
  max-width: var(--max-w);
  margin: 1.25rem auto 0;
  padding: 0 1.5rem;
  font-size: 0.8125rem;
  color: var(--text-dim);
}
.blog-breadcrumb a { color: var(--text-dim); text-decoration: none; }
.blog-breadcrumb a:hover { color: var(--accent); }

/* ── ARTICLE HEADER ── */
.blog-article {
  /* 680px caps the measure at ~72ch of 17px Outfit (comfort band 66-75);
     index/nav keep the wider --max-w */
  max-width: 680px;
  margin: 0 auto;
  padding: 2rem 1.5rem 4rem;
}
/* Single category label — the one badge the design keeps. White ground +
   accent text passes AA (5.0:1); no mono/uppercase costume. */
.blog-tag {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--accent);
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 9999px;
  padding: 0.2rem 0.75rem;
  margin-bottom: 1rem;
}
.blog-article h1 {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 4vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  color: var(--text-primary);
  margin-bottom: 1rem;
  letter-spacing: -0.03em;
}
.blog-meta {
  font-size: 0.875rem;
  color: var(--text-dim);
  margin-bottom: 1.75rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.blog-meta strong { color: var(--text-secondary); }

/* ── ARTICLE BODY ── */
/* break-word: long unhyphenated compounds (de "Zuschnittoptimierer", nl, hu)
   in headings otherwise widen the scroll area and drag the page sideways on
   mobile; clip is insurance so no single element can ever do that again */
.blog-article { overflow-x: clip; }
.blog-article h1, .blog-body h2, .blog-body h3 { overflow-wrap: break-word; }
.blog-body { font-size: 1.0625rem; }
.blog-body p { margin-bottom: 1.25rem; }
.blog-body h2 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 2.25rem 0 0.875rem;
  padding-top: 0.25rem;
  border-top: 1px solid var(--card-border);
}
.blog-body h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-light);
  margin: 1.5rem 0 0.5rem;
}
.blog-body ul, .blog-body ol {
  margin: 0.75rem 0 1.25rem 1.5rem;
}
.blog-body li { margin-bottom: 0.4rem; }
.blog-body strong { color: var(--text-light); }
.blog-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.blog-body a:hover { color: var(--accent-hover); }

/* Table */
.blog-body .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
}
.blog-body table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.blog-body th {
  background: var(--bg-alt);
  text-align: left;
  padding: 0.6rem 0.875rem;
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--text-secondary);
  border-bottom: 2px solid var(--card-border);
}
.blog-body td {
  padding: 0.6rem 0.875rem;
  border-bottom: 1px solid var(--card-border);
}
.blog-body tr:last-child td { border-bottom: none; }

/* Callout / tip box */
.blog-tip {
  background: var(--accent-bg);
  border: 1px solid var(--accent-bg-badge);
  padding: 1rem 1.25rem;
  border-radius: 8px;
  margin: 1.5rem 0;
  font-size: 0.9375rem;
}
.blog-tip strong { color: var(--accent); }

/* ── CTA BOX ── */
.blog-cta {
  margin: 2.5rem 0;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 2rem 2rem;
  text-align: center;
  color: var(--text-primary);
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.blog-cta h3 {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 800;
  margin-bottom: 0.5rem;
}
.blog-cta p {
  color: var(--text-secondary);
  margin-bottom: 1.25rem;
  font-size: 0.9375rem;
}
.blog-body .blog-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.blog-body .blog-cta-btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

/* ── SHEET-CALCULATOR CTA (mirrors .blog-cta-btn above) ── */
.blog-body .blog-tool-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.blog-body .blog-tool-cta-btn:hover { background: var(--accent-hover); color: #fff; text-decoration: none; }

/* ── BLOG INDEX LIST ── */
.blog-index-grid {
  max-width: var(--max-w);
  margin: 2rem auto 4rem;
  padding: 0 1.5rem;
  display: grid;
  gap: 1.5rem;
}
.blog-card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 12px;
  padding: 1.5rem;
  text-decoration: none;
  display: block;
  transition: box-shadow 0.15s, border-color 0.15s;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.blog-card:hover {
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
  border-color: var(--accent);
}
/* Card eyebrows retired (design audit): cluster headings carry the category
   on the index, titles carry the related cards. Kept in markup for structure. */
.blog-card-tag { display: none; }
.blog-card h2,
.blog-card h3 {
  font-size: 1.125rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.blog-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0.75rem;
}
.blog-card-meta {
  font-size: 0.8rem;
  color: var(--text-dim);
}

/* ── PAGE HEADER (blog index) ── */
.blog-page-header {
  max-width: var(--max-w);
  margin: 2rem auto 0;
  padding: 0 1.5rem;
}
.blog-page-header h1 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 800;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  letter-spacing: -0.03em;
}
.blog-page-header p { color: var(--text-secondary); }

/* ── PREFERRED SOURCE (Google deeplink, injected by scripts/inject-preferred-source.mjs) ── */
.blog-preferred-source {
  text-align: center;
  padding: 2.5rem 1.5rem;
}
.blog-preferred-source-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 1.4rem;
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 999px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.blog-preferred-source-btn:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 10px rgba(0,0,0,0.08);
}
.blog-preferred-source-btn svg { flex-shrink: 0; }

/* Closing bridge to the app — the page's last brand gesture (peak-end).
   Standalone before the footer since v5 (the Google block moved up). */
.blog-close-cta { text-align: center; padding: 0 1.5rem 2.5rem; }
.blog-close-cta-btn {
  display: inline-flex;
  align-items: center;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9375rem;
  padding: 0.7rem 1.5rem;
  border-radius: 8px;
  text-decoration: none;
  transition: background 0.15s;
}
.blog-close-cta-btn:hover { background: var(--accent-hover); }

/* Next step after the article (scripts/inject-blog-money-links.mjs): the
   .blog-cta card and the .blog-close-cta-btn button above, at the article's
   own measure (680px less its 1.5rem gutters). */
.blog-next-step { max-width: min(632px, calc(100% - 2rem)); margin: -1.5rem auto 0; }
.blog-cta p.blog-next-step-lead { font-size: 0.875rem; margin-bottom: 1rem; }
.blog-cta p.blog-next-step-links { font-size: 0.9375rem; margin: 1rem 0 0; color: var(--text-dim); }
.blog-next-step-links a { color: var(--accent); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.blog-next-step-links a:hover { color: var(--accent-hover); }
/* Secondary link under an in-article CTA button (same script). */
.blog-body .blog-cta-alt { display: block; width: fit-content; margin: 0.9rem auto 0; font-size: 0.9375rem; font-weight: 600; }

/* ── FOOTER (always dark) ── */
.blog-footer {
  background: var(--footer-bg);
  border-top: 1px solid var(--footer-border);
  padding: 2rem 1.5rem;
  text-align: center;
  font-size: 0.875rem;
  color: var(--footer-text);
}
.blog-footer a { color: rgba(255,255,255,0.55); text-decoration: none; margin: 0 0.5rem; }
.blog-footer a:hover { color: var(--accent); }

/* Code blocks */
code, pre {
  background: var(--bg-alt);
  color: var(--text-light);
  border-radius: 6px;
}
code { padding: 0.15rem 0.4rem; font-size: 0.875em; font-family: var(--font-mono); }
pre { padding: 1rem 1.25rem; overflow-x: auto; margin: 1.25rem 0; font-family: var(--font-mono); }

/* ── RESPONSIVE ── */
@media (max-width: 600px) {
  .blog-article { padding: 1.5rem 1rem 3rem; }
  .blog-cta { padding: 1.5rem 1.25rem; }
  .blog-nav-cta { padding: 0.4rem 0.75rem; font-size: 0.8125rem; flex: none; white-space: nowrap; }
  /* Long button labels (kk, ka, bg...) ran off the screen. The button keeps one line; when there is no room, the word
     beside the logo wraps to a second line that this height hides, whole, never cut mid-word. */
  .blog-nav-inner { gap: 0.75rem; }
  .blog-nav-logo { flex: 0 1 auto; min-width: 0; flex-wrap: wrap; align-content: flex-start; height: 1.5rem; line-height: 1.5rem; overflow: hidden; }
  /* Some articles write the footer links with no space between them, so the row could not wrap and widened the page. */
  .blog-footer a { display: inline-block; }
}
@media (max-width: 360px) {
  .blog-nav-inner { padding: 0 1rem; }
}

/* ── RTL SUPPORT ── */
html[dir="rtl"] .blog-body ul,
html[dir="rtl"] .blog-body ol {
  margin-left: 0;
  margin-right: 1.5rem;
}
html[dir="rtl"] .blog-body th,
html[dir="rtl"] .blog-body td {
  text-align: right;
}
html[dir="rtl"] .blog-skip-link {
  left: auto;
  right: 0;
  border-radius: 0 0 0 8px;
}

/* ── RELATED ARTICLES ── */
.blog-related {
  max-width: 760px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 1rem;
  border-top: 1px solid var(--card-border);
}
.blog-related h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}
.blog-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 900px) {
  .blog-related-grid { grid-template-columns: 1fr 1fr; }
}
.blog-related-card {
  display: block;
  padding: 1.25rem;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.blog-related-card:hover {
  border-color: var(--accent);
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}
.blog-related-card h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0.5rem 0 0;
  line-height: 1.4;
  color: var(--text-primary);
}
@media (max-width: 600px) {
  .blog-related-grid { grid-template-columns: 1fr; }
}

/* ── FAQ ACCORDION ── */
.blog-body details {
  margin: 0.75rem 0;
  border: 1px solid var(--card-border);
  border-radius: 8px;
  overflow: hidden;
}
.blog-body details summary {
  cursor: pointer;
  padding: 0.875rem 1.125rem;
  font-weight: 600;
  color: var(--text-primary);
  background: var(--card);
  list-style: none;
}
.blog-body details summary::-webkit-details-marker { display: none; }
.blog-body details summary::marker { display: none; }
.blog-body details[open] summary { border-bottom: 1px solid var(--card-border); }
.blog-body details div {
  padding: 0.875rem 1.125rem;
  font-size: 0.9375rem;
}

/* ── REDUCED MOTION ── */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}


/* ── AUTHOR BYLINE & CARD ── */
.blog-byline { gap: 0.7rem; }
.blog-byline-ava { flex: none; width: 44px; height: 44px; border-radius: 50%; overflow: hidden; display: block; box-shadow: 0 0 0 1px var(--bg-alt); }
.blog-byline-ava img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-byline-text { display: inline-flex; flex-direction: column; line-height: 1.35; }
.blog-byline-name { font-weight: 600; color: var(--text-secondary); }
.blog-byline-name a { color: var(--text-primary); text-decoration: none; border-bottom: 1.5px solid rgba(180,83,9,.4); }
.blog-byline-name a:hover { border-bottom-color: var(--accent); }
.blog-byline-sub { color: var(--text-dim); }
.blog-byline-role { color: var(--text-secondary); font-weight: 600; }

/* max-width: the card is a top-level sibling of the constrained article column,
   so it must cap itself; calc keeps side gutters below 760px viewports */
.blog-author-card { display: flex; gap: 1.25rem; align-items: flex-start; background: var(--card); border: 1px solid var(--bg-alt); border-radius: 14px; padding: 1.5rem 1.6rem; margin: 2.75rem auto 1rem; max-width: min(var(--max-w), calc(100% - 3rem)); }
.blog-author-photo { flex: none; width: 72px; height: 72px; border-radius: 50%; overflow: hidden; display: block; box-shadow: 0 0 0 1px var(--bg-alt); }
.blog-author-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-author-body { min-width: 0; }
.blog-author-name { font-size: 1.15rem; font-weight: 700; color: var(--text-primary); }
.blog-author-role { color: var(--text-secondary); font-weight: 600; font-size: 0.9rem; margin: 0.15rem 0 0.7rem; }
.blog-author-card p { color: var(--text-secondary); font-size: 0.95rem; line-height: 1.6; margin: 0 0 0.9rem; }
.blog-author-links { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.blog-author-links a { font-size: 0.8rem; font-weight: 600; color: var(--text-secondary); background: var(--bg-alt); border-radius: 999px; padding: 0.35rem 0.8rem; text-decoration: none; }
.blog-author-links a:hover { color: var(--accent); }
@media (max-width: 520px) { .blog-author-card { flex-direction: column; } }

/* ── BLOG INDEX: pillar + topic clusters ── */
.blog-pillar-card { position: relative; display: block; background: var(--card); border: 1px solid var(--accent); border-radius: 16px; padding: 1.6rem 1.75rem; margin: 0 0 2.5rem; text-decoration: none; box-shadow: 0 1px 2px rgba(20,25,32,.05), 0 10px 30px rgba(0,127,95,.10); transition: box-shadow .18s ease; }
.blog-pillar-card:hover { box-shadow: 0 1px 2px rgba(20,25,32,.05), 0 14px 40px rgba(0,127,95,.16); }
.blog-pillar-badge { display: inline-block; font-size: .7rem; letter-spacing: .09em; text-transform: uppercase; font-weight: 700; color: #fff; background: var(--accent); border-radius: 999px; padding: .2rem .7rem; margin-bottom: .55rem; }
.blog-pillar-card h2 { font-size: 1.4rem; line-height: 1.2; margin: .2rem 0 .5rem; color: var(--text-primary); }
.blog-pillar-card p { color: var(--text-secondary); margin: 0 0 .55rem; }
.blog-cluster-title { font-size: 1.2rem; margin: 1.5rem 0 .25rem; padding-bottom: .5rem; border-bottom: 1px solid var(--bg-alt); color: var(--text-primary); }
.blog-index-grid > .blog-cluster-title:first-child { margin-top: 0; }

/* ── IN-BODY FIGURES (cutting diagrams from the PDF export) ──
   Full-width overview on every screen; tap/click opens the full-size PNG so the fine
   dimension text stays readable on mobile (native pinch-zoom) without a JS lightbox. */
.blog-figure { margin: 2rem 0; }
.blog-figure-zoom { display: block; border: 1px solid var(--bg-alt); border-radius: 12px; overflow: hidden; background: #fff; cursor: zoom-in; }
.blog-figure-zoom img { display: block; width: 100%; height: auto; }
.blog-figure figcaption { margin-top: 0.7rem; color: var(--text-dim); font-size: 0.85rem; line-height: 1.5; text-align: center; }
.blog-figure figcaption b { color: var(--text-secondary); font-weight: 600; }
.blog-figure figcaption .zoom-hint { color: var(--accent); font-weight: 600; white-space: nowrap; }

/* Consent bar + footer button (public/blog/consent.js; strings from scripts/inject-blog-consent.mjs). The bar is
   fixed, so it never shifts the layout; both buttons look the same (no nudge toward "accept"). */
.cp-consent { position: fixed; inset-inline: 0; bottom: 0; z-index: 9999; background: #141920; color: rgba(255,255,255,.88);
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); font-family: Outfit, system-ui, sans-serif; font-size: 14px;
  line-height: 1.45; box-shadow: 0 -2px 12px rgba(0,0,0,.25); }
.cp-consent[hidden] { display: none; }
.cp-consent-title { margin: 0 auto 4px; max-width: 960px; font-weight: 700; }
.cp-consent-desc { margin: 0 auto 10px; max-width: 960px; }
.cp-consent-desc a { color: inherit; text-decoration: underline; } /* #007F5F on #141920 is 3.5:1, under AA for 14px text */
.cp-consent-desc a:hover { color: #fff; }
.cp-consent-btns { display: flex; gap: 8px; flex-wrap: wrap; max-width: 960px; margin: 0 auto; }
.cp-consent-btn { min-height: 44px; padding: 8px 18px; border-radius: 6px; border: 1px solid rgba(255,255,255,.35);
  background: transparent; color: #fff; font: inherit; font-weight: 600; cursor: pointer; }
.cp-consent-btn[aria-pressed="true"] { background: #007F5F; border-color: #007F5F; }
.blog-footer-consent { margin: 0.5rem 0 0; }
.blog-cookie-settings { background: none; border: 0; padding: 0.5rem; color: rgba(255,255,255,0.55); font: inherit; cursor: pointer; text-decoration: underline; }
.blog-cookie-settings:hover { color: var(--accent); }
