/* Seahorse Organizer — ocean blue + warm sand design system.
   Cards over tables. Pill-shaped buttons. Quicksand headings, Nunito body. */

:root {
  --cream: #FAF6EF;        /* warm cream — primary page background */
  --cream-card: #E9DFC8;   /* warm sand — secondary background / cards */
  --ink: #444441;          /* dark warm gray — primary body text */
  --ink-muted: #5F5E5A;    /* warm gray — secondary/muted text */

  --blue: #0C447C;         /* deep ocean blue — headlines, primary buttons/links */
  --blue-dark: #185FA5;    /* mid ocean blue — secondary accents, hover states (lighter than --blue on purpose) */
  --blue-bright: #378ADD;  /* bright ocean blue — tertiary accent, used sparingly (focus states) */
  --teal: #158066;         /* teal accent — subheadings, highlighted text, secondary emphasis */

  /* Borders derived from the palette rather than a separate invented color. */
  --line: color-mix(in srgb, var(--cream-card) 65%, var(--ink-muted) 35%);

  /* Functional-only utility color for errors/destructive actions — not part of
     the brand palette above (which has no red), kept unchanged from before. */
  --danger: #a13d2b;
  --danger-dark: #7c2e20;
  --paid-green: var(--teal); /* success/positive tags now ride on the teal accent */

  --radius: 10px;
  --radius-pill: 999px;
  --shadow: 0 2px 6px rgba(68, 68, 65, 0.1);
  --font-heading: "Quicksand", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
}

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

h1, h2, h3 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--teal);
  margin: 0 0 0.4em;
}

h1 {
  color: var(--blue);
  font-weight: 700;
}

h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }

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

.muted { color: var(--ink-muted); }
.small { font-size: 0.85rem; }

/* Header */
.site-header {
  background: var(--blue);
  color: #fff;
  padding: 0.85rem 0;
}

.site-header__inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  margin-right: auto;
}

.brand__mark { height: 1.6rem; width: auto; display: block; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.4);
  color: #fff;
  font-size: 1.2rem;
  border-radius: 6px;
  padding: 0.2rem 0.6rem;
}

.main-nav {
  display: flex;
  gap: 1.1rem;
  flex-wrap: wrap;
}

