/* ==========================================================================
   Charte graphique – Le Centre des Amis
   Conforme à la Note Interne GCN/14/38V00 (octobre 2014)
   Polices : Garamond, Constantia, Times  |  Couleurs : blanc, rouge, noir
   ========================================================================== */

/* ---------- Polices auto-hébergées ----------
   EB Garamond (police variable, graisses 400 à 800), licence SIL OFL 1.1
   (voir /fonts/OFL.txt). Servie depuis le site pour ne transmettre
   aucune donnée des visiteurs à un tiers. */
@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond-roman-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "EB Garamond";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond-roman-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond-italic-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
  font-family: "EB Garamond";
  font-style: italic;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/ebgaramond-italic-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ---------- Reset & Base ---------- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* Palette conforme à la charte */
  --color-black: #1a1a1a;
  --color-red: #8b1a1a;        /* rouge profond, sobre */
  --color-red-light: #a52a2a;
  --color-red-dark: #5c0e0e;
  --color-white: #ffffff;
  --color-off-white: #faf8f5;
  --color-parchment: #f7f0e1;     /* ivoire chaud – fond texturé papier */
  --color-parchment-alt: #efe5cc; /* variante marquée pour sections alternées */
  --color-gold: #b8952a;       /* accent doré discret */
  --color-grey: #666666;
  --color-grey-light: #e8e4df;

  /* Marbre Noir Marquina — fond héros (SVG veiné blanc/gris) */
  --marble-bg: #171613 url('../img/marble-marquina.svg') center/cover no-repeat;
  /* Variante distincte pour le header (veines différentes) */
  --marble-header-bg: #171613 url('../img/marble-marquina-header.svg') center/cover no-repeat;

  /* Typographie conforme : Garamond, Constantia, Times */
  --font-primary: "EB Garamond", Garamond, Constantia, "Times New Roman", Times, serif;
  --font-heading: "EB Garamond", Garamond, Constantia, "Times New Roman", Times, serif;

  /* Tailles */
  --size-base: 1.125rem;       /* 18px – taille moyenne comme prescrit */
  --size-small: 0.9rem;
  --size-h1: 2.25rem;
  --size-h2: 1.75rem;
  --size-h3: 1.35rem;

  /* Espacements */
  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--size-base);
  line-height: 1.7;
  color: var(--color-black);
  background-color: var(--color-parchment);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' seed='3'/><feColorMatrix values='0 0 0 0 0.25  0 0 0 0 0.18  0 0 0 0 0.08  0 0 0 0.45 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)' opacity='0.045'/></svg>");
  background-repeat: repeat;
  background-attachment: fixed;
}

/* ---------- Liens ---------- */
a {
  color: var(--color-red);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--color-red-dark);
}

/* Liens dans le contenu : soulignement discret pour la lisibilité */
.card a,
.content a,
.section p a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.card a:hover,
.content a:hover,
.section p a:hover {
  color: var(--color-red-dark);
  text-decoration-thickness: 2px;
}

/* ---------- Typographie ---------- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.3;
  color: var(--color-black);
}

h1 { font-size: var(--size-h1); }
h2 { font-size: var(--size-h2); margin-bottom: var(--space-sm); }
h3 { font-size: var(--size-h3); margin-bottom: var(--space-xs); }

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

blockquote {
  border-left: 3px solid var(--color-red);
  padding: var(--space-sm) var(--space-md);
  margin: var(--space-md) 0;
  font-style: italic;
  color: var(--color-grey);
  background-color: var(--color-white);
}

/* ---------- Header / Navigation ---------- */
.site-header {
  --header-pad: 24px;
  --logo-size: 110px;
  background: var(--marble-header-bg);
  color: var(--color-white);
  padding: var(--header-pad) 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  transition: padding 0.3s ease;
}

.site-header.is-scrolled {
  --header-pad: 8px;
  --logo-size: 60px;
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-title {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--color-white);
  letter-spacing: 0.05em;
}

