/* ============================================================
   Developer Guidelines Page — scoped to body.developer-guidelines-page
   TechGig theme: #d7263d
   ============================================================ */

body.developer-guidelines-page {
  --dg-brand: #d7263d;
  --dg-brand-dark: #b81e33;
  --dg-brand-soft: #fff5f6;
  --dg-brand-border: #fecdd3;
  --dg-ink: #19171a;
  --dg-muted: #64748b;
  --dg-surface: #f8f9fb;
  --dg-max: 1200px;
  --dg-pad: clamp(16px, 3vw, 32px);
  overflow-x: hidden;
}

/* ── Rev layout: let main-content keep its native layout so footer + site-header render normally.
   Page-specific resets live on .dg-page below, not on .main-content. ── */
body.developer-guidelines-page.page-developer-guidelines .main-content {
  background: transparent;
}

/* Page-specific full-bleed wrapper (replaces the previous .main-content reset) */
body.developer-guidelines-page .dg-page {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}

/* Scope header z-index to the site-header only — broad `header {}` selector was bleeding into
   footer sub-headers and breaking layout. */
body.developer-guidelines-page .site-header {
  position: relative;
  z-index: 200;
}

/* Solid bar over hero — do not override sticky/height (breaks TechGig nav layout) */
body.developer-guidelines-page .site-header.site-header-sticky:not(.sticky),
body.developer-guidelines-page section.site-header.site-header-sticky:not(.sticky) {
  background: #ffffff !important;
  box-shadow: 0 1px 0 rgba(25, 23, 26, 0.08) !important;
  border-bottom: 1px solid #eceef1 !important;
}

/* techmonk.css line 23622 hardcodes top:119px on the .sticky site-header assuming a top ad bar is
   present. On developer pages we set Page::$skip_ads = true (headerWithoutAds), so the ad bar is
   gone and that 119px leaves a gap at the top. Reset to 0 for these pages. */
body.developer-guidelines-page.headerWithoutAds section.site-header.site-header-sticky.sticky,
body.developer-guidelines-page section.site-header.site-header-sticky.sticky {
  top: 0 !important;
}

body.developer-guidelines-page .top-stripe-mc,
body.developer-guidelines-page #SkinningContainer {
  display: none !important;
}

/* Hide rev layout site sidebars and ad slots so only dg-layout shows */
body.developer-guidelines-page aside.sidebar,
body.developer-guidelines-page .col__right:not(.dg-main .col__right),
body.developer-guidelines-page .ad-slot-wrapper {
  display: none !important;
}

/* Ensure flex layout for sidebar+main */
body.developer-guidelines-page .dg-layout {
  display: flex !important;
  flex-wrap: nowrap !important;
}
body.developer-guidelines-page .dg-sidebar {
  flex: 0 0 220px !important;
  width: 220px !important;
}
body.developer-guidelines-page .dg-main {
  flex: 1 1 0% !important;
  min-width: 0 !important;
}

body.developer-guidelines-page .dg-main__panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: clamp(20px, 3vw, 32px);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  box-sizing: border-box;
}

/* ── Page shell ── */
body.developer-guidelines-page .dg-page {
  background: var(--dg-surface);
  min-height: 60vh;
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
  z-index: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Hero ── */
body.developer-guidelines-page .dg-hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #3d1219 45%, var(--dg-brand) 100%);
  padding: clamp(40px, 5vw, 56px) 0 clamp(32px, 4vw, 44px);
  position: relative;
  overflow: hidden;
  isolation: isolate;
  width: 100%;
}
body.developer-guidelines-page .dg-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  pointer-events: none;
}
body.developer-guidelines-page .dg-hero__inner {
  max-width: var(--dg-max);
  width: 100%;
  margin: 0 auto;
  padding: 0 var(--dg-pad);
  position: relative;
  z-index: 1;
  box-sizing: border-box;
}
body.developer-guidelines-page .dg-hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffd4da;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 20px;
  margin-bottom: 16px;
}
body.developer-guidelines-page .dg-hero__eyebrow::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #ffffff;
}
body.developer-guidelines-page .dg-hero__title {
  color: #ffffff;
  font-size: clamp(26px, 4vw, 34px);
  font-weight: 700;
  margin: 0 0 10px;
  line-height: 1.2;
  letter-spacing: -0.02em;
  text-transform: none;
}
body.developer-guidelines-page .dg-hero__sub {
  color: rgba(255, 255, 255, 0.82);
  font-size: 15px;
  margin: 0;
  line-height: 1.6;
  max-width: 640px;
}

