/* Events pages (/events/, /events/submit/). Built on the site's own pieces from /styles.css
   (.header, .section, .weight-tabs-container/.weight-tab, plain tables); this file only adds
   what those don't cover. Buttons copy the rankings page's "Download Rankings PDF" button and
   the form's level choices copy the leaderboards' Boys/Girls toggle. */

/* ---------------------------------------------------------------- buttons */
.ev-link-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 0.75em;
  padding: 0.5em 1em;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 4px;
  color: var(--text-main);
  font-family: inherit;
  font-size: 0.9em;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.ev-link-btn:hover { background: var(--accent-light); text-decoration: none; }
.ev-link-btn--primary { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.ev-link-btn--primary:hover { background: var(--accent-primary); filter: brightness(1.08); }
.ev-link-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.ev-actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- list */
.ev-tabs { overflow-x: auto; scrollbar-width: none; }
.ev-tabs::-webkit-scrollbar { display: none; }
.ev-tabs .weight-tab { white-space: nowrap; }

.ev-table td { padding-top: 10px; padding-bottom: 10px; vertical-align: top; }
.ev-col-date { white-space: nowrap; width: 1%; }
.ev-col-type { white-space: nowrap; width: 1%; }
.ev-name { font-weight: 500; }
.ev-mobile-sub { display: none; font-size: 0.8125rem; color: var(--text-secondary); margin-top: 2px; }

.ev-empty { padding: 24px 4px; color: var(--text-muted); font-size: 0.9375rem; }

/* ---------------------------------------------------------------- detail */
.ev-back { display: inline-block; margin-bottom: 10px; font-size: 0.875rem; }
.ev-detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 340px);
  gap: 24px;
  align-items: start;
}
.ev-info th {
  width: 1%;
  white-space: nowrap;
  vertical-align: top;
  padding: 10px 16px 10px 0;
  background: none;
  position: static;
  border-bottom: 1px solid var(--border-light);
}
.ev-info td { padding: 10px 0; line-height: 1.45; overflow-wrap: anywhere; }
.ev-info tr:last-child th, .ev-info tr:last-child td { border-bottom: none; }
.ev-pre { white-space: pre-wrap; }
.ev-flyer { border: 1px solid var(--border-light); border-radius: 4px; padding: 8px; background: var(--bg-card); }
.ev-flyer iframe { width: 100%; height: 460px; border: 0; display: block; background: var(--bg-main); }
.ev-flyer img { width: 100%; height: auto; display: block; }
.ev-flyer-link { display: block; margin-top: 8px; font-size: 0.8125rem; text-align: center; }

/* ---------------------------------------------------------------- submit form */
.ev-form { max-width: 720px; }
.ev-fieldset { border: none; padding: 0; margin: 0 0 1.75em; min-width: 0; }
.ev-fieldset legend {        /* same as the site's .section h2 */
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text);
  padding: 0 0 0.5em;
  margin-bottom: 0.75em;
  width: 100%;
  border-bottom: 1px solid var(--border);
}
.ev-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.ev-grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.ev-field { margin-bottom: 14px; min-width: 0; }
.ev-field > label, .ev-field-label {
  display: block;
  font-weight: 600;
  font-size: 0.875rem;
  margin-bottom: 5px;
  color: var(--text);
}
.ev-req { color: var(--bad); margin-left: 2px; }
.ev-opt { color: var(--muted); font-weight: 400; font-size: 0.8125rem; }
.ev-field input[type=text], .ev-field input[type=email], .ev-field input[type=tel], .ev-field input[type=url],
.ev-field input[type=date], .ev-field input[type=time],
.ev-field select, .ev-field textarea {
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
  font-size: 1rem;                /* 16px avoids iOS zoom-on-focus */
  padding: 8px 10px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  background: var(--bg-card);
  color: var(--text);
  min-height: 40px;
}
.ev-field input:disabled { background: var(--bg-main); color: var(--text-muted); cursor: not-allowed; }
.ev-field textarea { min-height: 96px; resize: vertical; }
.ev-field input:focus, .ev-field select:focus, .ev-field textarea:focus {
  outline: 2px solid var(--accent-light);
  border-color: var(--accent);
}
.ev-hint { font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.ev-hint--error { color: var(--bad); }

/* Level choices look like the leaderboards' Boys/Girls toggle */
.ev-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.ev-choice { position: relative; }
.ev-choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ev-choice span {
  display: inline-block;
  padding: 0.5em 1em;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.9em;
  font-weight: 500;
  cursor: pointer;
  background: var(--bg-card);
  user-select: none;
}
.ev-choice span:hover { background: var(--accent-light); }
.ev-choice input:checked + span { background: var(--accent-primary); border-color: var(--accent-primary); color: #fff; }
.ev-choice input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.ev-check { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 0.875rem; cursor: pointer; }
.ev-check input { width: 16px; height: 16px; margin: 0; }
.ev-check--sub { margin-top: 8px; font-weight: 500; }

.ev-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.ev-submit-row { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; margin: 0 0 10px; }
.ev-submit-row .ev-link-btn { margin-top: 0; }
.ev-error {
  padding: 10px 14px;
  border: 1px solid #fca5a5;
  background: #fef2f2;
  color: #991b1b;
  border-radius: 4px;
  font-size: 0.875rem;
}
.ev-notice {
  padding: 10px 14px;
  border: 1px solid var(--border-light);
  background: var(--accent-light);
  border-radius: 4px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.ev-success { max-width: 720px; padding: 8px 0 16px; }
.ev-success h2 { margin: 0 0 6px; font-size: 1.25rem; text-transform: none; letter-spacing: 0; }
.ev-success p { margin: 0 0 4px; color: var(--text-secondary); }

@media (max-width: 760px) {
  .ev-detail-grid { grid-template-columns: minmax(0, 1fr); }
  .ev-flyer iframe { height: 420px; }
}
@media (max-width: 640px) {
  .ev-tabs .weight-tab { padding: 0.75em 0.7em; }     /* all four tabs fit at 390px */
  .ev-table .ev-col-where, .ev-table .ev-col-type { display: none; }
  .ev-mobile-sub { display: block; }
  .ev-grid, .ev-grid--3 { grid-template-columns: minmax(0, 1fr); }
}
