/* Statsbudsjettet - Clean Chart Layout */

/* Import Grotesk font */
@import url('https://fonts.googleapis.com/css2?family=Space+Grotesk:wght@300;400;500;600;700&display=swap');

/* CSS Variables */
:root {
    /* Light theme colors - inspired by the example */
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9f6;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #2f3531;
    --text-secondary: #595959;
    --text-muted: #8f9091;
    
    --border-primary: #d1d3ce;
    --border-secondary: #e6e6e6;
    
    --accent-primary: #0083ff;
    --accent-secondary: #0066cc;
    --accent-success: #059669;
    --accent-danger: #dc2626;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);
    
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    
    /* Typography */
    --font-family: 'Space Grotesk', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Dark theme variables - Total blackout */
[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #111111;
    --bg-tertiary: #1a1a1a;
    
    --text-primary: #ffffff;
    --text-secondary: #e5e5e5;
    --text-muted: #a3a3a3;
    
    --border-primary: #333333;
    --border-secondary: #444444;
    
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.5);
    --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.5);
}

/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.6;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color 0.3s ease, color 0.3s ease;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    zoom: 0.9; /* Default to 90% zoom for better desktop experience */
}

/* Reset zoom for mobile devices */
@media (max-width: 768px) {
    body {
        zoom: 1; /* Full zoom on mobile */
    }
}

/* Loading Screen */
#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--bg-primary) 0%, #f8fafc 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
    transition: opacity 0.5s ease;
    overflow: hidden;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
}

/* Full Background Circular Line Chart Loading Screen */
.background-chart {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    opacity: 0.1;
}

.loading-content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 300px;
    padding: 1rem;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100vh;
}

.loading-header h1 {
    font-size: 2.5rem;
    margin: 0;
    color: #000;
    font-weight: 600;
    letter-spacing: -0.01em;
    animation: titleFloat 2s ease-in-out infinite;
}

.minimal-line {
    stroke-dasharray: 100;
    stroke-dashoffset: 100;
    filter: none;
    animation: lineDraw 2s ease-in-out infinite;
}

/* Minimal Animations */
@keyframes lineDraw {
    0% { 
        stroke-dashoffset: 100; 
        opacity: 0.6;
    }
    50% { 
        stroke-dashoffset: 0; 
        opacity: 1;
    }
    100% { 
        stroke-dashoffset: -100; 
        opacity: 0.6;
    }
}

@keyframes titleFloat {
    0%, 100% { 
        transform: translateY(0) scale(1); 
        opacity: 1;
    }
    50% { 
        transform: translateY(-2px) scale(1.01); 
        opacity: 0.9;
    }
}

.loading-content {
    text-align: center;
}

.loading-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.loading-content p {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Header */
.main-header {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-primary);
    padding: 1.5rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-shrink: 0; /* prevent shrinking */
}

/* Prevent header content from causing horizontal overflow */
.main-header {
    overflow: hidden;
    max-height: 120px; /* limit header height */
    transition: max-height 0.3s ease;
}

.site-title {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.site-title:hover {
    opacity: 0.8;
}

/* Breadcrumb styling */
.site-title .breadcrumb-separator {
    font-size: 1rem;
    color: var(--text-secondary);
    margin: 0 0.5rem;
}

.site-title .breadcrumb-item {
    font-size: 1.125rem;
    color: var(--text-secondary);
}

/* Make breadcrumb segments look clickable */
.site-title .breadcrumb-item {
    cursor: pointer;
}

.site-title .breadcrumb-item:first-child {
    font-size: 1.875rem;
    color: var(--text-primary);
}

/* Desktop breadcrumb wrapping for long paths */
@media (min-width: 769px) {
    .site-title {
        white-space: normal; /* allow wrapping on desktop too */
        line-height: 1.3;
    }
    
    .site-title .breadcrumb-item {
        display: inline; /* keep inline for better wrapping */
    }
    
    .site-title .breadcrumb-separator {
        display: inline; /* keep separators visible */
    }

    /* Create hanging indent effect - continuation lines align under arrow */
    .site-title {
        text-indent: -1.5rem; /* negative indent for hanging effect */
        padding-left: 1.5rem; /* positive padding to offset */
    }
}

.drill-up-button,
.nav-toggle,
.theme-toggle {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
}

.drill-up-button:hover,
.nav-toggle:hover,
.theme-toggle:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.theme-toggle i {
    width: 20px;
    height: 20px;
}

/* Theme toggle icon visibility */
[data-theme="light"] .sun-icon {
    display: none;
}

[data-theme="light"] .moon-icon {
    display: block;
}

[data-theme="dark"] .sun-icon {
    display: block;
    color: var(--accent-primary);
}

[data-theme="dark"] .moon-icon {
    display: none;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 200px);
    padding: 2rem 0;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Departments Grid */
.departments-grid {
    display: grid;
    gap: 2rem;
}

/* Department Chart Block - styled like the example */
.department-chart-block {
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    border: 1px solid var(--border-primary);
}

.department-header {
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 1.75rem;
    margin-bottom: 1.5rem;
}

.department-header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.department-title {
    font-family: var(--font-family);
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    line-height: 1.875rem;
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.department-title:hover {
    opacity: 0.8;
}

.department-subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 400;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    align-items: center;
    gap: 1rem;
}

.dept-posts {
    color: var(--text-secondary);
    font-size: 1rem;
    font-weight: 500;
    text-align: right;
    grid-column: 3;
}

.dept-change {
    font-size: 1rem;
    font-weight: 500;
    text-align: left;
    grid-column: 1;
}

.dept-years {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-align: center;
    grid-column: 2;
}

.subtitle-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
}


.subtitle-right {
    white-space: nowrap;
    margin-left: 1rem;
}

/* Chart card actions aligned to right */
.department-actions {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

.department-actions button {
    background: transparent;
    border: none;
    padding: 2px;
    line-height: 1;
    color: var(--text-secondary);
    cursor: pointer;
}

.department-actions button:hover {
    color: var(--text-primary);
}

.department-actions i {
    width: 14px;
    height: 14px;
}

.department-chart {
    margin-top: 1.5rem;
}

/* Chart styling */
.chart-container {
    width: 100%;
    height: 350px;
    position: relative;
}

.chart-svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

/* Chart elements */
.chart-grid-line {
    stroke: var(--border-secondary);
    stroke-width: 1;
    opacity: 0.5;
}

.chart-axis-line {
    stroke: var(--text-primary);
    stroke-width: 1;
}

.chart-tick {
    stroke: var(--text-primary);
    stroke-width: 1;
}

.chart-label {
    font-family: var(--font-family);
    font-size: 0.8rem;
    fill: var(--text-primary);
    text-anchor: middle;
}

.chart-label-y {
    font-family: var(--font-family);
    font-size: 0.8rem;
    fill: var(--text-primary);
    text-anchor: end;
}

.chart-area {
    fill: url(#chartGradient);
    fill-opacity: 0.3;
}

.chart-line {
    fill: none;
    stroke: var(--accent-primary);
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.chart-point {
    fill: var(--accent-primary);
    stroke: var(--bg-primary);
    stroke-width: 2;
    r: 4;
}

/* Department colors */
.department-chart-block[data-department="Arbeids- og inkluderingsdepartementet"] .chart-line {
    stroke: #3b82f6;
}

.department-chart-block[data-department="Barne- og familiedepartementet"] .chart-line {
    stroke: #10b981;
}

.department-chart-block[data-department="Digitaliserings- og forvaltningsdepartementet"] .chart-line {
    stroke: #f59e0b;
}

.department-chart-block[data-department="Energidepartementet"] .chart-line {
    stroke: #ef4444;
}

.department-chart-block[data-department="Finansdepartementet"] .chart-line {
    stroke: #8b5cf6;
}

.department-chart-block[data-department="Forsvarsdepartementet"] .chart-line {
    stroke: #06b6d4;
}

.department-chart-block[data-department="Helse- og omsorgsdepartementet"] .chart-line {
    stroke: #84cc16;
}

.department-chart-block[data-department="Justis- og beredskapsdepartementet"] .chart-line {
    stroke: #f97316;
}

.department-chart-block[data-department="Klima- og miljødepartementet"] .chart-line {
    stroke: #22c55e;
}

.department-chart-block[data-department="Kommunal- og distriktsdepartementet"] .chart-line {
    stroke: #eab308;
}

.department-chart-block[data-department="Kultur- og likestillingsdepartementet"] .chart-line {
    stroke: #ec4899;
}

.department-chart-block[data-department="Kunnskapsdepartementet"] .chart-line {
    stroke: #6366f1;
}

.department-chart-block[data-department="Landbruks- og matdepartementet"] .chart-line {
    stroke: #14b8a6;
}

.department-chart-block[data-department="Nærings- og fiskeridepartementet"] .chart-line {
    stroke: #f43f5e;
}

.department-chart-block[data-department="Samferdselsdepartementet"] .chart-line {
    stroke: #0ea5e9;
}

.department-chart-block[data-department="Utenriksdepartementet"] .chart-line {
    stroke: #a855f7;
}

.department-chart-block[data-department="Ymse"] .chart-line {
    stroke: #64748b;
}

/* Footer */
.main-footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-primary);
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

.footer-section p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-section .source-link,
.footer-section .contact-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    transition: color 0.2s ease;
}

.footer-section .source-link:hover,
.footer-section .contact-link:hover {
    color: var(--accent-primary);
}

.footer-section .source-icon,
.footer-section .contact-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    transition: color 0.2s ease;
}

