/*
Theme Style Definitions for eNewsWeb Global News
*/

/* --------------------------------------
   1. GLOBAL & TYPOGRAPHY
-------------------------------------- */

:root {
    --color-primary: #121212;      /* Near Black for Text/Headers */
    --color-secondary: #BB1919;    /* Deep Red (Accent/Highlights - BBC Style) */
    --color-background: #FFFFFF;
    --color-light-gray: #f3f3f3;   /* Background for secondary sections */
    --font-heading: 'Roboto Slab', serif; /* Serif for headlines (Authority) */
    --font-body: 'Noto Sans', sans-serif; /* Sans-serif for body (Readability) */
    --max-content-width: 1200px;
}

body {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    color: var(--color-primary);
    background-color: var(--color-background);
}

.container, .site-main {
    max-width: var(--max-content-width);
    margin: 0 auto;
    padding: 0 20px; /* Padding for small screens/edges */
}

h1, h2, h3, h4 {
    font-family: var(--font-heading);
    line-height: 1.2;
    margin-top: 1em;
    margin-bottom: 0.5em;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--color-secondary);
}

/* --------------------------------------
   2. HEADER & NAVIGATION (header.php)
-------------------------------------- */

.site-header {
    border-top: 5px solid var(--color-secondary);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Top Bar (Date, Sign In) */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid var(--color-light-gray);
}

.site-branding .site-title a {
    font-family: var(--font-heading);
    font-size: 24px;
    font-weight: bold;
}

/* Primary Navigation */
.main-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid var(--color-secondary); /* Bold line below navigation */
}

.main-navigation .nav-items {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
}

.main-navigation .nav-items li a {
    display: block;
    padding: 15px 18px;
    text-transform: uppercase;
    font-weight: 600;
    border-right: 1px solid var(--color-light-gray);
}

.menu-toggle {
    display: none; /* Hidden on desktop */
}

/* Breaking News Ticker */
.breaking-news-bar {
    background-color: var(--color-light-gray);
    padding: 8px 20px;
    font-size: 0.9em;
    display: flex;
    align-items: center;
}
.breaking-news-bar span {
    font-weight: bold;
    color: var(--color-secondary);
    margin-right: 10px;
}

/* --------------------------------------
   3. ADVERTISEMENTS & WIDGETS
-------------------------------------- */

.ad-placeholder {
    background-color: var(--color-light-gray);
    border: 1px dashed #aaa;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 15px 0;
    color: #666;
    font-size: 0.9em;
}

/* Header Banner Ad Slot */
.header-ad-slot-container {
    text-align: center;
    padding: 10px 0;
}
.banner-728x90 {
    width: 728px; 
    height: 90px;
    margin: 0 auto;
}
.vertical-300x600 {
    width: 300px; 
    height: 600px;
    margin-top: 20px;
}

/* --------------------------------------
   4. INDEX/ARCHIVE LAYOUT (index.php)
-------------------------------------- */

.main-content-flex {
    display: flex;
    gap: 30px; /* Space between posts column and sidebar */
    padding-top: 20px;
}

.posts-column {
    flex: 2; /* Takes up about 66% of the space */
    min-width: 0; /* Important for flex items */
}

.sidebar-column {
    flex: 1; /* Takes up about 33% of the space */
    max-width: 300px; /* Define max width for sidebar */
}

.page-header {
    border-bottom: 2px solid var(--color-light-gray);
    padding-bottom: 15px;
    margin-bottom: 20px;
}
.page-header .page-title {
    color: var(--color-secondary);
    font-size: 2.2em;
    font-weight: 700;
}

/* --------------------------------------
   5. FOOTER (footer.php)
-------------------------------------- */

.site-footer {
    background-color: var(--color-primary);
    color: #fff;
    padding: 30px 0;
    margin-top: 40px;
    font-size: 0.9em;
}

.site-footer a {
    color: #ccc;
}

