/* Custom CSS for Burogun Theme */

:root {
	--font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
	--font-size-base: 1rem;
	--line-height-base: 1.6;
	--font-weight-base: 400;

	--color-background: #ffffff;
	--color-text: #222222;
	--color-primary: #0073aa;
	--color-border: #dddddd;

	--spacing-unit: 1.5rem;
}

/* 1.0 Normalize & Base
--------------------------------------------- */
body {
	font-family: var(--font-family-base);
	font-size: var(--font-size-base);
	line-height: var(--line-height-base);
	font-weight: var(--font-weight-base);
	color: var(--color-text);
	background-color: var(--color-background);
	margin: 0;
}

/* 3.0 Layout
--------------------------------------------- */
.site {
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--spacing-unit);
	padding-right: var(--spacing-unit);
}

#content {
	display: flex;
	flex-wrap: wrap;
	gap: calc(var(--spacing-unit) * 2);
}

#primary {
	flex: 1 1 100%;
	min-width: 0; /* Prevents flex items from overflowing */
}

#secondary {
	flex: 1 1 100%;
}

/* Media query for two-column layout on larger screens */
@media (min-width: 768px) {
	#primary {
		flex: 2 1 0%; /* Takes up 2/3 of the space */
	}

	#secondary {
		flex: 1 1 0%; /* Takes up 1/3 of the space */
	}
}

/* 4.0 Components
--------------------------------------------- */
.widget {
    margin-bottom: var(--spacing-unit);
    border: 1px solid var(--color-border);
    padding: var(--spacing-unit);
}

.widget-title {
    margin-top: 0;
    font-size: 1.2rem;
    border-bottom: 2px solid var(--color-primary);
    padding-bottom: 0.5rem;
    margin-bottom: var(--spacing-unit);
}

/* 3.2 Header
--------------------------------------------- */
.site-header {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding-bottom: var(--spacing-unit);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: calc(var(--spacing-unit) * 2);
}

.site-branding {
    margin-right: var(--spacing-unit);
}

.site-title {
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
}

.site-title a {
    color: var(--color-text);
    text-decoration: none;
}

.site-description {
    font-size: 1rem;
    color: #666;
    margin: 0;
    font-weight: 400;
}

/* 3.3 Navigation
--------------------------------------------- */
.main-navigation ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
}

.main-navigation li {
    margin-left: 1.5rem;
}

.main-navigation a {
    display: block;
    color: var(--color-text);
    text-decoration: none;
    font-weight: 600;
    padding: 0.5rem 0;
    position: relative;
    border-bottom: 2px solid transparent;
    transition: color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.main-navigation a:hover {
    color: var(--color-primary);
}

.main-navigation .current_page_item > a,
.main-navigation .current-menu-item > a {
    color: var(--color-primary);
    border-bottom-color: var(--color-primary);
}

.menu-toggle {
    display: none; /* Hidden by default on larger screens */
}


/* Mobile Navigation Styles */
@media (max-width: 767px) {
    .site-header {
        position: relative;
    }

    .menu-toggle {
        display: block;
        background-color: transparent;
        border: 1px solid var(--color-border);
        padding: 0.5rem 0.8rem;
        cursor: pointer;
        font-size: 1rem;
    }

    .main-navigation ul {
        display: none; /* Hide menu by default */
        flex-direction: column;
        width: 100%;
        background-color: var(--color-background);
        border: 1px solid var(--color-border);
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 1000;
    }
    
    /* This class will be added by JS to show the menu */
    .main-navigation.toggled ul {
        display: flex;
    }

    .main-navigation li {
        margin: 0;
        width: 100%;
    }

    .main-navigation a {
        padding: 1rem var(--spacing-unit);
        border-bottom: 1px solid var(--color-border);
    }

    .main-navigation li:last-child a {
        border-bottom: none;
    }

    .main-navigation .current_page_item > a,
    .main-navigation .current-menu-item > a {
        border-bottom-color: var(--color-border);
    }
}

/* 2.0 Typography & Content
--------------------------------------------- */
a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.3;
    margin-top: calc(var(--spacing-unit) * 1.5);
    margin-bottom: var(--spacing-unit);
}

