/* Guide pages (docs/manager, docs/app), built by tools/guide_page.py. Works in light and dark mode. */
.hg { --r: 18px; --line: var(--md-default-fg-color--lightest); --card: var(--md-default-bg-color); margin-top: 1.5rem; }
.hg h2, .hg h3 { margin: 0; font-weight: 700; }
.hg-h { font-size: 1.15rem; margin-bottom: .8rem !important; }

/* start here */
.hg-start { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: .8rem; margin-bottom: 1.6rem; }
.hg-card { display: flex; gap: .75rem; align-items: center; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--card); color: var(--md-default-fg-color) !important; transition: transform .15s, box-shadow .15s, border-color .15s; }
.hg-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(30, 40, 90, .12); border-color: var(--md-accent-fg-color); }
.hg-card b { display: block; font-size: .8rem; }
.hg-card small { display: block; font-size: .66rem; color: var(--md-default-fg-color--light); margin-top: .15rem; }
.hg-ic { flex: none; width: 2.3rem; height: 2.3rem; border-radius: 12px; display: grid; place-items: center;
  background: linear-gradient(135deg, #455fe9, #7a3cf0); }
.hg-ic svg { width: 1.3rem; height: 1.3rem; fill: #fff; }

/* category menu */
.hg-nav { position: sticky; top: 2.4rem; z-index: 2; display: flex; flex-wrap: wrap; gap: .5rem; padding: .6rem .1rem; margin: 0 0 1.2rem;
  background: var(--md-default-bg-color); scrollbar-width: none; }
.hg-nav::-webkit-scrollbar { display: none; }
.hg-nav a { flex: none; display: flex; align-items: center; gap: .45rem; padding: .3rem .75rem .3rem .3rem; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--md-default-fg-color) !important; font-size: .68rem; white-space: nowrap; }
[dir=rtl] .hg-nav a { padding: .3rem .3rem .3rem .75rem; }
.hg-nav a:hover { border-color: var(--c); }
.hg-nav img, .hg-nav svg { flex: none; overflow: hidden; width: 1.9rem; height: 1.2rem; object-fit: cover; border-radius: 999px; }
.hg-nav small { color: var(--md-default-fg-color--light); font-size: .6rem; }

/* category */
.hg-cat { border: 1px solid var(--line); border-radius: calc(var(--r) + 4px); background: var(--card); padding: 1.1rem; margin: 0 0 1.4rem !important;
  scroll-margin-top: 6rem; box-shadow: 0 2px 14px rgba(30, 40, 90, .05); }
.hg-cat > header { display: flex; gap: 1.1rem; align-items: center; margin-bottom: 1rem; }
.hg-cat > header > img, .hg-cat > header > svg { flex: none; overflow: hidden; width: 208px; height: 130px; border-radius: 14px; object-fit: cover; }
.hg-cat > header h2 { font-size: 1.1rem; }
.hg-cat > header p { margin: .25rem 0 .4rem; font-size: .72rem; color: var(--md-default-fg-color--light); }
.hg-meta { display: inline-block; font-size: .62rem; padding: .1rem .55rem; border-radius: 999px; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); font-weight: 600; }
.hg-note { font-size: .7rem; margin: 0 0 1rem; padding: .6rem .8rem; border-radius: 12px; background: color-mix(in srgb, var(--c) 10%, transparent); }
.hg-note a { font-weight: 700; white-space: nowrap; }

/* article groups */
.hg-groups { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .9rem 1.4rem; }
.hg-g h3 { font-size: .74rem; color: var(--c); padding-bottom: .35rem; margin-bottom: .35rem !important; border-bottom: 2px solid color-mix(in srgb, var(--c) 25%, transparent); }
.hg-g ul { list-style: none; margin: 0 !important; padding: 0 !important; }
.hg-g li { margin: 0 !important; padding: .22rem 0; font-size: .7rem; line-height: 1.5; display: flex; gap: .35rem; align-items: baseline; }
.hg-g li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--c); opacity: .7; transform: translateY(-1px); }
.hg-a { color: var(--md-default-fg-color) !important; }
.hg-a:hover { color: var(--c) !important; text-decoration: underline; text-underline-offset: 3px; }
.hg-old { color: var(--md-default-fg-color--light) !important; }
.hg-badge { flex: none; font-size: .55rem; font-weight: 700; color: #fff; border-radius: 6px; padding: 0 .35rem; line-height: 1.5; white-space: nowrap; }
.hg-new { background: #e11d48; }
.hg-upd { background: #2563eb; }

/* videos */
.hg-videos { margin-top: 1.1rem; padding-top: .9rem; border-top: 1px dashed var(--line); }
.hg-vhead { display: flex; justify-content: space-between; align-items: center; margin-bottom: .6rem; }
.hg-vhead h3 { font-size: .74rem; }
.hg-count { font-size: .6rem; color: var(--md-default-fg-color--light); font-weight: 400; }
.hg-arrows { display: flex; gap: .3rem; }
.hg-arrows button { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1px solid var(--line); background: var(--card); cursor: pointer; display: grid; place-items: center; padding: 0; }
.hg-arrows button:disabled { opacity: .35; cursor: default; }
.hg-arrows svg { width: 1rem; height: 1rem; fill: var(--md-default-fg-color); }
[dir=rtl] .hg-arrows svg { transform: scaleX(-1); }
.hg-noscroll .hg-arrows { display: none; }
.hg-vrow { display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 3 * .8rem) / 4); gap: .8rem; overflow-x: auto;
  scroll-snap-type: x mandatory; scrollbar-width: thin; padding-bottom: .4rem; }
.hg-v { scroll-snap-align: start; color: var(--md-default-fg-color) !important; }
.hg-thumb { position: relative; display: block; aspect-ratio: 16 / 9; border-radius: 12px; overflow: hidden; background: var(--line); }
.hg-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .25s; }
.hg-v:hover .hg-thumb img { transform: scale(1.05); }
.hg-play { position: absolute; inset: 0; margin: auto; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: rgba(0, 0, 0, .55); }
.hg-play::after { content: ""; position: absolute; left: 54%; top: 50%; transform: translate(-50%, -50%); border-style: solid;
  border-width: .45rem 0 .45rem .7rem; border-color: transparent transparent transparent #fff; }
.hg-v:hover .hg-play { background: #e11d48; }
.hg-vt { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: .64rem; line-height: 1.5; margin-top: .35rem; }

/* old apps (app page) */
.hg-legacy { border: 1px dashed var(--line); border-radius: var(--r); padding: .8rem 1rem; margin-bottom: 1.4rem; }
.hg-legacy summary { cursor: pointer; font-size: .75rem; }
.hg-legacy summary small { display: block; color: var(--md-default-fg-color--light); font-size: .65rem; margin-top: .2rem; }
.hg-legacy .hg-videos { border-top: 0; }

@media (max-width: 760px) {
  .hg-cat { padding: .9rem; }
  .hg-cat > header > img, .hg-cat > header > svg { width: 112px; height: 70px; }
  .hg-vrow { grid-auto-columns: 62%; }
  .hg-nav { flex-wrap: nowrap; overflow-x: auto; }
}