.main-nav a {
  font-family: var(--font-heading);
  color: #ecdfc8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}

.main-nav a:hover { color: #fff; }

/* "Admin" dropdown -- native <details>/<summary>, keyboard-accessible and
   works on touch with zero JS. */
.nav-dropdown {
  position: relative;
}

.nav-dropdown > summary {
  cursor: pointer;
  list-style: none;
  font-family: var(--font-heading);
  color: #ecdfc8;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-dropdown > summary::-webkit-details-marker { display: none; }
.nav-dropdown > summary:hover,
.nav-dropdown[open] > summary { color: #fff; }

.nav-dropdown__menu {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  position: absolute;
  top: 100%;
  left: 0;
  margin-top: 0.6rem;
  background: var(--blue-dark);
  border-radius: 10px;
  padding: 0.75rem 1rem;
  min-width: 150px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
  z-index: 20;
}
.nav-dropdown__menu a { white-space: nowrap; }

/* Right-hand cluster: external "View Public Site" link + signed-in status,
   visually separated from the main backend nav items. */
.nav-right {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin-left: auto;
  padding-left: 1.1rem;
  border-left: 1px solid rgba(255, 255, 255, 0.25);
}

.nav-external-link {
  font-family: var(--font-heading);
  color: #ecdfc8;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
}
.nav-external-link:hover { color: #fff; }

.nav-signed-in {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  color: #ecdfc8;
  font-size: 0.85rem;
}

.logout-form { display: inline; }

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: #fff;
  text-decoration: underline;
  font: inherit;
  cursor: pointer;
}
.link-button:hover { color: var(--blue-bright); }

@media (max-width: 720px) {
  .nav-toggle { display: inline-block; }
  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.6rem;
    padding-top: 0.5rem;
  }
  .main-nav.is-open { display: flex; }

  .nav-dropdown__menu {
    position: static;
    box-shadow: none;
    background: transparent;
    padding: 0.3rem 0 0 0.9rem;
    margin-top: 0.3rem;
  }

  .nav-right {
    margin-left: 0;
    padding-left: 0;
    border-left: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.6rem;
    padding-top: 0.6rem;
    border-top: 1px solid rgba(255, 255, 255, 0.25);
  }
}

/* Page layout */
main.wrap { padding-top: 1.75rem; padding-bottom: 3rem; min-height: 60vh; }

.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}

.page-title { font-size: 1.9rem; margin-bottom: 0.15em; }
.page-subtitle { color: var(--ink-muted); margin-top: 0; }

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 780px) {
  .two-col { grid-template-columns: 1fr; }
}

/* Landing pages (Home / Training) */
.landing-layout {
  display: grid;
  grid-template-columns: minmax(4rem, 12rem) 2fr 1fr;
  gap: 2rem;
  align-items: start;
}

.landing-subhead {
  font-style: italic;
  color: var(--teal);
  font-size: calc(1em + 5pt);
}

.landing-heading {
  color: var(--blue);
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: calc(1em + 5pt);
}

.landing-watermark {
  width: 100%;
  height: 100%;
  min-height: 12rem;
  align-self: stretch;
  background-color: var(--blue);
  opacity: 0.2;
  -webkit-mask-image: url("../img/seahorse-icon.png");
  mask-image: url("../img/seahorse-icon.png");
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-position: center top;
  mask-position: center top;
}

.landing-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.landing-actions__heading {
  font-family: var(--font-heading);
  font-weight: 700;
  color: var(--blue);
  margin: 0 0 0.25rem;
}

.landing-actions .btn { text-align: center; }

.skip-to-actions { display: none; }

@media (max-width: 780px) {
  .landing-layout { grid-template-columns: 1fr; }
  .landing-watermark { display: none; }
  .skip-to-actions {
    display: inline-block;
    margin-bottom: 1rem;
  }
}

/* Cards — index-card feel */
.card {
  background: var(--cream-card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.25rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}

.index-card {
  display: block;
  text-decoration: none;
  color: var(--ink);
}

.index-card h3 { color: var(--teal); }

.index-card__top {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 0.5rem;
}

/* Stat tiles on dashboard */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.stat-card {
  text-align: center;
  margin-bottom: 0;
}

.stat-card--accent {
  background: var(--blue);
  border-color: var(--blue);
}
.stat-card--accent .stat-card__number,
.stat-card--accent .stat-card__label { color: #fff; }

.stat-card__number {
  display: block;
  font-family: var(--font-heading);
  font-size: 2.4rem;
  font-weight: 700;
  color: var(--blue);
  line-height: 1.1;
}

.stat-card__label {
  display: block;
  margin-top: 0.35rem;
  color: var(--ink-muted);
  font-size: 0.9rem;
}

/* Buttons — fully rounded, pill-shaped */
.btn {
  display: inline-block;
  padding: 0.6rem 1.3rem;
  border-radius: var(--radius-pill);
  font-weight: 700;
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}

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

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

/* Distinct, deliberately different-looking button for destructive actions
   (e.g. Delete) so it never reads as just another ghost button. */
.btn--danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn--danger:hover { background: var(--danger); border-color: var(--danger); color: #fff; }

/* Tags / status flags */
.tag {
  display: inline-block;
  padding: 0.15rem 0.6rem;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
  background: var(--line);
  color: var(--ink);
  white-space: nowrap;
}

.tag--paid, .tag--status-paid, .tag--status-trained, .tag--status-active-organizer, .tag--status-succeeded {
  background: var(--teal);
  color: #fff;
}
.tag--status-interested, .tag--status-registered, .tag--status-planned, .tag--status-postponed { background: var(--blue); color: #fff; }
.tag--status-inactive, .tag--status-cancelled, .tag--muted { background: var(--line); color: var(--ink-muted); }
.tag--status-imported { background: var(--blue-bright); color: #fff; }
.tag--status-failed { background: var(--danger); color: #fff; }
.tag--attention { background: var(--blue-bright); color: #fff; }

/* Forms */
.form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 560px;
}

.form--inline {
  flex-direction: row;
  align-items: flex-start;
  max-width: none;
  margin-bottom: 1rem;
}

.form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-weight: 600;
  color: var(--ink);
}

.form input,
.form select,
.form textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 0.55rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}

.form input:focus,
.form select:focus,
.form textarea:focus {
  outline: 2px solid var(--blue-bright);
  outline-offset: 1px;
}

.form--inline textarea { flex: 1; }

.filter-bar {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}
.filter-bar input, .filter-bar select {
  padding: 0.5rem 0.7rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: var(--font-body);
}

/* Tables */
.table-scroll { overflow-x: auto; }

.roster-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 480px;
}

.roster-table th, .roster-table td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--line);
}

.roster-table th {
  font-family: var(--font-heading);
  color: var(--teal);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.row--duplicate { background: color-mix(in srgb, var(--danger) 12%, var(--cream-card) 88%); }

/* Grouped row actions (e.g. Edit / Delete) -- kept side by side with a
   clear gap so a destructive button never sits flush against another. */
.table-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
  white-space: nowrap;
}

/* Truncated URL + copy button, used where a full external link would
   otherwise force a table wider than the page. */
.url-cell {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  max-width: 190px;
}

.url-cell__input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 0;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.8rem;
  color: var(--ink-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: default;
}
.url-cell__input:focus { outline: 1px solid var(--blue-bright); }

.copy-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--blue);
  text-decoration: underline;
  font-family: var(--font-body);
  font-size: 0.8rem;
  cursor: pointer;
  flex-shrink: 0;
}
.copy-button:hover { color: var(--blue-dark); }

