/* Calendars hub - Interactive API page (CAL-6).
   Styles for the OpenAPI explorer that hub/static/apipage.js mounts into the
   #/api view. It reuses the design-system tokens and classes from app.css
   (card, btn, pill, chip, code, copy, rs, tbl, ep, method, logo, sk …) and
   only adds the pieces specific to the API explorer: the hero, the Console,
   language tabs, the "Try it" panel, schema/parameter tables and the response
   view. Dark mode comes for free via the shared colour tokens. */

#api-explorer { display: flex; flex-direction: column; gap: 18px; }
#api-explorer .sect-h {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--faint);
  font-weight: 650; margin: 6px 2px -4px;
}

/* ---------- Hero ---------- */
.api-hero .hero-top { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.api-hero .hero-ttl { min-width: 240px; flex: 1; }
.api-hero .hero-ttl h2 { font-size: 20px; }
.api-hero .hero-sub { font-size: 13.5px; margin: 7px 0 0; max-width: 680px; color: var(--muted); line-height: 1.5; }
.api-hero .hero-actions { gap: 8px; }
.api-hero .hero-base { margin-top: 16px; }

/* ---------- Console ---------- */
.console-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 14px; }
.fld { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.fld > label { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.conn-row { gap: 8px; flex-wrap: nowrap; }
.conn-row .conn-sel { flex: 1; min-width: 0; }
.conn-row .conn-num { width: 92px; flex: none; }
.console-note { margin-top: 13px; line-height: 1.5; }
.console-note code, .ep-desc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px;
  background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 6px; color: var(--ink-2);
}

/* ---------- Endpoint / schema card bodies ---------- */
.ep-desc { color: var(--ink-2); font-size: 14px; margin: 15px 0 0; line-height: 1.55; }
.in-tag {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; color: var(--muted); background: var(--surface-2);
  border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 7px;
}
.tbl.params td.cell-d { color: var(--muted); font-size: 13px; max-width: 420px; }
.tbl.params td { vertical-align: top; }
.badge { display: inline-block; font-size: 11px; font-weight: 700; padding: 1px 8px; border-radius: 999px; white-space: nowrap; }
.badge.req { color: var(--bad); background: var(--bad-soft); border: 1px solid var(--bad-line); }
.badge.opt { color: var(--muted); background: var(--surface-2); border: 1px solid var(--line); }

/* ---------- Language tabs (segmented control) ---------- */
.samples { margin-top: 2px; }
.tabs { display: inline-flex; gap: 3px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; margin-bottom: 9px; }
.tabs .tab {
  border: 0; background: transparent; color: var(--muted); font-weight: 600; font-size: 12.5px;
  padding: 5px 13px; border-radius: 7px; cursor: pointer; transition: background var(--t), color var(--t);
}
.tabs .tab:hover { color: var(--ink); }
.tabs .tab.active { background: var(--surface); color: var(--brand); box-shadow: var(--shadow-sm); }

/* ---------- Status codes ---------- */
.status-codes { display: flex; flex-direction: column; gap: 7px; }
.sc-row { display: flex; gap: 12px; align-items: baseline; }
.sc-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-weight: 700; font-size: 13px; min-width: 36px; }
.sc-code.ok { color: var(--ok); }
.sc-code.bad { color: var(--bad); }
.sc-d { font-size: 13px; }

/* ---------- Try it ---------- */
.try { border: 1px dashed var(--line); border-radius: var(--radius-sm); padding: 15px; background: var(--surface-2); margin-top: 2px; }
.try-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 11px; margin-bottom: 12px; }
.try-lbl { font-weight: 600; font-size: 13px; margin: 2px 0 7px; color: var(--ink-2); }
.try textarea {
  width: 100%; min-height: 158px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px;
  line-height: 1.6; padding: 11px 13px; border: 1px solid var(--line); border-radius: 9px; background: var(--field);
  color: var(--ink); resize: vertical;
}
.try textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.try-send { margin-top: 11px; gap: 12px; }

/* ---------- Try-it response ---------- */
.try-res { margin-top: 13px; }
.try-res:empty { display: none; }
.res-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 9px; }
.res-head .chips { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .api-hero .hero-actions { width: 100%; }
}
