/* MAKARENALABS | Full Page Article System
   Modern editorial reading layout for MakarenaLabs
   Inter + crisp typography | Palette: #087cff #39ef86 #06152e #101b36 */

:root {
  --blue: #087cff;
  --blue-hover: #0066d6;
  --green: #39ef86;
  --navy: #06152e;
  --ink: #101b36;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --bg-page: #f3f5f9;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color-scheme: light;
}

*, *::before, *::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.article-page {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-page);
  color: var(--ink);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

button, a {
  -webkit-tap-highlight-color: transparent;
}

button {
  font: inherit;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

::selection {
  color: var(--navy);
  background: var(--green);
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* Page shell matching MakarenaLabs standard layout */
.article-main-wrapper {
  max-width: 1360px;
  margin: 34px auto 45px;
  background: var(--paper);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 20px 80px rgba(29, 61, 103, 0.08);
}

/* Header & Nav */
.article-site-header {
  padding: 28px 36px 0;
  position: relative;
  z-index: 10;
}

.article-site-header .nav {
  height: 77px;
  border-radius: 19px;
  background: #fff;
  border: 1px solid #e7edf6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  box-shadow: 0 4px 20px rgba(16, 27, 54, 0.03);
}

.article-site-header .brand {
  display: flex;
  align-items: center;
  gap: 11px;
}

.article-site-header .brand-logo {
  height: 38px;
  width: auto;
  object-fit: contain;
}

.article-site-header .navlinks {
  display: flex;
  gap: 36px;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
}

.article-site-header .navlinks a {
  color: #52657c;
  transition: color 0.15s;
}

.article-site-header .navlinks a:hover,
.article-site-header .navlinks a.active {
  color: var(--blue);
}

.article-site-header .navlinks button.out {
  border: 1px solid #dce7f1;
  border-radius: 50px;
  padding: 9px 18px;
  background: #f8fafc;
  color: var(--navy);
  font-weight: 700;
  font-size: 12px;
  letter-spacing: 0.04em;
  transition: all 0.15s ease;
}

.article-site-header .navlinks button.out:hover {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
}

.article-site-header .mobile {
  display: none;
  font-size: 24px;
  cursor: pointer;
}

/* Breadcrumb navigation strip */
.article-breadcrumb-bar {
  padding: 20px 48px;
  border-top: 1px solid #f1f5f9;
  border-bottom: 1px solid #e7edf6;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: #fafcff;
  flex-wrap: wrap;
}

.article-back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--blue);
  text-decoration: none;
  transition: transform 0.15s, color 0.15s;
}

.article-back-link:hover {
  color: var(--blue-hover);
  transform: translateX(-3px);
}

.article-breadcrumb-trail {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
}

.article-breadcrumb-trail a {
  color: #64748b;
  text-decoration: none;
}

.article-breadcrumb-trail a:hover {
  color: var(--blue);
}

.article-breadcrumb-trail .current {
  color: var(--navy);
  font-weight: 650;
}

/* Article Container */
.popup-article,
.article-body-container {
  padding: 48px clamp(24px, 5.5vw, 84px) 72px;
}

.popup-article-header {
  position: relative;
}

.popup-eyebrow {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #64748b;
}

.popup-sector {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--blue);
}

.popup-sector::before {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(57, 239, 134, 0.45);
}

.popup-separator {
  height: 14px;
  width: 1px;
  background: #cbd5e1;
}

.popup-article-header h1,
#article-title,
.popup-title {
  margin: 20px 0 0;
  max-width: 960px;
  font-size: clamp(34px, 4.4vw, 58px);
  font-weight: 850;
  letter-spacing: -0.05em;
  line-height: 1.12;
  color: var(--navy);
  text-wrap: balance;
}

.popup-subtitle {
  max-width: 820px;
  margin: 22px 0 32px;
  color: #475569;
  font-size: clamp(17px, 1.6vw, 22px);
  line-height: 1.6;
  letter-spacing: -0.02em;
}

.popup-byline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 16px 0;
  margin-top: 26px;
  flex-wrap: wrap;
}

.popup-author {
  font-size: 13px;
  color: #64748b;
}

.popup-author strong {
  color: var(--navy);
  font-weight: 700;
  margin-left: 6px;
}

.popup-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.popup-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 18px;
  border: 1px solid #d7e3ee;
  border-radius: 50px;
  color: var(--navy);
  background: #fff;
  font-weight: 650;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popup-action svg {
  width: 15px;
  height: 15px;
  flex: none;
}

.popup-action:hover,
.popup-action.is-copied {
  border-color: var(--blue);
  background: #eff6ff;
  color: var(--blue);
}

.popup-cover {
  margin: 36px 0 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--navy);
  box-shadow: 0 12px 32px rgba(6, 21, 46, 0.08);
}

.popup-cover img {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: cover;
  display: block;
}

