/**
 * Compact inject on Ringspo's legacy ring-buying-guide posts.
 * Loaded only on matching permalinks — not on LDN rewrite routes.
 *
 * This HTML sits in a normal WP article, not `.ldn-chrome--ringspo-classic`.
 * Do not invent a tinted outlined box (AI tell). Follow Ringspo: unboxed
 * sections, theme headings, white chart surface with 12px radius + shadow.
 *
 * The inject paints no band of its own. Colour sections (Best Place To Buy,
 * purple blocks) are GenerateBlocks in the WordPress post. Break out the
 * `.gb-container` that owns the band background: a direct white or base-3
 * section title, the shape carousel, and the teal wrap behind the Alon card.
 * Do not break out inset white review cards (`h3.gb-headline-text`).
 */

body.ldn-editorial-ring-guide {
	overflow-x: clip;
}

/* GenerateBlocks colour bands sit inside an ~800px `.gb-inside-container`.
 * Break out the container that paints the band, not every ancestor wrapper.
 * Ancestor inside-containers must not clip the negative margin. */
body.ldn-editorial-ring-guide .entry-content .gb-inside-container {
	overflow: visible;
}

body.ldn-editorial-ring-guide .entry-content .gb-container:has(
	> .gb-inside-container > :is(h1, h2, h3):is(.has-white-color, .has-base-3-color, .links-color-white)
):not(:has(> .gb-inside-container > h3.gb-headline-text)) {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding-left: calc(50vw - 50%);
	padding-right: calc(50vw - 50%);
	max-width: none;
	width: auto;
}

/* The shape carousel and the Alon wrap paint the same colour as the band
 * above them and have no section title, so they use the same breakout.
 * The white Alon card stays in the column. On a phone the band still
 * spans the screen. */
body.ldn-editorial-ring-guide .entry-content .gb-container:has(
	> .gb-inside-container > .wpsisac-slick-carousal-wrp
),
body.ldn-editorial-ring-guide .entry-content .gb-container:has(
	> .gb-inside-container > .gb-container > .gb-inside-container > .gb-grid-wrapper > .gb-grid-column > .gb-container > .gb-inside-container > h3.gb-headline-text
) {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding-left: calc(50vw - 50%);
	padding-right: calc(50vw - 50%);
	max-width: none;
	width: auto;
}

/* Best Place To Buy is a coloured wrapper around the heading container.
 * The heading container already breaks out, and the wrapper's own padding
 * then shows as white at the sides. Break the wrapper out and let the
 * heading container sit in that column, so the teal is one band. */
body.ldn-editorial-ring-guide .entry-content .gb-container:not(:has(.ldn-ring-guide)):not(:has(.wpsisac-slick)):has(
	> .gb-inside-container > .gb-container > .gb-inside-container > h2.has-base-3-color
) {
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
	padding-left: calc(50vw - 50%);
	padding-right: calc(50vw - 50%);
	max-width: none;
	width: auto;
}

body.ldn-editorial-ring-guide .entry-content .gb-container:not(:has(.ldn-ring-guide)):not(:has(.wpsisac-slick)):has(
	> .gb-inside-container > .gb-container > .gb-inside-container > h2.has-base-3-color
) > .gb-inside-container > .gb-container {
	margin-left: 0;
	margin-right: 0;
	padding-left: 0;
	padding-right: 0;
	max-width: none;
	width: auto;
}

.ldn-ring-guide,
.ldn-ring-guide__card {
	max-width: 42rem;
}

.ldn-ring-guide__card {
	margin: 2rem 0;
	padding: 0;
	border: none;
	background: transparent;
}

.ldn-ring-guide__card h2 {
	margin: 0 0 0.75rem;
}

.ldn-ring-guide__card p {
	margin: 0 0 0.75rem;
}

.ldn-ring-guide__figure {
	margin: 0 0 1.5rem;
	overflow: hidden;
}

.ldn-ring-guide__figure img,
.ldn-ring-guide__figure .ldn-ring-guide__chart {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 12px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
	background: #fff;
}

