/* ============================================================
   BCR Realty — Long-form Guide / Report styles
   Inherits every token from main.css. No new colours, no new
   fonts. Loaded only on the BCR Guide template.
   ============================================================ */

/* ---------- Guide hero ---------- */
.guide-hero { padding: 180px 0 60px; }
.guide-hero h1 { font-size: clamp(34px, 4.6vw, 52px); margin-bottom: 22px; letter-spacing: -0.015em; max-width: 900px; }
.guide-meta { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--bcr-gray-200); }
.guide-meta-item { font-size: 12.5px; color: var(--bcr-gray-600); display: flex; align-items: center; gap: 7px; }
.guide-meta-item strong { color: var(--bcr-dark); font-weight: 500; }
.guide-meta-item .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--bcr-blue-mid); flex-shrink: 0; }
.guide-updated { display: inline-flex; align-items: center; gap: 8px; background: var(--bcr-blue-light); color: var(--bcr-blue); font-size: 11.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 7px 15px; border-radius: 100px; }
.guide-updated .live { width: 7px; height: 7px; border-radius: 50%; background: #1FAF5A; }

/* ---------- Layout: content + sticky rail ---------- */
.guide-layout { display: grid; grid-template-columns: minmax(0,1fr) 300px; gap: 60px; align-items: start; }
.guide-rail { position: sticky; top: 100px; }

/* ---------- Table of contents ---------- */
.toc { background: var(--bcr-white); border: 1px solid var(--bcr-gray-200); border-radius: 16px; padding: 26px 24px; box-shadow: var(--shadow-card); }
.toc-title { font-size: 11px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; color: var(--bcr-gray-600); margin-bottom: 16px; }
.toc ol { list-style: none; counter-reset: toc; }
.toc li { counter-increment: toc; margin-bottom: 11px; }
.toc a { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.5; color: var(--bcr-gray-600); text-decoration: none; transition: color .2s; }
.toc a::before { content: counter(toc, decimal-leading-zero); font-family: var(--serif); font-weight: 700; color: var(--bcr-blue-mid); flex-shrink: 0; }
.toc a:hover { color: var(--bcr-blue); }

/* ---------- Guide body typography ---------- */
.guide-body { max-width: 100%; }
.guide-body h2 { font-size: clamp(24px, 3vw, 32px); margin: 56px 0 18px; scroll-margin-top: 100px; letter-spacing: -0.01em; }
.guide-body h2:first-child { margin-top: 0; }
.guide-body h3 { font-size: 20px; margin: 36px 0 12px; scroll-margin-top: 100px; }
.guide-body h4 { font-family: var(--sans); font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--bcr-blue); margin: 28px 0 10px; }
.guide-body p { font-size: 16px; font-weight: 300; color: var(--bcr-gray-600); line-height: 1.85; margin-bottom: 20px; }
.guide-body strong { color: var(--bcr-dark); font-weight: 500; }
.guide-body a { color: var(--bcr-blue); text-decoration: underline; text-underline-offset: 3px; }
.guide-body ul, .guide-body ol { margin: 0 0 22px 0; padding-left: 22px; }
.guide-body li { font-size: 16px; font-weight: 300; color: var(--bcr-gray-600); line-height: 1.8; margin-bottom: 9px; }
.guide-body li::marker { color: var(--bcr-blue-mid); }
.guide-body hr { border: none; border-top: 1px solid var(--bcr-gray-200); margin: 48px 0; }

/* ---------- Tables ---------- */
/* Scoped to .guide-body, .prose and the block editor so tables render
   correctly on guide pages, guide posts, ordinary posts and inside
   wp-admin. Never rely on a single wrapper class for table styling. */
