/* Afridyne Systems: Resources library (extends style.css, uses its variables) */

.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.75rem; font-size: 0.8rem; font-weight: 600; color: var(--muted); }
.badge { display: inline-block; padding: 0.2rem 0.55rem; border-radius: 4px; background: var(--paper); color: var(--teal-deep); border: 1px solid var(--mist); letter-spacing: 0.02em; }
.badge-amber { background: rgba(244, 180, 0, 0.16); border-color: var(--amber); color: var(--ink); }
.card-feature .badge { background: rgba(244, 247, 247, 0.1); border-color: rgba(244, 247, 247, 0.3); color: var(--paper); }
.card-feature .card-meta { color: rgba(244, 247, 247, 0.7); }

/* Article layout */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 3.5rem; align-items: start; }
.article-body { max-width: 46rem; min-width: 0; }
.article-body h2 { margin: 2.75rem 0 0.9rem; font-size: clamp(1.4rem, 2.6vw, 1.8rem); scroll-margin-top: 1.5rem; }
.article-body p, .article-body li { line-height: 1.7; }
.article-body ul, .article-body ol { padding-left: 1.3rem; }
.article-body code { font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, monospace; font-size: 0.9em; background: #e7eff0; color: var(--ink); padding: 0.12rem 0.38rem; border-radius: 4px; }
.article-body .note { margin-top: 1.5rem; margin-bottom: 1.5rem; }
.article-body .note strong { color: var(--teal-deep); }
.article-body .warn { border-left-color: #c0392b; }
.updated-line { color: var(--muted); font-size: 0.9rem; margin: 0 0 2rem; }

/* Copyable code blocks */
.code-block { margin: 1.25rem 0 1.6rem; background: var(--ink); color: var(--paper); border-radius: 8px; border: 1px solid #1e3946; overflow: hidden; }
.code-header { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.4rem 0.9rem; background: #0b181f; border-bottom: 1px solid #1e3946; font-size: 0.8rem; color: rgba(244, 247, 247, 0.7); font-family: ui-monospace, "Cascadia Code", Menlo, monospace; }
.copy-btn { font-family: var(--font-body); font-size: 0.78rem; font-weight: 600; padding: 0.25rem 0.7rem; border-radius: 4px; border: 1px solid rgba(244, 247, 247, 0.3); background: transparent; color: var(--paper); cursor: pointer; transition: background-color 0.15s, border-color 0.15s, color 0.15s; }
.copy-btn:hover { border-color: var(--amber); color: var(--amber); }
.copy-btn.copied { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.code-block pre { margin: 0; padding: 1rem 1.1rem; overflow-x: auto; font-family: ui-monospace, "Cascadia Code", "JetBrains Mono", Menlo, monospace; font-size: 0.9rem; line-height: 1.55; }
.code-block pre code { background: none; color: inherit; padding: 0; font-size: inherit; }

/* Sticky sidebar */
.article-aside { position: sticky; top: 1.5rem; display: flex; flex-direction: column; gap: 1.25rem; }
.aside-box { background: #fff; border: 1px solid var(--mist); border-radius: 8px; padding: 1.25rem; box-shadow: 0 1px 2px rgba(16, 34, 43, 0.06); }
.aside-box h3 { font-size: 1rem; margin-bottom: 0.75rem; color: var(--ink); }
.aside-box p { margin: 0 0 1rem; font-size: 0.92rem; color: var(--muted); line-height: 1.55; }
.aside-box .btn { padding: 0.6rem 1.1rem; font-size: 0.92rem; }
.toc-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 0.45rem; font-size: 0.9rem; }
.toc-list a { text-decoration: none; color: var(--muted); }
.toc-list a:hover { color: var(--teal); text-decoration: underline; }

/* Cheat-sheet tables */
.table-scroll { overflow-x: auto; margin: 1.1rem 0 2rem; border: 1px solid var(--mist); border-radius: 8px; background: #fff; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; }
.ref-table th { background: var(--teal-deep); color: var(--paper); text-align: left; padding: 0.7rem 1rem; font-family: var(--font-head); font-weight: 700; }
.ref-table td { padding: 0.7rem 1rem; border-top: 1px solid var(--mist); vertical-align: top; }
.ref-table td:first-child { white-space: nowrap; }
.ref-table tr:hover td { background: #f0f6f6; }
.ref-table code { white-space: nowrap; }

@media (max-width: 900px) {
  .article-layout { grid-template-columns: 1fr; gap: 2rem; }
  .article-aside { position: static; order: -1; }
}

@media print {
  .site-header, .ridge, .article-aside, .page-cta, .site-footer, .copy-btn, .to-top, .back-link { display: none !important; }
  .hero, .hero-inner { background: none; color: #000; min-height: 0; }
  .hero-inner .hero-body { padding: 0 0 1rem; }
  .hero-inner .lead { color: #333; }
  .article-layout { display: block; }
  .code-block, .table-scroll { break-inside: avoid; }
  .code-block { background: #fff; color: #000; border: 1px solid #999; }
  .code-header { background: #eee; color: #000; }
  .ref-table th { background: #ddd; color: #000; }
  body { background: #fff; }
}
