/*
 * Sagely Tools — shared design tokens and primitives.
 *
 * Palette is lifted from the site's GeneratePress global colors so tools read
 * as part of Sagely Chic rather than something bolted on. Type inherits from
 * the theme (Montserrat) on purpose.
 *
 * Sizing note: nothing here goes below 17px or below a 48px touch target. The
 * audience is women over 50 on phones; legibility is a functional requirement,
 * not a finishing touch.
 */

.st-tool {
	--st-wine: #7a2e3a;
	--st-wine-dark: #5e222b;
	--st-wine-tint: #f3e9ea;
	--st-sage: #8a9a7a;
	--st-sage-tint: #eef1ea;
	--st-cream: #f5f2ed;
	--st-tan: #c4a882;
	--st-ink: #241f20;
	--st-ink-soft: #574f51;
	--st-line: #e3dcd3;
	--st-white: #fff;

	--st-radius: 14px;
	--st-radius-lg: 20px;
	--st-gap: 18px;
	--st-shadow: 0 2px 4px rgba(36, 31, 32, .04), 0 12px 28px rgba(36, 31, 32, .07);

	box-sizing: border-box;
	max-width: 780px;
	margin: 2em auto;
	color: var(--st-ink);
	font-family: inherit;
	font-size: 17px;
	line-height: 1.6;
	-webkit-text-size-adjust: 100%;
}

.st-tool *,
.st-tool *::before,
.st-tool *::after {
	box-sizing: inherit;
}

/*
 * Restore the [hidden] attribute.
 *
 * [hidden] is only `display: none` in the user-agent stylesheet, so ANY author
 * rule that sets display beats it. `.st-input`, `.st-select` and `.st-btn` all
 * set display:flex, which meant `element.hidden = true` set the attribute and
 * changed nothing on screen — the shoe converter showed its foot-length input
 * and its size dropdown simultaneously, and every tool showed "Start over"
 * before there was anything to start over from.
 *
 * !important is right here and almost nowhere else: [hidden] is a browser
 * primitive, and the alternative is every current and future component rule
 * remembering not to break it.
 */
.st-tool [hidden],
#st-print-root [hidden] {
	display: none !important;
}

.st-tool p {
	margin: 0 0 1em;
}

.st-tool p:last-child {
	margin-bottom: 0;
}

/* ---------------------------------------------------------------- card -- */

.st-card {
	background: var(--st-cream);
	border: 1px solid var(--st-line);
	border-radius: var(--st-radius-lg);
	padding: 22px 18px;
	box-shadow: var(--st-shadow);
}

.st-card__lede {
	margin: 0 0 18px;
	color: var(--st-ink-soft);
	font-size: 16px;
}

.st-eyebrow {
	margin: 0 0 4px;
	color: var(--st-wine);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}

/* --------------------------------------------------------------- units -- */

.st-units {
	display: flex;
	gap: 4px;
	padding: 4px;
	background: var(--st-white);
	border: 1px solid var(--st-line);
	border-radius: 999px;
}

/* Colors restated on every state for the same reason as .st-btn above. */
.st-tool .st-units__btn,
.st-tool .st-units__btn:hover,
.st-tool .st-units__btn:focus,
.st-tool .st-units__btn:focus-visible,
.st-tool .st-units__btn:active {
	flex: 1;
	min-height: 48px;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--st-ink-soft);
	font: inherit;
	font-size: 16px;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.st-tool .st-units__btn:hover:not(.is-active),
.st-tool .st-units__btn:focus-visible:not(.is-active) {
	background: var(--st-wine-tint);
	color: var(--st-wine-dark);
}

.st-tool .st-units__btn.is-active,
.st-tool .st-units__btn.is-active:hover,
.st-tool .st-units__btn.is-active:focus,
.st-tool .st-units__btn.is-active:focus-visible,
.st-tool .st-units__btn.is-active:active {
	background: var(--st-wine);
	color: var(--st-white);
}

.st-tool .st-units__btn:focus-visible {
	outline: 3px solid var(--st-tan);
	outline-offset: 2px;
}

/* -------------------------------------------------------------- fields -- */

.st-fields {
	display: grid;
	gap: var(--st-gap);
	margin-top: 20px;
}

.st-field__label {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin-bottom: 6px;
	font-size: 17px;
	font-weight: 700;
}

