/* =============================================================================
   ehr_style_13_misc_pages.css
   Auction, Watchlist, Hall of Fame, EOY Ratings, Player Stats
   Expanded rows use global stable_horse_list_expanded_info / stable_horse_list_show.
   Expand toggles use global stable_horse_list_expand_toggle.
   ============================================================================= */


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — page containers
   ───────────────────────────────────────────────────────────────────────────── */

.auc_page_container,
.wl_page_container,
.hof_page_container,
.rtg_page_container,
.pst_page_container {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  box-sizing: border-box;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — table wrapper, table, thead, tbody
   ───────────────────────────────────────────────────────────────────────────── */

.auc_table_wrapper,
.wl_table_wrapper,
.hof_table_wrapper,
.rtg_table_wrapper,
.pst_table_wrapper {
  width: 100% !important;
  max-width: 100% !important;
  display: block;
  overflow-x: auto;
  box-sizing: border-box;
}

.auc_table,
.wl_table,
.hof_table,
.rtg_table,
.pst_table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  background-color: #fff;
}

.auc_table thead tr,
.wl_table thead tr,
.hof_table thead tr,
.rtg_table thead tr,
.pst_table thead tr {
  background-color: #E8E8D0;
}

.auc_table th,
.wl_table th,
.hof_table th,
.rtg_table th,
.pst_table th {
  padding: 8px 6px;
  text-align: left;
  font-size: 12px;
  font-weight: 700;
  color: #374151;
  border-bottom: 2px solid #c8c8a0;
  white-space: nowrap;
  overflow: hidden;
}

.auc_table td,
.wl_table td,
.hof_table td,
.rtg_table td,
.pst_table td {
  padding: 6px 6px;
  font-size: 12px;
  vertical-align: middle;
  border-bottom: 1px solid #e5e7eb;
}

/* ── Alternating rows ── */
/* auc/wl/hof/pst: rows come in pairs (main + expand), so stripe every 4 tr */
/* auc/wl/pst: rows come in pairs (main + expand), stripe every 4 tr */
.auc_table tbody tr:nth-child(4n+1),
.auc_table tbody tr:nth-child(4n+2),
.wl_table tbody tr:nth-child(4n+1),
.wl_table tbody tr:nth-child(4n+2),
.pst_table tbody tr:nth-child(4n+1),
.pst_table tbody tr:nth-child(4n+2) {
  background-color: #f8f8f2;
}

