/* KidsMap Organization Directory (Networks Catalog) Stylesheet */
:root {
  --org-ink: #142e23;
  --org-ink-light: #415a4e;
  --org-muted: #627b6f;
  --org-border: #dbe7e0;
  --org-border-focus: #148348;
  --org-bg-card: #ffffff;
  --org-bg-page: #f7faf8;
  --org-accent: #0f8344;
  --org-accent-hover: #0b6f39;
  --org-accent-light: #eaf5ee;
  --org-shadow-sm: 0 2px 8px rgba(18, 48, 33, 0.04);
  --org-shadow-md: 0 6px 20px rgba(18, 48, 33, 0.06);
  --org-shadow-hover: 0 14px 32px rgba(18, 48, 33, 0.1);
  --org-radius-sm: 8px;
  --org-radius-md: 14px;
  --org-radius-lg: 20px;
}

.org-directory {
  max-width: 1240px;
  margin: 28px auto 64px;
  padding: 0 24px;
  color: var(--org-ink);
  font-family: inherit;
}

/* ==========================================================================
   1. HERO BANNER
   ========================================================================== */
.org-hero {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 36px;
  padding: 36px 44px;
  border: 1px solid #d4e7dc;
  border-radius: var(--org-radius-lg);
  background: linear-gradient(135deg, #f0f7f2 0%, #ffffff 50%, #edf6f0 100%);
  box-shadow: 0 4px 20px rgba(18, 55, 36, 0.03);
  position: relative;
  overflow: hidden;
}

.org-hero::before {
  content: "";
  position: absolute;
  top: -60px;
  right: -60px;
  width: 240px;
  height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(168, 222, 189, 0.35) 0%, rgba(255, 255, 255, 0) 70%);
  pointer-events: none;
}

.org-hero-copy {
  max-width: 720px;
  position: relative;
  z-index: 1;
}

.org-hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  background: #e4f3ea;
  border: 1px solid #c8e5d3;
  color: var(--org-accent-hover);
  font-size: 13px;
  font-weight: 650;
  margin-bottom: 14px;
  letter-spacing: -0.01em;
}

.org-hero-badge .material-symbols-rounded {
  font-size: 16px;
}

.org-hero h1 {
  font-size: clamp(26px, 3.2vw, 40px);
  font-weight: 800;
  line-height: 1.16;
  letter-spacing: -0.03em;
  color: var(--org-ink);
  margin: 0 0 14px;
}

.org-hero-desc {
  font-size: 16px;
  line-height: 1.6;
  color: var(--org-ink-light);
  margin: 0;
  max-width: 650px;
}

.org-hero-aside {
  flex: 0 0 auto;
  position: relative;
  z-index: 1;
}

.org-hero-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 22px;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border: 1px solid #d2e7db;
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20, 60, 40, 0.06);
  max-width: 320px;
}

.org-hero-card-icon {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  background: var(--org-accent-light);
  color: var(--org-accent-hover);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.org-hero-card-icon .material-symbols-rounded {
  font-size: 26px;
}

.org-hero-card-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.org-hero-card-info strong {
  font-size: 14px;
  font-weight: 700;
  color: var(--org-ink);
}

.org-hero-card-info span {
  font-size: 12px;
  line-height: 1.4;
  color: var(--org-muted);
}

/* ==========================================================================
   2. FILTERS BAR
   ========================================================================== */
.org-filters {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  background: var(--org-bg-card);
  border: 1px solid var(--org-border);
  border-radius: var(--org-radius-md);
  padding: 20px 24px;
  margin: 24px 0 20px;
  box-shadow: var(--org-shadow-sm);
}

.org-filter-group label {
  display: block;
  font-size: 13px;
  font-weight: 650;
  color: var(--org-ink);
  margin-bottom: 7px;
}

.org-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.org-input-icon {
  position: absolute;
  left: 14px;
  font-size: 20px;
  color: var(--org-muted);
  pointer-events: none;
}

.org-filters input,
.org-filters select {
  width: 100%;
  min-width: 0;
  min-height: 48px;
  border: 1px solid #c9dcd1;
  border-radius: 11px;
  padding: 10px 16px 10px 42px;
  background: #ffffff;
  color: var(--org-ink);
  font: inherit;
  font-size: 14px;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.org-filters input::placeholder {
  color: #8fa59b;
}

.org-filters select {
  appearance: none;
  cursor: pointer;
  padding-right: 38px;
}

.org-select-arrow {
  position: absolute;
  right: 12px;
  font-size: 22px;
  color: var(--org-muted);
  pointer-events: none;
  transition: transform .15s ease;
}

.org-filters input:focus,
.org-filters select:focus {
  outline: none;
  border-color: var(--org-border-focus);
  box-shadow: 0 0 0 3px rgba(20, 131, 72, 0.14);
}

.org-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 11px 24px;
  border: 0;
  border-radius: 11px;
  background: linear-gradient(135deg, #0e8645, #086b35);
  color: #ffffff;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(14, 134, 69, 0.22);
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease;
  white-space: nowrap;
}

.org-btn-submit:hover {
  filter: brightness(1.05);
  box-shadow: 0 6px 16px rgba(14, 134, 69, 0.3);
  transform: translateY(-1px);
}

.org-btn-submit:active {
  transform: translateY(0);
}

.org-btn-submit .material-symbols-rounded {
  font-size: 18px;
  transition: transform .15s ease;
}

.org-btn-submit:hover .material-symbols-rounded {
  transform: translateX(3px);
}

/* ==========================================================================
   3. RESULTS TOOLBAR & ACTIVE CHIPS
   ========================================================================== */
.org-results-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
  margin-bottom: 22px;
}

.org-results-count h2 {
  font-size: 17px;
  font-weight: 700;
  margin: 0;
  color: var(--org-ink);
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.org-count-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: #e4f2e9;
  color: var(--org-accent-hover);
  font-size: 13px;
  font-weight: 750;
}

.org-active-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.org-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: #edf6f0;
  border: 1px solid #c9e4d3;
  color: var(--org-ink);
  font-size: 12.5px;
  font-weight: 600;
  text-decoration: none;
  transition: background .15s ease, border-color .15s ease;
}