.st-field__opt {
	color: var(--st-ink-soft);
	font-size: 13px;
	font-weight: 500;
	font-style: italic;
}

.st-input {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--st-white);
	border: 1.5px solid var(--st-line);
	border-radius: var(--st-radius);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.st-input:focus-within {
	border-color: var(--st-wine);
	box-shadow: 0 0 0 3px var(--st-wine-tint);
}

.st-input input {
	width: 100%;
	min-height: 56px;
	padding: 0 58px 0 16px;
	border: 0;
	border-radius: var(--st-radius);
	background: transparent;
	color: var(--st-ink);
	font: inherit;
	font-size: 19px;
	font-weight: 600;
}

.st-input input:focus {
	outline: none;
}

.st-input__unit {
	position: absolute;
	right: 16px;
	color: var(--st-ink-soft);
	font-size: 15px;
	font-weight: 600;
	pointer-events: none;
}

.st-field.has-error .st-input {
	border-color: #a8302f;
}

.st-field__error {
	margin: 6px 0 0;
	color: #a8302f;
	font-size: 15px;
	font-weight: 600;
}

.st-field__error:empty {
	display: none;
}

.st-form__error {
	margin: 18px 0 0;
	padding: 12px 14px;
	border-left: 4px solid #a8302f;
	border-radius: 6px;
	background: #fbecec;
	color: #7d2423;
	font-size: 16px;
	font-weight: 600;
}

/* ----------------------------------------------------------- help/detail -- */

.st-help {
	margin-top: 8px;
}

.st-help__summary,
.st-panel__summary {
	cursor: pointer;
	list-style: none;
}

.st-help__summary::-webkit-details-marker,
.st-panel__summary::-webkit-details-marker {
	display: none;
}

.st-help__summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	color: var(--st-wine);
	font-size: 15px;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.st-help__summary::before {
	content: "?";
	display: inline-grid;
	place-items: center;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--st-wine);
	color: var(--st-white);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
}

.st-help__body {
	display: grid;
	grid-template-columns: 96px 1fr;
	gap: 14px;
	align-items: center;
	margin-top: 8px;
	padding: 14px;
	background: var(--st-white);
	border: 1px solid var(--st-line);
	border-radius: var(--st-radius);
}

.st-help__text {
	margin: 0;
	color: var(--st-ink-soft);
	font-size: 15.5px;
	line-height: 1.55;
}

/* ------------------------------------------------------------- buttons -- */

.st-actions {
	display: grid;
	gap: 10px;
	margin-top: 22px;
}

.st-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 56px;
	padding: 0 22px;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font: inherit;
	font-size: 17px;
	font-weight: 700;
	text-align: center;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.st-btn:focus-visible {
	outline: 3px solid var(--st-tan);
	outline-offset: 2px;
}

/*
 * Every button state declares its own color, and all of them are scoped under
 * .st-tool so they outrank the theme.
 *
 * This matters more than it looks. GeneratePress ships
 * `button:focus { color:#ffffff }` at specificity (0,1,1), which beats a bare
 * `.st-btn--secondary { color: ... }` at (0,1,0). Because a clicked button keeps
 * focus, hovering it afterwards combined the theme's white text with our pale
 * hover background and the label vanished. Never let a button state here
 * inherit its color — always state it.
 */

.st-tool .st-btn--primary,
.st-tool .st-btn--primary:link,
.st-tool .st-btn--primary:visited {
	background: var(--st-wine);
	color: var(--st-white);
}

.st-tool .st-btn--primary:hover,
.st-tool .st-btn--primary:focus,
.st-tool .st-btn--primary:focus-visible,
.st-tool .st-btn--primary:active {
	background: var(--st-wine-dark);
	color: var(--st-white);
}

.st-tool .st-btn--secondary,
.st-tool .st-btn--secondary:link,
.st-tool .st-btn--secondary:visited {
	background: var(--st-white);
	border-color: var(--st-wine);
	color: var(--st-wine);
}

.st-tool .st-btn--secondary:hover,
.st-tool .st-btn--secondary:focus,
.st-tool .st-btn--secondary:focus-visible,
.st-tool .st-btn--secondary:active {
	background: var(--st-wine-tint);
	border-color: var(--st-wine);
	color: var(--st-wine-dark);
}

