/* Moey Icons site - shared by index.html (browse) and docs.html.
   The site itself is styled with Moey; the icons don't need Moey at all. */

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in oklab, var(--mo-bg-body) 88%, transparent);
  backdrop-filter: blur(10px);
}
.site-header .container { display: flex; align-items: center; gap: .75rem; min-height: 3.75rem; }
.site-brand { display: flex; align-items: center; gap: .5rem; font-weight: 700; font-size: 1.0625rem; color: var(--mo-fg-body); text-decoration: none; }
.site-brand .mi { font-size: 1.5rem; color: var(--mo-default-fg); }
.site-brand .badge { font-weight: 500; }
.site-nav { margin-inline-start: auto; }
.site-nav a { white-space: nowrap; }
.site-nav .site-ext .mi { font-size: .875em; color: var(--mo-fg-3); }
@media (width < 576px) {
  .site-brand .badge, .site-nav .site-ext { display: none; }
  .site-nav { gap: 0; }
}

/* ---------- Hero (browse page) ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; padding-block: 2.5rem 1.5rem; }
.hero > * { min-width: 0; }
.hero .code { overflow-x: auto; }
.hero .code code { white-space: pre-wrap; overflow-wrap: anywhere; }   /* the long CDN link wraps instead of hiding past the edge */
@media (width >= 1024px) { .hero { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); align-items: center; gap: 3rem; } }
.hero h1 { margin: 0 0 .75rem; font-size: clamp(1.75rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.1; letter-spacing: -.02em; }
.hero p { margin: 0; color: var(--mo-fg-2); font-size: 1.0625rem; max-width: 40rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.hero-stats { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; margin-top: 1.5rem; font-size: .875rem; color: var(--mo-fg-3); }
.hero-stats b { color: var(--mo-fg-body); font-variant-numeric: tabular-nums; }
.hero-art {
  display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .25rem;
  padding: 1rem; background: var(--mo-bg-surface); border-radius: var(--mo-radius-card);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); color: var(--mo-fg-2);
}
.hero-art span { display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--mo-radius-control); transition: background .15s, color .15s; }
.hero-art span:hover { background: var(--mo-default-bg-subtle); color: var(--mo-default-fg); }

/* ---------- Code ---------- */
.code {
  position: relative; margin: 0; padding: 1rem 1.25rem; overflow-x: auto;
  font: .8125rem/1.65 var(--mo-font-mono, ui-monospace, monospace);
  color: var(--mo-fg-body); background: var(--mo-bg-surface); border-radius: var(--mo-radius-card);
}
.code code { color: inherit; background: none; padding: 0; font-size: inherit; }
.code .c { color: var(--mo-fg-3); }
.demo + .code { border-start-start-radius: 0; border-start-end-radius: 0; }
.demo {
  display: flex; flex-wrap: wrap; align-items: center; gap: 1.25rem;
  padding: 1.5rem 1.25rem; background: var(--mo-bg-surface);
  border-radius: var(--mo-radius-card) var(--mo-radius-card) 0 0;
  border-bottom: 1px solid var(--mo-border-color);
}
.demo .lbl { display: grid; justify-items: center; gap: .375rem; }
.demo .lbl small { font-size: .6875rem; color: var(--mo-fg-3); font-family: var(--mo-font-mono, monospace); }

