/* -------------------------------------------------------
   3. SECTION A: HORSE INFO (public)
   
   3-column grid at desktop:
     Left:   horse image, name, owner, breeder, foaled
     Center: pedigree + stats table
     Right:  dam section + stat cards
   ------------------------------------------------------- */
.horsepage_top {
  /* 🍞 BREADCRUMB: Was display:grid (280px 1fr 380px). Changed to flex because
     style_more.css forces width:100% !important on ALL descendant divs inside
     the stable detail cell — grid children collapse when that fires. Flex
     children with explicit flex-basis + !important width fight it and win. */
  display: flex;
  flex-wrap: wrap;
  gap: var(--hp-gap);
  background: var(--hp-card-bg);
  padding: var(--hp-pad);
  border-radius: var(--hp-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  margin-bottom: var(--hp-gap);
}

/* -------------------------------------------------------
   HP_INFO_GRID — 4-column CSS grid container
   
   Replaces the old horsepage_top flex layout.
   Columns: identity | pedigree+dam | stats | stat cards
   ------------------------------------------------------- */
.hp_info_grid_container {
  position: relative;
}

.hp_info_grid {
  position: relative;
  display: grid;
  /* grid-template-columns: repeat(4, 1fr); */
  grid-template-columns: 1fr minmax(275px, auto) minmax(150px, auto);
  /* grid-template-columns: 1fr auto; */
  /* background: var(--hp-card-bg); */
  /* border-radius: var(--hp-radius);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08); */
  gap: 1em;
  align-items: start;
  padding: 1em;
}

/* .hp_info_grid > div:last-child {
  grid-column: 1 / -1;
} */

@media (max-width: 1200px) {
  .hp_info_grid {
    grid-template-columns: 1fr minmax(230px, auto);
  }

  .hp_info_grid > :last-child {
    grid-column: 1 / -1;
  }

  .horsepage_stats_card {
    grid-template-columns: minmax(200px, auto) minmax(300px, auto);
  }

}

/* 2x2 at medium widths */
@media (max-width: 1200px) and (min-width: 801px) {
  /* .hp_info_grid {
    grid-template-columns: auto 250px;
  } */
  /* Reset old horsepage_top grid-column/row assignments that bleed in */
  .hp_info_grid > .horsepage_identity {
    grid-column: auto !important;
    grid-row: auto !important;
  }
  /* .hp_info_grid > .horsepage_identity {
    grid-template-columns: auto 250px;
  } */

  .horsepage_image_block {
    grid-template-columns: 150px 1fr;
  }

  /* .horsepage_stats_col {
    grid-column: 1 / -1;
  } */
  
}

/* Below 800px: everything stacks single column */
@media (max-width: 800px) {
  .hp_info_grid {
    grid-template-columns: 1fr 1fr;
  }

  .hp_info_grid > * {
    grid-column: 1 / -1;
  }
}

/* Single column on mobile */
@media (max-width: 599px) {
  .hp_info_grid {
    grid-template-columns: 1fr;
    padding: var(--hp-pad);
    gap: var(--hp-gap);
  }
  /* Reset any grid-column/row assignments from old horsepage_top rules
     so all 4 columns stack cleanly in order */
  .hp_info_grid > .horsepage_identity,
  .hp_info_grid > .horsepage_stats_col {
    grid-column: 1 !important;
    grid-row: auto !important;
    justify-items: normal;
  }
}


/* --- Left column: horse identity --- */
/* 🍞 BREADCRUMB: OLD had flex:0 0 280px + width:280px !important.
   Worked for horsepage_top (flex layout). New hp_info_grid (CSS grid)
   ignores flex but width/max-width still capped the column at 280px,
   leaving dead whitespace. Fixed: remove fixed sizing, let grid handle. */
.horsepage_identity {
  display: grid;
  grid-template-columns: min(200px, 30%) 1fr;
  gap: var(--hp-gap);
  align-items: flex-start;
  justify-items: flex-start;
  /* background: var(--ehr-theme-raised); */
  /* max-width: 600px; */
  /* border-radius: 20px; */
  /* padding: .5em; */
}

.horsepage_horse_name {
  font-family: "Saira Condensed", sans-serif;
  /* font-size: 38px; */
  font-size: clamp(1.5rem, 4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 0.95;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.horsepage_horse_name .horsepage_horse_img {
  margin: .5em;
}

.horsepage_desc {
  font-size: 14px;
  padding: 8px 10px;
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
}

.horsepage_id_row {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
}

.horsepage_id_row .horsepage_label {
  font-weight: 700;
  margin-right: 8px;
}

.horsepage_image_block {
  display: grid;
  grid-template-columns: auto;
  gap: 1em;
  align-items: flex-start;
  grid-row: span 2;
  /* background: var(--ehr-theme-raised); */
  /* padding: 1em; */
}

@media (max-width: 1200px) and (min-width: 600px) {

  /* .horsepage_image_block {
    grid-template-columns: 150px 1fr;
  } */
  
}

.horsepage_horse_img {
  justify-content: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  /* gap: 1em; */
  /* grid-row: span 2; */
  overflow: hidden;
  /* padding: .5em; */
  /* border: 2px solid #907060; */
  /* border-radius: 10px; */
  /* background: var(--ehr-theme-accent); */
  /* box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
  -webkit-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75);
  -moz-box-shadow: 0px 0px 5px 0px rgba(0,0,0,0.75); */
}

.horsepage_horse_img .img {
  width: 100%;
  max-width: 200px;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
}

/* Empty/broken image fallback */
.horsepage_horse_img img[src=""],
.horsepage_horse_img img:not([src]) {
  display: none;
}

.horsepage_owner_breeder {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.horsepage_info_line {
  font-size: 13px;
  padding: 6px 10px;
  border: 1px solid var(--hp-border);
  border-radius: var(--hp-radius-sm);
}

.horsepage_label {
  font-weight: 700;
  margin-right: 6px;
}

/* Pedigree toggle (hidden by default) */
.horsepage_pedigree_toggle {
  display: none;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ehr-action);
  cursor: pointer;
  padding: 10px 12px;
  border: 1px solid var(--hp-green);
  border-radius: 4px;
  background: #1e471e;
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.horsepage_pedigree_toggle:hover {
  background: var(--hp-green);
  color: #fff;
}

.horsepage_pedigree_toggle .hp_ped_arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.horsepage_pedigree_toggle_open .hp_ped_arrow {
  transform: rotate(90deg);
}

.horsepage_pedigree_table.horsepage_show {
  display: block;
}

/* Flex row of cards — centered, wraps on narrow screens */
.horsepage_pedigree_table table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  padding-bottom: 10px;
}

/* thead/tbody/tr become invisible wrappers so TDs flex correctly */
.horsepage_pedigree_table thead,
.horsepage_pedigree_table tbody,
.horsepage_pedigree_table tr {
  display: contents;
}

/* Each sire = a flex card */
.horsepage_pedigree_table td {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
  min-width: 140px;
  max-width: 220px;
  border: 1px solid var(--hp-border);
  border-radius: 4px;
  padding: 8px 10px;
  background: #1e471e;
  color: #000;
}

.horsepage_pedigree_table td > strong {
  font-size: 15px;
  display: block;
  margin-bottom: 4px;
}

.horsepage_ped_sub {
  font-size: 11px;
}

.horsepage_ped_ss {
  font-weight: normal;
}

/* Stack to single column at 768px, bump fonts */
@media (max-width: 768px) {
  .horsepage_pedigree_table td {
    flex: 1 1 100%;
    max-width: 100%;
    font-size: 14px;
  }
  .horsepage_pedigree_table td > strong {
    font-size: 17px;
  }
  .horsepage_ped_sub {
    font-size: 13px;
  }
}

/* Pedigree toggle (hidden by default) */
.horsepage_stats_toggle {
  display: none;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
  font-weight: 600;
  color: var(--ehr-action);
  cursor: pointer;
  padding: .5em 1em;
  border: 1px solid var(--ehr-theme-strong);
  border-radius: 4px;
  background: var(--ehr-theme-base);
  transition: background 0.15s ease, color 0.15s ease;
  user-select: none;
}

.horsepage_stats_toggle:hover {
  background: var(--ehr-theme-strong);
  color: #fff;
}

.horsepage_stats_toggle .hp_ped_arrow {
  display: inline-block;
  transition: transform 0.2s ease;
}

.horsepage_stats_toggle_open .hp_ped_arrow {
  transform: rotate(90deg);
}

.horsepage_stats_table.horsepage_show {
  display: block;
}

.horsepage_stats_card {
  display: grid;
  gap: 1em;
}

.horsepage_stats_card.horsepage_show {
  display: grid;
}

/* --- Center column: stats table (pedigree moved to banner above) --- */
.horsepage_stats_col {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: var(--hp-gap-sm);
  flex: 1 1 300px;
  width: auto !important;
  min-width: 0;
  
  grid-row: span 2;
}

.horsepage_stats_col_card {
  /* padding: .75em; */
  background: var(--ehr-theme-raised);
  border-radius: 10px;
  /* box-shadow: var(--ehr-table-box-shadow); */
  /* min-width: 300px; */
  width: 100%;
}

/* Pedigree line as direct grid child spans all columns at every breakpoint */
.hp_info_grid > .horsepage_pedigree_line {
  grid-column: 1 / -1;
}

.horsepage_pedigree_line {
  font-size: 13px;
  padding: 8px 10px;
  background: #f9f9f9;
  border-radius: var(--hp-radius-sm);
  text-align: center;
  font-weight: 600;
  letter-spacing: 0.3px;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.horsepage_stats_table {
  width: 100%;
  box-shadow: var(--ehr-table-box-shadow);
  background-color: var(--ehr-theme-base);
  border: 1px solid var(--ehr-theme-strong);
  /* border-radius: 10px; */
  border-spacing: 0;
  border-collapse: separate;
  overflow: hidden;
}

/* Add left border to every column except first */
.horsepage_stats_table tbody tr > th:not(:first-child),
.horsepage_stats_table tbody tr > td:not(:first-child) {
  border-left: 1px solid color-mix(in srgb, var(--ehr-theme-strong) 75%, transparent);
}

/* Add horizontal borders from the TOP instead */
.horsepage_stats_table tbody tr:not(:first-child) > th,
.horsepage_stats_table tbody tr:not(:first-child) > td,
.horsepage_stats_table thead tr:not(:first-child) > th,
.horsepage_stats_table thead tr:not(:first-child) > td {
  border-top: 1px solid color-mix(in srgb, var(--ehr-theme-strong) 75%, transparent);
}

.horsepage_stats_table > thead {
  background: var(--ehr-theme-strong);
}

/* .horsepage_stats_table tr {
  color: #fff;
  background: #fff;
} */

.horsepage_stats_table th {
  font-weight: 600;
}

.horsepage_stats_table th,
.horsepage_stats_table td {
  border: none;
  color: var(--ehr-theme-on-brand);
  overflow: hidden;
  padding: .25em .5em;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.horsepage_stats_table td:first-child {
  text-align: left;
  font-weight: 600;
}

.horsepage_stats_full td:first-child {
  padding-left: 10px;
}

/* S column can hide early to save space */
/* .horsepage_stats_table .horsepage_stats_hide_s { }
.horsepage_stats_table .horsepage_stats_hide_p { } */

/* Stats row expand arrow — hidden on desktop, shown when columns hide */
.horsepage_stats_expand {
  display: none;
  cursor: pointer;
  color: var(--hp-green, #0c420c);
  font-size: 10px;
  padding: 0 4px;
  text-align: center;
  border-left: none !important;
}

/* Header cell for expand column — hidden on desktop too */
.horsepage_stats_expand_hdr {
  display: none;
  border: none !important;
  background: inherit !important;
}

/* Stats row hidden detail — shows P, S, $ as inline cards */
.horsepage_stats_detail_row { display: none; }
.horsepage_stats_detail_row.horsepage_stats_detail_show { display: table-row; }

.horsepage_stats_detail_cell {
  padding: 4px 8px !important;
  text-align: left !important;
}

.horsepage_stats_detail_cards {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.horsepage_stats_detail_card {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 4px 8px;
  border-left: 3px solid #4a8c5c;
  min-width: 50px;
}

.horsepage_stats_detail_card_label {
  font-weight: 700;
  font-size: 9px;
  color: #888;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.horsepage_stats_detail_card_value {
  font-weight: 600;
  font-size: 13px;
  color: #333;
}

/* Inherit surface color on stats detail rows */
.horsepage_row_dirt .horsepage_stats_detail_card { border-left-color: #c4a265; }
.horsepage_row_turf .horsepage_stats_detail_card { border-left-color: #4caf50; }
.horsepage_row_poly .horsepage_stats_detail_card { border-left-color: #7e57c2; }
.horsepage_row_sprint .horsepage_stats_detail_card { border-left-color: #64b5f6; }
.horsepage_row_route .horsepage_stats_detail_card { border-left-color: #ef9a9a; }
.horsepage_row_off .horsepage_stats_detail_card { border-left-color: #ba68c8; }

/* Detail rows inherit surface background */
.horsepage_stats_detail_row.horsepage_row_dirt { background: var(--hp-dirt); }
.horsepage_stats_detail_row.horsepage_row_turf { background: var(--hp-turf); }
.horsepage_stats_detail_row.horsepage_row_poly { background: var(--hp-poly); }
.horsepage_stats_detail_row.horsepage_row_sprint { background: var(--hp-sprint); }
.horsepage_stats_detail_row.horsepage_row_route { background: var(--hp-route); }
.horsepage_stats_detail_row.horsepage_row_off { background: var(--hp-off); }

/* .horsepage_stats_table tr.horsepage_row_dirt { background: rgba(var(--hp-dirt-rgb),.8) !important; color: #000; } */
.horsepage_stats_table tr.horsepage_row_dirt td:first-child:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--hp-dirt); }
/* .horsepage_stats_table tr.horsepage_row_turf { background: rgba(var(--hp-turf-rgb),.8) !important; color: #000; } */
.horsepage_stats_table tr.horsepage_row_turf td:first-child:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--hp-turf); }
/* .horsepage_stats_table tr.horsepage_row_poly { background: rgba(var(--hp-poly-rgb),.8) !important; color: #000; } */
.horsepage_stats_table tr.horsepage_row_poly td:first-child:before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px; background: var(--hp-poly); }
/* .horsepage_stats_table tr.horsepage_row_sprint { background: var(--hp-sprint) !important; }
.horsepage_stats_table tr.horsepage_row_route { background: var(--hp-route) !important; }
.horsepage_stats_table tr.horsepage_row_off { background: var(--hp-off) !important; } */

/* --- Compact stats view (mobile only) --- */
.horsepage_stats_compact { display: none; }

.horsepage_stats_compact_header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--ehr-theme-base);
  padding: .5em 1em;
  border: 1px solid var(--ehr-theme-strong);
  border-radius: 4px;
  color: var(--ehr-action);
  cursor: pointer;
  font-weight: 600;
}

.horsepage_stats_compact_arrow {
  font-size: 11px;
  color: var(--ehr-theme-strong);
  transition: transform 0.2s ease;
}

.horsepage_stats_compact_grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 8px 0;
}

.horsepage_stats_compact_card {
  display: flex;
  align-items: center;
  gap: 1em;
  background: #fff;
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 6px 8px;
  border-left: 3px solid #4a8c5c;
}

.horsepage_stats_compact_card.horsepage_row_dirt { border-left-color: #c4a265; background: var(--hp-dirt); }
.horsepage_stats_compact_card.horsepage_row_turf { border-left-color: #4caf50; background: var(--hp-turf); }
.horsepage_stats_compact_card.horsepage_row_poly { border-left-color: #7e57c2; background: var(--hp-poly); }
.horsepage_stats_compact_card.horsepage_row_sprint { border-left-color: #64b5f6; background: var(--hp-sprint); }
.horsepage_stats_compact_card.horsepage_row_route { border-left-color: #ef9a9a; background: var(--hp-route); }
.horsepage_stats_compact_card.horsepage_row_off { border-left-color: #ba68c8; background: var(--hp-off); }

.horsepage_stats_compact_label {
  font-weight: 700;
  font-size: 9px;
  color: var(--ehr-theme-base);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.horsepage_stats_compact_value {
  font-weight: 600;
  font-size: 13px;
  color: #333;
}

/* On mobile: hide full table, show compact */
@media (max-width: 600px) {
  .horsepage_stats_full { display: none !important; }
  .horsepage_stats_compact { display: block !important; }
  .horsepage_pedigree_toggle { display: block !important; }
  .horsepage_pedigree_table { display: none; }
  .horsepage_stats_toggle { display: flex !important; }
  .horsepage_stats_card { display: none;         
    grid-template-columns: 1fr;
    margin: 1em; } 
}


/* --- Right column: dam + stat cards --- */
/* 🍞 BREADCRUMB: OLD had flex:0 0 380px + width:380px !important.
   Same problem as horsepage_identity — fixed px width capped column in
   hp_info_grid (CSS grid). Fixed: remove fixed sizing, let grid handle. */
.horsepage_right_col {
  display: flex;
  flex-direction: column;
  gap: var(--hp-gap-sm);
  min-width: 0;
}

/* .horsepage_dam_section {
  padding: 12px;
  border: 2px solid var(--hp-border);
  border-radius: var(--hp-radius);
} */

.horsepage_dam_header {
  display: flex;
  gap: 1em;
  align-items: center;
}

.horsepage_dam_label {
  font-size: 11px;
  color: var(--ehr-action);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.horsepage_dam_name {
  font-weight: 600;
  /* margin-top: 2px; */
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.horsepage_badges {
  display: flex;
  gap: 6px;
}

.horsepage_badge {
  padding: 3px 8px;
  border-radius: var(--hp-radius-sm);
  font-weight: 700;
  color: white;
  font-size: 11px;
}

.horsepage_badge_main { background: #9c27b0; }
.horsepage_badge_alt  { background: #d32f2f; }

/* Stat cards grid */
.horsepage_stat_grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .5em;
}

/* @container content (max-width: 1400px) {
  .horsepage_stat_grid {
    grid-template-columns: repeat(2, 1fr);
  }
} */

.horsepage_stat_card {
  color: var(--ehr-theme-on-brand);
  background: var(--ehr-theme-base);
  border: 1px solid var(--ehr-theme-strong);
  text-align: center;
  /* border-radius: var(--hp-radius-sm); */
  /* box-shadow: var(--ehr-table-box-shadow); */
  /* padding: .25em .5em; */
}

.horsepage_stat_card_label {
  background: var(--ehr-theme-strong);
  font-weight: 600;
  padding: .25em .5em;
}

.horsepage_stat_card_value {
  padding: .25em;
}

/* Full-width stat card (for Wins Within) */
.horsepage_stat_card_full {
  grid-column: 1 / -1;
}

/* Breeding grid */
.horsepage_breeding_grid {
  display: grid;

  /* 3 equal columns */
  /* grid-template-columns: repeat(3, 1fr); */
  grid-template-columns: 1fr 1fr;

  gap: 1em;
}

.horsepage_breeding_grid .horsepage_breeding_card:first-child,
.horsepage_breeding_grid .horsepage_breeding_card:nth-child(2) {
  grid-column: 1 / -1;
}

/* Desktop / tablet */
/* @media (max-width: 600px) {
  .horsepage_breeding_grid {
    display: none;
  }
} */

.horsepage_breeding_card {
  background: #1e471e;
  border-left: 3px solid var(--ehr-theme-accent);
  border-radius: var(--hp-radius-sm);
  color: #fff;
  padding: .25em .5em;
}

.horsepage_breeding_card_label {
  font-size: 11px;
  color: var(--ehr-action);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  margin-bottom: 2px;
}

.horsepage_breeding_card_heading {
  font-weight: 700;
}

.horsepage_breeding_card_value {
  color: #92b190;
  font-size: 11px;
}

/* Full-width breeding stat card (for Wins Within) */
/* .horsepage_breeding_card_full {
  grid-column: 1 / -1;
} */

.horsepage_breeding_card_grid {
  /* display: flex; */
  /* flex-direction: column; */
  gap: 1em;
}

.horsepage_breeding_grid > .horsepage_breeding_card:first-child .horsepage_breeding_card_grid {
  display: flex;
}

/* Horse connections (Owner, Breeder, etc) */
.horsepage_connections {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 1em;
}
.horsepage_connections_card {
  background-color: var(--ehr-theme-base);
  border: 1px solid var(--ehr-theme-strong);
  border-radius: var(--hp-radius);
  /* box-shadow: var(--ehr-table-box-shadow); */
  display: grid; 
  /* flex-direction: column; */
  grid-template-columns:  50px 1fr;
  gap: .5em;
  align-items: center;
  padding: .25em 1em .25em .75em;
  width: 100%;
  grid-column: span 3;
  text-align: left;
}
/* .horsepage_connections_card:nth-child(-n+2) {
  grid-column: span 3;
} */

/* .horsepage_connections_card:nth-child(n+3) {
  grid-column: span 2;
} */
/* WILL2UI_20260924 (D3): no Badges card -> four cards; 2 x 2 instead of 2 + 2 + a blank third. */
/* .horsepage_connections_nobadges .horsepage_connections_card {
  grid-column: span 3;
} */
.horsepage_connections_card .label {
  color: var(--ehr-action);
  font-size: .9em;
  /* padding: .15em .5em; */
}
.horsepage_connections_card .value {
  color: var(--ehr-theme-on-brand);
  font-weight: 500;
  /* PHONEFIT_20261022: a long stable name (Breeder) wraps instead of pushing the card grid past a phone screen */
  min-width: 0;
  overflow-wrap: anywhere;
  /* padding: .25em .5em; */
}

@media (max-width: 480px) {
  .horsepage_connections {
    grid-column: 1 / -1;
  }
  /* PHONEFIT_20261022: ID / Owner / Breeder two to a row on a phone (three to a row wrapped the horse ID) */
  .horsepage_connections_card:nth-child(n+3) {
    grid-column: span 3;
  }
  /* .horsepage_connections_card .value {
    font-size: 12px;
  } */
}

/* Horse miscellaneous (Status, Badges, etc) */
.horsepage_misc {
  color: #fff;
  display: grid;
  gap: .35em;
  /* background: #2f415e;
  padding: 1em;
  border-radius: 10px;
  margin-top: 1em; */
}
.horsepage_misc_card {
  display: flex;
  gap: 1em;
  align-items: flex-end;
}
.horsepage_misc_card .label {
  font-size: 12px;
  font-weight: 500;
  color: var(--ehr-action);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.horsepage_horse_info {
  display: flex;
  flex-direction: column;
  gap: .5em;
  color: var(--ehr-theme-on-brand);
}
.horsepage_horse_info .myTag {
  display: flex;
  gap: .25em;
  align-items: center;
  flex-wrap: wrap;
}
.horsepage_horse_info .myTag-badge {
  border-radius: 4px;
  color: #000;
  font-weight: bold;
  line-height: normal;
  padding: .15em .5em;
}
.horsepage_horse_info .myTag-badge.color_light_grey { background-color: #ced0d2; }
.horsepage_horse_info .myTag-badge.color_roan { background-color: #85848a; }
.horsepage_horse_info .myTag-badge.color_dark_grey { background-color: rgb(73, 73, 73); }
.horsepage_horse_info .myTag-badge.color_dark_brown { background-color: #4f372c; color: #c9a695 !important; }
.horsepage_horse_info .myTag-badge.color_bay { background-color: #907060; }
.horsepage_horse_info .myTag-badge.color_chestnut { background-color: #d57f53; }

.horsepage_horse_info .myTag-badge.sex_colt { background-color: lightblue; }
.horsepage_horse_info .myTag-badge.sex_filly { background-color: lightpink; }
.horsepage_horse_info .myTag-badge.sex_gelding { background-color: tan; }
/* PHONEFIT_20261022 (player note 10-22: "Mare should match the format of filly"): fn_horse_returnsex also gives Mare and
   Horse (age 5 and up), which had no bubble. Mare = the Filly pink, Horse = the Colt blue. */
.horsepage_horse_info .myTag-badge.sex_mare { background-color: lightpink; }
.horsepage_horse_info .myTag-badge.sex_horse { background-color: lightblue; }

.horsepage_horse_info .sire_info {
  display: flex;
  gap: .5em;
  align-items: center;
  flex-wrap: wrap;
}

/* === DELTA: stable action cards + always-visible expand toggle === */

/* Always show the expand toggle regardless of viewport width */
.stable_horse_list_expand_toggle {
    display: inline-block !important;
    padding: 0px;
}

/* Action cards row — sits above the info cards */
.shl_action_cards {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
}

.shl_action_card {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  background: var(--ehr-button-primary-bg);
  /* border-left: 3px solid var(--ehr-theme-base); */
  border-radius: var(--hp-radius-sm);
  cursor: pointer;
  user-select: none;
  transition: background 0.15s;
}

.shl_action_card:hover {
  background: var(--ehr-theme-base);
}

.shl_action_card_label {
    font-weight: 700;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--ehr-button-primary-text);
}

/* CARDSTATE_20260924 (owner: "greyed out is less confusing"): a card that can't be used right now stays in
   place, greyed, with its reason -- instead of vanishing. Wrap so a reason never pushes the row off screen. */
.shl_action_cards { flex-wrap: wrap; }
.shl_action_card.shl_action_card_off { opacity: .45; cursor: not-allowed; }
.shl_action_card.shl_action_card_off:hover { background: var(--ehr-button-primary-bg); }
.shl_action_card_why {
    font-size: 10px;
    font-weight: 600;
    color: var(--ehr-button-primary-text);
    white-space: nowrap;
}
.shl_action_card_why::before { content: "\00b7\00a0"; }

/* Hidden action panel */
.shl_action_panel {
    display: none;
    /* background: var(--ehr-surface-bg); */
    border-top: 2px solid var(--ehr-theme-accent);
}

.shl_action_panel.shl_panel_open {
    display: block;
}

.shl_action_panel_content {
    font-weight: 500;
}

.shl_action_confirm {
    padding: 4px 14px;
    font-size: 12px;
    font-weight: 700;
    background: #4a8c5c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.shl_action_confirm:hover {
    background: #3a7049;
}

/* Standalone / new-window case */
@media (min-width: 1200px) {
  .shl_opt_icons,
  .shl_opt_section_container,
  .hp_info_grid {
    max-width: 1300px;
    margin: auto;
  }
}

/* Inside the main app: always full width, no centering, no container query needed */
/* .ehr-page-container .shl_opt_icons,
.ehr-page-container .shl_opt_section_container,
.ehr-page-container .hp_info_grid {
  max-width: none;
  margin: 0;
} */
