/* ====================================================
   Guides (guides/*.php, inc/guide-page.inc.php) and the hub.
   Loaded after landing.css; uses its colours (--cb-*) and buttons.
   Logical properties throughout, so Arabic reads right to left.
   ==================================================== */

.cb-guide { padding: 112px 0 24px; }

/* ---- Breadcrumb ---- */
.cb-crumbs ol {
  display: flex;
  flex-wrap: wrap;
  max-width: 760px;
  margin: 0 auto 18px;
  padding: 0;
  list-style: none;
  font-size: 0.9rem;
  color: var(--cb-muted);
}
.cb-crumbs li + li::before { content: "\203A"; margin-inline: 8px; color: var(--cb-muted); }
[dir="rtl"] .cb-crumbs li + li::before { content: "\2039"; }
.cb-crumbs a { color: var(--cb-muted); text-decoration: underline; text-underline-offset: 2px; }
.cb-crumbs li[aria-current] { overflow: hidden; max-width: 100%; text-overflow: ellipsis; white-space: nowrap; }

/* ---- The article column ---- */
.cb-article { max-width: 760px; margin: 0 auto; }
.cb-kicker {
  margin: 0 0 10px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cb-pink);
}
.cb-landing .cb-article h1 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4.6vw, 3rem);
  font-weight: 800;
  line-height: 1.1;
}
.cb-byline {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 20px;
  margin: 0 0 22px;
  font-size: 0.93rem;
  color: var(--cb-muted);
}
.cb-byline .bi { margin-inline-end: 3px; font-size: 0.9em; }
.cb-landing .cb-article .cb-byline a { color: var(--cb-ink); font-weight: 700; text-decoration: none; }
.cb-landing .cb-article .cb-byline a:hover { text-decoration: underline; }
.cb-lead { font-size: 1.2rem; line-height: 1.65; color: var(--cb-ink); }

.cb-article p,
.cb-article li { font-size: 1.07rem; line-height: 1.72; }
.cb-article p { margin: 0 0 16px; }
.cb-article ul,
.cb-article ol { margin: 0 0 18px; padding-inline-start: 1.4em; }
.cb-article li { margin-bottom: 8px; }
.cb-article li::marker { color: var(--cb-muted); }
.cb-landing .cb-article p a,
.cb-landing .cb-article li a,
.cb-landing .cb-article td a,
.cb-landing .cb-article figcaption a {
  color: var(--cb-cta-hover);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.cb-article strong { color: var(--cb-ink); }

.cb-article-sec { margin-top: 52px; scroll-margin-top: 92px; }
.cb-landing .cb-article-sec h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3.2vw, 2.05rem);
  font-weight: 800;
  line-height: 1.2;
}
.cb-landing .cb-article-sec h3 { margin: 0 0 8px; font-size: 1.2rem; font-weight: 800; }

/* ---- Key takeaways, contents ---- */
.cb-takeaways,
.cb-toc {
  margin: 28px 0;
  padding: 22px 26px 8px;
  border-radius: 20px;
  background: #fff;
}
.cb-takeaways { border-inline-start: 5px solid var(--cb-pink); box-shadow: 0 24px 50px -36px rgba(22, 24, 29, 0.45); }
.cb-toc { background: transparent; border: 1px solid var(--cb-line); }
.cb-landing .cb-takeaways h2,
.cb-landing .cb-toc h2 {
  margin: 0 0 12px;
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--cb-muted);
}
.cb-toc ol { columns: 2 240px; column-gap: 32px; }
.cb-toc li { break-inside: avoid; font-size: 1rem; }
.cb-landing .cb-article .cb-toc a { color: var(--cb-ink); text-decoration: none; }
.cb-landing .cb-article .cb-toc a:hover { text-decoration: underline; }

