/* ============================================================
   BondGuide — styles.css
   Aesthetic: Editorial/Utilitarian — Trade Publication
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700;900&family=Source+Serif+4:ital,wght@0,300;0,400;0,600;1,300;1,400&family=JetBrains+Mono:wght@400;500&display=swap');

/* ---- Variables ---- */
:root {
  --navy:       #0d1b2a;
  --navy-mid:   #1a2e45;
  --navy-light: #243d57;
  --amber:      #e8943a;
  --amber-dim:  #c4742a;
  --cream:      #f5f0e8;
  --cream-dark: #ede6d8;
  --ink:        #1c1c1e;
  --ink-mid:    #3a3a3c;
  --ink-light:  #636366;
  --rule:       #d4c9b8;
  --white:      #ffffff;
  --success:    #2d7a4f;
  --warning:    #b85c00;

  --font-display: 'Playfair Display', Georgia, serif;
  --font-body:    'Source Serif 4', Georgia, serif;
  --font-mono:    'JetBrains Mono', 'Courier New', monospace;

  --max-width: 1120px;
  --content-width: 740px;
  --sidebar-width: 300px;

  --space-xs:  0.25rem;
  --space-sm:  0.5rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;

  --radius-sm: 3px;
  --radius-md: 6px;
  --radius-lg: 12px;

  --transition: 0.18s ease;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 1.0625rem;
  line-height: 1.72;
  color: var(--ink);
  background: var(--cream);
  min-height: 100vh;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--navy-mid); text-decoration: underline; text-underline-offset: 3px; transition: color var(--transition); }
a:hover { color: var(--amber-dim); }
ul, ol { padding-left: 1.4em; }
li { margin-bottom: 0.35em; }
strong { font-weight: 600; color: var(--ink); }
em { font-style: italic; }

/* ---- Typography Scale ---- */
h1, h2, h3, h4, h5 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.18;
  color: var(--navy);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 5vw, 3.25rem); font-weight: 900; margin-bottom: var(--space-lg); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); margin-bottom: var(--space-md); margin-top: var(--space-2xl); }
h3 { font-size: clamp(1.1rem, 2vw, 1.45rem); margin-bottom: var(--space-sm); margin-top: var(--space-xl); }
h4 { font-size: 1.05rem; font-family: var(--font-body); font-weight: 600; text-transform: uppercase; letter-spacing: 0.06em; margin-bottom: var(--space-sm); margin-top: var(--space-lg); color: var(--navy-mid); }
p { margin-bottom: var(--space-md); }
p:last-child { margin-bottom: 0; }
blockquote {
  border-left: 4px solid var(--amber);
  padding: var(--space-md) var(--space-lg);
  margin: var(--space-xl) 0;
  background: var(--cream-dark);
  font-style: italic;
  color: var(--ink-mid);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--cream-dark);
  padding: 0.1em 0.35em;
  border-radius: var(--radius-sm);
  color: var(--navy-mid);
}
hr {
  border: none;
  border-top: 1px solid var(--rule);
  margin: var(--space-2xl) 0;
}

/* ---- Layout ---- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}
.layout-with-sidebar {
  display: grid;
  grid-template-columns: 1fr var(--sidebar-width);
  gap: var(--space-2xl);
  align-items: start;
}
.layout-full { max-width: var(--content-width); margin: 0 auto; }
@media (max-width: 900px) {
  .layout-with-sidebar { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
}

/* ---- Header ---- */
.site-header {
  background: var(--navy);
  border-bottom: 3px solid var(--amber);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: var(--space-lg);
}
.site-logo {
  font-family: var(--font-display);
  font-weight: 900;
  font-size: 1.35rem;
  color: var(--white);
  text-decoration: none;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}
.site-logo span { color: var(--amber); }
.site-logo svg { width: 26px; height: 26px; fill: var(--amber); flex-shrink: 0; }
.site-logo:hover { color: var(--cream); }

