/**
 * Layout Styles for Kava Theme
 * Grid System, Header, Footer, Navigation
 */

/* ==========================================================================
   Reset & Base
   ========================================================================== */

*, *::before, *::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
	-ms-text-size-adjust: 100%;
	overflow-x: hidden;
}

body {
	margin: 0;
	padding: 0;
	overflow-x: hidden;
	background-color: #ffffff;
}

img {
	max-width: 100%;
	height: auto;
	vertical-align: middle;
}

a {
	text-decoration: none;
	transition: color 0.3s ease;
}

ul, ol {
	margin: 0;
	padding: 0;
}

/* ==========================================================================
   Container
   ========================================================================== */

.container {
	width: 100%;
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 15px;
	padding-right: 15px;
}

/* ==========================================================================
   Grid System
   ========================================================================== */

.row {
	display: flex;
	flex-wrap: wrap;
	margin-left: -15px;
	margin-right: -15px;
}

.row::after {
	content: "";
	display: table;
	clear: both;
}

[class*="col-"] {
	position: relative;
	width: 100%;
	padding-left: 15px;
	padding-right: 15px;
}

/* Extra small devices (phones, less than 768px) */
.col-xs-12 {
	flex: 0 0 100%;
	max-width: 100%;
}

/* Medium devices (tablets, 768px and up) */
@media (min-width: 768px) {
	.col-md-4 {
		flex: 0 0 33.333333%;
		max-width: 33.333333%;
	}
	
	.col-md-8 {
		flex: 0 0 66.666667%;
		max-width: 66.666667%;
	}
	
	.col-md-12 {
		flex: 0 0 100%;
		max-width: 100%;
	}
}

/* ==========================================================================
   Site Structure
   ========================================================================== */

.site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.site-content {
	flex: 1;
	padding: 30px 0;
}

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
	background-color: #ffffff;
	border-bottom: 1px solid #f0f0f0;
	position: relative;
	z-index: 100;
}

.site-header__wrap {
	padding: 15px 0;
}

.space-between-content {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 15px;
}

/* Site Branding / Logo */
.site-branding {
	flex-shrink: 0;
}

.custom-logo-link {
	display: inline-block;
}

.custom-logo {
	max-height: 60px;
	width: auto;
}

.site-title {
	font-size: 24px;
	font-weight: 700;
	color: #398ffc;
	text-decoration: none;
}

.site-title:hover {
	color: #2a7ae0;
}

/* ==========================================================================
   Main Navigation
   ========================================================================== */

.main-navigation {
	font-weight: 400;
	font-size: 14px;
	line-height: 1.4;
	font-family: Roboto, sans-serif;
}

.main-navigation ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
}

.main-navigation li {
	position: relative;
}

.main-navigation a {
	display: block;
	padding: 10px 15px;
	color: #a1a2a4;
	transition: color 0.3s ease;
}

.main-navigation a:hover,
.main-navigation .current-menu-item > a,
.main-navigation .current_page_item > a {
	color: #3b3d42;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle-button {
	display: none;
	padding: 10px 15px;
	background-color: #398ffc;
	color: #ffffff;
	border: none;
	cursor: pointer;
	font-size: 16px;
}

@media (max-width: 767px) {
	.mobile-menu-toggle-button {
		display: block;
	}
	
	.main-navigation {
		width: 100%;
		order: 3;
	}
	
	.main-navigation .main-navigation-inner {
		display: none;
	}
	
	.main-navigation.toggled .main-navigation-inner {
		display: block;
	}
	
	.main-navigation ul {
		flex-direction: column;
		width: 100%;
	}
	
	.main-navigation a {
		padding: 12px 0;
		border-bottom: 1px solid #f0f0f0;
	}
	
	.space-between-content {
		flex-wrap: wrap;
	}
	
	.site-branding {
		flex: 1;
	}
}

/* ==========================================================================
   Breadcrumbs
   ========================================================================== */

.site-breadcrumbs {
	background-color: #f9f9f9;
	padding: 15px 0;
	border-bottom: 1px solid #f0f0f0;
}

.breadcrumbs_wrap {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 5px;
}

.breadcrumbs_item {
	font-size: 11px;
	font-weight: 400;
	color: #a1a2a4;
}

.breadcrumbs_item_link {
	color: #a1a2a4;
}

.breadcrumbs_item_link:hover {
	color: #398ffc;
}

.breadcrumbs_item_sep {
	color: #a1a2a4;
	margin: 0 5px;
}

.breadcrumbs_item_target {
	color: #3b3d42;
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
	background-color: #3b3d42;
	color: #ffffff;
	padding: 30px 0;
	margin-top: auto;
}

.site-footer a {
	color: #ffffff;
}

.site-footer a:hover {
	color: #398ffc;
}