.guide-body .table-wrap,
.prose .table-wrap,
.editor-styles-wrapper .table-wrap,
.table-wrap { overflow-x: auto; margin: 26px 0 14px; border: 1px solid var(--bcr-gray-200); border-radius: 14px; background: var(--bcr-white); -webkit-overflow-scrolling: touch; }
.guide-body table,
.prose table,
.editor-styles-wrapper .table-wrap table,
.table-wrap table { width: 100%; border-collapse: collapse; min-width: 560px; margin: 0; }
.guide-body thead th,
.prose thead th,
.table-wrap thead th {
  background: var(--bcr-blue-ink); color: var(--bcr-white);
  font-family: var(--sans); font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
  text-align: left; padding: 15px 18px; white-space: nowrap; border: none;
}
.guide-body tbody td,
.prose tbody td,
.table-wrap tbody td { padding: 15px 18px; font-size: 14.5px; font-weight: 300; color: var(--bcr-gray-600); border-top: 1px solid var(--bcr-gray-200); border-left: none; border-right: none; vertical-align: top; line-height: 1.6; }
.guide-body tbody tr:nth-child(even),
.prose tbody tr:nth-child(even),
.table-wrap tbody tr:nth-child(even) { background: #FCFCFB; }
.guide-body tbody td:first-child,
.prose tbody td:first-child,
.table-wrap tbody td:first-child { font-weight: 500; color: var(--bcr-dark); }
.guide-body tbody tr.is-total td,
.table-wrap tbody tr.is-total td { background: var(--bcr-blue-light); font-weight: 700; color: var(--bcr-dark); border-top: 2px solid var(--bcr-blue); }
.guide-body tbody tr.is-total td:first-child,
.table-wrap tbody tr.is-total td:first-child { color: var(--bcr-blue); }
.table-note { font-size: 12px; color: var(--bcr-gray-400); margin: 0 0 30px; line-height: 1.6; }

/* Scroll affordance on narrow screens */
@media (max-width: 700px) {
  .table-wrap { position: relative; }
  .table-wrap::after { content: 'Scroll \2192'; position: sticky; left: 100%; bottom: 0; display: block; width: max-content; font-size: 10px; letter-spacing: .1em; text-transform: uppercase; color: var(--bcr-gray-400); padding: 6px 10px; }
}

/* ---------- Key number callout ---------- */
.keynum { display: grid; grid-template-columns: auto 1fr; gap: 22px; align-items: center; background: var(--bcr-white); border: 1px solid var(--bcr-gray-200); border-left: 4px solid var(--bcr-blue); border-radius: 14px; padding: 26px 28px; margin: 30px 0; box-shadow: var(--shadow-card); }
.keynum-fig { font-family: var(--serif); font-size: 42px; font-weight: 700; color: var(--bcr-blue); line-height: 1; }
.keynum p { margin: 0; font-size: 15px; }

/* ---------- Callout boxes ---------- */
.callout { border-radius: 14px; padding: 24px 26px; margin: 28px 0; border: 1px solid var(--bcr-gray-200); background: var(--bcr-white); }
.callout h4 { margin-top: 0; }
.callout p:last-child, .callout ul:last-child, .callout ol:last-child { margin-bottom: 0; }
.callout-warn { border-left: 4px solid var(--bcr-red); background: #FFFBFB; }
.callout-warn h4 { color: var(--bcr-red); }
.callout-tip { border-left: 4px solid var(--bcr-blue); background: #FAFAFE; }
.callout-example { border-left: 4px solid var(--bcr-blue-mid); background: var(--bcr-gray-100); }
.callout-example h4 { color: var(--bcr-blue-mid); }

/* ---------- Worked example ---------- */
.worked { background: var(--bcr-blue-ink); background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px); background-size: 54px 54px; border-radius: 18px; padding: 34px 32px; margin: 34px 0; color: var(--bcr-white); }
.worked h4 { color: rgba(255,255,255,0.7); margin-top: 0; }
.worked p { color: rgba(255,255,255,0.75); }
.worked strong { color: var(--bcr-white); }
.worked-rows { margin: 18px 0 0; }
.worked-row { display: flex; justify-content: space-between; gap: 20px; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,0.12); font-size: 14.5px; color: rgba(255,255,255,0.75); font-weight: 300; }
.worked-row:last-child { border-bottom: none; }
.worked-row span:last-child { font-weight: 500; color: var(--bcr-white); white-space: nowrap; }
.worked-row.is-result { border-top: 2px solid var(--bcr-red); margin-top: 8px; padding-top: 16px; }
.worked-row.is-result span { font-family: var(--serif); font-size: 20px; font-weight: 700; color: var(--bcr-white); }

/* ---------- Checklist ----------
   NOTE: this list must NOT use display:grid. With grid, the text node
   following a <strong> label becomes its own anonymous grid item and
   auto-places into the narrow first column, which stacks the sentence
   one word per line. Block flow + absolutely positioned tick marker
   keeps the label and its sentence on the same line. */
.checklist { list-style: none; padding: 0; margin: 24px 0; }
ul.checklist { list-style: none; padding-left: 0; }
.checklist li,
ul.checklist li,
.guide-body ul.checklist li,
.prose ul.checklist li {
  display: block;
  position: relative;
  padding: 15px 0 15px 40px;
  margin: 0;
  border-bottom: 1px solid var(--bcr-gray-200);
  font-size: 16px;
  font-weight: 300;
  color: var(--bcr-gray-600);
  line-height: 1.8;
  list-style: none;
}
.checklist li:last-child,
ul.checklist li:last-child,
.guide-body ul.checklist li:last-child { border-bottom: none; }
.checklist li strong,
ul.checklist li strong { color: var(--bcr-dark); font-weight: 500; }
.checklist li::marker,
ul.checklist li::marker { content: ''; }
.checklist li::before,
ul.checklist li::before,
.guide-body ul.checklist li::before,
.prose ul.checklist li::before {
  content: '\2713';
  position: absolute;
  left: 0;
  top: 18px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--bcr-blue-light);
  color: var(--bcr-blue);
  font-size: 11px;
  font-weight: 700;
  line-height: 22px;
  text-align: center;
}

