/*
 * SR Promo (mu-plugin sr-promo.php). Everything is keyed on <html data-sr-promo="STATE">, which the
 * head bootstrap sets from the browser clock: none, upcoming, active, last_day, grace or ended.
 * Colors are WCAG AA (4.5:1 or better) against their own backgrounds:
 *   #FFFFFF on #030E1A 19.4, #FFD54A on #030E1A 13.8, #FFFFFF on #A4161A 7.8,
 *   #030E1A on #FFD54A 13.8, #030E1A on #FFFFFF 19.4, #0F67BE on #F0F4F8 (page) 5.1,
 *   #FFFFFF on #0F67BE 5.7.
 */

/* ---- State switching ---------------------------------------------------------------------- */

.sr-promo-when { display: none; }
html[data-sr-promo="none"]     div.sr-promo-when[data-sr-when~="none"],
html[data-sr-promo="upcoming"] div.sr-promo-when[data-sr-when~="upcoming"],
html[data-sr-promo="active"]   div.sr-promo-when[data-sr-when~="active"],
html[data-sr-promo="last_day"] div.sr-promo-when[data-sr-when~="last_day"],
html[data-sr-promo="grace"]    div.sr-promo-when[data-sr-when~="grace"],
html[data-sr-promo="ended"]    div.sr-promo-when[data-sr-when~="ended"] { display: block; }
html[data-sr-promo="none"]     span.sr-promo-when[data-sr-when~="none"],
html[data-sr-promo="upcoming"] span.sr-promo-when[data-sr-when~="upcoming"],
html[data-sr-promo="active"]   span.sr-promo-when[data-sr-when~="active"],
html[data-sr-promo="last_day"] span.sr-promo-when[data-sr-when~="last_day"],
html[data-sr-promo="grace"]    span.sr-promo-when[data-sr-when~="grace"],
html[data-sr-promo="ended"]    span.sr-promo-when[data-sr-when~="ended"] { display: inline; }

/* Sale prices show only while the offer is displayed (active, last_day). */
.sr-price__sale,
.sr-billed__sale { display: none; }
html[data-sr-promo="active"] .sr-has-sale > .sr-price__reg,
html[data-sr-promo="last_day"] .sr-has-sale > .sr-price__reg,
html[data-sr-promo="active"] .sr-has-sale > .sr-billed__reg,
html[data-sr-promo="last_day"] .sr-has-sale > .sr-billed__reg { display: none; }
html[data-sr-promo="active"] .sr-has-sale > .sr-price__sale,
html[data-sr-promo="last_day"] .sr-has-sale > .sr-price__sale,
html[data-sr-promo="active"] .sr-has-sale > .sr-billed__sale,
html[data-sr-promo="last_day"] .sr-has-sale > .sr-billed__sale { display: inline; }

