/* ==========================================================================
   Masonic Events — design tokens
   Palette: Regalia Navy + Brass + Stone, with a mosaic-pavement (chequered
   lodge floor) motif used sparingly as the page's one signature device.
   ========================================================================== */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,500;9..144,600;9..144,700&family=Source+Sans+3:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
  --ink: #16233f;
  --lodge-blue: #1f3a5f;
  --lodge-blue-light: #2c4d78;
  --brass: #b98d3e;
  --brass-light: #d7ac5c;
  --stone: #eef0ec;
  --stone-card: #ffffff;
  --charcoal: #23262b;
  --muted: #5b6472;
  --sage: #5c7a5e;
  --brick: #a23e3e;
  --border: #d9dcd3;

  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Source Sans 3', system-ui, -apple-system, Segoe UI, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;

  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(22, 35, 63, 0.08);
  --shadow-md: 0 6px 20px rgba(22, 35, 63, 0.12);
  --container: 1080px;
}

* { box-sizing: border-box; }

html { color-scheme: light; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.55;
  color: var(--charcoal);
  background: var(--stone);
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0 0 0.4em;
  font-weight: 600;
}

a { color: var(--lodge-blue); }
a:hover { color: var(--brass); }

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 3px solid var(--brass-light);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- Mosaic pavement signature ---------- */

.pavement-rule {
  height: 10px;
  width: 100%;
  background-image: linear-gradient(45deg, var(--ink) 25%, transparent 25%),
    linear-gradient(-45deg, var(--ink) 25%, transparent 25%),
    linear-gradient(45deg, transparent 75%, var(--ink) 75%),
    linear-gradient(-45deg, transparent 75%, var(--ink) 75%);
  background-size: 10px 10px;
  background-position: 0 0, 0 5px, 5px -5px, -5px 0px;
  opacity: 0.85;
}

/* ---------- Layout shell ---------- */

.app-shell { min-height: 100vh; display: flex; flex-direction: column; }

.site-header {
  background-color: var(--ink);
  color: #fff;
  padding: 28px 24px 0;
}

.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  min-height: 250px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 20px;
  padding: 28px;
  background: url('../pics/victoria-district-banner-option-1-fellowship.png') center / cover no-repeat;
  border-radius: var(--radius) var(--radius) 0 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.9);
}

.brand-mark { height: 46px; width: auto; }

.site-header__support {
  align-self: stretch;
  display: flex;
  flex: 0 0 190px;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 14px;
}

.site-header h1 {
  color: #fff;
  font-size: clamp(1.6rem, 3vw, 2.3rem);
  margin: 0;
}

.site-header p {
  margin: 4px 0 0;
  color: #c9d2e0;
  max-width: 60ch;
}

.site-header p a { color: inherit; }

.site-header__meta {
  text-align: left;
  font-size: 0.9rem;
  color: #c9d2e0;
}

.site-header__meta a { color: var(--brass-light); }

