:root {
    --primary-color: #004A93;
    --text-color: #333;
    --bg-color: #f4f7f6;
    --card-bg: #ffffff;
    --accent-color: #0C55B9;
    --container-width: 1200px;
    --header-height: 80px;
    /* Reduced header height hint */
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: var(--text-color);
    background-color: var(--bg-color);
    line-height: 1.6;
}

a {
    text-decoration: none;
    color: var(--primary-color);
    transition: color 0.3s;
}

a:hover {
    color: var(--accent-color);
}

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1rem;
}

/* Header */
.main-header {
    background: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    padding: 0.5rem 0;
    /* Reduced padding */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    padding: 0 1rem;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    max-width: 80%;
    /* Prevent logo from taking full width over menu */
}

.logo img {
    height: 50px;
    /* Default height */
    width: auto;
}

.site-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.site-title h1 {
    font-size: 1.5rem;
    color: var(--primary-color);
    line-height: 1.1;
    margin: 0;
}

.site-title p {
    font-size: 0.75rem;
    /* Small subtitle */
    color: #666;
    line-height: 1.2;
    margin: 0;
}

/* Nav */
.main-nav {
    display: flex;
    gap: 1.5rem;
    align-items: center;
}

.main-nav a {
    font-weight: 600;
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 1rem;
}

.main-nav a.active {
    background-color: var(--primary-color);
    color: #fff;
}

.hamburger {
    display: none;
    /* Hidden by default */
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
    z-index: 1001;
}

.hamburger span {
    display: block;
    width: 25px;
    height: 3px;
    background-color: var(--primary-color);
    border-radius: 2px;
    transition: 0.3s;
}

/* Responsive Header & Nav */
@media (max-width: 768px) {
    .main-header {
        padding: 0.3rem 0;
    }

    /* Logo Layout Adjustments */
    .logo img {
        height: 40px;
        /* Reduce logo size */
    }

    .site-title h1 {
        font-size: 1.1rem;
        /* Smaller title */
    }

    .site-title p {
        font-size: 0.65rem;
        /* Smaller subtitle */
        line-height: 1.1;
    }

    /* Hamburger Menu */
    .hamburger {
        display: flex;
    }

    .main-nav {
        display: none;
        /* Hide default nav */
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: #fff;
        flex-direction: column;
        padding: 1rem;
        box-shadow: 0 5px 5px rgba(0, 0, 0, 0.1);
        gap: 1rem;
        text-align: center;
        border-top: 1px solid #eee;
    }

    .main-nav.open {
        display: flex;
        animation: slideDown 0.3s ease-out;
    }

    .main-nav a {
        width: 100%;
        padding: 0.8rem;
        border-bottom: 1px solid #f0f0f0;
    }

    .main-nav a:last-child {
        border-bottom: none;
    }

    /* Hamburger Animation state */
    .hamburger.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    /* Mobile Content Margins */
    .container.main-content {
        margin-left: 20px;
        margin-right: 20px;
        width: auto;
        /* Allow auto width to respect margins inside viewport */
        padding-left: 0;
        /* Remove padding if margin is used as spacing */
        padding-right: 0;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Main Content */
.main-content {
    padding: 2rem 0;
    min-height: 80vh;
    margin-top: -15px;
}

.scroll-view-container {
    display: grid;
    grid-template-columns: repeat(1, 1fr);
    /* 1 column mobile */
    gap: 2rem;
    padding: 1rem 0;
}

/* Grid Layout */
.issue-page-card {
    background: var(--card-bg);
    margin-bottom: 0 !important;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: transform 0.3s;
    position: relative;
}

@media (min-width: 600px) {
    .scroll-view-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 900px) {
    .scroll-view-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .scroll-view-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Image Cropping */
.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 1.4;
    /* Crop to top half */
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: auto;
    object-position: top;
    object-fit: cover;
}

/* Gradient Overlay */
.image-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 40%;
    background: linear-gradient(to bottom, transparent 0%, rgba(255, 255, 255, 1) 100%);
    pointer-events: none;
}

.page-meta {
    position: relative;
    z-index: 10;
    background: #fff;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: none;
    margin-top: -5px;
}

.btn-read {
    background: var(--accent-color);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-weight: bold;
}

.btn-read:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Header Card (First Item) */
.header-card {
    background: #004A93;
    color: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    aspect-ratio: 1.25;
    min-height: 100%;
}

.header-card-content {
    padding: 1.5rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: center;
}

.header-card h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    padding-bottom: 0.5rem;
}

.header-actions {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    flex-grow: 1;
    justify-content: center;
}

