/* =============================================
   CS Plan sàrl — v4 Single Page Scrollable
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Bebas+Neue&family=Inter:wght@300;400;500&display=swap');

/* ----- Variables ----- */
:root {
  --bg:          #f5f1ea;
  --bg-section:  #dedad3;
  --bg-card:     #ffffff;
  --border:      #cdc7bc;
  --text:        #2a2a2a;
  --text-muted:  #7a7368;
  --accent:      #1e6fb5;
  --accent-h:    #2585d4;
  --hf-bg:       #1a1a1a;
  --hf-border:   #2e2e2e;
  --hf-text:     #d0ccc6;
  --hf-muted:    #888888;
  --white:       #ffffff;
  --font-head:   'Bebas Neue', 'Arial Narrow', Arial, sans-serif;
  --font-body:   'Inter', Verdana, Arial, sans-serif;
  --max-w:       1100px;
  --radius:      4px;
  --header-h:    64px;
}

/* ----- Reset ----- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-h); text-decoration: underline; }
img { max-width: 100%; display: block; }
ul { list-style: none; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 400;
  letter-spacing: 0.04em;
  line-height: 1.1;
  color: var(--text);
}
h2 { font-size: 2rem; margin-bottom: 1.2rem; }
h3 { font-size: 1.5rem; margin-bottom: 0.8rem; color: var(--accent); }
p { margin-bottom: 1rem; }
hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }

/* ----- Header / Nav ----- */
header {
  background-color: var(--hf-bg);
  border-bottom: 1px solid var(--hf-border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: var(--header-h);
}

/* Logo */
.logo a {
  font-family: var(--font-head);
  font-size: 1.8rem;
  letter-spacing: 0.1em;
  color: var(--white);
  text-decoration: none;
}
.logo a:hover { color: var(--accent-h); text-decoration: none; }
.logo .cs   { color: var(--accent); }
.logo .plan { color: var(--white); }
.logo .sarl { font-size: 1rem; color: var(--hf-muted); letter-spacing: 0.05em; }

/* Nav links */
nav ul {
  display: flex;
  gap: 4px;
  align-items: center;
}
nav ul li a {
  display: flex;
  align-items: center;
  height: var(--header-h);
  padding: 0 16px;
  color: var(--hf-text);
  font-size: 0.85rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
nav ul li a:hover,
nav ul li a.active {
  background-color: var(--accent);
  color: var(--white);
}

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--hf-border);
  color: var(--hf-text);
  font-size: 1.4rem;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: var(--radius);
}

/* ----- Main ----- */
main {
  flex: 1;
  width: 100%;
}

/* ----- Sections communes ----- */
section {
  padding: 64px 20px;
  scroll-margin-top: var(--header-h);
}

#accueil      { background-color: var(--bg);         padding-top: 36px; padding-bottom: 36px; }
#presentation { background-color: var(--bg-section); }
#activites    { background-color: var(--bg); }
#realisations { background-color: var(--bg-section); }
#contact      { background-color: var(--bg); }

.section-inner {
  max-width: var(--max-w);
  margin: 0 auto;
}

.section-header {
  border-left: 4px solid var(--accent);
  padding-left: 16px;
  margin-bottom: 2.4rem;
}

/* ----- Footer ----- */
footer {
  background-color: var(--hf-bg);
  border-top: 1px solid var(--hf-border);
}
.footer-inner {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 32px 20px 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}
.footer-info p {
  margin-bottom: 0.35rem;
  font-size: 0.83rem;
  color: var(--hf-muted);
}
.footer-info .company {
  font-family: var(--font-head);
  font-size: 1.1rem;
  color: var(--hf-text);
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.footer-info a { color: var(--hf-muted); text-decoration: none; }
.footer-info a:hover { color: var(--accent-h); }

.footer-links h4 {
  font-family: var(--font-head);
  font-size: 0.85rem;
  color: var(--hf-text);
  letter-spacing: 0.1em;
  font-weight: 400;
  margin-bottom: 8px;
}
.footer-links-group {
  margin-bottom: 16px;
}
.footer-links-group a {
  display: inline-block;
  color: var(--hf-muted);
  font-size: 0.8rem;
  margin-right: 14px;
  margin-bottom: 4px;
  text-decoration: none;
  transition: color 0.2s;
}
.footer-links-group a:hover { color: var(--accent-h); }

.footer-copy {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 12px 20px;
  border-top: 1px solid var(--hf-border);
  font-size: 0.75rem;
  color: var(--hf-muted);
  text-align: center;
}

/* ----- Slideshow (accueil) ----- */
.slideshow-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16/8;
  overflow: hidden;
  background: #000;
  border-radius: var(--radius);
  box-shadow: 0 4px 24px rgba(0,0,0,0.35);
}
.slideshow-wrap .slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 1s ease-in-out;
}
.slideshow-wrap .slide.active { opacity: 1; }

