/* Try to load TheSans fonts, but provide robust fallbacks */
@font-face {
    font-family: 'TheSans';
    src: local('TheSans-SemiBold'),
         url('/TheSansC5s-6_SemiBold.woff2') format('woff2');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TheSans';
    src: local('TheSans-SemiLight'),
         url('/TheSansC5s-4_SemiLight.woff2') format('woff2');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

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

body {
    width: 100vw;
    height: 100vh;
    overflow: hidden;
    background: transparent;
    color: #fff;
    /* Use system fonts as fallback that closely match TheSans */
    font-family: 'TheSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-weight: 300;
}

html {
    background: transparent;
}

/* Loading Overlay */
#loading-overlay {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: #000; /* solid black */
    /* No layout/centering needed; keep it simple and opaque */
    z-index: 2147483647; /* ensure above everything */
    opacity: 1;
    transition: opacity 0.8s ease-out;
}

#loading-overlay.loaded {
    opacity: 0;
    pointer-events: none;
    visibility: hidden; /* fully hide after fade to avoid any bleed */
}

/* Ensure page content is hidden until app is ready */
body:not(.app-ready) header,
body:not(.app-ready) main {
    visibility: hidden !important;
}

/* Spinner removed for plain black screen */

/* Header */
header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 2rem 3rem;
    z-index: 100;
    background: linear-gradient(180deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0) 100%);
}

.logo img {
    height: 60px;
    width: auto;
}

.datetime {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    text-align: right;
    font-family: 'TheSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-weight: 600;
}

.time {
    font-size: 3rem;
    font-weight: 600;
    line-height: 1;
}

.date {
    font-size: 3rem;
    font-weight: 600;
    opacity: 0.9;
}

/* Main Content */
main {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 85%;
    max-width: 1600px;
    height: auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.news-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    width: 100%;
    background: rgba(0, 0, 0, 0.75);
    border-radius: 8px;
    padding: 2.5rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    align-items: center;
}

.news-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    align-self: center;
}

#news-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
}

.qr-container {
    position: absolute;
    bottom: 1rem;
    left: 1rem;
    background: white;
    padding: 0.5rem;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}

#qr-code {
    display: block;
    width: 120px;
    height: 120px;
}

.news-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 1.5rem;
}

.headline {
    font-family: 'TheSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.text { 
    font-family: 'TheSans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 1.4rem;
    line-height: 1.6;
    font-weight: 300;
    color: rgba(255, 255, 255, 0.95);
    margin: 0;
}

/* Loading state */
.loading {
    opacity: 0.5;
}

/* Fade transition */
.fade-out {
    animation: fadeOut 0.3s ease-out;
}

.fade-in {
    animation: fadeIn 0.3s ease-in;
}

@keyframes fadeOut {
    from { opacity: 1; }
    to { opacity: 0; }
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .headline {
        font-size: 2rem;
    }
    
    .text {
        font-size: 1.2rem;
    }
}
