/*
 * Clubhouse home (body.ps-clubhouse, loaded after home-modern.php's own styles).
 * The venue's photo is the hero; a white panel sits over its lower edge; pill
 * buttons, generous rounding, one accent (the venue colour). Dark mode follows
 * the modern tokens (black base).
 */

body.ps-clubhouse {
    --page: #ffffff;
    --page-2: #f1f2ef;
    --surface: #ffffff;
    --surface-2: #f1f2ef;
    --line: #e3e4e0;
    --line-2: #eceeea;
    --ink: #0a0a0a;
    --ink-2: #2f3431;
    --muted: #5e625f;
    --faint: #5e625f;
    --r-xl: 28px;
    --r-lg: 22px;
    --r-md: 18px;
    --r-sm: 14px;
    --sh-brand: none;
    --ch-photo: #2d332f;
}
html[data-theme="dark"] body.ps-clubhouse {
    --page: #000000;
    --page-2: #141414;
    --surface: #1c1c1c;
    --surface-2: #141414;
    --line: #2a2a2a;
    --line-2: #1c1c1c;
    --ink: #ededed;
    --ink-2: #cccccc;
    --muted: #a3a3a3;
    --faint: #a3a3a3;
    --ch-photo: #1b1f1c;
}
body.ps-clubhouse::before { display: none; }
body.ps-clubhouse .btn { border-radius: 999px; box-shadow: none; }
body.ps-clubhouse .sec-head h2 { font-weight: 800; letter-spacing: -0.02em; }

/* ---- Hero ---- */
.ch-hero { padding: 12px 0 64px; }
.ch-hero .wrap { position: relative; }
.ch-frame {
    position: relative;
    height: clamp(300px, 46vw, 560px);
    border-radius: var(--r-xl);
    overflow: hidden;
    background: var(--ch-photo);
}
.ch-frame--brand { background: var(--brand); color: var(--court-green-on, #fff); }
.ch-frame__court { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0.28; }
.ch-frame__img { width: 100%; height: 100%; object-fit: cover; }
.ch-frame .hero-bg { position: absolute; inset: 0; }
.ch-frame .hero-bg__slide,
.ch-frame .hero-bg__video { border-radius: 0; }
.ch-frame__video { position: absolute; inset: 0; height: 100%; aspect-ratio: auto; border-radius: 0; }

.ch-panel {
    position: absolute;
    left: 56px;
    bottom: -24px;
    width: min(600px, calc(100% - 112px));
    background: var(--surface);
    border-radius: 24px;
    padding: 32px 34px 28px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
}
.ch-h1 {
    font-family: var(--fd);
    font-weight: 800;
    font-size: clamp(2.3rem, 5vw, 4rem);
    line-height: 0.98;
    letter-spacing: -0.02em;
    color: var(--ink);
}
.ch-h1--md { font-size: clamp(2rem, 4vw, 3.25rem); }
.ch-h1--sm { font-size: clamp(1.7rem, 3.2vw, 2.5rem); }
.ch-h1__accent { display: block; color: var(--brand); }
html[data-theme="dark"] .ch-h1__accent { color: var(--court-glow, var(--brand)); }
.ch-lede { color: var(--muted); font-size: 1.08rem; }
.ch-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.ch-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font-weight: 600;
    white-space: nowrap;
}
.ch-btn svg { width: 18px; height: 18px; }
.ch-btn--brand { background: var(--brand); color: var(--court-green-on, #fff); }
.ch-btn--line { border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.ch-btn--text { color: var(--ink); padding: 0 10px; }

.ch-op {
    position: absolute;
    right: 56px;
    bottom: -8px;
    width: 320px;
    background: var(--surface);
    border-radius: 22px;
    padding: 18px 22px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.14);
    color: var(--ink);
}
.ch-op__top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.ch-op__top b { font: 700 1.25rem/1.1 var(--fd); }
.ch-op__time, .ch-op__going span { color: var(--muted); }
.ch-op__going b { font-weight: 600; }

/* ---- When do you want to play? ---- */
.ch-when { padding-top: 64px; }
.ch-when__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.ch-when__head h2 { font-family: var(--fd); font-weight: 800; font-size: clamp(1.8rem, 4vw, 2.75rem); letter-spacing: -0.02em; line-height: 1.02; }
.ch-when__picker { display: flex; flex-direction: column; gap: 10px; }
.ch-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-pill {
    min-height: 44px;
    padding: 0 18px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
}
.ch-pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); font-weight: 600; }
.ch-muted { color: var(--muted); }
.ch-courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-top: 6px; }
.ch-court {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 16px 16px 20px;
    border-radius: var(--r-md);
    background: var(--surface-2);
}
.ch-court__info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ch-court__name { font: 700 1.15rem/1.15 var(--fd); color: var(--ink); }
.ch-court__kind { color: var(--muted); font-size: 0.9rem; }
.ch-court__price { font-weight: 600; font-variant-numeric: tabular-nums; }
.ch-court .ch-btn { min-height: 42px; padding: 0 18px; }
.ch-court.is-taken { opacity: 0.7; }
.ch-when__note { font-size: 0.9rem; }

@media (max-width: 860px) {
    .ch-hero { padding-bottom: 24px; }
    .ch-frame { height: 260px; }
    .ch-panel { position: relative; left: auto; bottom: auto; width: auto; margin: -56px 12px 0; padding: 22px; }
    .ch-op { position: relative; right: auto; bottom: auto; width: auto; margin: 14px 0 0; background: var(--surface-2); box-shadow: none; }
    .ch-when { padding-top: 36px; }
}

/* Part of the day + length: two compact segmented controls on one row. */
.ch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ch-seg { display: inline-flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--surface-2); max-width: 100%; overflow-x: auto; }
.ch-seg button {
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 500;
    white-space: nowrap;
}
.ch-seg button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); }
html[data-theme="dark"] .ch-seg button[aria-pressed="true"] { background: #2a2a2a; box-shadow: none; }

/* Start times of the chosen part, each with how many courts are free. */
.ch-hours { display: flex; gap: 8px; flex-wrap: wrap; }
.ch-hour {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    min-width: 92px;
    padding: 10px 16px;
    border-radius: var(--r-sm);
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--ink);
    text-align: left;
}
.ch-hour b { font: 700 1.05rem/1.1 var(--fd); font-variant-numeric: tabular-nums; }
.ch-hour span { font-size: 0.8rem; color: var(--muted); margin-top: 2px; }
.ch-hour[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--page); }
.ch-hour[aria-pressed="true"] span { color: inherit; opacity: 0.8; }
.ch-hour:disabled { opacity: 0.45; cursor: default; }
@media (max-width: 560px) {
    .ch-row { flex-direction: column; align-items: stretch; }
    .ch-seg { width: 100%; }
    .ch-seg button { flex: 1; padding: 0 10px; }
    .ch-hours { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; }
    .ch-hour { flex: 0 0 auto; }
}
@media (max-width: 560px) {
    .ch-when__picker > .ch-pills { flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; }
    .ch-when__picker > .ch-pills .ch-pill { flex: 0 0 auto; }
}
