/* ========================================
   CHROME STYLES - Navigation, Layout, UI
   ======================================== */

:root {
    /* Council brand colours — fallback values only; overridden by inline <style> in base.html */
    --council-accent: #005ea5;
    --council-link: #006699;
    --council-link-hover: #004b70;
    /* Semantic design-system tokens */
    --leg-text: #292929;
    --leg-text-secondary: rgba(30, 30, 30, 1);
    --leg-text-strong: #333333;
    --leg-link: var(--council-link);
    --leg-link-visited: color-mix(in srgb, var(--council-link) 75%, #777);
    --leg-link-hover: var(--council-link-hover);
    --leg-border: #b1b4b6;
    --leg-border-subtle: #d8dde0;
    --leg-surface: #ffffff;
    --leg-surface-muted: #f3f2f1;
    --leg-surface-panel: #f8f8f8;
    --leg-focus: #ffdd00;
    --leg-rule: rgba(30, 30, 30, 1);
}

html {
    background: var(--leg-rule);
}

html, * {
    scroll-behavior: smooth !important;
}

h1, h2, h3, h4, h5, h6 {
    scroll-margin-top: 10px;
}

body {
    font-family: "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    margin: 0;
    padding: 0;
    background-color: var(--leg-surface);
    color: var(--leg-text);
    font-size: 16px;
    overscroll-behavior: contain;
}

/* Skip links for keyboard navigation */
.skip-link {
    position: absolute;
    top: -60px;
    left: 6px;
    background: var(--leg-focus);
    color: var(--leg-rule);
    padding: 8px;
    text-decoration: none;
    border-radius: 4px;
    z-index: 1000;
    font-weight: bold;
}

.skip-link:focus {
    top: 6px;
}

/* Screen reader only content */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Enhanced focus indicators for accessibility */
*:focus {
    outline: 3px solid var(--leg-focus);
    outline-offset: 2px;
}

/* Ensure focus is visible on all interactive elements */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 3px solid var(--leg-focus);
    outline-offset: 2px;
}

/* Remove default outline and add custom one for better visibility */
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--leg-focus);
}

/* Legislation.gov.uk style header */
.legislation-header {
    background: #ffffff;
    border-bottom: 1px solid #ddd;
    padding: 0;
    margin-bottom: 0;
}

.legislation-header .header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.legislation-header .site-title {
    font-size: 24px;
    font-weight: bold;
    color: var(--council-accent);
    text-decoration: none;
    margin: 0;
}

.legislation-header .site-title:hover {
    text-decoration: underline;
}

.legislation-header .breadcrumb {
    font-size: 14px;
    color: #666;
    margin: 0;
    padding-left: 2rem;
}

.legislation-header .breadcrumb a {
    color: var(--council-accent);
    text-decoration: underline;
    font-family: "Roboto", sans-serif;
}

.legislation-header .breadcrumb a:hover {
    text-decoration: underline;
}

.legislation-header .breadcrumb-separator {
    margin: 0 8px;
    color: #999;
}

.container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
    background: #ffffff;
}

.sidebar {
    width: 25%;
    padding-right: 20px;
    border-right: 1px solid #e0e0e0;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 0;
    box-sizing: border-box;
}

.sidebar h2 {
    font-size: 1.1em;
    margin-top: 0;
    margin-bottom: 15px;
    color: var(--council-accent);
    font-weight: 600;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8px;
}

.sidebar h2 a {
    color: var(--council-accent);
    text-decoration: none;
}

.sidebar h2 a:hover {
    text-decoration: underline;
}

/* Burger menu styles */
.burger-menu {
    display: none;
    flex-direction: column;
    cursor: pointer;
    padding: 10px;
    background: var(--council-accent);
    color: white;
    border: none;
    border-radius: 4px;
    margin: 10px;
    position: fixed;
    top: 10px;
    left: 10px;
    z-index: 1001;
}

.burger-menu span {
    width: 25px;
    height: 3px;
    background: white;
    margin: 3px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-6px, 7px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-5px, -7px);
}

/* Common navigation styles */
.nav-links {
    list-style: none;
    padding: 0 0 0 0.5rem;
    margin-bottom: 1rem;
}

.nav-links ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links li {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-links a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: color 0.2s ease;
}

.nav-links a:hover {
    color: var(--council-accent);
    text-decoration: none;
}

/* Bold styling for summaries navigation links */
#summaries-nav a {
    font-weight: bold;
}