.action-btn {
    display: block;
    background: rgba(255, 255, 255, 0.1);
    color: #fff !important;
    padding: 0.8rem;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    transition: background 0.3s, transform 0.2s;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.action-btn:hover {
    background: #fff;
    color: #004A93 !important;
    transform: translateY(-2px);
    text-decoration: none;
}

.action-btn span {
    margin-right: 8px;
}

.header-card .header-card-content {
    width: 100%;
}

/* Archive Styles */
.archive-year-group {
    margin-bottom: 2rem;
}

.archive-year-group h3 {
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 0.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.archive-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 1rem;
    list-style: none;
}

.archive-item {
    text-align: center;
}

.archive-thumb {
    width: 100%;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s;
}

.archive-item:hover .archive-thumb {
    transform: scale(1.05);
}

.archive-month {
    display: block;
    margin-top: 0.5rem;
    font-weight: bold;
    font-size: 0.9rem;
}

/* Footer */
.main-footer {
    background: #333;
    color: #fff;
    padding: 2rem 0;
    text-align: center;
    margin-top: auto;
}

.main-footer a {
    color: #ddd;
}

/* assets/css/style.css - Header Card Refinement */

.header-card {
    background: #dddddd !important;
    /* Requested Gray Background */
    color: #fff;
    /* Aspect ratio maintained */
}

.header-card h3 {
    font-size: 1.1rem;
    /* Reduced Title Size */
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    color: #fff;
    /* Requested White Title */
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    /* improved readability on #ddd */
}

.action-btn {
    background: #004A93 !important;
    /* "Card in blu" - Buttons are now blue blocks */
    color: #fff !important;
    padding: 0.5rem;
    /* Reduced Padding */
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.action-btn:hover {
    background: #003366 !important;
    transform: translateY(-1px);
}

.header-actions {
    gap: 0.5rem;
    /* Reduced gap */
}

/* assets/css/style.css - Header Title Color Update */

.header-card h3 {
    color: #004A93 !important;
    /* Requested Blue Title */
    text-shadow: none;
    /* Remove shadow needed for white text */
    border-bottom: 1px solid rgba(0, 74, 147, 0.2);
    /* Adjust border to match blue theme */
}

/* assets/css/style.css - Mobile Header Preview */

/* Default: Hidden on Larger Screens */
.header-mobile-preview {
    display: none;
}

/* Mobile: Visible and styled */
@media (max-width: 600px) {
    .header-mobile-preview {
        display: block;
        margin: 1rem auto;
        width: 60%;
        /* Adjust size as needed */
        max-width: 200px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        border-radius: 4px;
        overflow: hidden;
    }

    .header-mobile-preview img {
        width: 100%;
        height: auto;
        display: block;
    }

    /* Override aspect ratio to allow growth */
    .header-card {
        aspect-ratio: auto !important;
        min-height: auto !important;
        height: auto !important;
    }
}

/* assets/css/style.css - Cross-Device Header Preview */

/* General Preview Style (Desktop Default) */
.header-preview {
    display: block;
    margin: 1rem auto;
    width: 200px;
    /* Requested size for desktop */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    overflow: hidden;
}

.header-preview img {
    width: 100%;
    height: auto;
    display: block;
}

/* Allow header card to grow to fit image */
.header-card {
    aspect-ratio: auto !important;
    min-height: auto !important;
    height: auto !important;
}

/* Mobile Overrides (< 600px - kept consistent with previous choice) */
@media (max-width: 600px) {
    .header-preview {
        width: 60%;
        /* Responsive width for mobile */
        max-width: 240px;
    }
}

/* assets/css/style.css - Sidebar Layout */

/* Mobile First (Default) */
.main-grid-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.sidebar-card {
    /* Standard card behavior on mobile */
    width: 100%;
}

.issues-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

/* Tablet (Grid starts appearing for issues) */
@media (min-width: 600px) {
    .issues-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop Sidebar Layout (> 900px) */
@media (min-width: 900px) {
    .main-grid-wrapper {
        display: grid;
        grid-template-columns: 280px 1fr;
        /* Sidebar Fixed Width | Content Flexible */
        gap: 2rem;
        align-items: start;
        /* Ensure sidebar doesn't stretch to full height of content */
    }

    .sidebar-card {
        position: sticky;
        /* Make it sticky */
        top: 20px;
        /* Offset from top */
        height: auto;
        /* Height fit to content */
        max-height: calc(100vh - 40px);
        /* Prevent overflow if taller than screen */
        overflow-y: auto;
        /* Scroll internally if needed */
        z-index: 100;
        margin-top: 0;
        /* Adjust alignment */
    }

    .issues-grid {
        grid-template-columns: repeat(2, 1fr);
        /* 2 cols next to sidebar */
        margin-top: 0;
        padding-top: 0;
    }
}

/* Large Desktop (> 1200px) */
@media (min-width: 1200px) {
    .issues-grid {
        grid-template-columns: repeat(3, 1fr);
        /* 3 cols next to sidebar */
    }
}

/* Mobile Accordion Styles */
.mobile-accordion-toggle {
    display: none;
    /* Hidden on Desktop */
    width: 100%;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 0.8rem;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    border-radius: 4px;
    margin-top: 1rem;
    transition: background 0.2s;
}

.mobile-accordion-toggle:hover {
    background: rgba(255, 255, 255, 0.3);
}

@media (max-width: 768px) {
    .mobile-accordion-toggle {
        display: block;
        /* Visible on Mobile */
    }

    /* Default handled by JS, but ensure toggle visibility */
}

/* Global Archive View Styles */
body.archive-view .container.main-content {
    max-width: none !important;
    margin: 20px !important;
    width: auto !important;
    padding-left: 0;
    padding-right: 0;
}