/**
 * CVC Grupos de Conexão — public finder.
 * Palette and type follow the existing igrejacvc.be design language:
 * DM Serif Text display, Gabarito/DM Sans UI, ink #1a1b1d, gold #9c763d.
 */

.cvc-gc {
  --cvc-ink: #1a1b1d;
  --cvc-ink-soft: #5b6470;
  --cvc-line: #e3e6ea;
  --cvc-surface: #ffffff;
  --cvc-surface-alt: #f6f7f9;
  --cvc-gold: #9c763d;
  --cvc-gold-soft: #f3ead9;
  --cvc-navy: #254260;
  --cvc-radius: 16px;
  --cvc-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 12px 32px rgba(16, 24, 40, .07);
  --cvc-shadow-lift: 0 2px 4px rgba(16, 24, 40, .05), 0 18px 44px rgba(16, 24, 40, .11);

  box-sizing: border-box;
  width: 100%;
  max-width: 1080px;
  margin-inline: auto;
  color: var(--cvc-ink);
  font-family: "Gabarito", "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  /* Keep headings clear of the site's sticky header when scrolled to. */
  scroll-margin-top: 110px;
}

/* The shortcode often sits inside a flex column that is narrower than the
   section. Let the widget span the full row so the cards are not squeezed
   into a half-width strip. */
.elementor-widget-shortcode:has(.cvc-gc) {
  width: 100% !important;
  max-width: 100% !important;
  flex: 1 1 100% !important;
}

.elementor-widget-shortcode .elementor-shortcode:has(.cvc-gc),
.elementor-widget-shortcode > .elementor-widget-container:has(.cvc-gc) {
  width: 100%;
  max-width: 100%;
}

.cvc-gc *,
.cvc-gc *::before,
.cvc-gc *::after { box-sizing: inherit; }

/* ---------------------------------------------------------------- intro */

.cvc-gc__intro {
  text-align: center;
  max-width: 680px;
  margin: 0 auto 28px;
}

.cvc-gc__title {
  font-family: "DM Serif Text", Georgia, "Times New Roman", serif;
  font-weight: 400;
  font-size: clamp(1.65rem, 1.15rem + 2.2vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  color: var(--cvc-ink);
}

.cvc-gc__subtitle {
  margin: 0;
  font-size: clamp(1rem, .96rem + .2vw, 1.09rem);
  color: var(--cvc-ink-soft);
}

/* ----------------------------------------------------------------- form */

.cvc-gc__form {
  background: var(--cvc-surface);
  border: 1px solid var(--cvc-line);
  border-radius: var(--cvc-radius);
  box-shadow: var(--cvc-shadow);
  padding: clamp(18px, 3vw, 26px);
  max-width: 760px;
  margin: 0 auto;
}

.cvc-gc__label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--cvc-ink-soft);
  margin-bottom: 9px;
}

.cvc-gc__input-row {
  display: flex;
  gap: 12px;
  align-items: stretch;
  flex-wrap: wrap;
}

.cvc-gc__input-wrap {
  position: relative;
  flex: 1 1 260px;
  min-width: 0; /* allows the flex item to shrink instead of overflowing */
  display: flex;
  align-items: center;
}

.cvc-gc__input-icon {
  position: absolute;
  left: 14px;
  width: 20px;
  height: 20px;
  color: var(--cvc-gold);
  pointer-events: none;
}