.site-title a {
  color: var(--color-white);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.site-logo {
  width: var(--logo-size);
  height: var(--logo-size);
  border-radius: 50%;
  flex-shrink: 0;
  transition: width 0.3s ease, height 0.3s ease;
}

.site-title .subtitle {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-grey-light);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Navigation */
.main-nav ul {
  list-style: none;
  display: flex;
  gap: var(--space-md);
}

.main-nav a {
  color: var(--color-grey-light);
  font-size: var(--size-small);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: var(--space-xs) 0;
  border-bottom: 2px solid transparent;
  transition: all 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--color-white);
  border-bottom-color: var(--color-red);
}

/* Hamburger menu (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-xs);
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--color-white);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* ---------- Hero Section ---------- */
.hero {
  background: var(--marble-bg);
  color: var(--color-white);
  text-align: center;
  padding: var(--space-xl) var(--space-md);
  position: relative;
}

.hero .hero-subtitle,
.hero .hero-order,
.hero .devise {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

/* Titre gravé (SVG) — remplace le rendu texte pur */
.engraved-h1 {
  margin: 0 auto var(--space-xs);
  padding: 0;
  max-width: 1100px;
  line-height: 1;
}
.engraved-h1 .engraved-title {
  display: block;
  width: 100%;
  height: auto;
}

.hero::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--color-red);
  z-index: 1;
}

.hero .devise {
  font-size: var(--size-small);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-gold);
  margin-bottom: var(--space-sm);
}

.hero h1 {
  color: var(--color-white);
  font-size: 2.75rem;
  font-weight: 500;
  margin-bottom: var(--space-xs);
  letter-spacing: 0.05em;
}

.hero .hero-subtitle {
  font-size: 1.15rem;
  color: var(--color-grey-light);
  font-style: italic;
  margin-bottom: var(--space-md);
}

.hero .hero-order {
  font-size: var(--size-base);
  color: var(--color-grey-light);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* ---------- Sections ---------- */
.section {
  max-width: 900px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

.section-dark {
  background-color: var(--color-black);
  color: var(--color-white);
}

.section-dark h2,
.section-dark h3 {
  color: var(--color-white);
}

.section-red {
  background-color: var(--color-red);
  color: var(--color-white);
}

.section-red h2 {
  color: var(--color-white);
}

.section-alt {
  background-color: var(--color-parchment-alt);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-lg);
}

.section-header h2 {
  position: relative;
  display: inline-block;
  padding-bottom: var(--space-xs);
}

.section-header h2::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 2px;
  background-color: var(--color-red);
}

.section-dark .section-header h2::after {
  background-color: var(--color-gold);
}

/* ---------- Citation accueil ---------- */
.home-citation {
  max-width: 900px;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.home-citation blockquote {
  margin: 0;
}

/* ---------- Croix Templière décorative ---------- */
.cross-ornament {
  text-align: center;
  margin: var(--space-lg) 0 var(--space-md);
  color: var(--color-red);
}

.cross-ornament img {
  display: block;
  margin: 0 auto;
  width: 110px;
  height: 110px;
  opacity: 0.9;
}

@media (max-width: 768px) {
  .cross-ornament img {
    width: 88px;
    height: 88px;
  }
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.card {
  border: 1px solid var(--color-grey-light);
  padding: var(--space-md);
  text-align: center;
  background-color: var(--color-white);
  transition: box-shadow 0.3s ease;
}

.card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
}

.card h3 {
  color: var(--color-red);
}

/* ---------- Link Cards (ressources) ---------- */
.card-grid--3 {
  grid-template-columns: repeat(3, 1fr);
}

.card-grid--triangle {
  grid-template-columns: repeat(2, 1fr);
}

.card-grid--triangle > :first-child {
  grid-column: 1 / -1;
  max-width: 50%;
  justify-self: center;
}

.card-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  max-width: 680px;
  margin-left: auto;
  margin-right: auto;
}

.link-card {
  display: block;
  border: 1px solid var(--color-grey-light);
  padding: var(--space-md);
  text-align: center;
  text-decoration: none;
  color: var(--color-black);
  background-color: var(--color-white);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

.link-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  border-color: var(--color-red);
}

.link-card h3 {
  color: var(--color-red);
  margin-bottom: var(--space-xs);
}

.link-card p {
  font-size: var(--size-small);
  color: var(--color-grey);
}

.link-card__img {
  display: block;
  width: 120px;
  height: auto;
  margin: 0 auto var(--space-xs);
}