/* Legacy selectors for backward compatibility */
#toc {
    list-style: none;
    padding: 0 0 0 0.5rem;
    margin-bottom: 1rem;
}

#toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#toc li {
    list-style: none;
    padding: 0;
    margin: 0;
}

#toc a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: color 0.2s ease;
}

/* Legacy selectors for backward compatibility */
#versions-nav {
    list-style: none;
    padding: 0 0 0 0.5rem;
    margin-bottom: 1rem;
}

#versions-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#versions-nav li {
    list-style: none;
    padding: 0;
    margin: 0;
}

#versions-nav a {
    text-decoration: none;
    color: #333;
    display: block;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f0;
    font-size: 14px;
    transition: color 0.2s ease;
}

#versions-nav .version-number {
    font-weight: bold;
}

#versions-nav a:hover {
    color: var(--council-accent);
    text-decoration: none;
}

#versions-nav li.versions-nav-more a {
    border-bottom: none;
    text-decoration: underline;
}

#versions-nav li.versions-nav-more a:hover {
    text-decoration: underline;
    text-decoration-thickness: 2px;
}

.search-container {
    margin-bottom: 0;
    border-bottom: none !important;
}

.search-container h2 {
    margin-bottom: 10px;
}

#search-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #ffffff;
}

#search-input:focus {
    outline: none;
    border-color: var(--council-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--council-accent) 25%, transparent);
}

#search-results {
    margin-top: 10px;
    max-height: 200px;
    overflow-y: auto;
    margin-bottom: 8px;
}

.search-see-all {
    padding: 8px;
    margin: 5px 0;
    text-align: center;
    border-bottom: none !important;
}

.search-see-all a {
    color: var(--council-accent);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.search-see-all a:hover {
    text-decoration: underline;
}

.search-result {
    padding: 8px;
    margin: 5px 0;
    background: #f0f0f0;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.search-result:hover {
    background: #e0e0e0;
}

.search-result .highlight {
    background: #ffeb3b;
    font-weight: bold;
}

.search-result-location {
    display: block;
    font-size: 11px;
    color: #555;
    margin-bottom: 2px;
}

.search-result-snippet {
    display: block;
}

#search-summary {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
    font-style: italic;
    border-bottom: none !important;
}

main {
    width: 75%;
    padding-left: 0;
    background: #ffffff;
}

/* Legislation.gov.uk style document header */
.document-header {
    background: #ffffff;
    border-bottom: 2px solid var(--council-accent);
    padding: 20px 0;
    margin-bottom: 30px;
}

.document-header h1 {
    font-size: 2.2em;
    color: var(--council-accent);
    margin: 0 0 10px 0;
    font-weight: 600;
    line-height: 1.2;
}

.document-header .document-subtitle {
    font-size: 1.1em;
    color: #666;
    margin: 0;
    font-weight: normal;
}

.document-header .document-meta {
    font-size: 14px;
    color: #666;
    margin-top: 10px;
    font-style: italic;
}

.document-header .document-meta .download-pdf-link {
    font-style: normal;
    font-weight: 600;
    margin-left: 0.35em;
    color: var(--council-link);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.25em;
}

.document-header .document-meta .download-pdf-link::before {
    content: "⇩";
    font-size: 0.9em;
}

.document-header .document-meta .download-pdf-link:hover,
.document-header .document-meta .download-pdf-link:focus-visible {
    text-decoration: underline;
}

header h1 {
    font-size: 2em;
    color: var(--council-accent);
    border-bottom: 2px solid var(--council-accent);
    padding-bottom: 10px;
    margin-top: 0;
}

a {
    color: var(--council-accent);
}

a:hover {
    text-decoration: underline;
}

/* Part Section Card Styles */
.part-section {
    border: 1px solid #ddd;
    border-radius: 0;
    background: #ffffff;
    margin-bottom: 30px;
}

.part-section.part-theme {
    border-color: var(--part-accent-muted);
}

.part-section-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 2px solid var(--council-accent);
}

.part-section.part-theme .part-section-header {
    background: var(--part-accent);
    border-bottom-color: transparent;
}