.cvc-gc .cvc-gc__input {
  width: 100%;
  min-width: 0;
  min-height: 54px;
  padding: 12px 16px 12px 44px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--cvc-ink);
  background: var(--cvc-surface);
  border: 1.5px solid var(--cvc-line);
  border-radius: 12px;
  transition: border-color .16s ease, box-shadow .16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.cvc-gc .cvc-gc__input::placeholder { color: #9aa3ad; }

.cvc-gc .cvc-gc__input:hover { border-color: #cfd5dc; }

.cvc-gc .cvc-gc__input:focus,
.cvc-gc .cvc-gc__input:focus-visible {
  outline: none;
  border-color: var(--cvc-navy);
  box-shadow: 0 0 0 4px rgba(37, 66, 96, .13);
}

.cvc-gc .cvc-gc__submit {
  flex: 0 0 auto;
  min-height: 54px;
  padding: 0 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: inherit;
  font-size: 1rem;
  font-weight: 600;
  color: #fff;
  background: var(--cvc-ink);
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  transition: background .16s ease, transform .12s ease, box-shadow .16s ease;
  -webkit-appearance: none;
  appearance: none;
}

.cvc-gc .cvc-gc__submit:hover {
  background: #2f3238;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .16);
}

.cvc-gc .cvc-gc__submit:active { transform: translateY(1px); }

.cvc-gc .cvc-gc__submit:focus-visible {
  outline: 3px solid var(--cvc-navy);
  outline-offset: 2px;
}

.cvc-gc .cvc-gc__submit[disabled] { opacity: .72; cursor: progress; }

.cvc-gc__spinner {
  display: none;
  width: 17px;
  height: 17px;
  border: 2px solid rgba(255, 255, 255, .35);
  border-top-color: #fff;
  border-radius: 50%;
}

.cvc-gc.is-loading .cvc-gc__spinner {
  display: block;
  animation: cvc-gc-spin .7s linear infinite;
}

@keyframes cvc-gc-spin { to { transform: rotate(360deg); } }

.cvc-gc__help {
  margin: 12px 0 0;
  font-size: .82rem;
  color: #7b848f;
}

/* -------------------------------------------------------------- message */

.cvc-gc__message[hidden] { display: none; }

.cvc-gc__message {
  max-width: 760px;
  margin: 18px auto 0;
  padding: 14px 18px;
  border-radius: 12px;
  font-size: .96rem;
  background: #fff6f6;
  color: #7d2b2b;
  border: 1px solid #f0d2d2;
  border-left: 4px solid #d05353;
}

.cvc-gc__message.is-info {
  background: var(--cvc-gold-soft);
  color: #6d5324;
  border-color: #e6d6ba;
  border-left-color: var(--cvc-gold);
}

/* -------------------------------------------------------------- results */

.cvc-gc__results[hidden] { display: none; }

.cvc-gc__results { margin-top: 40px; }

.cvc-gc__results-title {
  font-family: "DM Serif Text", Georgia, serif;
  font-weight: 400;
  font-size: clamp(1.3rem, 1.1rem + 1vw, 1.75rem);
  line-height: 1.2;
  text-align: center;
  margin: 0 0 26px;
  scroll-margin-top: 110px;
}

/* Focus is moved here programmatically for screen readers; a visible ring
   would look like a stray box to sighted users. */
.cvc-gc__results-title:focus,
.cvc-gc__results-title:focus-visible {
  outline: none;
  box-shadow: none;
}

.cvc-gc__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 20px;
  align-items: stretch;
}

/* ----------------------------------------------------------------- card */

.cvc-gc__card {
  position: relative;
  display: flex;
  flex-direction: column;
  background: var(--cvc-surface);
  border: 1px solid var(--cvc-line);
  border-radius: var(--cvc-radius);
  box-shadow: var(--cvc-shadow);
  padding: 26px 24px 24px;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.cvc-gc__card:hover {
  transform: translateY(-3px);
  box-shadow: var(--cvc-shadow-lift);
  border-color: #d6dbe1;
}

/* The nearest group gets a warm, deliberate emphasis. */
.cvc-gc__card--closest {
  border-color: var(--cvc-gold);
  box-shadow: 0 2px 4px rgba(156, 118, 61, .1), 0 20px 46px rgba(156, 118, 61, .16);
}

.cvc-gc__badge {
  position: absolute;
  top: -13px;
  left: 24px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 13px;
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: #fff;
  background: var(--cvc-gold);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(156, 118, 61, .3);
}

.cvc-gc__city {
  font-family: "DM Serif Text", Georgia, serif;
  font-weight: 400;
  font-size: 1.5rem;
  line-height: 1.2;
  margin: 6px 0 4px;
  color: var(--cvc-ink);
}

.cvc-gc__distance {
  display: inline-flex;
  align-items: baseline;
  gap: 5px;
  margin-bottom: 18px;
  font-size: .93rem;
  font-weight: 600;
  color: var(--cvc-gold);
}

.cvc-gc__distance small {
  font-weight: 500;
  color: var(--cvc-ink-soft);
}

.cvc-gc__meta {
  list-style: none;
  margin: 0 0 22px;
  padding: 0;
  display: grid;
  gap: 11px;
  border-top: 1px solid var(--cvc-line);
  padding-top: 18px;
}

.cvc-gc__meta li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: .95rem;
  color: var(--cvc-ink);
  margin: 0;
}

.cvc-gc__meta svg {
  flex: 0 0 auto;
  width: 17px;
  height: 17px;
  margin-top: 2px;
  color: var(--cvc-ink-soft);
}

.cvc-gc__meta span { min-width: 0; word-break: break-word; }

.cvc-gc__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: -6px 0 20px;
}

