/* [wr_toplist] — whisky dashboard table. Design-system tokens (colors_and_type.css mirror).
   Breaks out of the page container to run full-width (CoinMarketCap style). */

/* Pages using the table widen their container (set via the wr-has-toplist body
   class) so the H1, intro and table all align in one wide column — CMC-style,
   no horizontal scroll on desktop. Header block (title + intro + filters) is
   centred; the table below runs the full container width. */
.wr-has-toplist .wr-page-wrap { max-width: 1340px; }
.wr-has-toplist .wr-page-title { text-align: center; }
.wr-page-lead {
	font-family: var(--font-body); font-size: 18px; line-height: 1.6; color: #111;
	max-width: 70ch; margin: 0 auto 28px; text-align: center;
}
.wr-toplist { margin: 8px 0 40px; }

/* --- controls bar --- */
.wr-tl-controls {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px 18px;
	margin-bottom: 22px; font-family: var(--font-notes);
}
.wr-tl-search, .wr-tl-brand {
	font-family: var(--font-notes); font-size: 15px; color: var(--fg-1);
	padding: 9px 13px; border: 1px solid var(--border-2); border-radius: var(--radius-md); background: #fff;
}
.wr-tl-search { min-width: 220px; flex: 1 1 220px; max-width: 320px; }

/* whisky finder: emphasised, full-width search bar on its own row */
.wr-toplist--hero .wr-tl-search {
	flex: 0 0 100%; max-width: 600px; margin: 0 auto 8px;
	font-size: 18px; padding: 16px 22px;
	border: 2px solid var(--border-2); border-radius: var(--radius-lg);
	box-shadow: var(--shadow-2);
}
.wr-toplist--hero .wr-tl-search:focus { border-color: var(--brand-cask); outline: 0; }
/* dual-handle (min/max) range slider */
.wr-tl-dual { display: inline-flex; flex-direction: column; gap: 7px; font-size: 13px; color: var(--fg-3); }
.wr-tl-dual-cap { white-space: nowrap; }
.wr-tl-dual-cap output { font-weight: 700; color: var(--fg-2); font-variant-numeric: tabular-nums; }
.wr-tl-dual-rail { position: relative; width: 190px; height: 20px; }
.wr-tl-dual-track { position: absolute; top: 8px; left: 0; right: 0; height: 4px; background: var(--border-2); border-radius: 2px; }
.wr-tl-dual-fill { position: absolute; top: 8px; height: 4px; background: var(--brand-cask); border-radius: 2px; }
.wr-tl-dual-rail input[type="range"] {
	position: absolute; top: 0; left: 0; width: 100%; height: 20px; margin: 0;
	background: none; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.wr-tl-dual-rail input[type="range"]::-webkit-slider-runnable-track { background: none; border: 0; }
.wr-tl-dual-rail input[type="range"]::-moz-range-track { background: none; border: 0; }
.wr-tl-dual-rail input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none; appearance: none; pointer-events: auto;
	width: 16px; height: 16px; margin-top: 2px; border-radius: 50%; background: #fff;
	border: 2px solid var(--brand-cask); cursor: pointer; box-shadow: 0 1px 2px rgba(58,38,22,.2);
}
.wr-tl-dual-rail input[type="range"]::-moz-range-thumb {
	pointer-events: auto; width: 16px; height: 16px; border-radius: 50%; background: #fff;
	border: 2px solid var(--brand-cask); cursor: pointer;
}
.wr-tl-count { flex-basis: 100%; text-align: center; font-size: 13px; color: var(--fg-4); }