.footer-section .source-link:hover .source-icon,
.footer-section .contact-link:hover .contact-icon {
    color: var(--accent-primary);
}

.footer-copyright {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Responsive design */
@media (max-width: 768px) {
    .header-container {
        padding: 0 1rem;
    }
    
    .site-title {
        font-size: 1.5rem;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    .department-chart-block {
        padding: 1rem;
    }
    
    .department-title {
        font-size: 1.5rem;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
    }
    
    .footer-section .source-link,
    .footer-section .contact-link {
        justify-content: center;
    }
}

/* Drill-down view */
.drill-down-view {
    display: none;
}

.drill-down-view.active {
    display: block;
}

.drill-down-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.back-button {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-md);
    padding: 0.5rem 1rem;
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.back-button:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.drill-down-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.budget-post-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s ease;
}

.budget-post-item:hover {
    border-color: var(--accent-primary);
    box-shadow: var(--shadow-md);
}

.post-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.post-header-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.post-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
}

.clickable-title {
    cursor: pointer;
    transition: opacity 0.2s ease;
}

.clickable-title:hover {
    opacity: 0.8;
}

.post-amounts {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.post-amount {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.post-amount-secondary {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent-primary);
}

.post-details {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.post-details-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-primary);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.post-amounts-inline {
    display: flex;
    gap: 1rem;
    color: var(--text-secondary);
}

.post-chart {
    height: 150px;
    margin-top: 1rem;
}

.budget-item-detail {
    margin-top: 0.5rem;
    padding: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--radius-sm);
    border-left: 3px solid var(--accent-primary);
}

.year-breakdown {
    background: var(--bg-primary);
    border: 1px solid var(--border-secondary);
    margin-top: 1rem;
}

.year-breakdown .post-title {
    font-size: 1rem;
    color: var(--text-secondary);
}

.detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.detail-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    flex: 1;
}

.detail-amount {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
}

/* Navigation Menu */
.nav-menu {
    position: fixed;
    top: 0;
    left: -400px;
    width: 400px;
    height: 100vh;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-primary);
    z-index: 1000;
    transition: left 0.3s ease;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
}

.nav-menu.active {
    left: 0;
}

/* Prevent background scroll when the mobile nav is open */
body.nav-open {
    overflow: hidden;
    height: 100vh;
}

.nav-menu-wrapper {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.nav-menu-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--bg-primary);
}

.nav-menu-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.nav-close {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    transition: color 0.2s ease;
        padding: 0.25rem;
}

.nav-close:hover {
    color: var(--text-primary);
}

.nav-menu-items {
    flex: 1;
    padding: 1rem 0;
}

.nav-menu-item {
    display: block;
    padding: 1rem 1.5rem;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border-primary);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.nav-menu-item:hover {
    background: var(--bg-tertiary);
    color: var(--accent-primary);
}

.nav-menu-item.active {
    background: var(--accent-primary);
    color: white;
}

.nav-menu-item-icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
}

.nav-menu-item-content {
    flex: 1;
}

.nav-menu-item-title {
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.nav-menu-item-subtitle {
    font-size: 0.875rem;
    color: var(--text-secondary);
    opacity: 0.8;
}

.nav-menu-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-primary);
    background: var(--bg-primary);
}