/* Visually hidden, read by screen readers ("Regular price $29"). */
.sr-vh {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; overflow: hidden;
	clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ---- Prices --------------------------------------------------------------------------------- */

/* The struck-through regular price keeps the text color of the card; only its size changes. */
.sr-price__was {
	font-size: 0.55em;
	font-weight: 400;
	text-decoration: line-through;
	margin-right: 0.15em;
	vertical-align: 0.35em;
}
.sr-price__now { white-space: nowrap; }
/* Plans-page cards are narrow: the struck price goes on its own small line above "$20 /mo". */
.elementor-widget-text-editor .sr-price__was {
	display: block;
	font-size: 0.5em;
	line-height: 1.2;
	margin: 0 0 2px;
	vertical-align: baseline;
}

/* /affiliate-pricing/ table (post 13815, the older affiliate templates): during a sale the
   "$243 for your first year ..." sentence sits under the struck and sale prices. Text color is the
   table's own. */
.pricingTable .sr-billed { display: block; margin-top: 4px; font-size: 0.9em; line-height: 1.4; }
.pricingTable .sr-price__was { font-size: 0.85em; vertical-align: baseline; }
.pricingTable .sr-price__now { font-weight: 600; }
/* Below 1000px the theme stacks the cells and labels each one "Regular Price: " (all.css), which
   names no term and, during a sale, sits in front of the sale price. Converted cells (they hold
   [sr_price]) name their column instead; browsers without :has() keep the theme's label. */
@media screen and (max-width: 62.4375em) {
	.content .pricingTable td.pricingRegularPrice:nth-child(2):has(.sr-price)::before { content: "Monthly: "; }
	.content .pricingTable td.pricingRegularPrice:nth-child(3):has(.sr-price)::before { content: "Yearly: "; }
	.content .pricingTable td.pricingRegularPrice:nth-child(4):has(.sr-price)::before { content: "2 Years: "; }
}

/* ---- Announcement bar (wp_body_open) ------------------------------------------------------ */

.sr-promo-bar {
	display: none;
	position: relative;
	z-index: 100000; /* above the theme-builder header (z-index 99999) when it overlaps on scroll */
	background: #030E1A;
	color: #FFFFFF;
	font-family: "IBM Plex Sans", Arial, sans-serif;
	font-size: 15px;
	line-height: 1.4;
}
html[data-sr-promo="upcoming"] .sr-promo-bar,
html[data-sr-promo="active"] .sr-promo-bar,
html[data-sr-promo="last_day"] .sr-promo-bar { display: block; }
html[data-sr-promo="last_day"] .sr-promo-bar { background: #A4161A; }

.sr-promo-bar__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px 16px;
	max-width: 1440px;
	margin: 0 auto;
	padding: 8px 16px;
	text-align: center;
}
.sr-promo-bar strong { font-weight: 600; }
.sr-promo-bar__clock { white-space: nowrap; margin-left: 0.5em; }
.sr-promo-bar .sr-countdown { font-weight: 600; font-variant-numeric: tabular-nums; color: #FFD54A; }
html[data-sr-promo="last_day"] .sr-promo-bar .sr-countdown { color: #FFFFFF; }

.sr-promo-bar a.sr-promo-bar__cta,
.sr-promo-bar a.sr-promo-bar__cta:visited {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 4px;
	background: #FFD54A;
	color: #030E1A;
	font-weight: 600;
	font-size: 14px;
	text-decoration: none;
	white-space: nowrap;
}
html[data-sr-promo="last_day"] .sr-promo-bar a.sr-promo-bar__cta { background: #FFFFFF; }
.sr-promo-bar a.sr-promo-bar__cta:hover,
.sr-promo-bar a.sr-promo-bar__cta:focus { text-decoration: underline; }
.sr-promo-bar a.sr-promo-bar__cta:focus-visible { outline: 2px solid #FFFFFF; outline-offset: 2px; }

@media (max-width: 767px) {
	.sr-promo-bar { font-size: 14px; }
	.sr-promo-bar__inner { padding: 6px 12px; gap: 4px 10px; }
}

/* ---- Plans-page CTA during the sale (set by sr-promo.js) ---------------------------------- */

/* Sits under the card button, on the card's dark gradient (#030E1A to #0F67BE): white is
   19.4 to 5.7. */
.sr-cta-trial {
	display: block;
	margin-top: 8px;
	font-size: 14px;
	text-align: center;
}
/* body + class beats the kit's ".elementor-kit-42601 a" (secondary blue, 1.7:1 on the card). */
body .sr-cta-trial a,
body .sr-cta-trial a:visited,
body .sr-cta-trial a:hover { color: #FFFFFF; text-decoration: underline; }

/* ---- Evergreen sale landing pages (e.g. /black-friday-sale/) ------------------------------- */

.sr-bf { margin: 1em 0 2em; color: #030E1A; }
/* div.sr-bf p.x (0,2,2) beats the theme's ".content .content__copy p" (0,2,1) text color. */
div.sr-bf p.sr-bf__eyebrow {
	display: inline-block;
	margin: 0 0 0.75em;
	padding: 4px 12px;
	border-radius: 4px;
	background: #030E1A;
	color: #FFFFFF;
	font-weight: 600;
	font-size: 15px;
}
.sr-bf__eyebrow .sr-countdown { color: #FFD54A; font-variant-numeric: tabular-nums; }
html[data-sr-promo="last_day"] div.sr-bf p.sr-bf__eyebrow { background: #A4161A; }
html[data-sr-promo="last_day"] .sr-bf__eyebrow .sr-countdown { color: #FFFFFF; }
.sr-bf__title { margin: 0.25em 0 0.5em; font-size: 32px; line-height: 1.2; }
.sr-bf__lead { font-size: 18px; line-height: 1.5; margin: 0 0 1em; }

.sr-bf__table { width: 100%; max-width: 860px; border-collapse: collapse; margin: 1em 0 1.5em; }
.sr-bf__table th,
.sr-bf__table td { padding: 12px 14px; border-bottom: 1px solid #D5DCE4; text-align: left; vertical-align: top; }
.sr-bf__table thead th { background: #F0F4F8; font-weight: 600; }
.sr-bf__table .sr-price { display: block; font-size: 24px; font-weight: 600; line-height: 1.2; }
.sr-bf__table .sr-billed { display: block; font-size: 14px; margin: 4px 0 8px; }

/* Doubled classes (0,3,2) beat the theme's link colors (".content .content__copy p a" in all.css
   and a11y.css, up to 0,2,3). Theme links are #137CB4, 4.2:1 on the #F0F4F8 page: too light. */
div.sr-bf.sr-bf a:not(.sr-bf__button),
div.sr-bf.sr-bf a:not(.sr-bf__button):visited { color: #0F67BE; }
div.sr-bf a.sr-bf__button.sr-bf__button,
div.sr-bf a.sr-bf__button.sr-bf__button:visited {
	display: inline-block;
	padding: 10px 20px;
	border-radius: 6px;
	background: #030E1A;
	color: #FFFFFF;
	font-weight: 600;
	text-decoration: none;
}
div.sr-bf a.sr-bf__button.sr-bf__button:hover,
div.sr-bf a.sr-bf__button.sr-bf__button:focus { background: #0F67BE; color: #FFFFFF; }
a.sr-bf__buy { font-weight: 600; }

.sr-bf__note { font-size: 14px; }
.sr-bf__fine { font-size: 14px; }

@media (max-width: 767px) {
	.sr-bf__title { font-size: 26px; }
	.sr-bf__table thead { display: none; }
	.sr-bf__table tr { display: block; border-bottom: 1px solid #D5DCE4; padding: 8px 0; }
	.sr-bf__table th,
	.sr-bf__table td { display: block; border: 0; padding: 6px 0; }
	/* The column headings are hidden on phones; each cell names its term instead. */
	.sr-bf__table td[data-label]::before { content: attr(data-label); display: block; font-weight: 600; font-size: 14px; }
}