.site-info, .footer-social-links, .footer-navigation {
    text-align: center;
    padding: 5px 0;
}

.footer-navigation .footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    justify-content: center;
}

.footer-navigation .footer-links li {
    margin: 0 10px;
}

/* --------------------------------------
   6. RESPONSIVE DESIGN (Media Queries)
-------------------------------------- */

/* Tablet and Smaller Desktops */
@media (max-width: 1024px) {
    
    .container {
        padding: 0 15px;
    }

    .main-navigation .nav-items li a {
        padding: 12px 10px;
    }

    /* Smaller banner ad for tablets */
    .banner-728x90 {
        width: 468px; 
        height: 60px;
    }

    .posts-column {
        flex: 1; /* Give more space to posts on tablets */
    }
}


/* Mobile Devices */
@media (max-width: 768px) {
    
    .top-bar {
        flex-direction: column;
        text-align: center;
    }
    .top-bar-meta {
        margin-top: 5px;
        font-size: 0.9em;
    }

    /* Force full width and hide menu on mobile */
    .main-navigation {
        flex-direction: column;
        align-items: flex-start;
    }
    .main-navigation .nav-items {
        flex-direction: column;
        width: 100%;
        display: none; /* Hide by default, shown via JS toggle */
    }
    .main-navigation .nav-items li a {
        border-right: none;
        border-bottom: 1px solid var(--color-light-gray);
        padding: 10px 15px;
    }
    .menu-toggle {
        display: block; /* Show menu toggle button */
        background: none;
        border: none;
        padding: 10px 15px;
        cursor: pointer;
        font-weight: bold;
        text-transform: uppercase;
        color: var(--color-secondary);
    }
    .main-navigation .search-box {
        padding: 10px 15px;
        width: 100%;
    }

    /* Change layout to single column (Posts stack on top of Sidebar) */
    .main-content-flex {
        flex-direction: column;
        gap: 0;
    }

    .sidebar-column {
        max-width: 100%; /* Sidebar takes full width */
        order: 2; /* Put sidebar below the posts */
    }
    .posts-column {
        order: 1; 
    }
    
    /* Mobile ad size */
    .vertical-300x600, .banner-728x90 {
        width: 100%;
        height: 100px; /* Adjust height for space efficiency */
    }
}

/* --------------------------------------
   7. POST CARD LAYOUT (content-excerpt.php)
-------------------------------------- */

.news-post-card {
    border-bottom: 1px solid var(--color-light-gray); /* Separator line */
    padding-bottom: 20px;
    margin-bottom: 20px;
}

.post-card-wrapper {
    display: flex;
    gap: 20px;
}

.post-thumbnail-container {
    flex-shrink: 0; /* Prevents image from shrinking */
    width: 30%; /* Image takes 30% width on desktop */
    max-width: 200px; 
    overflow: hidden;
}

.post-thumbnail-container img {
    display: block;
    width: 100%;
    height: auto;
    object-fit: cover;
}

.post-content-wrap {
    flex-grow: 1;
}

.news-post-card .entry-title {
    font-size: 1.5em; /* Prominent headline */
    margin-top: 5px;
    margin-bottom: 10px;
    font-weight: 700;
}

.news-post-card .category-tag {
    font-size: 0.85em;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-secondary); /* Highlight the category/country */
}

.news-post-card .entry-summary {
    font-size: 0.95em;
    color: #444;
}

.news-post-card .post-meta-bottom {
    font-size: 0.8em;
    color: #777;
    margin-top: 10px;
}

/* Mobile Responsiveness for Post Card */
@media (max-width: 768px) {
    .post-card-wrapper {
        flex-direction: column; /* Stack image on top of text */
        gap: 10px;
    }
    
    .post-thumbnail-container {
        width: 100%;
        max-width: none;
    }

    .news-post-card .entry-title {
        font-size: 1.3em; 
    }
}