/*
Theme Name:   Hive Framework
Theme URI:    https://buzzdash.co.uk
Author:       Buzz Website Solutions
Author URI:   https://buzzdash.co.uk
Description:  A lightweight, hook-driven parent theme (Genesis-style) that provides the structural skeleton — header, content area, footer — via WordPress action hooks. A clean white base with sample demo content out of the box. Designed to be paired with the HiveBlocks plugin (Hero, Text, Columns, CTA blocks + patterns), but falls back to normal the_content() when no blocks are present, so it works standalone too.
Version:      2.1.0
Requires at least: 6.0
Requires PHP: 7.4
Tested up to: 6.7
License:      GPL v2 or later
License URI:  https://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  hive-framework
*/

/* ==========================================================================
   1. Reset / base
   ========================================================================== */

/* Fallback if inc/customizer.php's inline <style> hasn't printed yet
   (e.g. this file loaded standalone) — normally overridden per-site by
   the Customizer's Accent Colour setting. Child themes can override
   this variable in their own stylesheet instead of hunting for colour
   hex codes throughout this file. */
:root {
	--hive-accent: #b8860b;
	--hive-accent-hover: #96700a;
	--hive-header-bg: #ffffff;
	--hive-header-text: #1a1a1a;
	--hive-footer-bg: #ffffff;
	--hive-footer-text: #666666;
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	line-height: 1.6;
	color: #1a1a1a;
	background: #ffffff;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var( --hive-accent );
	text-decoration: none;
}

a:hover,
a:focus {
	text-decoration: underline;
}

/* ==========================================================================
   2. Structural wrappers output by inc/hooks.php
   ========================================================================== */
.site-header {
	background: var( --hive-header-bg );
	color: var( --hive-header-text );
	padding: 1rem 0;
	border-bottom: 1px solid #e5e5e5;
}

/* Editable via Customizer > Header > Sticky Header. */
.has-sticky-header .site-header {
	position: sticky;
	top: 0;
	z-index: 200;
}

.site-header .wrap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
}

.site-header a {
	color: var( --hive-header-text );
}

.site-branding .custom-logo {
	display: block;
	height: auto;
	max-width: 100%;
}

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

.nav-primary ul {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem;
	margin: 0;
	padding: 0;
}

.nav-primary-menu a {
	display: inline-block;
	padding: 0.25rem 0;
	border-bottom: 2px solid transparent;
}

.nav-primary-menu a:hover,
.nav-primary-menu a:focus,
.nav-primary-menu .current-menu-item > a {
	color: var( --hive-accent );
	border-bottom-color: var( --hive-accent );
	text-decoration: none;
}

.nav-primary-menu ul {
	list-style: none;
	margin: 0;
	padding-left: 1rem;
}

/* Hamburger toggle — hidden on desktop, shown below the mobile breakpoint. */
.menu-toggle {
	display: none;
	flex-direction: column;
	justify-content: center;
	gap: 5px;
	width: 40px;
	height: 40px;
	padding: 0;
	background: none;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	cursor: pointer;
}