/* hof/rtg: no expand rows — standard odd/even */
.hof_table tbody tr:nth-child(odd),
.rtg_table tbody tr:nth-child(odd) {
  background-color: #f8f8f2;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — expand toggle column
   ───────────────────────────────────────────────────────────────────────────── */

.auc_td_expand,
.wl_td_expand,
.hof_td_expand,
.pst_td_expand {
  text-align: center;
  padding-left: 14px;
  white-space: nowrap;
}


/* ─────────────────────────────────────────────────────────────────────────────
   SHARED — empty state
   ───────────────────────────────────────────────────────────────────────────── */

.auc_empty,
.wl_empty,
.hof_empty,
.rtg_empty,
.pst_empty {
  padding: 20px;
  color: #64748b;
  font-style: italic;
}


/* ─────────────────────────────────────────────────────────────────────────────
   AUCTION
   ───────────────────────────────────────────────────────────────────────────── */

/* KITLOOK_20261018: Auction controls (.auc_controls/.auc_control_group/.auc_btn*) -> deleted: no template, JS or Python uses them; the page uses pg_tabs (grep, KITLOOK_20261018) */

/* ── Columns ── */
.auc_td_horse     { font-weight: 600; }
.auc_td_bid       { text-align: right; white-space: nowrap; }
.auc_td_closes    { white-space: nowrap; }
.auc_td_bids      { text-align: center; }

/* KITLOOK_20261018: .auc_horse_name .auc_bid_amount .auc_closes_time .auc_nobids .auc_hibidder_* .auc_pagination .auc_page_link -> deleted: no template, JS or Python uses them (grep, KITLOOK_20261018) */

/* ── Responsive ── */
@media (max-width: 1400px) {
  .auc_th_tag,    .auc_td_tag,
  .auc_th_form,   .auc_td_form    { display: none; }
}
@media (max-width: 1200px) {
  .auc_th_sire,   .auc_td_sire,
  .auc_th_badge,  .auc_td_badge   { display: none; }
}
@media (max-width: 1000px) {
  .auc_th_owner,    .auc_td_owner,
  .auc_th_hibidder, .auc_td_hibidder { display: none; }
}
@media (max-width: 800px) {
  .auc_th_r, .auc_td_r,
  .auc_th_w, .auc_td_w            { display: none; }
}
@media (max-width: 600px) {
  .auc_th_as,   .auc_td_as,
  .auc_th_bids, .auc_td_bids      { display: none; }
}
/* Owner 2026-08-24: "blank 'open for more info' drop down exists when fully
   expanded". 1401px is the exact complement of the FIRST rule in the ladder
   above (Brd and Form at 1400px) and must move with it -- above that width
   nothing is collapsed and the panel only restates the row.

   NOT conditional per row, unlike the Watchlist: every item in this panel
   (Tag, Age/Sex, Starts, Wins, Sire, Owner, Hi Bidder, Bids, Reserve, Badges,
   D/S) has a column at full width, so there is genuinely nothing behind the
   arrow up there. Reserve is the one exception and it is card-mode only.

   !important beats ehr_horsepage_02_horseinfo.css:886, which forces the
   toggle visible at every width. */
@media (min-width: 1401px) {
  .auc_td_expand .stable_horse_list_expand_toggle { display: none !important; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   WATCHLIST
   ───────────────────────────────────────────────────────────────────────────── */

/* KITLOOK_20261018: Watchlist controls (.wl_controls/.wl_btn*) -> deleted: no template, JS or Python uses them; the page uses pg_tabs (grep, KITLOOK_20261018) */

/* ── Columns ── */
.wl_td_horse  { font-weight: 600; }
.wl_td_tag    { white-space: nowrap; }

/* KITLOOK_20261018: .wl_horse_name .wl_price .wl_action_icon -> deleted: no template, JS or Python uses them (grep, KITLOOK_20261018) */

/* ── Responsive ── */
/* The expander arrow, hidden above the first breakpoint -- but only on rows
   where the panel really is a restatement. See watchlist.j2 for why this is
   conditional and Player Stats' is not: the panel here carries Bid, Closes,
   Hi Bidder, Cond, Dist/Surf and Runs, none of which has a column, so a row in
   a claim or an auction keeps its arrow at every width. Sire rows keep it too.

   1201px is the exact complement of the rule below and must move with it.

   !important beats ehr_horsepage_02_horseinfo.css:886, which sets
   `.stable_horse_list_expand_toggle { display: inline-block !important }`
   globally under the comment "Always show the expand toggle regardless of
   viewport width". A plain rule loses to it outright. 2026-08-23. */
@media (min-width: 1201px) {
  .wl_td_expand:not(.wl_td_expand_keep) .stable_horse_list_expand_toggle {
    display: none !important;
  }
}

@media (max-width: 1200px) {
  .wl_th_dist, .wl_td_dist,
  .wl_th_cond, .wl_td_cond  { display: none; }
}

/* KITLOOK_20261018: .wl_racetype (dead), .wl_cardchip and the remove control (.wl_rm*) with its device-dark block -> moved to css/ehr_page_misc_market.css (WATCHLIST), on tokens */
@media (max-width: 1000px) {
  .wl_th_trk,  .wl_td_trk   { display: none; }
}
@media (max-width: 800px) {
  .wl_th_type, .wl_td_type,
  .wl_th_surf, .wl_td_surf   { display: none; }
}
@media (max-width: 600px) {
  .wl_th_sex,  .wl_td_sex,
  .wl_th_age,  .wl_td_age    { display: none; }
}


/* ── HALL OF FAME / EOY RATINGS / PLAYER STATS -> REMOVED KITLOOK_20261018: these rules styled the 08-2026 templates
   (.hof_td_*, .rtg_td_*, .rtg_title, .pst_td_*, .pst_update_btn ...). The 09-12 rebuild (hof_list / eoy_table / ps_table on
   the kit) left every class here unused -- grep over website/python, wrappers, js and jinja finds none -- and the one live
   name, .pst_filters_toggle, was beaten by the kit's pg_btn_2. The live rules are css/ehr_page_misc_people.css sections 1-4.
   The combined .hof_table / .rtg_table / .pst_table selectors in the SHARED blocks above and in NARROW PHONES below are dead
   too; left in place because those lists are shared with Auction and Watchlist. ── */


/* ─────────────────────────────────────────────────────────────────────────────
   JOCKEY PAGE
   ───────────────────────────────────────────────────────────────────────────── */

/* KITLOOK_20261018: .jky_page_container .jky_controls .jky_control_group .jky_btn* .jky_location_select -> deleted: no template, JS or Python uses them (grep, KITLOOK_20261018) */

/* KITLOOK_20261018: .jky_table_wrapper (dead) and .jky_table (white background) -> moved to css/ehr_page_misc_market.css (JOCKEYS: the kit pg_table + a transparent table), on tokens */

.jky_td_name,
.jky_th_name {
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 420px) {
  .jky_td_name,
  .jky_th_name { max-width: 100px; }
}

@media (max-width: 340px) {
  .jky_td_name,
  .jky_th_name { max-width: 70px; }
}

/* KITLOOK_20261018: .jky_table header / cell / zebra colours and the dead .jky_row_red/.jky_row_blue -> the kit pg_table + css/ehr_page_misc_market.css (JOCKEYS) */

/* ── Columns ── */
.jky_td_expand { text-align: center; padding-left: 14px; white-space: nowrap; }
.jky_td_rank   { text-align: center; font-weight: 700; }
.jky_td_name   { font-weight: 600; }
.jky_td_wpct, .jky_td_itmpct,
.jky_td_usdk, .jky_td_usdpr,
.jky_td_rmin   { text-align: right; white-space: nowrap; }

/* Headers follow their column's data alignment (2026-09-01). Numeric headers
   right-align to sit over their figures; Rank centers over its data. */
.jky_table th.jky_th_rank { text-align: center; }
.jky_table th.jky_th_rmin,
.jky_table th.jky_th_wpct,
.jky_table th.jky_th_itmpct,
.jky_table th.jky_th_usdk,
.jky_table th.jky_th_usdpr { text-align: right; }

/* KITLOOK_20261018: .jky_name .jky_exp_name .jky_empty and the controls' small-screen rules -> deleted: no template, JS or Python uses them (grep, KITLOOK_20261018) */

/* Column hiding cascade — most → least important */

/* 900px: drop secondary stats columns */
@media (max-width: 900px) {
  .jky_th_itmpct,   .jky_td_itmpct,
  .jky_th_usdk,     .jky_td_usdk,
  .jky_th_usdpr,    .jky_td_usdpr,
  .jky_th_maxbase,  .jky_td_maxbase,
  .jky_th_tiebreak, .jky_td_tiebreak,
  .jky_th_canride,  .jky_td_canride  { display: none; }
}

/* 600px: drop Trk and Exp */
@media (max-width: 600px) {
  .jky_th_trk, .jky_td_trk,
  .jky_th_exp, .jky_td_exp          { display: none; }
}

/* 420px: drop SelOrder (flag mode) and RMin */
@media (max-width: 420px) {
  .jky_th_selorder, .jky_td_selorder,
  .jky_th_rmin,     .jky_td_rmin    { display: none; }
}

/* 340px: drop W% — only expand toggle, rank, name remain */
@media (max-width: 340px) {
  .jky_th_wpct, .jky_td_wpct        { display: none; }
}

/* Tighten cell padding at small sizes */
@media (max-width: 420px) {
  .jky_table th,
  .jky_table td   { padding: 5px 4px; font-size: 11px; }
  .jky_td_expand  { padding-left: 6px; }
}

@media (max-width: 340px) {
  .jky_table th,
  .jky_table td   { padding: 4px 3px; font-size: 11px; }
  .jky_td_expand  { padding-left: 4px; }
}


/* ─────────────────────────────────────────────────────────────────────────────
   WATCHLIST — additional styles for real data
   ───────────────────────────────────────────────────────────────────────────── */

/* KITLOOK_20261018: .wl_sire_name (moved), .wl_type_badge* .wl_nobids .wl_hibidder_me (dead) -> moved to css/ehr_page_misc_market.css (WATCHLIST), on tokens */

/* ── Column alignment ── */
.wl_td_cprice,
.wl_td_abid  { text-align: right; white-space: nowrap; }
.wl_td_crun,
.wl_td_aclose { white-space: nowrap; font-size: 11px; color: #4a5568; }

/* ── Responsive — watchlist updated ── */
@media (max-width: 1100px) {
  .wl_th_aclose, .wl_td_aclose,
  .wl_th_crun,   .wl_td_crun    { display: none; }
}
@media (max-width: 900px) {
  .wl_th_cdist,  .wl_td_cdist,
  .wl_th_csurf,  .wl_td_csurf,
  .wl_th_ahi,    .wl_td_ahi     { display: none; }
}
@media (max-width: 600px) {
  .wl_th_sex,    .wl_td_sex,
  .wl_th_tag,    .wl_td_tag     { display: none; }
}

/* ── HOF Badge responsive visibility -> MOVED KITLOOK_20261018: css/ehr_page_misc_people.css section 3 (hof.j2 is its only user) ── */

/* KITLOOK_20261018: Watchlist sire panel rows, the sire-linked toggle and the sire-linked row tints (were !important) -> moved to css/ehr_page_misc_market.css (WATCHLIST; the tints need no !important there), on tokens */

/* ═════════════════════════════════════════════════════════════════════════════
   NARROW PHONES — 2026-08-24
   Owner: "some of these are just a little too wide on my mobile"
   (OnePlus CPH2513: 1080px wide, so roughly a 390-410px CSS viewport.)

   WHY THESE TABLES HAD A FLOOR THEY COULD NOT GO UNDER. Every ladder above
   stops at 600px, but the real constraint below that is not the column COUNT,
   it is that a stable name and a horse name are usually ONE TOKEN with no
   space in it. A table cell cannot break a word by default, so each of those
   columns demanded its longest word in full, and EOY carries three of them
   side by side (Horse, Owner, Sire) plus a comma-formatted Earned figure that
   is also unbreakable. That set has a minimum around 450px whatever the
   viewport says, which is why the wrapper's overflow-x kicked in and the table
   had to be dragged sideways.

   So the fix is to remove the floor, NOT to hide more columns:
   overflow-wrap lets a long name break, and the table then honours width:100%
   like everything else on the page.

   HIDING WAS NOT AN OPTION ON TWO OF THESE. eoy.j2 and hof.j2 have NO expander
   panel -- their only paired row is the player-profile card holder. Every
   column those two drop at a breakpoint is data that becomes unreachable on
   that screen, not data that moves somewhere else. (That predates this work:
   G1/G2/G3, the ITM counts, Age, Sex and Status already vanish with no way
   back.) Watchlist, Claims and Player Stats DO have panels, so they can afford
   to hide; these two cannot, and adding a fifth breakpoint to them would have
   quietly deleted Sire or Owner from mobile altogether.
   ═════════════════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  .auc_table, .wl_table, .hof_table, .rtg_table, .pst_table { font-size: 12px; }

  /* Headers may wrap down here. They are short by this point -- the long ones
     ("G1 ITM") are hidden hundreds of pixels earlier -- but nowrap is a hard
     minimum and there is no reason to pay for it on a phone. */
  .auc_table th, .wl_table th, .hof_table th,
  .rtg_table th, .pst_table th { padding: 6px 3px; white-space: normal; }

  .auc_table td, .wl_table td, .hof_table td,
  .rtg_table td, .pst_table td { padding: 5px 3px; }

  /* THE ACTUAL FIX. Only the name columns -- numbers, dates and badges must
     not break mid-token, and none of them is what forces the width. */
  .rtg_td_horse, .rtg_td_owner, .rtg_td_sire,
  .hof_td_horse, .hof_td_owner, .hof_td_sire,
  .wl_td_horse,  .wl_td_sire,
  .pst_td_master {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

/* ═════════════════════════════════════════════════════════════════════════════
   EXPANDED-PANEL IMAGES — 2026-08-24
   Owner: "the badges explode in size when they are put in the hidden areas."

   .stable_horse_list_expanded_item (ehr_legacy_03_stablelist.css:231) is
   `display: flex; flex-direction: column`. That puts the cross axis
   HORIZONTAL, so the default align-items:stretch stretches every direct child
   to the item's full width -- and .re_expanded_info gives those items
   `flex: 1 1 90px`. A badge is a 20-26px icon, so a bare <img> child was being
   stretched to 90px+ wide, and the global `img { height: auto }` in
   ehr_base.css scaled the height to match. Four times life size.

   The real fix is in the markup: every panel value belongs in a
   .stable_horse_list_expanded_value span, which is how every other screen
   builds these, and a span child stretching costs nothing. auc.j2 is now
   consistent with the rest.

   This rule is the backstop for the next template that forgets, since the
   failure is silent, ugly, and non-obvious from the markup. Scoped to a DIRECT
   child so it cannot reach an image legitimately laid out inside a value.
   ═════════════════════════════════════════════════════════════════════════ */
.stable_horse_list_expanded_item > img {
  align-self: flex-start;
  flex: 0 0 auto;
  max-width: 100%;
}

/* KITLOOK_20261018: AUCTION G-CARD BALANCE CHIP / FORM HEAT / A/S COLUMN (.auc_cards_chip .auc_form_heat* .auc_age .auc_as_sep) -> deleted: no template, JS or Python uses them; their successors .au_cards .au_heat .au_age .au_sep are in css/ehr_page_misc_market.css (AUCTION) (grep, KITLOOK_20261018) */


/* KITLOOK_20261018: JOCKEY ROSTER editor (live rules moved; .jky_roster_head/_title .jky_slots .jky_field* .jky_opt .jky_roster_actions .jky_warn .jky_ro_val .jky_roster_ro_note .jky_note were already unused) -> moved to css/ehr_page_misc_market.css (JOCKEYS), on tokens */

/* WILLMERGE_20261017 (render R17): from 981px up the 250px sidebar takes room from these tables, so a step from below 981px repeats
   inside that range. Every column hidden here is in the row's expander panel, and the arrow shows at these widths
   (Watchlist to 1200px, Auctions to 1400px, Jockeys always). Offline render: no sideways scroll from 981 to 1460px,
   35px+ to spare at every step. */
@media (min-width: 981px) and (max-width: 1190px) {
  .wl_th_sex,  .wl_td_sex,
  .wl_th_age,  .wl_td_age    { display: none; }
}
@media (min-width: 981px) and (max-width: 1100px) {
  .wl_th_sire, .wl_td_sire   { display: none; }
  .auc_th_owner,    .auc_td_owner,
  .auc_th_hibidder, .auc_td_hibidder { display: none; }
}
@media (min-width: 981px) and (max-width: 1060px) {
  .jky_th_itmpct, .jky_td_itmpct,
  .jky_th_usdk,   .jky_td_usdk,
  .jky_th_usdpr,  .jky_td_usdpr  { display: none; }
}