/* ---------- Page Liens — style éditorial ---------- */
.liens-page {
  max-width: 620px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-xl);
}

.liens-intro {
  text-align: center;
  max-width: 480px;
  margin: 0 auto var(--space-xl);
}

.liens-intro p {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--color-grey);
  margin: 0;
  line-height: 1.75;
}

.liens-sommaire {
  list-style: none;
  padding: 0;
  margin: 0;
}

.liens-groupe + .liens-groupe {
  margin-top: var(--space-xl);
}

.liens-groupe__titre {
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  font-size: 1.1rem;
  font-weight: 500;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--color-black);
}

.liens-groupe__titre::after {
  content: "";
  display: block;
  width: 48px;
  height: 1px;
  background-color: var(--color-red);
  opacity: 0.35;
  margin: 0.7rem auto 0;
}

.liens-liste {
  list-style: none;
  padding: 0;
  margin: var(--space-md) 0 0;
}

.liens-liste > li {
  position: relative;
  padding-left: 1.5em;
  margin-bottom: var(--space-md);
}

.liens-liste > li:last-child {
  margin-bottom: 0;
}

.liens-liste > li::before {
  content: "—";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--color-red);
  opacity: 0.6;
  font-style: normal;
}

.liens-liste a {
  font-style: italic;
  font-size: 1.08rem;
  font-weight: 500;
  text-decoration: none;
  color: var(--color-red);
  border-bottom: 1px solid transparent;
  padding-bottom: 0.05em;
  transition: border-color 0.3s ease, color 0.3s ease;
}

.liens-liste a:hover {
  color: var(--color-red-dark);
  border-bottom-color: var(--color-red);
}

.liens-liste p {
  margin: 0.35rem 0 0;
  font-size: 0.95rem;
  color: var(--color-grey);
  font-style: normal;
  line-height: 1.65;
}

@media (max-width: 600px) {
  .liens-groupe__titre {
    font-size: 1rem;
    letter-spacing: 0.14em;
  }

  .liens-liste a {
    font-size: 1rem;
  }

  .liens-fleuron--triple {
    letter-spacing: 0.5em;
    text-indent: 0.5em;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  background-color: var(--color-black);
  color: var(--color-grey-light);
  text-align: center;
  padding: var(--space-lg) var(--space-md);
  font-size: var(--size-small);
  line-height: 1.8;
}

.footer-devise {
  font-style: italic;
  color: var(--color-gold);
  letter-spacing: 0.15em;
  font-size: 1rem;
  margin-bottom: var(--space-xs);
}

.footer-loge {
  color: var(--color-white);
  font-size: 1rem;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-xs);
}

.footer-ordre {
  margin-bottom: var(--space-sm);
  padding-bottom: var(--space-sm);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-link {
  color: var(--color-gold);
}

.footer-link:hover {
  color: var(--color-white);
}

.footer-social {
  display: flex;
  justify-content: center;
  gap: var(--space-sm);
  margin-top: var(--space-sm);
}

.social-link {
  color: var(--color-grey-light);
  transition: color 0.2s ease;
}

.social-link:hover {
  color: var(--color-gold);
}

.footer-legal {
  font-size: 0.8rem;
  color: var(--color-grey);
  margin-top: var(--space-xs);
}

/* ---------- Page Header (sous-pages) ---------- */
.page-header {
  background: var(--marble-bg);
  color: var(--color-white);
  text-align: center;
  padding: var(--space-lg) var(--space-md);
}

.page-header .devise {
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}

.page-header .devise {
  font-size: var(--size-small);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--color-gold);
  margin-bottom: var(--space-xs);
}

.page-header h1 {
  color: var(--color-white);
  font-size: var(--size-h1);
}

/* ---------- Content Sections (sous-pages) ---------- */
.content {
  max-width: 800px;
  margin: 0 auto;
  padding: var(--space-lg) var(--space-md) var(--space-md);
}

.content h2 {
  margin-top: var(--space-lg);
}

.content h2:first-child {
  margin-top: 0;
}

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  padding-left: var(--space-lg);
  margin: var(--space-md) 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background-color: var(--color-red);
}

