/* DotYAML – shared styles for all library pages */
:root {
  --brand: #2563eb;
  --brand-light: #eff6ff;
  --brand-dark: #1d4ed8;
  --text: #111827;
  --muted: #6b7280;
  --border: #e5e7eb;
  --bg: #ffffff;
  --radius: 10px;
  --mono: 'Courier New', Courier, monospace;
  --code-bg: #f1f5f9;
  --code-border: #e2e8f0;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: system-ui, -apple-system, sans-serif; color: var(--text); background: #f9fafb; line-height: 1.6; }

/* SITE NAV */
.site-nav {
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex; align-items: center; justify-content: space-between;
  height: 60px; position: sticky; top: 0; background: #fff; z-index: 100;
}
.logo { font-weight: 700; font-size: 1.2rem; color: var(--brand); text-decoration: none; letter-spacing: -0.5px; }
.logo span { color: var(--text); }
.site-nav ul { list-style: none; display: flex; gap: 8px; }
.site-nav ul a { text-decoration: none; color: var(--muted); font-size: 0.9rem; padding: 6px 12px; border-radius: 6px; transition: background .15s, color .15s; }
.site-nav ul a:hover, .site-nav ul a.active { background: var(--brand-light); color: var(--brand); }

/* BUTTONS */
.btn { display: inline-block; padding: 12px 24px; border-radius: var(--radius); font-weight: 600; font-size: 0.95rem; text-decoration: none; transition: all .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-outline { border: 1.5px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--brand); color: var(--brand); }

/* LAYOUT */
.outer { max-width: 1100px; margin: 0 auto; padding: 32px 24px 64px; display: grid; grid-template-columns: 220px 1fr; gap: 40px; }

/* TOC SIDEBAR */
.toc { position: sticky; top: 80px; align-self: start; }
.toc h2 { font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; color: var(--muted); margin-bottom: 12px; }
.toc ul { list-style: none; }
.toc li a { display: block; font-size: 0.85rem; color: var(--muted); text-decoration: none; padding: 5px 0; border-left: 2px solid var(--border); padding-left: 12px; transition: all .15s; }
.toc li a:hover, .toc li a.active { color: var(--brand); border-left-color: var(--brand); }

/* AD SLOTS */
.ad-leaderboard {
  max-width: 728px; margin: 16px auto 0;
  background: #fff; border: 1px dashed var(--border);
  height: 90px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.8rem; border-radius: var(--radius);
}
.ad-sidebar {
  background: #fff; border: 1px dashed var(--border);
  height: 280px; display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 0.8rem; border-radius: var(--radius);
  margin-top: 32px; width: 100%;
}

/* CONTENT AREA */
.content { min-width: 0; }
.breadcrumb { font-size: 0.82rem; color: var(--muted); margin-bottom: 10px; }
.breadcrumb a { color: var(--muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--brand); }
h1 { font-size: 1.8rem; font-weight: 800; letter-spacing: -0.5px; margin-bottom: 8px; }
.lead { color: var(--muted); font-size: 0.97rem; margin-bottom: 36px; }

/* SECTIONS */
.section { margin-bottom: 52px; scroll-margin-top: 80px; }
.section-label { font-size: 0.78rem; font-weight: 700; color: var(--brand); text-transform: uppercase; letter-spacing: 1.5px; margin-bottom: 10px; }
.section h2 { font-size: 1.15rem; font-weight: 700; margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1.5px solid var(--border); display: flex; align-items: center; gap: 10px; }
.section h2 .tag { font-size: 0.7rem; font-weight: 700; background: var(--brand-light); color: var(--brand); padding: 2px 8px; border-radius: 20px; text-transform: uppercase; letter-spacing: 1px; }

/* CODE BLOCKS */
.code-block { background: #fff; border: 1.5px solid var(--code-border); border-radius: var(--radius); overflow: hidden; margin-bottom: 24px; }
.code-block-label { padding: 8px 14px; font-size: 0.75rem; font-weight: 700; color: var(--muted); background: var(--code-bg); border-bottom: 1px solid var(--code-border); text-transform: uppercase; letter-spacing: 1px; display: flex; justify-content: space-between; align-items: center; }
.copy-btn { background: none; border: 1px solid var(--border); border-radius: 5px; padding: 3px 10px; font-size: 0.72rem; cursor: pointer; color: var(--muted); transition: all .15s; font-family: inherit; }
.copy-btn:hover { background: var(--brand-light); color: var(--brand); border-color: var(--brand); }
.copy-btn.copied { background: #d1fae5; color: #065f46; border-color: #10b981; }
pre { padding: 16px; font-family: var(--mono); font-size: 0.83rem; line-height: 1.8; overflow-x: auto; color: var(--text); }
code { font-family: var(--mono); font-size: 0.85rem; background: var(--code-bg); padding: 1px 5px; border-radius: 4px; }

/* YAML SYNTAX HIGHLIGHT */
.k { color: #2563eb; }   /* key */
.s { color: #16a34a; }   /* string value */
.n { color: #d97706; }   /* number */
.b { color: #9333ea; }   /* boolean */
.c { color: #9ca3af; font-style: italic; } /* comment */
.a { color: #dc2626; }   /* anchor / special */

/* CALLOUTS */
.note { background: var(--brand-light); border-left: 3px solid var(--brand); padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.88rem; color: #1e40af; margin: 16px 0; }
.warn { background: #fffbeb; border-left: 3px solid #f59e0b; padding: 12px 16px; border-radius: 0 var(--radius) var(--radius) 0; font-size: 0.88rem; color: #92400e; margin: 16px 0; }

/* CTA BANNER */
.cta-banner { background: var(--brand); color: #fff; border-radius: var(--radius); padding: 24px 28px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-bottom: 48px; }
.cta-banner p { font-size: 0.95rem; font-weight: 500; }
.cta-banner a { background: #fff; color: var(--brand); padding: 9px 20px; border-radius: 7px; font-weight: 700; font-size: 0.88rem; text-decoration: none; white-space: nowrap; }
.cta-banner a:hover { background: var(--brand-light); }

/* EXAMPLE CARDS */
.card-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; margin-top: 20px; }
.card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; display: block; background: #fff; }
.card:hover { border-color: var(--brand); box-shadow: 0 4px 20px rgba(37,99,235,.1); }
.card-icon { font-size: 1.4rem; margin-bottom: 10px; }
.card h3 { font-size: 1rem; font-weight: 700; margin-bottom: 5px; }
.card p { font-size: 0.85rem; color: var(--muted); line-height: 1.5; }
.card-tag { display: inline-block; margin-top: 10px; font-size: 0.73rem; font-weight: 600; color: var(--brand); background: var(--brand-light); padding: 2px 9px; border-radius: 20px; }

/* CATEGORY CARDS (larger, for main index) */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 24px; }
.cat-card { border: 1.5px solid var(--border); border-radius: var(--radius); padding: 24px; text-decoration: none; color: var(--text); transition: border-color .15s, box-shadow .15s; display: block; background: #fff; }
.cat-card:hover { border-color: var(--brand); box-shadow: 0 4px 20px rgba(37,99,235,.1); }
.cat-card-icon { font-size: 2rem; margin-bottom: 12px; }
.cat-card h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 6px; }
.cat-card p { font-size: 0.85rem; color: var(--muted); line-height: 1.5; margin-bottom: 12px; }
.cat-card .count { font-size: 0.75rem; font-weight: 600; color: var(--brand); background: var(--brand-light); padding: 3px 10px; border-radius: 20px; display: inline-block; }

/* RELATED EXAMPLES PANEL */
.related { background: #fff; border: 1.5px solid var(--border); border-radius: var(--radius); padding: 20px 24px; margin-top: 40px; }
.related h3 { font-size: 0.95rem; font-weight: 700; margin-bottom: 14px; }
.related ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.related li a { color: var(--brand); text-decoration: none; font-size: 0.88rem; }
.related li a:hover { text-decoration: underline; }
.related li .rel-cat { font-size: 0.75rem; color: var(--muted); margin-left: 6px; }

/* FOOTER */
footer { border-top: 1px solid var(--border); padding: 28px 24px; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; font-size: 0.85rem; color: var(--muted); background: #fff; }
footer a { color: var(--muted); text-decoration: none; }
footer a:hover { color: var(--brand); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; }
.made-by a { color: var(--brand); font-weight: 600; }

/* RESPONSIVE */
@media (max-width: 800px) { .outer { grid-template-columns: 1fr; } .toc { display: none; } }
@media (max-width: 600px) { .site-nav ul { display: none; } footer { flex-direction: column; text-align: center; } }