.footer-copyright {
	font-size: 14px;
	text-align: center;
}

/* ==========================================================================
   Main Content Area
   ========================================================================== */

#primary {
	margin-bottom: 30px;
}

.site-main {
	padding: 0;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */

#secondary {
	margin-bottom: 30px;
}

.widget-area .widget {
	margin-bottom: 30px;
	padding: 20px;
	background-color: #f9f9f9;
	border-radius: 5px;
}

.widget-title {
	font-size: 18px;
	margin-bottom: 15px;
	padding-bottom: 10px;
	border-bottom: 2px solid #398ffc;
}

/* ==========================================================================
   Posts List / Grid
   ========================================================================== */

.posts-list {
	display: flex;
	flex-wrap: wrap;
	margin: -15px;
}

.posts-list--grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 30px;
	margin: 0;
}

.posts-list__item {
	margin-bottom: 30px;
}

.grid-item {
	background-color: #ffffff;
	border: 1px solid #f0f0f0;
	border-radius: 5px;
	overflow: hidden;
	transition: box-shadow 0.3s ease;
}

.grid-item:hover {
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
}

.grid-item-wrap {
	padding: 20px;
}

/* Post Thumbnail */
.post-thumbnail {
	margin: 0;
	overflow: hidden;
}

.post-thumbnail__link {
	display: block;
	position: relative;
}

.post-thumbnail img {
	width: 100%;
	height: 200px;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.grid-item:hover .post-thumbnail img {
	transform: scale(1.05);
}

/* Entry Header */
.entry-header {
	margin-bottom: 15px;
}

.entry-title {
	font-size: 18px;
	line-height: 1.4;
	margin: 10px 0;
}

.entry-title a {
	color: #3b3d42;
}

.entry-title a:hover {
	color: #398ffc;
}

/* Entry Meta */
.entry-meta {
	font-size: 12px;
	color: #a1a2a4;
	margin-bottom: 10px;
}

.entry-meta span {
	margin-right: 15px;
}

.entry-meta a {
	color: #398ffc;
}

.cat-links a {
	color: #398ffc;
}

/* Entry Content */
.entry-content {
	font-size: 14px;
	line-height: 1.6;
	color: #666;
	margin-bottom: 15px;
}

.entry-content p {
	margin-bottom: 15px;
}

.entry-content img {
	max-width: 100%;
	height: auto;
}

/* Entry Footer */
.entry-footer {
	padding-top: 15px;
	border-top: 1px solid #f0f0f0;
}

/* Buttons */
.btn-text-icon {
	display: inline-block;
	padding: 8px 20px;
	background-color: #398ffc;
	color: #ffffff !important;
	border-radius: 3px;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	transition: background-color 0.3s ease;
}

.btn-text-icon:hover {
	background-color: #2a7ae0;
	color: #ffffff !important;
}

/* ==========================================================================
   Single Post
   ========================================================================== */

.single .entry-header {
	margin-bottom: 30px;
}

.single .entry-title {
	font-size: 28px;
	margin-bottom: 15px;
}

.single .entry-content {
	font-size: 16px;
	line-height: 1.8;
}

.single .post-thumbnail {
	margin-bottom: 30px;
}

.single .post-thumbnail img {
	height: auto;
	border-radius: 5px;
}

/* Post Author Bio */
.post-author-bio {
	display: flex;
	align-items: flex-start;
	gap: 20px;
	padding: 30px;
	background-color: #f9f9f9;
	border-radius: 5px;
	margin: 30px 0;
}

.post-author__avatar img {
	border-radius: 50%;
}

.post-author__title {
	margin: 0 0 10px 0;
	font-size: 18px;
}

.post-author__title a {
	color: #398ffc;
}

/* Post Navigation */
.post-navigation {
	margin: 30px 0;
	padding: 20px 0;
	border-top: 1px solid #f0f0f0;
	border-bottom: 1px solid #f0f0f0;
}

.post-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
	flex: 1;
	min-width: 200px;
}

.post-navigation .nav-next {
	text-align: right;
}

.post-navigation a {
	color: #3b3d42;
}

.post-navigation a:hover {
	color: #398ffc;
}

.post-navigation .nav-text {
	font-size: 12px;
	color: #a1a2a4;
	text-transform: uppercase;
}

.post-navigation .post-title {
	font-size: 16px;
	margin: 5px 0 0 0;
}

/* ==========================================================================
   Pagination
   ========================================================================== */

.pagination,
.navigation.pagination {
	margin: 30px 0;
	text-align: center;
}

.pagination .nav-links {
	display: flex;
	justify-content: center;
	align-items: center;
	flex-wrap: wrap;
	gap: 5px;
}