.site-nav { display: flex; align-items: center; gap: var(--space-xs); }
.site-nav a {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-decoration: none;
  padding: 0.35rem 0.65rem;
  border-radius: var(--radius-sm);
  transition: all var(--transition);
  white-space: nowrap;
}
.site-nav a:hover { color: var(--white); background: rgba(255,255,255,0.1); }
.site-nav a.active { color: var(--amber); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  cursor: pointer;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  font-size: 1.1rem;
  line-height: 1;
}
@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .site-nav {
    display: none;
    position: absolute;
    top: 63px;
    left: 0; right: 0;
    background: var(--navy);
    border-bottom: 3px solid var(--amber);
    flex-direction: column;
    align-items: stretch;
    padding: var(--space-sm);
    gap: 0;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.65rem 1rem; border-radius: var(--radius-sm); }
}

/* ---- Hero ---- */
.hero {
  background: var(--navy);
  color: var(--white);
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  top: -60px; right: -80px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(232,148,58,0.12) 0%, transparent 70%);
  pointer-events: none;
}
.hero::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--amber) 0%, transparent 100%);
}
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: var(--space-md);
  display: block;
}
.hero h1 {
  color: var(--white);
  max-width: 800px;
  margin-bottom: var(--space-lg);
}
.hero-sub {
  font-size: 1.2rem;
  color: rgba(255,255,255,0.75);
  max-width: 600px;
  margin-bottom: var(--space-xl);
  line-height: 1.55;
  font-weight: 300;
}
.hero-cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  align-items: center;
}

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.65rem 1.4rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition);
  line-height: 1;
}
.btn-primary { background: var(--amber); color: var(--navy); border-color: var(--amber); }
.btn-primary:hover { background: var(--amber-dim); border-color: var(--amber-dim); color: var(--navy); }
.btn-outline { background: transparent; color: var(--white); border-color: rgba(255,255,255,0.4); }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(255,255,255,0.7); color: var(--white); }
.btn-secondary { background: var(--cream-dark); color: var(--navy); border-color: var(--rule); }
.btn-secondary:hover { background: var(--rule); color: var(--navy); }
.btn-lg { font-size: 1rem; padding: 0.85rem 1.8rem; }

/* ---- Breadcrumb ---- */
.breadcrumb {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-light);
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--rule);
  margin-bottom: var(--space-xl);
}
.breadcrumb a { color: var(--ink-light); text-decoration: none; }
.breadcrumb a:hover { color: var(--amber-dim); }
.breadcrumb span { margin: 0 0.4em; }

/* ---- Article Layout ---- */
.article-header { padding: var(--space-2xl) 0 var(--space-xl); border-bottom: 2px solid var(--navy); margin-bottom: var(--space-2xl); }
.article-meta {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--ink-light);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-md);
}
.article-meta span::before { content: '—  '; }
.article-meta span:first-child::before { content: ''; }

.article-body { padding: var(--space-xl) 0 var(--space-3xl); }

/* ---- Cards ---- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-lg);
  margin: var(--space-xl) 0;
}
.card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  text-decoration: none;
  color: inherit;
  display: block;
  transition: all var(--transition);
  border-top: 3px solid transparent;
  position: relative;
}
.card:hover {
  border-top-color: var(--amber);
  box-shadow: 0 4px 20px rgba(0,0,0,0.08);
  transform: translateY(-2px);
  color: inherit;
}
.card-eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--amber-dim);
  margin-bottom: var(--space-sm);
}
.card h3 { font-size: 1.1rem; margin: 0 0 var(--space-sm); color: var(--navy); }
.card p { font-size: 0.9rem; color: var(--ink-mid); margin: 0; line-height: 1.55; }
.card-arrow { position: absolute; bottom: var(--space-lg); right: var(--space-lg); color: var(--amber); font-size: 1.1rem; opacity: 0; transition: opacity var(--transition); }
.card:hover .card-arrow { opacity: 1; }

/* ---- Info Boxes ---- */
.info-box {
  border-left: 4px solid var(--navy-mid);
  background: rgba(13,27,42,0.05);
  padding: var(--space-md) var(--space-lg);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  margin: var(--space-xl) 0;
}
.info-box.amber { border-left-color: var(--amber); background: rgba(232,148,58,0.07); }
.info-box.success { border-left-color: var(--success); background: rgba(45,122,79,0.06); }
.info-box.warning { border-left-color: var(--warning); background: rgba(184,92,0,0.06); }
.info-box-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
  margin-bottom: var(--space-sm);
}
.info-box p { margin: 0; font-size: 0.95rem; }

