:root {
  --background: #f7f2ec;
  --surface: #fffaf4;
  --surface-strong: #ffffff;
  --text: #2f2a2a;
  --muted: #6d625d;
  --red: #a9443f;
  --red-dark: #84342f;
  --gold: #d5a75f;
  --line: #e4d8ce;
  --shadow: 0 22px 60px rgba(47, 42, 42, 0.14);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--background);
  line-height: 1.65;
}

a {
  color: inherit;
}

.hero {
  min-height: 78vh;
  background:
    linear-gradient(110deg, rgba(45, 35, 32, 0.86), rgba(132, 52, 47, 0.58)),
    url("assets/eglise-ennevelin.jpg");
  background-size: cover;
  background-position: center;
  color: white;
  padding: 22px;
}

.nav {
  max-width: 1160px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: white;
  text-decoration: none;
  font-weight: 700;
  letter-spacing: 0.2px;
}

.brand img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
  object-fit: cover;
  background: white;
  padding: 4px;
}

.nav-links {
  display: flex;
  gap: 18px;
  font-size: 0.95rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.nav-links a:hover {
  color: white;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.hero-content {
  max-width: 1060px;
  margin: 120px auto 70px;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--gold);
  margin: 0 0 14px;
}

.hero h1 {
  max-width: 900px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 1.02;
  margin: 0 0 24px;
}

.intro {
  max-width: 720px;
  font-size: 1.22rem;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 32px;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.button {
  display: inline-block;
  background: var(--gold);
  color: #281f1d;
  padding: 13px 21px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
  box-shadow: var(--shadow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button:hover {
  transform: translateY(-1px);
  box-shadow: 0 26px 65px rgba(47, 42, 42, 0.2);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.36);
  box-shadow: none;
}

.section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 86px 24px;
}

.section h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.85rem, 3.2vw, 3rem);
  line-height: 1.14;
  margin: 0 0 22px;
}

.mission {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 44px;
  align-items: center;
}

.section-text {
  max-width: 710px;
}

.highlight-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 26px;
  box-shadow: var(--shadow);
  text-align: center;
}

.highlight-card img {
  width: min(100%, 360px);
  height: auto;
  display: block;
  margin: 0 auto;
  border-radius: 18px;
}

.actions {
  padding-top: 35px;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 34px;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.card,
.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 28px;
  box-shadow: var(--shadow);
}

.card-number {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(169, 68, 63, 0.1);
  color: var(--red-dark);
  font-weight: 800;
  margin-bottom: 12px;
}

.card h3 {
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.card p {
  margin-bottom: 0;
  color: var(--muted);
}

.photo-section {
  max-width: 1160px;
  margin: 0 auto;
  padding: 0 24px 20px;
}

.photo-section img {
  width: 100%;
  max-height: 560px;
  object-fit: cover;
  border-radius: 32px;
  box-shadow: var(--shadow);
  display: block;
}

/* Film consacré à l’histoire de l’église */
.video-section {
  text-align: center;
}

.video-heading {
  max-width: 780px;
  margin: 0 auto 34px;
}

.video-intro {
  max-width: 720px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.05rem;
}

.video-wrapper {
  position: relative;
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
}

.video-wrapper iframe {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

.event-section {
  padding-top: 36px;
}

.event-card {
  max-width: 780px;
  margin: 0 auto;
  text-align: center;
}

.date {
  display: inline-block;
  padding: 7px 15px;
  border-radius: 999px;
  background: rgba(169, 68, 63, 0.11);
  color: var(--red-dark);
  font-weight: 800;
}

.contact {
  text-align: center;
  padding-top: 64px;
}

.contact > div {
  max-width: 760px;
  margin: 0 auto;
}

.mail {
  font-size: clamp(1.1rem, 3vw, 1.6rem);
  color: var(--red-dark);
  font-weight: 800;
  word-break: break-word;
}

.mail span {
  padding: 0 0.1em;
}

.small-note {
  color: var(--muted);
  font-size: 0.95rem;
}

footer {
  border-top: 1px solid var(--line);
  padding: 24px;
  text-align: center;
  color: var(--muted);
}

@media (max-width: 950px) {
  .mission,
  .cards-grid {
    grid-template-columns: 1fr 1fr;
  }

  .highlight-card {
    order: -1;
  }
}

@media (max-width: 720px) {
  .hero {
    min-height: auto;
  }

  .nav {
    align-items: flex-start;
    flex-direction: column;
  }

  .nav-links {
    justify-content: flex-start;
    gap: 12px 16px;
  }

  .hero-content {
    margin: 76px auto 54px;
  }

  .section {
    padding: 60px 20px;
  }

  .mission,
  .cards-grid {
    grid-template-columns: 1fr;
  }

  .photo-section {
    padding: 0 20px 10px;
  }

  .photo-section img {
    border-radius: 24px;
  }

  .video-wrapper {
    border-radius: 20px;
  }
}

/* Page de contact : styles ajoutés sans modifier les styles existants */
.contact-page-header {
  background:
    linear-gradient(110deg, rgba(45, 35, 32, 0.9), rgba(132, 52, 47, 0.65)),
    url("assets/eglise-ennevelin.jpg");
  background-size: cover;
  background-position: center;
  color: white;
  padding: 22px;
}

.contact-page-title {
  max-width: 900px;
  margin: 70px auto 54px;
  text-align: center;
}

.contact-page-title h1 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 4rem);
  line-height: 1.08;
  margin: 0 0 18px;
}

