/* ============================================================
   BWL — Competition Results
   A medal-node timeline inside the 1333px (10/12) centred area.
   Each row: [rail: medal + connector line] [main: header toggle,
   collapsible panel (rich text + peach sub-pills), download button].
   Desktop-first; mobile stacks/shrinks at the bottom.
   ============================================================ */

.bwl-results {
	--bwl-navy: #00085e;
	--bwl-orange: #ff4a00;
	--bwl-peach: #fbede6;
	--bwl-content: 1600px;
	--bwl-gutter: 24px;

	/* TWEAK timeline geometry */
	--cr-rail: 68px;            /* medal width / rail column */
	--cr-rail-gap: 43px;        /* rail → content gap (Figma 111 − 68) */
	--cr-node: 40px;            /* medal centre from the row top (connector anchor) */
	--cr-gap: 72px;             /* vertical gap between rows */

	padding: 60px 0;
	font-family: var(--bwl-font, Arial, Helvetica, sans-serif);
	color: var(--bwl-navy);
}

.bwl-results__inner {
	max-width: var(--bwl-content);   /* 1600 container, centred in the viewport */
	margin-inline: auto;
	padding-inline: var(--bwl-gutter);
}
/* Content spans 11/12 columns, flush to the container's LEFT edge
   (the spare 1/12 falls on the right). */
.bwl-results__title,
.bwl-results__list {
	max-width: calc(var(--bwl-content) / 12 * 11);   /* 11/12 ≈ 1467px */
}

.bwl-results__title {
	margin: 0 0 48px;
	font-size: 40px;
	font-weight: 900;
	line-height: 40px;
	text-transform: uppercase;
	color: var(--bwl-navy);
}

/* --- Timeline rows --- */
.bwl-results__row {
	position: relative;
	display: grid;
	grid-template-columns: var(--cr-rail) minmax(0, 1fr);
	column-gap: var(--cr-rail-gap);
	align-items: start;
}
.bwl-results__row + .bwl-results__row { margin-top: var(--cr-gap); }

/* Connector: from this medal's centre down to the next medal's centre. */
.bwl-results__row:not(:last-child)::before {
	content: "";
	position: absolute;
	left: calc(var(--cr-rail) / 2);
	top: var(--cr-node);
	height: calc(100% + var(--cr-gap));
	width: 1px;
	background: var(--bwl-navy);
	transform: translateX(-0.5px);
	z-index: 0;
}

.bwl-results__rail {
	position: relative;
	z-index: 1;                 /* the opaque medal covers the line ends */
}
.bwl-results__medal { display: block; width: var(--cr-rail); height: auto; }

.bwl-results__main { min-width: 0; }

/* --- Row header (title + View/Hide toggle) --- */
.bwl-results__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;
	min-height: 80px;           /* aligns the title's centre with the medal centre */
}
.bwl-results__rowtitle {
	margin: 0;
	font-size: 32px;
	font-weight: 700;
	line-height: 40px;
	color: var(--bwl-navy);
}

/* Toggle button (text label + plus/minus circle) */
.bwl-results__toggle,
.bwl-results__item-head {
	display: inline-flex;
	align-items: center;
	gap: 16px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	color: var(--bwl-navy);
	font-family: inherit;
}
.bwl-results__toggle { flex: 0 0 auto; }
.bwl-results__toggle-label {
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
}
.bwl-results__lbl--hide { display: none; }
.bwl-results__toggle[aria-expanded="true"] .bwl-results__lbl--show { display: none; }
.bwl-results__toggle[aria-expanded="true"] .bwl-results__lbl--hide { display: inline; }

.bwl-results__pm { flex: 0 0 auto; display: block; }
.bwl-results__pm-v { transition: opacity 0.15s ease; }
[aria-expanded="true"] .bwl-results__pm-v { opacity: 0; }   /* plus → minus */

/* --- Collapsible panel --- */
.bwl-results__panel { margin-top: 8px; }
.bwl-results__panel[hidden],
.bwl-results__item-panel[hidden] { display: none; }

.bwl-results__body {
	font-size: 20px;
	font-weight: 400;
	line-height: 24px;
	color: var(--bwl-navy);
}
.bwl-results__body p { margin: 0 0 1em; }
.bwl-results__body p:last-child { margin-bottom: 0; }
.bwl-results__body a { color: var(--bwl-navy); text-decoration: underline; }

/* --- Peach sub-pills --- */
.bwl-results__items {
	display: flex;
	flex-direction: column;
	gap: 30px;                  /* TWEAK gap between pills (Figma 526 − 415 − 81 ≈ 30) */
	margin-top: 16px;
}
.bwl-results__item {
	background: var(--bwl-peach);
	border: 1px solid var(--bwl-orange);
	border-radius: 20px;
}
.bwl-results__item-head {
	width: 100%;
	justify-content: space-between;
	min-height: 81px;
	padding: 16px 28px;         /* Figma title inset 139 − 111 = 28 */
	gap: 24px;
}
.bwl-results__item-head[disabled] { cursor: default; }
.bwl-results__item-head[disabled] .bwl-results__pm { opacity: 0.35; }
.bwl-results__item-title {
	font-size: 26px;
	font-weight: 700;
	line-height: 1.2;
	color: var(--bwl-navy);
	text-align: left;
}
.bwl-results__item-panel { padding: 8px 28px 40px; }

