/* ============================================================
   Baby Sensory Walthamstow — clean, professional timetable
   ============================================================ */

:root {
  --ink:    #1c2333;
  --slate:  #5a6478;
  --faint:  #8a93a6;
  --line:   #e6e9f0;
  --line-2: #eef1f6;
  --bg:     #f6f7fb;
  --card:   #ffffff;

  --accent:   #4f46e5;   /* indigo */
  --accent-d: #4338ca;
  --accent-bg:#eef0fe;

  --open:     #0f9d63;   --open-bg:  #e7f6ee;
  --wait:     #b6781a;   --wait-bg:  #fbf2df;

  --radius:   14px;
  --maxw:     980px;
  --font: "Inter", system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.05);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { margin: 0; line-height: 1.2; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }
.muted { color: var(--slate); }
.strong { font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  font-family: var(--font); font-weight: 600; font-size: .92rem;
  padding: .62em 1.15em; border-radius: 9px; text-decoration: none;
  border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn-sm { font-size: .85rem; padding: .5em .9em; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-d); }

/* ---------- top notice ---------- */
.notice { background: #fff6e3; border-bottom: 1px solid #f1e2b8; }
.notice-inner { padding: 10px 0; }
.notice-text { font-size: .86rem; color: #7c5c12; line-height: 1.45; }
.notice-text strong { color: #5f4708; }
.notice-text a { color: var(--accent-d); font-weight: 700; text-decoration: underline; }
.notice-text a:hover { color: var(--accent); }

/* ---------- masthead ---------- */
.masthead { background: var(--card); border-bottom: 1px solid var(--line); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 9px;
  background: var(--accent-bg); color: var(--accent); font-size: 1rem;
}
.brand-text { font-weight: 700; font-size: 1.05rem; line-height: 1; }
.brand-text em { display: block; font-style: normal; font-weight: 500; font-size: .76rem; color: var(--slate); margin-top: 3px; letter-spacing: .02em; }

/* ---------- subhead + tabs ---------- */
.subhead { background: var(--card); border-bottom: 1px solid var(--line); padding-top: 26px; }
.subhead h1 { font-size: clamp(1.6rem, 4.5vw, 2.1rem); }
.lede { color: var(--slate); margin-top: 8px; max-width: 56ch; }
.tabs { display: flex; gap: 4px; margin-top: 22px; }
.tab {
  font-family: var(--font); font-weight: 600; font-size: .95rem; color: var(--slate);
  background: none; border: 0; border-bottom: 2px solid transparent; cursor: pointer;
  padding: 10px 4px; margin-right: 16px; transition: color .15s, border-color .15s;
}
.tab:hover { color: var(--ink); }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ---------- panels ---------- */
.panel { display: none; padding-top: 26px; padding-bottom: 10px; }
.panel.active { display: block; }

/* ---------- filters ---------- */
.filters {
  display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; box-shadow: var(--shadow);
}
.field { display: flex; flex-direction: column; gap: 5px; min-width: 150px; flex: 1; }
.field label { font-size: .78rem; font-weight: 600; color: var(--slate); }
.field select {
  font-family: var(--font); font-size: .95rem; font-weight: 500; color: var(--ink);
  padding: .6em .8em; border: 1px solid var(--line); border-radius: 9px; background: #fff;
  cursor: pointer; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%235a6478' d='M3 4.5l3 3 3-3'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .8em center; padding-right: 2.2em;
}
.field select:focus { outline: 2px solid var(--accent-bg); border-color: var(--accent); }
.toggle { display: flex; align-items: center; gap: 8px; font-size: .9rem; font-weight: 500; color: var(--ink); cursor: pointer; padding-bottom: .55em; }
.toggle input { width: 17px; height: 17px; accent-color: var(--accent); cursor: pointer; }

.results-bar { display: flex; align-items: center; justify-content: space-between; margin: 18px 2px 10px; }
#result-count { font-size: .88rem; color: var(--slate); font-weight: 500; }
.reset { background: none; border: 0; color: var(--accent); font-family: var(--font); font-weight: 600; font-size: .85rem; cursor: pointer; }
.reset:hover { text-decoration: underline; }

/* ---------- table ---------- */
.table { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.thead, .row {
  display: grid;
  grid-template-columns: 1.6fr .9fr 1.05fr 1.35fr .7fr auto;
  align-items: center; gap: 14px;
}
.thead {
  padding: 13px 18px; background: #fafbfd; border-bottom: 1px solid var(--line);
  font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--faint);
}
.th-action { text-align: right; }
.thead > *, .row > * { min-width: 0; }
.item { border-bottom: 1px solid var(--line-2); }
.item:last-child { border-bottom: 0; }
.row { padding: 15px 18px; cursor: pointer; }
.row:hover, .item.open .row { background: #fafbff; }

.c-when .day { font-weight: 700; font-size: .98rem; }
.c-when .dates { color: var(--slate); font-size: .85rem; margin-top: 1px; white-space: nowrap; }
.chev { display: inline-block; margin-left: 4px; color: var(--faint); font-size: .75rem; transition: transform .18s; }
.item.open .chev { transform: rotate(180deg); }

/* session drawer */
.drawer { display: none; padding: 12px 18px 16px; background: #fbfcfe; border-top: 1px dashed var(--line); }
.item.open .drawer { display: block; }
.drawer-head { font-size: .82rem; font-weight: 600; color: var(--slate); margin-bottom: 10px; }
.sessions { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.sess { font-size: .82rem; font-weight: 600; color: var(--ink); background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 10px; font-variant-numeric: tabular-nums; }
.cal-btn { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .85rem; text-decoration: none; color: var(--accent-d); background: var(--accent-bg); border: 1px solid #dcdcfa; border-radius: 8px; padding: .55em 1em; transition: background .15s; }
.cal-btn:hover { background: #e2e4fe; }

.c-time { display: flex; flex-direction: column; align-items: flex-start; gap: 5px; }
.c-time-val { font-weight: 600; font-variant-numeric: tabular-nums; }
.pod { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; white-space: nowrap; }
.pod-am { color: #b06a12; background: #fcf1de; }
.pod-pm { color: #5a4bc4; background: #eceafb; }

.chip { display: inline-block; font-size: .8rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; }
.chip-age { color: var(--accent-d); background: var(--accent-bg); }
.chip-term { color: var(--slate); background: #f1f3f8; font-weight: 500; }
.c-price { display: flex; flex-direction: column; gap: 1px; }
.price-amt { font-weight: 700; font-variant-numeric: tabular-nums; }
.price-sub { font-size: .74rem; font-weight: 600; color: var(--faint); }

/* age-group colour coding (shared by chips + Classes tab) */
.age-0-6  { color: #b0356b; background: #fce7f0; }
.age-4-13 { color: #4338ca; background: #eef0fe; }
.age-7-13 { color: #0f7a6b; background: #e1f5f0; }
.c-action { text-align: right; }

.book {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font); font-weight: 600; font-size: .88rem; text-decoration: none;
  padding: .55em 1.1em; border-radius: 8px; white-space: nowrap; transition: background .15s, border-color .15s;
}
.book::before { content: ""; width: 7px; height: 7px; border-radius: 50%; }
.book-open { background: var(--open-bg); color: var(--open); border: 1px solid #c7e9d6; }
.book-open::before { background: var(--open); }
.book-open:hover { background: #dcf1e6; }
.book-wait { background: var(--wait-bg); color: var(--wait); border: 1px solid #f0deba; }
.book-wait::before { background: var(--wait); }
.book-wait:hover { background: #f7e9cf; }

.empty { text-align: center; color: var(--slate); padding: 36px; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); margin-top: 14px; }

/* ---------- our classes ---------- */
.prose { max-width: 64ch; }
.prose h2 { font-size: 1.4rem; margin-bottom: 10px; }
.prose p { color: var(--slate); }
.group-title { font-size: 1.1rem; margin: 30px 0 14px; }
.age-groups { display: grid; gap: 12px; }
.ag {
  background: var(--card); border: 1px solid var(--line); border-left-width: 5px; border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 160px 1fr; gap: 18px; align-items: start;
}
.ag-name { font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ag-dot { width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0; }
.ag-blurb { color: var(--slate); font-size: .95rem; }

.ag.k-0-6  { border-left-color: #e8769f; } .ag.k-0-6  .ag-name { color: #b0356b; } .ag.k-0-6  .ag-dot { background: #e8769f; }
.ag.k-4-13 { border-left-color: #6366f1; } .ag.k-4-13 .ag-name { color: #4338ca; } .ag.k-4-13 .ag-dot { background: #6366f1; }
.ag.k-7-13 { border-left-color: #16b6a4; } .ag.k-7-13 .ag-name { color: #0f7a6b; } .ag.k-7-13 .ag-dot { background: #16b6a4; }
.parties { margin-top: 26px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.parties h3 { font-size: 1.1rem; margin-bottom: 6px; }
.parties p { color: var(--slate); }

/* ---------- visit ---------- */
.visit-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.visit-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.visit-card h3 { font-size: 1.1rem; margin-bottom: 10px; }
.visit-card p { margin: 3px 0; }
.visit-card .btn { margin-top: 14px; }
.link { color: var(--accent); font-weight: 600; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- footer ---------- */
.foot { margin-top: 44px; padding: 24px 0 40px; border-top: 1px solid var(--line); }
.foot p { color: var(--faint); font-size: .8rem; text-align: center; }

/* ---------- mobile: table becomes cards ---------- */
@media (max-width: 680px) {
  .thead { display: none; }
  .table { background: transparent; border: 0; box-shadow: none; overflow: visible; }
  .item {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    box-shadow: var(--shadow); margin-bottom: 12px; overflow: hidden;
  }
  .row { grid-template-columns: 1fr auto; gap: 6px 12px; padding: 16px; }
  .row:hover, .item.open .row { background: transparent; }
  .c-when { grid-column: 1; }
  .c-action { grid-column: 2; grid-row: 1 / span 2; align-self: center; }
  .c-time { grid-column: 1; }
  .c-age { grid-column: 1; }
  .c-term { grid-column: 1; }
  .c-price { grid-column: 1; flex-direction: row; align-items: baseline; gap: 6px; }
  .c-price::before { content: "Price"; color: var(--faint); font-weight: 600; }
  .price-sub::before { content: "· "; }
  .drawer { padding: 12px 16px 16px; }
}
@media (max-width: 520px) {
  .field { min-width: 100%; }
  .ag { grid-template-columns: 1fr; gap: 6px; }
  .visit-grid { grid-template-columns: 1fr; }
}