/* ---------- Docs layout ---------- */
.docs { display: grid; gap: 2rem; padding-block: 2rem 5rem; }
@media (width >= 1024px) { .docs { grid-template-columns: 13rem minmax(0, 1fr); gap: 3rem; } }
.docs-toc { display: none; }
@media (width >= 1024px) {
  .docs-toc { display: block; position: sticky; top: 4.75rem; align-self: start; max-height: calc(100dvh - 6rem); overflow-y: auto; }
}
.docs-toc .nav a { font-size: .875rem; }
.docs-body { max-width: 50rem; min-width: 0; }
.docs-body > section { scroll-margin-top: 4.5rem; padding-bottom: 1rem; }
.docs-body h1 { margin: 0 0 .5rem; letter-spacing: -.02em; }
.docs-body h2 { margin: 2.5rem 0 .75rem; font-size: 1.5rem; letter-spacing: -.01em; }
.docs-body h3 { margin: 1.75rem 0 .5rem; font-size: 1.0625rem; }
.docs-body p, .docs-body li { color: var(--mo-fg-2); }
.docs-body .lead { font-size: 1.125rem; }
.docs-body .demo, .docs-body .code, .docs-body .table-wrap { margin-block: .75rem 1.25rem; }
.docs-body .demo + .code { margin-top: 0; }
.table-wrap { overflow-x: auto; }
.docs-body table { width: 100%; font-size: .875rem; }
.docs-body th, .docs-body td { padding: .5rem .75rem; text-align: start; border-bottom: 1px solid var(--mo-border-color); vertical-align: top; }
.docs-body th { color: var(--mo-fg-body); font-weight: 600; }

/* Steps (installation) */
.steps-list { list-style: none; padding: 0; margin: 1rem 0; counter-reset: s; display: grid; gap: 1.25rem; }
.steps-list > li { counter-increment: s; display: grid; grid-template-columns: 1.75rem minmax(0, 1fr); gap: .25rem .75rem; }
.steps-list > li::before {
  content: counter(s); display: grid; place-items: center; width: 1.75rem; height: 1.75rem;
  border-radius: 50%; background: var(--mo-default-bg-subtle); color: var(--mo-default-fg); font-size: .8125rem; font-weight: 600;
}
.steps-list > li > * { grid-column: 2; margin: 0; }
.steps-list > li > :first-child { grid-row: 1; align-self: center; color: var(--mo-fg-body); font-weight: 600; }

