/* =====================================================
   TranslateXYZ — Docs Landing Page
   /docs/  — sticky sidebar + 4 plugin sections + topic cards
   ===================================================== */

/* ===========================================
   HERO (dark gradient)
   =========================================== */
.docs-hero {
    background:
        radial-gradient(900px 500px at 80% -10%, rgba(48,178,48,0.20), transparent 60%),
        radial-gradient(700px 400px at 10% 110%, rgba(48,178,48,0.10), transparent 65%),
        linear-gradient(160deg, #0A1A0A 0%, #051005 100%);
    color: var(--text-on-dark);
    padding: var(--sp-9) 0 var(--sp-10);
    position: relative;
    overflow: hidden;
    text-align: center;
}
.docs-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(circle at 1px 1px, rgba(48,178,48,0.06) 1px, transparent 1.5px);
    background-size: 36px 36px;
    pointer-events: none;
    opacity: 0.5;
    mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
    -webkit-mask-image: radial-gradient(ellipse at center, #000 25%, transparent 75%);
}
.docs-hero__inner { position: relative; z-index: 1; max-width: 720px; margin: 0 auto; }
.docs-hero .breadcrumb { justify-content: center; margin-bottom: var(--sp-5); }
.docs-hero h1 {
    font-size: clamp(36px, 4.4vw, 56px);
    font-weight: var(--fw-extra);
    color: var(--text-on-dark-strong);
    letter-spacing: -0.025em;
    line-height: 1.05;
    margin: var(--sp-3) 0 var(--sp-4);
}
.docs-hero__lead {
    font-size: var(--fs-md);
    color: var(--text-on-dark-muted);
    line-height: var(--lh-relaxed);
    margin-bottom: 0;
}
.docs-hero .breadcrumb__list {
    justify-content: center;
}

/* ===========================================
   LAYOUT (sticky sidebar + sections)
   =========================================== */
.docs-section-wrap {
    padding: var(--sp-9) 0 var(--sp-12);
    background: var(--bg-light-subtle);
}
.docs-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: var(--sp-7);
    align-items: start;
}

/* ===========================================
   SIDEBAR — sticky plugin nav
   =========================================== */
.docs-sidebar {
    position: sticky;
    top: calc(var(--header-h-shrunk, 64px) + var(--sp-4));
}
.docs-nav {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: var(--sp-3);
    box-shadow: var(--sh-sm);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.docs-nav__title {
    font-size: 11px;
    font-weight: var(--fw-bold);
    color: var(--text-on-light-muted);
    text-transform: uppercase;
    letter-spacing: var(--ls-wider);
    padding: var(--sp-2) var(--sp-3) var(--sp-2);
}

.docs-nav-item {
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-3);
    border-radius: var(--r-md);
    text-decoration: none;
    color: inherit;
    transition: background var(--t-fast);
    border: 1px solid transparent;
}
.docs-nav-item:hover { background: var(--bg-light-subtle); }
.docs-nav-item.is-active {
    background: var(--green-50);
    border-color: var(--green-200);
}

.docs-nav-item__icon {
    width: 36px; height: 36px;
    flex-shrink: 0;
    object-fit: cover;
}
.docs-nav-item__name {
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--text-on-light-strong);
    line-height: 1.2;
}
.docs-nav-item__count {
    font-size: 11px;
    color: var(--text-on-light-muted);
    margin-top: 2px;
}
.docs-nav-item.is-active .docs-nav-item__name { color: var(--green-700); }
.docs-nav-item__arrow {
    margin-left: auto;
    width: 16px; height: 16px;
    color: var(--text-on-light-muted);
    flex-shrink: 0;
    opacity: 0;
    transition: opacity var(--t-fast), transform var(--t-fast);
}
.docs-nav-item.is-active .docs-nav-item__arrow {
    opacity: 1;
    color: var(--green-700);
}

/* ===========================================
   MAIN — sections
   =========================================== */
.docs-main {
    display: flex;
    flex-direction: column;
    gap: var(--sp-9);
}
.docs-section {
    scroll-margin-top: calc(var(--header-h-shrunk, 64px) + var(--sp-5));
}

