/* Gratis Docs — dark theme styles for block template */

/* Sidebar column — sticky + scrollable */
.gratis-docs-sidebar-col {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-right: 1rem;
    border-right: 1px solid rgba(148, 163, 184, 0.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

/* Remove WP block spacing inside sidebar/toc columns */
.gratis-docs-sidebar-col > * + *,
.gratis-docs-sidebar-col .wp-block-shortcode,
.gratis-docs-toc-col > * + *,
.gratis-docs-toc-col .wp-block-shortcode {
    margin-top: 0 !important;
}

.gratis-docs-nav,
.gratis-docs-toc {
    margin-top: 0 !important;
}

/* Nav shortcode output */
.gratis-docs-nav {
    margin-top: 0;
}

.gratis-docs-nav__cat {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #94a3b8;
    margin: 1.25rem 0 0.35rem;
    padding: 0;
}

.gratis-docs-nav__cat:first-child {
    margin-top: 0;
}

.gratis-docs-nav__list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.gratis-docs-nav__list li a {
    display: block;
    padding: 0.25rem 0.6rem;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.82rem;
    border-radius: 4px;
    line-height: 1.4;
    transition: background 0.15s, color 0.15s;
}

.gratis-docs-nav__list li a:hover {
    background: rgba(148, 163, 184, 0.1);
    color: #e2e8f0;
}

.gratis-docs-nav__list li.is-active a {
    background: rgba(99, 102, 241, 0.15);
    color: #a5b4fc;
    font-weight: 500;
}

/* TOC column — sticky + scrollable */
.gratis-docs-toc-col {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    padding-left: 1rem;
    border-left: 1px solid rgba(148, 163, 184, 0.15);
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.2) transparent;
}

/* Hide TOC column when empty (no headings → JS hides it) */
.gratis-docs-toc-col:empty,
.gratis-docs-toc-col.is-hidden {
    display: none;
}

/* Remove WP block spacing inside TOC column */
.gratis-docs-toc-col > * + * {
    margin-top: 0 !important;
}

.gratis-docs-toc a {
    display: block;
    padding: 0.2rem 0;
    color: #94a3b8;
    text-decoration: none;
    font-size: 0.75rem;
    line-height: 1.4;
    transition: color 0.15s;
}

.gratis-docs-toc a:hover,
.gratis-docs-toc a.is-active {
    color: #a5b4fc;
}

.gratis-docs-toc a[data-level="3"] {
    padding-left: 0.75rem;
}

/* Main content styling */
.gratis-docs-main-col .wp-block-post-title,
.gratis-docs-main-col > h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.5rem;
    letter-spacing: -0.02em;
}

.gratis-docs-main-col h2 {
    font-size: 1.4rem;
    font-weight: 600;
    margin: 2.5rem 0 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid rgba(148, 163, 184, 0.15);
    color: #ffffff;
}

.gratis-docs-main-col h2:first-of-type,
.gratis-docs-main-col .wp-block-post-content h2:first-child {
    border-top: none;
    padding-top: 0;
    margin-top: 0;
}

.gratis-docs-main-col h3 {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 1.75rem 0 0.5rem;
    color: #f1f5f9;
}

.gratis-docs-main-col p {
    line-height: 1.75;
    color: #cbd5e1;
    margin-top: 0.75rem;
    margin-bottom: 0;
}

.gratis-docs-main-col ul,
.gratis-docs-main-col ol {
    padding-left: 1.5rem;
    margin: 0.75rem 0;
    color: #cbd5e1;
}

.gratis-docs-main-col li {
    margin: 0.3rem 0;
    line-height: 1.6;
}

.gratis-docs-main-col strong {
    color: #f1f5f9;
}

.gratis-docs-main-col code {
    background: rgba(148, 163, 184, 0.12);
    padding: 0.15rem 0.4rem;
    border-radius: 3px;
    font-size: 0.85em;
    color: #a5b4fc;
}

.gratis-docs-main-col pre,
.gratis-docs-main-col .wp-block-code {
    background: #1e293b !important;
    border: 1px solid rgba(148, 163, 184, 0.15);
    padding: 1rem 1.25rem;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
    margin: 1rem 0;
}

.gratis-docs-main-col pre code,
.gratis-docs-main-col .wp-block-code code {
    background: none;
    padding: 0;
    color: #e2e8f0;
    font-size: inherit;
}

.gratis-docs-main-col img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    border: 1px solid rgba(148, 163, 184, 0.15);
    margin: 1rem 0;
}

.gratis-docs-main-col table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.85rem;
}

.gratis-docs-main-col th,
.gratis-docs-main-col td {
    padding: 0.6rem 0.75rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    text-align: left;
}

.gratis-docs-main-col th {
    background: rgba(148, 163, 184, 0.08);
    font-weight: 600;
    color: #f1f5f9;
}

/* Archive grid */
.gratis-docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}

.gratis-docs-card {
    display: flex;
    flex-direction: column;
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.15);
    border-radius: 8px;
    text-decoration: none;
    color: #e2e8f0;
    transition: border-color 0.15s, background 0.15s;
    background: rgba(148, 163, 184, 0.03);
}

.gratis-docs-card:hover {
    border-color: #6366f1;
    background: rgba(99, 102, 241, 0.05);
}

.gratis-docs-card__title {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0 0 0.3rem;
    color: #ffffff;
}

.gratis-docs-card__desc {
    display: block;
    font-size: 0.8rem;
    color: #94a3b8;
    margin: 0;
    line-height: 1.4;
}

/* Responsive */
@media (max-width: 1024px) {
    .gratis-docs-sidebar-col {
        position: static;
        border-right: none;
        border-bottom: 1px solid rgba(148, 163, 184, 0.15);
        padding: 0 0 1rem;
        max-height: none;
        overflow: visible;
    }
    .gratis-docs-toc-col {
        display: none !important;
    }
}
