/*
 * Mashin Irani — Weekly Buyers League (/loyalty/league/).
 *
 * Layers on the shared mi.css design system, which IS global here (inc/enqueue.php enqueues it as
 * `mi-frozen` on every page except the front page and product pages), so .container/.section/
 * .sec-head/.eyebrow/.breadcrumb/.btn/.icon/.num/.sr-only come for free and are never redeclared.
 *
 * It also RE-SHIPS two rule sets that live in page-scoped theme stylesheets and would otherwise never
 * load on this page:
 *   - .pill-tabs  — assets/css/pages/club.css, enqueued behind `if ( ! is_page('club') ) return;`
 *   - .mcard      — assets/css/pages/account.css, enqueued only on the account page
 * Without them the tab strip renders as two naked inline links and the medal cards lose their skin.
 *
 * ICONS: mi.css has NO global `svg {}` rule — its only icon contract is the `.icon` class
 * (fill:none; stroke:currentColor; stroke-width:1.5; stroke-linecap:round; stroke-linejoin:round).
 * mil_icon() therefore always emits class="icon", and the per-context rules below use element
 * selectors (e.g. `.mil-stat__ic svg`, specificity 0-1-1) so they out-specify `.icon` (0-1-0) for
 * size and colour while inheriting the caps/joins. Do not "simplify" those to `.icon` selectors.
 *
 * Every custom property carries a fallback verified byte-for-byte against mi.css's :root. NOTE: this
 * design system has NO --space-7 token (the scale is 1,2,3,4,5,6,8,10,12,16,20,24) — var(--space-7)
 * would compute to 0, so it is not used anywhere below. RTL-first: directional rules use logical
 * properties.
 */

