/* --- Material Design 3 Styling --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Roboto', sans-serif;
    background-color: #141218; /* M3 background */
    color: #E6E0E9; /* M3 on-background */
    padding: 1rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    body { padding: 2rem; }
}

/* --- Layout --- */
.main-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex-grow: 1;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

.top-section {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    flex-grow: 1;
}

@media (min-width: 1024px) {
    .top-section { grid-template-columns: 1fr 2fr; }
}

/* --- Cards --- */
.weather-card,
.news-card {
    background-color: #211F26; /* M3 surface */
    padding: 1.5rem;
    border-radius: 28px; /* M3 typical large rounded corner */
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Soft tonal elevation shadow */
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1rem;
    border-bottom: 1px solid #4A4458; /* M3 outline variant */
    margin-bottom: 1rem;
}

.card-title {
    font-size: 1.5rem;
    font-weight: 500;
    color: #D0BCFF; /* M3 primary */
}

/* --- Clock --- */
.clock-box {
    font-size: 1.5rem;
    font-weight: 500;
    background-color: #4F378B; /* M3 primary container */
    color: #EADDFF; /* M3 on-primary container */
    padding: 0.25rem 1rem;
    border-radius: 16px; /* M3 chip typically 16px or full */
}

/* --- Weather Specifics --- */
.current-weather {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex-grow: 1;
    gap: 1rem;
    text-align: center;
}

.weather-icon-large {
    width: 150px;
    height: 150px;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.3));
}

.weather-temp-large {
    font-size: 6rem;
    font-weight: 700;
    line-height: 1;
    color: #FFB4AB; /* M3 error/warm tone */
}

.weather-temp-cold {
    color: #A8C7FA !important; /* M3 distinct cold tone */
}

.weather-summary {
    font-size: 1.5rem;
    color: #E6E0E9;
}

/* --- News Layout --- */
.news-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

@media (min-width: 768px) {
    .news-container { grid-template-columns: 1fr 1fr; }
}

.news-badge {
    color: #381E72;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.875rem;
}

.nrk-badge {
    background-color: #A8C7FA; color: #062E6F; /* M3 custom blue */
}

.vg-badge {
    background-color: #FFB4AB; color: #690005; /* M3 custom red */
}

/* --- Featured Story --- */
.news-featured {
    position: relative;
    width: 100%;
    margin-bottom: 1rem;
    border-radius: 16px;
    overflow: hidden;
    background-color: #2B2930; /* surface-container-high */
    min-height: 200px;
}

.featured-img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.featured-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: linear-gradient(to top, rgba(33, 31, 38, 0.95), rgba(33, 31, 38, 0));
    padding: 1rem;
    padding-top: 3rem;
}

.featured-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #E6E0E9;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.25rem;
}

.featured-summary {
    font-size: 0.9rem;
    color: #CAC4D0;
    display: none;
}

@media (min-width: 1024px) {
    .featured-summary {
        display: -webkit-box;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }
}

/* --- News List --- */
.news-list {
    list-style: none;
    overflow-y: auto;
    flex-grow: 1;
    max-height: 400px;
    scrollbar-width: thin;
    scrollbar-color: #4A4458 transparent;
}

.news-list li {
    padding: 0.75rem 0;
    border-bottom: 1px solid #4A4458;
    font-size: 1rem;
    line-height: 1.4;
    color: #E6E0E9;
}

.news-list li:last-child {
    border-bottom: none;
}

/* --- Bottom Hourly Forecast --- */
.bottom-section {
    background-color: #211F26; /* M3 surface */
    padding: 1.5rem;
    border-radius: 28px;
    border: none;
    box-shadow: 0 4px 8px rgba(0,0,0,0.15); /* Soft tonal elevation shadow */
}

.section-title {
    font-size: 1.25rem;
    color: #E6E0E9;
    margin-bottom: 1rem;
}

.hourly-scroll {
    display: flex;
    gap: 2rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
    scrollbar-color: #4A4458 transparent;
}

.forecast-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 80px;
    gap: 0.5rem;
}

.forecast-time {
    font-weight: 500;
    color: #E6E0E9;
}

.forecast-icon {
    width: 50px;
    height: 50px;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

.forecast-temp {
    font-weight: 700;
    font-size: 1.25rem;
    color: #FFB4AB;
}

/* --- Footer --- */
.footer {
    text-align: center;
    color: #938F99;
    font-size: 0.875rem;
    margin-top: auto;
    padding-top: 1rem;
}

.footer span {
    color: #FFB4AB;
}

/* --- Screensaver --- */
#screensaver-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #141218; /* M3 bg */
    z-index: 9999;
    display: none;
    overflow: hidden;
    cursor: none;
}

#screensaver-logo {
    position: absolute;
    width: 200px;
    height: auto;
}