/* Sources (above the footer) */
.sources { padding-block: 2.5rem; border-top: 1px solid var(--mo-border-color); }
.sources h2 { margin: 0 0 1.25rem; font-size: 1.25rem; letter-spacing: -.01em; }
.sources-grid { display: grid; gap: 1rem; }
@media (min-width: 768px) { .sources-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.sources-grid > div { padding: 1.25rem; border-radius: var(--mo-radius-card); background: var(--mo-bg-surface); }
.sources h3 { display: flex; align-items: center; gap: .5rem; margin: 0 0 .5rem; font-size: 1rem; }
.sources h3 .mi { font-size: 1.25rem; color: var(--mo-fg-2); }
.sources p { margin: 0; color: var(--mo-fg-2); font-size: .9375rem; }
.sources .sources-note { margin-top: 1.25rem; font-size: .875rem; color: var(--mo-fg-3); }

/* Support (Ko-fi) */
.site-support { flex-shrink: 0; }
.site-nav { flex-shrink: 0; }   /* never squeeze Docs under the next button; too wide shows up as overflow in the phone checks */
@media (width < 360px) {   /* smallest phones (down to 280px): tighter header */
  .site-header .container { gap: .25rem; }
  .site-nav a { padding-inline: .375rem; }
  .site-header #themeBtn { width: 2rem; height: 2rem; }
}
@media (width < 420px) { .site-support span { display: none; } }   /* the heart alone on small phones */
.support-note { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; margin-top: 1rem; padding: 1rem 1.25rem; border-radius: var(--mo-radius-card); background: var(--mo-pink-bg-subtle, var(--mo-bg-surface)); }
.support-note > .mi { font-size: 1.5rem; color: var(--mo-pink-fg, #db2777); }
.support-note p { flex: 1 1 16rem; margin: 0; color: var(--mo-fg-body); }

.support-dialog { width: min(28rem, calc(100vw - 2rem)); }
.support-frame { overflow: hidden; border-radius: var(--mo-radius-card); background: #fff; }
.support-frame iframe { display: block; width: 100%; height: 620px; max-height: calc(100dvh - 12rem); border: 0; }
.support-fine { margin: .75rem 0 0; font-size: .8125rem; color: var(--mo-fg-3); }

/* 404 page */
.notfound { max-width: 40rem; padding-block: 4rem 5rem; text-align: center; }
.notfound-icon { font-size: 3rem; color: var(--mo-fg-3); }
.notfound h1 { margin: 1rem 0 .75rem; }
.notfound .code { text-align: start; }
.notfound .code code { white-space: pre-wrap; overflow-wrap: anywhere; }
.notfound-actions { display: flex; flex-wrap: wrap; gap: .5rem; justify-content: center; margin-top: 1.5rem; }

/* Footer */
.site-footer { padding-block: 2rem; font-size: .8125rem; color: var(--mo-fg-3); border-top: 1px solid var(--mo-border-color); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: .5rem 1.5rem; justify-content: space-between; }

/* Demo + code read as one block; a demo on its own is fully rounded */
.docs-body .demo:has(+ .code) { margin-bottom: 0; }
.demo:not(:has(+ .code)) { border-radius: var(--mo-radius-card); border-bottom: 0; }
.moey-tile { display: inline-grid; flex-shrink: 0; place-items: center; width: 2rem; height: 2rem; color: var(--mo-bg-body); background: var(--mo-fg-body); border-radius: 22%; }
.moey-tile > .moey-mark { width: 72%; height: auto; margin-top: 3%; }   /* the cat-m, cut out of the tile - it inverts with the theme */

/* Version menu in the header */
.site-version { flex-shrink: 0; }
.site-version .dropdown-toggle { font-variant-numeric: tabular-nums; }
.site-version .dropdown-toggle.is-older { color: var(--mo-amber-soft-text); background: var(--mo-amber-soft); }
.site-version-menu { --mo-menu-min-width: 13rem; }
.site-version-menu .menu-item-label .badge { margin-inline-start: .375rem; font-size: .625rem; vertical-align: .1em; }
@media (width < 420px) { .site-brand { font-size: 0; gap: 0; } .site-header .container { gap: .5rem; } .site-nav a { padding-inline: .5rem; } }

/* Changelog */
.changelog { max-width: 52rem; padding-block: 2rem 4rem; }
.changelog > h1 { margin: 0 0 .5rem; font-size: 1.75rem; }
.changelog > .lead { margin: 0 0 2rem; color: var(--mo-fg-3); }
.release { padding: 1.5rem; margin-bottom: 1rem; background: var(--mo-bg-surface); border-radius: var(--mo-radius-card); scroll-margin-top: 5rem; }
.release.is-current { box-shadow: inset 0 0 0 2px var(--mo-blue-solid); }
.release-head { display: flex; flex-wrap: wrap; gap: .5rem .75rem; align-items: center; }
.release-head h2 { margin: 0; font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.release-head time { font-size: .875rem; color: var(--mo-fg-3); }
.release-use { margin-inline-start: auto; }
.release > p { margin: .75rem 0 0; }
.release h3 { margin: 1.25rem 0 .5rem; font-size: .875rem; }
.release h3 small { font-weight: 400; color: var(--mo-fg-3); }
.release-icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(7rem, 1fr)); gap: .5rem; padding: 0; margin: 0; list-style: none; }
.release-icons button { display: grid; gap: .5rem; place-items: center; width: 100%; padding: 1rem .5rem .75rem; font: inherit; font-size: .75rem; color: var(--mo-fg-2); cursor: pointer; background: var(--mo-bg-1); border: 0; border-radius: var(--mo-radius-control); }
.release-icons button:hover { color: var(--mo-default-fg-emphasis); background: var(--mo-default-bg-subtle); }
.release-icons .mi { font-size: 2rem; }
.release .code { margin: 0 0 .75rem; }
.release-more { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .75rem; }
.release-more .btn { max-width: 100%; white-space: normal; text-align: start; }   /* long labels wrap on the smallest phones */
.release-files { display: flex; flex-wrap: wrap; gap: .375rem; }

/* One-line header on every screen */
.site-nav { flex-wrap: nowrap; }