.menu-toggle-bar {
	display: block;
	width: 20px;
	height: 2px;
	margin: 0 auto;
	background: var( --hive-header-text );
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(1) {
	transform: translateY(7px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(2) {
	opacity: 0;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-bar:nth-child(3) {
	transform: translateY(-7px) rotate(-45deg);
}

@media ( max-width: 782px ) {
	.site-header .wrap {
		position: relative;
	}

	.menu-toggle {
		display: flex;
		order: 2;
		margin-left: auto;
	}

	.nav-primary {
		order: 3;
		flex-basis: 100%;
		display: none;
	}

	.nav-primary.is-open {
		display: block;
	}

	.nav-primary-menu {
		flex-direction: column;
		gap: 0;
		padding: 0.5rem 0 1rem;
	}

	.nav-primary-menu li {
		width: 100%;
	}

	.nav-primary-menu a {
		display: block;
		padding: 0.6rem 0;
		border-bottom: 1px solid #f0f0f0;
	}

	.nav-primary-menu ul {
		padding-left: 1rem;
	}
}

.content-area {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
	background: #ffffff;
}

/* Two-column layout used when a template pairs .content-area with a
   sidebar inside .content-wrap (see index.php + hive_do_sidebar()). */
.content-wrap {
	display: flex;
	align-items: flex-start;
	gap: 2.5rem;
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px;
}

.content-wrap .content-area {
	flex: 1 1 0%;
	min-width: 0;
	max-width: none;
	margin: 0;
	padding: 0;
}

.widget-area {
	flex: 0 0 300px;
}

.widget-area .widget {
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid #e5e5e5;
}

.widget-area .widget:last-child {
	border-bottom: none;
}

.widget-area .widget-title {
	font-size: 1.05rem;
	margin: 0 0 0.75rem;
}

.widget-area ul {
	margin: 0;
	padding-left: 1.1rem;
}

@media ( max-width: 782px ) {
	.content-wrap {
		flex-direction: column;
	}

	.widget-area {
		flex-basis: auto;
		width: 100%;
	}

	.footer-columns-2 .footer-widgets,
	.footer-columns-3 .footer-widgets,
	.footer-columns-4 .footer-widgets {
		grid-template-columns: 1fr;
	}
}

/* Tablet breakpoint: ease a 3-4 column footer down to 2 columns before it
   gets cramped, rather than jumping straight from 4 to 1 at 782px. */
@media ( max-width: 1024px ) and ( min-width: 783px ) {
	.footer-columns-3 .footer-widgets,
	.footer-columns-4 .footer-widgets {
		grid-template-columns: repeat( 2, 1fr );
	}
}

.site-footer {
	background: var( --hive-footer-bg );
	color: var( --hive-footer-text );
	padding: 2rem 0;
	margin-top: 3rem;
	border-top: 1px solid #e5e5e5;
}

.site-footer .wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 20px;
	font-size: 0.875rem;
}

.site-footer a {
	color: inherit;
}

/* Footer widget area — column count editable via
   Customizer > Footer > Footer Widget Columns (adds a
   .footer-columns-N body class; see inc/customizer.php). Falls back to a
   single responsive column below the mobile breakpoint regardless of the
   chosen setting, so a 3-4 column footer never gets cramped on a phone. */
.footer-widgets {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	margin-bottom: 2rem;
	text-align: left;
}

.footer-columns-2 .footer-widgets {
	grid-template-columns: repeat( 2, 1fr );
}

.footer-columns-3 .footer-widgets {
	grid-template-columns: repeat( 3, 1fr );
}

.footer-columns-4 .footer-widgets {
	grid-template-columns: repeat( 4, 1fr );
}

.site-footer .site-credit {
	text-align: center;
}

.footer-widget-title {
	font-size: 1rem;
	margin: 0 0 0.5rem;
}

/* Generic button styling — covers core/button blocks and any plain
   <a class="button"> markup output by plugins (e.g. HiveCore's
   dashboard widget uses this same class in wp-admin). */
.button,
.wp-block-button__link {
	display: inline-block;
	padding: 0.65rem 1.4rem;
	background: var( --hive-accent );
	color: #ffffff;
	font-weight: 600;
	border-radius: 4px;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: background-color 0.15s ease;
}

.button:hover,
.button:focus,
.wp-block-button__link:hover,
.wp-block-button__link:focus {
	background: var( --hive-accent-hover );
	color: #ffffff;
	text-decoration: none;
}

.button:focus-visible,
.wp-block-button__link:focus-visible {
	outline: 2px solid #1a1a1a;
	outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	background: #1a1a1a;
	color: #fff;
	padding: 10px 16px;
	z-index: 100000;
}

.skip-link:focus {
	left: 10px;
	top: 10px;
}

/* Visually hidden but still readable by screen readers/assistive tech. */
.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* ==========================================================================
   3. Basic demo-content polish
   ========================================================================== */
.entry-title {
	font-size: clamp( 1.5rem, 1.1rem + 1.8vw, 2rem );
	margin: 0 0 1.5rem;
}

/* ==========================================================================
   4. Layout width variants (Customizer: Site Width)
   Body classes set by hive_framework_layout_body_class() in
   inc/customizer.php. Only .content-area/.content-wrap/.site-header/
   .site-footer .wrap need to change — they all share the same
   max-width today, so the selector list stays short.
   ========================================================================== */
.layout-wide .site-header .wrap,
.layout-wide .content-area,
.layout-wide .content-wrap,
.layout-wide .site-footer .wrap {
	max-width: 1400px;
}

.layout-fluid .site-header .wrap,
.layout-fluid .content-area,
.layout-fluid .content-wrap,
.layout-fluid .site-footer .wrap {
	max-width: none;
}

/* ==========================================================================
   5. Blog / archive / search entries (template-parts/content.php)
   ========================================================================== */
.hive-entry {
	margin-bottom: 3rem;
	padding-bottom: 3rem;
	border-bottom: 1px solid #e5e5e5;
}

.hive-entry:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.hive-entry .entry-thumbnail {
	margin-bottom: 1rem;
}

.hive-entry .entry-thumbnail img {
	border-radius: 6px;
}

.entry-meta {
	color: #666666;
	font-size: 0.9rem;
	margin-bottom: 0.75rem;
}

.entry-meta .byline {
	margin-left: 0.35rem;
}

.entry-footer {
	margin-top: 1.5rem;
	padding-top: 1rem;
	border-top: 1px solid #e5e5e5;
	color: #666666;
	font-size: 0.9rem;
}

.entry-footer > span {
	margin-right: 1rem;
}

.read-more {
	margin-top: 1rem;
}

.page-links {
	margin-top: 1.5rem;
	font-weight: 600;
}

/* ==========================================================================
   6. Archive / search / 404 page headers (hive_archive_header())
   ========================================================================== */
.page-header {
	margin-bottom: 2rem;
	padding-bottom: 1.5rem;
	border-bottom: 1px solid #e5e5e5;
}

.page-title {
	font-size: clamp( 1.4rem, 1.15rem + 1.1vw, 1.75rem );
	margin: 0 0 0.5rem;
}

.archive-description {
	color: #666666;
}

.no-results p,
.error-404 p {
	margin-bottom: 1.25rem;
}

/* ==========================================================================
   7. Search form (searchform.php)
   ========================================================================== */
.hive-search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 480px;
	margin: 1.5rem 0;
}

.hive-search-form .search-field {
	flex: 1 1 auto;
	min-width: 0;
	padding: 0.6rem 0.85rem;
	border: 1px solid #d5d5d5;
	border-radius: 4px;
	font-size: 1rem;
}

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

.hive-search-form .search-submit {
	flex: 0 0 auto;
}

/* ==========================================================================
   8. Pagination (hive_pagination(), hive_post_navigation())
   ========================================================================== */
.hive-pagination {
	margin-top: 2.5rem;
	display: flex;
	justify-content: center;
}

.hive-pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
}

.hive-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.25rem;
	height: 2.25rem;
	padding: 0 0.6rem;
	border: 1px solid #e5e5e5;
	border-radius: 4px;
	color: #1a1a1a;
	text-decoration: none;
}

