/* ═══════════════════════════════════════════════════════════════
   Regulation Page Styles — Modern, clean, readable layout
   for structured legal/regulatory content.
   ═══════════════════════════════════════════════════════════════ */

/* Breadcrumb */
.reg-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.reg-breadcrumb a {
    color: var(--text-muted);
    font-weight: 500;
    transition: color 0.2s;
}

.reg-breadcrumb a:hover {
    color: var(--primary);
}

.reg-breadcrumb .sep {
    opacity: 0.4;
    font-size: 0.75rem;
}

.reg-breadcrumb .current {
    color: var(--text-main);
    font-weight: 600;
}

/* Page Header */
.reg-page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1.5rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.reg-page-title-area {
    flex: 1;
    min-width: 250px;
}

.reg-page-badge {
    display: inline-block;
    background: var(--primary-gradient);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.3rem 0.75rem;
    border-radius: 2rem;
    margin-bottom: 0.75rem;
}

.reg-page-title-area h1 {
    font-size: 2rem;
    line-height: 1.2;
    background: linear-gradient(135deg, var(--secondary) 0%, #4a6074 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0;
}

/* Navigation Buttons */
.reg-nav-top,
.reg-nav-bottom {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    flex-wrap: wrap;
}

.reg-nav-bottom {
    justify-content: space-between;
    padding: 2rem 0;
    border-top: 1px solid var(--surface-border);
    margin-top: 2rem;
}

.reg-nav-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-heading);
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
}

.reg-nav-btn.prev {
    background: white;
    color: var(--primary);
    border: 1.5px solid rgba(255, 81, 47, 0.3);
}

.reg-nav-btn.prev:hover {
    background: var(--primary-gradient);
    color: white;
    border-color: transparent;
    transform: translateX(-3px);
    box-shadow: 0 4px 12px rgba(255, 81, 47, 0.3);
}

.reg-nav-btn.next {
    background: var(--primary-gradient);
    color: white;
    border: none;
    box-shadow: 0 2px 8px rgba(255, 81, 47, 0.3);
}

.reg-nav-btn.next:hover {
    transform: translateX(3px);
    box-shadow: 0 6px 16px rgba(255, 81, 47, 0.4);
    filter: brightness(1.1);
}

.reg-nav-btn.toc {
    background: white;
    color: var(--secondary);
    border: 1.5px solid var(--surface-border);
}

.reg-nav-btn.toc:hover {
    background: var(--secondary);
    color: white;
    border-color: var(--secondary);
}

/* Article Content */
.reg-article {
    padding: 3rem;
    line-height: 1.8;
    font-size: 1rem;
    color: var(--text-main);
}

.reg-article p {
    margin-bottom: 1rem;
    text-align: justify;
    hyphens: auto;
}

/* Chapter Headings */
.reg-chapter {
    font-size: 1.75rem;
    color: var(--secondary);
    margin: 2.5rem 0 1.25rem;
    padding-bottom: 0.75rem;
    border-bottom: 3px solid;
    border-image: var(--primary-gradient) 1;
    letter-spacing: -0.02em;
}

.reg-article .reg-chapter:first-child {
    margin-top: 0;
}

/* Section Headings */
.reg-section {
    font-size: 1.35rem;
    color: var(--primary);
    margin: 2rem 0 1rem;
    padding-left: 1rem;
    border-left: 4px solid var(--primary);
    line-height: 1.3;
}

/* Subheadings */
.reg-subheading {
    font-size: 1.1rem;
    color: var(--secondary);
    margin: 1.5rem 0 0.75rem;
    font-weight: 700;
    text-transform: capitalize;
}

/* Subsection Items (A., B., C.) */
.reg-subsections {
    margin: 1rem 0 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.reg-subsection {
    display: flex;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: rgba(255, 255, 255, 0.5);
    border-radius: 0.75rem;
    border: 1px solid rgba(0, 0, 0, 0.04);
    transition: all 0.2s ease;
}

.reg-subsection:hover {
    background: rgba(255, 255, 255, 0.8);
    border-color: rgba(255, 81, 47, 0.15);
    transform: translateX(4px);
}

.reg-letter {
    font-weight: 800;
    color: var(--primary);
    font-family: var(--font-heading);
    min-width: 1.5rem;
    flex-shrink: 0;
}

/* Numbered Lists */
.reg-list {
    margin: 1rem 0 1.5rem;
    padding-left: 0;
    list-style: none;
    counter-reset: reg-counter;
}

.reg-list li {
    counter-increment: reg-counter;
    padding: 0.6rem 1rem 0.6rem 2.75rem;
    position: relative;
    margin-bottom: 0.5rem;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 0.5rem;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.reg-list li:hover {
    background: rgba(255, 255, 255, 0.7);
    border-left-color: var(--accent);
    transform: translateX(2px);
}

.reg-list li::before {
    content: counter(reg-counter) ".";
    position: absolute;
    left: 0.75rem;
    font-weight: 800;
    color: var(--accent);
    font-family: var(--font-heading);
}

/* ═══════════════════════════════════════════════════════════════
   TOC Page Styles
   ═══════════════════════════════════════════════════════════════ */

/* Hero */
.toc-hero {
    text-align: center;
    padding: 2.5rem 1rem 1.5rem;
}

.toc-hero h1 {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--secondary) 0%, #4a6074 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

.toc-hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
    max-width: 600px;
    margin: 0 auto;
}

/* Search Bar */
.toc-search-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.toc-search-bar i {
    font-size: 1.25rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.toc-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 1rem;
    font-family: var(--font-body);
    color: var(--text-main);
    outline: none;
}

.toc-search-bar input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}

/* TOC Grid */
.toc-grid {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    padding: 0;
    margin: 0 0 2rem;
}

/* TOC Card */
.toc-card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border-radius: 1rem;
    background: var(--surface-glass);
    border: 1px solid var(--surface-border);
    text-decoration: none !important;
    color: var(--text-main) !important;
    font-weight: 500 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    height: 100%;
}

.toc-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: rgba(255, 81, 47, 0.3);
    background: rgba(255, 255, 255, 0.9);
}

.toc-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.6rem;
    background: var(--primary-gradient);
    color: white;
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 0.8rem;
    flex-shrink: 0;
}

.toc-title {
    font-size: 0.85rem;
    line-height: 1.35;
    color: var(--text-main);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .reg-page-header {
        flex-direction: column;
    }

    .reg-page-title-area h1 {
        font-size: 1.5rem;
    }

    .reg-article {
        padding: 1.5rem;
    }

    .reg-nav-bottom {
        flex-direction: column;
        gap: 0.75rem;
    }

    .reg-nav-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Print styles */
@media print {
    .sidebar,
    .main-header,
    .reg-breadcrumb,
    .reg-nav-top,
    .reg-nav-bottom,
    footer {
        display: none !important;
    }

    .main-wrapper {
        width: 100% !important;
    }

    .reg-article {
        box-shadow: none;
        border: none;
        padding: 0;
    }
}
