/* ========================================
   Live Free Voters — Custom Styles
   ======================================== */

/* Brand fonts: Gotham (from Lakepointe style guide) */
@font-face {
  font-family: 'Gotham';
  src: url('/fonts/Gotham-Bold.otf') format('opentype');
  font-weight: 700;
  font-display: swap;
}
@font-face {
  font-family: 'Gotham';
  src: url('/fonts/Gotham-Book.otf') format('opentype');
  font-weight: 400;
  font-display: swap;
}

/* Dark textured background */
.texture-bg {
  background-image:
    url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='0.04'/%3E%3C/svg%3E");
}

/* Skeleton loading animation */
.skeleton {
  background: linear-gradient(90deg, #e2e8f0 25%, #edf2f7 50%, #e2e8f0 75%);
  background-size: 200% 100%;
  animation: skeleton-pulse 1.5s ease-in-out infinite;
  border-radius: 8px;
}

@keyframes skeleton-pulse {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Card reveal animation */
.card-enter {
  animation: cardReveal 350ms cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
}

@keyframes cardReveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Staggered card animation delays */
.card-enter:nth-child(1) { animation-delay: 0ms; }
.card-enter:nth-child(2) { animation-delay: 100ms; }
.card-enter:nth-child(3) { animation-delay: 180ms; }
.card-enter:nth-child(4) { animation-delay: 250ms; }
.card-enter:nth-child(5) { animation-delay: 310ms; }
.card-enter:nth-child(6) { animation-delay: 360ms; }

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .skeleton { animation: none; background: #e2e8f0; }
  .card-enter { animation: none; opacity: 1; transform: none; }
}

/* Focus ring for keyboard navigation */
:focus-visible {
  outline: 2px solid #f04b28;
  outline-offset: 2px;
}

/* Select placeholder color — match input placeholders */
select:has(option[disabled]:checked) {
  color: rgba(113, 128, 150, 0.6);
}
select:not(:has(option[disabled]:checked)) {
  color: #1a202c;
}

/* Select dropdown arrow (custom) */
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%231a202c' fill-opacity='0.4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* Screen reader only utility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ---- Result cards ---- */

.result-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06), 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: box-shadow 200ms ease;
}

@media (min-width: 640px) {
  .result-card {
    padding: 24px;
  }
}

/* Primary card — accent border, uniform width */
.result-card:first-child {
  border-color: #f04b28;
}

/* ---- Form inputs (landing page) ---- */

/* Subtle glow on input focus */
input:focus, select:focus {
  box-shadow: 0 0 0 3px rgba(240, 75, 40, 0.15);
}

/* Smooth transitions on form elements */
input, select, button {
  transition: all 150ms ease;
}

/* ---- Footer ---- */

footer a {
  transition: color 150ms ease;
}
footer a:hover {
  color: rgba(255, 255, 255, 0.8);
}
