/* ============================================================
   Naples Passion — style.css
   Gabarit repris de Rome Passion (grille, menu, composants).
   Polices auto-hébergées : Cormorant Garamond (titres) + Jost (corps).
   Toutes les couleurs sont dans :root.
   ============================================================ */

@font-face {
  font-family: 'Cormorant Garamond';
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url('../fonts/CormorantGaramond-SemiBold.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Jost-Light.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('../fonts/Jost-Medium.woff2') format('woff2');
}
@font-face {
  font-family: 'Jost';
  font-style: italic;
  font-weight: 300;
  font-display: swap;
  src: url('../fonts/Jost-LightItalic.woff2') format('woff2');
}

/* ===== RESET & BASE ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Accent principal Naples : bleu du golfe et des majoliques.
     Plus saturé que la terre cuite de Rome (#c0441e / #8b2e10),
     tout en restant posé sur la même pierre, la même encre et le même or.
     Pour retoucher l'identité : modifier uniquement ces deux valeurs. */
  --terracotta:      #0a5f82;
  --terracotta-dark: #06384d;
  --gold:            #b8932a;
  --gold-light:      #e8c96a;
  --stone:           #f5f0e8;
  --stone-dark:      #e8e0cc;
  --ink:             #2a2418;
  --ink-mid:         #4a3f2f;
  --ink-light:       #7a6a54;
  --white:           #fdfaf5;
  --line:            #c9b8a0;
  --sidebar-w:       260px;
  --home-icon-size:  4rem;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Jost', sans-serif;
  font-weight: 300;
  color: var(--ink);
  background: var(--white);
  line-height: 1.8;
}

img { max-width: 100%; height: auto; display: block; }
a   { color: var(--terracotta); text-decoration: none; }
a:hover { color: var(--terracotta-dark); }

/* ===== LAYOUT GRILLE ===== */
.site-wrapper {
  display: grid;
  grid-template-areas:
    "header"
    "nav"
    "main"
    "footer";
  grid-template-columns: 1fr;
  min-height: 100vh;
}

@media (min-width: 900px) {
  .site-wrapper {
    grid-template-areas:
      "header  header"
      "nav     nav"
      "sidebar main"
      "footer  footer";
    grid-template-columns: var(--sidebar-w) 1fr;
  }
}

/* ===== HEADER ===== */
.site-header {
  grid-area: header;
  background: var(--ink);
  display: flex;
  align-items: stretch;
  min-height: 80px;
  overflow: hidden;
}

@media (min-width: 900px) {
  .site-header { min-height: 110px; }
}

.site-header-banner {
  flex: 1;
  display: flex;
  align-items: center;
}

.site-header-photo {
  flex-shrink: 0;
  overflow: hidden;
  max-height: 110px;
  display: none;
}

@media (min-width: 600px) {
  .site-header-photo { display: block; }
}

.site-header-photo img {
  height: 100%;
  width: auto;
  max-height: 110px;
  object-fit: cover;
  opacity: 0.92;
  display: block;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  padding: 1.25rem 1.5rem;
  text-decoration: none;
}

.site-logo-text {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.4rem, 4vw, 2rem);
  font-weight: 600;
  color: var(--white);
  letter-spacing: 0.04em;
}

.site-logo-text span { color: var(--gold-light); }

/* Sélecteur de langue : la même page dans chaque langue */
.header-lang {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 0.1rem;
  padding: 0.5rem 0.85rem 0.5rem 0;
}
.header-lang a {
  color: var(--gold-light);
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  line-height: 1;
  padding: 0.45rem 0.38rem;
  border-bottom: 2px solid transparent;
}
.header-lang a:hover,
.header-lang a:focus {
  color: white;
}
.header-lang a[aria-current="true"] {
  color: white;
  border-bottom-color: var(--gold-light);
}

/* ===== NAVIGATION ===== */
.site-nav {
  grid-area: nav;
  background: var(--terracotta);
}

.nav-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
}

