/**
 * Subpage template (page-templates/template-subpage.php).
 *
 * Template-level styles only; the breadcrumb, page hero and below-hero
 * strips have their own component CSS. Values come from assets/css/tokens.css.
 *
 * @package cartrack
 */

/* Editor content, shown only when the page has no builder sections. */
.subpage__content {
	max-width: calc(var(--container-narrow) + 2 * var(--container-gutter));
	margin-inline: auto;
	padding: var(--space-2xl) var(--container-gutter);
}

/* ==========================================================================
   Builder sections (cartrack_subpage_section_attrs(): shared Section settings)
   ========================================================================== */

.sp-section {
	scroll-margin-top: var(--subpage-anchor-offset);
	padding-block: var(--sp-space-medium);
}

.sp-section--bg-light {
	background: var(--sp-bg-light);
}

.sp-section--bg-tinted {
	background: var(--sp-bg-tinted);
}

.sp-section--pt-none { padding-top: 0; }
.sp-section--pt-small { padding-top: var(--sp-space-small); }
.sp-section--pt-medium { padding-top: var(--sp-space-medium); }
.sp-section--pt-large { padding-top: var(--sp-space-large); }
.sp-section--pb-none { padding-bottom: 0; }
.sp-section--pb-small { padding-bottom: var(--sp-space-small); }
.sp-section--pb-medium { padding-bottom: var(--sp-space-medium); }
.sp-section--pb-large { padding-bottom: var(--sp-space-large); }

/* Content column: ~1064px in the frames, aligned with the hero text on mobile. */
.sp-section__inner {
	max-width: calc(var(--sp-content-max) + 2 * var(--container-gutter));
	margin-inline: auto;
	padding-inline: var(--container-gutter);
}

/* Shared section heading (H2 style from Site Manager). */
.sp-heading {
	margin: 0;
	color: var(--color-text);
	font-family: var(--t-h2-family);
	font-size: var(--t-h2-size);
	font-weight: var(--t-h2-weight);
	line-height: var(--t-h2-line-height);
	letter-spacing: var(--t-h2-tracking);
}

/*
 * Editor-only notice inside a section that visitors don't see (for example
 * an FAQ section whose FAQ post is unpublished). Tokens are local: only
 * this notice uses them.
 */
.sp-editor-notice {
	--sp-notice-border: var(--color-primary);
	--sp-notice-bg: var(--color-primary-tint);

	margin: 0;
	padding: var(--space-sm) var(--space-md);
	border: 1px dashed var(--sp-notice-border);
	background-color: var(--sp-notice-bg);
	color: var(--color-text);
	font-family: var(--t-small-family);
	font-size: var(--t-small-size);
	line-height: var(--t-small-line-height);
}

/*
 * A stand-in section (cartrack_standin()): editors only, so it is loud on purpose. A striped frame around the
 * whole section and a dark label band at its top; visitors never get the section at all. Local tokens.
 */
.sp-section--standin {
	--sp-standin-yellow: #ffd400;
	--sp-standin-dark: #1a1a1a;
	--sp-standin-frame: 6px;

	position: relative;
}

.sp-section--standin::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 5;
	border: var(--sp-standin-frame) solid var(--sp-standin-yellow);
	border-image: repeating-linear-gradient(-45deg, var(--sp-standin-yellow) 0 12px, var(--sp-standin-dark) 12px 24px) 6;
	pointer-events: none;
}

.sp-standin-notice {
	position: relative;
	z-index: 6;
	margin: 0;
	padding: var(--space-sm) var(--container-gutter);
	background-color: var(--sp-standin-dark);
	color: var(--color-text-inverse);
	font-family: var(--t-small-family);
	font-size: var(--t-small-size);
	line-height: var(--t-small-line-height);
	text-align: center;
}

.sp-standin-notice__label {
	margin: 0;
	color: var(--sp-standin-yellow);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.sp-standin-notice__text {
	margin: var(--space-2xs) 0 0;
	overflow-wrap: anywhere;
}

@media (min-width: 64em) { /* --bp-lg */
	.sp-section {
		padding-block: var(--sp-space-medium-desktop);
	}

	/* "None" again: the desktop .sp-section padding above would otherwise override the mobile rule. */
	.sp-section--pt-none { padding-top: 0; }
	.sp-section--pt-small { padding-top: var(--sp-space-small-desktop); }
	.sp-section--pt-medium { padding-top: var(--sp-space-medium-desktop); }
	.sp-section--pt-large { padding-top: var(--sp-space-large-desktop); }
	.sp-section--pb-none { padding-bottom: 0; }
	.sp-section--pb-small { padding-bottom: var(--sp-space-small-desktop); }
	.sp-section--pb-medium { padding-bottom: var(--sp-space-medium-desktop); }
	.sp-section--pb-large { padding-bottom: var(--sp-space-large-desktop); }

}
