/* ═══════════════════════════════════════════════════════════
   CIMPLE — Moteur de Commune · Charte Radical
   Une seule CSS. Bulletproof. Scalable.
   ═══════════════════════════════════════════════════════════ */

/* ── Configuration ── */
:root {
  --primary:    #0f0f0f;
  --bg:         #ffffff;
  --surface:    #f5f5f5;
  --border:     #e0e0e0;
  --text:       #0f0f0f;
  --text-muted: #666666;
  --text-faint: #999999;
  --radius:     0px;
  --gap:        2rem;
  --font-b:     'Montserrat', system-ui, sans-serif;
  --font-h:     'Cormorant Garamond', Georgia, serif;
  --max:        1100px;
}

/* ── Reset ── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: var(--font-b); background: var(--bg); color: var(--text); line-height: 1.6; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-b); cursor: pointer; }

/* ── Layout ── */
.container { max-width: var(--max); margin: 0 auto; padding: 0 1.5rem; }
section { padding: 4rem 0; }

/* ── Navigation ── */
.topbar {
  border-bottom: 1px solid var(--border);
  padding: 1rem 0;
  position: sticky; top: 0;
  background: rgba(255,255,255,.97);
  backdrop-filter: blur(5px);
  z-index: 1000;
}
.topbar-nav { display: flex; justify-content: space-between; align-items: center; }
.logo {
  font-family: var(--font-b); font-weight: 900; font-size: .85rem;
  text-transform: uppercase; letter-spacing: .2em;
  text-decoration: none; color: var(--primary);
  white-space: nowrap;
}
.nav-links { display: flex; gap: 2rem; list-style: none; }
.nav-links a {
  text-decoration: none; color: var(--text-muted);
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .15em;
  transition: color .2s;
}
.nav-links a:hover { color: var(--primary); }
.nav-links a.active { color: var(--primary); font-weight: 800; border-bottom: 2px solid var(--primary); padding-bottom: 4px; }

/* ── Hero ── */
.hero { padding: 5rem 0 4rem; }
.hero-eyelet {
  font-size: .62rem; letter-spacing: .5em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: 1rem;
}
.hero h1 {
  font-family: var(--font-h); font-size: clamp(2.4rem, 5vw, 4rem);
  font-weight: 500; line-height: 1.1; margin-bottom: 1rem;
}
.hero p { font-size: .95rem; color: var(--text-muted); max-width: 540px; line-height: 1.7; margin-bottom: 2rem; }

/* ── Titres de section ── */
.section-eyelet {
  font-size: .6rem; letter-spacing: .5em; text-transform: uppercase;
  color: var(--text-faint); margin-bottom: .75rem;
}
.section-title {
  font-family: var(--font-h); font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500; margin-bottom: .5rem;
}
.section-lead { color: var(--text-muted); font-size: .9rem; line-height: 1.7; margin-bottom: 2rem; max-width: 600px; }

/* ── Composants ── */
.btn {
  display: inline-block; padding: .8rem 1.6rem;
  background: var(--primary); color: #fff;
  font-family: var(--font-b); font-weight: 600; font-size: .72rem;
  letter-spacing: .25em; text-transform: uppercase;
  border: none; cursor: pointer; transition: opacity .2s;
}
.btn:hover { opacity: .75; }
.btn-outline { background: transparent; border: 1px solid var(--primary); color: var(--primary); }

.card { border: 1px solid var(--border); padding: 2rem; transition: border-color .2s; }
.card:hover { border-color: var(--primary); }
.card-eyelet { font-size: .6rem; letter-spacing: .4em; text-transform: uppercase; color: var(--text-faint); margin-bottom: .75rem; }
.card h3 { font-family: var(--font-h); font-size: 1.8rem; font-weight: 600; margin-bottom: 1rem; line-height: 1.2; }
.card p { font-size: .95rem; color: var(--text-muted); line-height: 1.6; margin-bottom: 1.5rem; }
.card-icon { width: 36px; height: 36px; object-fit: contain; margin-bottom: 1rem; }