.part-label {
    display: block;
    font-size: 0.85em;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.part-section-header .part-section-title {
    margin: 0;
    margin-bottom: 0 !important;
    border-bottom: none !important;
    padding-top: 0;
    padding-bottom: 0;
    font-size: 1.6em;
    color: var(--council-accent);
    font-weight: 600;
}

.part-section.part-theme .part-section-title {
    color: #ffffff;
}

.part-section .nav-container {
    border: none;
    border-bottom: 1px solid #ddd;
}

.part-section.part-theme .nav-container {
    border-bottom-color: var(--part-accent-muted);
}

.part-section .nav-container:last-child {
    border-bottom: none;
}

.part-section .constitution-document {
    padding: 0 20px;
}

/* Shared navigation container styles */
.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border: 1px solid #ddd;
    margin-bottom: 0;
    gap: 20px;
    background: #ffffff;
    border-radius: 0;
    box-shadow: none;
}

@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        gap: 10px;
    }
    
    .nav-button {
        max-width: 100%;
        width: 100%;
    }
    
    .part-section-header {
        padding: 12px 15px;
    }
    
    .part-section-title {
        font-size: 1.1em;
    }
    
    .part-section .constitution-document {
        padding: 0 15px;
    }
}

/* .section-navigation inherits from nav-container */

/* Shared button styles */
.btn-primary {
    background: #ffffff;
    color: var(--council-accent);
    border: 1px solid var(--council-accent);
    padding: 8px 16px;
    border-radius: 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: normal;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background: var(--council-accent);
    border-color: var(--council-accent);
    text-decoration: none;
    color: white;
}

.part-section.part-theme .btn-primary {
    color: var(--part-accent-strong);
    border-color: var(--part-accent);
    background: var(--part-accent-surface);
}

.part-section.part-theme .btn-primary:hover,
.part-section.part-theme .btn-primary:focus-visible {
    background: var(--part-accent);
    border-color: var(--part-accent);
    color: #ffffff;
}

.part-section.part-theme #current-chapter-info {
    color: #333333;
    background: #ffffff;
    border: 1px solid #6f777b;
    padding: 0.35rem 0.75rem;
}

.btn-primary:disabled {
    background: #ffffff;
    border-color: #ccc;
    color: #999;
    cursor: not-allowed;
    opacity: 1;
}

.nav-button {
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-button.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#current-section-info,
#current-section-info-bottom {pa
    font-weight: normal;
    color: #333;
    font-size: 14px;
}

#current-chapter-info {
    font-weight: 600;
    border-radius: 999px;
}

/* Summary page styles */
.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.summary-card {
    background: white;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    border: 1px solid #ddd;
}

.summary-card h2 {
    margin-top: 0;
    color: var(--council-accent);
}

.summary-card h2 a {
    text-decoration: none;
    color: inherit;
}

.summary-card h2 a:hover {
    text-decoration: underline;
}

/* Metadata styling */
.metadata {
    color: #666;
    font-style: italic;
    margin-bottom: 20px;
}

/* Enhanced search results */
.search-result {
    background: white;
    padding: 10px;
    margin: 5px 0;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.search-result a {
    text-decoration: none;
    color: inherit;
}

.search-result:hover {
    background: #f8f9fa;
}

/* External reference styling */
.ref-link.external {
    color: #666;
    cursor: help;
}

.ref-link.external:hover {
    color: #333;
}

/* Search highlighting */
.highlight {
    background-color: #ffeb3b;
    padding: 0;
    border-radius: 2px;
    font-weight: bold;
}

/* Version Timeline Styles */
.version-timeline {
    background: #ffffff;
    border-top: 1px solid #ddd;
    border-radius: 0;
    padding: 15px 20px;
    margin-top: 30px;
    margin-bottom: 30px;
    box-shadow: none;
}

.versions-link {
    color: var(--council-accent);
    text-decoration: none;
    font-weight: normal;
}

.versions-link:hover {
    text-decoration: underline;
}

.version-timeline h3 {
    margin: 0 0 15px 0;
    color: var(--council-accent);
    font-size: 1.1em;
    font-weight: 600;
}

.timeline-container {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    align-items: center;
    padding: 4px;
    scroll-behavior: smooth;
    scrollbar-width: thin;
    scrollbar-color: var(--council-accent) #f0f0f0;
}

.timeline-container::-webkit-scrollbar {
    height: 8px;
}

.timeline-container::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb {
    background: var(--council-accent);
    border-radius: 4px;
}

.timeline-container::-webkit-scrollbar-thumb:hover {
    background: color-mix(in srgb, var(--council-accent) 75%, #000);
}

.timeline-item {
    position: relative;
    flex-shrink: 0;
}

.timeline-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 6px 10px;
    border: 1px solid #ddd;
    border-radius: 0;
    background: #ffffff;
    transition: all 0.2s ease;
    min-width: 90px;
}

.timeline-link:hover {
    background: color-mix(in srgb, var(--council-accent) 8%, white);
    border-color: var(--council-accent);
    text-decoration: none;
    color: #333;
}

.timeline-link.active {
    background: var(--council-accent);
    color: white;
    border-color: var(--council-accent);
}

.timeline-link.active .timeline-dot {
    background: white;
    border-color: white;
}

.timeline-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--council-accent);
    border: 1px solid var(--council-accent);
    margin-right: 6px;
    flex-shrink: 0;
}