.hive-pagination .page-numbers.current {
	background: var( --hive-accent );
	border-color: var( --hive-accent );
	color: #ffffff;
}

.hive-pagination .page-numbers:hover:not(.current) {
	border-color: var( --hive-accent );
}

.post-navigation {
	display: flex;
	justify-content: space-between;
	gap: 1.5rem;
	margin-top: 2.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid #e5e5e5;
}

.post-navigation .nav-links {
	display: flex;
	justify-content: space-between;
	width: 100%;
	gap: 1.5rem;
}

.post-navigation .nav-next {
	text-align: right;
	margin-left: auto;
}

.post-navigation .nav-subtitle {
	display: block;
	font-size: 0.8rem;
	color: #666666;
	text-transform: uppercase;
	letter-spacing: 0.03em;
}

.post-navigation .nav-title {
	font-weight: 600;
}

/* ==========================================================================
   9. Comments (comments.php)
   ========================================================================== */
.comments-area {
	margin-top: 3rem;
	padding-top: 2rem;
	border-top: 1px solid #e5e5e5;
}

.comments-title {
	font-size: 1.4rem;
	margin: 0 0 1.5rem;
}

.comment-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.comment-list .children {
	list-style: none;
	margin: 1.5rem 0 0;
	padding: 0 0 0 2rem;
}

.comment-body {
	margin-bottom: 2rem;
	padding-bottom: 2rem;
	border-bottom: 1px solid #e5e5e5;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
}

.comment-author .avatar {
	border-radius: 50%;
}

.comment-author .fn {
	font-weight: 600;
	font-style: normal;
}

.comment-metadata {
	font-size: 0.85rem;
	color: #666666;
}

.comment-metadata a {
	color: inherit;
}

.comment-reply-link {
	font-size: 0.85rem;
	font-weight: 600;
}

.comment-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 0.6rem 0.85rem;
	border: 1px solid #d5d5d5;
	border-radius: 4px;
	font-family: inherit;
	font-size: 1rem;
	margin-bottom: 1rem;
}

.comment-form textarea {
	min-height: 140px;
}

/* ==========================================================================
   Accessibility — visible-focus-for-keyboard-users-only
   Paired with assets/js/a11y.js (HiveFramework\Accessibility\A11yLoader),
   which adds/removes .hive-user-is-tabbing on <body> depending on whether
   the visitor is currently navigating by keyboard or mouse.
   ========================================================================== */
body:not(.hive-user-is-tabbing) a:focus,
body:not(.hive-user-is-tabbing) button:focus,
body:not(.hive-user-is-tabbing) input:focus,
body:not(.hive-user-is-tabbing) textarea:focus,
body:not(.hive-user-is-tabbing) select:focus {
	outline: none;
}

body.hive-user-is-tabbing a:focus,
body.hive-user-is-tabbing button:focus,
body.hive-user-is-tabbing input:focus,
body.hive-user-is-tabbing textarea:focus,
body.hive-user-is-tabbing select:focus {
	outline: 2px solid var( --hive-accent, #2271b1 );
	outline-offset: 2px;
}
