/*
 * Size guide — the garment measurement tables (D97).
 *
 * One mechanism for any number of garments: each garment is a `.size-chart`
 * with a serif title, an optional `.size-chart__group` label (TOP / BRA /
 * PANTS), and a real <table>. The header row carries a
 * `--surface-brand-subtle` band.
 *
 * Typography follows F2: the garment name is a display heading (so it inherits
 * the title face and the ramp), the column headers are type.label — tracked
 * caps in text.secondary — and the numbers are type.body with tabular figures.
 *
 * The numbers are **right-aligned**: a column of measurements is read by
 * scanning down it, and right alignment puts every decimal point on one axis.
 * That matters most on a phone, where the columns collapse to content width and
 * left-aligned ranges (`26.8 – 29.1` under `35.4 – 38.6`) come out visibly
 * ragged. SIZE stays left — it is a label, not a value.
 */

.entry-content .size-chart {
	max-width: 900px;
	margin-inline: auto;
}

.size-chart + .size-chart {
	margin-block-start: var(--space-16);
}

/* The garment name sits centred above its chart; the WP heading already comes
   from the display ramp, so only the centring and rhythm are set here. The
   `--space-8` below replaces the gap the removed "— SIZE GUIDE —" divider used
   to provide — without it the title sat flush against its table. */
.entry-content .size-chart__title {
	text-align: center;
	margin: 0 0 var(--space-8);
}

/* The "— SIZE GUIDE —" divider is removed (D126). It repeated the page's own
   name above every garment — three times on this page — and the garment title
   alone reads cleanly. The rule that drew it (a flex row with a hairline each
   side, plus its `::before`/`::after` and `span`) is **deleted rather than
   hidden**: nothing references `.size-chart__divider` any more. */

/* Optional sub-section name inside a multi-part garment (TOP, BRA, PANTS). */
.entry-content .size-chart__group {
	font-size: var(--text-xl);
	font-weight: var(--weight-medium);
	margin: 0 0 var(--space-4);
}

.size-chart__table {
	width: 100%;
	border-collapse: collapse;
	margin-block: 0 var(--space-6);
}

.size-chart__table caption {
	caption-side: top;
	text-align: left;
	font-size: var(--text-sm);
	color: var(--text-tertiary);
	padding-bottom: var(--space-4);
}

.size-chart__table th,
.size-chart__table td {
	padding-block: var(--space-4);
	padding-inline: var(--space-4);
	vertical-align: bottom;
}

/* SIZE is a label, not a value, so it is left-aligned and sized to its content
   (`S / M / L / XL` never need more than ~60px). Without the width cap the
   column swallowed a third of the table and pushed the data right. */
.size-chart__table thead th:first-child,
.size-chart__table tbody th {
	text-align: left;
	width: 1%;
	white-space: nowrap;
}

/* Every other column is a measurement — right-aligned so the decimal points
   share an axis (F2 §7). */
.size-chart__table thead th:not(:first-child),
.size-chart__table tbody td {
	text-align: right;
}

/* Column headers — type.label: tracked caps, Clay 600. The (elastic) qualifier
   is a second line inside the same header cell, so it stays attached to the
   column it describes. One step above type.label (text.sm rather than text.xs)
   so the names hold their own against the numbers beneath them. */
.size-chart__table thead th {
	font-size: var(--text-sm);
	font-weight: var(--weight-medium);
	letter-spacing: var(--tr-text-xs);
	text-transform: uppercase;
	color: var(--text-secondary);
	line-height: 1.4;
}

/* Body — numbers are type.body (16/17) at 1.60 with tabular lining figures so
   the columns line up; the size letter is the row header, at text.lg. */
.size-chart__table tbody th {
	font-size: var(--text-lg);
	font-weight: var(--weight-medium);
	color: var(--text-primary);
}
.size-chart__table tbody td {
	font-size: var(--text-md);
	font-weight: var(--weight-regular);
	color: var(--text-primary);
	font-variant-numeric: tabular-nums lining-nums;
}

/* The header row carries the tint — the column names sit in a blush band so the
   table reads from the top. */
.size-chart__table thead tr {
	background: var(--surface-brand-subtle);
}

/* Multi-part garments separate their groups with a hairline. */
.size-chart__group + .size-chart__table + .size-chart__group,
.size-chart__table + .size-chart__group {
	margin-top: var(--space-10);
	padding-top: var(--space-10);
	border-top: var(--border-width-hairline) solid var(--border-subtle);
}

/* Closing note — "All pieces are stretchy…" in the muted caption role. */
.size-chart__note {
	margin-block-start: var(--space-6);
	text-align: center;
	font-size: var(--text-sm);
	letter-spacing: var(--tr-text-sm);
	text-transform: uppercase;
	color: var(--text-tertiary);
}
.size-chart__note p {
	margin: 0;
	font-size: inherit;
	letter-spacing: inherit;
}

@media (max-width: 599px) {
	.size-chart__table th,
	.size-chart__table td {
		padding-inline: var(--space-2);
		padding-block: var(--space-3);
	}
	.size-chart__table thead th {
		font-size: var(--text-xs);
	}
	.size-chart__table tbody td {
		font-size: var(--text-sm);
	}
}