.st-tool .st-btn--ghost,
.st-tool .st-btn--ghost:link,
.st-tool .st-btn--ghost:visited {
	background: transparent;
	color: var(--st-ink-soft);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.st-tool .st-btn--ghost:hover,
.st-tool .st-btn--ghost:focus,
.st-tool .st-btn--ghost:focus-visible,
.st-tool .st-btn--ghost:active {
	background: transparent;
	color: var(--st-wine);
}

.st-btn[disabled] {
	opacity: .65;
	cursor: default;
}

.st-btn__spinner {
	display: none;
	width: 18px;
	height: 18px;
	border: 2px solid rgba(255, 255, 255, .4);
	border-top-color: #fff;
	border-radius: 50%;
	animation: st-spin .7s linear infinite;
}

.st-btn.is-busy .st-btn__spinner {
	display: block;
}

@keyframes st-spin {
	to { transform: rotate(360deg); }
}

/* -------------------------------------------------------------- panels -- */

.st-panels {
	display: grid;
	gap: 10px;
	margin: 24px 0;
}

.st-panel {
	background: var(--st-white);
	border: 1px solid var(--st-line);
	border-radius: var(--st-radius);
	overflow: hidden;
}

.st-panel__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 58px;
	padding: 12px 16px;
	font-size: 17px;
	font-weight: 700;
}

.st-panel__summary::after {
	content: "";
	flex: none;
	width: 10px;
	height: 10px;
	border-right: 2.5px solid var(--st-wine);
	border-bottom: 2.5px solid var(--st-wine);
	transform: rotate(45deg) translateY(-2px);
	transition: transform .2s ease;
}

.st-panel[open] .st-panel__summary::after {
	transform: rotate(-135deg) translateY(-2px);
}

.st-panel__summary:focus-visible {
	outline: 3px solid var(--st-tan);
	outline-offset: -3px;
}

.st-panel--yes .st-panel__summary { border-left: 5px solid var(--st-sage); }
.st-panel--no  .st-panel__summary { border-left: 5px solid var(--st-tan); }
.st-panel--age .st-panel__summary { border-left: 5px solid var(--st-wine); }

.st-panel__list {
	margin: 0;
	padding: 0 18px 18px 38px;
}

.st-panel__list li {
	margin-bottom: 9px;
	font-size: 16.5px;
	line-height: 1.55;
}

.st-panel__list li:last-child {
	margin-bottom: 0;
}

.st-panel__defs {
	margin: 0;
	padding: 0 18px 18px;
}

.st-panel__defs dt {
	margin-top: 12px;
	color: var(--st-wine);
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
}

.st-panel__defs dt:first-child {
	margin-top: 0;
}

.st-panel__defs dd {
	margin: 4px 0 0;
	font-size: 16.5px;
	line-height: 1.55;
}

/* -------------------------------------------------------------- wizard -- */

.st-wizard__head {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
}

