/* ------------------------------------------------------------------
   Schultz Community Technology Grant
   Extra styles for grant.html, apply.html, and admin.html.
   Builds on styles.css (shared palette, header, footer, buttons, fields).
   ------------------------------------------------------------------ */

/* ---------- Sub-page hero ---------- */
.page-hero {
  position: relative;
  padding: clamp(3.5rem, 10vh, 6.5rem) 0 clamp(2.5rem, 6vh, 4rem);
}
.page-hero-inner { max-width: 760px; }
.page-hero h1 {
  font-size: clamp(2.3rem, 5vw, 3.9rem);
  max-width: 18ch;
  margin-bottom: 1.4rem;
}
.page-hero .lede {
  font-size: clamp(1.08rem, 1rem + 0.6vw, 1.35rem);
  color: var(--ink-soft);
  max-width: 54ch;
  line-height: 1.5;
}
.page-hero .theme-line {
  margin-top: 1.6rem;
  font-family: "Fraunces", Georgia, serif;
  font-style: italic;
  font-size: 1.15rem;
  color: var(--forest);
}

/* ---------- Generic content section ---------- */
.grant-section {
  padding: clamp(3rem, 8vh, 5.5rem) 0;
  border-top: 1px solid var(--rule);
}
.grant-section.tint {
  background: var(--paper-2);
}
.grant-lede {
  color: var(--ink-soft);
  max-width: 60ch;
  font-size: 1.06rem;
  margin-top: 1.2rem;
}

/* ---------- Card grids ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: clamp(1rem, 2.5vw, 1.6rem);
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
}
.grant-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1.5rem;
}
.tint .grant-card { background: #faf7f1; }
.grant-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.6rem;
}
.grant-card p {
  color: var(--ink-soft);
  font-size: 0.97rem;
}

/* ---------- Two-column detail ---------- */
.grant-cols {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: clamp(2rem, 5vw, 4rem);
  align-items: start;
}
.grant-cols h2 { font-size: clamp(1.8rem, 3.2vw, 2.6rem); }

/* ---------- Check / bullet lists ---------- */
.check-list {
  list-style: none;
  margin: 0; padding: 0;
  display: grid;
  gap: 0.85rem;
}
.check-list li {
  position: relative;
  padding-left: 1.9rem;
  color: var(--ink-soft);
}
.check-list li::before {
  content: "";
  position: absolute;
  left: 0; top: 0.45em;
  width: 0.85rem; height: 0.45rem;
  border-left: 2px solid var(--gold);
  border-bottom: 2px solid var(--gold);
  transform: rotate(-45deg);
}
.plain-list {
  list-style: none;
  margin: 1rem 0 0; padding: 0;
  display: grid;
  gap: 0.7rem;
}
.plain-list li {
  position: relative;
  padding-left: 1.3rem;
  color: var(--ink-soft);
}
.plain-list li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--gold);
}

/* ---------- Value callout ---------- */
.value-callout {
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
  background: var(--forest);
  color: var(--paper);
  border-radius: 8px;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  max-width: 60ch;
}
.value-callout .amount {
  font-family: "Fraunces", serif;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  color: var(--gold-soft);
  display: block;
  margin-bottom: 0.6rem;
}
.value-callout p { color: rgba(245, 241, 234, 0.85); margin: 0; }

/* ---------- Timeline / steps ---------- */
.timeline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(1.2rem, 3vw, 2rem);
  margin-top: clamp(1.8rem, 4vw, 2.6rem);
}
.timeline .step-index {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-weight: 600;
  color: var(--gold);
  display: block;
  margin-bottom: 0.6rem;
}
.timeline h3 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.timeline p { color: var(--ink-soft); font-size: 0.95rem; }

