/* Help & Docs: landing hero + category grid, category listing, and the
   individual article layout (sidebar nav tree + sticky "on this page" TOC).
   Shares tokens with index.css (--primary-color, --glass-*, etc). */

.help-search-wrap { position: relative; max-width: 480px; margin: 1.6rem 0 1rem; }
.help-search-wrap--compact { max-width: none; margin: 0 0 1.2rem; }
.help-search-wrap--compact .help-search { padding: 0.6rem 0.9rem; border-radius: 10px; }
.help-search-wrap--compact .help-search i { font-size: 0.82rem; }
.help-search-wrap--compact .help-search input { font-size: 0.85rem; }
.help-search-wrap--compact .help-search-results { font-size: 0.85rem; }
.help-search {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.4rem;
    border-radius: 18px;
    background: var(--glass-background-raised);
    border: 1px solid var(--glass-border);
    backdrop-filter: blur(var(--glass-blur));
}
.help-search i { opacity: 0.45; font-size: 0.95rem; flex-shrink: 0; }
.help-search input {
    flex: 1;
    background: none;
    border: none;
    outline: none;
    color: #fff;
    font-family: inherit;
    font-size: 0.98rem;
}
.help-search input::placeholder { color: rgba(255, 255, 255, 0.4); }

.help-search-results {
    display: none;
    position: absolute;
    top: calc(100% + 0.6rem);
    left: 0;
    right: 0;
    z-index: 20;
    background: #17171c;
    border: 1px solid var(--glass-border);
    border-radius: 14px;
    box-shadow: var(--glass-shadow);
    overflow: hidden;
    text-align: left;
}
.help-search-results.open { display: block; }
.help-search-result {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem 1.1rem;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.help-search-result:last-child { border-bottom: none; }
.help-search-result:hover { background: rgba(169, 73, 243, 0.08); }
.help-search-result strong { font-size: 0.92rem; font-weight: 600; }
.help-search-result span { font-size: 0.78rem; opacity: 0.5; }
.help-search-empty { padding: 0.9rem 1.1rem; font-size: 0.85rem; opacity: 0.5; }

.help-discord-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    opacity: 0.6;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s;
    width: fit-content;
    margin-bottom: 1.6rem;
}
.help-discord-link:hover { opacity: 1; }

/* Category grid (docs home): big color tile + caption below, in the vein of
   Apple's Human Interface Guidelines landing page. Apple varies the tile hue
   per section to tell dozens of links apart; we only have five categories in
   one brand, so every tile stays on Callisto's own gradient instead. */
.help-cat-section-intro {
    font-size: 0.98rem;
    opacity: 0.6;
    max-width: 640px;
    margin: 0 0 1.6rem;
    line-height: 1.6;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.78rem;
}
.help-cat-section-intro--secondary { margin-top: 1.5rem; }

/* Featured homepage sections: Apple HIG's "Design fundamentals / Foundations
   of design" pattern. One stacked section per category, its own heading +
   blurb, then a row of colour-matched icon tiles, one per curated article
   (--cat-color set inline per section from HELP_CATEGORIES). */
