/*
 * site.css
 * Same design tokens as admin.css (navy structure, muted gold accent,
 * Sora/Inter type) so the public site and admin panel read as one
 * product, not two different builds bolted together.
 */

:root {
  --bds-navy: #161b33;
  --bds-navy-soft: #232a4d;
  --bds-gold: #c8952e;
  --bds-gold-soft: #f3e3c2;
  --bds-page-bg: #ffffff;
  --bds-surface: #ffffff;
  --bds-surface-2: #f8f9fc;
  --bds-border: #e3e6f0;
  --bds-text: #171a2b;
  --bds-text-secondary: #676d84;
  --bds-text-muted: #9aa0b4;
  --bs-font-sans-serif: 'Inter', system-ui, -apple-system, sans-serif;
  --bds-font-display: 'Sora', var(--bs-font-sans-serif);
  --bs-body-bg: var(--bds-page-bg);
  --bs-body-color: var(--bds-text);
  --bs-border-color: var(--bds-border);
  --bs-primary: var(--bds-navy);
  --bs-link-color: var(--bds-navy);
  --bs-border-radius: 0.6rem;
  --bs-border-radius-lg: 0.85rem;
}

[data-bs-theme="dark"] {
  --bds-page-bg: #12131c;
  --bds-surface: #1b1d2a;
  --bds-surface-2: #21232f;
  --bds-border: #2b2e40;
  --bds-text: #eef0f5;
  --bds-text-secondary: #a6abc0;
  --bds-text-muted: #767c93;
  --bs-body-bg: var(--bds-page-bg);
  --bs-body-color: var(--bds-text);
  --bs-border-color: var(--bds-border);
}

body { font-family: var(--bs-font-sans-serif); }
h1, h2, h3, h4, h5, h6, .site-brand { font-family: var(--bds-font-display); font-weight: 600; }
a { color: var(--bds-navy); }
[data-bs-theme="dark"] a { color: #d8dcf0; }

/* ---- Reading progress bar --------------------------------------------- */
.bds-reading-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0%;
  background: var(--bds-gold); z-index: 1050; transition: width 0.1s linear;
}

/* ---- Header ------------------------------------------------------------- */
.site-header { border-bottom: 1px solid var(--bds-border); background: var(--bds-surface); }
.site-brand { color: var(--bds-text); font-size: 1.1rem; }
.site-brand-mark {
  width: 32px; height: 32px; border-radius: 8px; background: var(--bds-gold);
  color: var(--bds-navy); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 700;
}
.nav-link-site { color: var(--bds-text-secondary); text-decoration: none; font-size: 0.9rem; }
.nav-link-site:hover { color: var(--bds-text); }
.btn-icon-site {
  width: 36px; height: 36px; border-radius: 0.5rem; border: 1px solid var(--bds-border);
  background: var(--bds-surface); color: var(--bds-text-secondary); display: inline-flex;
  align-items: center; justify-content: center; text-decoration: none;
}
.btn-icon-site:hover { background: var(--bds-surface-2); color: var(--bds-text); }

.bds-breadcrumb-site { font-size: 0.85rem; }
.bds-breadcrumb-site a { color: var(--bds-text-secondary); }

/* ---- Hero --------------------------------------------------------------- */
.bds-hero img { max-height: 320px; object-fit: cover; }

/* ---- Post/category cards -------------------------------------------------- */
.bds-post-card { color: var(--bds-text); }
.bds-post-card-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; border-radius: var(--bs-border-radius); }
.bds-category-card {
  background: var(--bds-surface-2); border: 1px solid var(--bds-border); border-radius: var(--bs-border-radius);
  padding: 1rem; text-align: center; color: var(--bds-text); font-weight: 500;
}
.bds-category-card:hover { border-color: var(--bds-gold); }

.bds-empty-state-site {
  text-align: center; padding: 2rem; color: var(--bds-text-secondary);
  background: var(--bds-surface-2); border-radius: var(--bs-border-radius);
}

/* ---- Widgets / sidebar --------------------------------------------------- */
.bds-widget { background: var(--bds-surface-2); border-radius: var(--bs-border-radius); padding: 1.1rem; }