/* ── Hero secondaire (pages internes) ── */
.hero-sm {
  background: var(--surface);
  padding: clamp(3rem, 10vh, 6rem) 0;
  border-bottom: 1px solid var(--border);
  text-align: center;
}
.hero-sm h1 {
  font-family: var(--font-h); font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 600; margin-bottom: 1rem;
}
.hero-sm p { color: var(--text-muted); font-size: 1.05rem; max-width: 600px; margin: 0 auto 2rem; }

/* ── Lien-bouton minimaliste ── */
.btn-link {
  text-decoration: none; color: var(--primary);
  font-weight: 700; font-size: .75rem;
  text-transform: uppercase; letter-spacing: .15em;
  transition: opacity .2s;
}
.btn-link:hover { opacity: .65; }
.text-center { text-align: center; }

/* ── Recherche (overlay plein écran) ── */
#search-overlay {
  position: fixed; inset: 0;
  background: rgba(255,255,255,.98);
  display: none; z-index: 2000;
  padding-top: 5rem;
}
#search-overlay.open { display: block; }
.search-container { max-width: 700px; margin: 0 auto; padding: 0 1.5rem; }
.search-input {
  width: 100%; border: none; border-bottom: 3px solid var(--primary);
  font-family: var(--font-h); font-size: 2.2rem; font-weight: 500;
  padding: 1rem 0; outline: none; color: var(--primary); background: transparent;
}
.search-input::placeholder { color: var(--border); }
.search-results { margin-top: 2rem; }
.search-close {
  position: absolute; top: 1.5rem; right: 1.5rem;
  background: none; border: none; font-size: 1.2rem; color: var(--text-muted);
  cursor: pointer; font-family: var(--font-b); letter-spacing: .1em;
}

/* ── Formulaires ── */
.form-block { max-width: 640px; }
label { display: block; font-size: .62rem; letter-spacing: .35em; text-transform: uppercase; color: var(--text-faint); margin: 1.5rem 0 .5rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="file"], textarea, select {
  width: 100%; border: none; border-bottom: 1px solid var(--border);
  padding: .6rem 0; font: 300 .95rem var(--font-b);
  background: transparent; outline: none; color: var(--text);
  transition: border-color .2s;
}
input:focus, textarea:focus, select:focus { border-bottom-color: var(--primary); }
textarea { min-height: 100px; resize: vertical; }
.form-submit {
  margin-top: 2rem; background: var(--primary); color: #fff; border: none;
  padding: .9rem 2rem; font: 600 .72rem/1 var(--font-b);
  letter-spacing: .3em; text-transform: uppercase; cursor: pointer; transition: opacity .2s;
}
.form-submit:hover { opacity: .75; }

/* ── Notice ── */
.notice {
  background: var(--surface); border-left: 2px solid var(--primary);
  padding: 1rem 1.25rem; font-size: .85rem; line-height: 1.6;
  color: var(--text-muted); margin: 2rem 0;
}
.notice strong { color: var(--text); }

/* ── Grilles ── */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--gap); }
.grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  margin-top: 2rem;
}

/* ── Footer ── */
footer {
  background: var(--surface); border-top: 1px solid var(--border);
  padding: 5rem 0; margin-top: 5rem;
}
.footer-col h4 {
  text-transform: uppercase; font-size: .75rem;
  letter-spacing: .2em; margin-bottom: 1.25rem;
  color: var(--text-muted); font-weight: 700;
}
.footer-col p { font-size: .85rem; color: var(--text-muted); margin-bottom: .35rem; }
.footer-col a { color: var(--text-muted); text-decoration: underline; text-underline-offset: 3px; }
.footer-col a:hover { color: var(--primary); }

/* ── Responsive ── */
@media (max-width: 768px) {
  .nav-links { display: none; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   HERO PLEIN ÉCRAN + BARRE GEMINI
   ═══════════════════════════════════════════════════════════ */

.hero-full {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  position: relative;
  background: url('../_img/hero-mairie.jpg') no-repeat center center/cover;
  color: white;
}

.hero-full::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.3), rgba(0,0,0,0.6));
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  width: 90%;
  max-width: 800px;
}

.hero-content h1 {
  font-size: clamp(3rem, 10vw, 6rem);
  font-family: 'Cormorant Garamond', serif;
  font-weight: 700;
  margin-bottom: 1rem;
  letter-spacing: -1px;
}