.timeline-content {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.timeline-version {
    font-weight: bold;
    font-size: 0.9em;
    margin-bottom: 1px;
    color: #222;
}

.timeline-date {
    font-size: 0.7em;
    color: #444;
    margin-bottom: 1px;
}

.timeline-link.active .timeline-version {
    color: white;
    font-weight: bold;
}

.timeline-link.active .timeline-date {
    color: rgba(255,255,255,0.9);
}

.timeline-status {
    font-size: 0.55em;
    color: #888;
    text-transform: uppercase;
    font-weight: 500;
}

.timeline-link.active .timeline-status {
    color: rgba(255,255,255,0.85);
}

/* Specific styling for superseded status */
.timeline-link .timeline-status.superseded {
    color: #666;
}

.timeline-link.active .timeline-status.superseded {
    color: rgba(255,255,255,0.95);
}

.timeline-item-more {
    flex-shrink: 0;
    min-width: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    padding: 6px 10px;
}

.timeline-more-link {
    color: var(--council-accent);
    text-decoration: underline;
    font-size: 0.9em;
}

.timeline-more-link:hover {
    text-decoration-thickness: 2px;
}

/* Responsive design */
@media (max-width: 768px) {
    .burger-menu {
        display: flex;
    }
    
    .legislation-header {
        margin-top: 85px;
    }
    
    .legislation-header .header-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .legislation-header .breadcrumb {
        font-size: 12px;
        padding-left: 0;
    }
    
    .container {
        flex-direction: column;
        padding: 15px;
    }
    
    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid #e0e0e0;
        margin-bottom: 20px;
        margin-right: 0;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        position: fixed;
        top: 0;
        left: 0;
        height: 100vh;
        z-index: 1000;
        overflow-y: auto;
        padding-top: 80px !important;
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    main {
        width: 100%;
        padding-left: 0;
    }
    
    .summary-grid {
        grid-template-columns: 1fr;
    }
    
    .timeline-container {
        flex-direction: row;
        overflow-x: auto;
        overflow-y: visible;
    }
    
    .timeline-link {
        min-width: 80px;
        justify-content: flex-start;
    }
    
    .document-header h1 {
        font-size: 1.8em;
    }
    
    .document-header .document-subtitle {
        font-size: 1em;
    }
}

/* ========================================
   PAGE-SPECIFIC STYLES
   ======================================== */

/* Compare Page Styles */
.container:has(#compare-page) {
    max-width: 1800px;
}

.container:has(#compare-page) .sidebar {
    max-width: 400px;
}

/* Admin page layout (full width, footer spacing, content wrappers) is defined
   centrally in admin.css under body.admin, not via per-page :has() rules here. */

#compare-page .compare-page {
    margin: 0 auto;
    padding: 20px;
}

#compare-page .version-selector {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#compare-page .version-selector h3 {
    margin: 0 0 20px 0;
    color: var(--council-accent);
}

#compare-page .compare-form {
    margin: 0;
}

#compare-page .version-inputs {
    display: flex;
    gap: 20px;
    align-items: end;
    flex-wrap: wrap;
}

#compare-page .version-input {
    flex: 1;
    min-width: 200px;
}

#compare-page .version-input label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

#compare-page .version-input select {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: white;
}

#compare-page .version-input select:focus {
    outline: none;
    border-color: var(--council-accent);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--council-accent) 25%, transparent);
}

#compare-page .btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
    height: fit-content;
}

#compare-page .btn-primary {
    background: var(--council-accent);
    color: white;
}

#compare-page .btn-primary:hover {
    background: color-mix(in srgb, var(--council-accent) 75%, #000);
}

#compare-page .comparison-results {
    margin-top: 30px;
}

