/*
Theme Name: My Simple Base Theme
Author: Your Name
Description: A clean, responsive, and minimal WordPress theme foundation.
Version: 1.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Tags: lightweight, responsive, one-column, two-columns, custom-logo, right-sidebar
*/

/* --- Basic Reset & Mobile First Defaults --- */
html { box-sizing: border-box; }
*, *:before, *:after { box-sizing: inherit; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f1f1f1; /* A light grey background */
}

img { max-width: 100%; height: auto; }
a { color: #0073aa; text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Layout Containers --- */
.site-container {
    background-color: #ffffff; /* White background for content */
    /* max-width is set dynamically by the Customizer */
    margin-left: auto;
    margin-right: auto;
    padding: 2em;
}

.site-content-wrapper {
    display: flex;
    flex-direction: column; /* Default for mobile */
    gap: 2em;
}

.site-main {
    width: 100%;
}

/* --- Header --- */
.site-header {
    padding: 1em 2em;
    background: #fff;
    border-bottom: 1px solid #ddd;
}

.site-branding-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap; /* Allow items to wrap on small screens */
    gap: 1em;
    /* max-width is set dynamically by the Customizer */
    margin-left: auto;
    margin-right: auto;
}

.site-branding .custom-logo {
    max-height: 60px; /* Control logo height */
    width: auto;
}

.site-title a { font-weight: bold; font-size: 1.5rem; }

/* --- Navigation --- */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center nav items on mobile */
}
.main-navigation li { margin: 0.5em; }
.main-navigation a { font-weight: 500; }

/* --- Sticky Header --- */
.sticky-header-active .site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}
body.sticky-header-active {
    /* Padding is added dynamically via JavaScript to prevent content jump */
}

/* --- Sidebar --- */
.widget-area {
    width: 100%; /* Full width on mobile */
}

/* --- Footer --- */
.site-footer {
    background: #333;
    color: #fff;
    padding: 2em;
    text-align: center;
    margin-top: 2em;
}
.site-footer a { color: #00a0d2; }

/* --- Tablet & Desktop Styles (min-width: 768px) --- */
@media (min-width: 768px) {
    .site-content-wrapper {
        flex-direction: row; /* Side-by-side layout on larger screens */
    }

    .main-navigation ul {
        justify-content: flex-end; /* Align nav to the right */
    }
    .main-navigation li { margin-left: 1.5em; }

    /* 1 Column Layout */
    .layout-1-col .site-main {
        width: 100%;
    }
    .layout-1-col .widget-area {
        display: none; /* Hide sidebar in 1-col layout */
    }

    /* 2 Column Layout */
    .layout-2-col .site-main {
        flex: 1; /* Takes up remaining space */
        min-width: 0; /* Prevents flex item from overflowing */
    }
    .layout-2-col .widget-area {
        flex-basis: 300px; /* Fixed width for the sidebar */
        flex-shrink: 0;
    }
}