/* ============================================================
   Rainbow Knights — Resource Directory
   Visual identity sourced from rainbowknights.org
     Plum (bands)      #562a84
     Teal (accents)    #026873
     Dark teal (hover) #013440
     Indigo (text)     #101066
     Light grey panel  #f3f3f7
   Fonts: Sen (body) + Montserrat (headings, Gotham substitute)
   ============================================================ */

:root {
  --plum: #562a84;
  --teal: #026873;
  --teal-dark: #013440;
  --indigo: #101066;
  --grey: #f3f3f7;
  --grey-border: #e4e4ef;
  --text-muted: #5b5b72;
  --white: #fff;
  --radius: 0.9rem;
  --shadow: 0 8px 24px rgba(16, 16, 102, 0.08);
  --shadow-hover: 0 14px 34px rgba(16, 16, 102, 0.15);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: "Sen", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  color: var(--indigo);
  background: var(--grey);
  line-height: 1.6;
}

h1, h2, h3 {
  font-family: "Montserrat", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-weight: 700;
  letter-spacing: -0.01em;
}

a { color: var(--teal); }

/* ---------- Header ---------- */
.site-header {
  background: var(--plum);
  color: var(--white);
}
.header-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.25rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}
.site-header img.logo {
  height: 46px;
  width: auto;
  display: block;
}
.header-tag {
  margin-left: auto;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.85);
}

/* ---------- Hero / intro ---------- */
.hero {
  background: var(--plum);
  color: var(--white);
  padding: 1.5rem 1.5rem 3rem;
}
.hero-inner {
  max-width: 1120px;
  margin: 0 auto;
}
.hero h1 {
  font-size: clamp(1.9rem, 4vw, 3rem);
  margin: 0 0 0.5rem;
  color: var(--white);
}
.hero p {
  max-width: 60ch;
  margin: 0;
  font-size: 1.1rem;
  color: rgba(255, 255, 255, 0.9);
}

/* ---------- Controls (search + filters) ---------- */
.controls {
  max-width: 1120px;
  margin: -2rem auto 0;
  padding: 0 1.5rem;
  position: relative;
  z-index: 2;
}
.controls-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.25rem 1rem;
}
.search-row {
  position: relative;
  display: flex;
  align-items: center;
}
.search-row svg {
  position: absolute;
  left: 1rem;
  width: 20px;
  height: 20px;
  color: var(--text-muted);
  pointer-events: none;
}
#search {
  width: 100%;
  font-family: inherit;
  font-size: 1.05rem;
  padding: 0.85rem 1rem 0.85rem 2.9rem;
  border: 2px solid var(--grey-border);
  border-radius: 0.7rem;
  color: var(--indigo);
  background: var(--grey);
  transition: border-color 0.15s ease, background 0.15s ease;
}
#search:focus {
  outline: none;
  border-color: var(--teal);
  background: var(--white);
}
#search::placeholder { color: var(--text-muted); }

.filters {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 1rem;
}
.filter-label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--indigo);
}
#category-select {
  font-family: inherit;
  font-size: 0.98rem;
  font-weight: 600;
  color: var(--indigo);
  padding: 0.6rem 2.4rem 0.6rem 0.9rem;
  border: 2px solid var(--grey-border);
  border-radius: 0.7rem;
  background-color: var(--grey);
  /* custom chevron */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23026873' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.8rem center;
  background-size: 18px;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
#category-select:hover { border-color: var(--teal); }
#category-select:focus {
  outline: none;
  border-color: var(--teal);
  background-color: var(--white);
}
#category-select:focus-visible {
  outline: 3px solid var(--plum);
  outline-offset: 2px;
}

/* ---------- Results meta ---------- */
.results-meta {
  max-width: 1120px;
  margin: 1.5rem auto 0;
  padding: 0 1.5rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

/* ---------- Directory grid ---------- */
.directory {
  max-width: 1120px;
  margin: 0.75rem auto 0;
  padding: 0 1.5rem 4rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--grey-border);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}

.card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 0.7rem;
}
.badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}
.badge-category {
  background: rgba(86, 42, 132, 0.1);
  color: var(--plum);
}
.badge-affirming {
  background: rgba(2, 104, 115, 0.12);
  color: var(--teal);
}

.card h3 {
  margin: 0 0 0.6rem;
  font-size: 1.25rem;
  color: var(--indigo);
}
.card .note {
  margin: 0 0 1.1rem;
  color: #2c2c44;
}

.card-details {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  border-top: 1px solid var(--grey-border);
  padding-top: 1rem;
}
.detail {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  font-size: 0.95rem;
  color: #2c2c44;
}
.detail svg {
  width: 17px;
  height: 17px;
  flex-shrink: 0;
  margin-top: 0.18rem;
  color: var(--teal);
}
.detail a {
  color: var(--teal);
  text-decoration: none;
  font-weight: 600;
  word-break: break-word;
}
.detail a:hover { color: var(--teal-dark); text-decoration: underline; }

/* ---------- Empty state ---------- */
.empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty strong { color: var(--indigo); }

/* ---------- CTA (submit / report) — lives inside the hero ---------- */
.cta-block {
  margin-top: 2rem;
  padding-top: 1.75rem;
  border-top: 1px solid rgba(255, 255, 255, 0.25);
}
.cta-block h2 {
  color: var(--white);
  font-size: clamp(1.35rem, 2.6vw, 1.8rem);
  margin: 0 0 0.5rem;
}
.cta-block p {
  max-width: 55ch;
  margin: 0 0 1.4rem;
  color: rgba(255, 255, 255, 0.9);
}
.cta-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: flex-start;
}
.btn {
  font-family: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  padding: 0.8rem 1.6rem;
  border-radius: 0.7rem;
  border: 2px solid transparent;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary {
  background: var(--teal);
  color: var(--white);
  border-color: var(--teal);
}
.btn-primary:hover {
  background: var(--teal-dark);
  border-color: var(--teal-dark);
}
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: rgba(255, 255, 255, 0.6);
}
.btn-outline:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--white);
}
.btn:focus-visible {
  outline: 3px solid var(--white);
  outline-offset: 3px;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--teal-dark);
  color: rgba(255, 255, 255, 0.85);
}
.footer-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}
.site-footer img.logo { height: 40px; margin-bottom: 1rem; }
.site-footer p { max-width: 55ch; margin: 0 0 0.75rem; }
.site-footer address { font-style: normal; line-height: 1.5; }
.site-footer a { color: #6fd3dd; }

@media (max-width: 600px) {
  .header-tag { width: 100%; margin-left: 0; }
}