/* ---- Tables: they scroll inside their box on small screens ---- */
.cb-table-wrap {
  overflow-x: auto;
  margin: 22px 0 26px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 0 0 1px var(--cb-line);
}
.cb-table-wrap:focus-visible { outline: 3px solid rgba(15, 112, 230, 0.45); outline-offset: 2px; }
.cb-table { width: 100%; margin: 0; border-collapse: collapse; font-size: 0.97rem; line-height: 1.5; }
.cb-table-wide .cb-table { min-width: 600px; }
.cb-table caption {
  caption-side: top;
  padding: 14px 16px 6px;
  font-weight: 800;
  text-align: start;
  color: var(--cb-ink);
}
.cb-table th,
.cb-table td { padding: 12px 16px; text-align: start; vertical-align: top; border-top: 1px solid var(--cb-line); }
.cb-table thead th { background: #f0eeeb; color: var(--cb-ink); font-weight: 700; white-space: nowrap; }
.cb-table tbody th { color: var(--cb-ink); font-weight: 700; }
/* Two-column tables on phones: Japanese and Chinese have no spaces, so give the label room for six characters
   ("file format" is six characters) or it breaks mid-word. Wide tables scroll and have room already. */
.cb-table-wrap:not(.cb-table-wide) .cb-table tbody th:lang(ja),
.cb-table-wrap:not(.cb-table-wide) .cb-table tbody th:lang(zh) { min-width: calc(6.3em + 32px); }

/* ---- Callouts, figures, inline buttons ---- */
.cb-callout {
  display: flex;
  gap: 12px;
  margin: 22px 0;
  padding: 16px 18px;
  border-radius: 16px;
  background: #eaf3ff;
}
.cb-callout > .bi { flex: none; font-size: 1.25rem; line-height: 1.6; color: var(--cb-cta); }
.cb-callout p { margin: 0; }
.cb-callout-warn { background: #fff4e3; }
.cb-callout-warn > .bi { color: #b25e00; }

.cb-figure { margin: 26px 0; }
.cb-figure img { display: block; width: 100%; height: auto; border-radius: 18px; box-shadow: 0 0 0 1px var(--cb-line); }
/* Square pictures (a product on white) at a size that still fits the screen. */
.cb-figure-sq img { max-width: 520px; margin-inline: auto; }
.cb-figure-tall img { max-width: 420px; margin-inline: auto; }
.cb-figure-sq .cb-ba { max-width: 520px; margin-inline: auto; }
.cb-figure-tall .cb-ba { max-width: 420px; margin-inline: auto; }
/* Inline diagrams (the car's camera positions). */
.cb-diagram svg { display: block; width: 100%; max-width: 600px; height: auto; margin-inline: auto; }
.cb-figure .cb-ba { border-radius: 18px; }
/* Right and wrong examples side by side (two a row on phones). */
.cb-grid-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
/* Six pictures: three a row (not five and one left over) where there is room. */
@media (min-width: 576px) { .cb-grid-list:has(> :nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); } }
.cb-article .cb-grid-item { margin: 0; }
.cb-grid-item img { display: block; width: 100%; height: auto; border-radius: 14px; box-shadow: 0 0 0 1px var(--cb-line); }
.cb-grid-item.is-ok img { box-shadow: 0 0 0 3px #1f9d55; }
.cb-article .cb-grid-item p { margin: 8px 2px 0; font-size: 0.92rem; line-height: 1.45; }
.cb-grid-item .bi { margin-inline-end: 2px; }
.cb-grid-item.is-ok .bi { color: #1f9d55; }
.cb-grid-item.is-bad .bi { color: #d0342c; }
.cb-figure figcaption { margin-top: 10px; font-size: 0.92rem; line-height: 1.5; color: var(--cb-muted); text-align: center; }
.cb-inline-cta { margin: 26px 0; }
.cb-landing .cb-article .cb-inline-cta a { color: #fff; text-decoration: none; }

/* ---- Numbered steps ---- */
.cb-article .cb-gsteps { counter-reset: cb-step; margin: 20px 0; padding: 0; list-style: none; }
.cb-article .cb-gsteps > li {
  position: relative;
  margin-bottom: 26px;
  padding-inline-start: 54px;
  counter-increment: cb-step;
}
.cb-gsteps > li::before {
  content: counter(cb-step);
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--cb-ink);
  color: #fff;
  font-weight: 800;
}
.cb-gsteps h3 { padding-top: 6px; }
.cb-gsteps img { display: block; width: 100%; height: auto; margin-top: 12px; border-radius: 14px; box-shadow: 0 0 0 1px var(--cb-line); }

/* ---- FAQ and sources inside the article ---- */
.cb-article .cb-article-faq { max-width: none; padding: 0; background: none; border-radius: 0; box-shadow: none; }
.cb-landing .cb-article .cb-article-faq h2 { text-align: start; }
.cb-article .cb-faq details p { font-size: 1.02rem; }
.cb-sources { padding-inline-start: 1.4em; }
.cb-article .cb-sources li { margin-bottom: 6px; font-size: 0.97rem; line-height: 1.55; overflow-wrap: anywhere; }
.cb-src-host { font-size: 0.85rem; color: var(--cb-muted); }
.cb-article .cb-article-note {
  margin-top: 40px;
  padding-top: 16px;
  border-top: 1px solid var(--cb-line);
  font-size: 0.92rem;
  color: var(--cb-muted);
}

/* ---- Guide cards (hub, "More guides") ---- */
.cb-guide-more { padding: 56px 0; }
.cb-landing .cb-guide-more-title {
  margin-bottom: 26px;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  font-weight: 800;
  text-align: center;
}
.cb-guide-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 22px;
}
.cb-guide-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 24px 50px -32px rgba(22, 24, 29, 0.45);
  transition: transform 0.15s, box-shadow 0.15s;
}
.cb-landing a.cb-guide-card { color: var(--cb-ink); }
.cb-guide-card:hover,
.cb-guide-card:focus-visible {
  text-decoration: none;
  transform: translateY(-3px);
  box-shadow: 0 30px 56px -30px rgba(22, 24, 29, 0.5);
}
.cb-guide-card img { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; background: var(--cb-line); }
.cb-guide-card-body { display: flex; flex-direction: column; gap: 6px; padding: 16px 18px 20px; }
.cb-guide-card-title { font-size: 1.1rem; font-weight: 800; line-height: 1.3; }
.cb-guide-card-sum { font-size: 0.94rem; line-height: 1.5; color: var(--cb-muted); }
.cb-guide-card-date { margin-top: auto; padding-top: 4px; font-size: 0.82rem; color: var(--cb-muted); }
.cb-guide-all { margin: 26px 0 0; text-align: center; font-weight: 700; }
[dir="rtl"] .cb-guide-all .bi-arrow-right { display: inline-block; transform: scaleX(-1); }

/* ---- The hub ---- */
.cb-guides-hub { padding: 112px 0 40px; }
.cb-guides-hub .cb-crumbs ol { max-width: none; }
.cb-guides-intro { max-width: 760px; margin: 0 auto 8px; text-align: center; }
.cb-landing .cb-guides-intro h1 { margin: 0 0 14px; font-size: clamp(2.1rem, 5vw, 3.3rem); font-weight: 800; line-height: 1.08; }
.cb-guides-intro p { font-size: 1.15rem; line-height: 1.6; color: var(--cb-muted); }
/* The groups side by side, each a column of its guides' cards. */
.cb-guides-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 28px; }
.cb-guides-group { margin-top: 44px; }
.cb-landing .cb-guides-group h2 { margin: 0 0 18px; font-size: 1.45rem; font-weight: 800; }

@media (max-width: 767.98px) {
  .cb-guide,
  .cb-guides-hub { padding-top: 92px; }
  .cb-lead { font-size: 1.1rem; }
  .cb-article p,
  .cb-article li { font-size: 1.02rem; }
  .cb-article-sec { margin-top: 40px; }
  .cb-takeaways,
  .cb-toc { padding: 18px 18px 4px; }
  .cb-article .cb-gsteps > li { padding-inline-start: 46px; }
  .cb-gsteps > li::before { width: 34px; height: 34px; }
  .cb-guide-more { padding: 40px 0; }
}

/* "More guides" and the tool pages' guides row: a short row, centred. */
@media (min-width: 900px) {
  .cb-guide-more .cb-guide-cards,
  .cb-tool-guides .cb-guide-cards { grid-template-columns: repeat(auto-fit, minmax(260px, 340px)); justify-content: center; }
}
