/* =========================================================
   Cryptid Catchers — site.css (UPDATED for higher dropdown contrast)
   Root-relative assets expected (domain mapped to repo root)
   ========================================================= */

/* ---------- CSS Reset (lightweight) ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;

  /* ✅ Helps browsers render native form controls in dark mode (dropdown menus, scrollbars, etc.) */
  color-scheme: dark;
}

/* ---------- Admin media previews (modal) ---------- */
.admin-media-stage {
  max-height: 500px;
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.04);
}

/* Constrain media inside stage */
.admin-media-stage .admin-media-el {
  width: 100%;
  height: 500px;
  max-height: 500px;
  object-fit: contain; /* use cover if you prefer cropping */
  display: block;
  border-radius: 12px;
}


/* ---------- Evidence slideshow ---------- */
.media-stage {
  max-height: 500px;
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

/* Make whatever is inside fit the stage */
.media-stage img,
.media-stage video {
  width: 100%;
  height: 500px;          /* matches max height */
  max-height: 500px;
  object-fit: contain;    /* show full image/video without cropping */
  display: block;
  border-radius: var(--radius);
}

.media-stage video { background: #000; }


.prose figure.lore-hero-figure {
  margin: 12px 0 18px;
}

.prose img.lore-hero {
  display: block;
  width: 100%;
  max-width: 520px;
  height: auto;
  border-radius: 14px;
}

.prose figcaption.lore-hero-caption {
  margin-top: 8px;
  font-size: 0.9rem;
  opacity: 0.75;
}

img, video { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

::selection {
  background: rgba(124, 92, 255, 0.35);
}

/* ---------- Theme ---------- */
:root {
  --bg: #0b0c10;
  --panel: #11131a;
  --panel-2: #0f1117;
  --card: #141827;
  --card-2: #101424;

  --text: #e9e9ee;
  --muted: #b1b3c2;
  --faint: #7b7f93;

  --border: rgba(255,255,255,0.10);
  --border-2: rgba(255,255,255,0.16);

  --accent: #7c5cff;
  --accent-2: #35d6ff;
  --danger: #ff4d6d;
  --ok: #35ffa3;

  --shadow: 0 12px 35px rgba(0,0,0,0.45);
  --shadow-soft: 0 8px 20px rgba(0,0,0,0.30);

  --radius: 16px;
  --radius-sm: 12px;

  --container: 1100px;

  /* ✅ Form control tuning (contrast) */
  --control-bg: rgba(255,255,255,0.08);
  --control-bg-focus: rgba(255,255,255,0.11);
  --control-border: rgba(255,255,255,0.18);
  --control-border-focus: rgba(53, 214, 255, 0.85);

  /* ✅ Dropdown menu (options) colors */
  --option-bg: #0f1117;
  --option-bg-hover: #141827;
  --option-text: #e9e9ee;
}

@media (prefers-color-scheme: light) {
  /* If user has light preference, we still keep it dark-themed,
     but slightly brighten panels. */
  :root {
    --bg: #0a0b10;
    --panel: #10121a;
    --card: #141a2a;
  }
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 18px;
}

.page {
  min-height: 100%;
  display: flex;
  flex-direction: column;
}

main {
  flex: 1;
  padding: 28px 0 40px;
}

.section {
  padding: 22px 0;
}

.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 16px; }

@media (min-width: 860px) {
  .grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
}

/* ---------- Typography ---------- */
h1, h2, h3, h4 {
  line-height: 1.15;
  margin: 0 0 10px;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(28px, 3vw, 44px); }
h2 { font-size: clamp(22px, 2.2vw, 30px); }
h3 { font-size: 18px; }
p { margin: 0 0 12px; }

.muted { color: var(--muted); }
.tiny { font-size: 12px; color: var(--faint); }
.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0);
  white-space: nowrap; border: 0;
}

.kicker {
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-size: 12px;
  font-weight: 700;
}

