/* Sycamores 3rd Ward Service Projects — LDS.org-inspired design */

:root {
  --primary: #005DA6;
  --primary-dark: #004A85;
  --primary-light: #E8F0FE;
  --accent-green: #00B388;
  --accent-green-light: #E6F9F4;
  --accent-red: #D32F2F;
  --accent-red-light: #FDECEA;
  --accent-amber: #F9A825;
  --accent-amber-light: #FFF8E1;
  --text: #1D1D1F;
  --text-secondary: #6E6E73;
  --border: #D2D2D7;
  --border-light: #E8E8ED;
  --bg: #F5F5F7;
  --white: #FFFFFF;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.10);
  --radius: 12px;
  --radius-sm: 8px;
  --transition: 0.2s ease;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* === HEADER === */
.site-header {
  background: var(--primary);
  color: var(--white);
  padding: 0;
}

.header-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 28px;
  text-align: center;
}

.site-header h1 {
  margin: 0 0 6px;
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.site-header .subtitle {
  margin: 0;
  font-size: 1rem;
  opacity: 0.85;
  font-weight: 400;
}

/* === MAIN CONTENT === */
.main {
  max-width: 960px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.section-label {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

/* === EVENT CARD GRID === */
.event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

.event-card {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition);
  cursor: pointer;
  position: relative;
  display: flex;
  flex-direction: column;
}

.event-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.event-card.selected {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), var(--shadow-md);
}

.event-card.disabled {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
}

.event-card .card-type {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary);
  margin: 0 0 8px;
}

.event-card .card-title {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 10px;
  color: var(--text);
  line-height: 1.3;
}

.event-card .card-meta {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0 0 4px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.event-card .card-meta .icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.event-card .card-footer {
  margin-top: auto;
  padding-top: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

/* === BADGES === */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.badge.open {
  background: var(--accent-green-light);
  color: #00785C;
}

.badge.full {
  background: var(--accent-red-light);
  color: var(--accent-red);
}

.badge.closed {
  background: #F0F0F3;
  color: #86868B;
}

.badge.upcoming {
  background: var(--accent-amber-light);
  color: #8B6914;
}

.spots-text {
  font-size: 0.82rem;
  color: var(--text-secondary);
  font-weight: 500;
}

/* === SIGNUP FORM (inline below card) === */
.signup-section {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 24px;
  margin-top: 16px;
  margin-bottom: 16px;
}

.signup-section .event-detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-light);
}

.signup-section .detail-title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 4px;
}

.signup-section .detail-meta {
  font-size: 0.92rem;
  color: var(--text-secondary);
  line-height: 1.6;
}

.signup-section .detail-meta strong {
  color: var(--text);
  font-weight: 600;
}

.signup-section .detail-stats {
  text-align: right;
  min-width: 140px;
}

.signup-section .detail-stats .stat-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--primary);
  line-height: 1;
}

.signup-section .detail-stats .stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* === FORM ELEMENTS === */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.form-group {
  margin-bottom: 14px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 5px;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: var(--white);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

input:focus, select:focus, textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 93, 166, 0.12);
}

textarea { min-height: 80px; resize: vertical; }

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 20px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: background var(--transition), opacity var(--transition);
  line-height: 1.4;
}

.btn-primary {
  background: var(--primary);
  color: var(--white);
}

.btn-primary:hover { background: var(--primary-dark); }

.btn-secondary {
  background: var(--primary-light);
  color: var(--primary);
}

.btn-secondary:hover { background: #D6E4F7; }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover { background: var(--primary-light); }

.btn-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 6px;
}

button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  background: var(--primary);
  color: var(--white);
  transition: background var(--transition);
}

button[type="submit"]:hover { background: var(--primary-dark); }

/* === NOTICES === */
.notice {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.92rem;
  margin-bottom: 16px;
  line-height: 1.5;
}

.notice.success {
  background: var(--accent-green-light);
  color: #00785C;
  border: 1px solid rgba(0, 179, 136, 0.25);
}

.notice.error {
  background: var(--accent-red-light);
  color: #B71C1C;
  border: 1px solid rgba(211, 47, 47, 0.2);
}

.notice.info {
  background: var(--primary-light);
  color: var(--primary-dark);
  border: 1px solid rgba(0, 93, 166, 0.15);
}

/* === ADMIN === */
.admin-section {
  background: var(--white);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
}

.admin-section h2 {
  font-size: 1.1rem;
  font-weight: 700;
  margin: 0 0 6px;
}

.admin-section .desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0 0 16px;
}

code {
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.85em;
  color: var(--primary-dark);
}

/* === FOOTER === */
.site-footer {
  text-align: center;
  padding: 24px;
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.site-footer a {
  color: var(--primary);
  text-decoration: none;
}

.site-footer a:hover { text-decoration: underline; }

.site-credit {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--text-light, #aab);
  letter-spacing: 0.02em;
}

/* === HONEYPOT === */
.honeypot {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* === RESPONSIVE === */
@media (max-width: 640px) {
  .site-header h1 { font-size: 1.4rem; }
  .main { padding: 20px 16px 40px; }
  .event-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .signup-section .event-detail-header { flex-direction: column; }
  .signup-section .detail-stats { text-align: left; }
}

/* === UTILITIES === */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }