/* fledgetone.com/guide/: the guide's pages (written by scripts/guide-site.mjs). Builds on styles.css. */

html:has(body.guide-page) { scroll-padding-top: 84px; }
kbd {
  font: 500 .85em var(--mono); padding: .1em .45em; border-radius: 5px;
  border: 1px solid var(--border-2); border-bottom-width: 2px; background: var(--panel-2); color: var(--text);
}
.nav-links a[aria-current="page"] { color: var(--text); }

/* ---- The index ---- */
.g-index { padding-block: 72px 96px; }
.g-hero { max-width: 760px; }
.g-hero .mono-label { color: var(--cyan); margin-bottom: 12px; }
.g-hero h1 { font-size: clamp(36px, 5vw, 56px); -webkit-text-fill-color: currentColor; background: none; color: var(--text); }
.g-hero .lede { margin: 16px 0 0; text-align: left; }
.g-filter { display: flex; flex-direction: column; gap: 8px; margin-top: 32px; max-width: 420px; }
.g-filter input {
  font: 400 16px var(--sans); color: var(--text); background: var(--panel);
  border: 1px solid var(--border-2); border-radius: 10px; padding: 12px 14px;
}
.g-filter input:focus { outline: 2px solid var(--cyan); outline-offset: 1px; border-color: transparent; }

.g-cards { list-style: none; padding: 0; margin: 40px 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.g-cards a {
  display: flex; flex-direction: column; gap: 8px; height: 100%;
  padding: 20px 22px; border-radius: var(--radius); border: 1px solid var(--border);
  background: var(--panel); color: var(--text); transition: border-color .2s ease, transform .2s ease;
}
.g-cards a:hover { text-decoration: none; border-color: var(--cyan); transform: translateY(-2px); }
.g-cards h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.3; }
.g-cards p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--muted); flex: 1; }
.g-count { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--cyan); }
.g-none { margin-top: 32px; color: var(--muted); }