/* --- RE-SHIP 1/2: pill tabs (from club.css, fallbacks + wrapping added) ----------------------- */
.pill-tabs{display:flex;gap:var(--space-1,4px);background:var(--bg-sunken,#ECE4DA);padding:4px;border-radius:var(--radius-pill,999px);width:fit-content;margin-block:var(--space-5,20px);flex-wrap:wrap}
.pill-tabs a{padding:var(--space-2,8px) var(--space-5,20px);border-radius:var(--radius-pill,999px);font-weight:600;font-size:.9rem;color:var(--text-secondary,#404751)}
.pill-tabs a.on{background:var(--navy-900,#102134);color:var(--ivory-50,#F5F0E9)}

/* --- Hero ------------------------------------------------------------------------------------ */
.mil-hero{padding-block:var(--space-8,32px) var(--space-4,16px)}
.mil-hero h1{font-size:clamp(1.6rem,4.5vw,2.25rem);line-height:1.2;margin:0 0 var(--space-3,12px);color:var(--navy-900,#102134)}
.mil-lede{max-width:64ch;color:var(--text-secondary,#404751);line-height:1.85;margin:0;font-size:1.03rem}

/* --- Cycle status tiles ---------------------------------------------------------------------- */
.mil-status{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-4,16px);margin-block:var(--space-6,24px)}
.mil-stat{background:var(--bg-elevated,#fff);border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-xl,16px);padding:var(--space-5,20px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06));display:flex;flex-direction:column;gap:var(--space-1,4px)}
.mil-stat__ic{width:36px;height:36px;border-radius:var(--radius-pill,999px);background:var(--bg-sunken,#ECE4DA);display:flex;align-items:center;justify-content:center;margin-bottom:var(--space-2,8px);flex:none}
.mil-stat__ic svg{width:18px;height:18px;stroke:var(--gold-500,#896f3d)}
.mil-stat__l{font-size:.8125rem;color:var(--text-tertiary,#6E6A66);font-weight:600}
.mil-stat__v{font-size:1.2rem;font-weight:700;color:var(--navy-900,#102134);line-height:1.35}
.mil-stat__s{font-size:.78rem;color:var(--text-tertiary,#6E6A66)}
.mil-cd{font-variant-numeric:tabular-nums}
@media(max-width:900px){.mil-status{grid-template-columns:repeat(2,1fr)}}
@media(max-width:560px){.mil-status{grid-template-columns:1fr}}

/* --- Leaderboard table ----------------------------------------------------------------------- */
.mil-tablewrap{overflow-x:auto;border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-lg,12px);background:var(--bg-elevated,#fff);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06))}
.mil-table{width:100%;border-collapse:collapse;font-size:.92rem;min-width:520px}
.mil-table th,.mil-table td{padding:var(--space-3,12px) var(--space-4,16px);text-align:start;border-bottom:1px solid var(--border,#D9CBC2);vertical-align:middle}
.mil-table thead th{background:var(--navy-900,#102134);color:var(--ivory-50,#F5F0E9);font-weight:600;font-size:.8125rem;white-space:nowrap}
.mil-table tbody tr:last-child td{border-bottom:0}
.mil-table tbody tr:hover{background:var(--bg-sunken,#ECE4DA)}
.mil-table tbody tr.mil-me{background:rgba(137,111,61,.14)}
.mil-nm{font-weight:600}
.mil-you{display:inline-flex;align-items:center;font-size:.7rem;font-weight:700;padding:2px var(--space-2,8px);border-radius:var(--radius-pill,999px);background:var(--navy-900,#102134);color:var(--gold-300,#E0C58F);margin-inline-start:var(--space-2,8px)}

.mil-rank{display:inline-flex;align-items:center;justify-content:center;width:30px;height:30px;border-radius:var(--radius-pill,999px);font-weight:700;font-size:.82rem;background:var(--n-100,#ECE4DA);color:var(--navy-900,#102134);flex:none}
.mil-rank--1{background:linear-gradient(135deg,var(--gold-500,#896f3d),var(--gold-300,#E0C58F));color:var(--navy-900,#102134)}
.mil-rank--2{background:linear-gradient(135deg,#8b97a5,#c3cdd7);color:#fff}
.mil-rank--3{background:linear-gradient(135deg,#a1662f,#d29b63);color:#fff}

/* Mobile: drop the table to stacked label/value cards so nothing overflows. */
@media(max-width:640px){
	.mil-tablewrap{border:0;background:none;box-shadow:none;overflow:visible}
	.mil-table{min-width:0}
	.mil-table thead{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
	.mil-table,.mil-table tbody,.mil-table tr,.mil-table td{display:block;width:100%}
	.mil-table tbody tr{border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-lg,12px);background:var(--bg-elevated,#fff);margin-bottom:var(--space-3,12px);padding-block:var(--space-2,8px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06))}
	.mil-table tbody tr:last-child{margin-bottom:0}
	.mil-table tbody td{border:0;padding:6px var(--space-4,16px);display:flex;align-items:center;justify-content:space-between;gap:var(--space-4,16px)}
	.mil-table tbody td::before{content:attr(data-th);font-weight:600;color:var(--text-tertiary,#6E6A66);font-size:.8rem}
}

/* --- Empty / unavailable state ---------------------------------------------------------------- */
.mil-empty{text-align:center;padding:var(--space-10,40px) var(--space-5,20px);border:1px dashed var(--border-strong,#C0B2A6);border-radius:var(--radius-xl,16px);background:var(--bg-sunken,#ECE4DA)}
.mil-empty__ic{width:56px;height:56px;border-radius:var(--radius-pill,999px);background:var(--bg-elevated,#fff);display:flex;align-items:center;justify-content:center;margin:0 auto var(--space-4,16px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06))}
.mil-empty__ic svg{width:26px;height:26px;stroke:var(--gold-500,#896f3d)}
.mil-empty b{display:block;font-size:1.05rem;color:var(--navy-900,#102134);margin-bottom:var(--space-2,8px)}
.mil-empty p{max-width:52ch;margin:0 auto var(--space-5,20px);color:var(--text-secondary,#404751);line-height:1.8;font-size:.92rem}

/* --- Your standing --------------------------------------------------------------------------- */
.mil-standing{background:var(--bg-elevated,#fff);border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-xl,16px);padding:clamp(20px,3vw,32px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06))}
.mil-figs{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-4,16px);margin-bottom:var(--space-6,24px)}
.mil-fig{text-align:center;background:var(--bg-sunken,#ECE4DA);border-radius:var(--radius-lg,12px);padding:var(--space-4,16px)}
.mil-fig__v{display:block;font-size:1.15rem;font-weight:700;color:var(--navy-900,#102134)}
.mil-fig__l{display:block;font-size:.78rem;color:var(--text-tertiary,#6E6A66);margin-top:4px}
@media(max-width:560px){.mil-figs{grid-template-columns:1fr}}
.mil-actions{display:flex;gap:var(--space-3,12px);flex-wrap:wrap;margin-top:var(--space-6,24px)}

.mil-login{display:flex;align-items:center;gap:var(--space-5,20px);flex-wrap:wrap;background:var(--bg-elevated,#fff);border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-xl,16px);padding:clamp(20px,3vw,32px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06))}
.mil-login__ic{width:48px;height:48px;flex:none;border-radius:var(--radius-pill,999px);background:var(--navy-900,#102134);display:flex;align-items:center;justify-content:center}
.mil-login__ic svg{width:22px;height:22px;stroke:var(--gold-300,#E0C58F)}
.mil-login__txt{flex:1 1 260px}
.mil-login__txt b{display:block;font-size:1.05rem;color:var(--navy-900,#102134);margin-bottom:4px}
.mil-login__txt p{margin:0;color:var(--text-secondary,#404751);font-size:.9rem;line-height:1.8}

/* --- Rules / steps --------------------------------------------------------------------------- */
.mil-steps{display:grid;grid-template-columns:repeat(3,1fr);gap:var(--space-4,16px)}
@media(max-width:900px){.mil-steps{grid-template-columns:1fr}}
.mil-step{background:var(--bg-elevated,#fff);border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-xl,16px);padding:var(--space-5,20px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06))}
.mil-step__n{width:32px;height:32px;border-radius:var(--radius-pill,999px);background:var(--navy-900,#102134);color:var(--gold-300,#E0C58F);display:flex;align-items:center;justify-content:center;font-weight:700;margin-bottom:var(--space-3,12px)}
.mil-step b{display:block;margin-bottom:var(--space-2,8px);color:var(--navy-900,#102134)}
.mil-step span{color:var(--text-secondary,#404751);font-size:.9rem;line-height:1.85}
.mil-subhead{margin:var(--space-10,40px) 0 var(--space-4,16px);font-size:1.15rem;color:var(--navy-900,#102134)}

/* --- RE-SHIP 2/2: medal cards (from account.css) + a bronze tier ------------------------------ */
.mil-medals{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:var(--space-4,16px)}
.mcard{text-align:center;border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-xl,16px);padding:var(--space-6,24px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06))}
.mcard.earned{background:var(--bg-elevated,#fff)}
.mcard.locked{opacity:.55;background:var(--bg-sunken,#ECE4DA)}
.mcard .disc{width:72px;height:72px;border-radius:50%;display:flex;align-items:center;justify-content:center;margin:0 auto var(--space-3,12px)}
.mcard.gold .disc{background:linear-gradient(140deg,var(--gold-300,#E0C58F),var(--gold-500,#896f3d))}
.mcard.silver .disc{background:linear-gradient(140deg,#c3cdd7,#8b97a5)}
.mcard.bronze .disc{background:linear-gradient(140deg,#d29b63,#a1662f)}
.mcard.platinum .disc{background:linear-gradient(140deg,#e8eef2,#b9c6d1)}
.mcard .disc svg{width:36px;height:36px;stroke:#fff}
.mcard b{font-size:1.05rem;color:var(--navy-900,#102134)}
.mcard span{font-size:.8rem;color:var(--text-tertiary,#6E6A66);display:block;margin-top:4px}
/* The legend copy is informational, so it must stay readable rather than dimmed. */
.mil-medals--legend .mcard.locked{opacity:1;background:var(--bg-sunken,#ECE4DA)}

/* --- Prizes ----------------------------------------------------------------------------------- */
.mil-prizes{display:grid;grid-template-columns:repeat(auto-fit,minmax(190px,1fr));gap:var(--space-4,16px)}
.mil-prize{display:flex;align-items:center;gap:var(--space-3,12px);background:var(--bg-elevated,#fff);border:1px solid var(--border,#D9CBC2);border-radius:var(--radius-lg,12px);padding:var(--space-4,16px);box-shadow:var(--shadow-e1,0 1px 2px rgba(16,33,52,.06));flex-wrap:wrap}
.mil-prize b{font-size:1rem;color:var(--success,#2E7D5B)}
.mil-prize>span:last-child{font-size:.8rem;color:var(--text-tertiary,#6E6A66);flex-basis:100%}

/* --- Notes ------------------------------------------------------------------------------------ */
.mil-note{display:flex;align-items:flex-start;gap:var(--space-2,8px);margin-top:var(--space-4,16px);font-size:.85rem;color:var(--text-tertiary,#6E6A66);line-height:1.8}
.mil-note svg{width:16px;height:16px;flex:none;margin-top:3px;stroke:var(--gold-500,#896f3d)}

/* --- Closing CTA band -------------------------------------------------------------------------- */
.mil-cta{text-align:center;padding:clamp(28px,5vw,48px) var(--space-5,20px);background:linear-gradient(135deg,var(--navy-900,#102134),var(--navy-800,#112250));border-radius:var(--radius-2xl,24px);color:var(--ivory-50,#F5F0E9);box-shadow:var(--shadow-e3,0 8px 24px rgba(16,33,52,.10))}
.mil-cta .eyebrow{color:var(--gold-300,#E0C58F)}
.mil-cta h2{font-size:clamp(1.3rem,3.5vw,1.8rem);margin:0 0 var(--space-3,12px);color:#fff}
.mil-cta p{max-width:52ch;margin:0 auto var(--space-6,24px);color:var(--sand-200,#D9CBC2);line-height:1.8}
.mil-cta__acts{display:flex;gap:var(--space-3,12px);justify-content:center;flex-wrap:wrap}
/* mi.css .btn-outline is navy-on-transparent, which is invisible on this dark band. */
.mil-cta .btn-outline{border:1.5px solid var(--gold-300,#E0C58F);color:var(--gold-300,#E0C58F);background:transparent}
.mil-cta .btn-outline:hover{background:rgba(224,197,143,.12);border-color:var(--gold-300,#E0C58F)}
