/* Vintage Zimbabwe Newspaper Styling - Plain and Simple */

:root {
    --vh: 100vh; /* Fallback viewport height */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    background-color: #3a3a3a;
    color: #1a1a1a;
    line-height: 1.6;
    padding: 0;
    margin: 0;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    overflow: hidden;
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
}

/* Newspaper Container */
.newspaper-container {
    width: 100vw;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    margin: 0;
    padding: 0;
    background-color: #e8dcc8;
    box-shadow: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Masthead - Traditional Newspaper Header */
.masthead {
    background-color: #d4c5a9;
    border-bottom: 4px solid #1a1a1a;
    border-top: 2px solid #1a1a1a;
    padding: 15px 30px;
    text-align: center;
    flex-shrink: 0;
    margin: 0;
    box-sizing: border-box;
}

.masthead-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    color: #2a2a2a;
    border-bottom: 1px solid #8a7a5a;
    padding-bottom: 5px;
}

/* Edition Selector */
.edition-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.edition-label {
    font-weight: bold;
    color: #2a2a2a;
}

#editionSelect {
    padding: 4px 8px;
    border: 2px solid #6a5a4a;
    background-color: #f5f0e8;
    color: #1a1a1a;
    font-family: 'Georgia', serif;
    font-size: 11px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

#editionSelect:hover {
    background-color: #ebe5d5;
    border-color: #4a3a2a;
}

#editionSelect:focus {
    outline: none;
    border-color: #2a2a2a;
}

.flag-icon {
    font-size: 20px;
    line-height: 1;
    user-select: none;
}

/* Title with Logo Container */
.title-with-logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 15px 0 10px 0;
}

.masthead-logo {
    width: 60px;
    height: auto;
    filter: sepia(20%) brightness(0.9);
}

.newspaper-title {
    font-family: 'Georgia', serif;
    font-size: 52px;
    font-weight: bold;
    letter-spacing: 3px;
    text-transform: uppercase;
    margin: 0;
    color: #0a0a0a;
    text-shadow: 1px 1px 0px #9a8a6a;
}

.motto {
    font-size: 14px;
    font-style: italic;
    letter-spacing: 2px;
    color: #2a2a2a;
    margin-bottom: 10px;
}

.edition-line {
    font-size: 11px;
    letter-spacing: 1px;
    color: #3a3a3a;
    border-top: 1px solid #8a7a5a;
    padding-top: 8px;
    margin-top: 8px;
}

.divider {
    margin: 0 10px;
}

/* Flipbook Container */
#flipbook {
    width: 100%;
    flex: 1;
    margin: 0 auto;
    background-color: #f5f0e8;
    overflow: hidden;
    touch-action: pan-y pinch-zoom; /* Allow vertical scrolling and pinch zoom on mobile */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

/* Turn.js generated wrapper */
#flipbook .turn-wrapper {
    width: 100% !important;
    height: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Turn.js pages */
#flipbook .turn-page,
#flipbook .p-temporal {
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

/* Ensure no overflow or gaps */
#flipbook > div {
    margin: 0 !important;
    padding: 0 !important;
}

/* Fix for turn.js shadow/wrapper elements */
.turn-wrapper,
.turn-shadow {
    margin: 0 !important;
    padding: 0 !important;
}

/* Page Styling */
.page {
    background-color: #f5f0e8;
    background-image: 
        linear-gradient(rgba(218, 208, 188, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(218, 208, 188, 0.03) 1px, transparent 1px);
    background-size: 20px 20px;
    box-shadow: inset 0 0 50px rgba(139, 119, 89, 0.1);
}

.page-cover {
    background-color: #e0d5c0;
}

.page-content {
    padding: 30px 40px;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
    scroll-behavior: smooth;
}

/* Custom scrollbar for page content */
.page-content::-webkit-scrollbar {
    width: 8px;
}

.page-content::-webkit-scrollbar-track {
    background: #e0d5c0;
}

.page-content::-webkit-scrollbar-thumb {
    background: #8a7a5a;
    border-radius: 4px;
}

.page-content::-webkit-scrollbar-thumb:hover {
    background: #6a5a4a;
}

/* Page Headers */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #1a1a1a;
    padding-bottom: 8px;
    margin-bottom: 20px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
}