/* 2-Column reading layout */
.popup-reading-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(36px, 5.5vw, 84px);
  margin-top: 56px;
  align-items: start;
}

.popup-aside {
  position: sticky;
  top: 36px;
  align-self: start;
  max-height: calc(100vh - 72px);
  overflow-y: auto;
  padding-right: 12px;
  scrollbar-width: thin;
}

.popup-toc-label {
  font-size: 10.5px;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--navy);
  margin: 0 0 18px;
  text-transform: uppercase;
}

.popup-toc-label span {
  color: var(--blue);
  padding-left: 4px;
}

.popup-toc {
  display: flex;
  flex-direction: column;
  border-left: 2px solid #e2e8f0;
}

.popup-toc a {
  border-left: 2px solid transparent;
  margin-left: -2px;
  color: #64748b;
  font-size: 12.5px;
  line-height: 1.5;
  padding: 8px 14px;
  text-decoration: none;
  transition: all 0.15s ease;
}

.popup-toc a.toc-sub,
.popup-toc a[data-level="3"] {
  padding-left: 24px;
  font-size: 11.5px;
}

.popup-toc a:hover,
.popup-toc a.active {
  border-left-color: var(--blue);
  color: var(--blue);
  font-weight: 700;
  background: #f0f7ff;
  border-radius: 0 6px 6px 0;
}

/* Prose Typography */
.popup-prose {
  min-width: 0;
  max-width: 820px;
  font-size: 16.5px;
  font-weight: 450;
  line-height: 1.86;
  color: #334155;
}

.popup-prose > *:first-child {
  margin-top: 0;
}

.popup-prose p {
  margin: 0 0 26px;
}

.popup-prose p.opening {
  font-size: 21px;
  line-height: 1.65;
  color: var(--navy);
  font-weight: 500;
  letter-spacing: -0.02em;
  margin-bottom: 40px;
  border-left: 3px solid var(--blue);
  padding-left: 22px;
}

.popup-prose :is(h1, h2, h3, h4, h5, h6) {
  color: var(--navy);
  scroll-margin-top: 50px;
}

.popup-prose h1 {
  font-size: 36px;
  line-height: 1.18;
  letter-spacing: -0.05em;
  margin: 54px 0 22px;
  font-weight: 800;
}

.popup-prose h2 {
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -0.04em;
  font-weight: 750;
  margin: 52px 0 20px;
}

.popup-prose h3 {
  font-size: 23px;
  line-height: 1.32;
  letter-spacing: -0.03em;
  font-weight: 700;
  margin: 38px 0 16px;
}

.popup-prose h4 {
  font-size: 19px;
  letter-spacing: -0.02em;
  margin: 32px 0 14px;
  font-weight: 650;
}

.popup-prose h5,
.popup-prose h6 {
  font-size: 16px;
  margin: 26px 0 12px;
  font-weight: 650;
}

.popup-prose :is(ul, ol) {
  padding-left: 24px;
  margin: 22px 0 32px;
}

.popup-prose li {
  margin: 0 0 12px;
  padding-left: 4px;
}

.popup-prose li::marker {
  color: var(--blue);
}

.popup-prose a {
  color: var(--blue);
  text-decoration: underline;
  text-decoration-color: #a1cfff;
  text-underline-offset: 3px;
}

.popup-prose a:hover {
  text-decoration-color: var(--blue);
}

.popup-prose blockquote {
  margin: 40px 0 44px;
  padding: 6px 0 6px 26px;
  border-left: 3px solid var(--green);
  font-weight: 600;
  letter-spacing: -0.025em;
  font-size: 21px;
  line-height: 1.58;
  color: var(--navy);
}

.popup-prose blockquote footer {
  margin-top: 12px;
  font-size: 12px;
  font-weight: 550;
  color: #64748b;
  letter-spacing: 0;
}

.popup-prose figure {
  margin: 38px 0 42px;
}

.popup-prose figure img {
  width: 100%;
  height: auto;
  max-height: 520px;
  object-fit: contain;
  background: #edf2f8;
  border-radius: 12px;
  border: 1px solid #e2e8f0;
}

.popup-prose figcaption {
  margin-top: 12px;
  color: #64748b;
  font-size: 12px;
  line-height: 1.5;
}

/* Code panels: dark developer theme */
.popup-prose .code-wrap {
  margin: 34px 0 40px;
  max-width: 100%;
  overflow: hidden;
  background: #081b34;
  color: #dde8f8;
  border: 1px solid #163653;
  border-radius: 14px;
  box-shadow: 0 14px 34px rgba(6, 21, 46, 0.14);
}

.popup-prose .code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 11px 18px;
  min-height: 48px;
  border-bottom: 1px solid #29405b;
  color: #d4e6fa;
  background: #06152b;
}

.popup-prose .code-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  min-width: 0;
}

.popup-prose .code-indicator {
  width: 8px;
  height: 8px;
  background: var(--green);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(57, 239, 134, 0.35);
}

