/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

button {
    outline: none;
}

button:focus,
button:focus-visible {
    outline: none !important;
}

:root {
    --bg-color: #f5f5f0;
    --text-color: #333;
    --card-bg: #fff;
    --border-color: #ddd;
    --hover-bg: #f5f5f0;
    --accent-color: #333;
    --accent-hover: #555;
    --meta-color: #666;
    --disabled-color: #ccc;
    --shadow: rgba(0,0,0,0.1);
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.4;
    color: var(--text-color);
    background-color: var(--bg-color);
    padding: 20px;
    transition: background-color 0.3s ease, color 0.3s ease;
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    zoom: 0.7;
    transform-origin: top left;
    font-size: 1.25em;
}

/* Starry background for dark mode */
.stars-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

body.dark-mode .stars-container {
    opacity: 1;
}

.star {
    position: absolute;
    background-color: white;
    border-radius: 50%;
    animation: twinkle 3s infinite;
}

.star.small {
    width: 1px;
    height: 1px;
}

.star.medium {
    width: 2px;
    height: 2px;
}

.star.large {
    width: 3px;
    height: 3px;
}

@keyframes twinkle {
    0%, 100% { opacity: 0.3; }
    50% { opacity: 1; }
}

/* Header */
header {
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 3px double var(--border-color);
    position: relative;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

header.loaded {
    opacity: 1;
}

.header-content {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    position: relative;
}

header h1 {
    font-size: 3.5em;
    font-weight: bold;
    letter-spacing: 2px;
    margin-bottom: 5px;
    text-transform: uppercase;
}

.header-title-link {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.header-title-link:hover {
    opacity: 0.8;
}

.theme-toggle {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    width: 1.5em;
    height: 1.5em;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0;
    font-size: 1.5em;
}

.theme-toggle:hover {
    background-color: var(--hover-bg);
    border-radius: 4px;
}

.theme-icon {
    width: 1em;
    height: 1em;
    position: absolute;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.sun-icon {
    opacity: 1;
    transform: rotate(0deg);
    color: #000;
}

.moon-icon {
    opacity: 0;
    transform: rotate(90deg);
    color: #fff;
}

body.dark-mode .sun-icon {
    opacity: 0;
    transform: rotate(90deg);
}

body.dark-mode .moon-icon {
    opacity: 1;
    transform: rotate(0deg);
}

.tagline {
    font-style: italic;
    color: var(--meta-color);
    font-size: 1.3em;
}

/* Icon styling */
.icon-inline {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin: 0 4px;
}

.layout-container {
    display: flex;
    flex-direction: column;
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    align-items: center;
    flex: 1;
    min-height: 0;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.layout-container.loaded {
    opacity: 1;
}

.main-content {
    width: 100%;
    max-width: 1200px;
    display: flex;
    flex-direction: column;
}

/* Editions Section */
.editions-section {
    width: 100%;
    max-width: 1200px;
    background-color: var(--card-bg);
    padding: 30px;
    box-shadow: 0 4px 8px var(--shadow);
    margin-bottom: 30px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.editions-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
}

.editions-header h3 {
    font-size: 1.8em;
    margin: 0;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.editions-header h3 .icon-inline {
    width: 1em;
    height: 1em;
}

.sort-order-btn {
    padding: 8px 16px;
    font-size: 0.9em;
    background-color: #fff;
    color: #000;
    border: none;
    border-radius: 2px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 40px;
    font-weight: 500;
    outline: none;
}

.sort-order-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sort-order-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.editions-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
    min-height: 300px;
}

.edition-item {
    padding: 6px 10px;
    cursor: pointer;
    border: 2px solid var(--border-color);
    border-radius: 2px;
    transition: all 0.2s ease;
    font-size: 1.05em;
    background-color: #fff;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 40px;
    height: auto;
}

.edition-item:hover {
    background-color: #000;
    color: #fff;
    border-color: #000;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.edition-item.active {
    font-weight: bold;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.edition-item.active .edition-item-number {
    font-weight: bold;
}

.edition-item.active .edition-item-date {
    font-weight: bold;
    color: var(--meta-color);
}

.edition-item-number {
    font-weight: bold;
    margin-bottom: 3px;
    font-size: 1.2em;
}

.edition-item-date {
    font-size: 1.05em;
    color: var(--meta-color);
    margin-top: 0;
}

.editions-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 2px solid var(--border-color);
}

.editions-dropdown {
    display: none;
    width: 100%;
    padding: 12px 16px;
    font-size: 1em;
    font-family: 'Georgia', serif;
    border: 2px solid #000;
    border-radius: 2px;
    background-color: #fff;
    color: #000;
    cursor: pointer;
    margin-bottom: 20px;
    outline: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 40px;
}

.editions-dropdown:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

body.dark-mode .editions-dropdown {
    background-color: #fff;
    color: #000;
    border-color: #000;
}

.pagination-btn {
    width: 40px;
    height: 40px;
    padding: 0;
    background-color: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    outline: none;
}

.pagination-btn:hover:not(:disabled) {
    background-color: #000;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.pagination-btn:disabled {
    background-color: #fff;
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.page-info {
    font-size: 0.9em;
    color: var(--text-color);
    min-width: 50px;
    text-align: center;
    font-weight: 500;
}

/* Quiz actions */
.questions-section {
    position: relative;
}

.quiz-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: 20px;
    margin-bottom: 0;
    padding: 15px 0 5px 0;
    flex-wrap: wrap;
}

.quiz-actions-info {
    padding: 10px 16px;
    font-size: 1.1em;
    background-color: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 2px;
    font-family: 'Georgia', serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: auto;
    height: 40px;
    cursor: default;
    white-space: nowrap;
}

.quiz-actions-date {
    font-weight: 500;
}

.quiz-actions-edition {
    font-size: 1em;
}

/* Buttons - Modern consistent style */
.nav-btn,
.toggle-answers-btn,
.pagination-btn {
    padding: 10px 16px;
    font-size: 1.1em;
    background-color: #fff;
    color: #000;
    border: 2px solid #000;
    border-radius: 2px;
    cursor: pointer;
    font-family: 'Georgia', serif;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 90px;
    height: 40px;
    font-weight: 500;
    outline: none;
}

.nav-btn:focus,
.toggle-answers-btn:focus,
.pagination-btn:focus {
    outline: none;
}

.nav-btn:focus-visible,
.toggle-answers-btn:focus-visible,
.pagination-btn:focus-visible {
    outline: none;
}

.pagination-btn {
    min-width: 40px;
    width: 40px;
    padding: 0;
}

.nav-btn:hover:not(:disabled),
.toggle-answers-btn:hover,
.pagination-btn:hover:not(:disabled) {
    background-color: #000;
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.nav-btn:disabled,
.pagination-btn:disabled {
    background-color: #fff;
    color: #999;
    border-color: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.nav-btn:active:not(:disabled),
.toggle-answers-btn:active,
.pagination-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

main {
    background-color: var(--card-bg);
    padding: 30px;
    box-shadow: 0 4px 8px var(--shadow);
    margin-bottom: 10px;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
    flex: 1;
    width: 100%;
    box-sizing: border-box;
    min-height: 800px;
}

/* Quiz newspaper style */
.quiz-newspaper {
    font-size: 0.95em;
    width: 100%;
    box-sizing: border-box;
    min-height: 700px;
    display: flex;
    flex-direction: column;
}

.quiz-header {
    text-align: center;
    margin-bottom: 10px;
    padding-bottom: 15px;
    border-bottom: 2px solid var(--accent-color);
    flex-shrink: 0;
}

/* Desktop elements - hidden on mobile */
.quiz-header.desktop-header {
    display: block;
}

.quiz-header.mobile-header {
    display: none;
}

.quiz-columns-header.desktop-header {
    display: grid;
}

.questions-header-mobile,
.answers-header-mobile {
    display: none;
}

.nav-btn.mobile-nav {
    display: none;
}

.nav-btn.desktop-nav {
    display: inline-flex;
}

.quiz-header h2 {
    font-size: 1.8em;
    margin: 0;
    letter-spacing: 1px;
}

.quiz-header-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
    width: 100%;
    margin-bottom: 8px;
}

.quiz-header-top {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    position: relative;
    flex: 1;
}

.quiz-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 1.3em;
    color: var(--meta-color);
}

.quiz-meta .edition {
    font-size: 1.3em;
    font-weight: 500;
}

.quiz-content {
    margin-top: 10px;
    width: 100%;
    box-sizing: border-box;
    flex: 1;
    min-height: 700px;
    display: flex;
    flex-direction: column;
}

.quiz-columns-header {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    margin-bottom: 12px;
    margin-top: 0;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 8px;
    padding-top: 0;
    width: 100%;
    box-sizing: border-box;
}

.quiz-columns-header.desktop-header {
    grid-template-columns: 1fr;
}

/* Questions section */
.questions-section {
    width: 100%;
    margin-bottom: 30px;
}

.quiz-intro-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 15px;
    margin-top: 5px;
}

.quiz-mid-image-container {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 5px;
}

.quiz-mid-images-container {
    width: 100%;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
    margin-top: 15px;
    margin-bottom: 5px;
    flex-wrap: wrap;
}

.quiz-mid-images-container .quiz-image-positioned {
    max-width: 300px;
    flex: 0 1 auto;
}

.questions-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
    margin-bottom: 20px;
}

.questions-column-left,
.questions-column-right {
    width: 100%;
}

.questions-column-left .questions-list,
.questions-column-right .questions-list {
    margin: 0;
    padding: 0;
}

/* Answers section */
.answers-section {
    width: 100%;
    margin-top: 15px;
}

.answers-two-columns {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    align-items: start;
}

.answers-column-left,
.answers-column-right {
    width: 100%;
}

.answers-column-left .answers-list,
.answers-column-right .answers-list {
    margin: 0;
    padding: 0;
    min-height: auto;
    height: auto;
}

/* Quiz images positioned in questions list */
.quiz-image-container {
    list-style: none;
    padding: 0 !important;
    margin: 0 !important;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.quiz-image-positioned {
    width: 100%;
    max-width: 400px;
    height: auto;
    max-height: 300px;
    object-fit: contain;
    display: block;
    margin: 0;
    background-color: var(--card-bg);
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
    pointer-events: none;
}

.questions-header,
.answers-header {
    font-size: 1.4em;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin: 0 0 12px 0;
}

.answers-header {
    margin-top: 0;
    margin-bottom: 12px;
    padding-top: 8px;
    padding-bottom: 8px;
    border-top: 2px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.quiz-columns {
    display: none; /* Old layout - not used anymore */
}

@media (max-width: 768px) {
    .questions-two-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .answers-two-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

.questions-column {
    display: flex;
    flex-direction: column;
    width: 100%;
    box-sizing: border-box;
    overflow-y: visible;
}

.questions-list,
.answers-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.questions-list li,
.answers-list li {
    position: relative;
    padding-left: 40px;
    margin-bottom: 15px;
    line-height: 1.6;
    font-size: 1.15em;
}

.answers-list {
    min-height: 700px;
    transition: visibility 0.3s, opacity 0.3s;
    width: 100%;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    overflow-y: visible;
}

.answers-list.hidden {
    visibility: hidden;
    opacity: 0;
    min-height: 700px;
}

.answers-list:not(.hidden) {
    visibility: visible;
    opacity: 1;
}

.question-number,
.answer-number {
    position: absolute;
    left: 0;
    top: 0;
    font-weight: bold;
    width: 35px;
    text-align: right;
    white-space: nowrap;
    display: inline-block;
    line-height: inherit;
}

.question-text,
.answer-text {
    display: block;
    margin-left: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
    hyphens: auto;
}

.answer-images {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    flex-wrap: wrap;
    justify-content: flex-start;
}

.answer-image {
    max-width: 300px;
    max-height: 300px;
    width: auto;
    height: auto;
    object-fit: contain;
    border: 1px solid var(--border-color);
    background-color: var(--card-bg);
    user-select: none;
    -webkit-user-drag: none;
    -khtml-user-drag: none;
    -moz-user-drag: none;
    -o-user-drag: none;
}

@media (max-width: 768px) {
    .answer-images {
        flex-direction: column;
        gap: 10px;
    }
    
    .answer-image {
        max-width: 100%;
        max-height: 250px;
    }
}

/* Loading Screen */
.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-color);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

.loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

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

.loading-text {
    font-family: 'Georgia', serif;
    font-size: 2em;
    font-weight: bold;
    color: var(--text-color);
    text-transform: uppercase;
    letter-spacing: 4px;
    margin-bottom: 40px;
    opacity: 1;
}

.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 20px;
}

.spinner-dot {
    width: 10px;
    height: 10px;
    background-color: var(--accent-color);
    border-radius: 50%;
    animation: loading-bounce 2s infinite ease-in-out both;
    opacity: 0.6;
}

.spinner-dot:nth-child(1) {
    animation-delay: -0.4s;
}

.spinner-dot:nth-child(2) {
    animation-delay: -0.2s;
}

.spinner-dot:nth-child(3) {
    animation-delay: 0s;
}

@keyframes loading-bounce {
    0%, 80%, 100% {
        transform: scale(0.7);
        opacity: 0.4;
    }
    40% {
        transform: scale(1.3);
        opacity: 1;
    }
}

body.dark-mode .loading-screen {
    background-color: var(--bg-color);
}

/* Header fade-in - merged with header styles above */

/* Footer */
footer {
    opacity: 0;
    transition: background-color 0.3s ease, box-shadow 0.3s ease, opacity 0.5s ease;
    background-color: var(--card-bg);
    padding: 40px 30px;
    box-shadow: 0 -2px 4px var(--shadow);
    margin-top: 80px;
    margin-left: -20px;
    margin-right: -20px;
    margin-bottom: -20px;
    width: calc(100% + 40px);
}

footer.loaded {
    opacity: 1;
}

.footer-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 40px;
    flex-wrap: wrap;
}

.footer-left {
    flex: 1;
    min-width: 200px;
}

.footer-right {
    flex: 1;
    min-width: 200px;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;
}

.footer-title {
    font-size: 1.8em;
    font-weight: bold;
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.footer-title-link {
    color: var(--text-color);
    text-decoration: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.footer-title-link:hover {
    opacity: 0.8;
}

.footer-date {
    font-size: 1em;
    color: var(--meta-color);
    margin: 8px 0 0 0;
    font-style: normal;
}

.footer-tagline {
    font-style: italic;
    color: var(--meta-color);
    font-size: 1.15em;
    margin: 0;
}

.footer-links {
    font-size: 0.9em;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-link-separator {
    color: var(--meta-color);
    margin: 0 4px;
}

.footer-links a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.footer-copyright {
    font-size: 0.85em;
    color: var(--meta-color);
    margin: 0;
}

/* Dark mode */
body.dark-mode {
    --bg-color: #0a0a0a;
    --text-color: #e0e0e0;
    --card-bg: #1a1a1a;
    --border-color: #333;
    --hover-bg: #2a2a2a;
    --accent-color: #e0e0e0;
    --accent-hover: #fff;
    --meta-color: #aaa;
    --disabled-color: #555;
    --shadow: rgba(0,0,0,0.5);
}

body.dark-mode .edition-item {
    background-color: var(--card-bg);
    border-color: var(--border-color);
    color: var(--text-color);
}

body.dark-mode .edition-item:hover {
    background-color: #000;
    border-color: #000;
    color: #fff;
}

body.dark-mode .edition-item.active {
    font-weight: bold;
}

body.dark-mode .edition-item.active .edition-item-date {
    color: var(--meta-color);
    font-weight: bold;
}

body.dark-mode .nav-btn,
body.dark-mode .toggle-answers-btn,
body.dark-mode .pagination-btn {
    background-color: #fff;
    color: #000;
    border-color: #000;
}

body.dark-mode .quiz-actions-info {
    background-color: #fff;
    color: #000;
    border-color: #000;
}

body.dark-mode .nav-btn:hover:not(:disabled),
body.dark-mode .toggle-answers-btn:hover,
body.dark-mode .pagination-btn:hover:not(:disabled) {
    background-color: #000;
    color: #fff;
}

body.dark-mode .nav-btn:disabled,
body.dark-mode .pagination-btn:disabled {
    background-color: #fff;
    color: #999;
    border-color: #ccc;
}

body.dark-mode .sort-order-btn {
    background-color: #fff;
    color: #000;
    border: none;
}

body.dark-mode .sort-order-btn:hover {
    background-color: #fff;
    color: #000;
}

/* Mobile-first responsive design */

/* Prevent zoom on input focus - critical for mobile UX */
@media screen and (max-width: 768px) {
    input, textarea, select {
        font-size: 16px !important;
    }
}

/* Small mobile phones (up to 480px) */
@media (max-width: 480px) {
    /* Base adjustments */
    body {
        padding: 0;
        font-size: 16px;
        -webkit-text-size-adjust: 100%;
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Header - Compact mobile layout */
    header {
        padding: 12px 10px;
        margin-bottom: 12px;
        text-align: left;
    }
    
    .header-content {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        margin-bottom: 8px;
        width: 100%;
    }
    
    header h1 {
        font-size: 1.6em;
        margin-bottom: 0;
        text-align: left;
        display: block;
        width: auto;
        flex: 1;
    }
    
    .theme-toggle {
        position: static;
        transform: none;
        width: 1.5em;
        height: 1.5em;
        flex-shrink: 0;
        margin-left: auto;
        font-size: 1.5em;
    }
    
    .tagline {
        font-size: 0.85em;
        margin-top: 8px;
        text-align: left;
        display: block;
        width: 100%;
        line-height: 1.5;
    }
    
    /* Loading screen - Mobile optimized */
    .loading-text {
        font-size: 1.5em;
    }
    
    /* Layout - Full width, stacked */
    .layout-container {
        flex-direction: column;
        gap: 12px;
        padding: 0 10px;
    }
}

@media (max-width: 768px) {
    /* Header - Left align on mobile */
    header {
        text-align: left;
    }
    
    header h1 {
        text-align: left;
    }
    
    .tagline {
        text-align: left;
    }
    
    .quiz-columns {
        display: none;
    }
    
    .questions-two-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .answers-two-columns {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    /* Mobile: Show dropdown, hide grid and pagination */
    .editions-dropdown {
        display: block;
    }
    
    .editions-header {
        display: none;
    }
    
    .editions-grid {
        display: none;
    }
    
    .editions-pagination {
        display: none;
    }
    
    /* Mobile quiz header - show mobile, hide desktop */
    .quiz-header.desktop-header {
        display: none !important;
    }
    
    .quiz-header.mobile-header {
        display: block !important;
        text-align: left;
        padding: 15px 0;
        margin-bottom: 15px;
        border-bottom: 2px solid var(--accent-color);
    }
    
    .quiz-header.mobile-header .quiz-header-nav {
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 10px;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .quiz-header.mobile-header h2 {
        font-size: 1.3em;
        margin: 0;
        flex: 1;
        text-align: center;
    }
    
    .quiz-header.mobile-header .edition {
        font-size: 1.2em;
        color: var(--meta-color);
        display: block;
        font-weight: 500;
        text-align: center;
        margin-top: 8px;
    }
    
    .quiz-images {
        flex-direction: column;
        gap: 15px;
        margin-bottom: 20px;
    }
    
    .quiz-images img:not(:only-child) {
        max-width: 100%;
        flex: 1 1 100%;
    }
    
    .quiz-image-positioned {
        max-width: 100%;
        max-height: 250px;
    }
    
    .quiz-image-container {
        margin: 0 !important;
    }
    
    .quiz-columns-header.desktop-header {
        display: none !important;
    }
    
    .questions-header-mobile,
    .answers-header-mobile {
        display: block !important;
        font-size: 1.2em;
        text-transform: uppercase;
        letter-spacing: 1px;
        margin: 15px 0 0 0;
        padding-bottom: 8px;
        border-bottom: 1px solid var(--border-color);
    }
    
    .quiz-content {
        margin-top: 5px;
    }
    
    .questions-section {
        margin-bottom: 20px;
    }
    
    .quiz-header.mobile-header {
        margin-bottom: 10px;
        padding-bottom: 10px;
    }
    
    .quiz-header.mobile-header .quiz-header-nav {
        margin-bottom: 8px;
    }
    
    .quiz-header.mobile-header h2 {
        font-size: 1.4em;
        margin: 0;
        flex: 1;
    }
    
    .quiz-header.mobile-header .edition {
        font-size: 1.1em;
        margin-top: 6px;
    }
    
    .answers-header.desktop-header {
        display: none !important;
    }
    
    .quiz-intro-image-container,
    .quiz-mid-image-container {
        margin-bottom: 12px;
        margin-top: 8px;
    }
    
    .quiz-mid-images-container {
        flex-direction: column;
        gap: 10px;
        margin-bottom: 12px;
        margin-top: 8px;
    }
    
    .quiz-mid-images-container .quiz-image-positioned {
        max-width: 100%;
        max-height: 250px;
    }
    
    .nav-btn.desktop-nav {
        display: none !important;
    }
    
    .nav-btn.mobile-nav {
        display: inline-flex !important;
    }
    
    .quiz-actions {
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 20px;
        padding: 15px 0 5px 0;
        justify-content: space-between;
    }
    
    .quiz-actions .nav-btn,
    .quiz-actions .toggle-answers-btn {
        flex: 1;
        min-width: 0;
        min-width: calc(33.333% - 6px);
    }
    
    .quiz-actions-info {
        width: 100%;
        justify-content: center;
        font-size: 0.9em;
        padding: 12px 14px;
        height: auto;
        min-height: 48px;
        white-space: nowrap;
        text-align: center;
        flex-wrap: nowrap;
        margin-top: 8px;
    }
    
    .quiz-actions-date,
    .quiz-actions-edition {
        display: inline;
        width: auto;
    }
    
    .toggle-answers-btn {
        flex: 1;
    }
    
    .answers-list {
        margin-top: 0;
        padding-top: 0;
    }
    
    /* Simplify main content */
    main {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .editions-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    /* Footer - Left align on mobile */
    footer {
        text-align: left;
    }
    
    .footer-content {
        text-align: left;
        width: 100%;
    }
    
    .footer-left,
    .footer-right {
        text-align: left;
        align-items: flex-start;
        width: 100%;
        display: block;
    }
    
    .footer-right {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-title,
    .footer-tagline {
        text-align: left;
        display: block;
        width: 100%;
    }
    
    .footer-date {
        text-align: left;
        display: block;
        width: 100%;
        margin-top: 4px;
    }
    
    .footer-links {
        align-items: flex-start;
        width: 100%;
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
    
    .footer-links a {
        justify-content: flex-start;
        width: 100%;
    }
    
    .footer-copyright {
        text-align: left;
        display: block;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .editions-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .editions-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .sort-order-btn {
        width: 100%;
    }
    
    .main-content {
        width: 100%;
    }
    
    .editions-section {
        padding: 15px;
        margin-bottom: 15px;
    }
    
    .edition-item {
        padding: 12px 10px;
        min-height: 80px;
    }
    
    main {
        padding: 15px;
        margin-bottom: 15px;
        min-height: auto;
    }
    
    .quiz-newspaper {
        min-height: auto;
    }
    
    .quiz-content {
        min-height: auto;
    }
    
    .quiz-columns {
        min-height: auto;
        height: auto;
    }
    
    .questions-column {
        min-height: auto;
        height: auto;
    }
    
    .answers-list {
        min-height: auto;
        height: auto;
    }
    
    .answers-list.hidden {
        min-height: auto;
        height: auto;
    }
    
    .questions-list li,
    .answers-list li {
        font-size: 1em;
        line-height: 1.7;
        margin-bottom: 16px;
        padding-left: 0;
        min-height: auto;
        display: flex;
        align-items: baseline;
    }
    
    .question-number,
    .answer-number {
        position: static;
        font-size: 1.15em;
        width: auto;
        text-align: right;
        white-space: nowrap;
        display: inline-block;
        margin-right: 8px;
        flex-shrink: 0;
        line-height: 1.7;
        vertical-align: baseline;
    }
    
    .question-text,
    .answer-text {
        flex: 1;
        display: inline-block;
        line-height: 1.7;
        vertical-align: baseline;
    }
    
    /* Buttons - Large touch targets (minimum 48px) */
    .nav-btn,
    .toggle-answers-btn {
        min-height: 48px;
        padding: 14px 16px;
        font-size: 1.05em;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        border-radius: 2px;
    }
    
    .pagination-btn {
        width: 48px;
        min-width: 48px;
        height: 48px;
        padding: 0;
    }
    
    .quiz-actions {
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 8px;
        margin-top: 20px;
        padding: 15px 0 5px 0;
        justify-content: space-between;
    }
    
    .quiz-actions .nav-btn,
    .quiz-actions .toggle-answers-btn {
        flex: 1;
        min-width: 0;
        min-width: calc(33.333% - 6px);
    }
    
    /* Pagination - Larger on mobile */
    .editions-pagination {
        padding: 15px 10px;
        gap: 15px;
        position: sticky;
        bottom: 0;
        background-color: var(--card-bg);
        border-top: 1px solid var(--border-color);
    }
    
    .page-info {
        font-size: 1em;
        min-width: 70px;
    }
    
    /* Footer - Stacked */
    footer {
        margin-top: 30px;
        padding: 25px 15px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
        margin-bottom: 0;
    }
    
    .footer-content {
        flex-direction: column;
        gap: 20px;
        text-align: left;
        width: 100%;
    }
    
    .footer-left {
        width: 100%;
        display: block;
    }
    
    .footer-right {
        width: 100%;
        display: flex;
        flex-direction: column;
        text-align: left;
        align-items: flex-start;
        gap: 12px;
    }
    
    .footer-title {
        font-size: 1.2em;
        text-align: left;
        margin-bottom: 8px;
        display: block;
        width: 100%;
    }
    
    .footer-date {
        font-size: 0.9em;
        text-align: left;
        display: block;
        width: 100%;
        margin-top: 4px;
        line-height: 1.5;
    }
    
    .footer-tagline {
        font-size: 0.85em;
        text-align: left;
        display: block;
        width: 100%;
        margin-top: 4px;
        line-height: 1.5;
    }
    
    .footer-links {
        flex-direction: column;
        gap: 12px;
        align-items: flex-start;
        width: 100%;
        margin-bottom: 8px;
    }
    
    .footer-link-separator {
        display: none;
    }
    
    .footer-links a {
        padding: 10px 0;
        font-size: 1em;
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
    }
    
    .footer-copyright {
        text-align: left;
        display: block;
        width: 100%;
        line-height: 1.5;
    }
    
    /* Quiz header adjustments */
    .quiz-header {
        margin-bottom: 15px;
        padding-bottom: 10px;
    }
}

/* Medium mobile (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
    body {
        padding: 12px;
    }
    
    header {
        padding: 15px 12px;
    }
    
    header h1 {
        font-size: 2em;
    }
    
    .layout-container {
        flex-direction: column;
        gap: 18px;
        padding: 0 12px;
    }
    
    .editions-section {
        padding: 20px;
    }
    
    .editions-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    main {
        padding: 18px;
    }
    
    .quiz-columns {
        grid-template-columns: 1fr;
        gap: 25px;
    }
    
    .quiz-actions {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-btn,
    .toggle-answers-btn {
        min-width: 100px;
        min-height: 48px;
        border-radius: 2px;
    }
    
    .editions-dropdown {
        display: block !important;
    }
}

/* Large tablets (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
    .editions-grid {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .nav-btn,
    .toggle-answers-btn {
        min-width: 100px;
        border-radius: 2px;
    }
}

