/*
Theme Name: xSolia
Theme URI: https://xsolia.com
Author: xSolia LLC
Description: Lightweight block theme for xSolia, a Texas-registered custom product sourcing and supply company. Works together with the xSolia Site plugin (pages, RFQ form, SEO).
Version: 1.0.1
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: xsolia
*/

/* ---------- Base ---------- */

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

body {
	text-rendering: optimizeLegibility;
	-webkit-font-smoothing: antialiased;
}

img,
svg {
	max-width: 100%;
	height: auto;
}

h1,
h2,
h3 {
	overflow-wrap: normal;
	word-break: normal;
	hyphens: manual;
	text-wrap: balance;
}

p,
li {
	text-wrap: pretty;
}

::selection {
	background: var(--wp--preset--color--copper);
	color: var(--wp--preset--color--white);
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 3px solid var(--wp--preset--color--copper);
	outline-offset: 3px;
	border-radius: 3px;
}

.skip-link.screen-reader-text:focus {
	background: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
	padding: 0.75rem 1rem;
	z-index: 100000;
}

/* ---------- Header ---------- */

/* The template part's own <header> element is the sticky box (its parent is the full page). */
.wp-site-blocks > header.wp-block-template-part {
	position: sticky;
	top: 0;
	z-index: 50;
}

.xs-header {
	/* Solid colour on purpose: backdrop-filter would trap the fixed mobile menu overlay inside the header. */
	background: var(--wp--preset--color--warm-white);
}

.admin-bar .wp-site-blocks > header.wp-block-template-part {
	top: var(--wp-admin--admin-bar--height, 32px);
}

@media (max-width: 600px) {
	.admin-bar .wp-site-blocks > header.wp-block-template-part {
		top: 0;
	}
}

.xs-logo {
	margin: 0;
	line-height: 0;
}

.xs-logo a {
	display: inline-block;
	padding-block: 4px;
}

.xs-logo img {
	height: auto;
	aspect-ratio: 2956 / 734;
}

@media (max-width: 599px) {
	.xs-header .xs-logo img {
		width: 120px !important;
	}
}

.xs-header .wp-block-navigation .wp-block-navigation-item__content {
	padding-block: 0.5rem;
}

.xs-header .wp-block-navigation-item.current-menu-item > a,
.xs-header .wp-block-navigation-item .wp-block-navigation-item__content[aria-current="page"] {
	text-decoration: underline;
	text-decoration-color: var(--wp--preset--color--copper);
	text-decoration-thickness: 2px;
	text-underline-offset: 0.45em;
}

.xs-header .wp-block-navigation__submenu-container {
	border: 1px solid var(--wp--preset--color--cool-gray) !important;
	border-radius: 8px;
	padding: 0.4rem !important;
	min-width: 230px !important;
	box-shadow: 0 12px 30px rgba(18, 35, 63, 0.10);
}

.xs-header .wp-block-navigation__responsive-container.is-menu-open {
	padding: 1.5rem 1.25rem;
}

.xs-header-cta .wp-block-button__link {
	white-space: nowrap;
}

/* Core switches to the menu button only below 600px; the full menu needs ~1100px. */
@media (max-width: 1100px) {
	.xs-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex !important;
	}

	.xs-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none !important;
	}

	.xs-header .is-menu-open .wp-block-navigation__responsive-container-close {
		display: flex !important;
	}

	.xs-header .is-menu-open .wp-block-navigation__submenu-container {
		position: static !important;
		opacity: 1 !important;
		visibility: visible !important;
		height: auto !important;
		width: auto !important;
	}

	.xs-header .is-menu-open .wp-block-navigation-submenu__toggle,
	.xs-header .is-menu-open .wp-block-navigation__submenu-icon {
		display: none !important;
	}
}

/* Request a Quote lives in the header button on desktop and inside the menu on smaller screens. */
.xs-header .xs-nav-rfq {
	display: none;
}

.xs-header .is-menu-open .xs-nav-rfq {
	display: block;
	margin-top: 0.75rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--wp--preset--color--cool-gray);
	width: 100%;
}

