/* ============================================================
   resources-inner.css — Optimized Scoped Layouts
   ============================================================ */
:root {
  --res-line: rgba(255,255,255,.08);
  --res-line2: rgba(255,255,255,.05);
  --res-orange: #ff6600;
  --res-orange-2: #ff8a33;
  --res-shadow: 0 28px 80px rgba(0,0,0,.42);
}

/* --- 1. Base & Container --- */
.resource-inner-page, .whitepaper-wrap, .integration-wrap, .api-wrap, .mh-wrap, .rn-wrap {
  color: #eef5ff; line-height: 1.58; padding-bottom: 80px;
}
.resource-inner-page .container, .whitepaper-wrap .container, .integration-wrap .container, .api-wrap .container, .mh-wrap .container, .rn-wrap .container {
  width: min(1380px, calc(100% - 40px)); margin: 0 auto;
}

/* --- 2. Sticky Topbar & Nav --- */
.resource-inner-page .topbar, .whitepaper-wrap .wp-topbar, .integration-wrap .ig-topbar, .api-wrap .api-topbar, .mh-wrap .mh-topbar, .rn-wrap .rn-topbar {
  position: sticky; top: 70px; z-index: 99; backdrop-filter: blur(16px); background: rgba(5,13,22,.72); border-bottom: 1px solid var(--res-line);
}
.resource-inner-page .topbar-inner, .whitepaper-wrap .wp-topbar-inner, .integration-wrap .ig-topbar-inner, .api-wrap .api-topbar-inner, .mh-wrap .mh-topbar-inner, .rn-wrap .rn-topbar-inner {
  min-height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 20px;
}
.resource-inner-page .ri-nav a, .whitepaper-wrap .wp-nav a, .integration-wrap .ig-nav a, .api-wrap .api-nav a, .mh-wrap .mh-nav a, .rn-wrap .rn-nav a {
  padding: 10px 14px; border-radius: 999px; color: #9db0c4; font-size: 14px; border: 1px solid transparent; transition: .2s ease; text-decoration: none;
}
.resource-inner-page .ri-nav a:hover, .whitepaper-wrap .wp-nav a:hover, .integration-wrap .ig-nav a:hover, .api-wrap .api-nav a:hover, .mh-wrap .mh-nav a:hover, .rn-wrap .rn-nav a:hover {
  border-color: var(--res-line); color: #eef5ff; background: rgba(255,255,255,.03);
}

/* --- 3. Eyebrows & Typography --- */
.resource-inner-page .eyebrow, .whitepaper-wrap .wp-eyebrow, .integration-wrap .ig-eyebrow, .api-wrap .api-eyebrow, .mh-wrap .mh-eyebrow, .rn-wrap .rn-eyebrow {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 13px; border-radius: 999px; background: rgba(255,102,0,.10); border: 1px solid rgba(255,102,0,.24); color: #ffd9bf; font-size: 12px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 18px;
}

/* --- 4. Core Glass Cards & Panels --- */
.resource-inner-page .hero-card, .whitepaper-wrap .wp-glass, .integration-wrap .ig-glass, .api-wrap .api-glass, .mh-wrap .mh-glass, .rn-wrap .rn-glass,
.resource-inner-page .study, .whitepaper-wrap .wp-panel, .integration-wrap .ig-panel, .api-wrap .api-panel, .mh-wrap .mh-panel, .rn-wrap .rn-panel,
.whitepaper-wrap .wp-chapter, .integration-wrap .ig-chapter, .api-wrap .api-chapter, .mh-wrap .mh-chapter, .rn-wrap .rn-chapter {
  background: linear-gradient(180deg, rgba(14,26,40,.92), rgba(8,17,28,.96)); border: 1px solid var(--res-line); box-shadow: var(--res-shadow); border-radius: 24px;
}
.resource-inner-page .hero-card, .whitepaper-wrap .wp-glass, .integration-wrap .ig-glass, .api-wrap .api-glass, .mh-wrap .mh-glass, .rn-wrap .rn-glass {
  border-radius: 34px; padding: 34px; position: relative; overflow: hidden;
}
.resource-inner-page .hero-card:before, .whitepaper-wrap .wp-glass:before, .integration-wrap .ig-glass:before, .api-wrap .api-glass:before, .mh-wrap .mh-glass:before, .rn-wrap .rn-glass:before {
  content: ""; position: absolute; right: -120px; top: -100px; width: 360px; height: 360px; border-radius: 50%; background: radial-gradient(circle, rgba(255,102,0,.16), transparent 62%); pointer-events: none;
}

