:root {
    --paper-color: #F5E6D3;
    --text-color: #2C1810;
    --dark-blue: #1A2639;
    --gold: #C5A880;
    --gray: #707070;
    --content-width-tablet: 700px;
    --content-width-mobile: 100%;
    --font-size-base: 16px;
    --font-size-tablet: 18px;
    --font-size-mobile: 16px;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--paper-color);
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    min-height: 100vh;
    opacity: 1;
    animation: none;
    overflow-x: hidden;
    width: 100%;
}

.newspaper-header {
    padding: 2rem 2rem 1rem;
    margin-bottom: 0;
}

.masthead {
    text-align: center;
    padding: 1rem 0;
}

.masthead h1 {
    font-family: 'Playfair Display', serif;
    font-weight: 900;
    font-size: 4.5rem;
    margin: 0;
    letter-spacing: -1px;
    color: var(--text-color);
}

.articles-grid {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.article-card {
    position: relative;
    background: transparent;
    margin-bottom: 2rem;
    padding: 2rem 0;
    border-bottom: 1px solid rgba(44, 24, 16, 0.2);
}

.article-card:last-child {
    border-bottom: none;
}

.article-card h2,
.article-card h3,
.article-card p {
    margin: 0 0 1rem 0;
    padding: 0;
    text-indent: 0;
}

.article-card p {
    color: var(--text-color);
    line-height: 1.8;
    font-family: 'Lora', serif;
    font-size: 1.1rem;
    max-width: 70ch;
    margin-right: auto;
}

.read-more {
    background: none;
    color: var(--text-color);
    border: none;
    padding: 0;
    font-size: 0.9rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    font-style: italic;
    position: relative;
}

.read-more::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--text-color);
    transition: opacity 0.2s ease;
}

.read-more:hover::after {
    opacity: 0.7;
}

@media (max-width: 768px) {
    .articles-grid {
        max-width: var(--content-width-mobile);
        padding: 0 1rem;
    }
    
    .year-section {
        column-width: auto;
        column-count: 1;
    }

    .article-card {
        padding: 1.5rem 0;
    }
}

/* Jaar container */
.year-section {
    margin-bottom: 4rem;
    column-width: 400px;
    column-gap: 3rem;
    column-rule: 1px solid var(--text-color);
    opacity: 1;
    animation: none;
}

/* Jaar headers */
.year-header {
    font-family: 'Playfair Display', serif;
    font-size: 3rem;
    color: var(--text-color);
    margin: 0 0 2rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--text-color);
    break-inside: avoid;
    break-after: avoid;
    column-span: all;
}

/* Update article card headers voor betere hiërarchie */
.article-card h3 {
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    margin: 0 0 1rem 0;
    color: var(--text-color);
    line-height: 1.2;
}

/* Zoekbalk styling */
.search-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    display: flex;
    align-items: center;
}

.search-container::after {
    content: 'Druk "/" om te zoeken';
    position: absolute;
    right: 3rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.8rem;
    color: var(--text-color);
    opacity: 0.6;
    pointer-events: none;
    white-space: nowrap;
}

.search-input {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1.1rem;
    border: 1px solid rgba(44, 24, 16, 0.2);
    border-radius: 4px;
    background-color: rgba(255, 255, 255, 0.7);
    color: var(--text-color);
    font-family: 'Roboto', sans-serif;
    min-height: 44px;
    touch-action: manipulation;
    transition: all 0.2s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.search-input:focus {
    outline: none;
    border-color: var(--text-color);
    background-color: rgba(255, 255, 255, 0.95);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.search-input:focus::placeholder {
    opacity: 0.5;
}

/* Hide keyboard shortcut hint when input is focused or has value */
.search-input:focus + .search-container::after,
.search-input:not(:placeholder-shown) + .search-container::after {
    opacity: 0;
}

/* Keyboard navigation styles */
.article-card .read-more:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--text-color);
    border-radius: 2px;
}

.article-card .read-more:focus:not(:focus-visible) {
    box-shadow: none;
}

