/* ===== RULES PAGE — WildRP layout, NML colors ===== */
body.rules-page {
    background: #0a0a0a;
    color: #fff;
    min-height: 100vh;
    padding-top: 5.25rem;
}

body.rules-sidebar-open {
    overflow: hidden;
}

/* Scrollbar personalizada */
body.rules-page,
.article-navigation-wrapper {
    scrollbar-width: thin;
    scrollbar-color: var(--nml-accent-muted) rgba(255, 255, 255, 0.06);
}

body.rules-page::-webkit-scrollbar,
.article-navigation-wrapper::-webkit-scrollbar {
    width: 10px;
}

body.rules-page::-webkit-scrollbar-track,
.article-navigation-wrapper::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 999px;
}

body.rules-page::-webkit-scrollbar-thumb,
.article-navigation-wrapper::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, var(--nml-accent), var(--nml-accent-muted));
    border-radius: 999px;
    border: 2px solid rgba(8, 8, 8, 0.6);
}

body.rules-page::-webkit-scrollbar-thumb:hover,
.article-navigation-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--nml-accent-light);
}

body.rules-page::-webkit-scrollbar-corner {
    background: transparent;
}

.rules-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0;
    z-index: 100;
    background: linear-gradient(90deg, var(--nml-accent), var(--nml-accent-light));
    transition: width 0.1s linear;
    pointer-events: none;
}

.rules-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.rules-background-media {
    position: absolute;
    inset: 0;
}

.rules-background-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.rules-background-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(8, 8, 8, 0.72) 0%, rgba(10, 10, 10, 0.85) 45%, rgba(8, 8, 8, 0.92) 100%),
        radial-gradient(ellipse at 30% 20%, var(--nml-accent-glow-soft) 0%, transparent 55%);
}

.article-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    user-select: none;
    -webkit-user-select: none;
}
.article-navigation-wrapper {
    position: fixed;
    top: 5.25rem;
    left: 0;
    width: 25%;
    height: calc(100vh - 5.25rem);
    overflow-x: clip;
    overflow-y: scroll;
    text-align: center;
    z-index: 5;
    background: rgba(8, 8, 8, 0.42);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-right: 1px solid rgba(255, 255, 255, 0.06);
}
.article-navigation {
    box-sizing: border-box;
    display: inline-block;
    margin: 0 auto;
    padding: 1.25rem 1.625rem 2rem;
    text-align: left;
}

.article-navigation-link {
    box-sizing: border-box;
    display: block;
    padding-bottom: 0.625rem;
}

.article-navigation-link a {
    color: rgba(255, 255, 255, 0.45);
    cursor: pointer;
    font-family: "Moon Dance", cursive;
    font-size: 1.1em;
    font-weight: 400;
    letter-spacing: 0.05em;
    line-height: 0.9;
    text-decoration: none;
    text-transform: uppercase;
    transition: color 0.15s ease;
}

.article-navigation-link a:hover {
    color: rgba(255, 255, 255, 0.95);
}

.article-navigation-link a.scroll-active {
    color: var(--nml-accent);
}

.article-navigation-link.is-hidden {
    display: none;
}

.rules-sidebar-head {
    position: sticky;
    top: 0;
    z-index: 2;
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    background: rgba(8, 8, 8, 0.92);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.rules-sidebar-label {
    margin: 0 0 0.75rem;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.4);
}

.rules-search-wrap {
    position: relative;
}

.rules-search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.9rem;
    pointer-events: none;
}

.rules-search {
    width: 100%;
    box-sizing: border-box;
    padding: 0.65rem 0.75rem 0.65rem 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.rules-search::placeholder {
    color: rgba(255, 255, 255, 0.35);
}

.rules-search:focus {
    border-color: rgba(168, 168, 168, 0.45);
    background: rgba(255, 255, 255, 0.08);
}

.rules-search-empty {
    color: rgba(255, 255, 255, 0.4);
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.95rem;
    padding: 0.5rem 0 1rem;
    margin: 0;
}

.rules-hero {
    text-align: center;
    padding: 1.5rem 0 2.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    margin-bottom: 1rem;
}

.rules-hero-kicker {
    margin: 0 0 0.5rem;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--nml-accent);
}

.rules-hero-title {
    margin: 0 0 0.75rem;
    font-family: "Moon Dance", cursive;
    font-size: clamp(2.5rem, 6vw, 3.75rem);
    font-weight: 400;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.05;
}

.rules-hero-desc {
    margin: 0 auto;
    max-width: 36rem;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 1.05rem;
    font-weight: 300;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
}

.rules-skeleton {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 1rem 0 2rem;
}

.rules-skeleton-line {
    height: 1rem;
    border-radius: 6px;
    background: linear-gradient(90deg, rgba(255,255,255,0.06) 25%, rgba(255,255,255,0.12) 50%, rgba(255,255,255,0.06) 75%);
    background-size: 200% 100%;
    animation: rules-shimmer 1.4s ease infinite;
}

.rules-skeleton-line.wide { width: 70%; height: 2rem; }
.rules-skeleton-line.medium { width: 55%; }

