/**
 * Hydrasearch components.
 *
 * Reusable, token-driven pieces shared across templates. Every value here comes
 * from tokens.css - no raw hex, no magic numbers.
 *
 * These rules carry NO !important. They are written for clean markup, so when a
 * template still has an inline style="" attribute the fix is to remove it from
 * the template, not to escalate here. Anything that genuinely must out-rank the
 * parent theme lives in a clearly marked "legacy overrides" block in the page
 * stylesheet that needs it.
 *
 * Naming: .hs-block, .hs-block__element, .hs-block--modifier
 */

/* ============================================================== buttons === */

.hs-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--hs-space-2);
	height: var(--hs-control-h);
	padding: 0 var(--hs-space-7);
	font-family: var(--hs-font-head);
	font-size: var(--hs-text-lg);
	font-weight: 400;
	line-height: 1;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	border: var(--hs-border);
	border-radius: var(--hs-radius-pill);
	cursor: pointer;
	transition:
		background var(--hs-fast) var(--hs-ease),
		border-color var(--hs-fast) var(--hs-ease),
		color var(--hs-fast) var(--hs-ease),
		transform var(--hs-fast) var(--hs-ease),
		box-shadow var(--hs-fast) var(--hs-ease);
}

.hs-btn:focus-visible {
	outline: none;
	box-shadow: var(--hs-ring);
}

.hs-btn[disabled],
.hs-btn[aria-disabled="true"] {
	opacity: .5;
	cursor: not-allowed;
}

/* Primary: the single most important action on the view. */
.hs-btn--primary {
	min-width: 200px;
	color: var(--hs-surface);
	background: var(--hs-navy);
	border-color: transparent;
	box-shadow: var(--hs-shadow-lg);
}

.hs-btn--primary:hover {
	color: var(--hs-surface);
	background: var(--hs-accent);
	transform: translateY(-1px);
}

.hs-btn--primary:focus-visible {
	box-shadow: var(--hs-ring), var(--hs-shadow-lg);
}

/* Secondary: supporting actions that sit beneath the primary one. */
.hs-btn--ghost {
	font-size: var(--hs-text-md);
	color: var(--hs-navy);
	background: var(--hs-surface);
	border-color: var(--hs-line);
	height: var(--hs-control-h-sm);
	padding: 0 var(--hs-space-5);
}

.hs-btn--ghost:hover {
	color: var(--hs-accent);
	background: var(--hs-surface-soft);
	border-color: rgba(0, 124, 186, .5);
	border-color: color-mix(in srgb, var(--hs-accent) 50%, transparent);
}

.hs-btn--ghost .hs-btn__icon {
	width: 20px;
	height: auto;
	opacity: .75;
}

/* Round icon-only control, used for gallery paging. */
.hs-btn--round {
	width: var(--hs-control-h-sm);
	height: var(--hs-control-h-sm);
	min-width: 0;
	padding: 0;
	display: grid;
	place-items: center;
	color: var(--hs-navy);
	background: rgba(255, 255, 255, .92);
	border-radius: var(--hs-radius-circle);
	box-shadow: var(--hs-shadow-sm);
}

.hs-btn--round:hover {
	color: var(--hs-surface);
	background: var(--hs-navy);
	border-color: var(--hs-navy);
}

.hs-btn--round svg {
	width: 20px;
	height: 20px;
	pointer-events: none;
}

.hs-btn--block {
	width: 100%;
}

/* ================================================================ cards === */

.hs-card {
	background: var(--hs-surface);
	border: var(--hs-border);
	border-radius: var(--hs-radius-lg);
	box-shadow: var(--hs-shadow-xs);
}

.hs-card--soft {
	background: var(--hs-surface-soft);
	border-radius: var(--hs-radius-md);
	box-shadow: none;
}

.hs-card--pad {
	padding: var(--hs-space-5) var(--hs-space-6);
}

/* ============================================================== eyebrow === */

.hs-eyebrow {
	display: block;
	font-family: var(--hs-font-head);
	font-size: var(--hs-text-xs);
	line-height: 1;
	letter-spacing: var(--hs-tracking-wider);
	text-transform: uppercase;
	color: var(--hs-muted);
}

/* ======================================================= section titles === */

.hs-section-title {
	position: relative;
	font-family: var(--hs-font-head);
	font-size: var(--hs-text-xl);
	line-height: var(--hs-leading-tight);
	color: var(--hs-navy);
	padding-bottom: var(--hs-space-3);
	margin-bottom: var(--hs-space-6);
}