.entry-title, .page-title {
    font-size: 2.2rem;
}

p {
    margin-top: 0;
    margin-bottom: var(--spacing-unit);
}

article {
    margin-bottom: calc(var(--spacing-unit) * 2);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: calc(var(--spacing-unit) * 2);
}

article:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.entry-meta {
    color: #555;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-unit);
}

.entry-meta a {
    font-weight: 600;
}

.entry-content {
    margin-top: var(--spacing-unit);
}

.entry-footer {
    margin-top: var(--spacing-unit);
    font-size: 0.9rem;
}

.post-thumbnail img {
    max-width: 100%;
    height: auto;
    margin-bottom: var(--spacing-unit);
}

.page-header {
    margin-bottom: calc(var(--spacing-unit) * 2);
    border-bottom: 1px solid var(--color-border);
    padding-bottom: var(--spacing-unit);
}

/* 4.1 Buttons
--------------------------------------------- */
.button {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1;
    text-align: center;
    text-decoration: none;
    white-space: nowrap;
    vertical-align: middle;
    cursor: pointer;
    border: 1px solid transparent;
    border-radius: 4px;
    transition: all 0.2s ease-in-out;
}

/* Button Types */
.button.primary {
    color: #fff;
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.button.primary:hover {
    background-color: #005f88; /* Darker shade of #0073aa */
    border-color: #005f88;
}

.button.secondary {
    color: var(--color-text);
    background-color: #e0e0e0;
    border-color: #e0e0e0;
}

.button.secondary:hover {
    background-color: #d0d0d0;
    border-color: #d0d0d0;
}

.button.outline {
    color: var(--color-primary);
    background-color: transparent;
    border-color: var(--color-primary);
}

.button.outline:hover {
    color: #fff;
    background-color: var(--color-primary);
}

/* Button Sizes */
.button.small {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.button.large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
}

/* 4.2 Block Styles
--------------------------------------------- */
.is-style-framed-paragraph {
    border: 1px solid var(--color-border);
    padding: var(--spacing-unit);
    background-color: #f9f9f9;
    border-radius: 4px;
}

/* Gutenberg Editor Styles (for backend consistency) */
/*
 * Note: These styles should also be loaded in the editor using add_editor_style()
 * which is already set up in functions.php to load assets/css/main.css.
 */
.editor-styles-wrapper .wp-block-paragraph.is-style-framed-paragraph {
    border: 1px solid var(--color-border);
    padding: var(--spacing-unit);
    background-color: #f9f9f9;
    border-radius: 4px;
}

.editor-styles-wrapper .is-style-highlighted-heading {
    background-color: #f0f0f0;
    padding: 0.5em 1em;
    border-left: 5px solid var(--color-primary);
}

/* Block Patterns specific styles (if any, for example, columns gap adjustment) */
.wp-block-columns.is-layout-flex.wp-container-core-columns-is-layout-1 {
    gap: calc(var(--spacing-unit) * 2); /* Ensure consistent gap */
}

/* 4.3 Search Form
--------------------------------------------- */
.search-form {
    display: flex;
    flex-wrap: nowrap;
    margin-bottom: var(--spacing-unit);
}

.search-field {
    flex-grow: 1;
    padding: 0.8rem 1rem;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: 4px 0 0 4px;
    font-size: 1rem;
    line-height: 1;
    min-width: 0; /* Allow field to shrink in flex container */
}

.search-field:focus {
    outline: none;
    border-color: var(--color-primary);
}

.search-submit {
    padding: 0.8rem 1.5rem;
    background-color: var(--color-primary);
    color: #fff;
    border: 1px solid var(--color-primary);
    border-left: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    transition: background-color 0.2s ease-in-out, border-color 0.2s ease-in-out;
}

.search-submit:hover {
    background-color: #005f88; /* Darker shade of --color-primary */
    border-color: #005f88;
}

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