/* Modal shell. Extracted from event.css when the gatherings hub started using
   the same dialog for "New gathering" that the gathering page uses for "Edit
   gathering" — two consumers is the point at which a second copy would start
   drifting, which is exactly what CLAUDE.md's no-premature-extraction rule is
   waiting for. Both pages link this file.

   Class prefix stays `ev-` so the existing markup and JS are untouched. */

.ev-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.65);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 1000;
  padding: 60px 16px 16px;
  overflow-y: auto;
}
.ev-modal-overlay.hidden { display: none; }
.ev-modal {
  background: var(--bg-secondary, #1a1f29);
  border: 1px solid var(--border, rgba(255,255,255,0.12));
  border-radius: 8px;
  width: 100%;
  max-width: 560px;
  padding: 22px 24px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.55);
}
.ev-modal-title {
  margin: 0 0 18px;
  font-size: 1.25rem;
  font-weight: 700;
}
.ev-modal-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  font-size: 0.72rem;
  color: var(--text-dim, #98a1ad);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.ev-modal-field input,
.ev-modal-field textarea {
  padding: 7px 10px;
  /* 16px min so iOS Safari doesn't auto-zoom the viewport on focus. */
  font-size: 16px;
  /* Was rgba(0,0,0,0.30) — a black wash tuned against the dark theme, which
     rendered every field mid-grey on the light one and made the whole dialog
     look disabled. Same fix as .t-field in tournament.css. */
  background: var(--bg);
  color: var(--text, #e6ebf2);
  border: 1px solid var(--border, rgba(255,255,255,0.18));
  border-radius: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
}
.ev-modal-field select {
  padding: 7px 30px 7px 10px;
  /* 16px min so iOS Safari doesn't auto-zoom the viewport on focus. */
  font-size: 16px;
  background-color: rgba(60, 90, 140, 0.18);
  background-image: linear-gradient(45deg, transparent 50%, var(--text-dim, #98a1ad) 50%),
                    linear-gradient(135deg, var(--text-dim, #98a1ad) 50%, transparent 50%);
  background-position: calc(100% - 14px) 50%, calc(100% - 9px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  color: var(--text, #e6ebf2);
  border: 1px solid rgba(110, 150, 220, 0.4);
  border-radius: 4px;
  text-transform: none;
  letter-spacing: 0;
  font-family: inherit;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
  width: 100%;
}
.ev-modal-field select:hover { background-color: rgba(60, 90, 140, 0.28); }
.ev-modal-field textarea { resize: vertical; min-height: 80px; }
.ev-modal-field input:focus,
.ev-modal-field textarea:focus,
.ev-modal-field select:focus {
  outline: none;
  border-color: var(--accent, #2d6df0);
}
.ev-modal-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ev-modal-row-3 { grid-template-columns: 1fr 1fr 1.6fr; }
.ev-modal-hint {
  font-size: 0.82rem;
  color: var(--text-dim);
  margin: 6px 0 16px;
}
.ev-modal-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}
.ev-modal-create {
  padding: 8px 18px;
  font-size: 0.92rem;
  background: var(--accent, #2d6df0);
  color: #fff;
  border: 0;
  border-radius: 4px;
  cursor: pointer;
  font-weight: 500;
}
.ev-modal-create:hover { background: var(--accent-hi, #4d85f4); }
.ev-modal-create:disabled { opacity: 0.6; cursor: not-allowed; }
.ev-modal-cancel {
  padding: 8px 14px;
  font-size: 0.88rem;
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border, rgba(255,255,255,0.15));
  border-radius: 4px;
  cursor: pointer;
}
.ev-modal-cancel:hover { background: rgba(255,255,255,0.06); color: var(--text); }
.ev-modal-delete {
  margin-left: auto;
  padding: 8px 14px;
  font-size: 0.88rem;
  background: transparent;
  color: rgba(220, 80, 80, 0.85);
  border: 1px solid rgba(220, 80, 80, 0.35);
  border-radius: 4px;
  cursor: pointer;
}
.ev-modal-delete:hover {
  background: rgba(220, 80, 80, 0.12);
  color: rgba(255, 120, 120, 0.95);
}
.ev-modal-status {
  color: var(--text-dim);
  font-size: 0.85rem;
  margin-left: 6px;
}

@media (max-width: 600px) {
  .ev-modal-row { grid-template-columns: 1fr; }
}

/* Gathering banner image — full-width strip across the top of the page. */
.event-banner { margin: 0 0 16px; border-radius: var(--card-radius, 8px); overflow: hidden; }
.event-banner img { display: block; width: 100%; max-height: 280px; object-fit: cover; }

/* Unlisted toggle row in the edit modal + the Unlisted status pill. */
.ev-modal-check { display: flex; align-items: flex-start; gap: 8px; margin-bottom: 12px;
  font-size: 0.85rem; color: var(--text, #e6ebf2); cursor: pointer; }
.ev-modal-check input { margin-top: 2px; flex: 0 0 auto; }

/* The modal now hosts the uploader and the markdown editor, whose children are
   not <input>/<textarea> and so pick up none of the field styling above. They
   also must not inherit .ev-modal-field's uppercase label treatment. */
.ev-modal-field .t-upload,
.ev-modal-field .md-editor { text-transform: none; letter-spacing: 0; font-size: 1rem; }
.ev-modal-field .t-upload-note,
.ev-modal-field .t-field-hint { text-transform: none; letter-spacing: 0; }
.ev-modal-field > span { text-transform: uppercase; letter-spacing: 0.04em; font-size: 0.72rem; }

/* The create dialog carries four field groups, an uploader and an editor; the
   edit dialog is a plain field list. 560 is right for that one and cramped for
   this one, so the wider variant is opt-in rather than applied to both. */
.ev-modal-wide { max-width: 680px; }
