/* Modern UI Core - Final Unified Design */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --secondary: #64748b;
    --bg-main: #f8fafc;
    --card-bg: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --ai-purple: #8b5cf6;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --green-bright: #10b981;
    --red-bright: #ef4444;
    --orange-bright: #f97316;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', -apple-system, system-ui, sans-serif;
    background-color: var(--bg-main);
    color: var(--text-main);
    line-height: 1.6;
    padding-bottom: 40px;
    scrollbar-gutter: stable;
}

.container { max-width: 1100px; margin: 0 auto; padding: 0 15px; width: 100%; }

/* Header & Nav */
.header-main { background: #ffffff; padding: 20px 0; border-bottom: 1px solid #e2e8f0; margin-bottom: 25px; }
.site-title { font-size: 26px; font-weight: 800; text-align: center; color: var(--primary); letter-spacing: -0.5px; margin-bottom: 5px; }
.site-subtitle { text-align: center; color: var(--secondary); font-size: 13px; font-weight: 500; text-transform: uppercase; letter-spacing: 1px; }

.header-nav { margin-top: 15px; }
.nav-list { display: flex; justify-content: center; list-style: none; gap: 10px; flex-wrap: wrap; padding: 0; }
.nav-link { 
    text-decoration: none; color: var(--text-main); font-weight: 600; font-size: 14px; 
    padding: 8px 16px; border-radius: 20px; transition: all 0.2s; 
    background: #f1f5f9; border: 1px solid transparent;
}
.nav-link:hover { background: #e2e8f0; color: var(--primary); }
.nav-link.active { background: var(--primary); color: #fff; }

/* News Grid - Journalist Frames & Fixed Buttons */
.news-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 25px; }
.news-card { 
    background: #fff; 
    border-radius: var(--radius); 
    overflow: hidden; 
    box-shadow: var(--shadow); 
    border: 1px solid #f1f5f9; 
    display: flex; 
    flex-direction: column; 
    height: 100%;
}

.news-img-wrap { 
    position: relative; 
    width: 100%; 
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    background: #000;
    overflow: hidden;
}

.news-img { 
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    object-fit: cover;
    object-position: center 20%; /* Prioritize faces/top of image */
}

.news-content { padding: 20px; flex-grow: 1; display: flex; flex-direction: column; }
.news-meta { font-size: 12px; color: var(--text-muted); margin-bottom: 10px; font-weight: 600; }
.news-title { font-size: 17px; font-weight: 700; line-height: 1.4; margin-bottom: 20px; color: var(--text-main); }

.btn-read { 
    margin-top: auto; /* Force button to the bottom */
    background: var(--primary); 
    color: #fff; 
    text-align: center; 
    padding: 12px; 
    border-radius: 10px; 
    text-decoration: none; 
    display: block; 
    font-weight: 700; 
    font-size: 14px; 
    transition: background 0.2s;
}
.btn-read:hover { background: var(--primary-dark); }

/* Article Page Fixes */
.article-container { 
    background: #ffffff; 
    padding: 40px; 
    border-radius: var(--radius); 
    box-shadow: var(--shadow); 
    border: 1px solid #e2e8f0;
    margin-bottom: 30px;
    position: relative;
}

.btn-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 25px;
    color: var(--primary);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
}

.article-header-img { 
    width: 100%; 
    height: auto; 
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--radius); 
    margin-bottom: 30px; 
    display: block;
}

.article-title { font-size: 32px; font-weight: 800; color: var(--text-main); margin-bottom: 25px; line-height: 1.2; }
.article-body { font-size: 18px; color: #334155; line-height: 1.8; }
.article-body img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 25px 0; display: block; }
.article-body p { margin-bottom: 20px; }

/* Energy Schedule Styles */
.hours-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 15px 0; }
@media (max-width: 600px) { .hours-grid { grid-template-columns: repeat(6, 1fr); } }

.hour-slot { 
    height: 40px; border: 1px solid rgba(0,0,0,0.05); 
    display: flex; align-items: center; justify-content: center; 
    font-size: 11px; font-weight: 700; border-radius: 4px; color: #fff; 
}
.hour-slot.available { background-color: var(--green-bright); }
.hour-slot.unavailable { background-color: var(--red-bright); }
.hour-slot.past { opacity: 0.4; filter: grayscale(1); }
.hour-slot.current { 
    border: 3px solid var(--orange-bright) !important; 
    color: #fff; 
    transform: scale(1.05);
    z-index: 10;
}

.location-card { background: #fff; border-radius: var(--radius); padding: 20px; margin-bottom: 20px; border: 1px solid #e2e8f0; }
.location-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }

.footer-main { margin-top: 50px; padding: 40px 0; text-align: center; border-top: 1px solid #e2e8f0; background: #fff; }

@media (max-width: 640px) {
    .site-title { font-size: 22px; }
    .article-container { padding: 25px 15px; }
    .article-title { font-size: 26px; }
    .news-grid { grid-template-columns: 1fr; }
}