/* --- Expanded pill: two-column grid of weight categories --- */
.bwl-results__cats {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 40px;            /* TWEAK category column gap */
	row-gap: 60px;               /* TWEAK gap between category blocks */
}
.bwl-results__cat-title {
	margin: 0 0 20px;
	font-size: 20px;
	font-weight: 900;
	line-height: 1;
	text-transform: uppercase;
	color: var(--bwl-navy);
}
.bwl-results__medals {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 20px;                   /* TWEAK gap between medallist rows */
}
.bwl-results__medallist {
	display: flex;
	align-items: flex-start;
	gap: 22px;                   /* badge → text gap (Figma 84 − 27 − 35) */
}
.bwl-results__place {
	position: relative;
	flex: 0 0 35px;
	width: 35px;
	height: 41px;
}
.bwl-results__place-svg { display: block; }
.bwl-results__place-num {
	position: absolute;
	left: 0;
	top: 6px;                    /* centre of the 35px circle (below the ribbon) */
	width: 35px;
	height: 35px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #ffffff;
	font-size: 20px;
	font-weight: 900;
	line-height: 1;
}
.bwl-results__medal-text {
	margin: 0;
	max-width: 440px;
	color: var(--bwl-navy);
	font-size: 20px;
	font-weight: 400;
	line-height: 24px;
}
.bwl-results__medal-text strong { font-weight: 700; }

/* categories + free-text both present: space them apart */
.bwl-results__cats + .bwl-results__item-body { margin-top: 32px; }
.bwl-results__item-body {
	font-size: 20px;
	font-weight: 400;
	line-height: 24px;
	color: var(--bwl-navy);
}
.bwl-results__item-body p { margin: 0 0 1em; }
.bwl-results__item-body p:last-child { margin-bottom: 0; }
.bwl-results__item-body a { color: var(--bwl-navy); text-decoration: underline; }

/* --- Download button (outline pill) --- */
.bwl-results__dl {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin-top: 24px;           /* TWEAK gap above the download button */
	padding: 8px 20px;
	border-radius: 20px;
	box-shadow: inset 0 0 0 1px var(--bwl-navy);
	color: var(--bwl-navy);
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
	text-decoration: none;
	transition: opacity 0.15s ease;
}
.bwl-results__dl:hover { color: var(--bwl-navy); opacity: 0.7; }
.bwl-results__dl-icon { flex: 0 0 auto; }

.bwl-results__placeholder { color: #6b7280; }

/* --- Responsive (mobile Figma pass) ---
   No medal rail / connector line: rows become full-width stacks divided by
   horizontal navy lines. Toggles keep just the +/- circle. Sub-pills slim to
   68px / radius 16 with a 30px circle; medal badges shrink to 22px. */
@media (max-width: 999px) {
	.bwl-results { padding: 40px 0; }
	.bwl-results__title { font-size: 34px; line-height: 34px; margin-bottom: 42px; }

	/* rows: drop the medal rail + connector, divide with horizontal lines */
	.bwl-results__rail { display: none; }
	.bwl-results__row { grid-template-columns: minmax(0, 1fr); }
	.bwl-results__row:not(:last-child)::before { content: none; }
	.bwl-results__row {
		border-bottom: 1px solid var(--bwl-navy);
		padding-bottom: 30px;
	}
	.bwl-results__row + .bwl-results__row {
		margin-top: 0;
		padding-top: 30px;
	}

	/* header: 26/30 title, circle-only toggle aligned to the first line */
	.bwl-results__header { min-height: 0; align-items: flex-start; gap: 12px; }
	.bwl-results__rowtitle { font-size: 26px; line-height: 30px; }
	.bwl-results__toggle-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

	.bwl-results__panel { margin-top: 30px; }
	.bwl-results__items { margin-top: 0; }
	.bwl-results__dl { margin-top: 30px; }

	/* sub-pills: radius 16, slim head, 30px circle */
	.bwl-results__item { border-radius: 16px; }
	.bwl-results__item-head { min-height: 68px; padding: 14px 18px; }
	.bwl-results__item-title { font-size: 20px; }
	.bwl-results__item-head .bwl-results__pm { width: 30px; height: 30px; }
	.bwl-results__item-panel { padding: 4px 18px 32px; }

	/* categories: single column, small (22px) medal badges */
	.bwl-results__cats { grid-template-columns: minmax(0, 1fr); row-gap: 60px; }
	.bwl-results__cat-title { font-size: 20px; line-height: 22px; margin-bottom: 16px; }
	.bwl-results__medals { gap: 20px; }
	.bwl-results__medallist { gap: 16px; }
	.bwl-results__place { flex-basis: 22px; width: 22px; height: 26px; }
	.bwl-results__place-svg { width: 22px; height: 26px; }
	.bwl-results__place-num { top: 4px; width: 22px; height: 22px; font-size: 14px; }
	.bwl-results__medal-text { font-size: 16px; line-height: 22px; }
	.bwl-results__body,
	.bwl-results__item-body { font-size: 16px; line-height: 22px; }
}