.flag-btn {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  width: 2rem;
  height: 2rem;
  font-size: 1rem;
  cursor: pointer;
  color: var(--ink-muted);
}
.flag-btn--on {
  background: var(--teal);
  border-color: var(--teal);
  color: #fff;
}

.flag-row { display: inline-flex; gap: 0.35rem; margin-left: 0.5rem; }

/* Activity / note lists */
.activity-list, .note-list {
  list-style: none;
  padding: 0;
  margin: 0 0 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.activity-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-wrap: wrap;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--line);
}

.note-list li {
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--line);
}
.note-list p { margin: 0.2rem 0 0; }

.detail-list {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.4rem 1rem;
  margin: 0;
}
.detail-list dt { color: var(--ink-muted); font-weight: 600; }
.detail-list dd { margin: 0; }

/* Flash messages */
.flash-stack { margin-bottom: 1.25rem; }
.flash {
  padding: 0.75rem 1rem;
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-weight: 500;
}
.flash--success { background: color-mix(in srgb, var(--teal) 15%, #fff 85%); color: var(--teal); border: 1px solid var(--teal); }
.flash--error { background: color-mix(in srgb, var(--danger) 12%, #fff 88%); color: var(--danger-dark); border: 1px solid var(--danger); }

.empty-state {
  color: var(--ink-muted);
  padding: 2rem 0;
  text-align: center;
}

.placeholder-note {
  background: color-mix(in srgb, var(--danger) 10%, var(--cream-card) 90%);
  border: 1px dashed var(--danger);
  border-radius: 8px;
  padding: 0.75rem 1rem;
  color: var(--danger-dark);
  font-style: italic;
}

.code-box {
  background: var(--blue);
  color: #ecdfc8;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  word-break: break-all;
}
.code-box a { color: inherit; }
.code-box a:hover { color: #fff; }

/* Tag widget (chips + attach form on detail pages) */
.tag-widget { display: flex; flex-direction: column; gap: 0.75rem; }

.tag-chip-form { display: inline-block; }

.tag--removable {
  border: none;
  cursor: pointer;
  font-family: var(--font-body);
}
.tag--removable:hover { background: var(--danger); color: #fff; }

.tag-attach-form { margin-bottom: 0; }
.tag-attach-form select { min-width: 160px; }

/* Dialogs */
.dialog {
  width: min(92vw, 480px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--cream-card);
  color: var(--ink);
  box-shadow: 0 8px 24px rgba(68, 68, 65, 0.25);
}

.dialog::backdrop {
  background: rgba(68, 68, 65, 0.45);
}

.dialog .form {
  max-width: none;
}

.dialog__actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 1.25rem 0;
  color: var(--ink-muted);
  font-size: 0.85rem;
}

.footer-links {
  margin-top: 0.35rem;
  display: flex;
  gap: 1rem;
}

.footer-links a {
  color: var(--ink-muted);
}

/* Honeypot spam-trap field: invisible to real visitors (offscreen, not
   display:none/visibility:hidden -- some bots skip fields hidden that way
   but still fill in offscreen ones), and out of the tab order / hidden
   from screen readers so it's never a genuine accessibility trap either. */
.honeypot-field {
  position: absolute;
  left: -9999px;
  top: -9999px;
}

/* Public events site */
.event-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  object-position: center top; /* bias toward the top of the frame, where the
                                   subject of a photo usually is, rather than
                                   an even center-crop that can lose it */
  border-radius: 8px;
  margin-bottom: 0.5rem;
  display: block;
}

.event-photo--large { height: 300px; }

/* About Us page: founder/team brand mark + bio layout */
.about-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.bio-row {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.bio-photo {
  width: 160px;
  height: 160px;
  object-fit: cover;
  object-position: center;
  border-radius: 8px;
  flex-shrink: 0;
  display: block;
}

.bio-row > div {
  flex: 1;
  min-width: 240px;
}

.map-embed {
  margin-top: 1rem;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.checkbox-label {
  flex-direction: row !important;
  align-items: center;
  gap: 0.5rem;
  font-weight: 400 !important;
  color: var(--ink) !important;
}
.checkbox-label input[type="checkbox"] { width: auto; }