/* ---- A section ---- */
.g-layout {
  display: grid; grid-template-columns: 220px minmax(0, 1fr) 200px; gap: 48px; align-items: start;
  padding-block: 48px 96px;
}
.g-side, .g-toc { position: sticky; top: 88px; max-height: calc(100vh - 110px); overflow-y: auto; }
.g-sections summary { list-style: none; cursor: default; display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.g-sections summary::-webkit-details-marker { display: none; }
.g-sections summary .mono-label { color: var(--cyan); }
.g-current { display: none; }
.g-side ol, .g-toc ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.g-side a, .g-toc a {
  display: block; padding: 6px 10px; border-left: 2px solid transparent; border-radius: 0 6px 6px 0;
  font-size: 14px; line-height: 1.35; color: var(--muted);
}
.g-side a:hover, .g-toc a:hover { color: var(--text); text-decoration: none; background: var(--panel); }
.g-side a[aria-current="page"] { color: var(--text); border-left-color: var(--cyan); background: var(--panel); }
.g-toc .mono-label { margin: 0 0 10px; }
.g-toc a { font-size: 13px; padding-block: 4px; }

.g-article { min-width: 0; max-width: 740px; }
.g-crumbs { margin: 0 0 10px; font: 500 12px var(--mono); letter-spacing: .06em; color: var(--muted); }
.g-crumbs a { color: var(--muted); }
.g-article h1 {
  font-size: clamp(32px, 4.2vw, 46px); line-height: 1.1; margin-bottom: 18px;
  -webkit-text-fill-color: currentColor; background: none; color: var(--text);
}
.g-article h3 { margin: 44px 0 10px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; line-height: 1.25; }
.g-article h3 a { color: var(--text); }
.g-article h3 a:hover { text-decoration: none; }
.g-article h3 a::after { content: ' #'; color: var(--border-2); font-weight: 400; opacity: 0; transition: opacity .15s ease; }
.g-article h3:hover a::after { opacity: 1; }
.g-article p, .g-article li { color: #c9c9d1; line-height: 1.7; }
.g-article p { margin: 0 0 14px; }
.g-article ul, .g-article ol { margin: 0 0 16px; padding-left: 22px; display: grid; gap: 6px; }
.g-article li::marker { color: var(--muted); }
.g-article strong { color: var(--text); font-weight: 600; }
.g-article a { text-decoration: underline; text-decoration-color: rgba(6, 182, 212, .4); text-underline-offset: 3px; }
.g-article code { color: #a5f3fc; overflow-wrap: anywhere; }
.g-article p, .g-article li { overflow-wrap: break-word; }
.g-tip {
  margin: 18px 0; padding: 14px 18px; border-radius: 10px;
  border: 1px solid rgba(6, 182, 212, .3); background: rgba(6, 182, 212, .08); color: #cdeff5; line-height: 1.65;
}
.g-table { margin: 18px 0 22px; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; }
.g-table table { width: 100%; border-collapse: collapse; font-size: 14px; }
.g-table th, .g-table td { padding: 9px 14px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--border); }
.g-table th { color: var(--text); font-weight: 600; background: var(--panel); }
.g-table tr:last-child td { border-bottom: 0; }
.g-table td { color: #c9c9d1; }

.g-pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 56px; padding-top: 28px; border-top: 1px solid var(--border); }
.g-pager a {
  display: flex; flex-direction: column; gap: 4px; padding: 16px 18px;
  border: 1px solid var(--border); border-radius: 10px; background: var(--panel); color: var(--text); font-weight: 600;
}
.g-pager a:hover { text-decoration: none; border-color: var(--cyan); }
.g-next { text-align: right; }

/* Screenshots and clips */
.g-shot { margin: 22px 0 28px; }
.g-shot a { display: block; }
.g-shot img, .g-shot video {
  display: block; width: 100%; height: auto; border-radius: 10px;
  border: 1px solid var(--border-2); background: var(--panel);
  box-shadow: 0 18px 50px -20px rgba(0, 0, 0, .8);
}
.g-shot.narrow { max-width: min(100%, var(--w)); }
.g-shot figcaption { margin-top: 10px; font-size: 14px; line-height: 1.5; color: var(--muted); }
.g-shot .ai-note { display: block; margin-top: 4px; }
.g-shot.narrow figcaption { max-width: 420px; }

/* ---- Narrower screens ---- */
@media (max-width: 1100px) {
  .g-layout { grid-template-columns: 200px minmax(0, 1fr); }
  .g-toc { display: none; }
  .g-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .g-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 20px; }
  .g-side { position: static; max-height: none; overflow: visible; }
  .g-sections { border: 1px solid var(--border); border-radius: 10px; background: var(--panel); }
  .g-sections summary { cursor: pointer; flex-direction: row; align-items: center; gap: 10px; margin: 0; padding: 12px 14px; }
  .g-sections summary::after { content: '▾'; margin-left: auto; color: var(--muted); }
  .g-sections[open] summary::after { content: '▴'; }
  .g-current { display: inline; font-weight: 600; color: var(--text); }
  .g-sections ol { padding: 0 6px 10px; }
}
@media (max-width: 640px) {
  .g-index { padding-block: 48px 72px; }
  .g-cards { grid-template-columns: minmax(0, 1fr); }
  .g-pager { grid-template-columns: minmax(0, 1fr); }
  .g-next { text-align: left; }
  .g-article h3 { margin-top: 36px; font-size: 20px; }
}

/* The licences page */
.licenses .fineprint a, .licenses .lede a { text-decoration: underline; text-underline-offset: 3px; }
.lic-group { margin-top: 56px; }
.lic-group h2 { margin: 0 0 14px; font-size: 22px; font-weight: 700; }
.lic-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.lic-list li { border-bottom: 1px solid var(--border); }
.lic-list summary { display: flex; align-items: baseline; gap: 12px; padding: 12px 4px; cursor: pointer; list-style: none; }
.lic-list summary::-webkit-details-marker { display: none; }
.lic-list summary::before { content: '›'; color: var(--muted); transition: transform .15s ease; display: inline-block; width: 10px; }
.lic-list details[open] summary::before { transform: rotate(90deg); }
.lic-list summary:hover .lic-name { color: var(--cyan); }
.lic-name { flex: 1 1 auto; font-weight: 500; overflow-wrap: anywhere; }
.lic-tag { margin-left: auto; flex: 0 1 auto; max-width: 45%; text-align: right; font: 500 12px/1.4 var(--mono); color: var(--muted); }
.lic-list pre { margin: 0 0 16px; padding: 16px; max-height: 420px; overflow: auto; background: var(--panel); border: 1px solid var(--border); border-radius: 10px; font: 12.5px/1.55 var(--mono); color: #c4c4cc; white-space: pre-wrap; overflow-wrap: anywhere; }
/* A tool's README (/tools/<tool>/, scripts/tools-site.mjs) */
.tool-readme .g-article { max-width: 820px; }
.tool-readme .g-article h3 { margin-top: 40px; }
.tool-readme .g-article h4 { margin: 28px 0 8px; font-size: 18px; font-weight: 700; }
.tool-readme .g-article h3 a, .tool-readme .g-article h4 a { color: var(--text); text-decoration: none; }
.tool-readme .g-article pre.code code { background: none; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.tool-get { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 24px; }
.tool-get .btn { text-decoration: none; white-space: normal; line-height: 1.3; }