.nav-quick-stats {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.stat-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.stat-value {
    font-weight: 600;
    color: var(--text-primary);
}

/* Mobile adjustments */
@media (max-width: 768px) {
    /* Header mobile adjustments */
    .header-container {
        padding: 0 1rem;
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    
    .site-title {
        font-size: 1.5rem;
        flex: 1;
        min-width: 0;
        white-space: normal; /* allow wrapping */
        line-height: 1.3;
        max-height: 80px; /* limit breadcrumb height */
        overflow-y: auto; /* scroll if too many lines */
        overflow-x: hidden;
    }
    
    .header-actions {
        gap: 0.25rem;
    }

    /* Hide hamburger on mobile; use native select instead */
    .nav-toggle {
        display: none;
    }

    /* Native mobile filter */
    .mobile-filter {
        width: 100%;
        margin-top: 0.25rem;
        padding: 0.5rem 0.75rem;
        border: 1px solid var(--border-primary);
        border-radius: var(--radius-md);
        background: var(--bg-secondary);
        color: var(--text-primary);
        font-family: var(--font-family);
    }

    /* Breadcrumb mobile adjustments */
    .site-title .breadcrumb-item {
        font-size: 1rem;
        display: block; /* stack items vertically */
    }
    
    .site-title .breadcrumb-item:first-child {
        font-size: 1.5rem;
    }
    
    .site-title .breadcrumb-separator {
        display: none; /* hide inline separators on mobile */
    }

    /* Add arrow prefix on subsequent lines */
    .site-title .breadcrumb-item:not(:first-child)::before {
        content: '→ ';
        color: var(--text-secondary);
        margin-right: 0.25rem;
    }

    /* Keep header from overflowing horizontally */
    .main-header {
        overflow: hidden;
    }
    
    .drill-up-button,
    .nav-toggle,
    .theme-toggle {
        padding: 0.4rem;
    }
    
    .drill-up-button i,
    .nav-toggle i,
    .theme-toggle i {
        width: 18px;
        height: 18px;
    }
    
    /* Navigation menu mobile */
    .nav-menu {
        width: 100%;
        left: -100%;
    }
    
    .nav-menu.active {
        left: 0;
    }

    /* Lock scroll on body when nav is open (extra safety on mobile) */
    body.nav-open {
        position: fixed;
        width: 100%;
        inset: 0;
    }

    /* Respect iOS safe area for the sticky header */
    @supports (padding-top: env(safe-area-inset-top)) {
        .main-header {
            padding-top: calc(1rem + env(safe-area-inset-top));
        }
    }
    
    .nav-menu-header {
        padding: 1rem;
    }
    
    .nav-menu-header h2 {
        font-size: 1.125rem;
    }
    
    /* Main content mobile */
    .main-content {
        padding: 1rem 0;
    }
    
    .container {
        padding: 0 1rem;
    }
    
    /* Department cards mobile */
    .department-chart-block {
        padding: 1rem;
        margin-bottom: 1.5rem;
    }
    
    .department-title {
        font-size: 1.5rem;
        line-height: 1.4;
    }
    
    .department-subtitle {
        font-size: 0.9rem;
        gap: 0.75rem;
    }
    
    .dept-posts {
        font-size: 0.9rem;
    }
    
    .dept-change {
        font-size: 0.9rem;
    }
    
    .dept-years {
        font-size: 0.9rem;
    }
    
    /* Chart containers mobile */
    .chart-container {
        height: 250px;
    }
    
    /* Budget post cards mobile */
    .budget-post-item {
        padding: 1rem;
        margin-bottom: 1rem;
    }
    
    .post-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .post-title {
        font-size: 1rem;
        line-height: 1.3;
    }
    
    .post-amounts {
        align-self: flex-end;
        gap: 0.2rem;
    }
    
    .post-amount,
    .post-amount-secondary {
        font-size: 1rem;
    }
    
    .post-details {
        font-size: 0.85rem;
    }
    
    /* Mini charts mobile */
    .post-chart {
        height: 120px;
        margin-top: 0.75rem;
    }
    
    /* Drill-down view mobile */
    .drill-down-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
        margin-bottom: 1.5rem;
    }
    
    .drill-down-title {
        font-size: 1.5rem;
        line-height: 1.3;
    }
    
    .back-button {
        padding: 0.5rem 0.75rem;
        font-size: 0.9rem;
    }
    
    /* Footer mobile */
    .footer-container {
        grid-template-columns: 1fr;
        gap: 1.5rem;
        text-align: center;
    }
    
    .footer-section .source-link,
    .footer-section .contact-link {
        justify-content: center;
    }
    
    /* Navigation menu items mobile */
    .nav-menu-item {
        padding: 0.75rem 1rem;
    }
    
    .nav-menu-item-title {
        font-size: 0.9rem;
    }
    
    .nav-menu-item-subtitle {
        font-size: 0.8rem;
    }
    
    /* Year breakdown mobile */
    .year-breakdown {
        margin-top: 0.75rem;
    }
    
    .year-breakdown .post-title {
        font-size: 0.9rem;
    }
    
    .budget-item-detail {
        padding: 0.4rem;
        margin-top: 0.4rem;
    }
    
    .detail-label,
    .detail-amount {
        font-size: 0.8rem;
    }
}

/* Extra small mobile adjustments */
@media (max-width: 480px) {
    .header-container {
        padding: 0 0.75rem;
    }
    
    .site-title {
        font-size: 1.25rem;
    }
    
    .site-title .breadcrumb-item:first-child {
        font-size: 1.25rem;
    }
    
    .container {
        padding: 0 0.75rem;
    }
    
    .department-chart-block {
        padding: 0.75rem;
    }
    
    .department-title {
        font-size: 1.25rem;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .budget-post-item {
        padding: 0.75rem;
    }
    
    .post-title {
        font-size: 0.95rem;
    }
    
    .post-amount,
    .post-amount-secondary {
        font-size: 0.9rem;
    }
    
    .post-chart {
        height: 100px;
    }
    
    .drill-down-title {
        font-size: 1.25rem;
    }
    
    .nav-menu-header {
        padding: 0.75rem;
    }
    
    .nav-menu-item {
        padding: 0.6rem 0.75rem;
    }
}

/* Utility classes */
.hidden {
    display: none !important;
}