/* ---- Article content ------------------------------------------------------ */
.bds-featured-image { max-height: 420px; object-fit: cover; }
.bds-disclosure {
  background: var(--bds-surface-2); border-left: 3px solid var(--bds-gold);
  padding: 0.75rem 1rem; font-size: 0.85rem; border-radius: 0 0.4rem 0.4rem 0;
}
.bds-toc { background: var(--bds-surface-2); border-radius: var(--bs-border-radius); padding: 1rem; }
.bds-toc a { color: var(--bds-text-secondary); text-decoration: none; }
.bds-toc a:hover { color: var(--bds-text); }

.bds-content { line-height: 1.75; }
.bds-content img { max-width: 100%; height: auto; border-radius: var(--bs-border-radius); }
.bds-content h2 { margin-top: 2rem; font-size: 1.4rem; }
.bds-content h3 { margin-top: 1.5rem; font-size: 1.15rem; }

.bds-pros-cons { border-radius: var(--bs-border-radius); padding: 1rem; }
.bds-pros { background: rgba(30,158,107,0.08); }
.bds-cons { background: rgba(220,76,76,0.08); }
.bds-pros-cons ul { padding-left: 1.1rem; }

.bds-spec-table th, .bds-comparison-table th { font-weight: 500; }

.bds-author-box {
  background: var(--bds-surface-2); border-radius: var(--bs-border-radius); padding: 1.1rem; margin-top: 1rem;
}
.bds-author-avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--bds-navy-soft); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 1.2rem; flex-shrink: 0;
}

/* ---- Footer --------------------------------------------------------------- */
.site-footer { background: var(--bds-surface-2); border-top: 1px solid var(--bds-border); margin-top: 2rem; }

/* ---- Accessibility ----------------------------------------------------------- */
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--bds-gold); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .bds-reading-progress { transition: none; }
}

/* ---- Sticky TOC + scrollspy active state (M4 Phase 2) ------------------------- */
@media (min-width: 992px) {
  .bds-toc { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
  .site-sidebar { position: sticky; top: 72px; max-height: calc(100vh - 90px); overflow-y: auto; }
}
.bds-toc a.active { color: var(--bds-gold); font-weight: 500; }

/* ---- Sticky share/font toolbar ------------------------------------------------ */
.bds-toolbar {
  position: sticky; top: 56px; z-index: 15; background: var(--bds-surface);
  padding: 0.5rem 0; border-bottom: 1px solid var(--bds-border);
}
.bds-font-controls .btn-icon-site { font-size: 0.75rem; font-weight: 600; width: 32px; height: 32px; }

/* ---- Back to top -------------------------------------------------------------- */
.bds-back-to-top {
  position: fixed; bottom: 20px; right: 20px; z-index: 1030;
  opacity: 0; pointer-events: none; transition: opacity 0.2s ease;
  background: var(--bds-surface); box-shadow: 0 2px 8px rgba(0,0,0,0.12);
}
.bds-back-to-top.show { opacity: 1; pointer-events: auto; }

/* ---- Amazon components (M4 Phase 2) -------------------------------------------- */
.bds-product-box { background: var(--bds-surface-2); border-radius: var(--bs-border-radius); padding: 1rem; }
.bds-stars { color: var(--bds-gold); letter-spacing: 1px; }
.bds-buy-button { font-size: 0.9rem; }

/* ---- Font-size scaling (applied to <html> via JS) ------------------------------ */
html[data-bds-font-size="sm"] .bds-content { font-size: 0.95rem; }
html[data-bds-font-size="lg"] .bds-content { font-size: 1.15rem; }

/* ---- Print stylesheet ------------------------------------------------------------ */
@media print {
  .site-header, .site-footer, .site-sidebar, .bds-toolbar, .bds-back-to-top,
  .bds-reading-progress, .offcanvas, .bds-widget { display: none !important; }
  .site-main { padding: 0 !important; }
  a { color: #000 !important; text-decoration: none !important; }
  .bds-content img { max-width: 100% !important; }
}
