/* OBridge Blog — shared styles
 * Brand: #1E2761 (deep royal blue), #DCE6F5 (light blue), #FFFFFF, ink #0B1024
 * Typography: Cormorant Garamond serif for headings, Inter for body, JetBrains Mono for micro
 */

:root {
  --brand: #1E2761;
  --brand-hover: #2A3577;
  --light: #DCE6F5;
  --light-2: #EEF3FA;
  --ink: #0B1024;
  --muted: #4A5578;
  --rule: #E2E8F0;
  --bg: #FFFFFF;
  --accent: #4A6FA5;
  --max-w: 1180px;
  --article-w: 720px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: 17px;
}

a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--brand-hover); text-decoration-thickness: 2px; }

/* ----- Site header ----- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.site-nav-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.wordmark {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-style: italic;
  font-size: 26px;
  font-weight: 500;
  color: var(--brand);
  text-decoration: none;
  letter-spacing: -0.5px;
}
.wordmark:hover { color: var(--brand); text-decoration: none; }

.nav-links {
  display: flex;
  gap: 32px;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
}
.nav-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand);
  text-decoration: none;
}
.nav-links a:hover,
.nav-links a.active {
  text-decoration: underline;
  text-underline-offset: 4px;
}
.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  line-height: 0;
}
.mobile-menu {
  position: fixed;
  inset: 0;
  background: #fff;
  z-index: 60;
  padding: 24px;
  display: flex;
  flex-direction: column;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 48px;
}
.nav-close {
  background: none;
  border: none;
  color: var(--brand);
  cursor: pointer;
  padding: 8px;
  margin-right: -8px;
  line-height: 0;
}
.mobile-menu-links {
  display: flex;
  flex-direction: column;
  gap: 24px;
  align-items: center;
}
.mobile-menu-links a {
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--brand);
  text-decoration: none;
}
.mobile-menu-links a.active { text-decoration: underline; text-underline-offset: 4px; }
.mobile-menu-links a.nav-cta {
  margin-top: 32px;
  color: #fff;
  letter-spacing: 0.05em;
}

.nav-cta {
  background: var(--brand);
  color: #fff !important;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.nav-cta:hover { background: var(--brand-hover); }

/* ----- Blog index hero ----- */
.blog-hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 96px 32px 40px;
  text-align: center;
}
.blog-hero .kicker {
  font-family: 'JetBrains Mono', 'IBM Plex Mono', monospace;
  font-size: 12px;
  color: var(--brand);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 20px;
}
.blog-hero h1 {
  font-family: 'Cormorant Garamond', 'Playfair Display', Georgia, serif;
  font-size: clamp(48px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 500;
  letter-spacing: -1.5px;
  color: var(--brand);
  margin-bottom: 24px;
}
.blog-hero h1 em {
  font-style: italic;
  color: var(--accent);
}
.blog-hero p {
  font-size: 20px;
  color: var(--muted);
  max-width: 640px;
  margin: 0 auto;
}

/* ----- Search bar ----- */
.search-wrap {
  max-width: 720px;
  margin: 48px auto 32px;
  padding: 0 32px;
}
.search {
  position: relative;
  width: 100%;
}
.search input {
  width: 100%;
  padding: 20px 24px 20px 60px;
  border: 1px solid var(--rule);
  border-radius: 16px;
  font-family: inherit;
  font-size: 17px;
  color: var(--ink);
  background: var(--light-2);
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}
.search input:focus {
  outline: none;
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(30, 39, 97, 0.08);
}
.search input::placeholder { color: #8B95AF; }
.search svg {
  position: absolute;
  left: 22px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  pointer-events: none;
}

/* ----- Filter chips ----- */
.filter-chips {
  max-width: var(--max-w);
  margin: 0 auto 40px;
  padding: 0 32px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.chip {
  padding: 8px 16px;
  border: 1px solid var(--rule);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

/* ----- Article grid ----- */
.article-grid {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 24px 32px 120px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 40px;
}

.article-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  border-radius: 20px;
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  background: #fff;
  border: 1px solid var(--rule);
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(30, 39, 97, 0.08);
  color: inherit;
  text-decoration: none;
}

.article-card .thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--light) 0%, var(--brand) 100%);
  position: relative;
  overflow: hidden;
}
.article-card .thumb::after {
  content: attr(data-topic);
  position: absolute;
  top: 20px;
  left: 20px;
  background: rgba(255,255,255,0.94);
  color: var(--brand);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  font-family: 'JetBrains Mono', monospace;
}
.article-card .thumb .thumb-glyph {
  position: absolute;
  bottom: 0;
  right: -20px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 220px;
  font-style: italic;
  font-weight: 500;
  color: rgba(255,255,255,0.18);
  line-height: 0.85;
  user-select: none;
}
.article-card .body {
  padding: 28px 26px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.article-card h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--brand);
  letter-spacing: -0.5px;
}
.article-card p.excerpt {
  font-size: 15px;
  color: var(--muted);
  line-height: 1.55;
}
.article-card .meta {
  display: flex;
  gap: 14px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
  letter-spacing: 0.3px;
  margin-top: 4px;
}
.article-card .meta .dot { width: 3px; height: 3px; background: var(--muted); border-radius: 50%; }

