/* Watys CMS — design public moderne (polices chargées via <link> dans le HTML) */

:root {
  --ink: #0f1c24;
  --ink-soft: #3a4f5c;
  --paper: #f4f7f5;
  --panel: #ffffff;
  --accent: #0d9488;
  --accent-deep: #0f766e;
  --accent-glow: rgba(13, 148, 136, 0.18);
  --line: #d7e2dc;
  --warn: #b45309;
  --radius: 14px;
  --shadow: 0 18px 50px rgba(15, 28, 36, 0.08);
  --font-sans: "DM Sans", system-ui, sans-serif;
  --font-display: "Instrument Serif", Georgia, serif;
  --max: 1100px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-sans);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, #c7f0ea 0%, transparent 55%),
    radial-gradient(900px 500px at 100% 0%, #dfe9ff 0%, transparent 50%),
    linear-gradient(180deg, #eef5f2 0%, var(--paper) 40%, #e8f0ec 100%);
  min-height: 100vh;
  line-height: 1.6;
}

img { max-width: 100%; height: auto; }
a { color: var(--accent-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ink); }

.wrap { width: min(var(--max), calc(100% - 2rem)); margin-inline: auto; }

.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(12px);
  background: rgba(244, 247, 245, 0.85);
  border-bottom: 1px solid rgba(215, 226, 220, 0.8);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; padding: 0.9rem 0;
}
.brand {
  font-family: var(--font-display);
  font-size: 1.55rem; letter-spacing: 0.01em;
  color: var(--ink); text-decoration: none;
}
.brand span { color: var(--accent); }

/* ===== Menu principal (barre + déroulants) ===== */
.nav { display: flex; align-items: center; }
.nav ul {
  list-style: none !important;
  list-style-type: none !important;
  margin: 0;
  padding: 0;
}
.nav .menu {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 0.15rem;
}
.nav-item { position: relative; }
.nav-item > a {
  display: inline-flex; align-items: center; gap: 0.3rem;
  color: var(--ink-soft); text-decoration: none; font-weight: 500; font-size: 0.95rem;
  padding: 0.5rem 0.7rem; border-radius: 8px; white-space: nowrap;
}
.nav-item > a:hover,
.nav-item.is-current > a { color: var(--ink); background: rgba(13, 148, 136, 0.08); }
.nav-caret { font-size: 0.65rem; opacity: 0.65; margin-left: 0.15rem; }

/* Panneau déroulant : caché par défaut, visible au survol */
.menu > .nav-item > .sub-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 280px;
  max-width: min(360px, 90vw);
  padding: 0.45rem;
  margin-top: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: var(--shadow);
  z-index: 100;
}
.menu > .nav-item:hover > .sub-menu,
.menu > .nav-item:focus-within > .sub-menu,
.menu > .nav-item.is-open > .sub-menu {
  display: block;
}

/* Ligne lien + bouton déplier (dans le panneau) */
.nav-row {
  display: flex;
  align-items: stretch;
  gap: 0.15rem;
}
.nav-row > a {
  flex: 1;
  display: block;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  white-space: normal;
  line-height: 1.35;
}
.nav-row > a:hover { background: rgba(13, 148, 136, 0.1); color: var(--ink); }
.nav-item.has-children > .nav-row > a { font-weight: 700; color: var(--ink); }

.nav-expand {
  flex: 0 0 2rem;
  width: 2rem;
  border: 0;
  background: transparent;
  border-radius: 8px;
  cursor: pointer;
  color: var(--ink-soft);
  font-size: 0.75rem;
  line-height: 1;
  padding: 0;
}
.nav-expand:hover { background: rgba(13, 148, 136, 0.12); color: var(--ink); }

/* Feuilles (sans enfants) : pas de gras */
.sub-menu .nav-item:not(.has-children) > .nav-row > a {
  font-weight: 500;
  color: var(--ink-soft);
}

/* Sous-niveaux : cachés par défaut, visibles si .is-expanded */
.sub-menu .sub-menu {
  display: none;
  position: static;
  min-width: 0;
  max-width: none;
  margin: 0.15rem 0 0.35rem;
  padding: 0 0 0 0.65rem;
  border: 0;
  border-left: 2px solid var(--line);
  box-shadow: none;
  background: transparent;
}
.nav-item.is-expanded > .sub-menu {
  display: block;
}

.nav-toggle {
  display: none; border: 1px solid var(--line); background: var(--panel);
  border-radius: 10px; padding: 0.45rem 0.7rem; font: inherit; cursor: pointer;
}

.hero {
  padding: 4.5rem 0 3rem;
  animation: rise 0.7s ease both;
}
.hero-kicker {
  display: inline-block; font-size: 0.8rem; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent-deep); font-weight: 700;
  margin-bottom: 0.8rem;
}
.hero-content { max-width: 40rem; margin-bottom: 1.6rem; }
.hero-content h1 {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  line-height: 1.05; margin: 0 0 1rem; font-weight: 400;
}
.hero-content p {
  font-size: 1.1rem; color: var(--ink-soft); margin: 0 0 0.9rem;
}
.cta-row { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.75rem 1.2rem; border-radius: 999px; font-weight: 700;
  text-decoration: none; border: 1px solid transparent; transition: .2s ease;
}
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: var(--accent-deep); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-deep); }

.content-panel {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px); box-shadow: var(--shadow);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  margin: 0 0 3rem;
  animation: rise 0.6s ease .1s both;
}
.content-panel h1, .content-panel h2, .content-panel h3 {
  font-family: var(--font-display); font-weight: 400; line-height: 1.2;
}
.content-panel h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-top: 0; }
.prose :is(h2,h3) { margin-top: 1.8rem; }
.prose pre, .prose code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #0f1c24; color: #d7f5ef; border-radius: 8px;
}
.prose pre { padding: 1rem; overflow-x: auto; }
.prose code { padding: 0.1rem 0.35rem; }
.prose pre code { padding: 0; background: transparent; }
.prose ul { padding-left: 1.2rem; }
.prose img { border-radius: 12px; }

.site-footer {
  border-top: 1px solid var(--line);
  padding: 2rem 0 2.5rem; color: var(--ink-soft); font-size: 0.92rem;
}
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; }

.not-found { text-align: center; padding: 5rem 0; }
.not-found h1 { font-family: var(--font-display); font-size: 3rem; font-weight: 400; }

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav {
    display: none;
    width: 100%;
    padding: 0.6rem 0 0.9rem;
  }
  .nav.is-open { display: block; }
  .nav .menu {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    flex-wrap: wrap;
  }
  .nav-item > a { white-space: normal; }
  .menu > .nav-item > .sub-menu {
    position: static;
    display: none;
    box-shadow: none;
    border: 1px solid var(--line);
    margin: 0.25rem 0 0.5rem;
    max-width: none;
  }
  .menu > .nav-item.is-open > .sub-menu { display: block; }
  .header-inner { flex-wrap: wrap; }
  .hero { padding-top: 3rem; }
}
