/* ============================
   Variables
   ============================ */
:root {
  --bg: #f7f6f4;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-muted: #888;
  --border: #e2dfdb;
  --header-h: 58px;
  --radius: 4px;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: system-ui, -apple-system, 'Segoe UI', Helvetica, Arial, sans-serif;
  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; }
ul { list-style: none; }

/* ============================
   Header
   ============================ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.75rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.logo span {
  font-weight: 400;
  color: var(--text-muted);
}

.main-nav ul {
  display: flex;
  gap: 2rem;
}
.main-nav a {
  font-size: 0.875rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.main-nav a:hover { color: var(--text); }

/* Burger */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  border-radius: var(--radius);
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: opacity 0.2s, transform 0.2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ============================
   Carousel
   ============================ */
.carousel-section {
  background: #111;
}

.carousel {
  position: relative;
  width: 100%;
  height: calc(100svh - var(--header-h));
  min-height: 300px;
  max-height: 820px;
  overflow: hidden;
  user-select: none;
}

.carousel-track-wrapper {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.55s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: transform;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Placeholder slide (couleur de fond) */
.carousel-slide.is-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-slide.is-placeholder .slide-label {
  color: rgba(255, 255, 255, 0.35);
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* Flèches */
.carousel-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 2.2rem;
  line-height: 1;
  width: 44px;
  height: 60px;
  cursor: pointer;
  border-radius: var(--radius);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-btn:hover { background: rgba(255, 255, 255, 0.25); }
.carousel-btn.prev { left: 1.25rem; }
.carousel-btn.next { right: 1.25rem; }

/* Points */
.carousel-dots {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 0.45rem;
}
.carousel-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.35);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, transform 0.2s;
}
.carousel-dot.active {
  background: #fff;
  transform: scale(1.3);
}

/* ============================
   Section Instagram
   ============================ */
.instagram-section {
  padding: 4rem 1.75rem 4.5rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.instagram-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap;
}

.instagram-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.instagram-profile-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 2rem;
  padding: 0.35rem 0.85rem 0.35rem 0.6rem;
  transition: color 0.15s, border-color 0.15s;
}
.instagram-profile-btn:hover {
  color: var(--text);
  border-color: #aaa;
}
.instagram-profile-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.instagram-posts {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
  align-items: start;
}
.instagram-posts--single {
  grid-template-columns: minmax(0, 540px);
  justify-content: center;
}

/* Les blockquotes Instagram injectent leur propre iframe —
   on force la largeur pour qu'ils s'inscrivent dans la grille */
.instagram-posts .instagram-media {
  width: 100% !important;
  min-width: 0 !important;
  margin: 0 !important;
}

@media (max-width: 800px) {
  .instagram-posts { grid-template-columns: 1fr; }
}

/* ============================
   Section Calendrier
   ============================ */
.calendar-section {
  padding: 4rem 1.75rem 5rem;
}

.section-inner {
  max-width: 960px;
  margin: 0 auto;
}

.calendar-section h2 {
  font-size: 1.4rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 1.75rem;
}

.calendar-wrapper {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.calendar-wrapper iframe {
  width: 100%;
  height: 600px;
  display: block;
}

.calendar-note {
  padding: 0.65rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.calendar-note code {
  font-family: 'SFMono-Regular', Consolas, monospace;
  background: #ebebeb;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  font-size: 0.9em;
}

/* ============================
   Instagram
   ============================ */
.instagram-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-muted);
  transition: color 0.15s;
}
.instagram-link:hover { color: var(--text); }

.instagram-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

/* Dans le footer : texte + icône centrés */
.footer-instagram {
  margin-top: 0.6rem;
  font-size: 0.8rem;
}

/* ============================
   Footer
   ============================ */
.site-footer {
  text-align: center;
  padding: 1.75rem;
  font-size: 0.8rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.1rem;
}

/* ============================
   Page Mode d'emploi — sous-nav
   ============================ */
.page-subnav {
  position: sticky;
  top: var(--header-h);
  z-index: 90;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-subnav-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 0 1.75rem;
  display: flex;
  gap: 0;
}

.subnav-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  padding: 0.85rem 1.25rem;
  font-size: 0.875rem;
  font-family: inherit;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
  margin-bottom: -1px;
}
.subnav-btn:hover { color: var(--text); }
.subnav-btn.active {
  color: var(--text);
  border-bottom-color: var(--text);
  font-weight: 500;
}

/* Panneaux de contenu */
.tab-panel {
  display: none;
  padding: 3.5rem 1.75rem 5rem;
}
.tab-panel.active { display: block; }

.tab-panel-inner {
  max-width: 960px;
  margin: 0 auto;
}

.tab-panel h2 {
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: 0.5rem;
}

.subsections {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-top: 2rem;
}

.subsection {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  background: var(--surface);
}

.subsection h3 {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  border-bottom: 1px solid var(--border);
}

@media (max-width: 640px) {
  .subsections { grid-template-columns: 1fr; }
}

.tab-panel .placeholder-text {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 1.5rem;
  padding: 2rem;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  text-align: center;
}

/* Nav active sur la page mode-emploi */
.nav-active { color: var(--text) !important; }

@media (max-width: 640px) {
  .page-subnav-inner { padding: 0 0.5rem; }
  .subnav-btn { padding: 0.75rem 0.9rem; font-size: 0.82rem; }
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 640px) {
  .nav-toggle { display: flex; }

  .main-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0.75rem 1.75rem 1rem;
  }
  .main-nav.is-open { display: block; }
  .main-nav ul { flex-direction: column; gap: 0; }
  .main-nav li { padding: 0.5rem 0; border-bottom: 1px solid var(--border); }
  .main-nav li:last-child { border-bottom: none; }
  .main-nav a { font-size: 1rem; color: var(--text); }

  .carousel {
    height: 58vw;
    min-height: 200px;
  }
  .carousel-btn {
    width: 36px;
    height: 48px;
    font-size: 1.75rem;
  }

  .calendar-wrapper iframe { height: 440px; }
  .calendar-section { padding: 2.5rem 1.25rem 3rem; }
}