#compare-page .comparison-results h3 {
    color: var(--council-accent);
    margin-bottom: 20px;
}

#compare-page .diff-container {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

#compare-page .diff-content {
    padding: 0;
    margin: 0;
}

/* Style the HTML diff output */
#compare-page .diff-content table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    table-layout: fixed;
}

#compare-page .diff-content th {
    background: #f8f9fa;
    padding: 8px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    text-align: left;
}

#compare-page .diff-content td {
    padding: 4px 8px;
    vertical-align: top;
    border-bottom: 1px solid #eee;
    word-wrap: break-word;
    white-space: pre-wrap;
    overflow-wrap: break-word;
    max-width: 0;
}

#compare-page .diff-content td[nowrap] {
    white-space: normal !important;
}

#compare-page .diff-content th:nth-child(2),
#compare-page .diff-content th:nth-child(4),
#compare-page .diff-content td:nth-child(3),
#compare-page .diff-content td:nth-child(6) {
    width: auto;
}

#compare-page .diff-content th:nth-child(1),
#compare-page .diff-content th:nth-child(3),
#compare-page .diff-content td:nth-child(1),
#compare-page .diff-content td:nth-child(2),
#compare-page .diff-content td:nth-child(4),
#compare-page .diff-content td:nth-child(5) {
    width: 1rem;
    white-space: nowrap;
}

#compare-page .diff-content .diff_header {
    background: #e9ecef;
    font-weight: bold;
}

#compare-page .diff-content .diff_next {
    background: #f8f9fa;
}

#compare-page .diff-content .diff_add {
    background: #d4edda;
}

#compare-page .diff-content .diff_chg {
    background: #fff3cd;
}

#compare-page .diff-content .diff_sub {
    background: #f8d7da;
}

/* Responsive design for compare page */
@media (max-width: 768px) {
    #compare-page .version-inputs {
        flex-direction: column;
    }
    
    #compare-page .version-input {
        min-width: auto;
    }
    
    #compare-page .diff-content table {
        font-size: 10px;
    }
    
    #compare-page .diff-content th,
    #compare-page .diff-content td {
        padding: 2px 4px;
    }
    
    #compare-page .diff-content th:nth-child(2),
    #compare-page .diff-content th:nth-child(4),
    #compare-page .diff-content td:nth-child(3),
    #compare-page .diff-content td:nth-child(6) {
        width: auto;
    }
    
    #compare-page .diff-content th:nth-child(1),
    #compare-page .diff-content th:nth-child(3),
    #compare-page .diff-content td:nth-child(1),
    #compare-page .diff-content td:nth-child(2),
    #compare-page .diff-content td:nth-child(4),
    #compare-page .diff-content td:nth-child(5) {
        width: 1rem;
        white-space: nowrap;
    }
}

/* Versions Page Styles */
#versions-page .versions-page {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

#versions-page .subtitle {
    color: #666;
    font-size: 1.1em;
    margin: 10px 0 30px 0;
}

#versions-page .versions-grid {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-bottom: 40px;
}

#versions-page .version-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

#versions-page .version-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

#versions-page .version-card.current {
    border-color: var(--council-accent);
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
}

#versions-page .version-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

#versions-page .version-header h3 {
    margin: 0;
    color: var(--council-accent);
    font-size: 1.3em;
}

#versions-page .current-badge {
    background: var(--council-accent);
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
}

#versions-page .status-badge {
    background: #6c757d;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 600;
    text-transform: capitalize;
}

#versions-page .version-details {
    margin-bottom: 20px;
}

#versions-page .version-date {
    margin-bottom: 10px;
    color: #666;
}

#versions-page .version-description {
    color: #555;
    line-height: 1.5;
}

#versions-page .version-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

#versions-page .btn {
    padding: 8px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    transition: background-color 0.2s ease;
    border: none;
    cursor: pointer;
}

#versions-page .btn-primary {
    background: var(--council-accent);
    color: white;
}

#versions-page .btn-primary:hover {
    background: color-mix(in srgb, var(--council-accent) 75%, #000);
}

#versions-page .btn-secondary {
    background: #6c757d;
    color: white;
}

#versions-page .btn-secondary:hover {
    background: #5a6268;
}

#versions-page .no-versions {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

#versions-page .no-versions p {
    font-size: 1.2em;
}

/* Responsive design for versions page */
@media (max-width: 768px) {
    #versions-page .version-actions {
        flex-direction: column;
    }
    
    #versions-page .btn {
        text-align: center;
    }
}

/* Version Warning Banner Styles */
.version-warning-banner {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-left: 4px solid #f39c12;
    margin: 0;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    position: relative;
}

.warning-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
}

.warning-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.warning-text {
    flex: 1;
    color: #856404;
    font-size: 14px;
    line-height: 1.4;
}

.warning-link {
    color: var(--council-accent);
    text-decoration: underline;
    font-weight: 600;
}

.warning-link:hover {
    color: color-mix(in srgb, var(--council-accent) 75%, #000);
    text-decoration: none;
}

.warning-dismiss {
    background: none;
    border: none;
    color: #856404;
    font-size: 20px;
    font-weight: bold;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.warning-dismiss:hover {
    background-color: rgba(133, 100, 4, 0.1);
}

/* Responsive design for warning banner */
@media (max-width: 768px) {
    .warning-content {
        padding: 10px 15px;
        flex-direction: row;
        align-items: flex-start;
        gap: 8px;
    }
    
    .warning-text {
        font-size: 13px;
    }
    
    .warning-dismiss {
        position: absolute;
        top: 8px;
        right: 8px;
    }
}

/* ----------------------------------------
   Admin preview banner
   ---------------------------------------- */

.preview-banner {
    background: #4c2c92;
    color: #fff;
    margin: 0;
    padding: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
    position: relative;
}

.preview-banner-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.preview-banner-text {
    flex: 1;
    font-size: 14px;
    line-height: 1.4;
}

.preview-banner-link,
.preview-banner-link:link,
.preview-banner-link:visited {
    color: #fff;
    text-decoration: underline;
    font-weight: 600;
    white-space: nowrap;
}

.preview-banner-link:hover,
.preview-banner-link:active,
.preview-banner-link:focus {
    color: #fff;
    text-decoration: none;
}

@media (max-width: 768px) {
    .preview-banner-content {
        padding: 10px 15px;
        align-items: flex-start;
        gap: 8px;
    }

    .preview-banner-text {
        font-size: 13px;
    }
}

/* ----------------------------------------
   Legislative design refresh overrides
   ---------------------------------------- */

a {
    color: var(--leg-link);
}

a:visited {
    color: var(--leg-link-visited);
}

a:hover,
a:active {
    color: var(--leg-link-hover);
}

.legislation-header {
    border-bottom: 2px solid var(--leg-rule);
    background: var(--leg-surface);
}

.legislation-header .header-content {
    max-width: 1280px;
    padding: 14px 20px 12px;
}

.legislation-header .header-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
}

.legislation-header .header-council-logo {
    width: 74px;
    height: auto;
    flex: 0 0 auto;
}

.legislation-header .site-title {
    color: var(--leg-rule);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: 0;
}

.legislation-header .breadcrumb,
.legislation-header .breadcrumb a {
    color: var(--leg-text-secondary);
    font-size: 0.95rem;
    text-decoration: none;
}

.legislation-header .breadcrumb a:hover {
    text-decoration: underline;
}

.container {
    max-width: 1280px;
    background: var(--leg-surface);
}

.sidebar {
    background: var(--leg-surface-panel);
    border-right: 1px solid var(--leg-border-subtle);
    padding: 16px;
}

.sidebar h2 {
    color: var(--leg-text-strong);
    border-bottom: 1px solid var(--leg-border-subtle);
    font-size: 1rem;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.sidebar h2 a {
    color: inherit;
}

.nav-links a {
    color: var(--leg-text-secondary);
    border-bottom: 1px solid var(--leg-border-subtle);
    padding: 6px 0;
}

.nav-links a:hover,
.part-chapters a:hover,
.part-toggle:hover {
    color: var(--leg-link);
}

#toc .toc-cover-page-link {
    margin-left: 20px;
    font-weight: 700;
    border-bottom: none;
}

.document-header {
    border-top: 1px solid var(--leg-rule);
    border-bottom: 1px solid var(--leg-border);
    padding: 18px 0;
    margin-bottom: 22px;
}

.document-header h1 {
    color: var(--leg-rule);
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.2;
}

.document-header .document-subtitle,
.document-header .document-meta {
    color: var(--leg-text-secondary);
}

.document-meta.document-meta-inline-row {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
}

.document-header .document-meta.document-meta-inline-row {
    align-items: center;
    background: #f8f8f8;
    border: 1px solid var(--leg-border);
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-top: 0.2rem;
    padding: 0.6rem 0.8rem;
}

.document-header .document-meta.document-meta-inline-row span {
    color: var(--leg-text-strong);
}

.document-header .document-meta.document-meta-inline-row a {
    color: var(--leg-link);
    font-style: normal;
    font-weight: 600;
    text-decoration: none;
}

.document-header .document-meta.document-meta-inline-row a:hover,
.document-header .document-meta.document-meta-inline-row a:focus-visible {
    color: var(--leg-link-hover);
    text-decoration: underline;
}

.part-section .part-section-header .document-meta.document-meta-inline-row {
    margin-top: 0.45rem;
    background: transparent;
    border: none;
    padding: 0;
    color: #ffffff;
}

.part-section .part-section-header .document-meta.document-meta-inline-row span,
.part-section .part-section-header .document-meta.document-meta-inline-row strong {
    color: #ffffff;
}

.part-section .part-section-header .document-meta.document-meta-inline-row a {
    color: #ffffff;
    text-decoration: underline;
}

.part-section .part-section-header .document-meta.document-meta-inline-row a:hover,
.part-section .part-section-header .document-meta.document-meta-inline-row a:focus-visible {
    color: #ffffff;
    text-decoration-thickness: 2px;
}

.part-section {
    border: 1px solid var(--leg-border);
    background: var(--leg-surface);
}

.part-section.part-theme {
    border-left: 6px solid var(--part-accent, var(--leg-rule));
}

.part-section-header {
    background: var(--leg-surface);
    border-bottom: 1px solid var(--leg-border-subtle);
    padding: 14px 20px;
    position: relative;
}

.part-section-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--part-accent, var(--leg-rule));
}