.xs-header .is-menu-open .xs-nav-rfq a {
	color: var(--wp--preset--color--copper-strong) !important;
	font-weight: 700;
}

.xs-header .is-menu-open .wp-block-navigation__responsive-container-content,
.xs-header .is-menu-open .wp-block-navigation__container,
.xs-header .is-menu-open .wp-block-navigation-item {
	align-items: flex-start !important;
	text-align: left;
}

.xs-header .is-menu-open .wp-block-navigation__submenu-container {
	border: 0 !important;
	box-shadow: none;
	padding: 0 0 0 1rem !important;
	min-width: 0 !important;
}

.xs-header .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	font-size: 1.125rem;
	padding-block: 0.6rem;
}

/* Touch targets */
.wp-block-navigation__responsive-container-open,
.wp-block-navigation__responsive-container-close {
	min-width: 44px;
	min-height: 44px;
	justify-content: center;
	align-items: center;
}

@media (max-width: 599px) {
	.xs-header-cta .wp-block-button__link {
		padding: 0.6rem 0.9rem !important;
		font-size: 0.875rem !important;
		min-height: 44px;
	}
}

/* ---------- Page sections ---------- */

.wp-block-post-content > .alignfull {
	margin-block: 0;
}

.xs-section {
	padding-block: var(--wp--preset--spacing--70);
}

.xs-section--tight {
	padding-block: var(--wp--preset--spacing--50);
}

.xs-section--hero {
	padding-top: var(--wp--preset--spacing--60);
	padding-bottom: var(--wp--preset--spacing--70);
}

.xs-section--top-line {
	border-top: 1px solid var(--wp--preset--color--cool-gray);
}

.xs-section-head {
	margin-bottom: var(--wp--preset--spacing--50) !important;
}

.xs-section-head > * {
	max-width: 46rem;
}

.xs-section-head h2 {
	margin-top: 0.4rem;
}

.xs-illus-hero img {
	aspect-ratio: 640 / 560;
	object-fit: contain;
}

.xs-illus-card img {
	aspect-ratio: 600 / 420;
	object-fit: cover;
}

.xs-card-link {
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 700;
	margin-top: auto !important;
}

.xs-card-link a {
	display: inline-block;
	padding-block: 0.5rem;
	text-decoration: none;
}

.xs-card-link a:hover {
	text-decoration: underline;
}

.xs-tag {
	display: inline-block;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--wp--preset--color--slate);
	background: var(--wp--preset--color--mist);
	border-radius: 999px;
	padding: 0.2rem 0.7rem;
}

.xs-rfq-layout .is-style-card h2,
.xs-rfq-layout .is-style-card h3 {
	margin-top: 0;
}

@media (min-width: 782px) {
	.xs-sticky {
		position: sticky;
		top: 6.5rem;
	}
}

/* ---------- Typography helpers ---------- */

.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--manrope);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: var(--wp--preset--color--copper-strong);
}

.has-navy-background-color .is-style-eyebrow,
.has-graphite-background-color .is-style-eyebrow {
	color: #F0A27F;
}

.xs-lead {
	font-size: var(--wp--preset--font-size--medium);
	line-height: 1.6;
	color: var(--wp--preset--color--slate);
	max-width: 46rem;
}

.has-navy-background-color .xs-lead,
.has-graphite-background-color .xs-lead {
	color: #D5DBE4;
}

.xs-note {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--slate);
}

/* ---------- Cards & panels ---------- */

.is-style-card {
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--cool-gray);
	border-radius: 12px;
	padding: clamp(1.25rem, 2.5vw, 2rem);
	height: 100%;
}

.wp-block-group.is-style-card {
	display: flex;
	flex-direction: column;
}

.is-style-card > :first-child {
	margin-top: 0;
}

.is-style-card > .xs-illustration {
	margin-bottom: 0.5rem;
}