/* ---------- FAQ ---------- */
.faq { margin: 26px 0; border: 1px solid var(--bcr-gray-200); border-radius: 14px; overflow: hidden; background: var(--bcr-white); }
.faq details { border-bottom: 1px solid var(--bcr-gray-200); }
.faq details:last-child { border-bottom: none; }
.faq summary { cursor: pointer; padding: 20px 24px; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--bcr-dark); list-style: none; display: flex; justify-content: space-between; gap: 16px; align-items: center; transition: color .2s; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-family: var(--sans); font-size: 22px; font-weight: 300; color: var(--bcr-blue); flex-shrink: 0; transition: transform .25s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { color: var(--bcr-blue); }
.faq-answer { padding: 0 24px 22px; }
.faq-answer p { margin-bottom: 12px; font-size: 15px; }
.faq-answer p:last-child { margin-bottom: 0; }

/* ---------- Methodology / sources ---------- */
.methodology { background: var(--bcr-gray-100); border: 1px solid var(--bcr-gray-200); border-radius: 16px; padding: 30px 32px; margin: 46px 0 0; }
.methodology h3 { margin-top: 0; font-size: 18px; }
.methodology p, .methodology li { font-size: 14px; line-height: 1.75; }
.methodology ul { margin-bottom: 12px; }

/* ---------- Author box ---------- */
.author-box { display: grid; grid-template-columns: 74px 1fr; gap: 20px; align-items: center; background: var(--bcr-white); border: 1px solid var(--bcr-gray-200); border-radius: 16px; padding: 24px 26px; margin: 40px 0 0; box-shadow: var(--shadow-card); }
.author-box img { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; object-position: center top; }
.author-box h4 { margin: 0 0 3px; font-family: var(--serif); font-size: 17px; font-weight: 700; color: var(--bcr-dark); text-transform: none; letter-spacing: 0; }
.author-box .author-role { font-size: 11.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--bcr-blue); margin-bottom: 8px; }
.author-box p { font-size: 13.5px; margin: 0; line-height: 1.7; }

/* ---------- Rail CTA ---------- */
.rail-cta { background: var(--bcr-blue-ink); background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px); background-size: 44px 44px; border-radius: 16px; padding: 26px 24px; margin-top: 20px; color: var(--bcr-white); }
.rail-cta h4 { color: rgba(255,255,255,0.65); margin: 0 0 10px; }
.rail-cta p { font-size: 14px; color: rgba(255,255,255,0.75); font-weight: 300; line-height: 1.7; margin-bottom: 18px; }
.rail-cta .btn { width: 100%; justify-content: center; font-size: 11.5px; padding: 13px 18px; }

/* ---------- Related guides ---------- */
.related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin-top: 30px; }
.related-card { background: var(--bcr-white); border: 1px solid var(--bcr-gray-200); border-radius: 14px; padding: 26px 24px; text-decoration: none; display: block; transition: transform .3s, box-shadow .3s; }
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
.related-card h3 { font-size: 17px; margin: 12px 0 8px; }
.related-card p { font-size: 13.5px; color: var(--bcr-gray-600); font-weight: 300; margin: 0; line-height: 1.65; }

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .guide-layout { grid-template-columns: 1fr; gap: 36px; }
  .guide-rail { position: static; order: -1; }
  .related-grid { grid-template-columns: 1fr; }
  .guide-hero { padding: 150px 0 40px; }
  .keynum { grid-template-columns: 1fr; gap: 12px; }
  .author-box { grid-template-columns: 1fr; text-align: left; }
  .author-box img { width: 64px; height: 64px; }
}