.hs-section-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 52px;
	height: 3px;
	border-radius: 2px;
	background: var(--hs-accent);
}

/* ================================================================ chips === */

.hs-chips {
	display: flex;
	flex-wrap: wrap;
	gap: var(--hs-space-2);
	margin: 0;
	padding: 0;
	list-style: none;
}

.hs-chip {
	font-family: var(--hs-font-body);
	font-size: var(--hs-text-sm);
	line-height: 1;
	color: var(--hs-navy);
	background: var(--hs-surface-soft);
	border: var(--hs-border);
	border-radius: var(--hs-radius-pill);
	padding: 7px 13px;
	white-space: nowrap;
}

/* ================================================== quantity / stepper === */

.hs-qty {
	display: inline-flex;
	align-items: stretch;
	height: var(--hs-control-h);
	background: var(--hs-surface);
	border: var(--hs-border);
	border-radius: var(--hs-radius-pill);
	overflow: hidden;
}

.hs-qty__btn {
	width: 46px;
	flex: 0 0 auto;
	padding: 0;
	font-family: var(--hs-font-head);
	font-size: 20px;
	line-height: 1;
	color: var(--hs-navy);
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: background var(--hs-fast) var(--hs-ease), color var(--hs-fast) var(--hs-ease);
}

.hs-qty__btn:hover {
	background: var(--hs-surface-soft);
	color: var(--hs-accent);
}

.hs-qty__btn:focus-visible {
	outline: none;
	background: var(--hs-surface-soft);
	box-shadow: inset 0 0 0 2px var(--hs-accent);
}

.hs-qty__field {
	width: 56px;
	align-self: stretch;
	padding: 0;
	margin: 0;
	text-align: center;
	font-family: var(--hs-font-body);
	font-size: var(--hs-text-lg);
	/* normal, so the browser keeps the digit optically centred at any height */
	line-height: normal;
	color: var(--hs-navy);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.hs-qty__field:focus {
	outline: none;
	box-shadow: none;
}

/* The native spinner is a second set of up/down controls beside ours, and it
   reserves width that pushes the digit off centre. */
.hs-qty__field::-webkit-outer-spin-button,
.hs-qty__field::-webkit-inner-spin-button {
	-webkit-appearance: none;
	appearance: none;
	display: none;
	margin: 0;
}

/* =============================================================== tables === */

.hs-table {
	width: 100%;
	margin: 0;
	border-collapse: separate;
	border-spacing: 0;
	border: var(--hs-border);
	border-radius: var(--hs-radius-md);
	overflow: hidden;
	font-family: var(--hs-font-body);
	font-size: var(--hs-text-base);
}

.hs-table th,
.hs-table td {
	padding: 13px 18px;
	border: 0;
	border-bottom: var(--hs-border);
	vertical-align: middle;
	color: var(--hs-text);
	background: transparent;
}

.hs-table tr:last-child th,
.hs-table tr:last-child td {
	border-bottom: 0;
}

.hs-table thead th {
	font-family: var(--hs-font-head);
	font-size: var(--hs-text-sm);
	line-height: 1.2;
	letter-spacing: var(--hs-tracking-wide);
	text-transform: uppercase;
	color: var(--hs-surface);
	background: var(--hs-navy);
	white-space: nowrap;
}

.hs-table tbody tr:nth-child(odd) td {
	background: var(--hs-surface);
}

.hs-table tbody tr:nth-child(even) td {
	background: var(--hs-surface-alt);
}

.hs-table tbody tr:hover td {
	background: var(--hs-surface-soft);
}

/* Two-column key/value form of the table. */
.hs-table--kv tbody td:first-child {
	font-weight: 600;
	color: var(--hs-navy);
	width: 42%;
}

/* =============================================================== meta list === */

.hs-meta-list {
	display: grid;
	grid-template-columns: minmax(0, auto) minmax(0, 1fr);
	margin: 0;
}

.hs-meta-list dt,
.hs-meta-list dd {
	margin: 0;
	padding: 9px 0;
	font-family: var(--hs-font-body);
	font-size: var(--hs-text-base);
	line-height: var(--hs-leading-snug);
	border-top: 1px solid rgba(0, 37, 77, .08);
	border-top: 1px solid color-mix(in srgb, var(--hs-navy) 8%, transparent);
}

.hs-meta-list > dt:first-of-type,
.hs-meta-list > dt:first-of-type + dd {
	border-top: 0;
}

.hs-meta-list dt {
	color: var(--hs-muted);
	padding-right: var(--hs-space-7);
	white-space: nowrap;
}

.hs-meta-list dd {
	color: var(--hs-navy);
	font-weight: 600;
	text-align: right;
}

/* ============================================================= callouts === */

.hs-callout {
	width: 100%;
	padding: var(--hs-space-4) var(--hs-space-5);
	border: var(--hs-border);
	border-radius: var(--hs-radius-sm);
	font-family: var(--hs-font-body);
	font-size: var(--hs-text-base);
	line-height: var(--hs-leading-normal);
}

.hs-callout--warn {
	background: var(--hs-warn-bg);
	border-color: var(--hs-warn-line);
	border-left: 4px solid var(--hs-warn-rule);
	color: var(--hs-warn-text);
}

.hs-callout--warn strong {
	color: #8a5a00;
}

/* ============================================================ text link === */

.hs-link {
	display: inline-block;
	font-family: var(--hs-font-head);
	font-size: var(--hs-text-sm);
	line-height: 1;
	color: var(--hs-accent);
	text-decoration: none;
	border-bottom: 1px solid currentColor;
	padding-bottom: 2px;
	transition: color var(--hs-fast) var(--hs-ease);
}

.hs-link:hover {
	color: var(--hs-navy);
}

/* ========================================================== sticky bar === */

.hs-stickybar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: var(--hs-z-sticky);
	padding: var(--hs-space-3) 0;
	background: var(--hs-surface);
	border-top: var(--hs-border);
	box-shadow: var(--hs-shadow-up);
	transform: translateY(105%);
	visibility: hidden;
	transition: transform var(--hs-med) var(--hs-ease);
}

