/* =========================================================================
   Spec G: sitewide "next step" loop component.

   Replaces the repeated flat grey quote-band closer with a designed section
   that carries contextual cross-links (services, packages, events,
   galleries) alongside the quote CTA. One component, two variants:
     .next-loop         dark band, used on service/event/package/category/
                         product/blog page endings.
     .next-loop--photo  full bleed background photo, extra visual weight,
                         used on the FAQ close and About.
   Rendered by site/build-lib/loop.mjs (services/events/packages/catalog/
   blog builds) and mirrored by hand in about.html, contact.html, faq.html.
   ========================================================================= */

.next-loop {
  position: relative;
  overflow: hidden;
  background: var(--color-ink);
  color: var(--color-white);
  padding-block: var(--space-7);
}
.next-loop::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 88% 12%, rgba(57, 181, 74, 0.18), transparent 55%);
  pointer-events: none;
}
.next-loop .container { position: relative; }
.next-loop__top { max-width: 640px; margin-bottom: var(--space-5); }
.next-loop__top .section-lede { color: rgba(255, 255, 255, 0.72); }

.next-loop__body {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--space-5);
  align-items: start;
}

.next-loop__links {
  list-style: none;
  margin: 0;
  padding: 0;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}
.next-loop__links a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.9rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  color: var(--color-white);
  text-decoration: none;
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease), transform 0.2s var(--ease);
}
.next-loop__links a:hover,
.next-loop__links a:focus-visible {
  border-color: var(--color-accent);
  background: rgba(57, 181, 74, 0.1);
  transform: translateY(-2px);
}
.next-loop__tag {
  flex-shrink: 0;
  font-family: var(--font-head);
  font-size: 0.62rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-pill);
  padding: 0.15rem 0.5rem;
  white-space: nowrap;
}
.next-loop__label {
  font-family: var(--font-head);
  font-size: 0.95rem;
  flex: 1;
  line-height: 1.2;
}
.next-loop__arrow { color: rgba(255, 255, 255, 0.45); flex-shrink: 0; }
.next-loop__links a:hover .next-loop__arrow,
.next-loop__links a:focus-visible .next-loop__arrow { color: var(--color-accent); }

.next-loop__cta {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  padding: var(--space-4);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.03);
}
.next-loop__cta .btn { width: 100%; }

@media (max-width: 900px) {
  .next-loop__body { grid-template-columns: 1fr; }
  .next-loop__links { grid-template-columns: 1fr; }
}

/* ---------- Photo variant: extra visual weight for page closers ---------- */
.next-loop--photo {
  padding-block: var(--space-8);
  background-image: linear-gradient(180deg, rgba(10, 10, 10, 0.5) 0%, rgba(10, 10, 10, 0.88) 100%), var(--loop-bg-image);
  background-size: cover;
  background-position: center;
}
.next-loop--photo .next-loop__top {
  max-width: 720px;
  margin-inline: auto;
  text-align: center;
}
.next-loop--photo .next-loop__top .section-title { max-width: 640px; margin-inline: auto; }
.next-loop--photo .next-loop__top .section-lede { margin-inline: auto; }
.next-loop--photo .next-loop__body {
  grid-template-columns: 1fr;
  justify-items: center;
  gap: var(--space-4);
}
.next-loop--photo .next-loop__links {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 860px;
  width: 100%;
}
.next-loop--photo .next-loop__cta {
  flex-direction: row;
  border: none;
  background: transparent;
  padding: 0;
}
.next-loop--photo .next-loop__cta .btn { width: auto; }

@media (max-width: 760px) {
  .next-loop--photo .next-loop__links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .next-loop--photo .next-loop__cta { flex-direction: column; width: 100%; max-width: 320px; }
}