/* ── Barre de recherche Gemini ── */
.search-container-main {
  margin-top: 3rem;
  position: relative;
}

.search-bar-gemini {
  width: 100%;
  padding: 1.5rem 2rem;
  padding-left: 4rem;
  border-radius: 50px;
  border: none;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  font-size: 1.2rem;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  outline: none;
  font-family: var(--font-b);
  color: var(--text);
}

.search-bar-gemini:focus {
  transform: scale(1.02);
  background: #fff;
  box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.search-container-main::before {
  content: '🔍';
  position: absolute;
  left: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.2rem;
  z-index: 3;
  opacity: 0.5;
}

/* ── Espace blanc sous la flottaison ── */
.section-spacer { padding: 8rem 0; }

/* ═══════════════════════════════════════════════════════════
   WRAPPER DÉFENSIF .cimple-brique
   Garantit que toute brique injectée respecte le skin Eguisheim,
   quelle que soit son origine (Cassini, Chanel, Village-Neuf…).
   ═══════════════════════════════════════════════════════════ */
.cimple-brique {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 3rem;
  margin-bottom: 0; /* géré par la grille bento */
  box-sizing: border-box;
  font-family: var(--font-b);
  color: var(--text);
}

.cimple-brique h1, .cimple-brique h2, .cimple-brique h3, .cimple-brique h4 {
  font-family: var(--font-h) !important;
  color: var(--text) !important;
  font-weight: 600 !important;
  margin-bottom: 1.25rem !important;
  border: none !important;
  background: none !important;
}
.cimple-brique h1 { font-size: 2rem !important; }
.cimple-brique h2 { font-size: 1.7rem !important; }
.cimple-brique h3 { font-size: 1.5rem !important; }
.cimple-brique h4 { font-size: 1.2rem !important; }

.cimple-brique p, .cimple-brique span, .cimple-brique li, .cimple-brique div {
  font-family: var(--font-b) !important;
  line-height: 1.6 !important;
}
.cimple-brique p, .cimple-brique li { color: var(--text-muted) !important; }
.cimple-brique strong, .cimple-brique b { color: var(--text) !important; }

.cimple-brique a { color: var(--primary) !important; text-decoration: underline; text-underline-offset: 3px; }
.cimple-brique a.btn, .cimple-brique a.btn-link { text-decoration: none !important; }

.cimple-brique button, .cimple-brique input, .cimple-brique textarea, .cimple-brique select {
  font-family: var(--font-b) !important;
}

/* Neutralisation des angles (héritage) */
.cimple-brique *, .cimple-brique *::before, .cimple-brique *::after { border-radius: 0 !important; }

/* ═══════════════════════════════════════════════════════════
   BENTO GRID (layouts asymétriques, type Ville & Tourisme)
   ═══════════════════════════════════════════════════════════ */
.bento-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(3, 1fr);
}
.bento-2-1  { grid-column: span 2; } /* large : 2 cols sur 3 */
.bento-1-2  { grid-column: span 1; } /* petite : 1 col sur 3 */
.bento-full { grid-column: span 3; } /* pleine largeur */

@media (max-width: 900px) {
  .bento-grid { grid-template-columns: 1fr; }
  .bento-2-1, .bento-1-2, .bento-full { grid-column: span 1; }
}

/* ═══════════════════════════════════════════════════════════
   BLUR-ON-SEARCH : effet "Magic Overlay"
   Quand l'input de recherche est focusé, tout ce qui suit le
   hero devient flou et non-interactif. La barre reste nette.
   ═══════════════════════════════════════════════════════════ */
body.cs-active main > section:not(.hero-full),
body.cs-active footer { filter: blur(6px); transition: filter .3s ease; pointer-events: none; }
body main > section:not(.hero-full),
body footer { transition: filter .3s ease; }

/* ═══════════════════════════════════════════════════════════
   DROPDOWN DE RECHERCHE (sous la barre Gemini)
   ═══════════════════════════════════════════════════════════ */