/* ---------- Surface components ---------- */
.card {
  background: linear-gradient(180deg, rgba(20, 24, 39, 0.98), rgba(16, 20, 36, 0.98));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  padding: 18px;
}


.card:hover {
  border-color: var(--border-2);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.hr {
  height: 1px;
  background: var(--border);
  border: 0;
  margin: 18px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(124, 92, 255, 0.14);
  border: 1px solid rgba(124, 92, 255, 0.35);
  color: var(--text);
  font-size: 12px;
  font-weight: 650;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
  text-decoration: none;
  transition: transform 120ms ease, border-color 120ms ease, background 120ms ease;
  user-select: none;
  font-weight: 650;
}

.btn:hover {
  text-decoration: none;
  border-color: var(--border-2);
  background: rgba(255,255,255,0.10);
  transform: translateY(-1px);
}

.btn:active { transform: translateY(0); }

.btn-accent {
  border-color: rgba(124, 92, 255, 0.55);
  background: rgba(124, 92, 255, 0.22);
}

.btn-accent:hover {
  border-color: rgba(124, 92, 255, 0.9);
  background: rgba(124, 92, 255, 0.30);
}

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

.btn-danger {
  border-color: rgba(255, 77, 109, 0.55);
  background: rgba(255, 77, 109, 0.18);
}

.btn-danger:hover {
  border-color: rgba(255, 77, 109, 0.95);
  background: rgba(255, 77, 109, 0.26);
}

/* ---------- Forms ---------- */
.field {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

label {
  font-size: 13px;
  color: var(--muted);
  font-weight: 650;
}

input[type="text"],
input[type="email"],
input[type="search"],
input[type="date"],
input[type="time"],
input[type="datetime-local"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--control-border);        /* ✅ higher contrast */
  background: var(--control-bg);                   /* ✅ higher contrast */
  outline: none;
  transition: border-color 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

textarea { min-height: 130px; resize: vertical; }

/* ✅ Make placeholder readable (esp. on white-ish native selects/inputs) */
input::placeholder,
textarea::placeholder {
  color: rgba(233,233,238,0.72);
}

/* ✅ Stronger focus ring */
input:focus,
select:focus,
textarea:focus {
  border-color: var(--control-border-focus);
  background: var(--control-bg-focus);
  box-shadow: 0 0 0 3px rgba(53, 214, 255, 0.18);
}

/* ✅ Native dropdown list readability (Chrome/Edge/Firefox often respect these) */
select {
  color: var(--text);
}

/* Ensure options aren’t white-bg + light text */
select option {
  background: var(--option-bg);
  color: var(--option-text);
}

/* Some browsers use :checked as the highlight */
select option:checked {
  background: var(--option-bg-hover);
  color: var(--option-text);
}

/* Helps on Windows where disabled option gets too faint */
select option:disabled {
  color: rgba(233,233,238,0.55);
}

.help {
  font-size: 12px;
  color: var(--faint);
}

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

.checkbox {
  display: inline-flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  user-select: none;
}

.checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

/* ---------- Header (partials/header.html) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(11, 12, 16, 0.78);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  gap: 14px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 220px;
}

.brand:hover { text-decoration: none; }

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top left, rgba(53,214,255,0.35), rgba(124,92,255,0.20));
  border: 1px solid rgba(255,255,255,0.10);
  box-shadow: 0 8px 20px rgba(0,0,0,0.35);
}

.brand-text { display: grid; line-height: 1.1; }
.brand-name { font-weight: 850; letter-spacing: -0.02em; }
.brand-tagline { font-size: 12px; color: var(--muted); margin-top: 3px; }

.primary-nav {
  display: flex;
  gap: 12px;
  align-items: center;
}

.primary-nav a {
  padding: 8px 10px;
  border-radius: 999px;
  border: 1px solid transparent;
  color: var(--text);
  font-weight: 650;
}

.primary-nav a:hover {
  text-decoration: none;
  border-color: var(--border);
  background: rgba(255,255,255,0.06);
}

.header-sub {
  padding: 0 0 14px;
}

.site-search {
  display: flex;
  gap: 10px;
  align-items: center;
}

.site-search input[type="search"] {
  flex: 1;
  border-radius: 999px;
  padding-left: 14px;
}

.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.06);
  cursor: pointer;
}

.nav-toggle:hover { border-color: var(--border-2); }

.nav-toggle-bar {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--text);
  margin: 4px auto;
  border-radius: 2px;
}

/* Mobile nav */
@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }

  .primary-nav {
    display: none;
    position: absolute;
    left: 18px;
    right: 18px;
    top: 64px;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 12px;
    background: rgba(17, 19, 26, 0.95);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
  }

  .primary-nav.open { display: flex; }

  .primary-nav a { padding: 10px 12px; }
}