/* --- table --- */
.wr-tl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.wr-tl-table { width: 100%; border-collapse: collapse; background: #fff; font-family: var(--font-notes); font-size: 15px; }
.wr-tl-table th, .wr-tl-table td {
	padding: 14px 16px; text-align: right; white-space: nowrap; border-bottom: 1px solid var(--border-1);
}
.wr-tl-table thead th {
	background: var(--bg-2);
	font-family: var(--font-ui); font-weight: 600; font-size: 13px; color: var(--fg-2);
	user-select: none; border-bottom: 2px solid var(--border-2);
}
.wr-tl-table thead th[data-sort] { cursor: pointer; }
.wr-tl-table thead th[data-sort]:hover { color: var(--brand-cask); background: var(--brand-cask-50); }
.wr-tl-table th.wr-tl-rank, .wr-tl-table td.wr-tl-rank { text-align: center; width: 48px; color: var(--fg-4); font-variant-numeric: tabular-nums; }
.wr-tl-table th.wr-tl-whisky, .wr-tl-table td.wr-tl-whisky { text-align: left; width: 34%; }
.wr-tl-table th.wr-tl-text, .wr-tl-table td.wr-tl-text { text-align: left; }
.wr-tl-num { font-variant-numeric: tabular-nums; }
.wr-tl-table td.wr-tl-active, .wr-tl-table th.wr-tl-active { background: var(--brand-cask-50); }
.wr-tl-table th.wr-tl-active { color: var(--brand-cask); }
.wr-tl-table tbody tr { transition: background var(--dur-fast) var(--ease-standard); }
.wr-tl-table tbody tr:hover { background: var(--bg-2); }

/* sort caret — conventional up/down affordance, always visible on sortable cols */
.wr-tl-caret { display: inline-block; margin-left: 7px; font-size: 11px; color: var(--fg-4); }
.wr-tl-caret::after { content: "⇅"; }
.wr-tl-table thead th[data-sort]:hover .wr-tl-caret { color: var(--brand-cask); }
th.wr-tl-sort-asc .wr-tl-caret, th.wr-tl-sort-desc .wr-tl-caret { color: var(--brand-cask); }
th.wr-tl-sort-asc .wr-tl-caret::after { content: "▲"; }
th.wr-tl-sort-desc .wr-tl-caret::after { content: "▼"; }

/* whisky cell (image + name, no brand pill) */
.wr-tl-whisky a { display: flex; align-items: center; gap: 14px; border-bottom: 0; color: var(--fg-1); }
.wr-tl-whisky a:hover .wr-tl-name { color: var(--brand-cask); }
.wr-tl-thumb {
	flex: 0 0 auto; width: 54px; height: 66px; display: flex; align-items: center; justify-content: center;
	background: var(--bg-2); border: 1px solid var(--border-1); border-radius: var(--radius-sm); overflow: hidden;
}
.wr-tl-thumb img { width: 100%; height: 100%; object-fit: contain; }
.wr-tl-name { font-family: var(--font-ui); font-weight: 600; font-size: 15.5px; line-height: 1.25; color: var(--fg-1); white-space: normal; transition: color var(--dur-fast) var(--ease-standard); }

/* deltas / na */
.wr-tl-delta { font-weight: 700; font-variant-numeric: tabular-nums; }
.wr-tl-delta.wr-up { color: #4F7A3C; }
.wr-tl-delta.wr-down { color: #B23A2A; }
.wr-tl-na { color: var(--fg-4); }

/* full-report button */
.wr-tl-report { text-align: right; width: 1%; }
.wr-tl-btn {
	display: inline-block; white-space: nowrap; border-bottom: 0;
	font-family: var(--font-ui); font-weight: 600; font-size: 13.5px;
	color: var(--brand-cask); padding: 7px 14px;
	border: 1px solid var(--border-2); border-radius: var(--radius-pill);
	transition: background var(--dur-fast) var(--ease-standard), border-color var(--dur-fast) var(--ease-standard);
}
.wr-tl-btn:hover { color: var(--brand-cask); background: var(--brand-cask-50); border-color: var(--brand-cask-100); }

/* --- large variant: roomier rows + bigger bottle images (search + archive results) --- */
.wr-toplist--large .wr-tl-table { font-size: 15.5px; }
.wr-toplist--large .wr-tl-table th, .wr-toplist--large .wr-tl-table td { padding: 20px 18px; }
.wr-toplist--large .wr-tl-thumb { width: 74px; height: 92px; border-radius: var(--radius-md); }
.wr-toplist--large .wr-tl-whisky a { gap: 18px; }
.wr-toplist--large .wr-tl-name { font-size: 17px; }

/* mobile: allow horizontal scroll, tighten */
@media (max-width: 820px) {
	.wr-tl-table th, .wr-tl-table td { padding: 11px 12px; font-size: 14px; }
	.wr-tl-thumb { width: 42px; height: 52px; }
	.wr-tl-table th.wr-tl-whisky, .wr-tl-table td.wr-tl-whisky { width: auto; }
	.wr-tl-count { width: 100%; margin-left: 0; }
	.wr-toplist--large .wr-tl-table th, .wr-toplist--large .wr-tl-table td { padding: 14px 12px; }
	.wr-toplist--large .wr-tl-thumb { width: 54px; height: 66px; }
	.wr-toplist--large .wr-tl-name { font-size: 15.5px; }
}