.page-number {
    color: #1a1a1a;
}

.section-name {
    color: #1a1a1a;
    font-size: 11px;
}

.date {
    color: #4a4a4a;
}

/* Headlines and Typography */
.headline-main h2 {
    font-family: 'Georgia', serif;
    font-size: 36px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    line-height: 1.2;
    margin-bottom: 15px;
    color: #0a0a0a;
    border-bottom: 3px solid #1a1a1a;
    padding-bottom: 10px;
}

.subheadline {
    font-size: 16px;
    font-style: italic;
    line-height: 1.4;
    margin-bottom: 20px;
    color: #2a2a2a;
    padding-left: 10px;
    border-left: 3px solid #6a5a4a;
}

.section-headline {
    font-family: 'Georgia', serif;
    font-size: 24px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
    color: #0a0a0a;
    line-height: 1.2;
}

/* Clickable Article Links */
.article-link {
    color: #0a0a0a;
    text-decoration: none;
    position: relative;
    transition: color 0.3s ease;
    cursor: pointer;
}

.article-link:hover {
    color: #4a3a2a;
}

.article-link::after {
    content: ' \00BB';
    font-size: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.article-link:hover::after {
    opacity: 1;
}

h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 15px 0 10px 0;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

h4 {
    font-size: 15px;
    font-weight: bold;
    margin: 12px 0 8px 0;
    color: #2a2a2a;
    text-transform: uppercase;
}

/* Column Layout */
.columns-container {
    display: flex;
    gap: 25px;
    margin-top: 15px;
}

.column {
    flex: 1;
    text-align: justify;
    hyphens: auto;
}

.column p {
    margin-bottom: 12px;
    font-size: 14px;
    color: #1a1a1a;
}

/* Front Page Logo */
.column-with-logo {
    position: relative;
}

.front-page-logo {
    text-align: center;
    margin-bottom: 20px;
    padding: 15px;
    border: 2px solid #6a5a4a;
    background-color: #ebe5d5;
}

.front-page-logo img {
    max-width: 180px;
    height: auto;
    display: block;
    margin: 0 auto;
    filter: sepia(15%) brightness(0.95);
}

/* Drop Cap - Traditional Newspaper Style */
.dropcap::first-letter {
    float: left;
    font-size: 58px;
    line-height: 50px;
    padding: 5px 8px 0 0;
    font-weight: bold;
    color: #0a0a0a;
    font-family: 'Georgia', serif;
}

/* Byline */
.byline {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 12px;
    color: #4a4a4a;
    font-style: italic;
}

/* Article Sections */
.article-section {
    margin-bottom: 25px;
}

.article-divider {
    height: 2px;
    background-color: #1a1a1a;
    margin: 20px 0;
}

/* Lists */
.newspaper-list {
    margin: 10px 0 10px 25px;
    font-size: 14px;
    color: #1a1a1a;
}

.newspaper-list li {
    margin-bottom: 6px;
    line-height: 1.5;
}

/* Front Page Specific */
.front-page {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.page-footer {
    margin-top: auto;
    text-align: center;
    font-style: italic;
    font-size: 12px;
    padding-top: 15px;
    border-top: 1px solid #6a5a4a;
    color: #3a3a3a;
}

/* Back Page / Contact Page */
.back-page {
    text-align: center;
}

.contact-section {
    margin-top: 30px;
}

.contact-section h3 {
    font-size: 22px;
    margin-bottom: 10px;
    color: #0a0a0a;
}

.contact-section p {
    font-size: 14px;
    margin-bottom: 20px;
    color: #2a2a2a;
}

.contact-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin: 30px 0;
    text-align: left;
}

.contact-item {
    padding: 15px;
    border: 2px solid #6a5a4a;
    background-color: #ebe5d5;
}

.contact-item h4 {
    margin-bottom: 8px;
    color: #1a1a1a;
    border-bottom: 1px solid #8a7a5a;
    padding-bottom: 5px;
}

.contact-item p {
    font-size: 13px;
    color: #2a2a2a;
}

/* Sectors Summary */
.sectors-summary {
    margin: 30px 0;
    padding: 20px;
    border: 3px double #1a1a1a;
    background-color: #ebe5d5;
}

.sectors-summary h3 {
    margin-bottom: 15px;
    font-size: 20px;
}

.sectors-list {
    font-size: 13px;
    line-height: 2;
    color: #1a1a1a;
}

.sectors-list span {
    display: inline-block;
    margin: 0 5px;
}

/* Footer Motto */
.footer-motto {
    margin: 30px 0;
    padding: 20px 0;
    border-top: 2px solid #1a1a1a;
    border-bottom: 2px solid #1a1a1a;
}

.large-text {
    font-size: 28px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 10px 0;
    color: #0a0a0a;
    font-family: 'Georgia', serif;
}

/* Heritage Note */
.heritage-note {
    margin-top: 30px;
    padding: 20px;
    background-color: #ebe5d5;
    border: 1px solid #8a7a5a;
    text-align: left;
}

.heritage-note h4 {
    margin-bottom: 10px;
    text-align: center;
}

.heritage-note p {
    font-size: 13px;
    line-height: 1.7;
    color: #2a2a2a;
    text-align: justify;
}

/* Navigation Controls */
.controls {
    text-align: center;
    padding: 20px 25px;
    background-color: #d4c5a9;
    border-top: 3px solid #1a1a1a;
    flex-shrink: 0;
    margin: 0;
    box-sizing: border-box;
}

.nav-button {
    background-color: #4a4a4a;
    color: #f5f0e8;
    border: 2px solid #1a1a1a;
    padding: 12px 30px;
    font-size: 14px;
    font-family: 'Georgia', serif;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    margin: 0 15px;
    transition: all 0.3s ease;
}

.nav-button:hover {
    background-color: #2a2a2a;
    color: #ffffff;
}

.nav-button:active {
    transform: translateY(2px);
}

.nav-button:disabled {
    background-color: #8a8a8a;
    cursor: not-allowed;
    opacity: 0.5;
}

#page-indicator {
    display: inline-block;
    font-size: 14px;
    font-weight: bold;
    color: #1a1a1a;
    margin: 0 20px;
    letter-spacing: 1px;
}