.contact-page-title p:last-child {
  max-width: 690px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.1rem;
}

.contact-form-section {
  max-width: 820px;
}

.contact-form-card {
  background: var(--surface-strong);
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: clamp(24px, 5vw, 46px);
  box-shadow: var(--shadow);
}

.contact-form {
  display: grid;
  gap: 20px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.form-field {
  display: grid;
  gap: 7px;
}

.form-field label {
  font-weight: 800;
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  border: 1px solid #cfc1b7;
  border-radius: 12px;
  padding: 12px 14px;
  background: white;
  color: var(--text);
  font: inherit;
}

.form-field textarea {
  min-height: 180px;
  resize: vertical;
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: 3px solid rgba(213, 167, 95, 0.35);
  border-color: var(--gold);
}

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

.form-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.form-button {
  border: 0;
  cursor: pointer;
  font: inherit;
}

.form-button:disabled {
  opacity: 0.65;
  cursor: wait;
}

.form-alert {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 24px;
  font-weight: 700;
}

.form-alert.success {
  background: #e8f5eb;
  border: 1px solid #9dc7a5;
  color: #245c30;
}

.form-alert.error {
  background: #fff0ee;
  border: 1px solid #d9aaa5;
  color: #7b2924;
}

.form-errors {
  margin: 8px 0 0;
  padding-left: 22px;
}

.hp-field {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

.back-link {
  display: inline-block;
  margin-top: 24px;
  color: var(--red-dark);
  font-weight: 800;
}

/* Page d’article */
.article-page-header {
  background:
    linear-gradient(110deg, rgba(45, 35, 32, 0.9), rgba(132, 52, 47, 0.66)),
    url("assets/eglise-ennevelin.jpg");
  background-size: cover;
  background-position: center;
  color: white;
  padding: 22px;
}

.article-page-title {
  max-width: 940px;
  margin: 88px auto 70px;
  text-align: center;
}

.article-page-title h1 {
  margin: 0 0 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.25rem, 5vw, 4.5rem);
  line-height: 1.05;
}

.article-page-title > p:not(.eyebrow) {
  max-width: 720px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.12rem;
}

.article-back-link {
  display: inline-block;
  margin-top: 26px;
  color: white;
  font-weight: 800;
  text-underline-offset: 4px;
}

.nav-links a[aria-current="page"] {
  color: white;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}

/* Aperçu de l’article sur la page d’accueil */
.event-teaser {
  padding-top: 42px;
}

.event-teaser-card {
  display: grid;
  grid-template-columns: 1.12fr 0.88fr;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.event-teaser-card > img {
  width: 100%;
  height: 100%;
  min-height: 430px;
  object-fit: cover;
}

.event-teaser-content {
  align-self: center;
  padding: clamp(30px, 5vw, 58px);
}

.event-teaser-content h2 {
  margin-bottom: 18px;
}

.event-teaser-content .date {
  margin: 0 0 18px;
}

.event-teaser-content > p:not(.eyebrow):not(.date) {
  margin: 0 0 28px;
  color: var(--muted);
}

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

  .contact-page-title {
    margin: 48px auto 38px;
  }

  .article-page-title {
    margin: 58px auto 42px;
  }

  .event-teaser-card {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .event-teaser-card > img {
    min-height: 0;
    aspect-ratio: 4 / 3;
  }
}

/* Retour sur les Journées européennes du patrimoine */
.event-story {
  padding-top: 50px;
}

.event-story-header {
  max-width: 820px;
  margin: 0 auto 42px;
  text-align: center;
}

.event-story-header .date {
  margin: 0 0 22px;
}

.event-lead {
  max-width: 760px;
  margin: 0 auto;
  color: var(--muted);
  font-size: 1.1rem;
}

.story-hero,
.story-chapter figure {
  margin: 0;
}

.story-hero {
  margin-bottom: 74px;
}

.story-hero img {
  aspect-ratio: 16 / 8.5;
}

.photo-link {
  display: block;
  width: 100%;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 28px;
  background: #ddd;
  box-shadow: var(--shadow);
  cursor: zoom-in;
}

.photo-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.photo-link:hover img {
  transform: scale(1.018);
}

.photo-link:focus-visible {
  outline: 4px solid var(--gold);
  outline-offset: 4px;
}

.story-hero figcaption,
.story-chapter figcaption {
  margin-top: 11px;
  color: var(--muted);
  font-size: 0.9rem;
  text-align: center;
}

.story-chapter {
  margin: 0 0 84px;
}

.story-chapter-soft {
  padding: clamp(28px, 5vw, 54px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--surface);
}

.story-copy {
  max-width: 760px;
  margin: 0 auto 34px;
}

.story-copy-wide {
  max-width: 840px;
  text-align: center;
}

.story-kicker {
  margin: 0 0 8px;
  color: var(--red-dark);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.story-copy h3,
.event-thanks h3 {
  margin: 0 0 16px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.65rem, 3vw, 2.45rem);
  line-height: 1.15;
}

.story-copy p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.04rem;
}

.story-photo-pair {
  display: grid;
  grid-template-columns: 1.45fr 0.8fr;
  gap: 22px;
  align-items: stretch;
}

.story-photo-pair figure,
.story-photo-pair .photo-link {
  min-height: 100%;
}

.story-photo-pair img {
  aspect-ratio: 4 / 3;
}

.story-photo-pair .portrait-photo img {
  aspect-ratio: 3 / 4;
}

.story-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.story-gallery .gallery-wide {
  grid-column: 1 / -1;
}

.story-gallery .gallery-wide img {
  aspect-ratio: 16 / 8;
}

.story-gallery figure:not(.gallery-wide) img {
  aspect-ratio: 4 / 3;
}

.story-gallery-music figure:last-child img {
  object-position: center 36%;
}

.celebration-pair {
  grid-template-columns: 1.5fr 0.72fr;
}

.convivial-gallery img {
  aspect-ratio: 3 / 4 !important;
}

.event-thanks {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 50px);
  border-radius: 28px;
  background: var(--red-dark);
  color: white;
  text-align: center;
  box-shadow: var(--shadow);
}