.ldn-ring-guide__figure figcaption,
.ldn-ring-guide__figure-note {
	margin: 0.4rem 0 0;
	font-size: inherit;
	font-style: normal;
	line-height: 1.5;
	color: #4a4a68;
}

.ldn-ring-guide__chart--distribution {
	min-height: 12rem;
	aspect-ratio: 760 / 320;
	overflow: hidden;
}

.ldn-ring-guide__cta {
	font-weight: 600;
	color: #706cc8;
	text-decoration: none;
}

.ldn-ring-guide__cta:hover,
.ldn-ring-guide__cta:focus-visible {
	color: #5249a3;
	text-decoration: underline;
}

/* Price ladder and comparison tables use the house `.ldn-table-card` +
 * `.ldn-data-table` from shared.css. Do not restyle cells here: a table
 * style change belongs in shared.css so price pages and ring guides stay
 * in lockstep.
 *
 * Three narrow columns survive 320px without a scroller. The wrap only
 * catches a locale that renders long money strings, and the heading sits
 * outside it so overflow cannot clip the title.
 */
.ldn-ring-guide__ladder-wrap {
	overflow: visible;
	margin: 0 0 0.75rem;
}

.ldn-ring-guide__table-heading {
	margin: 0 0 0.5rem;
	font-size: inherit;
	font-weight: 600;
	line-height: 1.4;
}

.ldn-ring-guide__ladder-wrap .ldn-table-card {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	margin-bottom: 0;
}

.ldn-ring-guide__ladder tbody th,
.ldn-ring-guide__compare-table tbody th {
	white-space: nowrap;
}

@media (max-width: 400px) {
	.ldn-ring-guide__ladder,
	.ldn-ring-guide__compare-table {
		font-size: 0.875rem;
	}

	.ldn-ring-guide__ladder th,
	.ldn-ring-guide__ladder td,
	.ldn-ring-guide__compare-table th,
	.ldn-ring-guide__compare-table td {
		padding: 0.5rem 0.55rem;
	}
}

/* In-body replacement for a hand-built price table.
 *
 * Unboxed on purpose. It stands where the reader's own table stood, so it takes
 * the article's type and spacing instead of announcing itself as a widget. The
 * only rules are the table's own cell hairlines.
 */
.ldn-ring-guide__compare {
	margin: 0 0 1.25rem;
}

.ldn-ring-guide__compare p {
	margin: 0.5rem 0 0;
}

.ldn-ring-guide__updated {
	margin: 0.5rem 0 0;
	font-size: 0.9rem;
	color: #4a4a68;
}

/* True-mm shape row (hub): live medians + outline SVGs + US quarter.
 *
 * Layout is a 2-column grid: quarter is intrinsic width, shapes fill the
 * rest. Do not put width:100% on the shared item class - the quarter uses
 * that class too, and 100% in a row made it eat the canvas and crush the
 * diamonds into a one-character column.
 */
.ldn-ring-guide__size-chart {
	container-type: inline-size;
	margin: 0 0 0.75rem;
	--chart-purple: #706cc8;
	--chart-purple-deep: #5249a3;
	--chart-ink: #1a1a2e;
}

.ldn-ring-guide__size-chart-kicker {
	margin: 0 0 0.65rem;
	font-family: "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
	font-size: 1.05rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--chart-ink);
}

.ldn-ring-guide__size-chart-canvas {
	--px-per-mm: 5.5;
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	column-gap: 1.1rem;
	row-gap: 1rem;
	padding: 1.2rem 1.1rem 1rem;
	background-color: #fff;
	background-image:
		linear-gradient(to right, rgba(112, 108, 200, 0.09) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(112, 108, 200, 0.09) 1px, transparent 1px);
	background-size: calc(5 * var(--px-per-mm) * 1px) calc(5 * var(--px-per-mm) * 1px);
	background-position: center;
	border-radius: 12px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.14);
}

.ldn-ring-guide__size-chart-shapes {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 0.85rem 0.45rem;
	min-width: 0;
	align-items: stretch;
	justify-items: stretch;
}

.ldn-ring-guide__size-item {
	display: grid;
	grid-template-rows: minmax(0, 1fr) auto auto;
	justify-items: center;
	align-items: end;
	gap: 0.3rem;
	min-width: 0;
	color: inherit;
	text-decoration: none;
}

