/* ==========================================================================
   paroisse-trinite-en-bray-catholique.fr — Direction artistique "Craie et Silex"
   ========================================================================== */

:root {
  /* Palette "Craie et Silex" */
  --craie: #F2EFE6;
  --craie-dark: #E6E1D3;
  --silex: #1A1A1D;
  --silex-soft: #2A2A2E;
  --vert-bray: #3E4A38;
  --vert-bray-dark: #2E3729;
  --rouille: #8B4A2B;
  --rouille-dark: #723A20;
  --gris-pierre: #8C8B85;
  --blanc: #FFFFFF;

  /* Typographies */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Newsreader', Georgia, serif;
  --font-kicker: 'Fraunces', Georgia, serif;

  /* Espacement */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
  --space-xl: 6rem;

  /* Rayons / ombres */
  --radius: 4px;
  --shadow-soft: 0 4px 24px rgba(26, 26, 29, 0.08);
  --shadow-medium: 0 8px 32px rgba(26, 26, 29, 0.14);
}

/* ==========================================================================
   Reset & fondations
   ========================================================================== */

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

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--silex);
  background: var(--craie);
  overflow-x: hidden;
}

/* Anti-distorsion images — REGLE reseau obligatoire */
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  color: var(--silex);
  line-height: 1.2;
  margin: 0 0 var(--space-sm);
}

h1 { font-size: clamp(2.2rem, 4vw, 3.4rem); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 600; }
h3 { font-size: clamp(1.25rem, 2vw, 1.6rem); font-weight: 500; }

p { margin: 0 0 var(--space-sm); }

a {
  color: var(--vert-bray);
  text-decoration: underline;
  text-decoration-color: rgba(62, 74, 56, 0.35);
  text-underline-offset: 3px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}
a:hover { color: var(--vert-bray-dark); text-decoration-color: var(--vert-bray-dark); }

.kicker {
  font-family: var(--font-kicker);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--rouille);
}

.container {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ==========================================================================
   Wrappers anti-distorsion images (ratio fixe obligatoire)
   ========================================================================== */

.img-hero, .img-card, .img-portrait {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--craie-dark);
}

.img-hero { aspect-ratio: 16/9; }
.img-card { aspect-ratio: 3/2; }
.img-portrait { aspect-ratio: 1/1; border-radius: 50%; }

/* .img-body is a <figure> that also wraps <figcaption> — the ratio/overflow
   clip must stay on the image itself, not the figure, or the caption gets
   cropped out of the fixed-height box along with any overflow. */
.img-body {
  border-radius: var(--radius);
}
.img-body img {
  display: block;
  width: 100%;
  aspect-ratio: 3/2;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--craie-dark);
}

.img-hero img, .img-card img, .img-portrait img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}

.img-body img {
  object-fit: cover;
  object-position: center top;
}

.body-photo-credit {
  display: block;
  font-size: 0.75rem;
  color: var(--vert-bray);
  text-align: right;
  margin-top: 0.25rem;
  text-decoration: none;
}
.body-photo-credit:hover { text-decoration: underline; }

figcaption {
  font-family: var(--font-kicker);
  font-style: italic;
  font-size: 0.85rem;
  color: var(--vert-bray-dark);
  margin-top: 0.5rem;
  line-height: 1.5;
}

/* ==========================================================================
   Signature visuelle — damier silex/craie (appareillage mural picard)
   ========================================================================== */

.damier {
  display: flex;
  width: 100%;
  height: 14px;
  margin: var(--space-lg) 0;
  overflow: hidden;
  border-radius: 2px;
}
.damier span {
  flex: 1 1 auto;
  height: 100%;
}
.damier span:nth-child(odd) { background: var(--silex); }
.damier span:nth-child(even) { background: var(--craie-dark); }

.damier--fine {
  height: 8px;
  opacity: 0.7;
}

/* ==========================================================================
   Boutons / CTA
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75em 1.5em;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.95rem;
  border-radius: var(--radius);
  text-decoration: none;
  border: 2px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--rouille);
  color: var(--blanc);
}
.btn-primary:hover { background: var(--rouille-dark); color: var(--blanc); }

.btn-outline {
  background: transparent;
  border-color: var(--silex);
  color: var(--silex);
}
.btn-outline:hover { background: var(--silex); color: var(--craie); }

/* ==========================================================================
   Header
   ========================================================================== */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(242, 239, 230, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid rgba(26, 26, 29, 0.08);
  transition: box-shadow 0.2s ease;
}
.site-header.is-scrolled { box-shadow: var(--shadow-soft); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  max-width: 1120px;
  margin: 0 auto;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 600;
  color: var(--silex);
  text-decoration: none;
}
.site-logo svg { width: 32px; height: 32px; }

.main-nav { display: flex; gap: var(--space-md); align-items: center; }
.main-nav a {
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.95rem;
  color: var(--silex);
  text-decoration: none;
}
.main-nav a:hover { color: var(--rouille); }

