.church-page {
  container-type: inline-size;
  overflow-wrap: anywhere;
}

.church-top,
.church-grid {
  display: grid;
  gap: var(--space-4);
}

.church-page :is(.church-preview, .church-progress, .church-card) {
  min-width: 0;
  padding: var(--space-4);
}

.church-preview,
.church-progress {
  display: grid;
  align-content: start;
  gap: var(--space-3);
}

.church-preview .panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  margin: 0;
}

.church-site-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  color: var(--primary);
  font-weight: 600;
  text-underline-offset: 4px;
}

.church-page :is(.church-site-link, .church-locality, .church-feature-time, .church-contact) svg,
.church-dialog :is(.church-locality, .church-feature-time) svg {
  flex: none;
  width: 1em;
  height: 1em;
}

.church-filters,
.church-channels,
.church-language-list,
.church-card-actions,
.church-entry-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.church-filters .filter {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 44px;
  transition: background-color 180ms ease-out, border-color 180ms ease-out, color 180ms ease-out;
}

.church-filters .filter svg {
  width: 16px;
  height: 16px;
}

.church-button {
  min-height: 44px;
  white-space: normal;
  text-align: start;
}

.church-button svg {
  flex-shrink: 0;
}

.church-preview > .church-button {
  justify-self: start;
}

.church-feature {
  --church-accent: var(--amber);
  --church-accent-ink: var(--prune-950);
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-m);
  color: var(--on-primary);
  background-color: var(--prune-900);
}

:is(.church-feature, .church-monogram)[data-accent="sauge"] {
  --church-accent: oklch(0.8 0.063 150);
  --church-accent-ink: var(--prune-950);
}

:is(.church-feature, .church-monogram)[data-accent="prune"] {
  --church-accent: var(--primary-line);
  --church-accent-ink: var(--prune-950);
}

.church-feature-copy {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: var(--space-2);
  min-width: 0;
  padding: var(--space-4);
}

.church-feature h3 {
  font-family: var(--font-display);
  font-size: clamp(1.45rem, 1rem + 1.3vw, 2rem);
  font-weight: 400;
  line-height: 1.12;
  text-wrap: balance;
}

.church-feature .church-prose {
  color: var(--on-dark-muted);
}

.church-feature-image {
  grid-row: 1;
  align-self: center;
  min-width: 0;
}

.church-feature-image img {
  display: block;
  width: 100%;
  height: auto;
}

.church-monogram {
  display: grid;
  flex: none;
  place-items: center;
  width: 44px;
  height: 48px;
  border-radius: var(--radius-arch);
  color: var(--church-accent-ink, var(--prune-950));
  background-color: var(--church-accent, var(--amber));
  font-family: var(--font-display);
  font-size: var(--text-l);
  line-height: 1;
}

.church-monogram svg {
  width: 22px;
  height: 22px;
}

.church-monogram.has-logo {
  padding: 6px;
  background-color: var(--amber-soft);
}

.church-monogram.has-logo img,
.church-logo-tile img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.church-logo-field {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.church-logo-tile {
  display: grid;
  flex: none;
  place-items: center;
  width: 96px;
  height: 96px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--amber-soft);
  color: var(--prune-900);
}

.church-logo-tile svg {
  width: 30px;
  height: 30px;
}

.church-logo-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.church-logo-copy small {
  max-width: 52ch;
  color: var(--text-secondary);
  line-height: 1.45;
}

.church-logo-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

@media (max-width: 520px) {
  .church-logo-field {
    flex-direction: column;
  }
}

.church-locality,
.church-feature-time,
.church-ready {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.church-locality {
  color: var(--church-accent);
  font-size: var(--text-s);
}

.church-feature-time {
  margin-top: var(--space-1);
  font-weight: 600;
}

#church-preview-feature > .church-feature {
  animation: church-preview-in 210ms ease-out both;
}

@keyframes church-preview-in {
  from { opacity: 0.65; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.church-page .church-progress {
  align-content: center;
  gap: var(--space-3);
  background-color: var(--amber-soft);
}

.church-progress-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-3);
}