/* ---------- Apply CTA band ---------- */
.apply-band {
  padding: clamp(3rem, 8vh, 5rem) 0;
  background: var(--forest);
  color: var(--paper);
  text-align: center;
}
.apply-band h2 { color: var(--paper); font-size: clamp(1.8rem, 3.4vw, 2.7rem); max-width: 22ch; margin: 0 auto 1.2rem; }
.apply-band p { color: rgba(245, 241, 234, 0.82); max-width: 46ch; margin: 0 auto 2rem; }
.apply-band .btn-solid { background: var(--gold); color: var(--forest-deep); }
.apply-band .btn-solid:hover { background: var(--gold-soft); }

/* ================================================================
   Apply page
   ================================================================ */
.apply-wrap { max-width: 720px; }
.apply-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.6rem, 4vw, 2.6rem);
  margin-top: clamp(1.8rem, 4vw, 2.4rem);
}
.apply-form .field { margin-bottom: 1.4rem; }
.apply-form select {
  width: 100%;
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.7rem 0.8rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.apply-form select:focus {
  outline: none;
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(47, 62, 58, 0.12);
}
.field-help {
  font-size: 0.83rem;
  color: var(--ink-faint);
  margin: 0.3rem 0 0;
}
.req-star { color: var(--gold); }

.consent {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
  margin: 0.5rem 0 1.4rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
}
.consent input { margin-top: 0.25rem; flex: none; }

/* Honeypot — visually hidden but present for bots. */
.hp-field {
  position: absolute !important;
  left: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-status.error {
  background: rgba(168, 46, 46, 0.08);
  border-color: rgba(168, 46, 46, 0.35);
  color: #8a2e2e;
}
.form-status.success {
  background: rgba(47, 62, 58, 0.08);
  border-color: rgba(47, 62, 58, 0.25);
  color: var(--forest);
}

.apply-loading, .apply-thanks { text-align: center; padding: 2rem 0; color: var(--ink-soft); }
.apply-thanks h2 { font-size: clamp(1.7rem, 3.2vw, 2.4rem); margin-bottom: 1rem; }

/* ================================================================
   Admin dashboard
   ================================================================ */
.admin-main { padding: clamp(2rem, 5vh, 3.5rem) 0 5rem; min-height: 60vh; }

/* Login card */
.login-card {
  max-width: 400px;
  margin: clamp(2rem, 8vh, 5rem) auto;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(1.8rem, 4vw, 2.6rem);
}
.login-card h1 { font-size: 1.6rem; margin-bottom: 0.4rem; }
.login-card .sub { color: var(--ink-faint); font-size: 0.92rem; margin-bottom: 1.6rem; }

/* Toolbar */
.admin-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.8rem;
}
.admin-bar h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.admin-bar .who { font-size: 0.88rem; color: var(--ink-faint); }
.link-btn {
  background: none;
  border: none;
  color: var(--forest);
  font: inherit;
  font-size: 0.9rem;
  cursor: pointer;
  text-decoration: underline;
  padding: 0;
}

/* Tabs */
.tabs {
  display: flex;
  gap: 0.3rem;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.8rem;
}
.tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  font: inherit;
  font-weight: 500;
  color: var(--ink-soft);
  padding: 0.7rem 1rem;
  cursor: pointer;
  margin-bottom: -1px;
}
.tab.active { color: var(--ink); border-bottom-color: var(--gold); }
.tab .count {
  display: inline-block;
  margin-left: 0.4rem;
  font-size: 0.75rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.05rem 0.5rem;
  color: var(--ink-soft);
}

.panel[hidden] { display: none; }

/* Filters */
.filter-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1.2rem;
}
.chip {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.35rem 0.9rem;
  font-size: 0.85rem;
  color: var(--ink-soft);
  cursor: pointer;
}
.chip.active { background: var(--forest); color: var(--paper); border-color: var(--forest); }

/* Applications table */
.app-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.93rem;
}
.app-table th {
  text-align: left;
  font-weight: 600;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-faint);
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid var(--line);
}
.app-table td {
  padding: 0.85rem 0.8rem;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
}
.app-table tr.clickable:hover { background: var(--paper-2); cursor: pointer; }

