/*!
Theme Name: wakapassgist
Theme URI: https://wakapassgist.com/
Author: Emmanuel
Author URI: https://wakapassgist.com/
Description: A highly attractive, mobile-first, secure, and SEO-optimized news blog theme.
Version: 1.2.1
Tested up to: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: wakapassgist-com

This theme, like WordPress, is licensed under the GPL.
*/

/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
1. Variables & Design Tokens
2. Normalize & Base
3. Typography & Accessibility
4. Layout Base
5. Components (Cards, Buttons, Header)
6. Navigation (Mobile & Desktop)
7. Single Post Formatting
8. Footer
9. Layout: Main Content & Sidebar (Grid Layout)
--------------------------------------------------------------*/

/*--------------------------------------------------------------
1. Variables & Design Tokens
--------------------------------------------------------------*/
:root {
    /* Branding Colors extracted from wakapassgist logo */
    --color-primary: #0f306b; /* Deep navy blue from text */
    --color-primary-hover: #0a214d;
    --color-accent: #d3121b; /* Vibrant red from globe swoosh/play button */
    
    /* Neutral Palette for high-contrast readability */
    --text-main: #111827;
    --text-muted: #4b5563;
    --bg-body: #f3f4f6; /* Soft gray to make white news cards pop */
    --bg-surface: #ffffff;
    --border-color: #e5e7eb;

    /* Typography - Instant load system fonts */
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    --font-serif: "Merriweather", "Georgia", serif; /* For long-form reading */
    
    /* Spacing & Layout */
    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1.25rem;
    --space-lg: 2.5rem;
    --space-xl: 5rem;
    --container-max: 1280px;
    --content-max: 800px;
    
    /* Visuals */
    --radius-sm: 4px;
    --radius-md: 12px;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -2px rgba(0,0,0,0.05);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/*--------------------------------------------------------------
2. Normalize & Base
--------------------------------------------------------------*/
*, *::before, *::after { box-sizing: border-box; }

html {
    font-size: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-body);
    color: var(--text-main);
    font-family: var(--font-sans);
    font-size: 1.125rem;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, video, iframe {
    max-width: 100%;
    height: auto;
    display: block;
}

/*--------------------------------------------------------------
3. Typography & Accessibility
--------------------------------------------------------------*/
h1, h2, h3, h4, h5, h6 {
    color: var(--color-primary);
    line-height: 1.2;
    margin-top: 0;
    margin-bottom: var(--space-sm);
    font-weight: 800;
    letter-spacing: -0.02em;
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.5rem, 4vw, 2.5rem); }

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

a:hover, a:focus { color: var(--color-accent); }

/* ACCESSIBILITY: Visible focus states */
:focus-visible {
    outline: 3px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: var(--radius-sm);
}

.screen-reader-text {
    border: 0; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%);
    height: 1px; margin: -1px; overflow: hidden; padding: 0;
    position: absolute !important; width: 1px; word-wrap: normal !important;
}

/*--------------------------------------------------------------
4. Layout Base
--------------------------------------------------------------*/
.site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Base styles for pages that might not use the sidebar wrapper yet */
.site-main {
    flex-grow: 1;
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

/* Premium News Grid */
.news-grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-top: var(--space-lg);
}

/* DESKTOP ENHANCEMENT: Make the first article a "Featured News" block */
@media screen and (min-width: 800px) {
    .news-grid-container .news-card:first-child {
        grid-column: 1 / -1; /* Span all columns */
        flex-direction: row; /* Side-by-side layout */
        align-items: center;
    }
    
    .news-grid-container .news-card:first-child .post-thumbnail {
        width: 60%;
        height: 100%;
    }
    
    .news-grid-container .news-card:first-child .entry-header {
        width: 40%;
        padding: var(--space-lg);
    }
    
    .news-grid-container .news-card:first-child .entry-title {
        font-size: clamp(2rem, 3vw, 2.75rem);
    }
}

/*--------------------------------------------------------------
5. Components (Cards, Buttons, Header)
--------------------------------------------------------------*/
.news-card {
    display: flex;
    flex-direction: column;
    background: var(--bg-surface);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    border: 1px solid transparent;
}

.news-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-5px);
    border-color: rgba(15, 48, 107, 0.1);
}

.news-card .post-thumbnail {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    margin: 0;
    border-bottom: 3px solid var(--color-accent);
}

.news-card .entry-header,
.news-card .entry-summary {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card .entry-title {
    font-size: 1.35rem;
    margin-bottom: var(--space-xs);
    color: var(--text-main);
}

.news-card .entry-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.button, .read-more-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-body);
    color: var(--color-primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    border: 2px solid var(--color-primary);
    cursor: pointer;
    transition: var(--transition);
    margin-top: auto;
    width: 100%;
}

.button:hover, .read-more-button:hover {
    background-color: var(--color-primary);
    color: #ffffff;
}

/*--------------------------------------------------------------
6. Header & Navigation (Mobile & Desktop)
--------------------------------------------------------------*/
.site-header {
    background: var(--bg-surface);
    border-bottom: 4px solid var(--color-primary);
    padding: var(--space-sm) var(--space-md);
    position: sticky;
    top: 0;
    z-index: 999;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
}

.site-branding .custom-logo-link img {
    max-height: 65px;
    width: auto;
    object-fit: contain;
    display: block;
}

.menu-toggle {
    display: block;
    width: 100%;
    padding: 1rem;
    background: var(--color-primary);
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 700;
    text-align: center;
    border: none;
    border-radius: var(--radius-sm);
    margin-top: var(--space-md);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
}

.main-navigation ul {
    display: none;
    list-style: none;
    padding: 0;
    margin: 0;
}

.main-navigation.toggled ul {
    display: block;
}

.main-navigation a {
    display: block;
    padding: 1rem 0;
    color: var(--color-primary);
    font-weight: 700;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--border-color);
}

@media screen and (min-width: 800px) {
    .site-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: var(--space-sm) var(--space-lg);
    }
    
    .menu-toggle { display: none; }
    
    .main-navigation ul {
        display: flex;
        gap: var(--space-lg);
    }
    
    .main-navigation a {
        border-bottom: none;
        padding: 0.5rem 0;
    }
    
    .main-navigation a:hover {
        color: var(--color-accent);
    }
}

/*--------------------------------------------------------------
7. Single Post Formatting
--------------------------------------------------------------*/
.single .site-main {
    max-width: var(--content-max);
    background: var(--bg-surface);
    padding: var(--space-lg);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    margin-top: var(--space-lg);
}

.single .entry-header {
    text-align: center;
    margin-bottom: var(--space-lg);
    border-bottom: 2px solid var(--border-color);
    padding-bottom: var(--space-lg);
}

.single .entry-content {
    font-family: var(--font-serif);
    font-size: 1.15rem;
    line-height: 1.8;
    color: #374151;
}

.single .entry-content p {
    margin-bottom: var(--space-lg);
}

.single .post-thumbnail {
    margin: var(--space-lg) 0;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/*--------------------------------------------------------------
8. Footer
--------------------------------------------------------------*/
.site-footer {
    background: var(--color-primary);
    color: #ffffff;
    padding: var(--space-xl) var(--space-md);
    text-align: center;
    margin-top: auto;
    border-top: 5px solid var(--color-accent);
}

.site-footer a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 700;
}

.site-footer a:hover {
    color: var(--color-accent);
}

/*--------------------------------------------------------------
9. Layout: Main Content & Sidebar (Grid Layout)
--------------------------------------------------------------*/
/* 1. The wrapper controls the layout */
.site-content-wrapper {
    display: grid;
    grid-template-columns: 1fr; /* Stacked on mobile */
    gap: var(--space-lg);
    width: 100%;
    max-width: var(--container-max);
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

/* 2. Strip padding/margins from .site-main so it fits the grid perfectly */
.site-content-wrapper .site-main {
    padding: 0 !important;
    margin: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
}

/* 3. Strip padding/margins from the sidebar */
#secondary {
    padding: 0;
    margin: 0;
    width: 100%;
}

/* 4. Desktop Layout - Force Side-by-Side */
@media screen and (min-width: 800px) {
    .site-content-wrapper {
        grid-template-columns: 1fr 320px; /* Main content gets remaining space, Sidebar gets exactly 320px */
        align-items: start; /* Prevents sidebar from stretching downwards */
    }
}

/*--------------------------------------------------------------
10. Footer Navigation
--------------------------------------------------------------*/
.footer-navigation {
    margin-bottom: var(--space-md);
    padding-bottom: var(--space-md);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-md);
}

.footer-menu-list a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: var(--transition);
}

.footer-menu-list a:hover {
    color: var(--color-accent);
}

.menu-toggle {
    display: flex; /* Changed from block to flex */
    align-items: center; /* Centers the icon vertically */
    justify-content: center; /* Centers the icon horizontally */
    width: 100%;
    padding: 0.75rem; /* Slightly reduced padding for an icon */
    background: var(--color-primary);
    color: #ffffff;
    border: none;
    border-radius: var(--radius-sm);
    margin-top: var(--space-md);
    cursor: pointer;
}