/* ── Sidebar + main layout ── */
body.developer-guidelines-page .dg-layout {
  max-width: var(--dg-max);
  width: 100%;
  margin: 0 auto;
  padding: 28px var(--dg-pad) 64px;
  display: flex;
  align-items: flex-start;
  gap: 28px;
  box-sizing: border-box;
}
.dg-sidebar {
  flex: 0 0 220px;
  width: 220px;
  position: sticky;
  top: 16px;
  align-self: flex-start;
}
.dg-sidebar__nav {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
  overflow: hidden;
}
.dg-sidebar__list {
  list-style: none;
  margin: 0;
  padding: 8px 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.dg-sidebar__list li { margin: 0; }
.dg-sidebar__list li a {
  display: block;
  padding: 12px 16px;
  font-size: 13.5px;
  font-weight: 500;
  color: #64748b;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
  line-height: 1.4;
}
body.developer-guidelines-page .dg-sidebar__list li a:hover {
  color: var(--dg-brand);
  background: var(--dg-brand-soft);
}
body.developer-guidelines-page .dg-sidebar__list li.active a {
  color: var(--dg-brand);
  background: var(--dg-brand-soft);
  border-left-color: var(--dg-brand);
  font-weight: 600;
}
body.developer-guidelines-page .dg-main {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
}

body.developer-guidelines-page .dg-main h1,
body.developer-guidelines-page .dg-main h2,
body.developer-guidelines-page .dg-main h3,
body.developer-guidelines-page .dg-main h4,
body.developer-guidelines-page .dg-main h5,
body.developer-guidelines-page .dg-main h6 {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* ── Section header ── */
.dg-section-head {
  margin-bottom: 24px;
}
.dg-section-head h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 6px;
}
.dg-section-head p {
  font-size: 13.5px;
  color: #64748b;
  margin: 0;
}

/* ── Stats strip ── */
body.developer-guidelines-page .dg-stats {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 28px;
  max-width: 100%;
  min-width: 0;
}
body.developer-guidelines-page .dg-stat {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 140px;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}
.dg-stat__icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
body.developer-guidelines-page .dg-stat__icon--blue  { background: var(--dg-brand-soft); }
body.developer-guidelines-page .dg-stat__icon--blue svg { stroke: var(--dg-brand); }
.dg-stat__icon--green { background: #f0fdf4; }
.dg-stat__icon--amber { background: #fffbeb; }
.dg-stat__val  { font-size: 22px; font-weight: 700; color: #0f172a; line-height: 1; }
.dg-stat__label{ font-size: 11.5px; color: #64748b; margin-top: 2px; }

/* ── Modern table card (no horizontal page scroll) ── */
body.developer-guidelines-page .dg-table-card {
  background: #ffffff;
  border-radius: 14px;
  border: 1px solid #e2e8f0;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05);
  max-width: 100%;
  width: 100%;
  box-sizing: border-box;
}
body.developer-guidelines-page .dg-table-card__header {
  padding: 16px 20px;
  border-bottom: 1px solid #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
body.developer-guidelines-page .dg-table-card__title {
  font-size: 13px;
  font-weight: 600;
  color: #475569;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
body.developer-guidelines-page .dg-table-scroll {
  overflow-x: hidden;
  overflow-y: visible;
  max-width: 100%;
  width: 100%;
}

/* ── Table: fixed layout so library columns wrap inside the card ── */
body.developer-guidelines-page .dg-table {
  width: 100%;
  max-width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  font-size: 13px;
  color: #334155;
}
body.developer-guidelines-page .dg-table thead tr {
  background: #f8fafc;
  border-bottom: 2px solid #e2e8f0;
}
body.developer-guidelines-page .dg-table thead th {
  padding: 10px 12px;
  text-align: left;
  font-size: 10px;
  font-weight: 700;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: normal;
  line-height: 1.35;
  word-break: break-word;
}
body.developer-guidelines-page .dg-table thead th:nth-child(1) { width: 11%; }
body.developer-guidelines-page .dg-table thead th:nth-child(2) { width: 14%; }
body.developer-guidelines-page .dg-table thead th:nth-child(3) { width: 12%; }
body.developer-guidelines-page .dg-table thead th:nth-child(4) { width: 31%; }
body.developer-guidelines-page .dg-table thead th:nth-child(5) { width: 32%; }
body.developer-guidelines-page .dg-table tbody tr {
  border-bottom: 1px solid #f1f5f9;
  transition: background 0.1s;
}
body.developer-guidelines-page .dg-table tbody tr:last-child { border-bottom: none; }
body.developer-guidelines-page .dg-table tbody tr:hover { background: #f8fafc; }
body.developer-guidelines-page .dg-table td {
  padding: 12px;
  vertical-align: top;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

/* ── Language badge ── */
.dg-lang-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  font-size: 13.5px;
  color: #1e293b;
  white-space: nowrap;
}
.dg-lang-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #94a3b8;
}
/* Language dot colors via first letter heuristic */
.dg-lang--c    .dg-lang-dot { background: #3b82f6; }
.dg-lang--j    .dg-lang-dot { background: #f59e0b; }
.dg-lang--p    .dg-lang-dot { background: #22c55e; }
.dg-lang--r    .dg-lang-dot { background: #8b5cf6; }
.dg-lang--s    .dg-lang-dot { background: #f97316; }
.dg-lang--g    .dg-lang-dot { background: #06b6d4; }
.dg-lang--k    .dg-lang-dot { background: #6366f1; }
.dg-lang--h    .dg-lang-dot { background: #e11d48; }
.dg-lang--m    .dg-lang-dot { background: #0891b2; }
.dg-lang--o    .dg-lang-dot { background: #d97706; }
.dg-lang--l    .dg-lang-dot { background: #7c3aed; }

/* ── Version chip ── */
body.developer-guidelines-page .dg-table .dg-version {
  display: inline-block;
  max-width: 100%;
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
  padding: 3px 6px;
  border-radius: 5px;
  border: 1px solid #e2e8f0;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
}

/* ── Stat chips (time / memory) ── */
.dg-chip-row { display: flex; flex-direction: column; gap: 5px; }
.dg-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: #334155;
  white-space: nowrap;
}
.dg-chip__icon { font-size: 12px; opacity: 0.7; }
body.developer-guidelines-page .dg-chip--time   .dg-chip__icon { color: var(--dg-brand); }
.dg-chip--mem    .dg-chip__icon { color: #16a34a; }

/* ── Library tags ── */
body.developer-guidelines-page .dg-libs {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 100%;
  min-width: 0;
}
body.developer-guidelines-page .dg-lib-tag {
  display: inline-block;
  max-width: 100%;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  color: #475569;
  font-size: 11px;
  font-family: "SFMono-Regular", Consolas, monospace;
  padding: 2px 6px;
  border-radius: 4px;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-all;
  line-height: 1.35;
}
.dg-libs--empty { color: #94a3b8; font-size: 12.5px; font-style: italic; }

/* ── How-to-write content ── */
body.developer-guidelines-page .dg-howto {
  max-width: none;
  width: 100%;
  min-width: 0;
  overflow-wrap: break-word;
}
.dg-howto h4 { font-size: 18px; font-weight: 600; color: #0f172a; margin: 0 0 8px; }
.dg-howto h5 { font-size: 14px; font-weight: 600; color: #334155; margin: 20px 0 6px; }
.dg-howto p  { font-size: 14px; color: #475569; line-height: 1.7; margin: 0 0 14px; }
.dg-howto pre {
  background: #0f172a;
  color: #e2e8f0;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  padding: 18px 20px;
  border-radius: 10px;
  overflow-x: auto;
  line-height: 1.6;
  margin: 12px 0 20px;
}
body.developer-guidelines-page .dg-howto a { color: var(--dg-brand); text-decoration: none; }
body.developer-guidelines-page .dg-howto a:hover { color: var(--dg-brand-dark); text-decoration: underline; }

/* Hide discussion pagination chrome when embedded elsewhere on site */
body.developer-guidelines-page #disc-pagination-wrap,
body.developer-guidelines-page .disc-pagination-meta {
  display: none !important;
}

/* ── Mobile card layout ── */
@media (max-width: 767px) {
  body.developer-guidelines-page .dg-hero { padding: 28px 0 24px; }
  body.developer-guidelines-page .dg-layout {
    flex-direction: column;
    gap: 20px;
    padding: 20px 14px 48px;
  }
  body.developer-guidelines-page .dg-main__panel {
    padding: 18px 16px;
  }
  .dg-sidebar {
    flex: none;
    width: 100%;
    position: static;
  }
  .dg-sidebar__list {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding: 6px;
    gap: 4px;
  }
  .dg-sidebar__list li a {
    white-space: nowrap;
    border-left: none;
    border-bottom: 3px solid transparent;
    border-radius: 8px;
    padding: 10px 14px;
  }
  body.developer-guidelines-page .dg-sidebar__list li.active a {
    border-left: none;
    border-bottom-color: var(--dg-brand);
  }
  .dg-stats { flex-direction: column; gap: 10px; }
  .dg-table { display: none; }
  .dg-mobile-cards { display: block; }
}
@media (min-width: 768px) {
  .dg-mobile-cards { display: none; }
}

/* ── Mobile card ── */
.dg-mobile-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,0.05);
}
.dg-mobile-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.dg-mobile-card__meta { display: flex; flex-direction: column; gap: 8px; font-size: 13px; color: #475569; }
.dg-mobile-card__row { display: flex; align-items: center; gap: 8px; }
.dg-mobile-card__key { font-weight: 600; color: #64748b; font-size: 11px; text-transform: uppercase; min-width: 64px; }
.dg-mobile-card__libs { margin-top: 8px; }
.dg-mobile-card__libs-label { font-size: 11px; font-weight: 600; color: #64748b; text-transform: uppercase; margin-bottom: 5px; }