/* Vintage Paper Texture Effect */
.page::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 20% 30%, rgba(139, 119, 89, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(139, 119, 89, 0.03) 0%, transparent 50%),
        radial-gradient(circle at 40% 80%, rgba(139, 119, 89, 0.02) 0%, transparent 50%);
    pointer-events: none;
}

/* Responsive Design */
@media screen and (max-width: 1024px) {
    .newspaper-title {
        font-size: 38px;
    }
    
    .masthead-logo {
        width: 50px;
    }
    
    .edition-label {
        font-size: 10px;
    }
    
    #editionSelect {
        font-size: 10px;
        padding: 3px 6px;
    }
    
    .flag-icon {
        font-size: 18px;
    }
    
    .page-content {
        padding: 20px 25px;
    }
    
    .columns-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .front-page-logo img {
        max-width: 150px;
    }
}

@media screen and (max-width: 768px) {
    body {
        overflow: hidden;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100); /* Use calculated height */
        position: fixed;
        width: 100%;
    }
    
    .newspaper-container {
        padding: 0;
        height: 100vh;
        height: calc(var(--vh, 1vh) * 100); /* Use calculated height */
        position: relative;
    }
    
    /* Ensure masthead is always visible at top */
    .masthead {
        padding: 8px 10px;
        position: relative;
        z-index: 100;
        flex-shrink: 0;
    }
    
    /* Ensure controls are always visible at bottom */
    .controls {
        padding: 8px;
        gap: 8px;
        position: relative;
        z-index: 100;
        flex-shrink: 0;
    }
    
    .masthead-top {
        flex-direction: column;
        gap: 5px;
        align-items: center;
    }
    
    .date {
        font-size: 10px;
    }
    
    .edition-selector {
        gap: 6px;
    }
    
    .edition-label {
        font-size: 9px;
    }
    
    #editionSelect {
        font-size: 9px;
        padding: 3px 6px;
        min-height: 24px;
        touch-action: manipulation;
    }
    
    .flag-icon {
        font-size: 16px;
    }
    
    .title-with-logo {
        flex-direction: column;
        gap: 8px;
    }
    
    .masthead-logo {
        width: 40px;
    }
    
    .newspaper-title {
        font-size: 22px;
        letter-spacing: 1px;
        text-align: center;
    }
    
    .motto {
        font-size: 9px;
        padding: 4px 0;
    }
    
    .edition-line {
        font-size: 8px;
        padding: 4px 0;
    }
    
    /* Flipbook adjustments for mobile */
    #flipbook {
        margin: 10px auto;
    }
    
    .page {
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
    }
    
    .page-content {
        padding: 12px 15px;
        font-size: 13px;
        line-height: 1.5;
    }
    
    .page-header {
        margin-bottom: 12px;
        padding-bottom: 6px;
        font-size: 9px;
    }
    
    .headline-main h2 {
        font-size: 20px;
        line-height: 1.2;
        margin-bottom: 8px;
    }
    
    .subheadline {
        font-size: 13px;
        line-height: 1.3;
    }
    
    .section-headline {
        font-size: 16px;
        margin-bottom: 8px;
    }
    
    .byline {
        font-size: 10px;
        margin-bottom: 8px;
    }
    
    .article-section {
        margin-bottom: 15px;
    }
    
    .dropcap {
        font-size: 36px;
        line-height: 30px;
        padding: 2px 6px 0 0;
    }
    
    .columns-container {
        flex-direction: column;
        gap: 12px;
    }
    
    .column {
        width: 100%;
    }
    
    .column h3 {
        font-size: 14px;
        margin: 10px 0 6px 0;
    }
    
    .column p {
        font-size: 13px;
        margin-bottom: 8px;
    }
    
    .newspaper-list {
        font-size: 12px;
        margin-left: 15px;
    }
    
    .newspaper-list li {
        margin-bottom: 4px;
    }
    
    .front-page-logo {
        padding: 8px;
        margin: 10px auto;
    }
    
    .front-page-logo img {
        max-width: 100px;
    }
    
    .article-divider {
        margin: 12px 0;
    }
    
    .page-footer {
        font-size: 10px;
        padding: 8px 0 6px 0;
    }
    
    /* Controls for mobile */
    .controls {
        padding: 8px;
        gap: 8px;
    }
    
    .nav-button {
        padding: 12px 24px;
        font-size: 13px;
        margin: 0 4px;
        touch-action: manipulation;
        min-height: 44px;
        min-width: 80px;
    }
    
    .page-indicator {
        font-size: 11px;
    }
    
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .contact-item h3 {
        font-size: 14px;
    }
    
    .contact-item p {
        font-size: 12px;
    }
    
    .article-link {
        font-size: 16px;
    }
}

