/* Bay Area Polish community directory — wycinanka papercut design.
   Shares the homepage palette (home.css); hero band + scallop-edge cards. */

.directory-page,
.dir-hero {
  --czerwien: #d6262d;
  --karmin: #a81b21;
  --kobalt: #2a4fc9;
  --marigold: #f3b229;
  --leaf: #2e7d4f;
  --ink: #211b1b;
  --paper: #fffdf8;
  --hairline: rgba(33, 27, 27, 0.14);
  --display-font: "Bricolage Grotesque", "Inter", system-ui, sans-serif;
}

.directory-page :focus-visible,
.dir-hero :focus-visible {
  outline: 3px solid var(--kobalt);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ hero */
.dir-hero {
  background: var(--paper);
  position: relative;
}
.dir-hero-in {
  max-width: 1120px;
  margin: 0 auto;
  padding: 52px 24px 58px;
  display: grid;
  grid-template-columns: 1.25fr 0.75fr;
  gap: 40px;
  align-items: center;
}
.dir-eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--czerwien);
  margin: 0 0 14px;
}
.dir-display {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: clamp(40px, 6.5vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.018em;
  margin: 0 0 18px;
  color: var(--ink);
}
.dir-intro {
  color: rgba(33, 27, 27, 0.78);
  font-size: 17px;
  max-width: 54ch;
}
.dir-intro p { margin: 0.4em 0; }
.dir-intro a { color: var(--czerwien); font-weight: 600; }
.dir-proof {
  display: flex;
  gap: 28px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.dir-proof div strong {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 26px;
  display: block;
  line-height: 1.1;
}
.dir-proof div span {
  font-size: 12.5px;
  color: rgba(33, 27, 27, 0.6);
}
.dir-medallion { justify-self: center; }
.dir-medallion svg {
  width: min(280px, 52vw);
  height: auto;
  display: block;
}
@media (prefers-reduced-motion: no-preference) {
  .dir-medallion svg {
    animation: dir-bloom 1.1s cubic-bezier(0.2, 0.7, 0.3, 1) both 0.15s;
  }
  @keyframes dir-bloom {
    from { transform: scale(0.85) rotate(-8deg); opacity: 0; }
  }
}
/* wycinanka lace edge under the hero */
.dir-lace {
  height: 20px;
  position: relative;
}
.dir-lace::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle at 11px -4px, #d6262d 12px, transparent 13px);
  background-size: 22px 20px;
  background-repeat: repeat-x;
}

/* -------------------------------------------------------------- controls */
.directory-page { padding: 0 0 40px; }
.directory-page [hidden] { display: none !important; }

.dir-controls {
  position: sticky;
  top: 64px; /* refined at runtime to the real header height */
  background: var(--paper);
  padding: 12px 0 14px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 30px;
  z-index: 5;
}
.dir-search-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  position: relative;
}
.dir-search-icon {
  position: absolute;
  left: 16px;
  top: 15px; /* input is always the row's first line */
  color: rgba(33, 27, 27, 0.45);
  pointer-events: none;
}
.dir-search {
  flex: 1;
  min-width: 0;
  font: inherit;
  font-size: 15px;
  padding: 11px 18px 11px 42px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  color: var(--ink);
}
.dir-search::placeholder { color: rgba(33, 27, 27, 0.42); }
.dir-count {
  flex: none;
  font-size: 13px;
  font-weight: 600;
  color: rgba(33, 27, 27, 0.55);
  margin: 0;
  white-space: nowrap;
}
.dir-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 6px 0;
}
.dir-filter-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: rgba(33, 27, 27, 0.55);
  width: 74px;
  flex: none;
}
.dir-chip {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1.5px solid var(--hairline);
  background: #fff;
  color: var(--ink);
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.dir-chip:hover { border-color: var(--czerwien); color: var(--czerwien); }
.dir-chip.is-active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--paper);
}
/* category chips carry their section color as a papercut dot */
.dir-chip[data-filter="cat"]:not([data-value="all"])::before {
  content: "";
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  margin-right: 7px;
  background: var(--chip-c, var(--czerwien));
  vertical-align: 1px;
}
.dir-chip--churches      { --chip-c: var(--kobalt); }
.dir-chip--restaurants   { --chip-c: var(--czerwien); }
.dir-chip--stores        { --chip-c: var(--leaf); }
.dir-chip--organizations { --chip-c: var(--marigold); }
.dir-chip--businesses    { --chip-c: var(--ink); }