.nav-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--terracotta-dark);
  border: none;
  color: white;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav-toggle .ham {
  width: 20px;
  height: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle .ham span {
  display: block;
  height: 2px;
  background: white;
  border-radius: 1px;
}

.nav-links {
  display: none;
  list-style: none;
  width: 100%;
  background: var(--terracotta-dark);
}
.nav-links.open { display: block; }
.nav-links li { border-bottom: 1px solid rgba(255,255,255,0.1); }
.nav-links a {
  display: block;
  padding: 0.75rem 1.5rem;
  color: white;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  transition: background 0.2s;
}
.nav-links a:hover { background: rgba(255,255,255,0.1); color: white; }
.nav-links a[aria-current="page"] {
  background: rgba(0, 0, 0, 0.18);
  color: white;
}

/* Sélecteur de langue — juste après Contact dans .nav-links */
.nav-links .nav-lang {
  list-style: none;
}
.lang-switch {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
}
.lang-switch summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  list-style: none;
  cursor: pointer;
  color: white;
  font-family: 'Jost', sans-serif;
  font-weight: 500;
  font-size: 0.9rem;
  letter-spacing: 0.05em;
}
.lang-switch summary::-webkit-details-marker { display: none; }
.lang-switch summary::marker { content: ""; }
.lang-switch summary:hover,
.lang-switch summary:focus {
  background: rgba(255, 255, 255, 0.1);
  color: white;
}
.lang-switch summary:focus-visible {
  outline: 2px solid var(--gold-light);
  outline-offset: 2px;
}
.lang-switch__flag {
  display: block;
  width: 18px;
  height: 12px;
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  object-fit: cover;
}
.lang-switch:not([open]) > :not(summary) { display: none; }
.lang-switch__list {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 40;
  display: block;
  min-width: 180px;
  margin: 0;
  padding: 6px 0;
  list-style: none;
  background: var(--white);
  border: 1px solid var(--stone-dark);
  box-shadow: 0 8px 24px rgba(42, 36, 24, 0.12);
}
.lang-switch__list a {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  color: var(--ink);
  text-decoration: none;
  font-family: 'Jost', sans-serif;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  text-transform: none;
}
.lang-switch__list a:hover,
.lang-switch__list a:focus {
  color: var(--terracotta);
  background: var(--stone);
}
.lang-switch__list a[aria-current="true"] {
  color: var(--terracotta);
  font-weight: 700;
}
.lang-switch__list .lang-switch__flag {
  border-color: var(--stone-dark);
}

@media (min-width: 700px) {
  .nav-toggle { display: none; }
  .nav-links {
    display: flex !important;
    flex-wrap: wrap;
    flex: 1 1 auto;
    width: auto;
    max-width: 100%;
    min-width: 0;
    background: transparent;
    align-items: center;
  }
  .nav-links li { border: none; }
  .nav-links a {
    padding: 0.9rem 1rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }
  .nav-links a:hover { background: rgba(0,0,0,0.15); }
  .nav-links .nav-lang {
    display: flex;
    align-items: center;
  }
  .lang-switch {
    width: auto;
  }
  .lang-switch summary {
    padding: 0.9rem 1rem;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
  }
  .lang-switch summary:hover,
  .lang-switch summary:focus {
    background: rgba(0, 0, 0, 0.15);
  }
}

/* Bouton "Les monuments" (mobile uniquement) */
.monument-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--gold);
  border: none;
  color: white;
  padding: 0.75rem 1rem;
  cursor: pointer;
  font-family: 'Jost', sans-serif;
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  margin-left: auto;
}
@media (min-width: 900px) {
  .monument-toggle { display: none; }
}

/* ===== SIDEBAR ===== */
.site-sidebar {
  grid-area: sidebar;
  background: var(--stone);
  border-right: 1px solid var(--stone-dark);
  padding: 1.5rem 1.25rem;
  display: none;
}

/* Mobile : panneau glissant par-dessus le contenu */
.site-sidebar.open {
  display: block;
  position: fixed;
  top: 0;
  left: 0;
  width: 85%;
  max-width: 320px;
  height: 100vh;
  overflow-y: auto;
  z-index: 100;
  box-shadow: 4px 0 20px rgba(0,0,0,0.25);
}

/* Fond semi-transparent derrière la sidebar ouverte */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 99;
}
.sidebar-overlay.open { display: block; }

@media (min-width: 900px) {
  .site-sidebar {
    display: block;
    position: sticky;
    top: 0;
    max-height: 100vh;
    overflow-y: auto;
  }
  .site-sidebar.open {
    position: sticky;
    width: auto;
    max-width: none;
    box-shadow: none;
  }
  .sidebar-overlay { display: none !important; }
}

.sidebar-title {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--terracotta);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-bottom: 2px solid var(--terracotta);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.sidebar-section { margin-bottom: 1.25rem; }

.sidebar-section-title {
  font-family: 'Jost', sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.5rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid var(--stone-dark);
}

.sidebar-section ul { list-style: none; padding: 0; }
.sidebar-section ul li { margin-bottom: 0.15rem; }
.sidebar-section ul a {
  color: var(--ink-mid);
  font-size: 0.82rem;
  line-height: 1.5;
  display: block;
  padding: 0.15rem 0;
  transition: color 0.2s, padding-left 0.2s;
}
.sidebar-section ul a:hover        { color: var(--terracotta); padding-left: 4px; }
.sidebar-section ul a.active       { color: var(--terracotta); font-weight: 500; }