.slide-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0,0,0,0.45);
  border: none;
  color: #fff;
  font-size: 1.6rem;
  padding: 8px 14px;
  cursor: pointer;
  z-index: 10;
  border-radius: var(--radius);
  transition: background 0.2s;
}
.slide-btn:hover { background: rgba(30,111,181,0.7); }
.slide-btn.prev { left: 12px; }
.slide-btn.next { right: 12px; }

.slide-dots {
  position: absolute;
  bottom: 12px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  z-index: 10;
}
.slide-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  cursor: pointer;
  transition: background 0.2s;
}
.slide-dots span.active { background: var(--accent); }

/* ----- Présentation ----- */
.presentation-text {
  margin-bottom: 2rem;
  max-width: 760px;
}
.presentation-text p { margin-bottom: 0.9rem; }

.person-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  max-width: 620px;
}
.person-card h2 { font-size: 1.6rem; margin-bottom: 0.2rem; }
.person-card .role { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 1.4rem; }
.person-card h3 { font-size: 1.2rem; color: var(--accent); margin-bottom: 0.6rem; }
.person-card ul { list-style: square; padding-left: 1.4rem; }
.person-card ul li { margin-bottom: 0.45rem; font-size: 0.95rem; }

/* ----- Activités ----- */
.activites-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.activite-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.activite-card:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 16px rgba(30,111,181,0.1);
}
.activite-card h3 {
  font-size: 1.25rem;
  color: var(--accent);
  margin-bottom: 1rem;
  padding-bottom: 0.6rem;
  border-bottom: 1px solid var(--border);
}
.activite-card ul { list-style: square; padding-left: 1.2rem; }
.activite-card ul li { margin-bottom: 0.5rem; font-size: 0.93rem; color: var(--text); }

/* ----- Réalisations ----- */
.pdf-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 10px 20px;
  border-radius: var(--radius);
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2rem;
  transition: background 0.2s, color 0.2s;
  text-decoration: none;
}
.pdf-link:hover { background: var(--accent); color: var(--white); text-decoration: none; }
.pdf-link::before { content: "↓"; font-size: 1rem; }

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 24px;
}
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
}
.project-card:hover { border-color: var(--accent); }
.project-card img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.project-card .proj-info { padding: 14px 16px; }
.project-card .proj-info h3 { font-size: 1.1rem; margin-bottom: 0.3rem; color: var(--text); }
.project-card .proj-info p { font-size: 0.85rem; color: var(--text-muted); margin: 0; }

.projects-empty {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-style: italic;
  padding: 1.5rem 0;
}

/* ----- Contact ----- */
.contact-layout {
  display: flex;
  gap: 32px;
  flex-wrap: wrap;
  align-items: flex-start;
}
.contact-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 32px;
  min-width: 280px;
}
.contact-card p { margin-bottom: 0.4rem; }
.contact-card .company-name {
  font-family: var(--font-head);
  font-size: 1.4rem;
  color: var(--text);
  margin-bottom: 0.8rem;
}
.contact-card a { color: var(--accent); }
.contact-card a:hover { color: var(--accent-h); }

.map-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 18px;
  color: var(--text-muted);
  font-size: 0.88rem;
  transition: border-color 0.2s, color 0.2s;
  text-decoration: none;
}
.map-link:hover { border-color: var(--accent); color: var(--accent-h); text-decoration: none; }
.map-link::before { content: "↗\00a0"; }

/* ----- Pages d'erreur (404, 500…) ----- */
#erreur { background-color: var(--bg); min-height: 60vh; display: flex; align-items: center; }
.erreur-wrap {
  text-align: center;
  padding: 60px 20px;
}
.erreur-code {
  font-family: var(--font-head);
  font-size: 8rem;
  line-height: 1;
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.erreur-wrap h2 { font-size: 2rem; margin-bottom: 1rem; }
.erreur-wrap p  { color: var(--text-muted); margin-bottom: 2rem; }
.erreur-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--accent);
  color: var(--white);
  padding: 12px 28px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.2s;
}
.erreur-btn:hover { background: var(--accent-h); color: var(--white); text-decoration: none; }

/* ----- Bouton retour en haut ----- */
#back-to-top {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 44px;
  height: 44px;
  background: var(--accent);
  color: var(--white);
  border: none;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s, background 0.2s;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
#back-to-top.visible { opacity: 1; pointer-events: auto; }
#back-to-top:hover { background: var(--accent-h); }

/* ----- Responsive ----- */
@media (max-width: 900px) {
  .activites-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .nav-toggle { display: block; }
  nav ul {
    display: none;
    flex-direction: column;
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--hf-bg);
    border-bottom: 1px solid var(--hf-border);
    padding: 12px 0;
    gap: 2px;
  }
  nav ul.open { display: flex; }
  nav ul li a { height: auto; padding: 14px 20px; width: 100%; }
  .slideshow-wrap { aspect-ratio: 4/3; }
  .projects-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  section { padding: 40px 16px; }
}