/* --- 5. Button Architecture --- */
.resource-inner-page .btn, .whitepaper-wrap .wp-btn, .integration-wrap .ig-btn, .api-wrap .api-btn, .mh-wrap .mh-btn, .rn-wrap .rn-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; padding: 14px 18px; border-radius: 15px; font-weight: 800; border: 1px solid var(--res-line); background: rgba(255,255,255,.04); transition: .2s ease; text-decoration: none; color: #eef5ff;
}
.resource-inner-page .btn.primary, .whitepaper-wrap .wp-btn.primary, .integration-wrap .ig-btn.primary, .api-wrap .api-btn.primary, .mh-wrap .mh-btn.primary, .rn-wrap .rn-btn.primary {
  background: linear-gradient(135deg,var(--res-orange),var(--res-orange-2)); border: none; color: #fff; box-shadow: 0 14px 36px rgba(255,102,0,.24);
}
.resource-inner-page .btn:hover, .whitepaper-wrap .wp-btn:hover, .integration-wrap .ig-btn:hover, .api-wrap .api-btn:hover, .mh-wrap .mh-btn:hover, .rn-wrap .rn-btn:hover { transform: translateY(-2px); }
.resource-inner-page .btn.primary:hover, .whitepaper-wrap .wp-btn.primary:hover, .integration-wrap .ig-btn.primary:hover, .api-wrap .api-btn.primary:hover, .mh-wrap .mh-btn.primary:hover, .rn-wrap .rn-btn.primary:hover { box-shadow: 0 18px 42px rgba(255, 106, 0, 0.45); filter: brightness(1.1); }
.resource-inner-page .btn:not(.primary):hover, .whitepaper-wrap .wp-btn:not(.primary):hover, .integration-wrap .ig-btn:not(.primary):hover, .api-wrap .api-btn:not(.primary):hover, .mh-wrap .mh-btn:not(.primary):hover, .rn-wrap .rn-btn:not(.primary):hover { background: rgba(255, 255, 255, 0.08); border-color: rgba(255, 255, 255, 0.2); color: #fff; }
.resource-inner-page .brand {
  display: flex; align-items: center; gap: 14px; font-weight: 800; letter-spacing: .02em;
}
.resource-inner-page .logo {
  width: 38px; height: 38px; border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), #ff8f3f);
  position: relative; box-shadow: 0 10px 30px rgba(255,106,0,.25);
}
.resource-inner-page .logo:before, .resource-inner-page .logo:after {
  content: ""; position: absolute; inset: 8px;
  border: 2px solid rgba(255,255,255,.35); border-radius: 10px;
}
.resource-inner-page .logo:after { inset: 13px; border-width: 1px; opacity: .85; }
.resource-inner-page .ri-nav {
  display: flex; gap: 10px; flex-wrap: wrap;
}
.resource-inner-page .hero { padding: 72px 0 34px; }
.resource-inner-page .hero-grid {
  display: grid; grid-template-columns: 1fr; gap: 28px; align-items: stretch;
}
.resource-inner-page .hero-card, .resource-inner-page .study, .resource-inner-page .panel, 
.resource-inner-page .metric, .resource-inner-page .proof, .resource-inner-page .gallery-item, 
.resource-inner-page .architecture, .resource-inner-page .timeline-item, .resource-inner-page .stack-card {
  background: linear-gradient(180deg, rgba(14,26,40,.92), rgba(9,19,30,.92));
  border: 1px solid var(--line, rgba(255,255,255,.09));
  box-shadow: 0 20px 80px rgba(0,0,0,.45);
}
.resource-inner-page .hero-card {
  border-radius: 32px; padding: 34px; position: relative; overflow: hidden; max-width: 1000px; margin: 0 auto;
}
.resource-inner-page h1, .resource-inner-page h2, .resource-inner-page h3, .resource-inner-page h4 { margin: 0 0 12px; }
.resource-inner-page h1 { font-size: clamp(32px, 5vw, 62px); line-height: 1.02; letter-spacing: -.04em; }
.resource-inner-page h2 { font-size: clamp(28px, 3vw, 42px); line-height: 1.08; letter-spacing: -.03em; }
.resource-inner-page h3 { font-size: 22px; line-height: 1.18; }
.resource-inner-page h4 { font-size: 16px; line-height: 1.25; }
.resource-inner-page .lead { font-size: 18px; color: #c9d7e7; max-width: 820px; }
.resource-inner-page .hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.resource-inner-page .hero-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 26px;
}
.resource-inner-page .metric { border-radius: 18px; padding: 18px; }
.resource-inner-page .metric .k { font-size: 28px; font-weight: 800; letter-spacing: -.03em; }
.resource-inner-page .metric .l { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.resource-inner-page .section { padding: 36px 0 18px; }
.resource-inner-page .section-head {
  display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 22px;
}
.resource-inner-page .section-head p { max-width: 820px; color: var(--muted); margin: 0; }
.resource-inner-page .toc { display: flex; gap: 10px; flex-wrap: wrap; }
.resource-inner-page .toc a {
  padding: 11px 14px; border-radius: 999px; border: 1px solid var(--line, rgba(255,255,255,.09));
  background: rgba(255,255,255,.03); color: #d9e4ef; font-size: 14px; text-decoration: none;
}
.resource-inner-page .toc a:hover { border-color: rgba(255,106,0,.35); color: #fff; }
.resource-inner-page .study { 
  margin-top: 18px; 
  border-radius: 30px; 
  overflow: hidden; 
  scroll-margin-top: 170px; /* Accounts for both sticky navbars */
}
.resource-inner-page .study-header {
  padding: 28px 28px 18px;
  display: grid; grid-template-columns: 1fr auto; gap: 18px;
  border-bottom: 1px solid var(--line, rgba(255,255,255,.09));
  background:
    linear-gradient(180deg, rgba(255,255,255,.02), rgba(255,255,255,0)),
    radial-gradient(circle at 90% 12%, rgba(255,106,0,.10), transparent 24%);
}
.resource-inner-page .study-tagline { color: #ffccad; font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.resource-inner-page .study-sub { color: #cdd8e5; max-width: 900px; }
.resource-inner-page .study-code {
  align-self: start; padding: 12px 14px; border-radius: 16px;
  background: rgba(255,255,255,.04); border: 1px solid var(--line, rgba(255,255,255,.09));
  font-size: 13px; color: #cbd7e3;
}
.resource-inner-page .study-body { padding: 22px 28px 30px; display: grid; gap: 22px; }
.resource-inner-page .three { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.resource-inner-page .two { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.resource-inner-page .panel { border-radius: 22px; padding: 20px; }
.resource-inner-page .panel p:last-child, .resource-inner-page .proof p:last-child { margin-bottom: 0; }
.resource-inner-page .muted { color: var(--muted); }
.resource-inner-page ul { margin: 12px 0 0 18px; padding: 0; }
.resource-inner-page li { margin: 8px 0; }
.resource-inner-page .architecture { border-radius: 24px; padding: 22px; }
.resource-inner-page .arch-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; align-items: stretch; margin-top: 16px;
}
.resource-inner-page .stack-card {
  border-radius: 18px; padding: 16px; min-height: 140px;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  position: relative;
}
.resource-inner-page .stack-card .step {
  width: 28px; height: 28px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255,106,0,.14); color: #ffd1b7; font-size: 12px; font-weight: 800; margin-bottom: 10px;
}
.resource-inner-page .arrow { display: flex; align-items: center; justify-content: center; color: #7f93a8; font-weight: 900; }
.resource-inner-page .proof-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 16px; }
.resource-inner-page .proof { border-radius: 22px; padding: 20px; }
.resource-inner-page .proof-table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 14px; }
.resource-inner-page .proof-table td { padding: 10px 0; border-bottom: 1px solid var(--line, rgba(255,255,255,.09)); vertical-align: top; }
.resource-inner-page .proof-table td:first-child { color: var(--muted); width: 34%; }
.resource-inner-page .gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.resource-inner-page .gallery-item {
  border-radius: 22px; overflow: hidden; min-height: 230px; position: relative;
  background:
    radial-gradient(circle at 20% 20%, rgba(92,184,255,.18), transparent 24%),
    radial-gradient(circle at 80% 30%, rgba(255,106,0,.15), transparent 30%),
    linear-gradient(180deg, #102033, #0a1623);
}
.resource-inner-page .gallery-caption {
  position: absolute; left: 16px; right: 16px; bottom: 16px;
  padding: 12px 14px; border-radius: 16px;
  background: rgba(3,10,17,.72); border: 1px solid rgba(255,255,255,.08);
  backdrop-filter: blur(10px); font-size: 14px;
}
.resource-inner-page .wire {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(255,255,255,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.05) 1px, transparent 1px);
  background-size: 24px 24px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,.8), transparent);
}
.resource-inner-page .mock {
  position: absolute; inset: 20px 20px 76px;
  border-radius: 18px; border: 1px solid rgba(255,255,255,.12);
  background: linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  overflow: hidden; box-shadow: inset 0 1px 0 rgba(255,255,255,.04);
}
.resource-inner-page .mock .bar {
  height: 38px; border-bottom: 1px solid rgba(255,255,255,.08);
  display: flex; align-items: center; gap: 7px; padding: 0 12px; background: rgba(255,255,255,.03);
}
.resource-inner-page .dot { width: 8px; height: 8px; border-radius: 999px; background: rgba(255,255,255,.3); }
.resource-inner-page .mock .body { padding: 14px; }
.resource-inner-page .row { display: grid; gap: 10px; }
.resource-inner-page .row.r2 { grid-template-columns: 1.1fr .9fr; }
.resource-inner-page .row.r3 { grid-template-columns: repeat(3, 1fr); }
.resource-inner-page .cell {
  height: 56px; border-radius: 12px; border: 1px solid rgba(255,255,255,.08); background: rgba(255,255,255,.03);
}
.resource-inner-page .cell.tall { height: 140px; }
.resource-inner-page .timeline { display: grid; gap: 14px; }
.resource-inner-page .timeline-item {
  border-radius: 18px; padding: 16px 18px; display: grid; grid-template-columns: 120px 1fr; gap: 16px;
}
.resource-inner-page .phase {
  color: #ffd2b7; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; font-weight: 800;
}
@media (max-width: 1100px) {
  .resource-inner-page .hero-grid, .resource-inner-page .proof-grid, .resource-inner-page .two, 
  .resource-inner-page .three, .resource-inner-page .gallery, .resource-inner-page .arch-grid { grid-template-columns: 1fr; }
  .resource-inner-page .study-header { grid-template-columns: 1fr; }
  .resource-inner-page .timeline-item { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .resource-inner-page .container { width: min(1380px, calc(100% - 24px)); }
  .resource-inner-page .hero { padding-top: 40px; }
  .resource-inner-page .hero-card, .resource-inner-page .study-header, .resource-inner-page .study-body { padding-left: 18px; padding-right: 18px; }
  .resource-inner-page .hero-stats { grid-template-columns: 1fr; }
  .resource-inner-page .ri-nav { display: none; }
  .resource-inner-page .toc { overflow: auto; flex-wrap: nowrap; padding-bottom: 6px; }
}

/* This now ONLY affects article.blade.php and skips your mockups */
.ig-chapter-body.is-dynamic,
.ig-chapter-body.is-dynamic * {
    box-sizing: border-box !important;
    max-width: 100% !important;
    overflow-wrap: break-word;
    white-space: normal;
}

.ig-chapter-body.is-dynamic table {
    display: block;
    width: 100% !important;
    overflow-x: auto;
}

.ig-chapter-body.is-dynamic pre {
    white-space: pre-wrap !important;
    overflow-x: auto;
}

@media (max-width:1160px) {
  .rn-wrap .rn-hero-grid, .rn-wrap .rn-grid-4, .rn-wrap .rn-grid-3, .rn-wrap .rn-grid-2, .rn-wrap .rn-flow-grid, .rn-wrap .rn-metrics, .rn-wrap .rn-sticky-layout, .rn-wrap .rn-status-grid { grid-template-columns: 1fr 1fr; }
  .rn-wrap .rn-hero-grid, .rn-wrap .rn-sticky-layout { grid-template-columns: 1fr; }
  .rn-wrap .rn-chapter-head, .rn-wrap .rn-release-card { grid-template-columns: 1fr; }
  .rn-wrap .rn-nav { display: none; }
  .rn-wrap .rn-sidebar { position: relative; top: auto; }
}
@media (max-width:760px) {
  .rn-wrap .container { width: min(1380px, calc(100% - 24px)); }
  .rn-wrap .rn-hero-grid, .rn-wrap .rn-grid-4, .rn-wrap .rn-grid-3, .rn-wrap .rn-grid-2, .rn-wrap .rn-flow-grid, .rn-wrap .rn-metrics, .rn-wrap .rn-status-grid, .rn-wrap .rn-mini-grid { grid-template-columns: 1fr; }
  .rn-wrap .rn-glass, .rn-wrap .rn-chapter-head, .rn-wrap .rn-chapter-body, .rn-wrap .rn-toc-card, .rn-wrap .rn-pulse-board { padding-left: 18px; padding-right: 18px; }
  .rn-wrap .rn-chip-nav { overflow: auto; flex-wrap: nowrap; padding-bottom: 6px; }
  .rn-wrap .rn-timeline-card, .rn-wrap .rn-change-card { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
    .resource-inner-page .topbar, 
    .whitepaper-wrap .wp-topbar, 
    .integration-wrap .ig-topbar, 
    .api-wrap .api-topbar, 
    .mh-wrap .mh-topbar, 
    .rn-wrap .rn-topbar {
        position: relative !important;
        top: auto !important;
    }
}