.church-progress-head p {
  margin-top: var(--space-1);
  color: var(--text-secondary);
}

.church-progress-value {
  color: var(--prune-900);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1;
}

.church-progress-value span {
  font-size: var(--text-l);
}

.church-progress .meter {
  background-color: color-mix(in oklch, var(--color-warning) 18%, transparent);
}

.church-progress .church-next {
  margin-inline: var(--space-2);
}

.church-next.list > li {
  min-height: 0;
  padding-block: 0;
}

.church-next .row-button {
  min-height: 44px;
  padding: var(--space-2);
  border-radius: var(--radius-s);
  white-space: normal;
  text-align: start;
}

.church-next .row-button svg {
  flex: none;
  width: 16px;
}

.church-progress .church-ready {
  margin-top: var(--space-2);
  color: var(--color-success);
}

.church-ready svg {
  flex: none;
  width: 20px;
}

.church-profile-head {
  display: grid;
  gap: var(--space-1);
  margin: var(--space-6) 0 var(--space-4);
}

.church-profile-head h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
}

.church-card {
  display: grid;
  grid-template-rows: auto 1fr auto auto;
  align-items: start;
  gap: var(--space-3);
  transition: border-color 180ms ease-out;
}

.church-card:hover {
  border-color: var(--primary-line);
}

.church-card-head,
.church-identity,
.church-person {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

.church-card-icon {
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-m);
  color: var(--primary);
  background-color: var(--primary-soft);
}

.church-card-icon svg {
  width: 19px;
  height: 19px;
}

.church-card-content {
  display: grid;
  align-content: start;
  gap: var(--space-2);
  color: var(--text-secondary);
}

.church-card-content strong,
.church-card-content address {
  color: var(--text-primary);
  font-weight: 600;
}

.church-prose {
  white-space: pre-wrap;
}

.church-meta {
  color: var(--text-muted);
  font-size: var(--text-s);
}

.church-channels,
.church-language-list,
.church-contact {
  margin: 0;
  padding: 0;
  list-style: none;
}

.church-channels {
  gap: var(--space-1);
}

.church-channels .chip {
  gap: var(--space-1);
  background-color: var(--bg-sunken);
  color: var(--text-secondary);
  font-size: 12px;
}

.church-channels .chip svg {
  width: 13px;
  height: 13px;
}

.church-location {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: var(--space-3);
  align-items: center;
}

.church-location address,
.church-full-preview address {
  font-style: normal;
}

.church-map {
  position: relative;
  isolation: isolate;
  display: grid;
  place-items: center;
  min-height: 84px;
  overflow: hidden;
  border-radius: var(--radius-s);
  background-color: oklch(0.91 0.03 125);
}

.church-map::before,
.church-map::after {
  position: absolute;
  z-index: -1;
  width: 116px;
  height: 44px;
  border-block: 8px solid var(--bg-surface);
  content: "";
  transform: rotate(-27deg);
}

.church-map::after {
  transform: rotate(63deg);
}

.church-map span {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  color: var(--on-primary);
  background-color: var(--primary);
}

.church-map svg {
  width: 18px;
  height: 18px;
}

.church-person {
  align-items: flex-start;
}

.church-person > div,
.church-gathering {
  display: grid;
  gap: var(--space-1);
}

.church-team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 74px), 1fr));
  gap: var(--space-3) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

.church-team-grid .church-person {
  display: grid;
  justify-items: start;
  gap: var(--space-1);
  font-size: var(--text-s);
  text-wrap: balance;
}

.church-portrait {
  display: grid;
  flex: none;
  place-items: center;
  width: 48px;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius-s);
  background: var(--bg-sunken);
}

.church-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 35%;
}

.church-portrait img[hidden],
.church-portrait:has(img:not([hidden])) .avatar {
  display: none;
}

.church-team-grid .church-portrait {
  width: 60px;
  max-width: 100%;
}

