/* Special Events — scoped styles for the staff workspace.
 *
 * Every selector is prefixed .he-* so this file cannot reach anything the rest
 * of the Hub owns. Design tokens come from styles.css; nothing here re-declares
 * a brand colour, so the workspace follows the Hub's light and dark themes
 * rather than carrying its own.
 *
 * No @import, no url() to a remote host: the live CSP is style-src 'self'.
 */

.he-root { color: var(--text); }

/* --- toolbar + status tabs ------------------------------------------------ */
.he-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 20px;
}
/* The status filter is one segmented control: the chosen status is the raised segment. */
.he-tabs {
  display: inline-flex; gap: 2px; flex-wrap: wrap; padding: 3px;
  border-radius: 9px; background: #eef1f5;
}
.he-tab {
  border: 0; background: transparent; color: #344256;
  border-radius: 7px; min-height: 30px; padding: 0 12px; font-size: 13px; font-weight: 500;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.he-tab:hover { color: var(--ink-900); }
.he-tab-on {
  background: #fff; color: var(--ink-900); font-weight: 600;
  box-shadow: 0 0 0 1px var(--border), 0 1px 2px rgba(11, 26, 43, .07);
}
.he-tab-n { color: var(--text3); margin-left: 4px; font-weight: 500; font-variant-numeric: tabular-nums; }
/* New event sits beside the page title on wide screens, like every page's actions
   (styles.css "PAGE ACTIONS BESIDE THE TITLE"). The list view is the only one with a
   toolbar, so the create/edit/detail views are untouched. */
@media (min-width: 1280px) {
  .he-root { position: relative; }
  .he-root > .he-toolbar > .he-toolbar-actions {
    position: absolute; z-index: 2; top: -28px; right: 0; margin: 0; transform: translateY(-100%);
  }
}

/* --- buttons -------------------------------------------------------------- */
/* Same size and weight as the Hub's .hub-btn, so an Events page reads like every other. */
.he-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 38px;
  border: 1px solid var(--border2); background: var(--surface); color: var(--text);
  border-radius: var(--r); padding: 8px 14px; font-size: 12.5px; font-weight: 700; line-height: 1.2;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.he-btn:hover { background: var(--surface2); }
/* The Hub's one primary colour: navy, white text at 16:1. */
.he-btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.he-btn-primary:hover { background: var(--navy2); border-color: var(--navy2); }
.he-btn-quiet { border-color: transparent; background: transparent; color: var(--accent-2); padding: 0 8px; }
.he-btn-quiet:hover { background: transparent; color: #115e59; text-decoration: underline; text-underline-offset: 3px; }
/* Cancelling an event or a registration cannot be undone from this screen, so
   it does not look like the buttons beside it. */
.he-btn-danger { background: var(--danger-bg); border-color: var(--danger-br); color: var(--danger); }
.he-btn-danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }
.he-btn:disabled, .he-attbtn:disabled { opacity: .55; cursor: default; }
.he-link {
  border: 0; background: none; padding: 3px 0; font: inherit; font-weight: 600;
  color: var(--navy3); cursor: pointer; text-align: left;
}
.he-link:hover { text-decoration: underline; }

/* --- tables --------------------------------------------------------------- */
/* position: the table's visually-hidden "Actions" label is absolutely positioned; without a
   containing block here it escaped the scroller and widened the whole page on a phone. */
.he-tablewrap { overflow-x: auto; position: relative; }
.he-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.he-table th {
  text-align: left; font-size: 12.5px; letter-spacing: 0; text-transform: none;
  color: var(--text3); font-weight: 500; padding: 10px 12px; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
.he-table th:first-child, .he-table td:first-child { padding-left: 4px; }
.he-table td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; color: #344256; }
.he-table tbody tr:hover { background: #f7f9fb; }
.he-table .he-link { color: var(--ink-900); }
.he-c-cap { font-variant-numeric: tabular-nums; }
.he-c-date { white-space: nowrap; }
.he-c-title { min-width: 260px; }
.he-c-cap { min-width: 180px; }
.he-c-act { text-align: right; white-space: nowrap; }
.he-c-n { color: var(--text3); font-variant-numeric: tabular-nums; width: 34px; }
.he-c-status { white-space: nowrap; width: 1%; }
.he-table-att td { vertical-align: top; }
/* The location under an event title. It is a <span> inside a table cell, so it
   needs an explicit block to sit on its own line rather than running on from
   the title. */
.he-sub { display: block; font-size: 12px; color: var(--text3); margin-top: 2px; }
/* The panel that stops a save: a DST-ambiguous time awaiting a choice, or a
   cancellation awaiting confirmation. It interrupts on purpose. */
.he-warn {
  border: 1px solid var(--warn-br); background: var(--warn-bg); color: var(--text);
  border-radius: 10px; padding: 14px 16px; margin: 14px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.he-warn .he-h4 { margin: 0; color: var(--warn); }
.he-warn p { margin: 0; font-size: 13px; }
.he-empty {
  padding: 56px 24px; text-align: center; color: var(--text3);
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.he-empty h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--ink-900); }
.he-empty p { margin: 0 auto; max-width: 52ch; font-size: 14px; }
.he-empty p + p { margin-top: 18px; }
.he-muted { color: var(--text3); }
.he-mail { color: var(--navy3); }

/* --- status pills --------------------------------------------------------- */
.he-pill {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 9px;
  font-size: 12px; line-height: 1; font-weight: 600; letter-spacing: 0; text-transform: none;
  border: 0; white-space: nowrap;
}
/* A dot beside the word: the status still reads without its colour. */
.he-pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .7; }
/* One rule per status the DATABASE can hold, named after the stored value, so a
   status can never render unstyled because the UI invented its own vocabulary.
   The five here are exactly hub_special_events.status. */
.he-pill-draft               { background: #eef1f5; color: #344256; }
.he-pill-published           { background: #edf7f6; color: #0f766e; }
.he-pill-registration_closed { background: #fff8ec; color: #7c3a0b; }
.he-pill-cancelled           { background: #fef3f2; color: #b42318; }
.he-pill-completed           { background: #eef2f8; color: #153459; }

/* --- detail --------------------------------------------------------------- */
.he-detail-top {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; flex-wrap: wrap; margin-bottom: 14px;
}
.he-detail-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.he-h3 { margin: 0 0 8px; font-family: var(--serif); font-size: 22px; font-weight: 600; line-height: 1.25; color: var(--ink-900); }
.he-h4 { margin: 28px 0 10px; font-size: 15px; font-weight: 600; color: var(--ink-900); }
.he-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px 20px; margin: 0 0 18px; font-size: 14px;
}
.he-meta dt { font-size: 12.5px; color: var(--text3); font-weight: 500; margin-bottom: 2px; }
.he-meta dd { margin: 0; color: var(--text); }
/* The host roster lists inside .he-meta. No layout of their own: .he-meta is
   already auto-fit/minmax, so these collapse to one column on a phone. */
.he-names { margin: 0; padding-left: 18px; line-height: 1.7; }
.he-names li { overflow-wrap: anywhere; }
.he-desc { font-size: 14px; line-height: 1.65; color: var(--text2); max-width: 74ch; }
.he-desc p { margin: 0 0 12px; }
.he-qlist { margin: 0; padding-left: 20px; font-size: 14px; color: var(--text2); line-height: 1.9; }
.he-req { color: var(--danger); font-size: 11px; font-weight: 700; text-transform: uppercase; }
/* A question the save-time validator will refuse. Shown, not hidden. */
.he-q-nolabel { color: var(--danger); font-style: italic; }
.he-ans { margin-bottom: 3px; }
.he-ans-q { color: var(--text3); }

/* --- notes ---------------------------------------------------------------- */
.he-note {
  border-radius: 8px; padding: 10px 14px; font-size: 13px;
  margin-bottom: 14px; border: 1px solid transparent;
}
.he-note-ok   { background: var(--ok-bg);   color: var(--ok);   border-color: var(--ok-br); }
.he-note-warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-br); }
.he-note-read { background: var(--info-bg); color: var(--info); border-color: var(--info-br); }
.he-hint { font-size: 12px; color: var(--text3); margin: 6px 0 0; line-height: 1.5; }

/* --- form ----------------------------------------------------------------- */
.he-form { max-width: 720px; }
.he-field { margin-bottom: 16px; }
.he-lab { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.he-input {
  width: 100%; border: 1px solid var(--border2); border-radius: 8px;
  padding: 9px 12px; font-size: 14px; font-family: inherit; color: var(--text);
  background: var(--surface); box-sizing: border-box;
}
.he-input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
.he-input:disabled { background: var(--surface2); color: var(--text3); }
.he-textarea { resize: vertical; line-height: 1.6; }
.he-grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.he-formactions { display: flex; gap: 8px; margin-top: 8px; }

/* --- question editor ------------------------------------------------------ */
.he-toolbar-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.he-qedit { list-style: none; margin: 0 0 14px; padding: 0; }
.he-q-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  border: 1px solid var(--border); border-radius: 8px;
  padding: 10px 12px; margin-bottom: 6px; background: var(--surface);
}
.he-q-main { min-width: 0; }
.he-q-label { display: block; font-size: 14px; font-weight: 600; }
.he-q-meta { display: block; font-size: 12px; color: var(--text3); margin-top: 2px; }
.he-q-opts { font-size: 12px; color: var(--text2); margin-top: 4px; }
.he-q-del { color: var(--danger); flex: 0 0 auto; }
.he-q-del:hover { background: var(--danger-bg); }
.he-q-none {
  border: 1px dashed var(--border2); border-radius: 8px; padding: 14px;
  font-size: 13px; color: var(--text3); text-align: center;
}
.he-qadd {
  border: 1px solid var(--border); border-radius: 10px;
  padding: 14px; background: var(--surface2);
}
.he-qadd-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 12px; }
.he-qadd-opts { margin-top: 10px; }
.he-qadd .he-field { margin-bottom: 10px; }
.he-check {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text2); margin-bottom: 12px;
}

/* --- upcoming events listing ---------------------------------------------- */

/* --- attendance ----------------------------------------------------------- */
.he-attbtns { display: inline-flex; gap: 4px; }
.he-attbtn {
  border: 1px solid var(--border2); background: var(--surface); color: var(--text2);
  border-radius: 6px; padding: 4px 9px; font-size: 12px; font-weight: 600;
  cursor: pointer; font-family: inherit; white-space: nowrap;
}
.he-attbtn:hover { background: var(--surface2); color: var(--text); }
.he-attbtn-yes-on {
  background: var(--ok-bg); border-color: var(--ok-br); color: var(--ok);
}
.he-attbtn-no-on {
  background: var(--warn-bg); border-color: var(--warn-br); color: var(--warn);
}
.he-att { font-size: 12px; font-weight: 600; }
.he-att-cancelled { color: var(--text3); }

/* --- accessibility -------------------------------------------------------- */
.he-sr {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (max-width: 720px) {
  .he-grid2, .he-qadd-grid { grid-template-columns: 1fr; }
  .he-toolbar { align-items: flex-start; flex-direction: column; }
}