/* ---------- Footer (partials/footer.html) ---------- */
.site-footer {
  border-top: 1px solid var(--border);
  background: rgba(15, 17, 23, 0.85);
  backdrop-filter: blur(10px);
  padding: 28px 0 18px;
}

.footer-grid {
  display: grid;
  gap: 18px;
}

@media (min-width: 860px) {
  .footer-grid {
    grid-template-columns: 2fr 1fr 1fr;
    align-items: start;
  }
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.footer-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: rgba(124, 92, 255, 0.18);
  border: 1px solid rgba(124, 92, 255, 0.35);
}

.footer-title {
  font-weight: 850;
  letter-spacing: -0.02em;
}

.footer-heading {
  margin: 0 0 8px;
  font-size: 13px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.10em;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.footer-links a {
  color: var(--text);
  opacity: 0.92;
}

.footer-links a:hover {
  opacity: 1;
  text-decoration: underline;
}

.footer-bottom {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.dot { margin: 0 8px; opacity: 0.6; }

/* ---------- Hero + highlights (for home later) ---------- */
.hero {
  padding: 26px 0 10px;
}

.hero-inner {
  display: grid;
  gap: 16px;
  align-items: start;
}

@media (min-width: 860px) {
  .hero-inner {
    grid-template-columns: 1.2fr 0.8fr;
    align-items: center;
    gap: 22px;
  }
}

.hero-card {
  border-radius: calc(var(--radius) + 6px);
  background: radial-gradient(circle at 10% 10%, rgba(53,214,255,0.16), transparent 40%),
              radial-gradient(circle at 80% 20%, rgba(124,92,255,0.16), transparent 45%),
              linear-gradient(180deg, rgba(255,255,255,0.06), rgba(255,255,255,0.02));
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 22px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
}

/* ---------- Lists/cards for cryptids & sightings ---------- */
.card-list {
  display: grid;
  gap: 14px;
}

@media (min-width: 860px) {
  .card-list.two { grid-template-columns: repeat(2, 1fr); }
  .card-list.three { grid-template-columns: repeat(3, 1fr); }
}

.card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.card-title h3 { margin: 0; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
}

.meta span {
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
}

/* ---------- Map page helpers ---------- */
.map-shell {
  display: grid;
  gap: 14px;
}

@media (min-width: 980px) {
  .map-shell {
    grid-template-columns: 360px 1fr;
    align-items: start;
  }
}

.map-panel {
  position: sticky;
  top: 98px; /* accounts for sticky header height */
  padding: 14px;
}

.map-canvas {
  min-height: 520px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.04);
}

/* ---------- Toast / notices ---------- */
.notice {
  border: 1px solid var(--border);
  background: rgba(255,255,255,0.05);
  border-radius: var(--radius-sm);
  padding: 12px;
}

.notice.ok { border-color: rgba(53, 255, 163, 0.35); background: rgba(53, 255, 163, 0.08); }
.notice.bad { border-color: rgba(255, 77, 109, 0.35); background: rgba(255, 77, 109, 0.08); }

/* ---------- Utility ---------- */
.center { text-align: center; }
.right { text-align: right; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
