/* Gym Hub. Colours inherit from the template; override the --gh-* variables per site. */
.gymhub {
  --gh-accent: var(--link-color, #0b5ed7);
  --gh-accent-fg: #fff;
  --gh-line: color-mix(in srgb, currentColor 18%, transparent);
  --gh-soft: color-mix(in srgb, currentColor 6%, transparent);
  --gh-radius: 10px;
  --gh-panel: color-mix(in srgb, var(--gh-accent) 8%, Canvas);
  --gh-panel-line: color-mix(in srgb, var(--gh-accent) 28%, transparent);
  --gh-gap: 1rem;
  margin-block: 1rem;
}
.gymhub *, .gymhub *::before, .gymhub *::after { box-sizing: border-box; }
.gymhub [hidden] { display: none !important; }

/* Toolbar */
.gh-filters { border: 1px solid var(--gh-panel-line); border-radius: var(--gh-radius); padding: .65rem .9rem; margin-bottom: .85rem; background: var(--gh-panel); box-shadow: 0 1px 3px rgba(0, 0, 0, .06); }
.gh-filters > summary { cursor: pointer; font-weight: 700; padding: .2rem 0; list-style-position: inside; }
.gh-filters[open] > summary { margin-bottom: .35rem; padding-bottom: .5rem; border-bottom: 1px solid var(--gh-panel-line); }
.gh-filters__grid { display: grid; gap: .7rem .9rem; padding: .6rem 0 .25rem; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); align-items: end; }
.gh-field { display: grid; gap: .25rem; margin: 0; }
.gh-field__label { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.gymhub select { width: 100%; padding: .5rem .55rem; border: 1px solid var(--gh-panel-line); border-radius: 8px; background: Canvas; color: CanvasText; font: inherit; }
.gymhub select:focus-visible, .gh-seg:focus-visible, .gh-btn:focus-visible { outline: 2px solid var(--gh-accent); outline-offset: 2px; }
.gymhub option { color: #111; background: #fff; }
.gh-range, .gh-inc { display: grid; gap: .25rem; font-size: .9rem; }
.gh-range > span:first-child, .gh-inc > span:first-child { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; opacity: .75; }
.gh-range input { width: 100%; accent-color: var(--gh-accent); }
.gh-range__val { font-weight: 600; }
.gh-inc > div { display: flex; gap: .9rem; flex-wrap: wrap; }
.gh-bar { display: flex; justify-content: space-between; gap: .75rem; align-items: center; flex-wrap: wrap; }
.gh-bar select { width: auto; min-width: 12rem; }
.gh-seg-group { display: inline-flex; border: 1px solid var(--gh-line); border-radius: 8px; overflow: hidden; }
.gh-seg { border: 0; background: transparent; color: inherit; padding: .45rem .9rem; font: inherit; cursor: pointer; }
.gh-seg.is-on { background: var(--gh-accent); color: var(--gh-accent-fg); }
.gh-count { margin: .6rem 0; font-size: .9rem; opacity: .8; }
.gh-empty { padding: 2rem 0; text-align: center; opacity: .8; }

/* Buttons */
.gh-btn { display: inline-block; padding: .45rem .85rem; border: 1px solid var(--gh-accent); border-radius: 8px; background: var(--gh-accent); color: var(--gh-accent-fg); font: inherit; font-size: .9rem; text-decoration: none; cursor: pointer; line-height: 1.2; }
.gh-btn:hover { filter: brightness(1.1); color: var(--gh-accent-fg); }
.gh-btn[disabled] { opacity: .5; cursor: not-allowed; }
.gh-btn--ghost { background: transparent; color: inherit; border-color: var(--gh-line); }
.gh-btn--ghost:hover { color: inherit; background: var(--gh-soft); filter: none; }
.gh-btn--book { padding: .3rem .7rem; }

/* Cards */
.gh-list { display: grid; gap: var(--gh-gap); grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.gh-card { display: flex; flex-direction: column; border: 1px solid var(--gh-line); border-radius: var(--gh-radius); overflow: hidden; content-visibility: auto; contain-intrinsic-size: auto 420px; }
.gh-card__img img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.gh-card__body { display: flex; flex-direction: column; gap: .5rem; padding: .85rem; flex: 1; }
.gh-card__title { margin: 0; font-size: 1.1rem; }
.gh-card__title a { text-decoration: none; }
.gh-card__meta { margin: 0; font-size: .85rem; opacity: .75; }
.gh-card__intro { margin: 0; font-size: .9rem; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.gh-prices { list-style: none; margin: 0; padding: 0; display: grid; gap: .35rem; }
.gh-prices li { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .35rem .5rem; background: var(--gh-soft); border-radius: 6px; }
.gh-prices li.is-dim { opacity: .45; }
.gh-badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: .3rem; }
.gh-badges li { font-size: .75rem; padding: .1rem .5rem; border: 1px solid var(--gh-line); border-radius: 999px; }
.gh-card__actions { margin-top: auto; padding-top: .4rem; display: flex; justify-content: space-between; align-items: center; gap: .5rem; }
.gh-cmp { display: inline-flex; gap: .35rem; align-items: center; font-size: .9rem; cursor: pointer; }

/* Map */
.gh-map { height: var(--gh-map-height, 70vh); min-height: 320px; border: 1px solid var(--gh-line); border-radius: var(--gh-radius); z-index: 0; }
.gh-popup { display: grid; gap: .3rem; font-size: .9rem; color: #111; }
.gh-popup img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.gh-popup__meta { opacity: .7; }
.gh-popup__actions { display: flex; gap: .4rem; margin-top: .25rem; }
.gh-popup .gh-btn--ghost { color: #111; }

/* Compare bar + dialog */
.gh-cmpbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000; display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; padding: .6rem 1rem; background: Canvas; color: CanvasText; border-top: 1px solid var(--gh-line); box-shadow: 0 -4px 16px rgba(0, 0, 0, .12); }
.gh-cmpbar__chips { display: flex; flex-wrap: wrap; gap: .4rem; flex: 1; }
.gh-chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .35rem .15rem .6rem; border: 1px solid var(--gh-line); border-radius: 999px; font-size: .85rem; }
.gh-chip button { border: 0; background: transparent; color: inherit; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.gh-dialog { width: min(1100px, 96vw); max-height: 92vh; padding: 0; border: 1px solid var(--gh-line); border-radius: var(--gh-radius); background: Canvas; color: CanvasText; }
.gh-dialog::backdrop { background: rgba(0, 0, 0, .55); }
.gh-dialog__head { display: flex; justify-content: space-between; align-items: center; padding: .75rem 1rem; border-bottom: 1px solid var(--gh-line); position: sticky; top: 0; background: Canvas; z-index: 3; }
.gh-table-wrap { overflow: auto; max-height: calc(92vh - 4rem); }
.gh-table { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 560px; font-size: .9rem; }
.gh-table th, .gh-table td { padding: .6rem .75rem; border-bottom: 1px solid var(--gh-line); text-align: left; vertical-align: top; }
.gh-table thead th { position: sticky; top: 0; background: Canvas; z-index: 2; min-width: 190px; }
.gh-table thead img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; margin-bottom: .4rem; }
.gh-table tbody th { position: sticky; left: 0; background: Canvas; z-index: 1; width: 9rem; font-weight: 600; }
.gh-table thead th:first-child { left: 0; z-index: 4; min-width: 9rem; }
.gh-table td.gh-best { background: color-mix(in srgb, #1a9a4a 14%, transparent); font-weight: 700; }
.gh-book { display: grid; gap: .35rem; }
body:has(.gh-cmpbar:not([hidden])) { padding-bottom: 4.5rem; }

/* Compare on small screens: each label gets its own full-width row, the gyms share the row below it equally. */
@media (max-width: 640px) {
  .gh-dialog { width: 100vw; max-width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0; border: 0; }
  .gh-table-wrap { max-height: calc(100dvh - 3.6rem); overflow-x: hidden; }
  .gh-table { display: block; min-width: 0; }
  .gh-table thead, .gh-table tbody { display: block; }
  .gh-table tr { display: grid; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); }
  .gh-table thead { position: sticky; top: 0; z-index: 3; background: Canvas; border-bottom: 1px solid var(--gh-line); }
  .gh-table thead th { position: static; min-width: 0; padding: .5rem .4rem; font-size: .85rem; border-bottom: 0; }
  .gh-table thead th:first-child { display: none; }
  .gh-table tbody th { position: static; grid-column: 1 / -1; width: auto; padding: .35rem .6rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .02em; background: var(--gh-soft); border-bottom: 0; }
  .gh-table tbody td { min-width: 0; padding: .5rem .45rem; font-size: .88rem; overflow-wrap: anywhere; }
  .gh-book .gh-btn { text-align: center; }
}

@media (max-width: 575px) {
  .gh-list { grid-template-columns: 1fr; }
  .gh-bar select { flex: 1; min-width: 0; }
}