.org-filter-chip:hover {
  background: #feebe8;
  border-color: #f7b8b0;
  color: #b92b1c;
}

.org-filter-chip .material-symbols-rounded {
  font-size: 15px;
}

.org-reset-btn {
  font-size: 13px;
  font-weight: 650;
  color: var(--org-muted);
  text-decoration: none;
  padding: 4px 8px;
  transition: color .15s ease;
}

.org-reset-btn:hover {
  color: #b92b1c;
  text-decoration: underline;
}

/* ==========================================================================
   4. ORGANIZATION GRID & CARDS
   ========================================================================== */
.org-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.org-card {
  display: flex;
  flex-direction: column;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: var(--org-bg-card);
  box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
  overflow: hidden;
  min-width: 0;
  height: 100%;
  transition: transform .22s cubic-bezier(0.2, 0, 0, 1), box-shadow .22s ease, border-color .22s ease;
}

.org-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
  border-color: #b7dac4;
}

/* --- Media / Gallery layout: Strictly 4:3 Aspect Ratio --- */
.org-card-media {
  position: relative;
  width: 100% !important;
  aspect-ratio: 4 / 3 !important;
  height: auto !important;
  background: #eef5f0;
  overflow: hidden;
}

/* 3 Photos: Editorial 1 large + 2 stacked */
.org-card-media--count-3 {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 2.5px;
}

.org-card-media--count-3 .org-media-frame:first-child {
  grid-row: 1 / span 2;
  grid-column: 1;
}

.org-card-media--count-3 .org-media-frame:nth-child(2) {
  grid-row: 1;
  grid-column: 2;
}

.org-card-media--count-3 .org-media-frame:nth-child(3) {
  grid-row: 2;
  grid-column: 2;
}

/* 2 Photos: 50% / 50% split */
.org-card-media--count-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5px;
}

/* 1 Photo: Full cover */
.org-card-media--count-1 {
  display: block;
}

.org-media-frame {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #e1eee5;
}

.org-media-frame img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .35s ease;
}

.org-card:hover .org-media-frame img {
  transform: scale(1.04);
}

/* Empty photo placeholder */
.org-card-media--empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #eaf4ed 0%, #dbecdf 100%);
  position: relative;
}

.org-empty-media-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--org-accent-hover);
}

.org-empty-media-content .material-symbols-rounded {
  font-size: 52px;
  color: #178347;
  opacity: 0.9;
}

.org-empty-media-content span {
  font-size: 13px;
  font-weight: 700;
  color: #215939;
  letter-spacing: 0.02em;
}

/* Badges on media */
.org-badge-branches {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(14, 38, 27, 0.82);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.16);
  z-index: 2;
}

.org-badge-branches .material-symbols-rounded {
  font-size: 15px;
  color: #8ee9ad;
}

.org-photo-caption {
  position: absolute;
  bottom: 10px;
  left: 10px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  color: #1f3b2d;
  font-size: 11px;
  font-weight: 650;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  z-index: 2;
}

.org-photo-caption .material-symbols-rounded {
  font-size: 13px;
  color: var(--org-accent-hover);
}

/* --- Card Body --- */
.org-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  gap: 8px;
}

.org-card-topline {
  margin: 0;
}