.is-style-outline-panel {
	border: 1px solid var(--wp--preset--color--cool-gray);
	border-radius: 12px;
	padding: clamp(1.25rem, 2.5vw, 2rem);
}

.wp-block-columns.xs-equal > .wp-block-column {
	display: flex;
	flex-direction: column;
}

.wp-block-columns.xs-equal > .wp-block-column > .is-style-card {
	flex: 1;
}

/* Trust bar */
.xs-trust {
	border-top: 1px solid var(--wp--preset--color--cool-gray);
	border-bottom: 1px solid var(--wp--preset--color--cool-gray);
}

.xs-trust p {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	margin: 0;
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 700;
	color: var(--wp--preset--color--navy);
}

.xs-trust p::before {
	content: "";
	flex: 0 0 auto;
	width: 0.6rem;
	height: 0.6rem;
	background: var(--wp--preset--color--copper);
	transform: rotate(45deg);
}

/* Capability / step numbers */
.xs-kicker {
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 800;
	font-size: 0.85rem;
	letter-spacing: 0.08em;
	color: var(--wp--preset--color--copper-strong);
	margin-bottom: 0.4rem !important;
}

.has-navy-background-color .xs-kicker {
	color: #F0A27F;
}

.xs-steps {
	counter-reset: xs-step;
}

.xs-step {
	position: relative;
	border-top: 2px solid var(--wp--preset--color--navy);
	padding-top: 1.1rem;
}

.has-navy-background-color .xs-step {
	border-top-color: #F0A27F;
}

/* Checklist */
.is-style-checklist {
	list-style: none;
	padding-left: 0;
}

.is-style-checklist li {
	position: relative;
	padding-left: 1.9rem;
	margin-bottom: 0.65rem;
}

.is-style-checklist li::before {
	content: "";
	position: absolute;
	left: 0.15rem;
	top: 0.38em;
	width: 0.95rem;
	height: 0.55rem;
	border-left: 2.5px solid var(--wp--preset--color--copper-strong);
	border-bottom: 2.5px solid var(--wp--preset--color--copper-strong);
	transform: rotate(-45deg);
}

.has-navy-background-color .is-style-checklist li::before {
	border-color: #F0A27F;
}

/* Illustrations */
.xs-illustration img {
	border-radius: 14px;
	display: block;
	width: 100%;
}

.xs-illustration figcaption {
	font-size: 0.8125rem;
	color: var(--wp--preset--color--slate);
	margin-top: 0.6rem;
	text-align: left;
}

/* FAQ (core/details) */
.wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--cool-gray);
	padding: 0;
	margin: 0 !important;
}

.wp-block-details summary {
	cursor: pointer;
	list-style: none;
	padding: 1.15rem 2.5rem 1.15rem 0;
	position: relative;
	font-family: var(--wp--preset--font-family--manrope);
	font-weight: 700;
	font-size: 1.0625rem;
	color: var(--wp--preset--color--navy);
}

.wp-block-details summary::-webkit-details-marker {
	display: none;
}

.wp-block-details summary::after {
	content: "";
	position: absolute;
	right: 0.4rem;
	top: 50%;
	width: 0.6rem;
	height: 0.6rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: translateY(-70%) rotate(45deg);
	transition: transform 0.2s ease;
}

.wp-block-details[open] summary::after {
	transform: translateY(-25%) rotate(-135deg);
}

.wp-block-details > :not(summary) {
	margin-top: 0;
	padding-bottom: 1.15rem;
	max-width: 52rem;
}

.xs-faq {
	border-top: 1px solid var(--wp--preset--color--cool-gray);
}

/* Buttons */
.wp-block-button__link {
	min-height: 48px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.wp-block-button__link:active {
	transform: translateY(1px);
}

.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 2px solid currentColor;
	background: transparent;
}

.wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--navy);
	border-color: var(--wp--preset--color--navy);
	color: var(--wp--preset--color--white);
}

.has-navy-background-color .wp-block-button.is-style-outline > .wp-block-button__link {
	color: var(--wp--preset--color--white);
}

