/* Écran « Cultes et équipes ». */

.service-page h1,
.service-page h2 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
}

.service-heading {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  padding: clamp(16px, 3vw, 32px);
  border-radius: var(--radius-l);
  background: var(--prune-900);
  color: var(--on-primary);
}

.service-intro {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
}

.service-intro .date-tile {
  background: var(--amber);
  color: var(--prune-950);
}

.service-intro h1 {
  font-size: clamp(1.65rem, 3.6vw, 2.75rem);
  line-height: 1.12;
}

.service-location {
  color: var(--on-dark-muted);
}

.service-readiness {
  font-size: var(--text-l);
  text-wrap: pretty;
}

.service-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.service-actions .button {
  min-height: 44px;
}

.service-actions .button:first-child {
  border-color: var(--amber);
  background: var(--amber);
  color: var(--prune-950);
}

.service-actions .button:first-child:hover {
  background: var(--amber-soft);
}

.service-actions .button.secondary {
  border-color: var(--on-dark-muted);
  background: transparent;
  color: var(--on-primary);
}

.service-actions .button.secondary:hover {
  background: var(--prune-800);
}

.service-actions .button:focus-visible {
  outline-color: var(--amber);
}

.service-layout,
.service-people {
  display: grid;
  align-content: start;
  align-items: start;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-4);
}

.service-card {
  min-width: 0;
  padding: clamp(16px, 2vw, 24px);
}

.service-card h2 {
  margin-bottom: var(--space-3);
  font-size: var(--text-xl);
}

.service-card ul,
.service-card ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.service-issue {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  column-gap: var(--space-2);
  padding: var(--space-3) 0 var(--space-1);
  border-top: 1px solid var(--border);
}

.service-issue-copy {
  display: grid;
  overflow-wrap: anywhere;
}

.service-issue-copy > span,
.service-team-count,
.service-roster li > :last-child {
  color: var(--text-secondary);
  font-size: var(--text-s);
}

.service-issue .chip {
  align-self: start;
}

.service-issue-action.button {
  grid-column: 1 / -1;
  justify-self: start;
  gap: var(--space-1);
  min-height: 44px;
  max-width: 100%;
  margin-inline-start: calc(-1 * var(--space-2));
  padding-inline: var(--space-2);
  white-space: normal;
}

.service-issue-action .icon,
.service-edit-label .icon {
  width: 16px;
  height: 16px;
  flex: none;
}

.service-ready {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--color-success);
}

.service-ministry + .service-ministry {
  border-top: 1px solid var(--border);
}

.service-ministry summary,
.service-detail summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 44px;
  list-style: none;
  cursor: pointer;
}

.service-ministry summary::-webkit-details-marker,
.service-detail summary::-webkit-details-marker {
  display: none;
}

.service-ministry summary > strong {
  margin-inline-end: auto;
}

.service-chevron {
  display: inline-flex;
  flex: none;
  color: var(--primary);
}

.service-chevron .icon {
  width: 15px;
  height: 15px;
}

.service-card details[open] > summary .service-chevron {
  transform: rotate(180deg);
}

.service-roster li,
.service-songs a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 var(--space-2);
  padding: var(--space-2) 0;
}

.service-roster li {
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

.service-program h2 {
  margin-bottom: 0;
  scroll-margin-top: 88px;
}

.service-program-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding-bottom: var(--space-1);
}

.service-program-head .button {
  min-height: 44px;
}

.service-entry {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
}

.service-entry::before {
  content: "";
  grid-column: 2;
  grid-row: 1;
  height: 1px;
  background: var(--border);
}

.service-moment {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 0 var(--space-1);
}

.service-moment-edit {
  display: grid;
  grid-template-columns: minmax(3.6rem, auto) minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--space-2);
  min-height: 48px;
  width: 100%;
  padding: var(--space-2);
  border: 0;
  border-radius: var(--radius-s);
  background: var(--bg-sunken);
  color: var(--text-primary);
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.service-moment-edit:is(:hover, :focus-visible) {
  background: var(--primary-soft);
}

.service-moment-edit strong,
.service-moment-edit small {
  display: block;
  overflow-wrap: anywhere;
}

.service-moment-copy strong {
  text-wrap: pretty;
}