.st-progress {
	flex: none;
	color: var(--st-ink-soft);
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.st-progress__track {
	flex: 1;
	height: 6px;
	background: var(--st-white);
	border: 1px solid var(--st-line);
	border-radius: 999px;
	overflow: hidden;
}

.st-progress__bar {
	display: block;
	height: 100%;
	background: var(--st-wine);
	border-radius: 999px;
	transition: width .25s ease;
}

/* A fieldset, reset so it lays out like a plain block. */
.st-step {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.st-step__title {
	display: block;
	padding: 0;
	margin: 0 0 4px;
	color: var(--st-ink);
	font-size: 21px;
	font-weight: 800;
	line-height: 1.25;
}

.st-step__title:focus {
	outline: none;
}

.st-step__title:focus-visible {
	outline: 3px solid var(--st-tan);
	outline-offset: 4px;
	border-radius: 4px;
}

.st-step__lede {
	margin: 0 0 16px;
	color: var(--st-ink-soft);
	font-size: 15.5px;
	line-height: 1.55;
}

.st-step__group {
	margin-bottom: 18px;
}

.st-step__group:last-of-type {
	margin-bottom: 0;
}

.st-step__grouplabel {
	display: block;
	margin-bottom: 8px;
	color: var(--st-wine);
	font-size: 12.5px;
	font-weight: 700;
	letter-spacing: .09em;
	text-transform: uppercase;
}

/* ------------------------------------------------------- choice cards -- */

.st-choices {
	display: grid;
	gap: 10px;
}

.st-choice {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 60px;
	padding: 14px 16px;
	background: var(--st-white);
	border: 1.5px solid var(--st-line);
	border-radius: var(--st-radius);
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease;
}

/* The real radio, kept in the DOM for keyboard and screen readers. */
.st-choice input {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* Drawn radio dot. */
.st-choice::before {
	content: "";
	flex: none;
	width: 22px;
	height: 22px;
	border: 2px solid var(--st-contrast-3, #b9afa2);
	border-radius: 50%;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.st-choice:hover {
	border-color: var(--st-wine);
	background: var(--st-wine-tint);
}

.st-choice:has(input:checked) {
	border-color: var(--st-wine);
	background: var(--st-wine-tint);
}

.st-choice:has(input:checked)::before {
	border-color: var(--st-wine);
	box-shadow: inset 0 0 0 5px var(--st-wine);
}

.st-choice:has(input:focus-visible) {
	outline: 3px solid var(--st-tan);
	outline-offset: 2px;
}

/*
 * :has() is well supported now but not universally. Without it the dot never
 * fills, so mirror every checked/focus style off a class the JS also sets.
 */
.st-choice.is-checked {
	border-color: var(--st-wine);
	background: var(--st-wine-tint);
}

.st-choice.is-checked::before {
	border-color: var(--st-wine);
	box-shadow: inset 0 0 0 5px var(--st-wine);
}

.st-choice.is-focused {
	outline: 3px solid var(--st-tan);
	outline-offset: 2px;
}

.st-choice__text {
	display: block;
	min-width: 0;
}

.st-choice__label {
	display: block;
	color: var(--st-ink);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.3;
}

.st-choice__hint {
	display: block;
	margin-top: 2px;
	color: var(--st-ink-soft);
	font-size: 14.5px;
	line-height: 1.4;
}

/* ---------------------------------------------------------- wizard nav -- */

.st-wizard__nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 20px;
}

.st-wizard__nav .st-btn--primary {
	flex: 1 1 auto;
}

.st-btn--back {
	flex: none;
	min-height: 48px;
	padding: 0 6px;
	border: 0;
	background: transparent;
	color: var(--st-ink-soft);
	font: inherit;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
}

.st-tool .st-btn--back:hover,
.st-tool .st-btn--back:focus,
.st-tool .st-btn--back:focus-visible,
.st-tool .st-btn--back:active {
	background: transparent;
	color: var(--st-wine);
}

.st-btn--back:focus-visible {
	outline: 3px solid var(--st-tan);
	outline-offset: 2px;
	border-radius: 6px;
}

/* --------------------------------------------------------- summary bar -- */

/*
 * What the steps collapse into once there is a result: everything she chose,
 * on one line, still changeable.
 */
.st-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin-bottom: 18px;
	padding: 14px 16px;
	background: var(--st-cream);
	border: 1px solid var(--st-line);
	border-radius: var(--st-radius);
}

.st-summary__items {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	min-width: 0;
	flex: 1 1 200px;
}

.st-summary__item {
	color: var(--st-ink);
	font-size: 15.5px;
	font-weight: 700;
}

.st-summary__sep {
	color: var(--st-contrast-3, #b9afa2);
}

.st-summary__change {
	flex: none;
	min-height: 44px;
	padding: 0 16px;
	border: 1.5px solid var(--st-wine);
	border-radius: 999px;
	background: var(--st-white);
	color: var(--st-wine);
	font: inherit;
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}

.st-tool .st-summary__change:hover,
.st-tool .st-summary__change:focus,
.st-tool .st-summary__change:focus-visible,
.st-tool .st-summary__change:active {
	background: var(--st-wine-tint);
	color: var(--st-wine-dark);
}

.st-summary__change:focus-visible {
	outline: 3px solid var(--st-tan);
	outline-offset: 2px;
}

/* Screen-reader-only live region for step announcements. */
.st-sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	border: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

/* -------------------------------------------------------------- select -- */

/*
 * Shared with every tool that offers a dropdown. Lived in dress-size.css until
 * the shoe converter needed it and would have rendered an unstyled select.
 */

.st-select {
	position: relative;
	display: flex;
	align-items: center;
	background: var(--st-white);
	border: 1.5px solid var(--st-line);
	border-radius: var(--st-radius);
	transition: border-color .15s ease, box-shadow .15s ease;
}

.st-select:focus-within {
	border-color: var(--st-wine);
	box-shadow: 0 0 0 3px var(--st-wine-tint);
}

.st-select::after {
	content: "";
	position: absolute;
	right: 18px;
	width: 10px;
	height: 10px;
	border-right: 2.5px solid var(--st-wine);
	border-bottom: 2.5px solid var(--st-wine);
	pointer-events: none;
	transform: rotate(45deg) translateY(-3px);
}

.st-select select {
	width: 100%;
	min-height: 56px;
	padding: 0 48px 0 16px;
	border: 0;
	border-radius: var(--st-radius);
	appearance: none;
	background: transparent;
	color: var(--st-ink);
	font: inherit;
	font-size: 18px;
	font-weight: 700;
	cursor: pointer;
}

.st-select select:focus {
	outline: none;
}

.st-field.has-error .st-select {
	border-color: #a8302f;
}

/* ---------------------------------------------------------- size cards -- */

/*
 * The converter result grid, shared by dress-size and shoe-size.
 */

.st-size-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px;
	margin: 20px 0 0;
	padding: 0;
	list-style: none;
}

.st-size-card {
	display: grid;
	gap: 4px;
	min-height: 128px;
	padding: 15px 14px;
	background: var(--st-cream);
	border: 1px solid var(--st-line);
	border-radius: var(--st-radius);
}

.st-size-card.is-input {
	background: var(--st-wine-tint);
	border-color: var(--st-wine);
}

.st-size-card__label {
	color: var(--st-wine);
	font-size: 13px;
	font-weight: 800;
	letter-spacing: .08em;
	text-transform: uppercase;
}

.st-size-card__value {
	color: var(--st-ink);
	font-size: 28px;
	font-weight: 800;
	line-height: 1;
}

.st-size-card__name {
	align-self: end;
	color: var(--st-ink-soft);
	font-size: 14px;
	line-height: 1.35;
}

/*
 * Sizes past the end of a country's published chart. Muted rather than alarming
 * — the number is still correct arithmetic, it just is not a size she will find
 * on a rail. Color is not the only signal: the dashed border and the "Rarely
 * made" label each carry the meaning on their own.
 */

.st-size-card.is-beyond {
	background: var(--st-white);
	border-style: dashed;
	border-color: #c9c0b4;
}

.st-size-card.is-beyond .st-size-card__value {
	color: var(--st-ink-soft);
}

.st-size-card__flag {
	align-self: end;
	margin-top: 2px;
	color: #8a6d3b;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
}

.st-size-note--beyond {
	border-left-color: var(--st-tan);
}

/* ------------------------------------------------- converter skeleton -- */

.st-size-skeleton {
	display: grid;
	gap: 12px;
	margin-top: 24px;
	padding: 24px 18px;
	background: var(--st-cream);
	border: 1px solid var(--st-line);
	border-radius: var(--st-radius-lg);
}

.st-size-skeleton span {
	height: 18px;
	background: linear-gradient(90deg, #e7e0d7 25%, #f1ece5 50%, #e7e0d7 75%);
	background-size: 400% 100%;
	border-radius: 8px;
	animation: st-size-shimmer 1.3s ease infinite;
}

.st-size-skeleton span:nth-child(1) { width: 42%; height: 28px; }
.st-size-skeleton span:nth-child(2) { width: 100%; }
.st-size-skeleton span:nth-child(3) { width: 82%; }
.st-size-skeleton span:nth-child(4) { width: 68%; }

@keyframes st-size-shimmer {
	0%   { background-position: 100% 0; }
	100% { background-position: 0 0; }
}

/* ------------------------------------------------------ result actions -- */

.st-result:focus {
	outline: none;
}

.st-result__actions {
	display: grid;
	gap: 10px;
	padding-top: 20px;
	border-top: 1px solid var(--st-line);
}

/* --------------------------------------------------------------- notes -- */

.st-note {
	margin: 14px 0 0;
	padding: 12px 14px;
	border-left: 4px solid var(--st-tan);
	border-radius: 6px;
	background: var(--st-white);
	font-size: 15.5px;
	line-height: 1.55;
}

.st-disclaimer {
	margin: 18px 0 0;
	color: var(--st-ink-soft);
	font-size: 15px;
	font-style: italic;
	line-height: 1.55;
}

/* ------------------------------------------------------------ desktop -- */

@media (min-width: 768px) {
	.st-tool {
		font-size: 18px;
	}

	.st-card {
		padding: 32px 30px;
	}

	.st-fields {
		grid-template-columns: 1fr 1fr;
		gap: 22px;
	}

	.st-actions {
		grid-auto-flow: column;
		justify-content: start;
		align-items: center;
	}

	.st-help__body {
		grid-template-columns: 110px 1fr;
	}

	.st-size-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		gap: 12px;
	}

	.st-result__actions {
		grid-auto-flow: column;
		justify-content: start;
		align-items: center;
	}

	.st-choices--split {
		grid-template-columns: 1fr 1fr;
	}

	.st-step__title {
		font-size: 24px;
	}

	.st-wizard__nav .st-btn--primary {
		flex: 0 0 auto;
	}
}

/* --------------------------------------------------------------- print -- */

/*
 * "Print or save" must produce the result and nothing else — not the site
 * header, nav, article, sidebar, ads or footer.
 *
 * The usual trick is `body * { visibility: hidden }` plus absolute positioning,
 * but that depends on no ancestor being positioned, which no one can guarantee
 * inside a theme. Instead st-core.js clones the result into #st-print-root as a
 * direct child of <body>, so hiding body's other direct children hides
 * everything else with certainty. The clone carries .st-tool so the design
 * tokens, which are defined on that class, still resolve.
 *
 * A plain Ctrl+P (no .st-printing class) still prints the whole page, because
 * someone doing that usually wants the article.
 */

#st-print-root {
	display: none;
}

@media print {
	@page {
		margin: 15mm;
	}

	body.st-printing > *:not(#st-print-root) {
		display: none !important;
	}

	body.st-printing #st-print-root {
		display: block !important;
		max-width: none;
		margin: 0;
		font-size: 12pt;
	}

	#st-print-root .st-result__actions,
	#st-print-root .st-summary__change,
	#st-print-root .st-skeleton,
	#st-print-root .st-size-skeleton {
		display: none !important;
	}

	/* The summary line itself is worth printing — it records what she entered. */
	#st-print-root .st-summary {
		padding: 0 0 8pt;
		border: 0;
		border-bottom: 1pt solid #ccc;
		background: none;
	}

	/* Attribution, since the site header is gone. */
	#st-print-root::before {
		content: "Sagely Chic \00B7  sagelychic.com";
		display: block;
		margin-bottom: 14pt;
		padding-bottom: 6pt;
		border-bottom: 1pt solid #999;
		color: #555;
		font-size: 9pt;
		font-weight: 700;
		letter-spacing: .1em;
		text-transform: uppercase;
	}

	#st-print-root .st-panel,
	#st-print-root .st-size-card {
		break-inside: avoid;
		page-break-inside: avoid;
	}

	#st-print-root .st-panel__summary::after {
		display: none;
	}

	/*
	 * Kill every animation and transition inside the clone.
	 *
	 * This is not cosmetic. Each tool's result carries an entrance animation
	 * that starts at opacity 0 with animation-fill-mode: both. Cloning the node
	 * restarts that animation, and window.print() fires while the clone is
	 * still on its first frame — so the printout came out completely blank.
	 *
	 * Deliberately class-agnostic. This rule previously listed .st-verdict and
	 * .st-size-result by name, so when .st-shoe-result was added later it was
	 * silently left out and only that tool printed blank. Do not go back to
	 * naming classes here.
	 *
	 * No blanket opacity:1 — that would flatten deliberate opacity such as
	 * .st-figure__band. Removing the animation is enough, because none of these
	 * elements declare a static opacity of their own.
	 */
	#st-print-root,
	#st-print-root * {
		animation: none !important;
		transition: none !important;
	}

	/* Ink economy, and borders read better than fills on paper. */
	#st-print-root .st-verdict,
	#st-print-root .st-size-result,
	#st-print-root .st-shoe-result,
	#st-print-root .st-bra-result {
		padding: 0;
		border: 0;
		box-shadow: none;
	}
}

/* -------------------------------------------------------- reduced motion -- */

@media (prefers-reduced-motion: reduce) {
	.st-tool *,
	.st-tool *::before,
	.st-tool *::after {
		animation-duration: .01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: .01ms !important;
	}
}
