:root {
  --bg: #f6f4f0;
  --surface: #fff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --accent: #2c5f4d;
  --accent-2: #b8860b;
  --border: #e0dcd4;
  --radius: 10px;
  --font: "Source Serif 4", "Georgia", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--text);
  background: var(--bg);
  line-height: 1.5;
}

a {
  color: var(--accent);
}

.wrap {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.25rem;
}

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.25rem;
}

.brand {
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  letter-spacing: 0.02em;
}

.nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.nav a {
  text-decoration: none;
  font-size: 0.95rem;
}

.nav a:hover {
  text-decoration: underline;
}

.nav-link--paroisse {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.nav-link__label {
  white-space: nowrap;
}

.nav-icon--croix {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--accent-2);
  opacity: 0.95;
}

.nav-link--paroisse:hover .nav-icon--croix {
  color: var(--accent);
  opacity: 1;
}

#espace-paroisse {
  scroll-margin-top: 1rem;
}

.site-main {
  padding: 2rem 0 3rem;
}

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 1.5rem 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.hero h1 {
  font-family: var(--font);
  font-size: 2rem;
  margin: 0 0 0.5rem;
}

.lead {
  font-size: 1.1rem;
  color: var(--muted);
  max-width: 52ch;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1rem;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
  margin-top: 2rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.card h2 {
  font-family: var(--font);
  margin-top: 0;
  font-size: 1.25rem;
}

.btn {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

.btn.ghost {
  background: transparent;
}

.btn:hover {
  filter: brightness(0.97);
}

.muted {
  color: var(--muted);
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: flex-end;
  margin-bottom: 1.5rem;
}

.filters label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.filters input,
.filters select {
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  min-width: 180px;
}

.catalogue-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.catalogue-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
}

.catalogue-item__meta {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 0.35rem;
}

.badge {
  display: inline-block;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
  background: #e8f0ec;
  color: var(--accent);
}

.lit-bloc--evangile .badge {
  background: #fdebd1;
  color: #8a4b08;
}

.lit-bloc--chant .badge {
  background: #e8eef8;
  color: #1e3a5f;
}

.catalogue-item__title {
  font-family: var(--font);
  font-size: 1.2rem;
  margin: 0.25rem 0;
}

.catalogue-item__ref {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.catalogue-item__text {
  margin-top: 0.5rem;
  font-family: var(--font);
  font-size: 0.98rem;
}

.catalogue-item__preview {
  max-height: 8.5rem;
  overflow: hidden;
  position: relative;
}

.catalogue-item__preview::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.2rem;
  background: linear-gradient(to bottom, rgba(255, 255, 255, 0), var(--surface));
  pointer-events: none;
}

.lecture-open-btn {
  margin-top: 0.65rem;
}

.messe-list {
  padding-left: 1.2rem;
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.table th,
.table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.table thead {
  background: #faf8f5;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  max-width: 420px;
}

.stack input {
  padding: 0.45rem 0.55rem;
  border-radius: 6px;
  border: 1px solid var(--border);
}

.alert.error {
  background: #fdecea;
  border: 1px solid #f5c2c0;
  padding: 0.6rem 0.75rem;
  border-radius: 8px;
}

.inline-form {
  display: inline;
}

.feuille-list {
  list-style: none;
  padding: 0;
}

.feuille-list li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
}

.small {
  font-size: 0.85rem;
  margin-left: 0.5rem;
}

.lignes-fieldset {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  background: var(--surface);
}

.help {
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0;
}

.ligne-row {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 0.75rem;
  align-items: start;
  margin-bottom: 0.75rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px dashed var(--border);
}

@media (max-width: 720px) {
  .ligne-row {
    grid-template-columns: 1fr;
  }
}

.ligne-row label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.9rem;
}

.ligne-row select,
.ligne-row textarea {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-family: inherit;
}

/* —— Thèmes liturgiques (couleur du jour, données AELF en cache) —— */
body.liturgie-theme--defaut {
  --bg: #f6f4f0;
  --surface: #fff;
  --text: #1a1a1a;
  --muted: #5c5c5c;
  --accent: #2c5f4d;
  --accent-2: #b8860b;
  --border: #e0dcd4;
}

body.liturgie-theme--violet {
  --bg: #f2eff7;
  --surface: #faf8fd;
  --text: #1e1828;
  --muted: #5a5268;
  --accent: #5c4682;
  --accent-2: #7d6b94;
  --border: #dcd4e8;
}

body.liturgie-theme--rouge {
  --bg: #f9f0f0;
  --surface: #fff8f8;
  --text: #241418;
  --muted: #6b4548;
  --accent: #9b2335;
  --accent-2: #c45c4a;
  --border: #e8d4d4;
}

body.liturgie-theme--vert {
  --bg: #f0f5f1;
  --surface: #fafcf9;
  --text: #152018;
  --muted: #4a5c50;
  --accent: #2d6a4f;
  --accent-2: #40916c;
  --border: #d4e0d6;
}

body.liturgie-theme--blanc {
  --bg: #fbf9f3;
  --surface: #fffef9;
  --text: #1c1a16;
  --muted: #6a6358;
  --accent: #8a7030;
  --accent-2: #c4a35a;
  --border: #e8e2d4;
}

body.liturgie-theme--rose {
  --bg: #faf5f8;
  --surface: #fffafc;
  --text: #221820;
  --muted: #6b5560;
  --accent: #a8557a;
  --accent-2: #c9a0b8;
  --border: #ead4dc;
}