@keyframes rules-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.rules-toc-toggle {
    display: none;
    position: fixed;
    bottom: 1.25rem;
    left: 1.25rem;
    z-index: 60;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 999px;
    background: rgba(8, 8, 8, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: #fff;
    font-family: "Plus Jakarta Sans", sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

.rules-toc-toggle .pi {
    font-size: 1rem;
}

.rules-back-top {
    position: fixed;
    bottom: 1.25rem;
    right: 1.25rem;
    z-index: 60;
    width: 2.75rem;
    height: 2.75rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 50%;
    background: rgba(8, 8, 8, 0.88);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--nml-accent);
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
    transition: transform 0.15s ease, color 0.15s ease;
}

.rules-back-top:hover {
    transform: translateY(-2px);
    color: var(--nml-accent-light);
}

.article-navigation-link.depth-2 {
    font-size: 0.95em;
    padding-left: 0.625rem;
}

.article-navigation-link.depth-3 {
    font-size: 0.9em;
    padding-left: 1.25rem;
}

.article-navigation-link.depth-4 {
    font-size: 0.85em;
    padding-left: 1.875rem;
}

.article-navigation-link.depth-5 {
    font-size: 0.8em;
    padding-left: 2.5rem;
}

.article-navigation-link.depth-6 {
    font-size: 0.75em;
    padding-left: 3.125rem;
}

.article-content {
    width: min(920px, 94%);
    margin: 0 auto;
    padding: 0 1.25rem 5rem;
    color: #fff;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    text-align: center;
}

@media (min-width: 993px) {
    .article-wrapper {
        padding-left: 25%;
        box-sizing: border-box;
    }

    .article-content {
        width: min(920px, 88%);
    }
}

.article-content article {
    padding: 0.5rem 0 2rem;
}
.article-content.mobile-article {
    width: min(920px, 94%);
}

.article-content p,
.article-content ol,
.article-content ul,
.article-content table {
    color: #fff;
    font-family: "Plus Jakarta Sans", "PT Sans", sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.8;
    padding-top: 5px;
    padding-bottom: 5px;
    text-align: center;
}

.article-content li {
    color: #fff;
    font-family: "Plus Jakarta Sans", "PT Sans", sans-serif;
    font-size: 1.2rem;
    font-weight: 300;
    line-height: 1.6;
    opacity: 0.8;
    text-align: center;
}

.article-content ol,
.article-content ul {
    display: inline-block;
    text-align: center;
    margin: 0.25rem auto 0.75rem;
    padding-left: 1.25rem;
    list-style-position: inside;
}

.article-content blockquote {
    font-style: italic;
    opacity: 0.8;
    max-width: 48rem;
    margin-left: auto;
    margin-right: auto;
}

.article-content table {
    margin-left: auto;
    margin-right: auto;
}

.article-content table,
.article-content td,
.article-content th {
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-collapse: collapse;
    padding: 5px;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    font-family: "Moon Dance", cursive;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.05;
    text-transform: uppercase;
    color: #fff;
    scroll-margin-top: 6.5rem;
    text-align: center;
}

.article-content h1 { font-size: 3rem; margin: 2rem 0 1rem; }
.article-content h2 { font-size: 2.8rem; margin: 2.5rem 0 1rem; }
.article-content h3 { font-size: 2.2rem; margin: 2rem 0 0.75rem; }
.article-content h4 { font-size: 1.9rem; margin: 1.5rem 0 0.5rem; }
.article-content h5 { font-size: 1.6rem; margin: 1.25rem 0 0.5rem; }
.article-content h6 { font-size: 1.3rem; margin: 1rem 0 0.5rem; }

.article-content h2:first-child,
.article-content h3:first-child {
    margin-top: 1.5rem;
}

.article-content a {
    color: var(--nml-accent);
    text-decoration: none;
}

.article-content a:hover {
    color: var(--nml-accent-light);
}

.article-content strong {
    font-weight: 600;
    opacity: 1;
}

.rules-loading {
    color: rgba(255, 255, 255, 0.45);
    font-family: "Plus Jakarta Sans", "PT Sans", sans-serif;
    font-size: 1.1rem;
    font-weight: 300;
    padding: 2rem 0;
}

@media (max-width: 992px) {
    .rules-toc-toggle {
        display: inline-flex;
    }

    .article-navigation-wrapper {
        display: block;
        position: fixed;
        top: 5.25rem;
        left: 0;
        width: min(88vw, 320px);
        transform: translateX(-105%);
        transition: transform 0.25s ease;
        z-index: 50;
        box-shadow: 8px 0 32px rgba(0, 0, 0, 0.45);
    }

    .article-navigation-wrapper.is-open {
        transform: translateX(0);
    }

    .article-wrapper {
        padding-left: 0;
    }

    .article-content {
        width: min(920px, 94%);
        padding: 0 1rem 5rem;
    }
}

@media (max-width: 768px) {
    .article-content,
    .article-content.mobile-article {
        width: min(920px, 96%);
        padding: 0 0.75rem 5rem;
    }
}