.help-featured-stack {
    display: flex;
    flex-direction: column;
    gap: 1.3rem;
    margin-bottom: 1rem;
}
.help-featured-section-head { margin-bottom: 0.7rem; }
.help-featured-section-head h2 { margin: 0 0 0.35rem; font-size: 1.3rem; font-weight: 700; }
.help-featured-section-head p { margin: 0; font-size: 0.9rem; opacity: 0.55; max-width: 640px; line-height: 1.55; }
.help-featured-section-head a { color: var(--cat-color); text-decoration: underline; text-underline-offset: 2px; }
.help-featured-tiles {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}
.help-featured-tile-card {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    text-decoration: none;
    color: inherit;
}
.help-featured-tile {
    aspect-ratio: 16 / 10;
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 18% 0%, rgba(255, 255, 255, 0.32) 0%, transparent 55%),
        var(--cat-color);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.3),
        inset 0 -14px 24px rgba(0, 0, 0, 0.16),
        0 10px 24px color-mix(in srgb, var(--cat-color) 35%, transparent);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.help-featured-tile i { font-size: 3.4rem; color: #fff; filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.22)); }
.help-featured-tile-card:hover .help-featured-tile {
    transform: scale(1.02);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -14px 24px rgba(0, 0, 0, 0.16),
        0 14px 30px color-mix(in srgb, var(--cat-color) 48%, transparent);
}
.help-featured-tile-card span { font-size: 0.92rem; font-weight: 600; line-height: 1.35; }

@media (max-width: 700px) {
    .help-featured-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 480px) {
    .help-featured-tiles { grid-template-columns: 1fr; }
}

.help-cat-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem 1.25rem;
}
.help-cat-card {
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    text-decoration: none;
    color: inherit;
}
.help-cat-tile {
    aspect-ratio: 16 / 9;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(120% 140% at 18% 0%, rgba(255, 255, 255, 0.35) 0%, transparent 55%),
        var(--cat-color, var(--primary-gradient));
    border: 1px solid rgba(255, 255, 255, 0.16);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.35),
        inset 0 -16px 26px rgba(0, 0, 0, 0.14),
        0 10px 26px color-mix(in srgb, var(--cat-color, #a949f3) 35%, transparent);
    backdrop-filter: blur(2px);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.help-cat-tile i {
    font-size: 2.6rem;
    color: #fff;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.22));
}
.help-cat-card:hover .help-cat-tile {
    transform: scale(1.02);
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4),
        inset 0 -16px 26px rgba(0, 0, 0, 0.14),
        0 14px 32px color-mix(in srgb, var(--cat-color, #a949f3) 45%, transparent);
}
.help-cat-caption h3 { margin: 0 0 0.3rem; font-size: 1.05rem; font-weight: 600; }
.help-cat-caption p { margin: 0; font-size: 0.85rem; opacity: 0.55; line-height: 1.5; }
.help-cat-count { display: block; margin-top: 0.35rem; font-size: 0.76rem; opacity: 0.4; font-weight: 500; }

@media (max-width: 900px) {
    .help-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
    .help-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

.help-cta {
    text-align: center;
    padding: 3rem 0 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.help-cta p { opacity: 0.6; margin-bottom: 1rem; }

/* Shared doc shell: sidebar + content (+ TOC on article pages) */
.help-shell { max-width: 1240px; margin: 0 auto; padding: 9rem 2rem 6rem; }

.help-breadcrumb { font-size: 0.85rem; opacity: 0.45; margin-bottom: 1.2rem; }
.help-breadcrumb a { color: inherit; text-decoration: none; }
.help-breadcrumb a:hover { color: var(--primary-light); }
.help-breadcrumb .sep { margin: 0 0.4rem; opacity: 0.5; }
.help-breadcrumb .current { opacity: 0.75; }

.help-layout {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 3rem;
    align-items: start;
}
.help-layout.has-toc { grid-template-columns: 240px 1fr 220px; }

/* Sidebar nav tree. `.help-sidenav` is a real <nav> element, which also
   matches index.css's header `nav { display: grid; align-items: center; }`
   selector — align-items and width need restating here or every row
   collapses to shrink-to-fit and centers in the column instead of
   filling and left-aligning it. */
.help-sidenav {
    position: sticky;
    top: 104px;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.2rem;
}
.help-sidenav-section {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
}
.help-sidenav-cat {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.5rem 0.6rem;
    border-radius: 10px;
    font-size: 0.88rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.72);
    text-decoration: none;
    box-sizing: border-box;
}
.help-sidenav-cat i:first-child { font-size: 0.8rem; opacity: 0.65; flex-shrink: 0; width: 1rem; text-align: center; }
.help-sidenav-cat span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.help-sidenav-cat .chev { font-size: 0.65rem; opacity: 0.4; flex-shrink: 0; transition: transform 0.2s; }
.help-sidenav-cat:hover { background: rgba(255, 255, 255, 0.04); }
.help-sidenav-section.expanded .help-sidenav-cat {
    color: #fff;
    background: rgba(169, 73, 243, 0.1);
    border: 1px solid rgba(169, 73, 243, 0.25);
    padding: calc(0.5rem - 1px) calc(0.6rem - 1px);
}
.help-sidenav-section.expanded .help-sidenav-cat .chev { transform: rotate(180deg); opacity: 0.8; color: var(--primary-light); }

.help-sidenav-articles {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    padding: 0.3rem 0 0.4rem 1.6rem;
    box-sizing: border-box;
    gap: 0.05rem;
}
.help-sidenav-article {
    display: block;
    width: 100%;
    padding: 0.35rem 0.6rem;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    position: relative;
    box-sizing: border-box;
}
.help-sidenav-article:hover { color: rgba(255, 255, 255, 0.85); }
.help-sidenav-article.current {
    color: #fff;
    font-weight: 600;
    background: rgba(169, 73, 243, 0.1);
}
.help-sidenav-article.current::before {
    content: '';
    position: absolute;
    left: -0.7rem;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 14px;
    border-radius: 2px;
    background: var(--primary-gradient);
}

/* Category listing content */
.help-eyebrow {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--primary-light);
    opacity: 0.9;
}
.help-content h1 { font-size: clamp(2rem, 3.4vw, 2.6rem); font-weight: 700; margin: 0.6rem 0 0.75rem; }
.help-content .help-dek { font-size: 1.02rem; opacity: 0.6; max-width: 600px; margin: 0 0 2.2rem; line-height: 1.6; }

.help-article-list { display: flex; flex-direction: column; gap: 0.75rem; }
.help-article-row {
    display: flex;
    align-items: center;
    gap: 1.1rem;
    padding: 1.1rem 1.35rem;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.08);
    text-decoration: none;
    color: inherit;
    transition: background 0.2s, border-color 0.2s;
}
.help-article-row:hover { background: rgba(169, 73, 243, 0.06); border-color: rgba(169, 73, 243, 0.25); }
.help-article-row-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}
.help-article-row-icon i { font-size: 0.9rem; color: var(--primary-light); }
.help-article-row-text { flex: 1; min-width: 0; }
.help-article-row-text h4 { margin: 0 0 0.2rem; font-size: 0.96rem; font-weight: 600; }
.help-article-row-text p { margin: 0; font-size: 0.82rem; opacity: 0.5; }
.help-article-row-chev { font-size: 0.75rem; opacity: 0.3; flex-shrink: 0; }

/* Article page */
.help-article-meta {
    font-size: 0.82rem;
    opacity: 0.4;
    margin-bottom: 2.4rem;
    padding-bottom: 1.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.help-article-body { max-width: 660px; }
.help-article-body h2 { font-size: 1.28rem; font-weight: 600; margin: 2.4rem 0 0.9rem; scroll-margin-top: 110px; }
.help-article-body h1:first-child,
.help-article-body h2:first-child { margin-top: 0; }
.help-article-body p { font-size: 0.97rem; line-height: 1.75; opacity: 0.75; margin: 0 0 1rem; }
.help-article-body ul,
.help-article-body ol { margin: 0 0 1rem; padding-left: 1.3rem; }
.help-article-body ol { list-style: decimal; }
.help-article-body li { font-size: 0.95rem; line-height: 1.7; opacity: 0.75; margin-bottom: 0.4rem; }
.help-article-body li::marker { color: var(--primary-light); font-weight: 600; }
.help-article-body a { color: var(--primary-light); }
.help-article-body strong { color: #fff; font-weight: 600; }
.help-article-body code {
    background: rgba(255, 255, 255, 0.07);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    padding: 0.1rem 0.4rem;
    font-size: 0.88em;
}

/* GFM-style pipe tables (| a | b |), e.g. the Pterodactyl -> Aurora mapping */
.help-table-wrap {
    overflow-x: auto;
    margin: 0 0 1.4rem;
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    background: var(--glass-background-raised);
}
.help-article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 420px;
}
.help-article-body th,
.help-article-body td {
    text-align: left;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--glass-border);
    line-height: 1.5;
}
.help-article-body th {
    font-weight: 700;
    color: #fff;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    background: rgba(255, 255, 255, 0.04);
    white-space: nowrap;
}
.help-article-body td { opacity: 0.8; }
.help-article-body td strong { opacity: 1; }
.help-article-body tbody tr:last-child th,
.help-article-body tbody tr:last-child td { border-bottom: none; }
.help-article-body tbody tr:hover { background: rgba(255, 255, 255, 0.03); }

/* Sticky TOC */
.help-toc { position: sticky; top: 104px; font-size: 0.83rem; }
.help-toc-label { font-size: 0.7rem; font-weight: 700; letter-spacing: 0.08em; opacity: 0.35; margin-bottom: 0.9rem; }
.help-toc-link {
    display: block;
    padding: 0.35rem 0 0.35rem 0.85rem;
    border-left: 2px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    margin-bottom: 0.1rem;
}
.help-toc-link:hover { color: rgba(255, 255, 255, 0.85); }

@media (max-width: 900px) {
    .help-layout, .help-layout.has-toc { grid-template-columns: 1fr; }
    .help-sidenav { position: static; }
    .help-toc { display: none; }
}