/* ---- Comparison Table ---- */
.comparison-table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-xl) 0;
  font-size: 0.92rem;
  background: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 1px 8px rgba(0,0,0,0.07);
}
.comparison-table thead { background: var(--navy); color: var(--white); }
.comparison-table th {
  padding: 0.85rem 1rem;
  text-align: left;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.comparison-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--cream-dark);
  color: var(--ink-mid);
  vertical-align: top;
}
.comparison-table tr:last-child td { border-bottom: none; }
.comparison-table tr:nth-child(even) td { background: rgba(245,240,232,0.5); }
.comparison-table .highlight td { background: rgba(232,148,58,0.08) !important; font-weight: 600; color: var(--ink); }

/* ---- FAQ ---- */
.faq-section { margin: var(--space-2xl) 0; }
.faq-item {
  border-bottom: 1px solid var(--rule);
  padding: var(--space-md) 0;
}
.faq-item:last-child { border-bottom: none; }
.faq-question {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--navy);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: var(--space-md);
  user-select: none;
  list-style: none;
  padding: 0;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
}
.faq-question::-webkit-details-marker { display: none; }
details[open] .faq-question { color: var(--amber-dim); }
.faq-icon { color: var(--amber); font-size: 1.2rem; flex-shrink: 0; margin-top: 0.1rem; transition: transform var(--transition); }
details[open] .faq-icon { transform: rotate(45deg); }
.faq-answer { padding-top: var(--space-md); color: var(--ink-mid); font-size: 0.97rem; line-height: 1.7; }

/* ---- Sidebar ---- */
.sidebar { position: sticky; top: 80px; }
.sidebar-widget {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: var(--radius-md);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.sidebar-widget h4 { margin-top: 0; font-size: 0.78rem; }
.sidebar-widget ul { list-style: none; padding: 0; }
.sidebar-widget ul li { border-bottom: 1px solid var(--cream-dark); padding: 0.4rem 0; font-size: 0.88rem; }
.sidebar-widget ul li:last-child { border-bottom: none; }
.sidebar-widget ul li a { text-decoration: none; color: var(--navy-mid); }
.sidebar-widget ul li a:hover { color: var(--amber-dim); }
.sidebar-cta {
  background: var(--navy);
  color: var(--white);
  text-align: center;
  padding: var(--space-lg);
}
.sidebar-cta h4 { color: var(--amber); margin-top: 0; }
.sidebar-cta p { color: rgba(255,255,255,0.75); font-size: 0.88rem; margin-bottom: var(--space-md); }

/* ---- Tool ---- */
.tool-wrapper {
  background: var(--white);
  border: 2px solid var(--navy);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: var(--space-2xl) 0;
  box-shadow: 0 4px 24px rgba(0,0,0,0.1);
}
.tool-header {
  background: var(--navy);
  color: var(--white);
  padding: var(--space-lg) var(--space-xl);
  display: flex;
  align-items: center;
  gap: var(--space-md);
}
.tool-header h2 { color: var(--white); margin: 0; font-size: 1.3rem; }
.tool-header .tool-icon { font-size: 1.6rem; }
.tool-body { padding: var(--space-xl); }
.tool-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
@media (max-width: 600px) { .tool-form-row { grid-template-columns: 1fr; } }
.form-group { display: flex; flex-direction: column; gap: var(--space-xs); }
.form-group label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--navy);
}
.form-group select, .form-group input {
  font-family: var(--font-body);
  font-size: 0.97rem;
  padding: 0.6rem 0.85rem;
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  transition: border-color var(--transition);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23636366' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  padding-right: 2.2rem;
}
.form-group select:focus, .form-group input:focus {
  outline: none;
  border-color: var(--amber);
  box-shadow: 0 0 0 3px rgba(232,148,58,0.15);
}
.tool-result {
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-top: var(--space-lg);
  display: none;
}
.tool-result.visible { display: block; }
.result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
.result-item {}
.result-label {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 0.25rem;
}
.result-value {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--amber);
  line-height: 1.2;
}
.result-note { font-size: 0.82rem; color: rgba(255,255,255,0.6); margin-top: var(--space-xs); }
.result-details { border-top: 1px solid rgba(255,255,255,0.15); padding-top: var(--space-md); margin-top: var(--space-md); }
.result-details p { color: rgba(255,255,255,0.8); font-size: 0.9rem; margin-bottom: 0.5rem; }
.result-details a { color: var(--amber); }