/* ===== CONTENU PRINCIPAL ===== */
.site-main {
  grid-area: main;
  padding: 2rem 1.5rem 3rem;
  max-width: 780px;
}
@media (min-width: 900px) {
  .site-main {
    padding: 2.5rem 2.5rem 4rem;
    /* 55vw plafonne trop longtemps à 780px ; 42vw + 400px croît dès ~1040px jusqu'à 1200px. */
    max-width: clamp(780px, calc(42vw + 400px), 1200px);
    margin-inline: auto;
  }
}

/* Typographie */
h1 {
  font-family: 'Cormorant Garamond', serif;
  font-size: clamp(1.8rem, 5vw, 2.8rem);
  font-weight: 600;
  color: var(--ink);
  line-height: 1.15;
  margin-bottom: 0.25rem;
  letter-spacing: -0.01em;
}
h1::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: var(--terracotta);
  margin-top: 0.75rem;
  margin-bottom: 1rem;
}

h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--ink-mid);
  margin: 2.5rem 0 0.75rem;
  letter-spacing: 0.01em;
}

h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink-mid);
  margin: 1.5rem 0 0.5rem;
}

p {
  font-size: 1rem;
  color: var(--ink-mid);
  margin-bottom: 1.25rem;
  text-align: justify;
}

/* Carte infos pratiques */
.info-card {
  background: var(--stone);
  border-left: 4px solid var(--terracotta);
  border-radius: 0 6px 6px 0;
  padding: 1.25rem 1.5rem;
  margin: 1.5rem 0 2rem;
  display: grid;
  gap: 0.75rem;
}
@media (min-width: 600px) {
  .info-card { grid-template-columns: 1fr 1fr; }
}

.info-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.info-label {
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-light);
}
.info-value {
  font-size: 0.92rem;
  color: var(--ink);
}
.info-value a { color: var(--terracotta); }

/* Figures & images */
figure {
  margin: 2rem 0;
  clear: both;
}
figure img {
  width: 100%;
  border-radius: 4px;
  box-shadow: 0 4px 20px rgba(42,36,24,0.15);
}
.figure-tilted {
  overflow: visible;
  padding: 1.75rem 1.25rem 3rem;
}
.figure-tilted img {
  transform: rotate(-3deg);
  box-shadow: 0 8px 24px rgba(42,36,24,0.18);
}

/* Figures plus larges (à poser manuellement sur des <figure> ciblées).
   Sous 1300px : aucun override — même rendu qu'une figure normale.
   ≥1300px : déborde .site-main, centré sur la colonne texte,
   sans chevaucher la sidebar ni sortir du viewport. */
@media (min-width: 1300px) {
  .figure-wide {
    width: min(1400px, calc(100vw - var(--sidebar-w) - 4rem));
    max-width: min(1400px, calc(100vw - var(--sidebar-w) - 4rem));
    margin-inline: calc(50% - min(700px, calc((100vw - var(--sidebar-w) - 4rem) / 2)));
  }
}
figcaption {
  font-size: 0.8rem;
  color: var(--ink-light);
  font-style: italic;
  margin-top: 0.5rem;
  text-align: center;
}

@media (min-width: 600px) {
  figure.float {
    float: left;
    width: 45%;
    margin: 0 1.75rem 1.5rem 0;
  }
  /* Le premier élément après une figure.float s'étale à droite */
  figure.float + p,
  figure.float + h2,
  figure.float + h3 {
    overflow: hidden;
  }
}

/* Tout ce qui vient APRÈS le premier élément suivant reprend la pleine largeur */
figure.float + p + p,
figure.float + p + figure,
figure.float + p + h2,
figure.float + p + h3 {
  clear: both;
}

/* Toute figure non-flottante repart toujours sur pleine largeur */
figure:not(.float) { clear: both; }

.clearfix::after { content: ''; display: table; clear: both; }

/* Page d'accueil : grands liens */
.home-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}
.home-link {
  background: var(--terracotta);
  color: white;
  text-align: center;
  padding: 1.5rem 1rem;
  border-radius: 4px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  transition: background 0.2s, transform 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.75rem;
}
.home-link:hover {
  background: var(--terracotta-dark);
  color: white;
  transform: translateY(-2px);
}
.home-link-icon {
  display: inline-block;
  width: var(--home-icon-size, 3rem);
  height: var(--home-icon-size, 3rem);
}
.home-link-icon svg {
  width: 100%;
  height: 100%;
  color: currentColor;
}
.home-link img { width: 64px; height: 64px; object-fit: contain; margin: 0 auto; }

