/* MASTER THEME VARIABLES */
:root {
    --bg-body: #f4f7f6; --bg-card: #ffffff; --bg-header: #1a1a2e;
    --text-main: #333333; --text-muted: #555555; 
    --accent: #1691B3; 
    --login-blue: #00a8ff; --shadow: rgba(0,0,0,0.08); --input-border: #cccccc;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-body: #0f0f12; --bg-card: #1a1a1d; --bg-header: #000000;
        --text-main: #f0f0f0; --text-muted: #a0a0a0; 
        --accent: #1691B3; 
        --shadow: rgba(0,0,0,0.4); --input-border: #333333;
    }
}

/* BASE STYLES */
body {
    font-family: 'Segoe UI', system-ui, sans-serif; margin: 0; padding: 0;
    background-color: var(--bg-body); color: var(--text-main);
    transition: background-color 0.3s ease; line-height: 1.6;
    position: relative;
    /* FIX: Enable Flexbox to pin footer */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* THE BACKGROUND IMAGE LAYER */
body::before {
    content: "";
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    background-image: url('background.png'); 
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.15;
    z-index: -1;
    pointer-events: none;
}

/* LAYOUT CONTAINERS */
.container { 
    max-width: 1200px; 
    margin: 40px auto; 
    padding: 0 20px; 
    position: relative; 
    z-index: 1; 
    /* FIX: Tells container to expand and fill empty vertical space */
    flex: 1; 
}

.section-header { margin-bottom: 30px; display: flex; align-items: center; gap: 15px; }
.section-header h2 { margin: 0; font-size: 1.5rem; white-space: nowrap; }
.header-line { height: 2px; background: var(--accent); flex-grow: 1; opacity: 0.5; }

/* HEADER - SQUARED UP */
header { 
    background-color: var(--bg-header); 
    color: #ffffff; 
    padding: 0.8rem 0; 
    position: sticky; 
    top: 0; 
    z-index: 2000; 
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    border-bottom: 4px solid var(--accent); 
    flex-shrink: 0;
}

.header-container { max-width: 1200px; margin: 0 auto; padding: 0 20px; display: flex; justify-content: space-between; align-items: center; }

.logo-link {
    display: flex;
    align-items: center;
    gap: 15px;
    text-decoration: none;
    color: inherit;
}

.site-logo {
    height: 55px; 
    width: auto;
    display: block;
}

.logo-text h1 { margin: 0; font-size: 1.8rem; line-height: 1.1; }
.logo-text p { margin: 0; font-size: 0.85rem; opacity: 0.7; }

.login-btn { background-color: var(--login-blue); color: white; padding: 10px 24px; border-radius: 50px; font-weight: 600; font-size: 0.9rem; text-decoration: none; }

/* FOOTER - MATCHED TO HEADER SIZE */
footer { 
    background-color: var(--bg-header); 
    color: #ffffff; 
    padding: 0.8rem 0; 
    text-align: center; 
    border-top: 4px solid var(--accent); 
    /* FIX: Removed high margin-top to keep it flush with bottom */
    margin-top: 40px; 
    flex-shrink: 0;
}

.footer-links { margin-bottom: 5px; }
.footer-links a { color: #888; text-decoration: none; margin: 0 15px; font-size: 0.9rem; }
.footer-links a:hover { color: var(--accent); }
footer p { margin: 5px 0 0 0; font-size: 0.8rem; opacity: 0.7; }

/* CONTENT TYPES (GRID/BOX) */
.news-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 35px; }
.content-box { background: var(--bg-card); border-radius: 16px; padding: 40px; box-shadow: 0 10px 30px var(--shadow); }

/* NEWS CARD STYLES */
.card { 
    background: var(--bg-card); 
    border-radius: 16px; 
    overflow: hidden; 
    display: flex; 
    flex-direction: column; 
    box-shadow: 0 10px 30px var(--shadow); 
    transition: transform 0.2s ease; 
}
.card:hover { transform: translateY(-5px); }

.card-img { 
    width: 100%; height: 200px; object-fit: cover; 
    display: block; border-bottom: 2px solid var(--accent); 
}
.card-content { padding: 20px; display: flex; flex-direction: column; gap: 10px; flex-grow: 1; }
.date-tag { font-size: 0.75rem; color: var(--text-muted); text-transform: uppercase; font-weight: 600; }
.read-more { color: var(--accent); text-decoration: none; font-weight: bold; font-size: 0.9rem; margin-top: auto; }

/* LOAD MORE LINK STYLING */
.load-more-wrapper { text-align: center; margin-top: 50px; margin-bottom: 20px; }
#load-more-link { color: var(--accent); text-decoration: none; font-weight: 600; font-size: 1.1rem; cursor: pointer; transition: opacity 0.2s; }
#load-more-link:hover { opacity: 0.7; text-decoration: underline; }