body.liturgie-theme--noir {
  --bg: #ebebed;
  --surface: #f5f5f6;
  --text: #1a1a1c;
  --muted: #5a5a5e;
  --accent: #3d3d42;
  --accent-2: #6b6b72;
  --border: #d4d4d8;
}

body.liturgie-theme--or {
  --bg: #f9f6f0;
  --surface: #fffdf7;
  --text: #1f1c14;
  --muted: #6b6350;
  --accent: #9a7209;
  --accent-2: #c9a227;
  --border: #e8dfc8;
}

body[class*="liturgie-theme--"] .site-header {
  border-bottom: 2px solid var(--accent);
}

body[class*="liturgie-theme--"] .site-header .brand {
  color: var(--accent);
}

.liturgie-footer-note {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  max-width: 65ch;
}

.liturgie-footer-note__couleur {
  font-style: italic;
}

.source-note {
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
}

.aelf-infos__l2 {
  margin: 0.25rem 0 0;
  font-size: 1.05rem;
}

.aelf-meta {
  margin: 0.75rem 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.section-title {
  font-family: var(--font);
  font-size: 1.35rem;
  margin: 2rem 0 1rem;
}

.aelf-html {
  font-family: var(--font);
  font-size: 0.98rem;
}

.aelf-html p {
  margin: 0.5rem 0;
}

.droits {
  margin-top: 2rem;
  font-size: 0.85rem;
}

.parties-vue-intro {
  margin-bottom: 1rem;
  max-width: 70ch;
}

.badge--aelf-inline {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  border-radius: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  background: color-mix(in srgb, var(--accent) 18%, transparent);
  color: var(--accent);
}

.messe-parties {
  margin-bottom: 1.5rem;
  padding: 1rem 1.25rem;
}

.messe-parties__titre {
  font-family: var(--font);
  font-size: 1.1rem;
  margin: 0 0 0.75rem;
  color: var(--text);
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.parties-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.parties-table th,
.parties-table td {
  padding: 0.5rem 0.65rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.parties-table th {
  font-weight: 600;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.parties-table__partie {
  white-space: nowrap;
  font-weight: 500;
  color: var(--text);
}

.parties-table__row--completer .parties-table__partie {
  color: var(--muted);
}

.parties-table__apercu {
  line-height: 1.45;
  max-width: 42rem;
}

.badge--aelf {
  background: color-mix(in srgb, var(--accent) 20%, transparent);
  color: var(--accent);
}

.badge--completer {
  background: color-mix(in srgb, var(--muted) 22%, transparent);
  color: var(--muted);
}

.parties-vue-vide {
  margin: 1rem 0 1.5rem;
  max-width: 55ch;
}

.connexion-search {
  align-items: flex-end;
  flex-wrap: wrap;
}

.connexion-search__field {
  flex: 1 1 16rem;
  min-width: 12rem;
}

.connexion-hint {
  margin: 0.5rem 0 1.25rem;
  font-size: 0.88rem;
}

.connexion-card {
  max-width: 40rem;
}

.connexion-form select[required] {
  width: 100%;
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 0.35rem 0.5rem;
}

.connexion-form__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.api-doc-footer {
  margin: 1.5rem 0 0;
  font-size: 0.85rem;
}

.referentiel-card {
  margin: 2rem 0 1.5rem;
  padding: 1.25rem;
}

.referentiel-card__title {
  font-family: var(--font);
  font-size: 1.2rem;
  margin: 0 0 0.5rem;
}

.referentiel-card__intro {
  margin: 0 0 1rem;
  max-width: 65ch;
  line-height: 1.45;
}

.referentiel-form {
  flex-wrap: wrap;
  align-items: flex-end;
}

.referentiel-form label {
  flex: 1 1 12rem;
}

.referentiel-out {
  margin-top: 1rem;
}

.openchurch-results {
  margin: 0.5rem 0 0;
  padding-left: 1.25rem;
  line-height: 1.5;
}

.openchurch-results li {
  margin: 0.35rem 0;
}

.openchurch-note {
  margin: 0 0 0.75rem;
  font-size: 0.88rem;
}

.bible-counts {
  margin: 0 0 1rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  align-items: center;
}

.bible-counts__item {
  font-size: 0.92rem;
  color: var(--muted);
}

.bible-verses h2 {
  margin-top: 0;
}

.bible-verses__list {
  column-gap: 1rem;
}

.bible-verse {
  margin: 0.45rem 0;
  font-family: var(--font);
}

.bible-verse__num {
  display: inline-block;
  min-width: 2.1rem;
  color: var(--accent);
  font-weight: 600;
}

.lecture-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

.lecture-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(17, 20, 24, 0.58);
}

.lecture-modal__dialog {
  position: relative;
  margin: 4vh auto;
  width: min(92vw, 980px);
  max-height: 92vh;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  overflow: hidden;
}

.lecture-modal__content {
  padding: 1.25rem 1.35rem 1.5rem;
  overflow-y: auto;
  max-height: calc(92vh - 2rem);
}

.lecture-modal__close {
  position: absolute;
  top: 0.5rem;
  right: 0.55rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 1.95rem;
  line-height: 1;
  cursor: pointer;
  padding: 0.1rem 0.35rem;
}

.lecture-modal__close:hover {
  color: var(--text);
}

body.modal-open {
  overflow: hidden;
}