.docs-section__header {
    display: flex;
    align-items: center;
    gap: var(--sp-4);
    padding-bottom: var(--sp-5);
    margin-bottom: var(--sp-5);
    border-bottom: 1px solid var(--border-light);
    flex-wrap: wrap;
}
.docs-section__icon {
    width: 56px; height: 56px;
    flex-shrink: 0;
}
.docs-section__heading {
    flex: 1;
    min-width: 0;
}
.docs-section__heading .eyebrow {
    margin-bottom: 6px;
}
.docs-section__heading h2 {
    font-size: var(--fs-2xl);
    font-weight: var(--fw-extra);
    color: var(--text-on-light-strong);
    letter-spacing: -0.02em;
    margin-bottom: 4px;
    line-height: 1.15;
}
.docs-section__heading p {
    font-size: var(--fs-sm);
    color: var(--text-on-light-muted);
    margin: 0;
    line-height: var(--lh-relaxed);
}
.docs-section__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: var(--fs-sm);
    font-weight: var(--fw-bold);
    color: var(--green-700);
    padding: 8px 14px;
    border: 1px solid var(--green-300);
    background: var(--green-50);
    border-radius: var(--r-pill);
    text-decoration: none;
    flex-shrink: 0;
    transition: all var(--t-fast);
}
.docs-section__cta:hover {
    background: var(--green-500);
    color: #fff;
    border-color: var(--green-500);
}
.docs-section__cta svg { width: 14px; height: 14px; }

/* Card grid */
.docs-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--sp-4);
}

/* Topic card — clickable external link */
.doc-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    text-decoration: none;
    color: inherit;
    position: relative;
    overflow: hidden;
    transition: transform var(--t-base), box-shadow var(--t-base), border-color var(--t-base);
    isolation: isolate;
}
.doc-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--green-50), transparent 60%);
    opacity: 0;
    transition: opacity var(--t-base);
    z-index: -1;
}
.doc-card:hover {
    transform: translateY(-3px);
    border-color: var(--green-500);
    box-shadow: 0 12px 28px rgba(48,178,48,0.10);
}
.doc-card:hover::before { opacity: 1; }

.doc-card__external {
    position: absolute;
    top: var(--sp-4);
    right: var(--sp-4);
    width: 28px; height: 28px;
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-on-light-muted);
    transition: all var(--t-base);
}
.doc-card:hover .doc-card__external {
    background: var(--green-500);
    color: #fff;
    border-color: var(--green-500);
    transform: translate(2px, -2px);
}
.doc-card__external svg { width: 12px; height: 12px; }

.doc-card__icon {
    width: 40px; height: 40px;
    background: var(--green-50);
    color: var(--green-700);
    border-radius: var(--r-md);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: var(--sp-3);
}
.doc-card__icon svg { width: 20px; height: 20px; }

.doc-card__title {
    font-size: var(--fs-base);
    font-weight: var(--fw-bold);
    color: var(--text-on-light-strong);
    margin-bottom: 4px;
    line-height: 1.25;
    letter-spacing: -0.01em;
    padding-right: 28px;
}
.doc-card__desc {
    font-size: var(--fs-sm);
    color: var(--text-on-light);
    line-height: var(--lh-relaxed);
}

/* ===========================================
   RESPONSIVE
   =========================================== */
@media (max-width: 1024px) {
    .docs-layout {
        grid-template-columns: 1fr;
        gap: var(--sp-6);
    }
    .docs-sidebar { position: static; }
    /* Plugin nav: was a horizontal scroll strip (4 items × 200px = 800px → off-screen).
       Switch to a 2-column grid so all 4 plugin filters fit inside the viewport
       without horizontal scrolling. */
    .docs-nav {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: var(--sp-2);
    }
    .docs-nav__title { display: none; }
    .docs-nav-item {
        min-width: 0;
        padding: var(--sp-3) var(--sp-3) var(--sp-3) var(--sp-2);
    }
    /* Hide the active-state arrow on the mobile filter grid (no room, less needed). */
    .docs-nav-item__arrow { display: none; }
    .docs-cards { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
    .docs-hero { padding: var(--sp-8) 0 var(--sp-9); }
    .docs-section__header { gap: var(--sp-3); }
    .docs-section__icon { width: 44px; height: 44px; }
    .docs-section__heading h2 { font-size: var(--fs-xl); }
    .docs-section__cta { width: 100%; justify-content: center; margin-top: var(--sp-3); }
    /* Slightly tighter padding inside each filter card on tablet portrait + phones */
    .docs-nav-item { padding: var(--sp-2); gap: var(--sp-2); }
    .docs-nav-item__icon { width: 28px; height: 28px; }
    .docs-nav-item__name { font-size: var(--fs-xs); }
    .docs-nav-item__count { font-size: 10px; }
}

@media (max-width: 480px) {
    /* On very narrow phones, stack the filters to a single column so the plugin
       name + parent-plugin line stay readable instead of getting cramped. */
    .docs-nav { grid-template-columns: 1fr; }
    .docs-nav-item { padding: var(--sp-3); }
    .docs-nav-item__icon { width: 32px; height: 32px; }
    .docs-nav-item__name { font-size: var(--fs-sm); }
    .docs-nav-item__count { font-size: 11px; }
}

@media (max-width: 640px) {
    .docs-cards { grid-template-columns: 1fr; }
}