.part-section-header .part-section-title {
    color: var(--leg-rule);
    letter-spacing: 0.02em;
}

.version-warning-banner {
    background: #fef7d1;
    border-bottom: 1px solid #f3d768;
    box-shadow: none;
}

.warning-text {
    color: var(--leg-text-strong);
}

.warning-link {
    color: var(--leg-link);
}

/* Live option 6 */
.part-section {
    border: none;
    background: #ffffff;
}

.part-section.part-theme {
    border: none;
}

.part-section .part-section-header {
    background: var(--part-accent, var(--council-link));
    border: none;
}

.part-section.part-theme .part-section-header {
    background: var(--part-accent, var(--council-link));
    border: none;
}

.part-section .part-section-header::before {
    display: none;
}

.part-section.part-theme .part-section-header::before {
    display: none;
}

.part-section .part-section-title {
    color: #ffffff;
}

.part-section.part-theme .part-section-title {
    color: #ffffff;
}

.part-section .nav-container {
    border: 0;
    border-bottom: 1px solid #6f777b;
}

.part-section .chapter {
    border-bottom: 1px solid #6f777b;
}

.part-section .chapter:last-child {
    border-bottom: none;
}

.part-section.part-theme .btn-primary {
    border-color: var(--part-accent, var(--council-link));
    color: var(--part-accent, var(--council-link));
    background: #ffffff;
}

.part-section.part-theme .btn-primary:hover,
.part-section.part-theme .btn-primary:focus-visible {
    background: var(--part-accent, var(--council-link));
    color: #ffffff;
}

.part-section.part-theme #current-chapter-info {
    background: #ffffff;
    border: 1px solid #6f777b;
    color: #333333;
    border-radius: 0;
}

.constitution-cover-page {
    --part-accent: #333333;
}

.constitution-cover-page .part-section-header {
    margin-bottom: 2rem;
}

.site-footer {
    width: 100%;
    background: var(--leg-rule);
    color: #ffffff;
    margin-top: 2rem;
}

.site-footer-content {
    max-width: 1280px;
    margin: 0 auto;
    padding: 1rem 1rem 1.2rem;
}

.site-footer-formats,
.site-footer-licence {
    margin: 0;
    color: #ffffff;
    font-size: 0.95rem;
    line-height: 1.5;
}

.site-footer-licence {
    margin-top: 0.35rem;
}

.site-footer-licence-row {
    display: inline-flex;
    align-items: flex-start;
    gap: 0.55rem;
}

.site-footer-ogl-logo {
    width: auto;
    height: 1rem;
    flex: 0 0 auto;
    filter: none;
    margin-top: 0;
}

.site-footer a,
.site-footer a:visited,
.site-footer a:hover,
.site-footer a:active {
    color: #ffffff;
}

