/*
  style.css — only what Tailwind utilities can't express cleanly:
  the card show/hide animation and the filter buttons' states.
  Every selector is prefixed .pf- so nothing leaks into a host page.
*/

/* ---------- Filter buttons ---------- */
.pf-filter {
  display: inline-flex; align-items: center; gap: .5rem;
  padding: .55rem 1rem; border-radius: 9999px;
  border: 1px solid #cbd5e1; background: #fff; color: #334155;
  font-size: .875rem; font-weight: 600; line-height: 1.25rem; cursor: pointer;
  transition: background-color 200ms ease, border-color 200ms ease, color 200ms ease, box-shadow 200ms ease;
}
.pf-filter:hover { border-color: #818cf8; color: #3730a3; }
.pf-filter:focus-visible { outline: none; box-shadow: 0 0 0 3px #fff, 0 0 0 5px #6366f1; }

/* ACTIVE state: filled, with a subtle lift, so the current filter is obvious */
.pf-filter[aria-pressed="true"] {
  background: #4f46e5; border-color: #4f46e5; color: #fff;
  box-shadow: 0 6px 16px -6px rgba(79, 70, 229, .6);
}

/* The little count bubble app.js adds, e.g. "Residential (2)" */
.pf-count {
  min-width: 1.4rem; padding: 0 .4rem; border-radius: 9999px;
  background: #f1f5f9; color: #475569; font-size: .75rem; line-height: 1.4rem; text-align: center;
}
.pf-filter[aria-pressed="true"] .pf-count { background: rgba(255, 255, 255, .22); color: #fff; }

/* ---------- Cards ---------- */
/* Hidden cards take no space in the grid. (!important beats any Tailwind display class.) */
.pf-card[hidden] { display: none !important; }

/* Cards fade and shrink using CSS transitions; app.js only switches classes. */
.pf-card {
  transition: opacity 300ms ease, transform 300ms ease, box-shadow 200ms ease;
  will-change: opacity, transform;
}
.pf-card:hover { box-shadow: 0 16px 32px -12px rgba(15, 23, 42, .25); }

/* Leaving: fade out and shrink slightly before being removed from the grid. */
.pf-card.is-leaving  { opacity: 0; transform: scale(.92); pointer-events: none; }
/* Entering: starts faded and small, then app.js removes this class to animate in. */
.pf-card.is-entering { opacity: 0; transform: scale(.92); }

/* Gentle image zoom on hover */
.pf-media img { transition: transform 500ms ease; }
.pf-card:hover .pf-media img { transform: scale(1.05); }

/* Users who prefer less motion: instant changes, no zoom. */
@media (prefers-reduced-motion: reduce) {
  .pf-card, .pf-filter, .pf-media img { transition: none; }
  .pf-card:hover .pf-media img { transform: none; }
}
