/* Basic clean styles for CleanLite */

:root { 
    --wrap-width: 1100px; 
    --accent: #1e73be; 
    color-scheme: light; 
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
    color: #222;
    background: #fff;
    line-height: 1.6;
}

.wrap { 
    max-width: var(--wrap-width); 
    margin: 0 auto; 
    padding: 0 20px; 
}

.site-header { 
    border-bottom: 1px solid #eaeaea; 
    padding: 15px 0; 
    transition: background-color 0.3s ease, padding 0.3s ease;
    width: 100%;
    z-index: 999;
}

/* Site Branding */
.site-branding {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px; 
}

.custom-logo-link img {
    height: auto;
    display: block;
    /* max-width is handled by Customizer */
}

.site-title { 
    font-size: 22px; 
    text-decoration: none; 
    margin: 0; 
    line-height: 1.2;
    font-weight: 700;
}

.site-title a {
    text-decoration: none;
    color: inherit;
}

.site-description { 
    margin: 0; 
    font-size: 14px; 
    color: #666;
}

/* Desktop Navigation */
.main-navigation .menu {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    /* gap is handled by Customizer */
}

.main-navigation .menu li {
    margin: 0;
    position: relative;
}

.main-navigation a {
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.2s ease;
}

/* Toggle Button (Hidden on Desktop) */
.menu-toggle {
    display: none;
    background: transparent;
    border: 1px solid #ddd;
    padding: 8px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
}

.menu-toggle .menu-icon {
    margin-right: 6px;
}

/* Mobile Layout */
@media (max-width: 768px) {
    .site-header .wrap {
        flex-direction: column;
        align-items: flex-start;
    }

    .menu-toggle {
        display: flex;
        align-items: center;
        width: 100%;
        justify-content: center;
        margin-top: 10px;
    }

    /* Important: Hide menu by default on mobile */
    .main-navigation .menu {
        display: none;
        flex-direction: column;
        width: 100%;
        background: #f9f9f9;
        margin-top: 10px;
        padding: 10px;
        border-radius: 4px;
        gap: 0 !important; /* Force no gap on mobile, use margin */
    }

    /* Show menu when toggled */
    #primary-menu.toggled-on {
        display: flex !important;
    }

    .main-navigation .menu li {
        border-bottom: 1px solid #eaeaea;
        margin-bottom: 0;
    }

    .main-navigation .menu li:last-child {
        border-bottom: none;
    }

    .main-navigation .menu a {
        display: block;
        padding: 12px 0;
    }
}

@media (min-width: 769px) {
    .site-header .wrap {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    .site-branding {
        margin-bottom: 0;
    }
    .main-navigation .menu {
        display: flex; /* Force flex on desktop */
    }
}

/* Posts */
.site-main {
    padding: 40px 0;
}

.entry-header {
    margin-bottom: 15px;
}

.entry-title { 
    margin: 0 0 10px;
    font-size: 26px;
}

.entry-meta { 
    font-size: 13px; 
    color: #666; 
    margin-bottom: 15px; 
}

.entry-content { 
    margin-bottom: 30px;
    color: #444;
}

.post-thumbnail img,
.post-thumbnail-single img {
    width: 100%;
    height: auto;
    display: block;
    margin-bottom: 25px;
    border-radius: 6px;
}

/* Tags */
.entry-tags .tag-links a {
    display: inline-block;
    background: #f1f1f1;
    padding: 4px 10px;
    border-radius: 20px;
    text-decoration: none;
    color: #555;
    margin-right: 6px;
    font-size: 12px;
}

/* SIDEBAR & WIDGET DESIGN */
.widget-area {
    margin-top: 40px;
}

@media (min-width: 900px) {
    .site-main .wrap {
        display: grid;
        grid-template-columns: 2fr 1fr;
        gap: 60px;
    }
    .widget-area {
        margin-top: 0;
    }
}

.widget { 
    margin-bottom: 40px; 
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.widget:last-child {
    border-bottom: none;
}

.widget-title {
    font-size: 16px;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--accent, #1e73be);
    display: inline-block;
    color: #333;
}

.widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.widget ul li {
    padding: 8px 0;
    border-bottom: 1px solid #f5f5f5;
}

.widget ul li:last-child {
    border-bottom: none;
}

.widget ul li a {
    text-decoration: none;
    color: #444;
    transition: color 0.2s;
}

.widget ul li a:hover {
    color: var(--accent, #1e73be);
}

/* Footer */
.site-footer {
    border-top: 1px solid #eaeaea;
    padding: 30px 0;
    font-size: 14px;
    color: #666;
    background: #f9f9f9;
    margin-top: 40px;
}

/* Utilities */
.screen-reader-text {
    position: absolute;
    left: -10000px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--accent, #1e73be);
    color: #fff;
    padding: 8px 12px;
    z-index: 100000;
    text-decoration: none;
    border-radius: 4px;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 10px;
}

/* ==========================================================================
   NEW HEADER FEATURES: Sticky, Transparent, Scrolled States
   ========================================================================== 
*/

.site-wrapper {
    overflow-x: visible;
}

/* STICKY HEADER LOGIC */
.site-header.is-sticky {
    position: sticky;
    top: 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* TRANSPARENT HEADER LOGIC */
body.has-transparent-header .site-header {
    position: absolute; /* Overlays content */
    top: 0;
    left: 0;
    background-color: transparent;
    border-bottom: none;
    box-shadow: none;
}

/* When transparent header is enabled, content needs to handle overlay 
   (Usually hero sections work fine, but text needs contrast) */

/* TRANSPARENT + STICKY COMBINATION */
/* If sticky is enabled, we want it to become solid when scrolled */
body.has-transparent-header .site-header.is-sticky.has-scrolled {
    position: fixed; /* Fix to top when scrolled */
    animation: slideDown 0.3s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    /* Background color is handled by inline CSS from Customizer */
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}

/* Admin bar fix */
.admin-bar .site-header.is-sticky { top: 32px; }
@media screen and (max-width: 782px) { .admin-bar .site-header.is-sticky { top: 46px; } }

/* 404 & Search */
.error-404 .page-title { font-size: 32px; margin-bottom: 20px; }
.search-form { display: flex; gap: 10px; margin-top: 15px; }
.search-field { padding: 8px; border: 1px solid #ccc; border-radius: 4px; flex-grow: 1; }
.search-submit { padding: 8px 16px; background: #222; color: #fff; border: none; border-radius: 4px; cursor: pointer; }