/* Sommaire des monuments */
.monument-lead {
  text-align: left;
  margin-bottom: 0.5rem;
}
.monument-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0 0 0.5rem;
}
@media (min-width: 600px) {
  .monument-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 900px) {
  .monument-grid { grid-template-columns: repeat(3, 1fr); }
}
.monument-card {
  display: flex;
  flex-direction: column;
  background: var(--stone);
  border-radius: 4px;
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
}
.monument-card:hover { color: var(--ink); }
.monument-card:hover h3 { color: var(--terracotta); }
.monument-card img {
  width: 100%;
  height: auto;
  border-radius: 0;
  box-shadow: none;
}
.monument-card h3 {
  font-size: 1.15rem;
  line-height: 1.25;
  margin: 0.85rem 0.9rem 0.35rem;
}
.monument-card p {
  text-align: left;
  font-size: 0.92rem;
  line-height: 1.45;
  margin: 0 0.9rem 0.95rem;
}

/* Sommaire des programmes : mêmes cartes, deux colonnes au plus */
.programme-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin: 0 0 0.5rem;
}
@media (min-width: 700px) {
  .programme-grid { grid-template-columns: repeat(2, 1fr); }
}
.programme-photo {
  position: relative;
  display: block;
}
.programme-badge {
  position: absolute;
  left: 0.7rem;
  bottom: 0.7rem;
  background: var(--terracotta);
  color: white;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  line-height: 1.2;
  padding: 0.28rem 0.55rem;
  border-radius: 2px;
}

/* ===== FOOTER ===== */
.site-footer {
  grid-area: footer;
  background: var(--ink);
  color: rgba(255,255,255,0.5);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.82rem;
  letter-spacing: 0.04em;
}
.site-footer a { color: var(--gold-light); }
.site-footer a:hover { color: white; }

/* ===== CARTES LEAFLET (aussi dans style/carte-leaflet.css) ===== */
.carte-leaflet {
  width: 100%;
  max-width: 660px;
  height: 560px;
  margin: 0 auto 1.5rem;
  border: 1px solid var(--line);
  z-index: 0;
}
.carte-leaflet-tall {
  height: 640px;
}
.leaflet-control-layers {
  font: 13px/1.3 Jost, "Segoe UI", sans-serif;
  background: rgba(255, 252, 246, 0.92);
  border: 1px solid var(--line);
}
.rp-map-marker {
  background: none;
  border: none;
}
.rp-map-pin {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  position: absolute;
  left: 0;
  top: 0;
}
.rp-map-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--terracotta);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.35);
  flex: 0 0 auto;
}
.rp-map-label {
  font: 700 11px/1.2 Jost, "Segoe UI", sans-serif;
  color: #fff;
  background: transparent;
  border: none;
  border-radius: 0;
  padding: 0;
  text-shadow:
    0 0 3px rgba(0, 0, 0, 0.95),
    0 1px 2px rgba(0, 0, 0, 0.9),
    1px 0 2px rgba(0, 0, 0, 0.9),
    -1px 0 2px rgba(0, 0, 0, 0.9);
}
.rp-map-pin:hover .rp-map-label {
  color: var(--gold-light);
}
.rp-anchor-right .rp-map-pin {
  flex-direction: row;
  transform: translate(0, -50%);
}
.rp-anchor-left .rp-map-pin {
  flex-direction: row-reverse;
  transform: translate(-100%, -50%);
}
.rp-anchor-top .rp-map-pin {
  flex-direction: column-reverse;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -100%);
}
.rp-anchor-bottom .rp-map-pin {
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, 0);
}
.rp-anchor-dot .rp-map-pin {
  transform: translate(-50%, -50%);
}

/* ===== NAPLES — contenu hérité du gabarit précédent ===== */
.site-header,
.site-nav,
.site-main,
.site-footer {
  min-width: 0;
}

/* Jost n'est chargé qu'en 300 et 500 : le gras réel est le 500. */
strong, b { font-weight: 500; }

.site-main {
  overflow-wrap: break-word;
}

.site-main img {
  max-width: 100%;
  height: auto;
  margin-inline: auto;
}

.site-main ul,
.site-main ol {
  margin: 0 0 1.25rem 1.25rem;
}
.site-main ul { list-style: disc; }
.site-main ol { list-style: decimal; }
.site-main li {
  margin-bottom: 0.35rem;
  color: var(--ink-mid);
}

.site-main table {
  width: 100%;
  max-width: 100%;
  margin: 0 0 1.25rem;
  border-collapse: collapse;
}
.site-main td,
.site-main th {
  vertical-align: top;
  padding: 0.35rem;
}

/* Les pages Word collent encore une police et une taille en dur. */
.site-main font,
.site-main [style*="font-family"],
.site-main [style*="font-size"],
.site-main [style*="FONT-SIZE"] {
  font-family: inherit !important;
  font-size: inherit !important;
}

@media (max-width: 599px) {
  .site-main table,
  .site-main tbody,
  .site-main tr,
  .site-main td,
  .site-main th {
    display: block;
    width: 100% !important;
  }
}