.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5em;
}
.nav-toggle svg { width: 26px; height: 26px; }

/* Dropdown Patrimoine (desktop = hover/focus, mobile = statique déplié) */
.nav-dropdown { position: relative; }
.nav-dropdown__trigger {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
}
.nav-dropdown__panel {
  display: none;
  flex-direction: column;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 300px;
  background: var(--blanc);
  border-radius: var(--radius);
  box-shadow: var(--shadow-medium);
  padding: 0.5em 0;
  z-index: 50;
}
.nav-dropdown__panel a {
  padding: 0.55em 1.1em;
  font-size: 0.9rem;
  color: var(--silex);
  white-space: normal;
}
.nav-dropdown__panel a:hover { background: var(--craie); color: var(--rouille); }
.nav-dropdown:hover .nav-dropdown__panel,
.nav-dropdown:focus-within .nav-dropdown__panel { display: flex; }

@media (max-width: 860px) {
  .main-nav {
    position: fixed;
    inset: 0 0 0 auto;
    width: min(320px, 85vw);
    height: 100vh;
    background: var(--craie);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-xl) var(--space-md);
    box-shadow: var(--shadow-medium);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    overflow-y: auto;
    overflow-x: hidden;
  }
  .main-nav.is-open { transform: translateX(0); }
  .nav-toggle { display: block; }

  .nav-dropdown { width: 100%; }
  .nav-dropdown__panel {
    display: flex;
    position: static;
    box-shadow: none;
    padding: 0 0 0 1em;
    min-width: 0;
  }
  .nav-dropdown__panel a { font-size: 0.85rem; padding: 0.4em 0; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 60vh;
  color: var(--blanc);
  overflow: hidden;
}
.hero.hero--home { min-height: 86vh; align-items: center; }

.hero__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.hero__credit {
  position: absolute;
  bottom: 0.4rem;
  right: 0.6rem;
  z-index: 2;
  font-size: 0.7rem;
  color: rgba(242, 239, 230, 0.75);
  text-decoration: none;
  background: rgba(26, 26, 29, 0.4);
  padding: 0.15rem 0.5rem;
  border-radius: 0.25rem;
}
.hero__credit:hover { color: #F2EFE6; }
.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(26,26,29,0.25) 0%, rgba(26,26,29,0.6) 70%, rgba(26,26,29,0.85) 100%);
  z-index: 1;
}

.hero__content {
  position: relative;
  z-index: 2;
  max-width: 1120px;
  margin: 0 auto;
  padding: var(--space-xl) var(--space-md);
  width: 100%;
}

.hero__kicker {
  font-family: var(--font-kicker);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--craie);
  opacity: 0.85;
  margin-bottom: var(--space-xs);
  display: block;
}

.hero__title { color: var(--blanc); margin-bottom: var(--space-sm); }
.hero__subtitle { font-size: 1.15rem; max-width: 640px; opacity: 0.95; }

.breadcrumb {
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
  opacity: 0.9;
}
.breadcrumb a { color: var(--blanc); text-decoration-color: rgba(255,255,255,0.4); }
.breadcrumb a:hover { color: var(--craie); }

/* ==========================================================================
   Article body / page layout
   ========================================================================== */

.page-body {
  max-width: 760px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md);
}

.chapeau {
  font-family: var(--font-display);
  font-size: 1.3rem;
  font-weight: 400;
  font-style: italic;
  color: var(--vert-bray-dark);
  line-height: 1.5;
  margin-bottom: var(--space-md);
  padding-bottom: var(--space-md);
  border-bottom: 1px solid rgba(26,26,29,0.1);
}

.article-body a { color: var(--vert-bray-dark); font-weight: 600; text-decoration-color: var(--vert-bray); text-decoration-thickness: 1.5px; }
.article-body a:hover { color: var(--rouille); text-decoration-color: var(--rouille); }
.article-body h2 { margin-top: var(--space-lg); }
.article-body h3 { margin-top: var(--space-md); }
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: var(--space-md) 0;
  font-size: 0.95rem;
}
.article-body th, .article-body td {
  padding: 0.6em 0.8em;
  border: 1px solid rgba(26,26,29,0.15);
  text-align: left;
}
.article-body th { background: var(--craie-dark); font-family: var(--font-body); font-weight: 600; }
.article-body blockquote {
  border-left: 3px solid var(--rouille);
  padding-left: var(--space-sm);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--vert-bray-dark);
}
.article-body figure { margin: var(--space-md) 0; }
.article-body ul:not(.faq ul):not(.toc ul), .article-body ol:not(.toc ol) {
  margin: var(--space-md) 0;
  padding-left: 0;
  list-style: none;
}
.article-body ul:not(.faq ul):not(.toc ul) li {
  position: relative;
  padding-left: 1.6em;
  margin-bottom: 0.6em;
  line-height: 1.6;
}
.article-body ul:not(.faq ul):not(.toc ul) li::before {
  content: '';
  position: absolute;
  left: 0.15em;
  top: 0.55em;
  width: 8px;
  height: 8px;
  background: var(--rouille);
  border-radius: 50%;
}
.article-body ol:not(.toc ol) {
  counter-reset: article-ol;
}
.article-body ol:not(.toc ol) li {
  position: relative;
  padding-left: 1.9em;
  margin-bottom: 0.6em;
  line-height: 1.6;
  counter-increment: article-ol;
}
.article-body ol:not(.toc ol) li::before {
  content: counter(article-ol);
  position: absolute;
  left: 0;
  top: 0;
  width: 1.4em;
  height: 1.4em;
  background: var(--vert-bray);
  color: var(--blanc);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Table des matières */
.toc {
  background: var(--blanc);
  border: 1px solid rgba(26,26,29,0.1);
  border-radius: var(--radius);
  padding: var(--space-sm) var(--space-md);
  margin-bottom: var(--space-md);
}
.toc__title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5em;
}
.toc ul { list-style: none; padding: 0; margin: 0; }
.toc li { margin-bottom: 0.35em; }
.toc a { font-size: 0.92rem; text-decoration: none; }