.has-navy-background-color .wp-block-button.is-style-outline > .wp-block-button__link:hover {
	background: var(--wp--preset--color--white);
	border-color: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy);
}

.wp-block-button.is-style-accent > .wp-block-button__link {
	background: var(--wp--preset--color--copper-strong);
	color: var(--wp--preset--color--white);
}

.wp-block-button.is-style-accent > .wp-block-button__link:hover {
	background: #9A4522;
}

.has-navy-background-color .wp-block-button:not(.is-style-outline):not(.is-style-accent) > .wp-block-button__link {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy);
}

/* Links on dark */
.has-navy-background-color a:not(.wp-block-button__link),
.has-graphite-background-color a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--white);
}

/* Hero texture */
.xs-hero {
	position: relative;
	overflow: hidden;
}

.xs-hero::after {
	content: "";
	position: absolute;
	inset: auto -10% -1px -10%;
	height: 1px;
	background: var(--wp--preset--color--cool-gray);
}

.xs-grid-bg {
	background-image:
		linear-gradient(rgba(18, 35, 63, 0.05) 1px, transparent 1px),
		linear-gradient(90deg, rgba(18, 35, 63, 0.05) 1px, transparent 1px);
	background-size: 32px 32px;
}

/* Disclosure strip */
.xs-disclosure {
	border-left: 4px solid var(--wp--preset--color--copper);
	padding-left: 1.25rem;
}

/* Tables */
.wp-block-table table {
	border-collapse: collapse;
	width: 100%;
	font-size: 0.975rem;
}

.wp-block-table th,
.wp-block-table td {
	border: 1px solid var(--wp--preset--color--cool-gray);
	padding: 0.75rem 0.9rem;
	text-align: left;
	vertical-align: top;
}

.wp-block-table thead th {
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--navy);
	font-family: var(--wp--preset--font-family--manrope);
}

@media (max-width: 600px) {
	.wp-block-table {
		overflow-x: auto;
	}
}

/* Footer */
.xs-footer a {
	color: #E6EAF0;
	text-decoration: none;
}

.xs-footer a:hover {
	color: var(--wp--preset--color--white);
	text-decoration: underline;
}

.xs-footer .xs-footer-links {
	list-style: none;
	padding: 0;
	margin: 0;
}

.xs-footer .xs-footer-links li {
	margin-bottom: 0.55rem;
}

.xs-footer .xs-footer-heading {
	font-family: var(--wp--preset--font-family--manrope);
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: #F0A27F;
}

.xs-footer .xs-footer-bottom {
	border-top: 1px solid rgba(217, 222, 229, 0.18);
	color: #D5DBE4;
}

.xs-footer .xs-footer-legal {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.25rem;
}

.xs-footer .xs-footer-legal li {
	margin: 0;
}

.xs-footer .xs-contact-list {
	list-style: none;
	padding: 0;
	margin: 0;
}

.xs-footer .xs-contact-list li {
	margin-bottom: 0.55rem;
}

.xs-footer .xs-contact-list span,
.xs-footer .xs-location {
	display: block;
	color: #D5DBE4;
	font-size: 0.875rem;
}



/* Legal page body */
.xs-legal h2 {
	margin-top: 2.5rem;
}

/* ---------- Motion ---------- */

@media (prefers-reduced-motion: no-preference) {
	.xs-hero .xs-hero-copy > * {
		animation: xs-rise 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
	}

	.xs-hero .xs-hero-copy > *:nth-child(2) { animation-delay: 0.05s; }
	.xs-hero .xs-hero-copy > *:nth-child(3) { animation-delay: 0.1s; }
	.xs-hero .xs-hero-copy > *:nth-child(4) { animation-delay: 0.15s; }

	.wp-block-button__link:hover {
		transform: translateY(-1px);
	}
}

/* Movement only: text is never hidden, so it is visible to every visitor and counts for LCP immediately. */
@keyframes xs-rise {
	from {
		transform: translateY(8px);
	}
	to {
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* Template parts sit flush against main content. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}