.cs-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
  display: none;
  max-height: 480px;
  overflow-y: auto;
  z-index: 5;
  text-align: left;
  border-radius: 8px;
}
.cs-dropdown.open { display: block; }
/* Mini-cartes Gemini */
.cs-card {
  padding: 1.4rem 1.8rem;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  text-align: left;
}
.cs-card:hover { background: var(--surface); }
.cs-card:last-child { border-bottom: none; }
.cs-card-cat {
  font-size: .62rem; letter-spacing: .35em; text-transform: uppercase;
  color: var(--primary); font-weight: 700; margin-bottom: 6px;
}
.cs-card-title {
  font-family: var(--font-h); font-size: 1.25rem; font-weight: 600;
  color: var(--text); margin: 0 0 .4rem;
}
.cs-card-excerpt {
  font-size: .82rem; color: var(--text-muted);
  line-height: 1.5; margin-bottom: .9rem;
}

/* Couleur du kicker selon le type */
.cs-type-service .cs-card-cat { color: var(--primary); }                  /* service = noir profond */
.cs-type-info    .cs-card-cat { color: #888; font-weight: 500; }          /* info = neutre */
.cs-type-action  .cs-card-cat { color: #c0392b; }                         /* action = rouge sobre */
.cs-type-admin   .cs-card-cat { color: #555; font-style: italic; }        /* admin = discret */
.cs-type-admin   { background: #fafafa; }
.cs-type-admin .cs-card-title::after { content: ' 🔒'; opacity: .5; font-size: .9rem; }

/* ═══════════════════════════════════════════════════════════
   MODAL DE DÉTAIL
   ═══════════════════════════════════════════════════════════ */
.cs-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 9999;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  animation: csFadeIn .18s ease-out;
}
@keyframes csFadeIn { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 600px) { .cs-modal-overlay { padding: 24px; } }
.cs-modal-card {
  background: #fff; width: 100%; max-width: 640px;
  max-height: 92vh; overflow-y: auto;
  font-family: var(--font-b);
  display: flex; flex-direction: column;
}
.cs-modal-head {
  background: var(--primary); color: #fff;
  padding: 24px 28px;
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px;
}
.cs-modal-cat {
  font-size: .6rem; letter-spacing: .35em; text-transform: uppercase;
  color: rgba(255,255,255,.55); margin-bottom: 6px;
}
.cs-modal-title {
  font-family: var(--font-h); font-size: 1.6rem; font-weight: 600;
  color: #fff; line-height: 1.2; margin: 0;
}
.cs-modal-close {
  background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; width: 32px; height: 32px; flex-shrink: 0;
  cursor: pointer; font-size: .9rem;
  display: flex; align-items: center; justify-content: center;
  transition: opacity .15s;
}
.cs-modal-close:hover { opacity: .65; }
.cs-modal-body { padding: 28px; }
.cs-modal-section { margin-bottom: 26px; }
.cs-modal-label {
  font-size: .6rem; letter-spacing: .4em; text-transform: uppercase;
  color: var(--text-muted); font-weight: 700; margin-bottom: 10px;
}
.cs-modal-steps { list-style: none; padding: 0; margin: 0; }
.cs-modal-steps li {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid #f0f0f0;
  font-size: .88rem; line-height: 1.55; color: var(--text);
}
.cs-modal-steps li:last-child { border-bottom: 0; }
.cs-modal-step-num {
  flex-shrink: 0; width: 22px; height: 22px;
  background: var(--primary); color: #fff;
  font-size: .65rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  margin-top: 1px;
}
.cs-modal-pieces { list-style: none; padding: 0; margin: 0; }
.cs-modal-pieces li {
  font-size: .88rem; padding: 6px 0 6px 18px;
  border-bottom: 1px solid #f0f0f0; color: var(--text);
  position: relative;
}
.cs-modal-pieces li::before { content: '→'; position: absolute; left: 0; color: var(--text-muted); }
.cs-modal-pieces li:last-child { border-bottom: 0; }
.cs-modal-meta {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px; margin-top: 8px;
}
.cs-modal-meta-item { background: var(--surface); padding: 14px 16px; }
.cs-modal-meta-item div:last-child { font-size: .9rem; color: var(--text); margin-top: 4px; font-weight: 500; }
.cs-modal-foot {
  padding: 18px 28px;
  border-top: 1px solid var(--border);
  text-align: right;
}