.hs-stickybar.is-visible {
	transform: none;
	visibility: visible;
}

.hs-stickybar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--hs-space-5);
	max-width: var(--hs-container);
	margin: 0 auto;
	padding: 0 var(--hs-space-5);
}

.hs-stickybar__title {
	margin: 0;
	font-family: var(--hs-font-head);
	font-size: var(--hs-text-lg);
	line-height: 1.2;
	color: var(--hs-navy);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.hs-stickybar__actions {
	display: flex;
	align-items: center;
	gap: var(--hs-space-3);
	flex: 0 0 auto;
}

/* =========================================================== lightbox === */

.hs-lightbox {
	position: fixed;
	inset: 0;
	z-index: var(--hs-z-overlay);
	display: grid;
	place-items: center;
	padding: 4vmin;
	background: rgba(0, 20, 45, .82);
	opacity: 0;
	transition: opacity var(--hs-fast) var(--hs-ease);
}

.hs-lightbox.is-open {
	opacity: 1;
}

.hs-lightbox__img {
	max-width: 100%;
	max-height: 92vh;
	border-radius: var(--hs-space-2);
	background: var(--hs-surface);
	box-shadow: var(--hs-shadow-overlay);
}

.hs-lightbox__close {
	position: absolute;
	top: var(--hs-space-4);
	right: var(--hs-space-4);
	width: var(--hs-control-h-sm);
	height: var(--hs-control-h-sm);
	display: grid;
	place-items: center;
	color: var(--hs-surface);
	background: rgba(255, 255, 255, .12);
	border: 0;
	border-radius: var(--hs-radius-circle);
	cursor: pointer;
	transition: background var(--hs-fast) var(--hs-ease);
}

.hs-lightbox__close:hover {
	background: rgba(255, 255, 255, .24);
}

.hs-lightbox__cap {
	position: absolute;
	left: 0;
	right: 0;
	bottom: var(--hs-space-4);
	text-align: center;
	font-family: var(--hs-font-body);
	font-size: var(--hs-text-base);
	line-height: var(--hs-leading-snug);
	color: rgba(255, 255, 255, .82);
}

body.hs-lightbox-open {
	overflow: hidden;
}

/* ============================================================== badges === */

.hs-badge {
	display: inline-flex;
	align-items: center;
	gap: var(--hs-space-1);
	height: 28px;
	padding: 0 var(--hs-space-3);
	font-family: var(--hs-font-head);
	font-size: var(--hs-text-sm);
	line-height: 1;
	letter-spacing: .04em;
	color: var(--hs-surface);
	background: rgba(0, 37, 77, .82);
	border-radius: 999px;
	pointer-events: none;
}

.hs-badge svg {
	width: 14px;
	height: 14px;
}