.popup-prose .code-language {
  font: 700 10.5px/1.4 'Inter', sans-serif;
  letter-spacing: 0.12em;
  color: var(--green);
}

.popup-prose .code-filename {
  font: 500 11.5px/1.4 'SFMono-Regular', Consolas, monospace;
  color: #93a8be;
  min-width: 0;
  overflow-wrap: anywhere;
}

.popup-prose .code-copy {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid #38536d;
  border-radius: 8px;
  padding: 6px 12px;
  color: #d4e6fa;
  background: rgba(255, 255, 255, 0.05);
  font: 600 11px/1.3 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.15s ease;
}

.popup-prose .code-copy:hover,
.popup-prose .code-copy.is-copied {
  border-color: var(--green);
  color: var(--green);
  background: rgba(57, 239, 134, 0.08);
}

.popup-prose .code-pre {
  margin: 0;
  padding: 18px 20px;
  max-width: 100%;
  width: 100%;
  overflow-x: auto;
  line-height: 1.75;
  font-size: 12.5px;
  tab-size: 4;
  scrollbar-width: thin;
  scrollbar-color: #5c7a9b #091b35;
}

.popup-prose code {
  font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
}

.popup-prose .tok-comment { color: #879db2; }
.popup-prose .tok-string { color: #a5edbd; }
.popup-prose .tok-variable { color: #ffb4cf; }
.popup-prose .tok-number { color: #f8c37f; }
.popup-prose .tok-option { color: #83cbf9; }
.popup-prose .tok-command,
.popup-prose .tok-keyword { color: #83b8ff; }
.popup-prose .tok-builtin { color: #d7a8ff; }

/* Callout, Tables & Multimedia */
.popup-prose .editorial-callout {
  margin: 34px 0;
  padding: 24px 28px;
  background: #eff6ff;
  border-left: 3px solid var(--blue);
  border-radius: 0 10px 10px 0;
}

.popup-prose .editorial-callout strong {
  display: block;
  color: var(--navy);
  font-size: 16px;
  margin-bottom: 8px;
}

.popup-prose .editorial-callout p {
  margin: 0;
}

.popup-prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 44px 0;
}

.popup-prose .table-scroll,
.popup-prose .table-wrap {
  overflow-x: auto;
  max-width: 100%;
  margin: 30px 0 40px;
}

.popup-prose table {
  border-collapse: collapse;
  min-width: 400px;
  width: 100%;
  font-size: 13.5px;
}

.popup-prose caption {
  text-align: left;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 12px;
}

.popup-prose th,
.popup-prose td {
  border-bottom: 1px solid var(--line);
  text-align: left;
  padding: 13px 15px;
  vertical-align: top;
}

.popup-prose th {
  background: #f0f6fd;
  color: var(--navy);
  font-weight: 700;
}

.popup-prose .responsive-embed {
  position: relative;
  margin: 32px 0 42px;
  width: 100%;
  aspect-ratio: 16 / 9;
}

.popup-prose .responsive-embed iframe {
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: 12px;
}

.popup-prose .audio-embed audio {
  width: 100%;
  max-width: 100%;
}

.popup-initial {
  padding: 110px 12%;
  font-size: 16px;
  color: var(--muted);
}

.popup-initial.error {
  color: #a52a36;
  line-height: 1.7;
}


/* Responsive */
@media (max-width: 960px) {
  .popup-reading-layout {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 36px;
  }
  .popup-article,
  .article-body-container {
    padding: 40px 32px 56px;
  }
}

@media (max-width: 768px) {
  .article-main-wrapper {
    margin: 16px 8px 32px;
    border-radius: 18px;
  }
  .article-site-header {
    padding: 16px 16px 0;
  }
  .article-site-header .nav {
    padding: 0 20px;
    height: 68px;
  }
  .article-site-header .navlinks {
    display: none;
  }
  .article-site-header .mobile {
    display: block;
  }
  .article-breadcrumb-bar {
    padding: 16px 20px;
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
  .popup-article,
  .article-body-container {
    padding: 32px 20px 48px;
  }
  .popup-article-header h1,
  #article-title,
  .popup-title {
    font-size: clamp(30px, 7vw, 44px);
    letter-spacing: -0.04em;
  }
  .popup-reading-layout {
    grid-template-columns: 1fr;
    gap: 32px;
    margin-top: 36px;
  }
  .popup-aside {
    position: static;
    max-height: none;
    padding-right: 0;
  }
  .popup-toc {
    flex-direction: row;
    overflow-x: auto;
    gap: 8px;
    border: 0;
    padding-bottom: 6px;
  }
  .popup-toc a,
  .popup-toc a[data-level] {
    border: 1px solid #d8e3ee;
    border-radius: 20px;
    white-space: nowrap;
    margin: 0;
    padding: 8px 14px;
    font-size: 11.5px;
  }
  .popup-toc a.active {
    border-color: var(--blue);
    background: #eff6ff;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