.pagination .page-numbers {
	display: inline-block;
	padding: 10px 15px;
	color: #a1a2a4;
	border: 1px solid #f0f0f0;
	border-radius: 3px;
	transition: all 0.3s ease;
}

.pagination a.page-numbers:hover,
.pagination .page-numbers.current {
	background-color: #398ffc;
	border-color: #398ffc;
	color: #ffffff;
}

.pagination .prev,
.pagination .next {
	color: #398ffc;
}

/* ==========================================================================
   Comments
   ========================================================================== */

.comments-area {
	margin-top: 30px;
	padding-top: 30px;
	border-top: 1px solid #f0f0f0;
}

.comments-title {
	font-size: 24px;
	margin-bottom: 30px;
}

.comment-list {
	list-style: none;
	padding: 0;
}

.comment-body {
	padding: 20px;
	background-color: #f9f9f9;
	border-radius: 5px;
	margin-bottom: 20px;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 10px;
}

.comment-author img {
	border-radius: 50%;
}

.comment-author .fn {
	font-weight: 500;
}

.comment-metadata {
	font-size: 12px;
	color: #a1a2a4;
}

.comment-content {
	margin-top: 15px;
}

.comment-reply-link {
	display: inline-block;
	margin-top: 10px;
	font-size: 12px;
	color: #398ffc;
}

/* Comment Form */
.comment-respond {
	margin-top: 30px;
}

.comment-reply-title {
	font-size: 24px;
	margin-bottom: 20px;
}

.comment-form label {
	display: block;
	margin-bottom: 5px;
	font-weight: 500;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 12px 15px;
	border: 1px solid #e0e0e0;
	border-radius: 3px;
	font-size: 14px;
	margin-bottom: 15px;
	transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
	outline: none;
	border-color: #398ffc;
}

.comment-form textarea {
	min-height: 150px;
	resize: vertical;
}

.comment-form .submit {
	padding: 12px 30px;
	background-color: #398ffc;
	color: #ffffff;
	border: none;
	border-radius: 3px;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.3s ease;
}

.comment-form .submit:hover {
	background-color: #2a7ae0;
}

/* ==========================================================================
   Responsive Fixes
   ========================================================================== */

/* Prevent horizontal scroll */
html, body {
	overflow-x: hidden;
	max-width: 100vw;
}

.site {
	overflow-x: hidden;
}

/* Mobile styles */
@media (max-width: 767px) {
	.container {
		padding-left: 15px;
		padding-right: 15px;
	}
	
	.row {
		margin-left: -10px;
		margin-right: -10px;
	}
	
	[class*="col-"] {
		padding-left: 10px;
		padding-right: 10px;
	}
	
	.site-header__wrap {
		padding: 10px 0;
	}
	
	.custom-logo {
		max-height: 40px;
	}
	
	.posts-list--grid {
		grid-template-columns: 1fr;
		gap: 20px;
	}
	
	.single .entry-title {
		font-size: 22px;
	}
	
	.post-author-bio {
		flex-direction: column;
		text-align: center;
	}
	
	.post-navigation .nav-links {
		flex-direction: column;
	}
	
	.post-navigation .nav-next {
		text-align: left;
	}
	
	/* Fix images overflow */
	img {
		max-width: 100%;
		height: auto;
	}
	
	/* Fix tables overflow */
	table {
		display: block;
		overflow-x: auto;
		max-width: 100%;
	}
	
	/* Fix iframes and embeds */
	iframe,
	embed,
	object,
	video {
		max-width: 100%;
	}
	
	/* Fix pre and code overflow */
	pre, code {
		max-width: 100%;
		overflow-x: auto;
		word-wrap: break-word;
	}
}

/* Tablet styles */
@media (min-width: 768px) and (max-width: 991px) {
	.posts-list--grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.screen-reader-text {
	clip: rect(1px, 1px, 1px, 1px);
	position: absolute !important;
	height: 1px;
	width: 1px;
	overflow: hidden;
	word-wrap: normal !important;
}

.screen-reader-text:focus {
	background-color: #f1f1f1;
	border-radius: 3px;
	box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6);
	clip: auto !important;
	color: #21759b;
	display: block;
	font-size: 14px;
	font-weight: bold;
	height: auto;
	left: 5px;
	line-height: normal;
	padding: 15px 23px 14px;
	text-decoration: none;
	top: 5px;
	width: auto;
	z-index: 100000;
}

.skip-link {
	background-color: #f1f1f1;
	color: #21759b;
	padding: 15px 23px 14px;
	position: absolute;
	left: -9999px;
	z-index: 999999;
}

.skip-link:focus {
	left: 6px;
	top: 7px;
}

/* Clear floats */
.clearfix::after {
	content: "";
	display: table;
	clear: both;
}