.no-results {
  grid-column: 1 / -1;
  text-align: center;
  padding: 80px 20px;
  color: var(--muted);
  font-size: 16px;
}

/* ----- Article page ----- */
.article-header {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 80px 32px 40px;
}
.breadcrumb {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  margin-bottom: 24px;
}
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }

.article-header h1 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.08;
  font-weight: 500;
  letter-spacing: -1px;
  color: var(--brand);
  margin-bottom: 24px;
}
.article-header .lede {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  line-height: 1.5;
  color: var(--muted);
  font-style: italic;
  margin-bottom: 32px;
}
.article-header .byline {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 20px 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
  color: var(--muted);
}
.article-header .byline .author { color: var(--ink); font-weight: 500; }
.article-header .byline .dot { width: 3px; height: 3px; background: var(--muted); border-radius: 50%; }

.article-body {
  max-width: var(--article-w);
  margin: 0 auto;
  padding: 32px 32px 80px;
}
.article-body p {
  font-size: 18px;
  line-height: 1.72;
  margin-bottom: 24px;
  color: var(--ink);
}
.article-body h2 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  letter-spacing: -0.6px;
  color: var(--brand);
  margin: 56px 0 20px;
  line-height: 1.15;
}
.article-body h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 24px;
  font-weight: 500;
  color: var(--ink);
  margin: 40px 0 12px;
  line-height: 1.2;
}
.article-body ul, .article-body ol {
  margin: 8px 0 28px 24px;
  padding-left: 6px;
}
.article-body li {
  font-size: 18px;
  line-height: 1.7;
  margin-bottom: 12px;
  color: var(--ink);
}
.article-body blockquote {
  border-left: 3px solid var(--brand);
  padding: 4px 24px;
  margin: 32px 0;
  color: var(--muted);
  font-style: italic;
  font-size: 20px;
  font-family: 'Cormorant Garamond', Georgia, serif;
  line-height: 1.5;
}
.article-body .callout {
  background: var(--light-2);
  border-left: 3px solid var(--brand);
  padding: 24px 28px;
  margin: 32px 0;
  border-radius: 4px;
}
.article-body .callout p:last-child { margin-bottom: 0; }
.article-body .callout .callout-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--brand);
  text-transform: uppercase;
  letter-spacing: 1.5px;
  font-weight: 600;
  margin-bottom: 10px;
}
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0 32px;
  font-size: 15px;
}
.article-body th, .article-body td {
  border-bottom: 1px solid var(--rule);
  text-align: left;
  padding: 12px 14px;
  vertical-align: top;
}
.article-body th {
  background: var(--light-2);
  font-weight: 600;
  color: var(--brand);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.article-body code {
  background: var(--light-2);
  padding: 2px 6px;
  border-radius: 4px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.9em;
  color: var(--brand);
}
.article-body strong { color: var(--brand); font-weight: 600; }

.article-body a { color: var(--brand); text-decoration: underline; text-underline-offset: 3px; }
.article-body a:hover { color: var(--accent); }

.article-body .footnote-sep {
  border: none;
  border-top: 1px solid var(--rule);
  margin: 56px 0 24px;
}
.article-body .footnotes {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
}
.article-body .footnotes p { font-size: 14px; margin-bottom: 12px; }

/* ----- Obridge CTA in article ----- */
.obridge-cta {
  margin: 64px auto 0;
  padding: 40px 36px;
  background: var(--brand);
  color: #fff;
  border-radius: 20px;
  max-width: var(--article-w);
}
.obridge-cta .cta-kicker {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--light);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.obridge-cta h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  line-height: 1.2;
  color: #fff;
  margin-bottom: 16px;
}
.obridge-cta p {
  color: rgba(255,255,255,0.85);
  font-size: 16px;
  margin-bottom: 24px;
}
.obridge-cta a.btn {
  display: inline-block;
  background: #fff;
  color: var(--brand);
  padding: 14px 28px;
  border-radius: 999px;
  font-weight: 600;
  text-decoration: none;
  font-size: 15px;
  transition: transform 0.15s;
}
.obridge-cta a.btn:hover { transform: translateY(-2px); }