/* ==========================================================================
   FAQ accordion
   ========================================================================== */

.faq { margin: var(--space-lg) 0; }
.faq__list { border-top: 1px solid rgba(26,26,29,0.12); }
.faq__item {
  border-bottom: 1px solid rgba(26,26,29,0.12);
}
.faq__question {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  background: none;
  border: none;
  text-align: left;
  padding: var(--space-sm) 0;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1.02rem;
  color: var(--silex);
  cursor: pointer;
}
.faq__question svg {
  flex-shrink: 0;
  margin-left: var(--space-sm);
  color: var(--rouille);
  transition: transform 0.25s ease;
}
.faq__item[aria-expanded="true"] .faq__question svg { transform: rotate(180deg); }

.faq__answer {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s ease;
}
.faq__answer p { padding-bottom: var(--space-sm); color: var(--silex); opacity: 0.9; }

/* ==========================================================================
   Cards (blog / listing)
   ========================================================================== */

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: var(--space-md);
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--blanc);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  text-decoration: none;
  color: var(--silex);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-medium); }

.card__body { padding: var(--space-sm) var(--space-md) var(--space-md); }
.card__kicker {
  font-family: var(--font-kicker);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--rouille);
  display: flex;
  align-items: center;
  gap: 0.5em;
}
.card__date { font-family: var(--font-body); font-weight: 400; opacity: 0.75; }
.card__title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin: 0.4em 0 0.3em;
  color: var(--silex);
}
.card__excerpt { font-size: 0.92rem; opacity: 0.85; margin: 0; }

.related-pages { margin: var(--space-lg) 0; }
.related-pages h2 { margin-bottom: var(--space-md); }

.category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: var(--space-lg);
}
.category-filters button {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5em 1.1em;
  border-radius: 999px;
  border: 1px solid rgba(26,26,29,0.2);
  background: var(--blanc);
  color: var(--silex);
  cursor: pointer;
  transition: all 0.2s ease;
}
.category-filters button.is-active,
.category-filters button:hover {
  background: var(--silex);
  color: var(--craie);
  border-color: var(--silex);
}

/* ==========================================================================
   Footer
   ========================================================================== */

.site-footer {
  background: var(--silex);
  color: var(--craie);
  padding: var(--space-xl) 0 var(--space-md);
  margin-top: var(--space-xl);
}
.site-footer a { color: var(--craie); text-decoration-color: rgba(242,239,230,0.35); }
.site-footer a:hover { color: var(--rouille-dark); }

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}
@media (max-width: 780px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

.footer-brand { display: flex; flex-direction: column; gap: var(--space-sm); }
.footer-brand__logo {
  display: flex; align-items: center; gap: 0.6em;
  font-family: var(--font-display); font-size: 1.2rem; color: var(--craie);
}
.footer-brand__logo svg { width: 28px; height: 28px; }
.footer-slogan { font-family: var(--font-kicker); font-style: italic; opacity: 0.8; font-size: 0.95rem; }

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--gris-pierre);
  margin-bottom: var(--space-sm);
}
.footer-col ul { list-style: none; padding: 0; margin: 0; }
.footer-col li { margin-bottom: 0.5em; font-size: 0.92rem; }

.footer-disclaimer {
  border-top: 1px solid rgba(242,239,230,0.15);
  padding-top: var(--space-md);
  font-size: 0.85rem;
  opacity: 0.85;
  line-height: 1.6;
}
.footer-disclaimer p { margin-bottom: 0.6em; }
.footer-disclaimer a { color: var(--gris-pierre); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid rgba(242,239,230,0.1);
  font-size: 0.82rem;
  opacity: 0.65;
}

/* ==========================================================================
   Reveal animation (IntersectionObserver)
   ========================================================================== */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  html { scroll-behavior: auto; }
}