.event-thanks .eyebrow {
  color: var(--gold);
}

.event-thanks p:last-child {
  max-width: 680px;
  margin: 0 auto;
  color: rgba(255, 255, 255, 0.86);
}

.photo-modal {
  width: min(94vw, 1180px);
  max-height: 92vh;
  padding: 16px;
  overflow: visible;
  border: 0;
  border-radius: 22px;
  background: #171414;
  color: white;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.45);
}

.photo-modal::backdrop {
  background: rgba(18, 13, 12, 0.82);
  backdrop-filter: blur(4px);
}

.photo-modal img {
  display: block;
  width: 100%;
  max-height: calc(92vh - 86px);
  object-fit: contain;
  border-radius: 13px;
}

.photo-modal p {
  margin: 12px 44px 0 4px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 0.92rem;
}

.photo-modal-close {
  position: absolute;
  z-index: 2;
  top: -13px;
  right: -13px;
  width: 42px;
  height: 42px;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 50%;
  background: var(--red-dark);
  color: white;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

@media (max-width: 800px) {
  .story-photo-pair,
  .celebration-pair {
    grid-template-columns: 1fr;
  }

  .story-photo-pair .portrait-photo {
    width: min(100%, 540px);
    margin: 0 auto;
  }

  .story-gallery {
    grid-template-columns: 1fr 1fr;
  }

  .story-gallery-music figure:last-child {
    grid-column: 1 / -1;
    width: min(100%, 540px);
    margin: 0 auto;
  }

  .convivial-gallery figure:last-child {
    grid-column: 1 / -1;
    width: min(100%, 540px);
    margin: 0 auto;
  }
}

@media (max-width: 600px) {
  .event-story {
    padding-top: 34px;
  }

  .story-hero,
  .story-chapter {
    margin-bottom: 58px;
  }

  .story-hero img {
    aspect-ratio: 4 / 3;
  }

  .photo-link {
    border-radius: 19px;
  }

  .story-chapter-soft {
    padding: 24px 16px;
    border-radius: 24px;
  }

  .story-gallery {
    grid-template-columns: 1fr;
  }

  .story-gallery .gallery-wide,
  .story-gallery-music figure:last-child,
  .convivial-gallery figure:last-child {
    grid-column: auto;
    width: 100%;
  }

  .story-gallery .gallery-wide img,
  .story-gallery figure:not(.gallery-wide) img {
    aspect-ratio: 4 / 3;
  }

  .convivial-gallery img {
    aspect-ratio: 3 / 4 !important;
  }

  .photo-modal {
    width: 96vw;
    padding: 10px;
    border-radius: 16px;
  }

  .photo-modal-close {
    top: -10px;
    right: -6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .photo-link img {
    transition: none;
  }
}
@media (max-width: 800px) {
  .story-photo-pair figure,
  .story-photo-pair .photo-link {
    min-height: 0;
  }

  .story-photo-pair .photo-link {
    height: auto;
  }

  .story-photo-pair .photo-link img,
  .story-photo-pair .portrait-photo img {
    height: auto;
    aspect-ratio: auto;
    object-fit: contain;
  }
}