@media (max-width: 768px) {
    .search-container {
        padding: 0 1rem;
    }

    .search-container::after {
        display: none;
    }

    .search-input {
        padding: 0.8rem 1rem;
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* No results message */
.no-results {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
    font-style: italic;
}

/* Article meta styling */
.article-meta {
    margin: 0.5rem 0 1rem;
    font-size: 0.9rem;
    color: var(--gray);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.article-date {
    display: inline-block;
}

.reading-time {
    display: inline-flex;
    align-items: center;
    font-style: normal;
    color: var(--text-color);
    background: rgba(44, 24, 16, 0.05);
    padding: 0.2rem 0.6rem;
    border-radius: 3px;
    font-size: 0.8rem;
    transition: background-color 0.2s ease;
}

.reading-time::before {
    content: '⏱';
    margin-right: 0.4rem;
    font-size: 0.9rem;
}

.reading-time:hover {
    background: rgba(44, 24, 16, 0.08);
}

@media (max-width: 768px) {
    .article-meta {
        gap: 0.8rem;
    }

    .reading-time {
        padding: 0.15rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* Loading animatie voor artikelen en jaartallen */
@keyframes articleLoad {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

.loading-shimmer {
    background: linear-gradient(
        90deg,
        rgba(44, 24, 16, 0.03) 25%,
        rgba(44, 24, 16, 0.08) 37%,
        rgba(44, 24, 16, 0.03) 63%
    );
    background-size: 400% 100%;
    animation: articleLoad 1.5s ease infinite;
}

.year-header.loading {
    height: 4rem;
    width: 150px;
    border-bottom: none;
    margin-bottom: 2rem;
}

.article-card.loading {
    min-height: 200px;
}

.article-card.loading *,
.year-header.loading * {
    visibility: hidden;
}

/* Loading section styling */
.year-section.loading {
    margin-bottom: 4rem;
}

@media (prefers-reduced-motion: reduce) {
    body {
        animation: none;
        opacity: 1;
    }
    .loading-shimmer {
        animation: none;
        background: rgba(44, 24, 16, 0.03);
    }
}

/* Tablet styling (iPad) */
@media (max-width: 1024px) {
    .articles-grid {
        max-width: var(--content-width-tablet);
        padding: 0 2rem;
    }

    .search-container {
        max-width: var(--content-width-tablet);
    }

    .article-card h2 {
        font-size: 1.8rem;
    }

    .article-card p {
        font-size: var(--font-size-tablet);
        line-height: 1.7;
    }

    .masthead h1 {
        font-size: 3.5rem;
    }

    .year-header {
        font-size: 2.5rem;
    }
}

/* Mobile styling */
@media (max-width: 768px) {
    .articles-grid {
        max-width: var(--content-width-mobile);
        padding: 0 1rem;
    }

    .search-container {
        max-width: var(--content-width-mobile);
        padding: 0 1rem;
    }

    .masthead {
        padding: 0.5rem 0;
    }

    .masthead h1 {
        font-size: 2.5rem;
    }

    .year-header {
        font-size: 2rem;
        margin-bottom: 1.5rem;
    }

    .article-card {
        padding: 1.5rem 0;
    }

    .article-card h2 {
        font-size: 1.5rem;
    }

    .article-card p {
        font-size: var(--font-size-mobile);
        line-height: 1.6;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8rem;
    }

    .article-meta {
        font-size: 0.9rem;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .masthead h1 {
        font-size: 2rem;
    }

    .year-header {
        font-size: 1.8rem;
    }

    .article-card {
        padding: 1rem 0;
    }

    .article-card h2 {
        font-size: 1.3rem;
    }
}

.intro-text {
    max-width: 800px;
    margin: 0 auto 2rem;
    padding: 0 2rem;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    line-height: 1.6;
}

.intro-text p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.9;
}

@media (max-width: 768px) {
    .newspaper-header {
        padding: 1rem 1rem 0.5rem;
    }

    .masthead {
        padding: 0.5rem 0;
    }

    .intro-text {
        padding: 0 1rem;
        margin: 0 auto 1.5rem;
    }

    .intro-text p {
        font-size: 1rem;
        line-height: 1.5;
    }

    .search-container {
        padding: 0 1rem;
        margin: 0 auto 1.5rem;
    }

    .search-input {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.8rem;
    }
}

.search-results-info {
    max-width: 800px;
    margin: 1rem auto;
    padding: 0 2rem;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.search-results-info p {
    margin: 0;
    font-size: 0.95rem;
    opacity: 0.8;
}

.clear-search {
    background: none;
    border: 1px solid var(--text-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-search:hover {
    background: var(--text-color);
    color: var(--paper-color);
}

.clear-search:focus {
    outline: 2px solid var(--text-color);
    outline-offset: 2px;
}

.clear-search:focus:not(:focus-visible) {
    outline: none;
}

@media (max-width: 768px) {
    .search-results-info {
        padding: 0 1rem;
        margin: 1rem auto;
        flex-direction: column;
        gap: 0.5rem;
    }
}

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

/* Back to Top Button */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--text-color);
    color: var(--paper-color);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    padding-bottom: 4px;
}

.back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
}

.back-to-top:hover {
    background: var(--dark-blue);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.back-to-top:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--paper-color), 0 0 0 6px var(--text-color);
}

@media (max-width: 768px) {
    .back-to-top {
        bottom: 1.5rem;
        right: 1.5rem;
        width: 40px;
        height: 40px;
        font-size: 1.2rem;
    }

    .search-section {
        padding: 1rem 0;
        margin-bottom: 1.5rem;
    }

    .search-container {
        padding: 0 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}

.home-link {
    color: var(--text-color);
    text-decoration: none;
    font-size: 0.9rem;
}

.home-link:hover {
    text-decoration: underline;
    transform: translateX(-5px);
    opacity: 0.7;
}