/*
 * Public weekly schedule: matrix by start time + phone agenda.
 * Standalone: does not depend on the admin calendar stylesheet.
 *
 * Theme hooks (override on .wss-wcb-ps or :root):
 *   --wss-ps-ink            main text colour
 *   --wss-ps-accent         today column / active tab / primary button
 *   --wss-ps-heading-font   font for the week title (default: inherit)
 *   --wss-ps-sticky-top     offset for the sticky day header (e.g. height of a fixed site header)
 *   --wss-ps-max            maximum block width
 */
.wss-wcb-ps{
    --ps-ink:var(--wss-ps-ink,#17243a);
    --ps-accent:var(--wss-ps-accent,#17243a);
    --ps-muted:#4a5568;
    --ps-line:#dfe4ec;
    --ps-line-soft:#e6e9ef;
    --ps-surface:#fff;
    --ps-tint:#faf9f5;
    --ps-today:#f3f6fb;
    box-sizing:border-box;
    width:100%;
    max-width:var(--wss-ps-max,1280px);
    margin:28px auto 52px;
    color:var(--ps-ink);
    font-family:inherit;
    font-size:14px;
    line-height:1.4;
}
.wss-wcb-ps *,.wss-wcb-ps *::before,.wss-wcb-ps *::after{box-sizing:border-box}
.wss-wcb-ps :where(h2,h3,h4,p,ul,li,table,caption,small,b,time,span){margin:0;padding:0;letter-spacing:normal;text-transform:none}
.wss-wcb-ps ul{list-style:none}
.wss-wcb-ps__sr{position:absolute;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}

/* Toolbar */
.wss-wcb-ps .wss-wcb-ps__bar{display:flex;flex-wrap:wrap;align-items:flex-end;gap:12px 16px;margin:0 0 18px;padding:14px 16px;background:var(--ps-surface);border:1px solid var(--ps-line);border-radius:12px}
.wss-wcb-ps .wss-wcb-ps__nav{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.wss-wcb-ps .wss-wcb-ps__week{margin:0 10px;font-family:var(--wss-ps-heading-font,inherit);font-size:26px;font-weight:700;line-height:1.15;color:var(--ps-ink);white-space:nowrap}
.wss-wcb-ps .wss-wcb-ps__btn,
.wss-wcb-ps .wss-wcb-ps__icon{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 16px;font-family:inherit;font-size:14px;font-weight:600;line-height:1;color:var(--ps-ink);background:var(--ps-surface);border:1px solid #cfd6e1;border-radius:8px;text-decoration:none;cursor:pointer;transition:background .15s,border-color .15s}
.wss-wcb-ps .wss-wcb-ps__icon{width:44px;padding:0;font-size:20px;font-weight:500}
.wss-wcb-ps .wss-wcb-ps__btn:hover,
.wss-wcb-ps .wss-wcb-ps__icon:hover{background:#f1f4f9;border-color:#b6c1d1;color:var(--ps-ink)}
.wss-wcb-ps .wss-wcb-ps__btn--primary{color:#fff;background:var(--ps-accent);border-color:var(--ps-accent)}
.wss-wcb-ps .wss-wcb-ps__btn--primary:hover{color:#fff;background:var(--ps-accent);filter:brightness(1.18)}
.wss-wcb-ps .wss-wcb-ps__field{display:flex;flex-direction:column;gap:5px;min-width:150px}
.wss-wcb-ps .wss-wcb-ps__field--grow{flex:1 1 260px}
.wss-wcb-ps .wss-wcb-ps__field span{font-size:12px;font-weight:600;color:var(--ps-muted)}
.wss-wcb-ps .wss-wcb-ps__field input,
.wss-wcb-ps .wss-wcb-ps__field select{width:100%;min-height:44px;padding:0 12px;font-family:inherit;font-size:14px;font-weight:500;line-height:1.2;color:var(--ps-ink);background:var(--ps-surface);border:1px solid #cfd6e1;border-radius:8px}
.wss-wcb-ps a:focus-visible,
.wss-wcb-ps button:focus-visible,
.wss-wcb-ps input:focus-visible,
.wss-wcb-ps select:focus-visible,
.wss-wcb-ps__matrix-wrap:focus-visible{outline:2px solid #2f6fb0;outline-offset:2px}
.wss-wcb-ps.has-js .wss-wcb-ps__submit{display:none}

/* Legend */
.wss-wcb-ps .wss-wcb-ps__legend{display:flex;flex-wrap:wrap;align-items:center;gap:8px 16px;margin:0 2px 10px;font-size:12.5px;color:var(--ps-muted)}
.wss-wcb-ps .wss-wcb-ps__legend-item{display:inline-flex;align-items:center;gap:6px}

/* Seat pill */
.wss-wcb-ps .wss-wcb-ps__seats{flex:none;display:inline-block;min-width:26px;padding:2px 8px;font-size:12px;font-weight:700;line-height:1.35;text-align:center;border-radius:999px;background:#e3f1ea;color:#14573a}
.wss-wcb-ps .wss-wcb-ps__seats--low,
.wss-wcb-ps .is-low .wss-wcb-ps__seats{background:#fdeccb;color:#6e4200;box-shadow:inset 0 0 0 1px #d9a441}
.wss-wcb-ps .wss-wcb-ps__seats--zero,
.wss-wcb-ps .is-zero .wss-wcb-ps__seats{background:#e8eaee;color:#4a5568}

/* Chip */
.wss-wcb-ps .wss-wcb-ps__list{display:flex;flex-direction:column;gap:6px}
.wss-wcb-ps .wss-wcb-ps__chip{display:flex;align-items:center;gap:8px;padding:6px 8px;font-size:12.5px;font-weight:500;line-height:1.25;color:var(--ps-ink);background:var(--ps-surface);border:1px solid #dde2ea;border-radius:8px}
.wss-wcb-ps .wss-wcb-ps__chip::before{content:"";flex:none;width:9px;height:9px;border-radius:50%;background:var(--wss-tour,#5a6b86)}
.wss-wcb-ps .wss-wcb-ps__name{flex:1;min-width:0;font-size:inherit;font-weight:inherit;color:inherit;overflow-wrap:anywhere}
.wss-wcb-ps .wss-wcb-ps__time{display:block;margin-top:1px;font-size:11.5px;font-weight:500;color:var(--ps-muted);font-variant-numeric:tabular-nums}
.wss-wcb-ps .wss-wcb-ps__chip.is-zero{background:#f4f5f7;color:var(--ps-muted)}

/* Matrix */
.wss-wcb-ps .wss-wcb-ps__matrix-wrap{background:var(--ps-surface);border:1px solid var(--ps-line);border-radius:12px;overflow:clip}
.wss-wcb-ps .wss-wcb-ps__agenda{display:none}
.wss-wcb-ps .wss-wcb-ps__matrix{width:100%;margin:0;border-collapse:separate;border-spacing:0;table-layout:fixed}
.wss-wcb-ps .wss-wcb-ps__matrix th,
.wss-wcb-ps .wss-wcb-ps__matrix td{padding:8px;vertical-align:top;font-size:13px;text-align:left;background:transparent;border:0;border-right:1px solid var(--ps-line-soft);border-bottom:1px solid var(--ps-line-soft)}
.wss-wcb-ps .wss-wcb-ps__matrix th:last-child,
.wss-wcb-ps .wss-wcb-ps__matrix td:last-child{border-right:0}
.wss-wcb-ps .wss-wcb-ps__matrix tbody tr:last-child th,
.wss-wcb-ps .wss-wcb-ps__matrix tbody tr:last-child td{border-bottom:0}
.wss-wcb-ps .wss-wcb-ps__matrix thead th{position:sticky;top:var(--wss-ps-sticky-top,0);z-index:2;padding:12px 6px;text-align:center;font-weight:700;color:var(--ps-ink);background:#f1efe8;border-bottom:1px solid var(--ps-line)}
.wss-wcb-ps .wss-wcb-ps__matrix thead th.wss-wcb-ps__corner{width:108px;padding-left:12px;text-align:left}
.wss-wcb-ps .wss-wcb-ps__matrix thead th.is-today{color:#fff;background:var(--ps-accent)}
.wss-wcb-ps .wss-wcb-ps__dayname{display:block;font-size:13px;font-weight:700}
.wss-wcb-ps .wss-wcb-ps__matrix time{display:block;margin-top:2px;font-size:12px;font-weight:500;color:var(--ps-muted);font-variant-numeric:tabular-nums}
.wss-wcb-ps .wss-wcb-ps__matrix th.is-today time{color:#d6deea}
.wss-wcb-ps .wss-wcb-ps__matrix tbody th{width:108px;padding:12px 10px;background:var(--ps-tint)}
.wss-wcb-ps .wss-wcb-ps__matrix td.is-today{background:var(--ps-today)}
.wss-wcb-ps .wss-wcb-ps__rowtime{display:block;font-size:19px;font-weight:700;line-height:1.1;color:var(--ps-ink);font-variant-numeric:tabular-nums}
.wss-wcb-ps .wss-wcb-ps__rowtime--small{font-size:13px}
.wss-wcb-ps .wss-wcb-ps__rowmeta{display:block;margin-top:5px;font-size:11.5px;font-weight:400;line-height:1.35;color:var(--ps-muted)}
.wss-wcb-ps .wss-wcb-ps__none{display:block;padding-top:4px;text-align:center;font-size:14px;color:#6b7686}
.wss-wcb-ps .wss-wcb-ps__allday td{border-bottom:2px solid var(--ps-line)}

/* Empty states / notices */
.wss-wcb-ps .wss-wcb-ps__empty{padding:14px 16px;font-size:14px;color:var(--ps-muted);background:#f8fafc;border:1px solid var(--ps-line);border-radius:10px}
.wss-wcb-ps .wss-wcb-ps__empty--day{margin-bottom:10px}
.wss-wcb-ps__notice{max-width:var(--wss-ps-max,1280px);margin:16px auto;padding:14px 16px;font-size:14px;color:#4a5568;background:#f8fafc;border:1px solid #dfe4ec;border-radius:10px}

/* Desktop: use the browser width, even inside a narrow theme/Elementor column.
 * The existing matrix, colors and mobile agenda remain unchanged.
 */
@media (min-width:783px){
    .wss-wcb-ps{
        position:relative;
        left:50%;
        width:calc(100vw - 48px);
        max-width:var(--wss-ps-max,none);
        margin-left:0;
        margin-right:0;
        transform:translateX(-50%);
    }
}

/* Tablet: keep the matrix readable, scroll instead of squeezing. */
@media (max-width:1099px){
    .wss-wcb-ps .wss-wcb-ps__matrix-wrap{overflow-x:auto;overscroll-behavior-x:contain}
    .wss-wcb-ps .wss-wcb-ps__matrix{min-width:900px}
    .wss-wcb-ps .wss-wcb-ps__matrix thead th{position:static}
}

/* Phone: day tabs + agenda instead of a wide table. */
@media (max-width:782px){
    .wss-wcb-ps{margin:20px auto 36px}
    .wss-wcb-ps .wss-wcb-ps__bar{padding:12px}
    .wss-wcb-ps .wss-wcb-ps__nav{width:100%;justify-content:space-between}
    .wss-wcb-ps .wss-wcb-ps__week{flex:1;margin:0;font-size:22px;white-space:normal;text-align:center}
    .wss-wcb-ps .wss-wcb-ps__btn--today{flex:1 1 100%}
    .wss-wcb-ps .wss-wcb-ps__field,
    .wss-wcb-ps .wss-wcb-ps__field--grow{flex:1 1 100%}
    .wss-wcb-ps .wss-wcb-ps__legend{display:none}
    .wss-wcb-ps .wss-wcb-ps__matrix-wrap{display:none}
    .wss-wcb-ps .wss-wcb-ps__agenda{display:block}
    .wss-wcb-ps .wss-wcb-ps__tabs{display:none}
    .wss-wcb-ps.has-js .wss-wcb-ps__tabs{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;margin:0 0 16px}
    .wss-wcb-ps .wss-wcb-ps__tab{min-height:56px;padding:4px 0;font-family:inherit;font-size:12px;font-weight:600;line-height:1.2;color:var(--ps-ink);background:var(--ps-surface);border:1px solid var(--ps-line);border-radius:8px;cursor:pointer}
    .wss-wcb-ps .wss-wcb-ps__tab small{display:block;margin-top:2px;font-size:13px;font-weight:500;color:var(--ps-muted)}
    .wss-wcb-ps .wss-wcb-ps__tab[aria-pressed="true"]{color:#fff;background:var(--ps-accent);border-color:var(--ps-accent)}
    .wss-wcb-ps .wss-wcb-ps__tab[aria-pressed="true"] small{color:#d6deea}
    .wss-wcb-ps.has-js .wss-wcb-ps__day:not(.is-active){display:none}
    .wss-wcb-ps .wss-wcb-ps__day{margin-bottom:22px}
    .wss-wcb-ps .wss-wcb-ps__dayhead{margin:0 0 8px;font-size:16px;font-weight:700;color:var(--ps-ink)}
    .wss-wcb-ps .wss-wcb-ps__dayhead small{font-size:13px;font-weight:500;color:var(--ps-muted)}
    .wss-wcb-ps .wss-wcb-ps__group{margin:14px 0 6px;font-size:12.5px;font-weight:700;letter-spacing:.04em;text-transform:uppercase;color:var(--ps-muted)}
    .wss-wcb-ps .wss-wcb-ps__agenda .wss-wcb-ps__chip{min-height:48px;padding:6px 12px;font-size:14.5px;border-radius:10px}
    .wss-wcb-ps .wss-wcb-ps__agenda .wss-wcb-ps__seats{font-size:12.5px;padding:3px 10px}
}

@media print{
    .wss-wcb-ps{margin:0;max-width:none}
    .wss-wcb-ps .wss-wcb-ps__bar .wss-wcb-ps__nav a,
    .wss-wcb-ps .wss-wcb-ps__field,
    .wss-wcb-ps .wss-wcb-ps__submit{display:none}
    .wss-wcb-ps .wss-wcb-ps__matrix-wrap{display:block;overflow:visible;border-radius:0}
    .wss-wcb-ps .wss-wcb-ps__matrix{min-width:0}
    .wss-wcb-ps .wss-wcb-ps__matrix thead th{position:static}
    .wss-wcb-ps .wss-wcb-ps__agenda{display:none}
    .wss-wcb-ps .wss-wcb-ps__matrix tr{break-inside:avoid}
}
