/* --- 1. CONFIGURATION (CSS VARIABLES) --- */
:root {
    /* Color Palette */
    --primary: #2c3e50;       /* Deep Navy */
    --accent: #e67e22;        /* Hero Gold/Orange */
    --accent-hover: #d35400;  /* Darker Orange */
    --bg-body: #f8f9fa;       /* Light Gray (easier on eyes than pure white) */
    --bg-card: #ffffff;       /* Pure White */
    --text-main: #333333;     /* Dark Grey for reading */
    --text-muted: #666666;    /* Light Grey for meta info */
    
    /* Typography Scale */
    --fs-h1: 2.5rem;
    --fs-h2: 1.75rem;
    --fs-h3: 1.25rem;
    --fs-body: 1rem;          /* 16px Base */
    
    /* Spacing System (8px grid) */
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 32px;
    --space-xl: 64px;
    
    /* Layout */
    --container-width: 1100px;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0,0,0,0.05);
    --shadow-hover: 0 10px 15px rgba(0,0,0,0.1);
}

/* --- 2. GLOBAL RESET & TYPOGRAPHY --- */
* {
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-main);
    line-height: 1.6;
    font-size: var(--fs-body);
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Keeps footer at bottom */
}

a { color: var(--accent); text-decoration: none; transition: color 0.2s; }
a:hover { color: var(--accent-hover); }

h1, h2, h3 { line-height: 1.2; margin-bottom: var(--space-md); color: var(--primary); }
h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }

/* --- 3. LAYOUT & NAVIGATION --- */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-md);
    width: 100%;
}

/* Sticky Navigation */
/* Sticky Navigation & Banner Header */
/* --- HEADER & BANNER CONFIG --- */
header {
    background-color: var(--primary);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    
    /* 1. Desktop Height */
    height: 300px; 
    overflow: hidden; /* Ensures nothing spills out */
    padding: 0;
    line-height: 0;
}

.header-content {
    width: 100%;      /* Changed from auto */
    height: 100%;     /* Fill the container */
    margin: 0;
}

.header-content a {
    display: block;
    height: 100%;
    width: 100%;
}

.banner-img {    
    height: 100%;     
    width: 100%;      /* CRITICAL FIX: Forces image to fill screen width */
    
    object-fit: cover;       /* Keeps aspect ratio by cropping */
    object-position: top center; /* Keeps faces visible */
}

/* --- MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    /* CRITICAL FIX: Resize the CONTAINER, not just the image */
    header {
        height: 120px; 
    }
    
    /* Optional: Typography tweaks for mobile */
    :root { 
        --fs-h1: 2rem; 
    }
    
    /* Layout tweaks */
    .hero-card { margin-bottom: var(--space-md); }
    .hero-navigation { flex-direction: column; }
    .nav-btn { width: 100%; }
}

/* --- 4. HERO GRID SYSTEM (The Big Upgrade) --- */
.hero-grid {
    display: grid;
    /* Auto-fit creates columns based on screen width (Responsive!) */
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-lg);
}

/* Card Component */
.hero-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 0; /* Remove padding from container, put inside */
    display: flex;
    flex-direction: column; /* Stack Image on top of Text */
    transition: transform 0.2s, box-shadow 0.2s;
    overflow: hidden; /* Clips image corners */
    height: 100%; /* Equal height cards */
}

.hero-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.hero-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-bottom: 1px solid #eee;
}

.hero-info {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.hero-info h3 { margin-top: 0; margin-bottom: var(--space-sm); }
.hero-info p { 
    color: var(--text-muted); 
    font-size: 0.95rem;
    /* Truncate text after 3 lines */
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: var(--space-md);
}

/* Button inside card */
.read-more {
    margin-top: auto; /* Pushes button to bottom */
    display: inline-block;
    padding: 8px 16px;
    background-color: var(--accent);
    color: white;
    border-radius: 4px;
    font-weight: 600;
    text-align: center;
}
.read-more:hover { color: white; background: var(--accent-hover); text-decoration: none;}

/* --- 5. ADVERTISING CONTAINERS --- */
.ad-container {
    background: #e9ecef;
    border: 1px dashed #ced4da;
    text-align: center;
    padding: var(--space-sm);
    margin: var(--space-lg) 0;
    display: block;
    width: 100%;
    min-height: 60px;
    box-sizing: border-box; 
    overflow: hidden;
    border-radius: var(--border-radius);
}

.ad-label {
    font-size: 0.7rem;
    color: #888;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 5px;
}

/* --- 6. HERO DETAIL PAGE (Specifics) --- */
.hero-detail-layout {
    max-width: 800px; /* Narrower for reading focus */
}
.hero-main-img {
    width: 100%;
    height: auto;
    max-height: 500px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: var(--space-md);
}
.bio-text { font-size: 1.1rem; line-height: 1.8; }

.hero-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    border-top: 1px solid #ddd;
}

.nav-btn {
    padding: 12px 24px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    flex: 1;
}
.nav-btn.random { background: var(--accent); }
.nav-btn:hover { opacity: 0.9; }

/* --- 7. FOOTER --- */
footer {
    background: var(--primary);
    color: white;
    padding: var(--space-lg) 0;
    margin-top: auto; /* Pushes footer to bottom */
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
footer a { color: #bdc3c7; margin: 0 10px; }
footer a:hover { color: white; text-decoration: underline; }

/* --- 8. PAGINATION --- */
.pagination { text-align: center; margin: var(--space-lg) 0; }
.pagination button {
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    margin: 0 5px;
}
.pagination button:disabled { background: #ccc; cursor: not-allowed; }

/* --- 9. MOBILE RESPONSIVENESS --- */
@media (max-width: 768px) {
    :root { --fs-h1: 2rem; }
    .hero-card { margin-bottom: var(--space-md); }
    .hero-navigation { flex-direction: column; }
    .nav-btn { width: 100%; }
}