.timeline-item {
  position: relative;
  margin-bottom: var(--space-md);
}

.timeline-item::before {
  content: '';
  position: absolute;
  left: calc(-1 * var(--space-lg) - 4px);
  top: 0.5em;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background-color: var(--color-red);
}

.timeline-date {
  font-weight: 600;
  color: var(--color-red);
  margin-bottom: var(--space-xs);
}

/* ---------- Contact Form / Info ---------- */
.contact-form {
  max-width: 600px;
  margin: 0 auto;
}

.contact-form .form-group {
  margin-bottom: var(--space-sm);
}

.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-red);
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.6rem 0.8rem;
  font-family: var(--font-primary);
  font-size: var(--size-base);
  border: 1px solid var(--color-grey-light);
  background: var(--color-white);
}

.contact-form textarea {
  resize: vertical;
}

.contact-form .form-notice {
  font-size: var(--size-small);
  color: var(--color-grey);
  margin-top: var(--space-sm);
}

.contact-form .form-notice a {
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.contact-form .form-actions {
  text-align: center;
  margin-top: var(--space-md);
}

.contact-form button {
  font-family: var(--font-primary);
  font-size: var(--size-base);
  padding: 0.7rem 2.5rem;
  background-color: var(--color-red);
  color: var(--color-white);
  border: none;
  cursor: pointer;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: background-color 0.3s ease;
}

.contact-form button:hover {
  background-color: var(--color-red-dark);
}

.contact-info {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.contact-info dt {
  font-weight: 600;
  color: var(--color-red);
  margin-top: var(--space-sm);
}

.contact-info dd {
  margin-left: 0;
  margin-bottom: var(--space-xs);
}

/* ---------- Separator ---------- */
.separator,
.content hr {
  border: none;
  height: 1px;
  background-color: var(--color-grey-light);
  margin: var(--space-lg) auto;
  max-width: 200px;
}

/* ---------- Listes dans le contenu Markdown ---------- */
.content ul,
.content ol {
  margin: var(--space-sm) 0 var(--space-md) var(--space-md);
}

/* ---------- Skip Link (accessibilité) ---------- */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--color-red);
  color: var(--color-white);
  padding: 0.5rem 1rem;
  z-index: 200;
  font-size: var(--size-small);
}

.skip-link:focus {
  left: 0;
  color: var(--color-white);
}

/* ---------- Focus visible (accessibilité) ---------- */
:focus-visible {
  outline: 2px solid var(--color-red);
  outline-offset: 2px;
}

/* ---------- Utilitaires ---------- */
.text-center {
  text-align: center;
}

.mt-sm {
  margin-top: var(--space-sm);
}

.mt-md {
  margin-top: var(--space-md);
}

.mb-lg {
  margin-bottom: var(--space-lg);
}

.external-link {
  font-size: 1.05rem;
  letter-spacing: 0.05em;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .hero h1 {
    font-size: 2rem;
  }

  .hero .hero-subtitle {
    font-size: 1rem;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .nav-toggle {
    display: block;
  }

  .main-nav {
    width: 100%;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
  }

  .main-nav.open {
    max-height: 300px;
  }

  .main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: var(--space-sm) 0;
  }

  .main-nav a {
    display: block;
    padding: var(--space-xs) 0;
  }

  .card-grid--3 {
    grid-template-columns: 1fr;
  }

  .card-grid--triangle {
    grid-template-columns: 1fr;
  }

  .card-grid--triangle > :first-child {
    max-width: 100%;
  }

  .section {
    padding: var(--space-sm) var(--space-sm) var(--space-lg);
  }

  .content {
    padding: var(--space-sm) var(--space-sm) var(--space-lg);
  }
}

@media (max-width: 480px) {
  :root {
    --size-base: 1rem;
    --size-h1: 1.75rem;
    --size-h2: 1.4rem;
  }

  .hero {
    padding: var(--space-lg) var(--space-sm);
  }

  .hero h1 {
    font-size: 1.6rem;
  }
}

/* ---------- Impression : fond blanc uni (économie d'encre, lisibilité) ---------- */
@media print {
  body {
    background-color: #ffffff;
    background-image: none;
  }

  .section-alt {
    background-color: #ffffff;
  }
}