/* Status badge */
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 100px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.badge.new        { background: rgba(192,138,45,0.12); color: var(--gold); border-color: rgba(192,138,45,0.3); }
.badge.reviewing  { background: rgba(47,62,58,0.1); color: var(--forest); border-color: rgba(47,62,58,0.25); }
.badge.shortlisted{ background: rgba(60,110,170,0.12); color: #35618c; border-color: rgba(60,110,170,0.3); }
.badge.accepted   { background: rgba(45,120,70,0.14); color: #2b7a46; border-color: rgba(45,120,70,0.3); }
.badge.declined   { background: rgba(120,120,120,0.14); color: #666; border-color: rgba(120,120,120,0.3); }

.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--ink-faint);
}

/* Modal / detail drawer */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(35, 40, 42, 0.5);
  display: flex;
  justify-content: flex-end;
  z-index: 300;
}
.modal-backdrop[hidden] { display: none; }
.drawer {
  background: var(--paper);
  width: min(560px, 100%);
  height: 100%;
  overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 2.4rem);
  box-shadow: -8px 0 30px -12px rgba(35,40,42,0.5);
}
.drawer-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 1.4rem;
}
.drawer-head h2 { font-size: 1.5rem; }
.drawer-close {
  background: none; border: 1px solid var(--line);
  border-radius: 4px; width: 36px; height: 36px;
  font-size: 1.2rem; cursor: pointer; color: var(--ink-soft);
  flex: none;
}
.answer-block { margin-bottom: 1.2rem; }
.answer-block .q-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink-faint);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}
.answer-block .q-value { color: var(--ink); white-space: pre-wrap; }
.answer-block .q-value.empty { color: var(--ink-faint); font-style: italic; }

.meta-row {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  font-size: 0.85rem;
  color: var(--ink-faint);
  margin-bottom: 1.4rem;
}

/* Questions manager */
.q-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.8rem; }
.q-item {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  display: flex;
  align-items: center;
  gap: 0.9rem;
}
.q-item.inactive { opacity: 0.55; }
.q-move {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.q-move button {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 3px;
  width: 26px; height: 20px;
  line-height: 1;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.7rem;
}
.q-move button:disabled { opacity: 0.35; cursor: default; }
.q-item .q-main { flex: 1; min-width: 0; }
.q-item .q-title { font-weight: 500; }
.q-item .q-sub { font-size: 0.8rem; color: var(--ink-faint); margin-top: 0.2rem; }
.q-item .q-actions { display: flex; gap: 0.5rem; flex: none; }
.tag-pill {
  font-size: 0.7rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 0.1rem 0.5rem;
  color: var(--ink-soft);
}

.btn-sm { padding: 0.45rem 0.85rem; font-size: 0.85rem; }
.btn-danger { color: #8a2e2e; border-color: rgba(138,46,46,0.4); background: transparent; }
.btn-danger:hover { background: #8a2e2e; color: var(--paper); }

/* Question editor form inside drawer */
.q-editor .field { margin-bottom: 1.1rem; }
.q-editor select, .q-editor input[type="text"], .q-editor textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.98rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 0.6rem 0.75rem;
}
.q-editor .checkbox-row { display: flex; align-items: center; gap: 0.5rem; }
.q-editor .checkbox-row input { width: auto; }
.drawer-actions { display: flex; gap: 0.7rem; margin-top: 1.5rem; flex-wrap: wrap; }

/* Reuse contact form status style on light bg for admin */
.admin-main .form-status { margin-top: 1rem; }

@media (max-width: 760px) {
  .grant-cols { grid-template-columns: 1fr; }
  .app-table thead { display: none; }
  .app-table, .app-table tbody, .app-table tr, .app-table td { display: block; width: 100%; }
  .app-table tr { border: 1px solid var(--line); border-radius: 6px; margin-bottom: 0.8rem; padding: 0.3rem 0.2rem; }
  .app-table td { border: none; padding: 0.35rem 0.8rem; }
  .app-table td[data-label]::before {
    content: attr(data-label) ": ";
    font-weight: 600;
    color: var(--ink-faint);
  }
}
