/*
 * Offer History block (acf/offer-history).
 *
 * Plain CSS, loaded only on pages that contain the block (omaat-core:
 * Buy_Points/Block.php), so it needs no theme build. Fonts are inherited from
 * the theme. Colors are from the OMAAT style guide:
 *   Navy #021D49, Slate Blue #005677, Aqua #36B0C9, Yellow #FFB71B,
 *   Red Orange #FF4D00, Blue Gray #DAE1E9.
 *
 * The theme styles every <table> on the site (borders between columns, a
 * rule under each cell, a pinned first column on phones). The .oh-table
 * rules below undo those inside this unit only.
 *
 * Phase 2 (2026-11-20).
 * 2026-11-20 (b): CTA is a full-width button on its own row under the
 *                 current deal; the "Get the deal" column is gone.
 */

.oh {
	--oh-navy: #021D49;
	--oh-slate: #005677;
	--oh-aqua: #36B0C9;
	--oh-yellow: #FFB71B;
	--oh-orange: #FF4D00;
	--oh-gray: #DAE1E9;
	--oh-tint: #EEF2F6;
	--oh-muted: #4D5F70;
	--oh-rule: #E6EBF0;

	color: var(--oh-navy);
	container-name: oh;
	container-type: inline-size;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.oh > * {
	margin: 0;
}

/* ---- Header ------------------------------------------------------------ */

.oh__header {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.oh .oh__title {
	color: var(--oh-navy);
	font-size: 2.3rem;
	line-height: 1.15;
	margin: 0;
}

.oh .oh__intro {
	font-size: 16px;
	line-height: 24px;
	margin: 0;
}

.oh .oh__updated {
	color: var(--oh-muted);
	font-size: 13px;
	line-height: 18px;
	margin: 0;
}

.oh .oh__verdict {
	background: var(--oh-tint);
	border-radius: 10px;
	font-size: 16px;
	line-height: 24px;
	margin: 0;
	padding: 16px 20px;
}

/*
 * The titles inside the unit are paragraphs, not headings, so the post's
 * table of contents lists the unit once (its h2) instead of four times.
 * They take the theme's heading font to look the same as an h3.
 */
.oh .oh__subtitle,
.oh .oh__panel-title {
	font-family: 'SharpGrotesk Book 23', 'SharpGrotesk Book 19', sans-serif;
	font-weight: 500;
}

.oh .oh__subtitle {
	color: var(--oh-navy);
	font-size: 18px;
	line-height: 24px;
	margin: 0;
}

/* ---- Chart panel + stats bar -------------------------------------------- */

.oh__figure {
	border-radius: 16px;
	display: flex;
	flex-wrap: wrap;
	margin: 0;
	overflow: hidden;
}

.oh__panel {
	background: var(--oh-navy);
	box-sizing: border-box;
	display: flex;
	flex: 999 1 420px;
	flex-direction: column;
	gap: 14px;
	justify-content: center;
	min-width: 0;
	padding: 28px 24px 20px;
}

.oh .oh__panel-title {
	color: #fff;
	font-size: 20px;
	line-height: 26px;
	margin: 0;
	text-align: center;
}

.oh .oh__panel-note {
	color: #B9C9D8;
	font-size: 12px;
	line-height: 17px;
	margin: 0;
}

.oh-chart {
	display: block;
	height: auto;
	width: 100%;
}

.oh-chart--narrow {
	display: none;
}

.oh-chart text {
	fill: #B9C9D8;
	font-size: 20px;
}

.oh-chart--narrow text {
	font-size: 13px;
}

/* A navy outline behind every label keeps it readable where it crosses a line. */
.oh-chart text {
	paint-order: stroke;
	stroke: var(--oh-navy);
	stroke-linejoin: round;
	stroke-width: 5px;
}

.oh-chart text.oh-chart__ring-label {
	stroke: none;
}

.oh-chart__grid {
	stroke: #fff;
	stroke-dasharray: 7 7;
	stroke-opacity: 0.22;
	stroke-width: 1;
}

.oh-chart__standard {
	stroke: #fff;
	stroke-dasharray: 2 6;
	stroke-linecap: round;
	stroke-opacity: 0.75;
	stroke-width: 1.5;
}

.oh-chart__valuation {
	stroke: var(--oh-yellow);
	stroke-dasharray: 2 6;
	stroke-linecap: round;
	stroke-width: 2;
}

.oh-chart text.oh-chart__valuation-label {
	fill: var(--oh-yellow);
	font-weight: 600;
}

.oh-chart__area {
	fill: var(--oh-aqua);
	fill-opacity: 0.14;
}

.oh-chart__line {
	fill: none;
	stroke: var(--oh-aqua);
	stroke-linecap: round;
	stroke-linejoin: round;
	stroke-width: 4.5;
}

.oh-chart--narrow .oh-chart__line {
	stroke-width: 2.5;
}

.oh-chart__start {
	fill: var(--oh-aqua);
}

.oh-chart__ring {
	fill: var(--oh-navy);
	stroke: var(--oh-orange);
	stroke-width: 3;
}

.oh-chart--narrow .oh-chart__ring {
	stroke-width: 2.25;
}

.oh-chart text.oh-chart__ring-label {
	fill: #fff;
	font-size: 17px;
	font-weight: 700;
}

.oh-chart--narrow text.oh-chart__ring-label {
	font-size: 11.5px;
}

.oh-chart__now {
	fill: #fff;
	stroke: var(--oh-aqua);
	stroke-width: 3.5;
}

.oh-chart--narrow .oh-chart__now {
	stroke-width: 2.5;
}

.oh-chart text.oh-chart__now-label {
	fill: #fff;
	font-weight: 700;
}

.oh__stats {
	background: var(--oh-yellow);
	box-sizing: border-box;
	color: var(--oh-navy);
	display: flex;
	flex: 1 1 200px;
	flex-direction: column;
	gap: 16px;
	justify-content: center;
	margin: 0;
	padding: 24px 20px;
	text-align: center;
}

.oh__stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.oh__stat + .oh__stat:not(.oh__stat--valuation) {
	border-top: 1px solid rgba(2, 29, 73, 0.3);
	padding-top: 16px;
}

.oh__stats dt {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 16px;
	text-transform: uppercase;
}

.oh__stats dd {
	margin: 0;
}

.oh__stat-value {
	font-size: 34px;
	font-weight: 600;
	line-height: 40px;
}

.oh__stat-note {
	font-size: 13px;
	line-height: 18px;
}

.oh__stat--valuation {
	background: var(--oh-navy);
	border-radius: 10px;
	color: #fff;
	gap: 0;
	padding: 10px 12px;
}

.oh__stat--valuation dt {
	color: var(--oh-yellow);
	font-size: 11px;
}

.oh__stat--valuation .oh__stat-value {
	font-size: 26px;
	line-height: 32px;
}

/* ---- "How often" bar ---------------------------------------------------- */

.oh__share {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.oh__share-bar {
	border-radius: 7px;
	display: flex;
	gap: 2px;
	height: 14px;
	overflow: hidden;
}

.oh__share-bar span {
	display: block;
	min-width: 6px;
}

.oh .oh__share-legend {
	display: flex;
	flex-wrap: wrap;
	font-size: 14px;
	gap: 6px 24px;
	line-height: 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.oh__share-legend li {
	margin: 0;
	padding: 0;
}

.oh__swatch {
	border-radius: 2px;
	display: inline-block;
	height: 10px;
	margin-right: 6px;
	width: 10px;
}

/* ---- Table -------------------------------------------------------------- */

.oh__history {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.oh__table-wrap {
	border: 1px solid #D9E1E8;
	border-radius: 10px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.oh .oh-table {
	background: transparent;
	border-collapse: collapse;
	display: table;
	font-size: 15px;
	line-height: 22px;
	margin: 0;
	width: 100%;
}

.oh .oh-table thead {
	border-bottom: 0;
}

.oh .oh-table th,
.oh .oh-table td {
	background: transparent;
	border: 0;
	border-bottom: 1px solid var(--oh-rule);
	box-shadow: none;
	color: var(--oh-navy);
	margin: 0;
	max-width: none;
	min-width: 0;
	padding: 14px;
	position: static;
	text-align: left;
	vertical-align: middle;
}

.oh .oh-table th::after,
.oh .oh-table td::after {
	content: none;
}

.oh .oh-table th {
	background: var(--oh-gray);
	border-bottom: 0;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 16px;
	padding: 12px 14px;
	text-transform: uppercase;
}

.oh .oh-table tbody:last-of-type tr:last-child td {
	border-bottom: 0;
}

.oh .oh-table .oh-num {
	text-align: right;
}

.oh .oh-table .oh-date {
	color: #33475A;
}

/* A date range may break after the dash, never inside a date. */
.oh .oh-table .oh-date time {
	white-space: nowrap;
}

.oh .oh-table .oh-cost {
	white-space: nowrap;
}

.oh-cost__value {
	display: block;
	font-size: 16px;
	font-weight: 700;
}

.oh-gap {
	color: var(--oh-muted);
	display: block;
	font-size: 12px;
	line-height: 18px;
}

.oh .oh-table .oh-row--current td {
	background: #E8F5F8;
}

/* The CTA sits on its own row under the current deal, inside the same tinted band. */
.oh .oh-table .oh-row--has-cta td {
	border-bottom: 0;
	padding-bottom: 10px;
}

.oh .oh-table .oh-row--cta td {
	padding-bottom: 16px;
	padding-top: 0;
}

.oh-deal {
	font-weight: 600;
}

.oh-muted {
	color: var(--oh-muted);
	font-size: 13px;
	white-space: nowrap;
}

.oh-badge {
	border-radius: 999px;
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	line-height: 16px;
	margin-left: 6px;
	padding: 2px 8px;
	text-transform: uppercase;
	vertical-align: 2px;
	white-space: nowrap;
}

.oh-badge--now {
	background: var(--oh-navy);
	color: #fff;
}

.oh-badge--best {
	background: #FFE4D6;
	color: #AD3400;
}

.oh-badge--upcoming {
	background: var(--oh-gray);
	color: var(--oh-navy);
}

.oh .oh-table td a.oh-cta,
.oh a.oh-cta {
	background: var(--oh-navy);
	border: 0 !important;
	border-radius: 999px;
	box-sizing: border-box;
	color: #fff !important;
	display: block;
	font-size: 14px;
	font-weight: 600;
	line-height: 22px;
	min-height: 44px;
	padding: 11px 16px;
	text-align: center;
	text-decoration: none !important;
	text-transform: none;
	width: auto;
}

.oh .oh-table td a.oh-cta:hover,
.oh .oh-table td a.oh-cta:focus,
.oh a.oh-cta:hover,
.oh a.oh-cta:focus {
	background: var(--oh-slate);
}

.oh .oh__toggle-wrap {
	margin: 4px 0 0;
	text-align: center;
}

.oh__toggle {
	background: #fff;
	border: 1.5px solid var(--oh-navy);
	border-radius: 999px;
	color: var(--oh-navy);
	cursor: pointer;
	font: inherit;
	font-size: 15px;
	font-weight: 600;
	min-height: 44px;
	padding: 10px 24px;
}

.oh__toggle:hover,
.oh__toggle:focus {
	background: var(--oh-tint);
}

.oh .oh__footnote {
	color: var(--oh-muted);
	font-size: 13px;
	line-height: 20px;
	margin: 0;
}

/*
 * ---- Narrow layout --------------------------------------------------------
 *
 * Applied when the unit itself is under 620px wide, whatever the screen
 * size, so it also holds in a narrow content column. Browsers without
 * container queries get the same rules below 768px of screen width.
 */

@container oh (max-width: 619.98px) {

	.oh .oh__title {
		font-size: 26px;
		line-height: 31px;
	}

	.oh .oh__verdict {
		font-size: 15px;
		line-height: 22px;
		padding: 14px 16px;
	}

	.oh__figure {
		border-radius: 14px;
	}

	.oh__panel {
		flex-basis: 100%;
		gap: 10px;
		padding: 20px 12px 14px;
	}

	.oh .oh__panel-title {
		font-size: 18px;
		line-height: 24px;
	}

	.oh-chart--wide {
		display: none;
	}

	.oh-chart--narrow {
		display: block;
	}

	/* Stats run three across under the chart; the valuation takes its own row. */
	.oh__stats {
		flex: 1 1 100%;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 12px 4px;
		padding: 16px 8px;
	}

	.oh__stat {
		flex: 1 1 0;
		min-width: 0;
	}

	.oh__stat + .oh__stat:not(.oh__stat--valuation) {
		border-top: 0;
		padding-top: 0;
	}

	.oh__stats dt {
		font-size: 10px;
		letter-spacing: 0.05em;
		line-height: 14px;
	}

	.oh__stat-value {
		font-size: 20px;
		line-height: 26px;
	}

	.oh__stat-note {
		font-size: 11px;
		line-height: 15px;
	}

	.oh__stat--valuation {
		align-items: baseline;
		flex: 1 1 100%;
		flex-direction: row;
		flex-wrap: wrap;
		gap: 2px 8px;
		justify-content: center;
		margin: 0 8px;
	}

	.oh__stat--valuation .oh__stat-value {
		font-size: 18px;
		line-height: 24px;
	}

	/*
	 * The table becomes a list of cards: dates and price on the first line,
	 * the promotion and the gap to our valuation on the second, and the CTA
	 * full width under the current deal. Nothing scrolls sideways.
	 */
	.oh .oh-table,
	.oh .oh-table tbody,
	.oh .oh-table td {
		display: block;
	}

	.oh .oh-table tbody[hidden] {
		display: none;
	}

	.oh .oh-table thead {
		clip: rect(0, 0, 0, 0);
		height: 1px;
		overflow: hidden;
		position: absolute;
		width: 1px;
	}

	.oh .oh-table tr {
		border-bottom: 1px solid var(--oh-rule);
		display: grid;
		gap: 2px 12px;
		grid-template-areas:
			"date cost"
			"promo cost";
		grid-template-columns: minmax(0, 1fr) auto;
		padding: 14px 16px;
	}

	.oh .oh-table tbody:last-of-type tr:last-child {
		border-bottom: 0;
	}

	.oh .oh-table .oh-row--current {
		background: #E8F5F8;
	}

	.oh .oh-table td,
	.oh .oh-table .oh-row--current td {
		background: transparent;
		border: 0;
		padding: 0;
	}

	.oh .oh-table .oh-date {
		font-size: 12px;
		grid-area: date;
		line-height: 18px;
	}

	.oh .oh-table .oh-promo {
		grid-area: promo;
	}

	.oh .oh-table .oh-cost {
		grid-area: cost;
	}

	.oh .oh-table .oh-row--has-cta {
		border-bottom: 0;
		padding-bottom: 12px;
	}

	.oh .oh-table .oh-row--cta {
		display: block;
		padding-top: 0;
	}

}

@supports not (container-type: inline-size) {
	@media (max-width: 767.98px) {

		.oh .oh__title {
			font-size: 26px;
			line-height: 31px;
		}

		.oh .oh__verdict {
			font-size: 15px;
			line-height: 22px;
			padding: 14px 16px;
		}

		.oh__figure {
			border-radius: 14px;
		}

		.oh__panel {
			flex-basis: 100%;
			gap: 10px;
			padding: 20px 12px 14px;
		}

		.oh .oh__panel-title {
			font-size: 18px;
			line-height: 24px;
		}

		.oh-chart--wide {
			display: none;
		}

		.oh-chart--narrow {
			display: block;
		}

		/* Stats run three across under the chart; the valuation takes its own row. */
		.oh__stats {
			flex: 1 1 100%;
			flex-direction: row;
			flex-wrap: wrap;
			gap: 12px 4px;
			padding: 16px 8px;
		}

		.oh__stat {
			flex: 1 1 0;
			min-width: 0;
		}

		.oh__stat + .oh__stat:not(.oh__stat--valuation) {
			border-top: 0;
			padding-top: 0;
		}

		.oh__stats dt {
			font-size: 10px;
			letter-spacing: 0.05em;
			line-height: 14px;
		}

		.oh__stat-value {
			font-size: 20px;
			line-height: 26px;
		}

		.oh__stat-note {
			font-size: 11px;
			line-height: 15px;
		}

		.oh__stat--valuation {
			align-items: baseline;
			flex: 1 1 100%;
			flex-direction: row;
			flex-wrap: wrap;
			gap: 2px 8px;
			justify-content: center;
			margin: 0 8px;
		}

		.oh__stat--valuation .oh__stat-value {
			font-size: 18px;
			line-height: 24px;
		}

		/*
		 * The table becomes a list of cards: dates and price on the first line,
		 * the promotion and the gap to our valuation on the second, and the CTA
		 * full width under the current deal. Nothing scrolls sideways.
		 */
		.oh .oh-table,
		.oh .oh-table tbody,
		.oh .oh-table td {
			display: block;
		}

		.oh .oh-table tbody[hidden] {
			display: none;
		}

		.oh .oh-table thead {
			clip: rect(0, 0, 0, 0);
			height: 1px;
			overflow: hidden;
			position: absolute;
			width: 1px;
		}

		.oh .oh-table tr {
			border-bottom: 1px solid var(--oh-rule);
			display: grid;
			gap: 2px 12px;
			grid-template-areas:
				"date cost"
				"promo cost";
			grid-template-columns: minmax(0, 1fr) auto;
			padding: 14px 16px;
		}

		.oh .oh-table tbody:last-of-type tr:last-child {
			border-bottom: 0;
		}

		.oh .oh-table .oh-row--current {
			background: #E8F5F8;
		}

		.oh .oh-table td,
		.oh .oh-table .oh-row--current td {
			background: transparent;
			border: 0;
			padding: 0;
		}

		.oh .oh-table .oh-date {
			font-size: 12px;
			grid-area: date;
			line-height: 18px;
		}

		.oh .oh-table .oh-promo {
			grid-area: promo;
		}

		.oh .oh-table .oh-cost {
			grid-area: cost;
		}

		.oh .oh-table .oh-row--has-cta {
			border-bottom: 0;
			padding-bottom: 12px;
		}

		.oh .oh-table .oh-row--cta {
			display: block;
			padding-top: 0;
		}

	}
}