/* Extra small mobile devices (480px and below) */
@media screen and (max-width: 480px) {
    .masthead {
        padding: 6px 8px;
    }
    
    .newspaper-title {
        font-size: 18px;
    }
    
    .motto {
        font-size: 8px;
    }
    
    .edition-line {
        font-size: 7px;
    }
    
    .page-content {
        padding: 10px 12px;
        font-size: 12px;
    }
    
    .headline-main h2 {
        font-size: 18px;
    }
    
    .section-headline {
        font-size: 14px;
    }
    
    .column p,
    .subheadline {
        font-size: 12px;
    }
    
    .newspaper-list {
        font-size: 11px;
    }
    
    .nav-button {
        padding: 10px 18px;
        font-size: 12px;
        min-width: 70px;
    }
    
    .page-indicator {
        font-size: 10px;
    }
    
    .front-page-logo img {
        max-width: 80px;
    }
}

/* Landscape orientation optimization */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .masthead {
        padding: 4px 10px;
    }
    
    .newspaper-title {
        font-size: 20px;
    }
    
    .motto {
        display: none;
    }
    
    .edition-line {
        font-size: 7px;
    }
    
    .page-content {
        padding: 8px 12px;
        font-size: 11px;
    }
    
    .controls {
        padding: 4px;
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
    }
    
    .controls {
        display: none;
    }
    
    .page {
        page-break-after: always;
        box-shadow: none;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}
