/*
Theme Name: High Divide Site
Theme URI: https://click-refresh.com/
Description: Site-only child theme for the High Divide distribution site (store, resources). Not the shipped starter child theme.
Author: Sammy Russo
Author URI: https://click-refresh.com/
Template: high-divide
Version: 0.9.13
Requires at least: 6.3
Requires PHP: 8.0
Text Domain: high-divide-site
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/old-licenses/gpl-2.0.html
*/

/* Site-specific CSS for the distribution site. Loads after the High Divide stylesheet. */
@font-face {
  font-family: "Red Hat Display";
  src: url("assets/fonts/RedHatDisplay-VariableFont_wght.woff2") format("woff2");
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Red Hat Text";
  src: url("assets/fonts/RedHatText-VariableFont_wght.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
:root {
  --bs-body-font-family: "Red Hat Text", system-ui, -apple-system, "Segoe UI", sans-serif;
}
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6, .site-title, .entry-title {
  font-family: "Red Hat Display", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-weight: 700;
}
.btn {border-radius: 1px;}

footer .widget ul li {border-bottom: none;}

.wp-block-group.d-flex > .wp-block-group__inner-container {
  display: contents;
}

/* GRavity Forms */
.gform-theme--foundation .gform_fields {
    grid-row-gap:15px !important;
    row-gap: 15px !important;
}
/* Gravity Forms: every form uses the palette primary instead of Gravity Forms' default blue
   (Orbital theme variables). */
.gform_wrapper.gform-theme--orbital { /* !important: Gravity Forms prints each form's variables inline with an ID selector */
	--gf-color-primary: var(--bs-primary) !important;
	--gf-color-primary-rgb: var(--bs-primary-rgb) !important;
	--gf-color-primary-contrast: #fff !important;
	--gf-color-primary-darker: color-mix(in srgb, var(--bs-primary) 85%, black) !important;
	--gf-color-primary-lighter: color-mix(in srgb, var(--bs-primary) 85%, white) !important;
}
/* Analytics consent banner (inc/consent.php). Bottom left on wide screens, full width on phones. */
.hds-consent {
	position: fixed;
	inset: auto 1rem 1rem 1rem;
	z-index: 1090;
	max-width: 26rem;
}
.hds-consent[hidden] {
	display: none;
}
/* Resources: single sidebar. Sticky on large screens, clearing the fixed navbar and admin bar. */
@media (min-width: 992px) {
	.hds-resource-sidebar {
		position: sticky;
		top: calc(var(--hd-header-height, 0px) + 1.5rem);
		max-height: calc(100vh - var(--hd-header-height, 0px) - 3rem);
		overflow-y: auto;
	}
	.admin-bar .hds-resource-sidebar {
		top: calc(var(--hd-header-height, 0px) + 32px + 1.5rem);
		max-height: calc(100vh - var(--hd-header-height, 0px) - 32px - 3rem);
	}
}
.hds-resource-sidebar .list-group,
.hds-account-nav .list-group {
	/* Bootstrap compiles the active color as a literal blue; use the palette. */
	--bs-list-group-active-bg: var(--bs-primary);
	--bs-list-group-active-border-color: var(--bs-primary);
}
.hds-resource-sidebar .list-group-item,
.hds-account-nav .list-group-item {
	padding-block: .6rem;
}

/* Code blocks: the theme boxes both <pre> and its <code>. Keep the double frame,
   but give the inner box the page background for a touch of depth. */
.entry-content pre > code {
	display: block;
	background-color: var(--hdb-light);
}
.accordion {
    --bs-accordion-active-bg: var(--hdb-secondary);
    --bs-accordion-active-color: var(--hdb-light);
    --bs-accordion-btn-focus-box-shadow: 0 0 0 .25rem rgba(var(--bs-secondary-rgb), .25);
}

/* The arrow takes the button's text color: dark when closed, light when open.
   The :not(.collapsed) selector is needed to beat Bootstrap's open-state image rule. */
.accordion-button::after,
.accordion-button:not(.collapsed)::after {
    background-image: none;
    background-color: currentColor;
    -webkit-mask: var(--bs-accordion-btn-icon) center / var(--bs-accordion-btn-icon-width) no-repeat;
    mask: var(--bs-accordion-btn-icon) center / var(--bs-accordion-btn-icon-width) no-repeat;
}

/* Temporary until High Divide Blocks fixes it: the theme's H5 color overrides
   Bootstrap's white caption text. Take the caption's color instead. */
.hdb-bs-carousel .carousel-caption h5 {
	color: inherit;
}

/* Block Settings block: matches the FAQ block's list display. */
.hds-block-settings__heading {
	margin-bottom: 2rem;
}
.hds-block-settings__group {
	padding: 1.5rem 0;
	border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
.hds-block-settings__group:first-of-type {
	padding-top: 0;
}
.hds-block-settings__title {
	margin: 0 0 .75rem;
	color: inherit;
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1.35;
}
.hds-block-settings__group > :last-child {
	margin-bottom: 0;
}
/* One group: no sub-heading, so no divider is needed after the last row. */
.hds-block-settings--single .hds-block-settings__group {
	border-bottom: 0;
	padding-bottom: 0;
}

/* Resource cards: the documented block's icon, as in the block inserter. */
.hds-resource-card__icon.dashicons {
	flex: none;
	width: 2.75rem;
	height: 2.75rem;
	border-radius: 50%;
	background-color: var(--bs-tertiary-bg, #f8f9fa);
	color: var(--bs-primary);
	font-size: 1.5rem;
	line-height: 2.75rem;
	text-align: center;
}

/* Resources archive: category headings are jump targets (#slug). Clear the fixed navbar. */
.hds-resource-group__heading {
	scroll-margin-top: calc(var(--hd-header-height, 80px) + var(--wp-admin--admin-bar--height, 0px) + 1.5rem);
}
/* Separator block: the parent theme draws it in #dee2e6 and Bootstrap fades every <hr>
   to 25%, so it barely shows. Use the palette's secondary (slate) instead. A color
   picked on the block itself still wins. */
.wp-block-separator:not(.has-text-color):not(.has-background) {
	border-top-color: var(--bs-secondary);
	opacity: 0.5;
}
/* Section anchors (/#pricing, /blocks/#accordion) clear the fixed navbar and admin bar.
   The section's own padding provides the breathing room. */
.hdb-section[id] {
	scroll-margin-top: calc(var(--hd-header-height, 80px) + var(--wp-admin--admin-bar--height, 0px));
}
/* Single resource: anchors clear the fixed navbar and admin bar. #demo needs more room,
   because its "Demonstration" heading sits just above it. The 80px fallback covers a
   jump that happens before the theme's script has measured the header. */
.single-resource .entry-content [id] {
	--hds-anchor-space: 1.5rem;
	scroll-margin-top: calc(var(--hd-header-height, 80px) + var(--wp-admin--admin-bar--height, 0px) + var(--hds-anchor-space));
}
.single-resource .entry-content [id="demo"] {
	--hds-anchor-space: 4rem;
}
/* Bootstrap's smooth scrolling gets cancelled during page load, leaving #demo links at
   the top of the page. Jump straight to anchors on resource pages. */
html:has(body.single-resource) {
	scroll-behavior: auto;
}
/* Resources archive: jump straight to the #slug on arrival (a smooth scroll gets cancelled
   during page load). The class is added after load, so the pills still scroll smoothly. */
html:has(body.post-type-archive-resource) {
	scroll-behavior: auto;
}
@media (prefers-reduced-motion: no-preference) {
	html.hds-smooth-scroll:has(body.post-type-archive-resource) {
		scroll-behavior: smooth;
	}
}

/* Sales pages (/blocks/ page 278, /theme/ page 280): screenshots sit on a slate panel offset
   down and right, with a soft shadow, to break up the white. The panel is a hard
   box-shadow on the image itself, so a caption under it doesn't stretch the panel.
   The figure's margin reserves room for it, so it never pushes past the column. */
:is(.page-id-6, .page-id-278, .page-id-280) .hdb-section .wp-block-image {
	--hds-shot-offset: 1.5rem;
	margin: 0 var(--hds-shot-offset) var(--hds-shot-offset) 0;
}
:is(.page-id-6, .page-id-278, .page-id-280) .hdb-section .wp-block-image img {
	display: block;
	border: 1px solid rgba(var(--bs-body-color-rgb), 0.08);
	border-radius: 0.5rem;
	background-color: var(--bs-body-bg);
	box-shadow:
		0 0.75rem 1.5rem rgba(var(--bs-primary-rgb), 0.18),
		0 0.125rem 0.375rem rgba(var(--bs-primary-rgb), 0.12),
		var(--hds-shot-offset) var(--hds-shot-offset) 0 0 rgba(var(--bs-secondary-rgb), 0.3);
}
:is(.page-id-6, .page-id-278, .page-id-280) .hdb-section .wp-block-image figcaption {
	margin-top: calc(var(--hds-shot-offset) + 0.5rem);
}
/* Separators sit between Sections, outside their containers. Inset them by the
   container's padding so they line up with the text. */
:is(.page-id-6, .page-id-278, .page-id-280) .wp-block-separator {
	margin-inline: calc(var(--bs-gutter-x, 1.5rem) * 0.5);
}
@media (max-width: 767.98px) {
	:is(.page-id-6, .page-id-278, .page-id-280) .hdb-section .wp-block-image {
		--hds-shot-offset: 1rem;
	}
}

/* Navigation button in the palette's primary color (navy). A copy of the parent
   theme's Customizer `.nav-cta` style, fixed to primary. Add the CSS class
   `nav-btn-primary` to a top-level menu item (Appearance → Menus → CSS Classes). */
.site-navbar .navbar-nav > .nav-btn-primary > .nav-link {
	color: var(--hd-primary-contrast) !important;
	background-color: var(--hd-primary);
	border-radius: var(--bs-border-radius);
	padding-right: 1rem;
	padding-left: 1rem;
}
.site-navbar .navbar-nav > .nav-btn-primary > .nav-link:hover,
.site-navbar .navbar-nav > .nav-btn-primary > .nav-link:focus {
	color: var(--hd-primary-contrast) !important;
	background-color: color-mix(in srgb, var(--hd-primary) 85%, black);
}
