/*
 * The NC Catholic finder (/mass, /confession, /adoration).
 * Desktop: the list beside a full-height map. Phone: search, the map, then the list.
 * Colours are the theme's tokens (theme-nc.css); corners are 2px.
 */

.ncf-main { display: block; padding: var(--ncf-top, 61px) 0 0; margin: 0; max-width: none; }
.ncf {
  display: grid;
  grid-template-columns: minmax(380px, 470px) 1fr;
  height: calc(100dvh - var(--ncf-top, 61px));
  min-height: 560px;
  border-top: 1px solid var(--lac-rule);
  font-family: var(--lac-ui);
  color: var(--lac-ink);
  background: var(--lac-paper);
}
.ncf-panel { overflow-y: auto; overscroll-behavior: contain; border-right: 1px solid var(--lac-rule); scrollbar-gutter: stable; }
.ncf-mapwrap { position: relative; background: var(--lac-bg-warm); }
.ncf-map { position: absolute; inset: 0; }

/* ── head ── */
.ncf-head { padding: 22px 24px 16px; border-bottom: 1px solid var(--lac-rule); background: var(--lac-paper); }
.ncf-tabs { display: inline-flex; border: 1px solid var(--lac-rule); border-radius: 2px; padding: 3px; gap: 2px; background: var(--lac-bg-warm); }
.ncf .ncf-tabs a {
  padding: 7px 14px; border-radius: 2px; font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--lac-ink-2); text-decoration: none; line-height: 1;
}
.ncf .ncf-tabs a:hover { color: var(--lac-ink); background: var(--nc-wash); }
.ncf .ncf-tabs a[aria-current="page"] { background: var(--nc-navy); color: #fff; }
.ncf-head h1 { font-family: var(--lac-display); font-weight: 700; font-size: 38px; line-height: 1.08; margin: 18px 0 8px; color: var(--lac-ink); letter-spacing: -0.005em; }
.ncf-lede { margin: 0 0 16px; font-size: 15px; line-height: 1.5; color: var(--lac-ink-3); max-width: 40ch; }

.ncf-search { display: flex; gap: 8px; }
.ncf-search input {
  flex: 1; min-width: 0; height: 48px; padding: 0 14px; border: 1px solid var(--lac-stone); border-radius: 2px;
  font: 500 17px var(--lac-ui); color: var(--lac-ink); background: #fff;
}
.ncf-search input::placeholder { color: var(--lac-ink-3); }
.ncf-search input:focus { outline: none; border-color: var(--nc-navy); box-shadow: 0 0 0 3px var(--nc-wash); }
.ncf-go {
  height: 48px; padding: 0 18px; border: 0; border-radius: 2px; background: var(--nc-navy); color: #fff;
  font: 600 15px var(--lac-ui); letter-spacing: 0.02em; cursor: pointer;
}
.ncf-go:hover { background: var(--lac-red); }
.ncf-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.ncf-near {
  display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 12px; border: 1px solid var(--nc-navy); border-radius: 2px;
  background: transparent; color: var(--nc-navy); font: 600 14px var(--lac-ui); cursor: pointer;
}
.ncf-near svg { color: var(--nc-blue); }
.ncf-near:hover { background: var(--nc-wash); }
.ncf-chips { display: inline-flex; gap: 6px; flex-wrap: wrap; }
.ncf-chips button {
  height: 36px; padding: 0 12px; border: 1px solid var(--lac-rule); border-radius: 2px; background: var(--lac-paper);
  color: var(--lac-ink-2); font: 500 14px var(--lac-ui); cursor: pointer;
}
.ncf-chips button span { font-variant-numeric: tabular-nums; color: var(--lac-ink-3); margin-left: 2px; }
.ncf-chips button[aria-pressed="true"] { background: var(--nc-blue); border-color: var(--nc-blue); color: var(--nc-navy); font-weight: 600; }
.ncf-chips button[aria-pressed="true"] span { color: var(--nc-navy); }
.ncf-near:focus-visible, .ncf-chips button:focus-visible, .ncf-go:focus-visible, .ncf-tabs a:focus-visible, .ncf-act:focus-visible {
  outline: 2px solid var(--lac-red); outline-offset: 2px;
}
.ncf-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── list ── */
.ncf-status { margin: 0; padding: 12px 24px; font-size: 13px; color: var(--lac-ink-3); border-bottom: 1px solid var(--lac-rule); background: var(--lac-bg-warm); }
.ncf-list { list-style: none; margin: 0; padding: 0; }
.ncf-card { position: relative; padding: 18px 24px 18px; border-bottom: 1px solid var(--lac-rule); transition: background-color 120ms ease; }
.ncf-card:hover { background: #fff; }
.ncf-card.is-active { background: #fff; box-shadow: inset 4px 0 0 var(--nc-blue); }
.ncf-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.ncf-name { margin: 0; font-family: var(--lac-display); font-weight: 700; font-size: 21px; line-height: 1.2; }
.ncf .ncf-name a { color: var(--lac-ink); text-decoration: none; }
.ncf .ncf-name a:hover { color: var(--lac-red); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.ncf-dist { flex: none; font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--lac-ink-3); white-space: nowrap; }
.ncf-where { margin: 3px 0 0; font-size: 14px; color: var(--lac-ink-3); }
.ncf-kind { margin-left: 8px; padding: 1px 6px; border: 1px solid var(--lac-rule); border-radius: 2px; font-size: 11px; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--lac-ink-2); }
.ncf-next[hidden] { display: none; }
.ncf-next { display: inline-flex; gap: 6px; align-items: baseline; margin: 10px 0 0; padding: 4px 9px; border-radius: 2px; background: var(--nc-wash); color: var(--nc-navy); font-size: 14px; }
.ncf-next span { font-weight: 600; }
.ncf-next b { font-variant-numeric: tabular-nums; }
.ncf-times { margin: 10px 0 0; display: grid; gap: 3px; }
.ncf-times div { display: grid; grid-template-columns: 84px 1fr; gap: 10px; align-items: baseline; }
.ncf-times dt { font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--lac-ink-3); }
.ncf-times dd { margin: 0; font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; color: var(--lac-ink); }
.ncf-read { margin: 6px 0 0; font-size: 12px; color: var(--lac-ink-3); }
.ncf-call, .ncf-perpetual { margin: 8px 0 0; font-family: var(--lac-serif); font-style: italic; font-size: 15px; color: var(--lac-ink-2); }
.ncf-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.ncf a.ncf-act {
  display: inline-flex; align-items: center; height: 32px; padding: 0 11px; border: 1px solid var(--lac-rule); border-radius: 2px;
  font-size: 13px; font-weight: 600; color: var(--nc-navy); text-decoration: none; background: var(--lac-paper);
}
.ncf a.ncf-act:hover { border-color: var(--nc-navy); }
.ncf a.ncf-act-call { background: var(--nc-navy); border-color: var(--nc-navy); color: #fff; }
.ncf a.ncf-act-call:hover { background: var(--lac-red); border-color: var(--lac-red); }
.ncf-phone { font-weight: 500; font-variant-numeric: tabular-nums; opacity: 0.85; margin-left: 4px; }

/* ── map chrome ── */
.ncf-credit { position: absolute; right: 8px; bottom: 6px; z-index: 2; margin: 0; padding: 2px 6px; border-radius: 2px; font: 11px var(--lac-ui); color: var(--lac-ink-3); background: rgba(248, 250, 252, 0.9); }
.ncf .ncf-credit a { color: var(--lac-ink-2); text-decoration: none; }
.ncf-map .maplibregl-ctrl-group { border-radius: 2px; box-shadow: 0 1px 3px rgba(19, 41, 75, 0.18); }
.ncf-map .maplibregl-ctrl-attrib { font: 11px var(--lac-ui); background: rgba(248, 250, 252, 0.88); }
.ncf-map .maplibregl-ctrl-attrib a { color: var(--lac-ink-2); }

/* ── phone and narrow ── */
@media (max-width: 959px) {
  .ncf { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .ncf-panel { display: contents; }
  .ncf-head { order: 1; padding: 18px 16px 14px; }
  .ncf-mapwrap { order: 2; height: 42vh; min-height: 260px; border-bottom: 1px solid var(--lac-rule); }
  .ncf-status { order: 3; padding: 10px 16px; }
  .ncf-list { order: 4; }
  .ncf-card { padding: 16px; }
  .ncf-head h1 { font-size: 32px; margin-top: 14px; }
  .ncf-lede { font-size: 14px; }
  .ncf-phone { display: none; }
}
@media (prefers-reduced-motion: reduce) { .ncf-card { transition: none; } }

/* ── Find a Church: the Catholic parishes, then every tradition nearby ── */
.ncf .ncf-sec { margin: 0; padding: 20px 24px 4px; font-family: var(--lac-display); font-size: 22px; font-weight: 700; letter-spacing: 0; text-transform: none; color: var(--lac-ink); }
.ncf .ncf-sec-others { margin-top: 8px; border-top: 1px solid var(--lac-rule); padding-top: 22px; }
.ncf-more { display: block; width: calc(100% - 48px); margin: 12px 24px 4px; height: 40px; border: 1px solid var(--nc-navy); border-radius: 2px; background: none; color: var(--nc-navy); font: 600 14px var(--lac-ui); cursor: pointer; }
.ncf-more[hidden], .ncf-hint[hidden] { display: none; }
.ncf-more:hover { background: var(--nc-wash); }
.ncf-hint { margin: 0; padding: 4px 24px 22px; font-size: 14px; color: var(--lac-ink-3); }
.ncf-other { padding-top: 14px; padding-bottom: 14px; }
.ncf-other .ncf-name { font-size: 18px; }
.ncf .ncf-other .ncf-name a { color: var(--lac-ink-2); }
@media (max-width: 959px) { .ncf-sec, .ncf-more, .ncf-hint, .ncf-others { order: 4; } .ncf-sec, .ncf-hint { padding-left: 16px; padding-right: 16px; } .ncf-more { width: calc(100% - 32px); margin: 12px 16px; } }

/* the church's own icon beside its name */
.ncf-icon { flex: none; width: 28px; height: 28px; margin-right: 10px; border-radius: 2px; object-fit: contain; align-self: center; }
.ncf-card-head { justify-content: flex-start; }
.ncf-card-head .ncf-name { flex: 1; }

/* Search and map controls stay usable on a phone and with a keyboard. */
.ncf [hidden] { display: none !important; }
.ncf-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; margin-top: 12px; }
.ncf-tools button, .ncf-tools a { border: 0; padding: 10px 0; background: none; color: var(--nc-navy); font: 600 13px var(--lac-ui); text-underline-offset: 4px; cursor: pointer; }
.ncf-tools a { margin-left: auto; }
.ncf button:focus-visible, .ncf a:focus-visible { outline: 2px solid var(--nc-navy); outline-offset: 3px; }
.ncf .ncf-near, .ncf .ncf-chips button, .ncf .ncf-act, .ncf .ncf-tabs a { min-height: 44px; height: auto; box-sizing: border-box; }
.ncf .ncf-tabs a { display: inline-flex; align-items: center; padding: 8px 10px; letter-spacing: .025em; }
.ncf .ncf-act { padding: 9px 11px; }
.ncf .ncf-on-map { border: 1px solid var(--lac-rule); border-radius: 2px; background: var(--lac-paper); color: var(--nc-navy); font: 600 13px var(--lac-ui); cursor: pointer; }
.ncf button:disabled { opacity: .65; cursor: wait; }
.ncf .ncf-card-head { align-items: center; gap: 10px; }
.ncf-icon { margin-right: 0; }
.ncf-name { min-width: 0; overflow-wrap: anywhere; }
.ncf-map-status { position: absolute; z-index: 3; left: 24px; right: 60px; top: 20px; margin: 0; padding: 14px 18px; background: var(--lac-paper); color: var(--nc-navy); border: 1px solid var(--lac-rule); font-size: 14px; }
.ncf-retry { position: absolute; z-index: 3; top: 100px; left: 24px; min-height: 44px; padding: 8px 18px; background: var(--nc-navy); color: #fff; border: 0; cursor: pointer; }
.ncf-mapwrap.is-unavailable .ncf-map { visibility: hidden; }
.ncf-card { scroll-margin-top: calc(var(--ncf-top, 61px) + 12px); }
@media (min-width: 960px) { #ncfMapToggle { display: none; } .ncf-head { position: sticky; top: 0; z-index: 4; } }
@media (max-width: 420px) { .ncf .ncf-tabs { display: flex; } .ncf .ncf-tabs a { flex: 1; justify-content: center; font-size: 11px; padding: 8px 6px; } .ncf-dist { font-size: 12px; } }