.church-contact {
  display: grid;
  gap: var(--space-1);
}

.church-contact li {
  display: flex;
  align-items: baseline;
  gap: var(--space-2);
}

.church-contact li svg {
  align-self: center;
}

.church-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-1);
}

.church-strip img,
.church-gallery img,
.church-edit-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-s);
}

.church-strip img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.church-dialog {
  overflow-wrap: anywhere;
}

.church-dialog .modal-foot {
  flex-wrap: wrap;
}

.church-dialog .church-form :is(.field, fieldset),
.church-dialog .church-entry-actions {
  min-width: 0;
}

.church-counter {
  align-self: end;
  font-variant-numeric: tabular-nums;
}

.church-checks {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.church-checks .check {
  min-height: 44px;
}

.church-entries.list > .church-entry {
  display: grid;
  gap: var(--space-3);
  padding: var(--space-4) 0;
}

.church-entry-copy {
  display: grid;
  align-content: start;
  justify-items: start;
  gap: var(--space-1);
}

.church-gallery {
  display: grid;
  gap: var(--space-4);
}

.church-gallery > figure {
  margin: 0;
}

.church-gallery figcaption {
  margin-top: var(--space-2);
}

.church-gallery .row-button {
  display: grid;
  width: 100%;
  gap: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-m);
  text-align: start;
}

.church-gallery.church-entries.list > .church-entry {
  grid-template-rows: auto 1fr auto;
  padding: var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.church-edit-image img {
  max-height: 240px;
  object-fit: contain;
}

.church-people-results {
  margin-top: var(--space-3);
}

.church-people-results .row-button {
  min-height: 44px;
}

.church-full-preview {
  display: grid;
  gap: var(--space-5);
}

.church-full-preview section {
  display: grid;
  gap: var(--space-2);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}

.church-full-preview section > h3 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
}

.church-full-preview .list > li {
  padding: var(--space-2) 0;
}

.church-full-preview .list > .church-gathering {
  display: grid;
}

.church-full-preview summary {
  min-height: 44px;
  padding-block: var(--space-2);
  color: var(--primary);
  cursor: pointer;
}

:is(.church-page, .church-dialog) :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 3px;
}

@container (min-width: 460px) {
  .church-preview .church-feature-illustrated {
    grid-template-columns: minmax(0, 1fr) minmax(0, 0.9fr);
  }

  .church-preview .church-feature-copy {
    padding: var(--space-5);
  }

  .church-preview .church-feature-image {
    grid-row: auto;
    padding: var(--space-3) var(--space-3) var(--space-3) 0;
  }

  .church-preview .church-feature-image img {
    border-radius: var(--radius-s);
  }

  .church-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .church-grid > :last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }
}

@container (min-width: 810px) {
  /* L'avancement tient sur une ligne au-dessus de l'aperçu : pas de colonne haute à moitié vide. */
  .church-page .church-progress {
    grid-template-columns: minmax(0, auto) minmax(160px, 1fr) minmax(0, auto);
    align-items: center;
    column-gap: var(--space-6);
  }

  .church-progress-head {
    gap: var(--space-2) var(--space-6);
  }

  .church-progress :is(.church-next, .church-ready) {
    margin: 0;
  }

  .church-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .church-grid > :last-child:nth-child(odd) {
    grid-column: auto;
  }

  .church-page :is(.church-preview, .church-progress, .church-card) {
    padding: var(--space-5);
  }
}

@media (min-width: 600px) {
  .church-dialog .church-feature-image {
    grid-row: auto;
    padding: var(--space-3) var(--space-3) var(--space-3) 0;
  }

  .church-dialog .church-feature-image img {
    border-radius: var(--radius-s);
  }

  .church-dialog .church-feature-illustrated,
  .church-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .church-dialog .church-form {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (prefers-reduced-motion: reduce) {
  #church-preview-feature > .church-feature {
    animation: none;
  }

  .church-card,
  .church-filters .filter {
    transition: none;
  }
}