/* -------------------------------------------------------------- sections */
.dir-section { margin: 0 0 44px; --cat-c: var(--kobalt); }
.dir-section[data-cat="churches"]      { --cat-c: var(--kobalt); }
.dir-section[data-cat="restaurants"]   { --cat-c: var(--czerwien); }
.dir-section[data-cat="stores"]        { --cat-c: var(--leaf); }
.dir-section[data-cat="organizations"] { --cat-c: #d9950b; } /* marigold, darkened for text contrast */
.dir-section[data-cat="businesses"]    { --cat-c: var(--ink); }

.dir-section-title {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: clamp(22px, 3vw, 28px);
  letter-spacing: -0.01em;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.dir-bloom { color: var(--cat-c); flex: none; }
.dir-section-count {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 13px;
  font-weight: 700;
  color: var(--cat-c);
  background: color-mix(in srgb, var(--cat-c) 12%, transparent);
  border-radius: 999px;
  padding: 2px 11px;
}

.dir-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}

/* papercut card: white paper with a scalloped ribbon cut along the top */
.dir-card {
  background: #fff;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  padding: 26px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.dir-card::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 12px;
  background-image:
    linear-gradient(var(--cat-c), var(--cat-c)),
    radial-gradient(circle at 8px 5px, var(--cat-c) 6px, transparent 6.6px);
  background-size: 100% 5px, 16px 12px;
  background-repeat: no-repeat, repeat-x;
}
.dir-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 26px rgba(33, 27, 27, 0.1);
}
.dir-card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.dir-card-name {
  font-family: var(--display-font);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.22;
  margin: 0;
}
.dir-card-name a { color: var(--ink); text-decoration: none; }
.dir-card-name a:hover { color: var(--czerwien); text-decoration: underline; }
.dir-region {
  flex: none;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--cat-c);
  background: color-mix(in srgb, var(--cat-c) 10%, transparent);
  border-radius: 6px;
  padding: 3px 8px;
}
.dir-meta { font-size: 13px; color: rgba(33, 27, 27, 0.62); margin: 0; }
.dir-desc { font-size: 14px; color: rgba(33, 27, 27, 0.85); margin: 0; }
.dir-note { font-size: 13px; color: var(--karmin); margin: 0; font-style: italic; }
.dir-card-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
}
.dir-tag {
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(33, 27, 27, 0.06);
  color: rgba(33, 27, 27, 0.7);
  text-decoration: none;
}
a.dir-tag:hover { background: rgba(214, 38, 45, 0.1); color: var(--czerwien); }
.dir-tag--ok { background: rgba(46, 125, 79, 0.12); color: var(--leaf); }
.dir-tag--listed { background: rgba(243, 178, 41, 0.2); color: #8a6410; }

/* ------------------------------------------------------------ empty state */
.dir-empty {
  text-align: center;
  padding: 48px 20px;
  border: 1.5px dashed var(--hairline);
  border-radius: 14px;
}
.dir-empty p {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: 20px;
  margin: 0 0 14px;
}
.dir-empty-clear {
  font: inherit;
  font-weight: 600;
  font-size: 14.5px;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 999px;
  border: 0;
  background: var(--czerwien);
  color: #fff;
  transition: background 0.15s ease;
}
.dir-empty-clear:hover { background: var(--karmin); }

/* ---------------------------------------------------------------- CTA band */
.dir-cta {
  margin-top: 44px;
  border-radius: 14px;
  background: var(--czerwien);
  color: #fff;
  text-align: center;
  padding: 44px 28px 40px;
  position: relative;
  overflow: hidden;
}
/* paper scallops cut into the band's top and bottom edges */
.dir-cta::before,
.dir-cta::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 12px;
  pointer-events: none;
}
.dir-cta::before {
  top: 0;
  background-image: radial-gradient(circle at 10px -3px, var(--paper) 9px, transparent 9.6px);
  background-size: 20px 12px;
  background-repeat: repeat-x;
}
.dir-cta::after {
  bottom: 0;
  background-image: radial-gradient(circle at 10px 15px, var(--paper) 8px, transparent 8.6px);
  background-size: 20px 12px;
  background-repeat: repeat-x;
}
.dir-cta-title {
  font-family: var(--display-font);
  font-weight: 800;
  font-size: clamp(21px, 3.4vw, 30px);
  letter-spacing: -0.01em;
  line-height: 1.18;
  margin: 0 auto 20px;
  max-width: 24em;
  color: #fff;
}
.dir-cta-btn {
  display: inline-block;
  background: #fff;
  color: var(--czerwien);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  padding: 12px 26px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease, transform 0.15s ease;
}
.dir-cta-btn:hover {
  background: var(--marigold);
  color: var(--ink);
  text-decoration: none;
}
.dir-cta-btn:active { transform: scale(0.98); }

/* -------------------------------------------------------------- responsive */
@media (max-width: 920px) {
  .dir-hero-in {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 36px 24px 44px;
  }
  .dir-medallion { order: -1; justify-self: start; }
  .dir-medallion svg { width: 130px; }
}
@media (max-width: 640px) {
  .dir-hero-in { padding: 28px 16px 36px; }
  .dir-proof { gap: 20px; }
  .dir-search-row { flex-wrap: wrap; }
  .dir-count { width: 100%; text-align: right; }
  .dir-filter-label { width: 100%; }
}