.cvc-gc__tag {
  padding: 4px 11px;
  font-size: .76rem;
  font-weight: 600;
  color: var(--cvc-ink-soft);
  background: var(--cvc-surface-alt);
  border: 1px solid var(--cvc-line);
  border-radius: 999px;
}

.cvc-gc .cvc-gc__cta {
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: .96rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
  color: #fff;
  background: var(--cvc-ink);
  border: 1.5px solid var(--cvc-ink);
  border-radius: 11px;
  transition: background .16s ease, color .16s ease, box-shadow .16s ease;
}

.cvc-gc .cvc-gc__cta:hover {
  background: #2f3238;
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 24, 40, .16);
}

.cvc-gc .cvc-gc__cta:focus-visible {
  outline: 3px solid var(--cvc-navy);
  outline-offset: 2px;
}

.cvc-gc__card--closest .cvc-gc__cta {
  background: var(--cvc-gold);
  border-color: var(--cvc-gold);
}

.cvc-gc__card--closest .cvc-gc__cta:hover { background: #866430; }

/* ------------------------------------------------------------- skeleton */

.cvc-gc__skeleton[hidden] { display: none; }

.cvc-gc__skeleton {
  margin-top: 40px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(268px, 1fr));
  gap: 20px;
}

.cvc-gc__skel-card {
  height: 258px;
  border-radius: var(--cvc-radius);
  border: 1px solid var(--cvc-line);
  background: linear-gradient(100deg, #f2f4f6 30%, #e9ecef 45%, #f2f4f6 60%);
  background-size: 300% 100%;
  animation: cvc-gc-shimmer 1.25s ease-in-out infinite;
}

@keyframes cvc-gc-shimmer {
  0%   { background-position: 100% 0; }
  100% { background-position: 0 0; }
}

/* ------------------------------------------------------------- reveal */

@media (prefers-reduced-motion: no-preference) {
  .cvc-gc__card {
    animation: cvc-gc-rise .34s cubic-bezier(.2, .7, .3, 1) backwards;
  }
  .cvc-gc__card:nth-child(2) { animation-delay: .06s; }
  .cvc-gc__card:nth-child(3) { animation-delay: .12s; }
  .cvc-gc__card:nth-child(n+4) { animation-delay: .18s; }
}

@keyframes cvc-gc-rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .cvc-gc *,
  .cvc-gc *::before,
  .cvc-gc *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* --------------------------------------------------------------- mobile */

@media (max-width: 640px) {
  .cvc-gc__form { padding: 18px 16px; border-radius: 14px; }
  .cvc-gc__input-row { gap: 10px; }
  .cvc-gc__input-wrap { flex: 1 1 100%; }
  .cvc-gc .cvc-gc__submit { width: 100%; }
  .cvc-gc__grid,
  .cvc-gc__skeleton { grid-template-columns: 1fr; gap: 18px; }
  .cvc-gc__card { padding: 24px 20px 22px; }
  .cvc-gc__results { margin-top: 32px; }
}

/* Dark sections: the shortcode may sit on a dark Elementor container. */
.cvc-gc--on-dark .cvc-gc__title,
.cvc-gc--on-dark .cvc-gc__results-title { color: #fff; }

.cvc-gc--on-dark .cvc-gc__subtitle { color: rgba(255, 255, 255, .78); }