.ldn-ring-guide__size-chart-shapes .ldn-ring-guide__size-item {
	width: 100%;
}

.ldn-ring-guide__size-item--quarter {
	width: auto;
	max-width: 100%;
	justify-self: center;
}

a.ldn-ring-guide__size-item:hover .ldn-ring-guide__size-label,
a.ldn-ring-guide__size-item:focus-visible .ldn-ring-guide__size-label {
	text-decoration: underline;
}

a.ldn-ring-guide__size-item:hover .ldn-ring-guide__size-stone svg,
a.ldn-ring-guide__size-item:focus-visible .ldn-ring-guide__size-stone svg {
	color: var(--chart-purple-deep);
}

.ldn-ring-guide__size-stone {
	display: block;
	width: calc(var(--mm-w) * var(--px-per-mm) * 1px);
	max-width: 100%;
	height: auto;
	aspect-ratio: var(--mm-w) / var(--mm-l);
}

.ldn-ring-guide__size-item--quarter .ldn-ring-guide__size-stone {
	border-radius: 50%;
	overflow: hidden;
	background: transparent;
}

.ldn-ring-guide__size-stone svg,
.ldn-ring-guide__size-stone img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/*
 * Facet SVGs mix filled ribbons and source stroke-widths, then get
 * stretched by each stone's millimetres. Drop the fill and pin stroke
 * to screen pixels so every shape shares one line weight.
 */
.ldn-ring-guide__size-stone svg {
	color: var(--chart-purple);
	overflow: hidden;
}

.ldn-ring-guide__size-stone svg path {
	fill: none !important;
	stroke: var(--chart-purple);
	stroke-width: 0.75px !important;
	stroke-linejoin: round;
	stroke-linecap: round;
	vector-effect: non-scaling-stroke;
}

.ldn-ring-guide__size-label,
.ldn-ring-guide__size-dims {
	max-width: 100%;
	line-height: 1.2;
	text-align: center;
	overflow-wrap: break-word;
}

.ldn-ring-guide__size-label {
	font-size: 0.8rem;
	font-weight: 700;
	color: var(--chart-ink);
}

.ldn-ring-guide__size-dims {
	font-size: 0.68rem;
	color: #4a4a68;
}

.ldn-ring-guide__size-chart figcaption {
	margin-top: 1.15rem;
	font-size: inherit;
	font-family: inherit;
	font-style: normal;
	line-height: inherit;
	color: inherit;
}

/* Narrow article or viewport: quarter on top, shapes in two columns. */
@container (max-width: 36rem) {
	.ldn-ring-guide__size-chart-canvas {
		--px-per-mm: 5;
		grid-template-columns: minmax(0, 1fr);
		padding: 1rem 0.85rem 0.85rem;
	}

	.ldn-ring-guide__size-chart-shapes {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem 0.75rem;
	}
}

@media (max-width: 640px) {
	.ldn-ring-guide__size-chart-canvas {
		--px-per-mm: 5;
		grid-template-columns: minmax(0, 1fr);
		padding: 1rem 0.85rem 0.85rem;
	}

	.ldn-ring-guide__size-chart-shapes {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem 0.75rem;
	}
}

/* Slide titles are paragraphs so the contents list stays the article
 * sections. The carousel plugin paints these metrics on h2 only.
 * The title wraps inside the slide at phone width. The plugin still
 * shows one slide. */
body.ldn-editorial-ring-guide p.wpsisac-slide-title {
	line-height: normal;
	padding-top: 0;
	padding-bottom: 0;
	color: #444444;
	margin: 5px 0 !important;
	font-size: 22px !important;
}

body.ldn-editorial-ring-guide p.wpsisac-slide-title a,
body.ldn-editorial-ring-guide p.wpsisac-slide-title a:visited,
body.ldn-editorial-ring-guide p.wpsisac-slide-title a:hover,
body.ldn-editorial-ring-guide p.wpsisac-slide-title a:focus {
	line-height: normal;
	color: #444444;
	text-decoration: none;
	outline: 0;
	font-size: 22px !important;
}
