/*
Theme Name: SPIN Community & Fitness
Theme URI: https://spininc.org
Author: Whitepenny
Description: Lightweight block theme for SPIN Community & Fitness. Fixed blue sidebar navigation, Montserrat typography, core blocks only.
Version: 1.0.0
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: spinfit
*/

/* ---------- Layout shell: sidebar + main column ---------- */

.spin-shell {
	display: flex;
	min-height: 100vh;
	min-height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
}

.spin-sidebar {
	flex: 0 0 var(--wp--custom--sidebar-width);
	width: var(--wp--custom--sidebar-width);
	position: sticky;
	top: var(--wp-admin--admin-bar--height, 0px);
	height: calc(100vh - var(--wp-admin--admin-bar--height, 0px));
	overflow-y: auto;
	background: var(--wp--preset--color--primary);
	color: var(--wp--preset--color--base);
	text-align: center;
}

.spin-main {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

.spin-content {
	flex: 1 0 auto;
}

/* ---------- Sidebar contents ---------- */

.spin-sidebar .wp-block-site-logo img {
	margin-inline: auto;
}

.spin-sidebar .wp-block-navigation .wp-block-navigation-item__content {
	padding: 0.7rem 1rem;
	transition: color 0.2s ease;
}

.spin-sidebar .wp-block-navigation .wp-block-navigation-item__content:hover,
.spin-sidebar .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content {
	color: rgba(255, 255, 255, 0.65);
}

.spin-sidebar .wp-block-navigation .current-menu-item {
	box-shadow: inset 3px 0 0 var(--wp--preset--color--base);
}

.spin-sidebar .wp-block-social-links .wp-social-link svg {
	width: 14px;
	height: 14px;
}

.spin-contact a {
	color: rgba(255, 255, 255, 0.85);
	text-decoration: none;
}

.spin-contact a:hover {
	color: var(--wp--preset--color--base);
}

.spin-contact-email a::before,
.spin-contact-phone a::before {
	content: "";
	display: inline-block;
	width: 0.85em;
	height: 0.85em;
	margin-right: 0.4em;
	vertical-align: -0.05em;
	background: currentColor;
	-webkit-mask: var(--spin-icon) center / contain no-repeat;
	mask: var(--spin-icon) center / contain no-repeat;
}

.spin-contact-email a::before {
	--spin-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M2 5h20v14H2z' fill='none'/%3E%3Cpath d='M2 6.5 12 13l10-6.5V5H2zM2 8.8V19h20V8.8l-10 6.5z'/%3E%3C/svg%3E");
}

.spin-contact-phone a::before {
	--spin-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6.6 10.8a15.1 15.1 0 0 0 6.6 6.6l2.2-2.2a1 1 0 0 1 1-.25 11.4 11.4 0 0 0 3.6.57 1 1 0 0 1 1 1V20a1 1 0 0 1-1 1A17 17 0 0 1 3 4a1 1 0 0 1 1-1h3.5a1 1 0 0 1 1 1c0 1.25.2 2.45.57 3.57a1 1 0 0 1-.25 1z'/%3E%3C/svg%3E");
}

/* ---------- Page title bar ---------- */

.spin-title-bar {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

/* ---------- Content helpers ---------- */

.spin-map iframe {
	display: block;
	width: 100%;
	max-width: 100%;
	height: 450px;
	border: 0;
}

/* ---------- Tablets: narrower sidebar ---------- */

@media (max-width: 960px) {
	.spin-shell {
		--wp--custom--sidebar-width: 230px;
	}

	.spin-sidebar .wp-block-site-logo img {
		width: 180px !important;
		height: auto;
	}
}

/* ---------- Phones: sidebar becomes a top bar (matches core nav overlay breakpoint) ---------- */

@media (max-width: 599px) {
	.spin-shell {
		flex-direction: column;
	}

	.spin-sidebar {
		position: relative;
		top: 0;
		width: auto;
		height: auto;
		flex-basis: auto;
		overflow: visible;
		z-index: 10;
	}

	.spin-sidebar .spin-sidebar-inner {
		flex-direction: row !important;
		justify-content: space-between !important;
		align-items: center !important;
		padding: 0.75rem 1rem !important;
		min-height: 0 !important;
	}

	.spin-sidebar .wp-block-site-logo {
		margin: 0 !important;
	}

	.spin-sidebar .wp-block-site-logo img {
		width: 140px !important;
		height: auto;
	}

	.spin-sidebar .spin-sidebar-extras {
		display: none;
	}

	.spin-sidebar .wp-block-navigation {
		margin: 0 !important;
	}

	.spin-sidebar .wp-block-navigation__responsive-container.is-menu-open {
		background: var(--wp--preset--color--primary) !important;
		color: var(--wp--preset--color--base) !important;
	}

	.spin-sidebar .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
		align-items: center;
		font-size: 1.25rem;
	}

	.spin-sidebar .wp-block-navigation .current-menu-item {
		box-shadow: none;
	}

	.spin-content .spin-title-bar,
	.spin-content .spin-page-body {
		padding-left: 1.25rem !important;
		padding-right: 1.25rem !important;
	}
}

/* Links inside headings keep the heading color */
:where(h1, h2, h3, h4, h5, h6) a {
	color: inherit;
}

/* ---------- Mindbody (HealCode) widgets ---------- */

healcode-widget input:not([type="checkbox"]):not([type="radio"]),
healcode-widget select {
	max-width: 100%;
}

@media (max-width: 599px) {
	healcode-widget table.hc_info,
	healcode-widget table.hc_info tbody,
	healcode-widget table.hc_info tr,
	healcode-widget table.hc_info th,
	healcode-widget table.hc_info td {
		display: block;
		width: 100% !important;
		text-align: left !important;
	}
}