/* ---- Checklist ---- */
.checklist {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0;
}
.checklist li {
  display: flex;
  gap: var(--space-sm);
  padding: 0.55rem 0;
  border-bottom: 1px solid var(--cream-dark);
  align-items: start;
  font-size: 0.95rem;
}
.checklist li:last-child { border-bottom: none; }
.checklist li::before { content: '✓'; color: var(--success); font-weight: 700; flex-shrink: 0; margin-top: 0.1rem; }

/* ---- Stat Strip ---- */
.stat-strip {
  background: var(--navy-mid);
  color: var(--white);
  padding: var(--space-xl) 0;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-xl);
  text-align: center;
}
.stat-number {
  font-family: var(--font-display);
  font-size: 2.4rem;
  font-weight: 900;
  color: var(--amber);
  line-height: 1;
  display: block;
}
.stat-label { font-size: 0.85rem; color: rgba(255,255,255,0.65); margin-top: 0.3rem; display: block; }

/* ---- Section ---- */
.section { padding: var(--space-3xl) 0; }
.section-alt { background: var(--cream-dark); }
.section-dark { background: var(--navy); color: var(--white); }
.section-dark h2, .section-dark h3 { color: var(--white); }
.section-dark p { color: rgba(255,255,255,0.8); }
.section-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--amber);
  margin-bottom: var(--space-sm);
  display: block;
}
.section-title { margin-top: 0; }

/* ---- Footer ---- */
.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.65);
  padding: var(--space-3xl) 0 var(--space-xl);
  border-top: 3px solid var(--amber);
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--space-2xl);
  padding-bottom: var(--space-2xl);
  border-bottom: 1px solid rgba(255,255,255,0.1);
  margin-bottom: var(--space-xl);
}
@media (max-width: 768px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .site-logo { font-size: 1.2rem; margin-bottom: var(--space-md); }
.footer-brand p { font-size: 0.875rem; line-height: 1.6; }
.footer-col h5 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--white);
  margin-bottom: var(--space-md);
}
.footer-col ul { list-style: none; padding: 0; }
.footer-col ul li { margin-bottom: 0.5rem; }
.footer-col ul li a { color: rgba(255,255,255,0.6); font-size: 0.875rem; text-decoration: none; transition: color var(--transition); }
.footer-col ul li a:hover { color: var(--amber); }
.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-md);
  font-size: 0.8rem;
}
.footer-bottom a { color: rgba(255,255,255,0.5); text-decoration: none; }
.footer-bottom a:hover { color: var(--amber); }
.disclaimer-strip {
  background: rgba(0,0,0,0.25);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-sm);
  margin-top: var(--space-lg);
  font-size: 0.8rem;
  color: rgba(255,255,255,0.45);
  line-height: 1.5;
}

/* ---- Utility ---- */
.text-amber { color: var(--amber); }
.text-navy { color: var(--navy); }
.text-muted { color: var(--ink-light); }
.text-mono { font-family: var(--font-mono); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Print ---- */
@media print {
  .site-header, .site-footer, .sidebar, .tool-wrapper { display: none; }
  body { color: #000; background: #fff; }
  h1, h2, h3 { color: #000; page-break-after: avoid; }
}

/* ---- Animations ---- */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.fade-up { animation: fadeUp 0.45s ease both; }
.fade-up-1 { animation-delay: 0.05s; }
.fade-up-2 { animation-delay: 0.12s; }
.fade-up-3 { animation-delay: 0.20s; }
.fade-up-4 { animation-delay: 0.28s; }
