/*
Theme Name: STW General Theme
Theme URI: https://example.com/stwgeneraltheme
Author: STW Developer
Author URI: https://example.com
Description: A robust and comprehensive Gutenberg block theme with full-width responsive layouts. Features 100% width containers with zero padding, neutral background, and templates for standard pages, left-sidebar, and right-sidebar layouts.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: stwgeneraltheme
Tags: full-site-editing, block-patterns, block-styles, wide-blocks, full-width, responsive-layout
*/

/* Reset and Base Styles */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	padding: 0;
	width: 100%;
	overflow-x: hidden;
}

/* Full Width Container Styles */
.wp-site-blocks {
	width: 100%;
	max-width: 100%;
	padding: 0;
	margin: 0;
}

.wp-site-blocks > * {
	width: 100%;
	max-width: 100%;
}

/* Header Styles */
.site-header {
	width: 100%;
	padding: 0;
	margin: 0;
}

/* Footer Styles */
.site-footer {
	width: 100%;
	padding: 0;
	margin: 0;
}

/* Main Content Area */
.site-main {
	width: 100%;
	padding: 0;
	margin: 0;
}

/* Full Width Alignment */
.alignfull {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

.alignwide {
	width: 100%;
	max-width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Template Parts Reset */
.wp-block-template-part {
	width: 100%;
	padding: 0;
	margin: 0;
}

/* Group Block Full Width */
.wp-block-group {
	width: 100%;
	max-width: 100%;
}

.wp-block-group.alignfull {
	padding-left: 0;
	padding-right: 0;
}

/* Sidebar Layout Styles */
.sidebar-layout {
	display: flex;
	flex-wrap: wrap;
	width: 100%;
	gap: 0;
}

.sidebar-layout .content-area {
	flex: 1 1 70%;
	min-width: 0;
}

.sidebar-layout .sidebar-area {
	flex: 0 0 30%;
	min-width: 250px;
}

/* Left Sidebar */
.sidebar-left .sidebar-area {
	order: -1;
}

.sidebar-left .content-area {
	order: 1;
}

/* Right Sidebar */
.sidebar-right .content-area {
	order: -1;
}

.sidebar-right .sidebar-area {
	order: 1;
}

/* Responsive Sidebar Breakpoints */
@media screen and (max-width: 1024px) {
	.sidebar-layout .content-area {
		flex: 1 1 65%;
	}
	
	.sidebar-layout .sidebar-area {
		flex: 0 0 35%;
	}
}

@media screen and (max-width: 768px) {
	.sidebar-layout {
		flex-direction: column;
	}
	
	.sidebar-layout .content-area,
	.sidebar-layout .sidebar-area {
		flex: 1 1 100%;
		width: 100%;
		order: unset;
	}
	
	.sidebar-left .sidebar-area,
	.sidebar-left .content-area,
	.sidebar-right .sidebar-area,
	.sidebar-right .content-area {
		order: unset;
	}
	
	/* Content always first on mobile */
	.sidebar-layout .content-area {
		order: 1;
	}
	
	.sidebar-layout .sidebar-area {
		order: 2;
	}
}

/* Responsive Typography */
@media screen and (max-width: 768px) {
	html {
		font-size: 14px;
	}
}

@media screen and (max-width: 480px) {
	html {
		font-size: 13px;
	}
}

/* Responsive Images */
img {
	max-width: 100%;
	height: auto;
}

/* Responsive Embeds */
.wp-block-embed,
.wp-block-video {
	max-width: 100%;
}

.wp-block-embed__wrapper {
	position: relative;
	width: 100%;
}

/* Columns Responsive */
@media screen and (max-width: 768px) {
	.wp-block-columns {
		flex-direction: column;
	}
	
	.wp-block-column {
		flex-basis: 100% !important;
		width: 100%;
	}
}

/* Navigation Responsive */
@media screen and (max-width: 768px) {
	.wp-block-navigation__responsive-container.is-menu-open {
		width: 100%;
		padding: 1rem;
	}
}

/* Cover Block Full Width */
.wp-block-cover.alignfull {
	width: 100%;
	margin-left: 0;
	margin-right: 0;
}

/* Remove Default Block Margins */
.wp-block-group.has-background {
	padding: 0;
}

/* Ensure No Unwanted Spacing */
.entry-content > *:first-child {
	margin-top: 0;
}

.entry-content > *:last-child {
	margin-bottom: 0;
}

/* Post Content Full Width */
.wp-block-post-content {
	width: 100%;
	max-width: 100%;
}

/* Query Loop Full Width */
.wp-block-query {
	width: 100%;
}

.wp-block-post-template {
	width: 100%;
}

/* Row and Stack Full Width */
.wp-block-group.is-layout-flex,
.wp-block-group.is-layout-flow {
	width: 100%;
}

/* Utility Classes */
.full-width {
	width: 100%;
	max-width: 100%;
	padding-left: 0;
	padding-right: 0;
}

.no-padding {
	padding: 0;
}

.no-margin {
	margin: 0;
}