.org-card-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 750;
  color: var(--org-accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.org-card-tag svg,
.org-card-tag .material-symbols-rounded {
  font-size: 14px;
  width: 14px;
  height: 14px;
}

.org-card h3 {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  overflow-wrap: anywhere;
}

.org-card h3 a {
  color: #0f172a;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  transition: color .2s ease;
}

.org-card:hover h3 a {
  color: #08a769;
}

.org-description {
  font-size: 13px;
  line-height: 1.4;
  color: #4f6357;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}

.org-fallback {
  font-size: 12px;
  color: #7a8f83;
  font-style: italic;
  margin: 0;
}

.org-fallback--nobranches {
  color: #a45a1c;
  font-style: normal;
  font-weight: 600;
}

/* Districts pills */
.org-districts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 0;
}

.org-district-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f1f7f3;
  border: 1px solid #dbe7df;
  color: #274b3a;
  line-height: 1.3;
}

.org-district-pill svg,
.org-district-pill .material-symbols-rounded {
  font-size: 13px;
  width: 13px;
  height: 13px;
  color: var(--org-accent);
}

.org-district-more {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 7px;
  border-radius: 6px;
  background: #e4eee7;
  color: var(--org-accent-hover);
}

/* Card CTA Action */
.org-card-cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 16px;
  border-radius: 10px;
  background: #08a769;
  border: none;
  color: #ffffff;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  box-shadow: 0 2px 6px rgba(8, 167, 105, 0.2);
}

.org-card-cta:hover {
  background: #068d58;
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(8, 167, 105, 0.35);
}

.org-card-cta:active {
  transform: translateY(0) scale(0.98);
}

.org-card-cta-arrow {
  display: inline-flex;
  align-items: center;
  font-size: 14px;
  transition: transform .2s ease;
}

.org-card-cta:hover .org-card-cta-arrow {
  transform: translateX(3px);
}

.org-card:hover .org-card-cta {
  background: #eaf5ee;
  border-color: #bfe1cd;
  color: #086131;
}

.org-card:hover .org-card-cta-arrow {
  transform: translateX(4px);
}

/* ==========================================================================
   5. EMPTY STATE & PAGINATION
   ========================================================================== */
.org-empty {
  grid-column: 1 / -1;
  padding: 64px 24px;
  text-align: center;
  border: 1px dashed #cadcd0;
  border-radius: var(--org-radius-lg);
  background: #ffffff;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-empty-icon-wrap {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: #edf6f0;
  color: var(--org-muted);
  display: grid;
  place-items: center;
  margin-bottom: 16px;
}

.org-empty-icon-wrap .material-symbols-rounded {
  font-size: 38px;
}

.org-empty h3 {
  font-size: 22px;
  font-weight: 800;
  color: var(--org-ink);
  margin: 0 0 8px;
}

.org-empty p {
  font-size: 14.5px;
  color: var(--org-muted);
  margin: 0 0 20px;
  max-width: 420px;
}

.org-btn-reset-empty {
  display: inline-flex;
  align-items: center;
  padding: 10px 22px;
  border-radius: 10px;
  background: var(--org-accent);
  color: #ffffff;
  font-size: 13.5px;
  font-weight: 700;
  text-decoration: none;
  transition: background .15s ease;
}

.org-btn-reset-empty:hover {
  background: var(--org-accent-hover);
}

.org-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin: 36px 0 0;
  gap: 16px;
}

.org-pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid var(--org-border);
  background: #ffffff;
  color: var(--org-ink);
  font-size: 13.5px;
  font-weight: 650;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease;
}

.org-pagination-btn:hover {
  border-color: #b2d5c0;
  background: #f7faf8;
}

.org-pagination-btn .material-symbols-rounded {
  font-size: 18px;
}

.org-pagination-pages {
  font-size: 14px;
  font-weight: 700;
  color: var(--org-muted);
}

.org-directory :is(a, button, input, select):focus-visible {
  outline: 3px solid var(--org-border-focus);
  outline-offset: 3px;
}

/* ==========================================================================
   6. RESPONSIVE BREAKPOINTS
   ========================================================================== */
@media (max-width: 1024px) {
  .org-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px;
  }
  .org-hero {
    padding: 30px 32px;
    gap: 24px;
  }
  .org-hero-aside {
    display: none;
  }
}

@media (max-width: 768px) {
  .org-directory {
    padding: 0 16px;
    margin-top: 20px;
  }
  .org-hero {
    padding: 24px 20px;
    border-radius: 18px;
  }
  .org-hero h1 {
    font-size: 24px;
  }
  .org-hero-desc {
    font-size: 14px;
  }
  .org-filters {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 16px;
    border-radius: 16px;
  }
  .org-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .org-card-media {
    aspect-ratio: 4 / 3 !important;
    height: auto !important;
  }
  .org-card-body {
    padding: 14px 16px 16px;
  }
  .org-results-bar {
    align-items: flex-start;
  }
}
