/* Taisyklių puslapis: šoninė skyrių juosta ir taisyklių sąrašas. */

.docs-shell {
    display: grid;
    grid-template-columns: 17rem minmax(0, 1fr);
    gap: 3rem;
    width: 100%;
    max-width: 78rem;
    margin: 0 auto;
    padding: 6.5rem 1.5rem 5rem;
}

.docs-sidebar {
    position: sticky;
    top: 6.5rem;
    align-self: start;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    padding-right: 0.5rem;
}

.docs-sidebar-label {
    margin-bottom: 0.9rem;
    padding-left: 0.85rem;
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.09em;
    text-transform: uppercase;
    color: #555555;
}

.docs-nav {
    display: grid;
    gap: 0.2rem;
}

.docs-nav-item {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    padding: 0.6rem 0.85rem;
    border: 1px solid transparent;
    border-radius: 6px;
    color: #aaaaaa;
    font-size: 0.875rem;
    font-weight: 500;
    text-align: left;
    transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.docs-nav-item:hover {
    background: rgba(255, 255, 255, 0.04);
    color: #fff;
}

.docs-nav-item-active {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.12);
}

.docs-nav-count {
    margin-left: auto;
    font-size: 0.72rem;
    font-weight: 600;
    color: #555555;
}

.docs-nav-item-active .docs-nav-count { color: #aaaaaa; }

.docs-updated {
    margin-top: 1.5rem;
    padding-left: 0.85rem;
    font-size: 0.72rem;
    color: #555555;
}

.docs-main { min-width: 0; }

.docs-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-bottom: 1.1rem;
    font-size: 0.78rem;
    color: #555555;
}

.docs-breadcrumb a { transition: color 0.16s ease; }
.docs-breadcrumb a:hover { color: #aaaaaa; }
.docs-breadcrumb-current { color: #aaaaaa; }

.docs-title {
    font-size: clamp(1.9rem, 3.4vw, 2.5rem);
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.015em;
    color: #fff;
}

.docs-summary {
    margin-top: 0.6rem;
    color: #aaaaaa;
    font-size: 0.95rem;
    line-height: 1.6;
}

.docs-divider {
    margin: 2rem 0 1.75rem;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-rules {
    display: grid;
    gap: 0.6rem;
}

.docs-rule {
    position: relative;
    display: grid;
    grid-template-columns: 2.15rem minmax(0, 1fr) 1.5rem;
    align-items: start;
    gap: 0.85rem;
    padding: 1rem 1.1rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #c9c9c9;
    line-height: 1.65;
    scroll-margin-top: 6.5rem;
    transition: background-color 0.16s ease, border-color 0.16s ease;
}

.docs-rule:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
}

.docs-rule-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.85rem;
    height: 1.85rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: #e5e5e5;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1;
}

.docs-rule-anchor {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.85rem;
    color: #3d3d3d;
    opacity: 0;
    transition: color 0.16s ease, opacity 0.16s ease;
}

.docs-rule:hover .docs-rule-anchor,
.docs-rule-anchor:focus-visible { opacity: 1; }
.docs-rule-anchor:hover { color: #e5e5e5; }

@keyframes docsRuleFlash {
    from { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.28); }
    to { background: rgba(255, 255, 255, 0.02); border-color: rgba(255, 255, 255, 0.08); }
}

.docs-rule-target { animation: docsRuleFlash 1.6s ease-out; }

.docs-pager {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 2.5rem;
    padding-top: 1.75rem;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.docs-pager-link {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    flex: 1 1 12rem;
    padding: 0.85rem 1.1rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    transition: background-color 0.16s ease, border-color 0.16s ease;
}

.docs-pager-link:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.14);
}

.docs-pager-next { text-align: right; }

.docs-pager-label {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #555555;
}

.docs-pager-title {
    color: #e5e5e5;
    font-size: 0.9rem;
    font-weight: 600;
}

@keyframes docsFade {
    from { opacity: 0; transform: translate3d(0, 6px, 0); }
    to { opacity: 1; transform: none; }
}

.docs-enter { animation: docsFade 0.28s cubic-bezier(0.2, 0.8, 0.2, 1) both; }

.docs-skeleton { display: grid; gap: 0.85rem; }

.docs-skeleton-bar {
    height: 1.1rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.05);
    animation: docsPulse 1.4s ease-in-out infinite;
}

@keyframes docsPulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.45; }
}

.docs-error {
    padding: 1.1rem 1.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 8px;
    color: #aaaaaa;
    font-size: 0.9rem;
    line-height: 1.6;
}

@media (max-width: 1023px) {
    .docs-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding-top: 5.75rem;
    }

    .docs-sidebar {
        position: fixed;
        top: 4rem;
        left: 0;
        bottom: 0;
        z-index: 40;
        width: min(19rem, 82vw);
        max-height: none;
        padding: 1.25rem 1rem;
        background: #0d0d0d;
        border-right: 1px solid rgba(255, 255, 255, 0.08);
        transform: translate3d(-100%, 0, 0);
        transition: transform 0.24s cubic-bezier(0.2, 0.8, 0.2, 1);
    }

    .docs-sidebar-open { transform: translate3d(0, 0, 0); }
}

@media (max-width: 640px) {
    .docs-shell { padding-left: 1rem; padding-right: 1rem; }
    .docs-rule {
        grid-template-columns: 1.75rem minmax(0, 1fr);
        gap: 0.7rem;
        padding: 0.85rem 0.9rem;
        font-size: 0.875rem;
    }
    .docs-rule-anchor { display: none; }
    .docs-pager-link { flex-basis: 100%; }
    .docs-pager-next { text-align: left; }
}

@media (prefers-reduced-motion: reduce) {
    .docs-enter,
    .docs-rule-target,
    .docs-skeleton-bar,
    .docs-sidebar {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}