.service-moment-edit small {
  font-size: var(--text-s);
  font-weight: 400;
  color: var(--text-secondary);
}

.service-time {
  color: var(--primary);
}

.service-time strong {
  white-space: nowrap;
}

.service-edit-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  color: var(--primary);
  font-size: var(--text-s);
}

.service-edit-label > span {
  display: none;
}

.service-moves {
  display: flex;
}

.service-moves .icon-button {
  width: 44px;
  height: 44px;
  border-color: transparent;
  background: transparent;
}

.service-moves .icon {
  width: 16px;
  height: 16px;
}

.service-detail {
  grid-column: 1 / -1;
  margin-inline-start: calc(3.6rem + var(--space-4));
  font-size: var(--text-s);
}

.service-detail summary {
  color: var(--primary);
  font-weight: 600;
}

.service-songs a {
  align-items: center;
  min-height: 44px;
  border-top: 1px solid var(--border);
  color: var(--primary);
  text-decoration: none;
}

.service-songs a > :first-child {
  flex: 1;
  min-width: 0;
  overflow-wrap: anywhere;
}

.service-songs a:hover > :first-child {
  text-decoration: underline;
}

.service-songs .icon {
  width: 15px;
}

.service-detail blockquote {
  margin: 0;
  padding: var(--space-3);
  border-radius: var(--radius-s);
  background: var(--bg-sunken);
}

.service-detail .service-announcements { white-space: pre-line; }

.service-detail cite {
  display: block;
  margin-top: var(--space-2);
  color: var(--text-secondary);
}

.service-insert {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 44px;
  min-height: 32px;
  justify-content: center;
  padding-inline: var(--space-2);
  border: 0;
  border-radius: var(--radius-s);
  background: transparent;
  color: var(--primary);
  font: 600 var(--text-s)/1.3 var(--font-sans);
  cursor: pointer;
}

.service-entry > .service-insert {
  grid-column: 1;
  grid-row: 1;
}

.service-insert .icon {
  width: 15px;
  height: 15px;
}

.service-insert:hover {
  background: var(--primary-soft);
}

.service-insert-end {
  min-height: 44px;
  margin-top: var(--space-2);
}

@media (min-width: 900px) {
  .service-actions .service-jump {
    display: none;
  }

  .service-layout {
    grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  }
}

@media (min-width: 1100px) {
  .service-heading {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .service-intro {
    grid-column: 1 / -1;
  }
}

@media (max-width: 550px) {
  .service-moment-edit {
    grid-template-columns: minmax(3.2rem, auto) minmax(0, 1fr);
    gap: var(--space-1) var(--space-2);
  }

  .service-edit-label {
    grid-column: 2;
  }

  .service-edit-label > span {
    display: inline;
  }

  .service-moves {
    flex-direction: column;
  }

  .service-detail {
    margin-inline-start: calc(3.2rem + var(--space-4));
  }
}

@media (min-width: 551px) {
  .service-edit-label > span {
    display: inline;
    opacity: 0;
  }

  .service-moment-edit:is(:hover, :focus) .service-edit-label > span {
    opacity: 1;
  }
}

@media (hover: none) {
  .service-edit-label > span {
    opacity: 1;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .service-edit-label > span {
    transition: opacity 150ms ease-out;
  }

  .service-chevron {
    transition: transform 150ms ease-out;
  }
}

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

@media print {
  body:has(dialog[open] .doc-runsheet) > :not(dialog) {
    display: none;
  }

  dialog.modal[open]:has(.doc-runsheet) {
    position: absolute;
    inset: 0 auto auto 0;
    display: block;
    width: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    border: 0;
    overflow: visible;
    animation: none;
  }

  dialog:has(.doc-runsheet) :is(.modal-head, .modal-foot) {
    display: none;
  }

  dialog:has(.doc-runsheet) :is(.modal-body, .paper-stage) {
    padding: 0;
    overflow: visible;
  }

  .a4.doc-runsheet {
    position: static;
    width: auto;
    min-height: 0;
    padding: 10mm 17mm 8mm;
  }

  .doc-runsheet .doc-notes {
    min-height: 44px;
  }

  .doc-runsheet :is(.doc-table tr, .doc-teams > section, .doc-foot) {
    break-inside: avoid;
  }
}
