/* SG Article Presentation — scoped to final article content only. */
.sgap-article{
  width:100%; max-width:var(--sgap-max-width,1180px); margin-inline:auto;
  font-size:clamp(var(--sgap-body-min,17px), calc(15.6px + .22vw), var(--sgap-body-max,20px));
  line-height:var(--sgap-line-height,1.75); overflow-wrap:anywhere;
  text-rendering:optimizeLegibility; -webkit-font-smoothing:antialiased;
}
.sgap-article p{margin:0 0 var(--sgap-p-space,1.05em)}
.sgap-article h2,.sgap-article h3{line-height:1.25; text-wrap:balance; scroll-margin-top:110px}
.sgap-article h2{font-size:clamp(var(--sgap-h2-min,27px),calc(24px + .8vw),var(--sgap-h2-max,38px));margin:var(--sgap-section-space,2rem) 0 .7em}
.sgap-article h3{font-size:clamp(var(--sgap-h3-min,21px),calc(19px + .45vw),var(--sgap-h3-max,29px));margin:1.55em 0 .6em}
.sgap-article h2:first-child,.sgap-article h3:first-child{margin-top:.4em}
.sgap-article ul,.sgap-article ol{margin:.65em 0 1.2em 1.35em;padding:0}
.sgap-article li{margin:.35em 0;padding-left:.2em}
.sgap-article a{text-underline-offset:.16em;text-decoration-thickness:.08em}
.sgap-article img,.sgap-article svg{max-width:100%;height:auto}
.sgap-article figure{max-width:100%;margin:1.6rem auto}
.sgap-article figcaption{font-size:.92em;line-height:1.55;margin-top:.65rem;opacity:.82}
.sgap-article code:not(pre code){font-size:.92em;padding:.12em .34em;border:1px solid rgba(127,127,127,.24);border-radius:.3em;background:rgba(127,127,127,.08)}
.sgap-article blockquote{margin:1.35em 0;padding:.75em 1.15em;border-inline-start:4px solid currentColor;background:rgba(127,127,127,.06)}
.sgap-article table{width:100%;max-width:100%;border-collapse:collapse;margin:1.4rem 0;font-size:clamp(var(--sgap-table-min,15px),calc(14px + .22vw),var(--sgap-table-max,18px));line-height:1.5}
.sgap-article th,.sgap-article td{padding:.7em .8em;border:1px solid rgba(127,127,127,.28);vertical-align:top;text-align:left}
.sgap-article th{font-weight:700;background:rgba(127,127,127,.09)}
/* SG Box: intentionally plain, with no heading, icon, label or semantic name. */
.sgap-article .sgap-box{display:block;margin:1.2rem 0 1.3rem;padding:.9rem 1rem;border:1px solid #bae6fd;border-radius:11px;background:#f0f9ff;color:#253247;box-shadow:none}
.sgap-article .sgap-box p{margin:0 0 .55rem;line-height:1.62}
.sgap-article .sgap-box p:last-child{margin-bottom:0}
.sgap-article .sgap-box code{padding:.08em .32em;border:1px solid #bae6fd;border-radius:5px;background:#e0f2fe;font-size:.92em}

.sgap-article .sgap-callout{--sgap-accent:#64748b;--sgap-tint:#f8fafc;display:block;margin:1.2rem 0 1.3rem;padding:.82rem .95rem .88rem;border:1px solid color-mix(in srgb,var(--sgap-accent) 24%,#e2e8f0);border-inline-start:4px solid var(--sgap-accent);border-radius:11px;background:var(--sgap-tint);box-shadow:none;overflow:hidden}
.sgap-article .sgap-callout-head{display:flex;align-items:center;gap:.48rem;margin:0 0 .38rem;padding:0;background:transparent;border:0;font-size:.96em;line-height:1.35}
.sgap-article .sgap-callout-icon{display:inline-grid;place-items:center;flex:0 0 auto;width:1.35rem;height:1.35rem;border:0;border-radius:0;background:transparent;color:var(--sgap-accent);box-shadow:none}
.sgap-article .sgap-callout-icon svg{display:block;width:1.15rem;height:1.15rem;fill:none;stroke:currentColor;stroke-width:1.9;stroke-linecap:round;stroke-linejoin:round}
.sgap-article .sgap-callout-title{color:#0f172a;font-weight:780}
.sgap-article .sgap-callout-body{padding:0;color:#253247}
.sgap-article .sgap-callout-body p{margin:0 0 .55rem;line-height:1.62}
.sgap-article .sgap-callout-body p:last-child{margin-bottom:0}
.sgap-article .sgap-note{--sgap-accent:#2563eb;--sgap-tint:#f7faff}
.sgap-article .sgap-tip{--sgap-accent:#059669;--sgap-tint:#f5fbf8}
.sgap-article .sgap-warning{--sgap-accent:#d97706;--sgap-tint:#fffaf2}
.sgap-article .sgap-example{--sgap-accent:#7c3aed;--sgap-tint:#faf8ff}
.sgap-article .sgap-important{--sgap-accent:#dc2626;--sgap-tint:#fff7f7}
.sgap-media-placeholder{border:1px dashed rgba(127,127,127,.45);border-radius:12px;padding:1rem;background:rgba(127,127,127,.035)}
.sgap-media-placeholder-inner{min-height:150px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;gap:.4rem}.sgap-media-placeholder-inner span{font-size:.9em;opacity:.75}
/* Give existing dedicated renderers enough room without overriding their own design. */
.sgap-article .sg-command-box,.sgap-article .sg-output-box,.sgap-article [class*="sg-command"],.sgap-article [class*="sg-output"]{max-width:100%}
.sgap-article .sgar-figure,.sgap-article [class*="sgar-"]{max-width:100%}
@media(max-width:700px){
  .sgap-article{font-size:max(16px,var(--sgap-body-min,17px));line-height:max(1.65,var(--sgap-line-height,1.75))}
  .sgap-article h2{font-size:max(25px,var(--sgap-h2-min,27px))}.sgap-article h3{font-size:max(20px,var(--sgap-h3-min,21px))}
  .sgap-article table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch;white-space:normal}
  .sgap-article th,.sgap-article td{min-width:130px;padding:.65em}
}
@media(min-width:1500px){.sgap-article{font-size:var(--sgap-body-max,20px)}}

/* v2.5.0 callouts are consolidated above; legacy duplicate rules removed. */

/* v2.2 Classic Editor compile-on-save polish */
.sgcae-inline-label{margin:1.15rem 0 .45rem!important;font-size:1.02em;color:#172554}
.sgcae-inline-label strong{font-weight:760}
.sgcae-reference-row,.sgcae-resource-row{margin:.55rem 0}
.sgcae-reference-row>a,.sgcae-resource-row>a{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:.2rem .8rem;align-items:center;text-decoration:none!important;border:1px solid #e2e8f0;border-radius:12px;padding:.78rem .95rem;background:linear-gradient(135deg,#fff,#f8fafc);transition:.15s ease}
.sgcae-reference-row>a:hover,.sgcae-resource-row>a:hover{transform:translateY(-1px);box-shadow:0 8px 20px rgba(15,23,42,.07);border-color:#cbd5e1}
.sgcae-reference-title{font-weight:760;color:#172554}
.sgcae-reference-url{grid-column:1;font-size:.84em;color:#64748b;overflow-wrap:anywhere}
.sgcae-reference-arrow{grid-column:2;grid-row:1/3;color:#475569;font-size:1.12em}
.sgcae-resource-row>a{grid-template-columns:1fr auto;color:#0f3c6e;font-weight:750}

.sgap-real-media{margin:1.4rem 0 1.8rem}.sgap-media-shell{position:relative;border-radius:18px;overflow:hidden;background:#0f172a;box-shadow:0 14px 36px rgba(15,23,42,.12);border:1px solid rgba(148,163,184,.28)}
.sgap-media-shell img{display:block;width:100%;height:auto;max-height:760px;object-fit:contain;background:#020617}.sgap-media-badge{position:absolute;top:12px;right:12px;padding:.38rem .62rem;border-radius:999px;background:rgba(15,23,42,.82);color:#fff;font-size:.78em;font-weight:700}.sgap-real-media figcaption{margin-top:.65rem;color:#64748b;font-size:.92em}
.sgap-media-required{border:1px dashed #f59e0b;background:linear-gradient(135deg,#fff7ed,#fff)}

/* v2.4.1 whitespace rhythm correction */

/* Paragraphs: preserve deliberate paragraph boundaries without giant gaps. */
.sgap-article p{
  margin-top:0;
  margin-bottom:1rem;
  line-height:1.7;
}

/* Consecutive paragraphs remain visually distinct. */
.sgap-article p + p{
  margin-top:.15rem;
}

/* Lists: compact inside, normal spacing around the whole list. */
.sgap-article ul,
.sgap-article ol{
  margin-top:.65rem;
  margin-bottom:1rem;
  padding-left:1.5rem;
}

.sgap-article li{
  margin:.28rem 0;
  line-height:1.55;
}

/* Prevent theme rules from creating oversized gaps between prose and a list. */
.sgap-article p + ul,
.sgap-article p + ol{
  margin-top:.45rem;
}

.sgap-article ul + p,
.sgap-article ol + p{
  margin-top:.2rem;
}

/* Standalone bold paragraphs should remain separate blocks. */
.sgap-article p > strong:only-child{
  display:block;
  line-height:1.55;
}

/* Do not render empty paragraphs as artificial whitespace. */
.sgap-article p:empty{
  display:none;
  margin:0;
  padding:0;
}

/* Technical blocks and callouts own their own spacing. */
.sgap-article .sgap-callout,
.sgap-article .sgar-visual,
.sgap-article .sgco-box,
.sgap-article .sgap-table-wrap{
  margin-top:1.15rem;
  margin-bottom:1.25rem;
}

/* Headings: enough separation without swallowing content. */
.sgap-article h2{
  margin-top:2rem;
  margin-bottom:.85rem;
}

.sgap-article h3{
  margin-top:1.45rem;
  margin-bottom:.65rem;
}

/* v2.4.2 direct article image rendering
   Real IMAGE/SCREENSHOT media is not a diagram card. */
.sgap-direct-image,
.sgap-real-media.sgap-direct-image{
  display:block;
  width:100%;
  max-width:100%;
  margin:1.2rem auto 1.5rem !important;
  padding:0 !important;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
  overflow:visible !important;
}

.sgap-direct-image img{
  display:block;
  width:auto !important;
  max-width:100% !important;
  height:auto !important;
  max-height:none !important;
  object-fit:contain;
  margin:0 auto;
  padding:0;
  border:0 !important;
  border-radius:0 !important;
  background:transparent !important;
  box-shadow:none !important;
}

.sgap-direct-image figcaption{
  margin:.55rem auto 0 !important;
  padding:0 .15rem;
  max-width:900px;
  text-align:center;
  color:#64748b;
  font-size:.92em;
  line-height:1.45;
}

/* Old shell/badge rules must never affect direct images. */
.sgap-direct-image .sgap-media-shell,
.sgap-direct-image .sgap-media-badge{
  display:none !important;
}

@media(max-width:700px){
  .sgap-direct-image{
    margin:1rem auto 1.2rem !important;
  }
  .sgap-direct-image img{
    width:100% !important;
    max-width:100% !important;
  }
}

/* v2.4.3 compact article profile */
.sgap-profile,
.sgap-article-profile,
.sgcae-article-profile{
  display:grid !important;
  grid-template-columns:repeat(6,minmax(0,1fr)) !important;
  gap:0 !important;
  width:100% !important;
  margin:1rem 0 1.25rem !important;
  border:1px solid #dbe3ee !important;
  border-radius:14px !important;
  overflow:hidden !important;
  background:#fff !important;
  box-shadow:0 8px 24px rgba(15,23,42,.04) !important;
}

.sgap-profile-item,
.sgap-profile > div,
.sgap-article-profile > div,
.sgcae-article-profile > div{
  min-width:0 !important;
  min-height:86px !important;
  padding:12px 13px !important;
  display:flex !important;
  flex-direction:column !important;
  justify-content:center !important;
  gap:4px !important;
  grid-column:auto !important;
  grid-row:auto !important;
  border:0 !important;
  border-right:1px solid #e7edf5 !important;
  background:#fff !important;
}

.sgap-profile-item:last-child,
.sgap-profile > div:last-child,
.sgap-article-profile > div:last-child,
.sgcae-article-profile > div:last-child{
  border-right:0 !important;
}

.sgap-profile-label,
.sgap-profile .label,
.sgap-article-profile .label,
.sgcae-article-profile .label,
.sgap-profile-item > strong:first-child{
  margin:0 !important;
  font-size:11px !important;
  line-height:1.2 !important;
  font-weight:800 !important;
  letter-spacing:.04em !important;
  text-transform:uppercase !important;
  color:#64748b !important;
}

.sgap-profile-value,
.sgap-profile .value,
.sgap-article-profile .value,
.sgcae-article-profile .value{
  margin:0 !important;
  font-size:14px !important;
  line-height:1.3 !important;
  font-weight:700 !important;
  color:#172554 !important;
  overflow-wrap:anywhere !important;
}

.sgap-profile-icon,
.sgap-profile svg,
.sgap-article-profile svg,
.sgcae-article-profile svg{
  width:17px !important;
  height:17px !important;
}

@media(min-width:1200px){
  .sgap-profile,
  .sgap-article-profile,
  .sgcae-article-profile{
    grid-template-columns:1fr .85fr .95fr .95fr 1.2fr 1.3fr !important;
  }
}

@media(min-width:701px) and (max-width:1199px){
  .sgap-profile,
  .sgap-article-profile,
  .sgcae-article-profile{
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
  }

  .sgap-profile-item,
  .sgap-profile > div,
  .sgap-article-profile > div,
  .sgcae-article-profile > div{
    min-height:78px !important;
    border-right:1px solid #e7edf5 !important;
    border-bottom:1px solid #e7edf5 !important;
  }
}

@media(max-width:700px){
  .sgap-profile,
  .sgap-article-profile,
  .sgcae-article-profile{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    margin:.8rem 0 1rem !important;
  }

  .sgap-profile-item,
  .sgap-profile > div,
  .sgap-article-profile > div,
  .sgcae-article-profile > div{
    min-height:70px !important;
    padding:10px 11px !important;
    border-right:1px solid #e7edf5 !important;
    border-bottom:1px solid #e7edf5 !important;
  }

  .sgap-profile-value,
  .sgap-profile .value,
  .sgap-article-profile .value,
  .sgcae-article-profile .value{
    font-size:13px !important;
  }
}

@media(max-width:420px){
  .sgap-profile,
  .sgap-article-profile,
  .sgcae-article-profile{
    grid-template-columns:1fr !important;
  }

  .sgap-profile-item,
  .sgap-profile > div,
  .sgap-article-profile > div,
  .sgcae-article-profile > div{
    min-height:60px !important;
    border-right:0 !important;
  }
}

/* v2.5.0 responsive callout tuning */
@media(max-width:600px){.sgap-article .sgap-callout{margin:1rem 0 1.1rem;padding:.72rem .78rem .76rem;border-radius:9px}.sgap-article .sgap-callout-head{margin-bottom:.3rem}.sgap-article .sgap-callout-body p{line-height:1.58}}

@media(max-width:600px){.sgap-article .sgap-box{margin:1rem 0 1.1rem;padding:.78rem .82rem;border-radius:9px}}
