/* cca-religiousorgs — shared custom styles layered on the NYC Core theme.
   Adapted from the cca-exemptorgs / cca-schools fleet stylesheet so all fleet UIs feel identical. */

/* ---- field rows (label over value) ---- */
.field-label { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #607D8B; margin-top: .55rem; }
.field-label:first-child { margin-top: 0; }
.field-value { font-size: .95rem; color: #212529; word-break: break-word; }
.field-value.large { font-size: 1.5rem; font-weight: 700; }

/* ---- stat badges ---- */
.stat-badge { display: inline-flex; align-items: center; font-size: .75rem; font-weight: 700; border-radius: 1rem; padding: .2rem .6rem; white-space: nowrap; }
.stat-badge.primary   { background-color: #E3F2FD; color: #1976D2; }
.stat-badge.info      { background-color: #E3F2FD; color: #1976D2; }
.stat-badge.success   { background-color: #C8E6C9; color: #2E7D32; }
.stat-badge.warning   { background-color: #FFF9C4; color: #F57F17; }
.stat-badge.danger    { background-color: #FFCDD2; color: #C62828; }
.stat-badge.secondary { background-color: #ECEFF1; color: #546E7A; }
.stat-badge.purple    { background-color: #EDE7F6; color: #5E35B1; }

/* ---- meta strip: plain-language freshness line + collapsed provenance ---- */
.meta-strip { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: .5rem .75rem; background: #f8fafc; border: 1px solid #e9eef3; border-radius: .4rem; }
.meta-dim { color: #8a94a3; font-size: .78rem; display: inline-flex; align-items: center; }
.meta-dim code { color: inherit; }
.meta-fresh { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 600; color: #2E7D32; }
.meta-strip .meta-fresh i { color: #2E7D32; }
.meta-details { font-size: .8rem; }
.meta-details > summary { cursor: pointer; color: #6c757d; list-style: none; display: inline-flex; align-items: center; gap: .3rem; padding: .15rem 0; }
.meta-details > summary::-webkit-details-marker { display: none; }
.meta-details[open] > summary { margin-bottom: .15rem; }
.meta-details > summary:hover { color: #004CBE; }
.meta-badges { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }

/* ---- filter chips ---- */
.filter-chip { display: inline-flex; align-items: center; font-size: .82rem; font-weight: 600; color: #37474F; background: #fff; border: 1px solid #cfd8dc; border-radius: 1rem; padding: .2rem .7rem; margin-right: .3rem; text-decoration: none; white-space: nowrap; cursor: pointer; }
.filter-chip:hover { border-color: #004CBE; color: #004CBE; text-decoration: none; }
.filter-chip.active { background: #004CBE; border-color: #004CBE; color: #fff; }
.filter-chip .count { opacity: .65; font-weight: 500; margin-left: 2px; }

/* ---- tiles & result cards ---- */
.lookup-tile { cursor: pointer; transition: box-shadow .15s, transform .15s; }
.lookup-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); transform: translateY(-2px); }
.result-card { border-top: 3px solid #90A4AE; transition: box-shadow .15s; }
.result-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.result-card:focus-within { outline: 2px solid #004CBE; outline-offset: 2px; }
.result-card.deductible { border-top-color: #2E7D32; }
.result-card.revoked { border-top-color: #C62828; }
.result-tag { display: inline-flex; align-items: center; font-size: .72rem; font-weight: 600; color: #546E7A; background: #ECEFF1; border-radius: .3rem; padding: .1rem .45rem; margin-right: .3rem; }

/* ---- entity hero ---- */
.entity-hero { border-left: 5px solid #004CBE; }
.entity-hero.revoked { border-left-color: #C62828; }
.entity-title { font-size: clamp(1.45rem, 2.4vw, 2.25rem); }
.entity-kicker { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 700; color: #607D8B; }

/* ---- tables: clickable rows + mobile cards ---- */
.table { font-size: .875rem; }
tr[data-href] { cursor: pointer; }
tr[data-href] .row-chevron { color: #9aa5b1; }
tr[data-href]:hover .row-chevron { color: #004CBE; }
.money { font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 575.98px) {
  .table-cards thead { display: none; }
  .table-cards, .table-cards tbody, .table-cards tr, .table-cards td { display: block; width: 100%; }
  .table-cards tr { border: 1px solid #e3e8ee; border-radius: .4rem; padding: .55rem .7rem; margin-bottom: .6rem; background: #fff; }
  .table-cards td { border: 0 !important; padding: .15rem 0 !important; }
  .table-cards td:empty { display: none; }
  .table-cards td[data-label]::before { content: attr(data-label) ": "; font-weight: 700; color: #607D8B; font-size: .78rem; }
  .table-cards td.row-chevron-cell { display: none; }
}

/* ---- loading skeletons ---- */
@keyframes eo-shimmer { from { background-position: -400px 0; } to { background-position: 400px 0; } }
.skeleton-block { border-radius: .3rem; min-height: 14px; background: linear-gradient(90deg, #eceff1 25%, #f7f9fa 37%, #eceff1 63%); background-size: 800px 100%; animation: eo-shimmer 1.3s linear infinite; }
.skeleton-table .skeleton-block { height: 16px; margin-bottom: 10px; }
.skel-row { gap: 12px; margin-bottom: 10px; }
.skel-row .skeleton-block { flex: 0 0 auto; }

/* ---- empty / error states ---- */
.empty-state { text-align: center; padding: 2.2rem 1rem; color: #555; }
.empty-state i { font-size: 2.2rem; color: #adb5bd; margin-bottom: .7rem; display: block; }
.empty-state.load-error i { color: #E57373; }
.empty-state.load-error { padding: 2rem 1rem; }
.error-message { display: none; margin-top: 20px; }
.error-message.show { display: block; }

/* ---- map ---- */
.map-frame { position: relative; width: 100%; height: clamp(420px, 58vh, 640px); border: 1px solid #dfe5ec; border-radius: .5rem; overflow: hidden; }
.map-frame--tall { height: clamp(460px, 62vh, 700px); }
.maplibregl-popup-content { padding: 12px 14px; }
.maplibregl-popup { z-index: 6; }
.map-fallback-host { display: flex; align-items: center; justify-content: center; background: #f5f7fa; border: 1px dashed #c8d0da; }
.map-fallback { text-align: center; max-width: 420px; padding: 1.5rem 1.25rem; color: #455; }
.map-fallback i { font-size: 2.4rem; color: #90A4AE; margin-bottom: .6rem; display: block; }

/* ---- header / nav ---- */
.nav-toggle { display: none; background: none; border: 0; color: #fff; font-size: 1.15rem; padding: .25rem .5rem; }
#primary-nav a.nav-active { font-weight: 700; box-shadow: inset 0 -2px 0 currentColor; }
@media (max-width: 767.98px) {
  .nav-toggle { display: inline-block; }
  #primary-nav { display: none; width: 100%; }
  #primary-nav.show { display: block; }
  #primary-nav .extensible-list.horizontal { flex-direction: column; align-items: flex-start; }
  #primary-nav .extensible-list.horizontal li { padding: .3rem 0; }
}

.stat-badge .badge-dim { opacity: .7; font-weight: 600; margin-left: 2px; }

/* ---- prose (explainer summary/etymology/history/beliefs/practices/organization) ---- */
.prose { font-size: .95rem; line-height: 1.65; color: #263238; }
.prose p:last-child { margin-bottom: 0 !important; }
.prose-meta { font-size: .78rem; color: #8a94a3; }

/* ---- provenance legend (self-description vs academic/historical vs classification) ---- */
.provenance-legend { display: flex; flex-wrap: wrap; gap: .5rem 1rem; font-size: .82rem; color: #546E7A; }
.provenance-legend .stat-badge { font-size: .72rem; }

/* ---- religions/traditions hierarchy tree ---- */
.tree-list { list-style: none; margin: 0; padding-left: 0; }
.tree-list .tree-list { padding-left: 1.35rem; border-left: 1px dashed #cfd8dc; margin-top: .35rem; margin-left: .5rem; }
.tree-node { padding: .2rem 0; }
.tree-node a { font-weight: 600; }
.tree-toggle { background: none; border: 0; color: #607D8B; padding: 0 .35rem 0 0; cursor: pointer; width: 1.1rem; }
.branch-card { border: 1px solid #e3e8ee; border-radius: .4rem; padding: .6rem .8rem; margin-bottom: .5rem; }

/* ---- source / citation list ---- */
.source-item { border-left: 3px solid #90A4AE; padding: .4rem .8rem; margin-bottom: .6rem; }
.source-item.type-academic { border-left-color: #5E35B1; }
.source-item.type-official { border-left-color: #2E7D32; }
.source-item.type-reference { border-left-color: #1976D2; }
.source-item.type-historical { border-left-color: #F57F17; }
.source-item .source-title { font-weight: 700; }
.source-item .source-meta { font-size: .78rem; color: #78909C; }

/* ---- footer ---- */
.footer-head { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .07em; color: #9aa7b5; margin-bottom: .5rem; }
.footer-links { list-style: none; margin: 0; padding: 0; }
.footer-links li { margin-bottom: .35rem; }
.footer-links a { color: #cfd8e3; font-size: .9rem; text-decoration: none; }
.footer-links a:hover { color: #fff; text-decoration: underline; }
.footer-legal { border-top: 1px solid rgba(255,255,255,.12); }

/* ---- print ---- */
@media print {
  #global-header, footer, .btn, .nav-toggle, .meta-details, .copy-link-btn { display: none !important; }
}