/* ----- Related articles ----- */
.related-section {
  background: var(--light-2);
  padding: 80px 32px;
  margin-top: 40px;
}
.related-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}
.related-inner h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 32px;
  color: var(--brand);
  margin-bottom: 32px;
  text-align: center;
  letter-spacing: -0.5px;
}
.related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 32px;
}

/* ----- Footer ----- */
.site-footer {
  border-top: 1px solid var(--rule);
  padding: 48px 32px;
  background: #fff;
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
}
.site-footer a { color: var(--muted); text-decoration: none; margin-left: 24px; }
.site-footer a:hover { color: var(--brand); }

/* ----- Responsive ----- */
@media (max-width: 767px) {
  .nav-links { display: none; }
  .site-nav-inner > .nav-cta { display: none; }
  .nav-toggle { display: inline-flex; }
}
@media (max-width: 720px) {
  .site-nav-inner { padding: 14px 20px; }
  .blog-hero { padding: 60px 20px 32px; }
  .search-wrap { padding: 0 20px; }
  .filter-chips { padding: 0 20px; }
  .article-grid { padding: 24px 20px 80px; gap: 28px; }
  .article-header, .article-body { padding-left: 20px; padding-right: 20px; }
  .article-body p, .article-body li { font-size: 17px; }
  .obridge-cta { margin-left: 20px; margin-right: 20px; padding: 28px 24px; }
  .related-section { padding: 60px 20px; }
}
/* =============================================
   AI summary widget (article pages)
   ============================================= */
.ai-summary {
  max-width: var(--article-w);
  margin: 32px auto;
  padding: 0 32px;
}
.ai-summary-inner,
.ai-summary {
  box-sizing: border-box;
}
.ai-summary .ai-summary-lead {
  background: #1E2761;
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  border-radius: 16px 16px 0 0;
  padding: 20px 24px 12px;
  margin: 0;
}
.ai-summary-instant {
  background: #1E2761;
  padding: 2px 20px 4px;
}
.ai-summary-run {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 12px 18px;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ai-summary-run:hover:not(:disabled) {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
}
.ai-summary-run:disabled {
  opacity: 0.65;
  cursor: default;
}
.ai-summary-result {
  color: #FFFFFF;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  line-height: 1.6;
  margin-top: 12px;
}
.ai-summary-result ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.ai-summary-result li {
  position: relative;
  padding-left: 18px;
}
.ai-summary-result li::before {
  content: "\2013";
  position: absolute;
  left: 0;
  color: rgba(255, 255, 255, 0.6);
}
.ai-summary-result .ai-summary-error {
  color: #FFB4B4;
  margin: 0;
}
.ai-summary-sub {
  background: #1E2761;
  color: rgba(255, 255, 255, 0.7);
  font-family: 'Inter', sans-serif;
  font-size: 13px;
  font-weight: 500;
  margin: 0;
  padding: 14px 20px 8px;
}
.ai-summary-grid {
  background: #1E2761;
  border-radius: 0 0 16px 16px;
  padding: 4px 20px 20px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.ai-summary-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #FFFFFF;
  border-radius: 10px;
  padding: 12px 16px;
  text-decoration: none;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, border-color 0.15s, transform 0.15s;
}
.ai-summary-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.24);
  transform: translateY(-1px);
  color: #FFFFFF;
  text-decoration: none;
}
.ai-summary-btn svg {
  flex-shrink: 0;
  color: #FFFFFF;
}
@media (max-width: 640px) {
  .ai-summary-grid {
    grid-template-columns: 1fr;
  }
  .ai-summary {
    padding: 0 20px;
  }
}