main {
  flex: 1;
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 32px 20px 64px;
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.site-footer {
  background: var(--ink);
  color: #c9d2e0;
  padding: 32px 24px 40px;
  text-align: center;
}

.site-footer__inner { max-width: var(--container); margin: 0 auto; }

.site-footer strong { color: #fff; }

.site-footer p a { color: inherit; }

.site-footer img { margin-top: 14px; height: 60px; }

/* ---------- Cards ---------- */

.card {
  background: var(--stone-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 24px;
}

.card__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.card__header h2 { font-size: 1.4rem; margin: 0; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brass);
  font-weight: 500;
}

/* ---------- Buttons & inputs ---------- */

.btn {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: 8px;
  border: 1px solid transparent;
  padding: 10px 18px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, border-color 0.15s ease;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--lodge-blue); color: #fff; }
.btn--primary:hover { background: var(--lodge-blue-light); }

.btn--brass { background: var(--brass); color: #21200f; }
.btn--brass:hover { background: var(--brass-light); }

.btn--ghost { background: transparent; color: var(--lodge-blue); border-color: var(--border); }
.btn--ghost:hover { border-color: var(--lodge-blue); }

.btn--danger { background: #fff; color: var(--brick); border-color: var(--brick); }
.btn--danger:hover { background: var(--brick); color: #fff; }

.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--sm { padding: 6px 12px; font-size: 0.85rem; }

label { font-weight: 600; font-size: 0.9rem; color: var(--ink); }

.field { display: flex; flex-direction: column; gap: 6px; }

input[type="text"],
input[type="password"],
input[type="email"],
textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: var(--charcoal);
  width: 100%;
}

textarea { resize: vertical; }

input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--lodge-blue); }

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.helper-text { font-size: 0.85rem; color: var(--muted); }

.status-banner {
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.92rem;
}
.status-banner--ok { background: #e9f1e9; color: var(--sage); }
.status-banner--warn { background: #f7ece2; color: #8a5a1f; }
.status-banner--error { background: #f8e9e9; color: var(--brick); }

/* ---------- Tables ---------- */

.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); }

table.data-table { width: 100%; border-collapse: collapse; font-size: 0.94rem; min-width: 640px; }

.data-table thead th {
  background: var(--ink);
  color: #fff;
  text-align: left;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.82rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
}
.data-table thead th:hover { background: var(--lodge-blue); }

.data-table tbody td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tbody tr:nth-child(even) { background: #f7f8f5; }
.data-table tbody tr:hover { background: #eef3fa; cursor: pointer; }

.data-table .empty-row td { text-align: center; color: var(--muted); padding: 22px; cursor: default; }
.data-table .empty-row:hover { background: transparent; }

/* ---------- Modal ---------- */

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 35, 63, 0.55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  z-index: 50;
}

.modal-panel {
  background: #fff;
  border-radius: var(--radius);
  max-width: 620px;
  width: 100%;
  box-shadow: var(--shadow-md);
  position: relative;
}

.modal-panel--wide { max-width: 900px; }

.modal-panel__head {
  padding: 18px 22px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--radius) var(--radius) 0 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-panel__head h3 { color: #fff; margin: 0; font-size: 1.15rem; }

.modal-close {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.4);
  color: #fff;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.85rem;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1;
  padding: 7px 14px;
  white-space: nowrap;
}
.modal-close:hover { background: rgba(255, 255, 255, 0.12); border-color: #fff; }

.modal-panel__body { padding: 22px; display: flex; flex-direction: column; gap: 16px; }

/* ---------- Event preview ---------- */

.event-preview { border-left: 4px solid var(--brass); padding-left: 18px; }
.event-preview h3 { font-size: 1.5rem; }
.event-preview .eyebrow { display: block; margin-bottom: 4px; }

.food-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.food-row input[type="text"] { width: 70px; }

.total-line {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

/* ---------- Misc ---------- */

.inline-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }

.pill-toggle { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.pill-toggle label { display: flex; align-items: center; gap: 6px; font-weight: 500; cursor: pointer; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 640px) {
  .two-col { grid-template-columns: 1fr; }
  .site-header__meta { margin-left: 0; text-align: left; }
  main { padding: 22px 14px 48px; }
  .card { padding: 18px; }
}

/* ---------- Small utilities (used instead of inline style="" strings,
   since React's style prop must be an object, not a CSS string) ---------- */

.u-mono-sm { font-family: var(--font-mono); font-size: 0.8rem; }
.u-prewrap { white-space: pre-wrap; }
.u-mt-8 { margin-top: 8px; }
.u-mt-14 { margin-top: 14px; }
.u-mt-16 { margin-top: 16px; }
.u-mt-18 { margin-top: 18px; }
.u-mt-22 { margin-top: 22px; }
.u-mb-16 { margin-bottom: 16px; }
.u-maxw-220 { max-width: 220px; }
.u-maxw-320 { max-width: 320px; }
.u-minw-180 { min-width: 180px; }
.u-flex-grow { flex: 1; min-width: 220px; }
.u-muted-note { opacity: 0.8; }
.checkbox-row { display: flex; align-items: center; gap: 8px; }
.hr-subtle { border: none; border-top: 1px solid var(--border); margin: 4px 0; }
.tagline { font-size: 1.25rem; margin: 0 0 6px; }

.edit-with-preview {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}
.edit-with-preview__preview { position: sticky; top: 16px; }
@media (max-width: 900px) {
  .edit-with-preview { grid-template-columns: 1fr; }
  .edit-with-preview__preview { position: static; }
}

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--brass);
  color: #21200f;
  padding: 10px 16px;
  z-index: 100;
  border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }
