/* ---------- Base ---------- */
* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: #1a1a1a;
  background: #f4f4f4;
}

/* ---------- Header / Nav ---------- */
.ht-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 24px;
  background: #101820;
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
}
.ht-logo {
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.2rem;
}
.ht-nav {
  display: flex;
  gap: 20px;
}
.ht-nav-link {
  color: #e6e6e6;
  text-decoration: none;
  font-size: 0.95rem;
  padding: 6px 4px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s ease;
}
.ht-nav-link:hover,
.ht-nav-link.ht-active {
  border-color: #f28c28;
  color: #fff;
}

.ht-burger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 26px;
  height: 20px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}
.ht-burger span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
}

@media (max-width: 780px) {
  .ht-burger { display: flex; }
  .ht-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: #101820;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .ht-nav.ht-open {
    max-height: 400px;
  }
  .ht-nav-link {
    padding: 14px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.08);
  }
}

/* ---------- Contenu de page ---------- */
.ht-content {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}
.ht-page-title {
  font-size: 1.6rem;
  margin-bottom: 24px;
}

/* Conteneur du document converti depuis le .odt : structure sémantique
   réelle (h1/h2/p/table...), responsive nativement. */
.ht-doc-wrapper {
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  padding: 24px 28px;
  line-height: 1.6;
  font-size: 1.05rem;
  overflow-x: auto; /* filet de secours pour un très large tableau */
}
.ht-doc-wrapper img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px auto;
}
.ht-doc-wrapper table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  margin: 1em 0;
}
.ht-doc-wrapper td,
.ht-doc-wrapper th {
  word-break: break-word;
}
.ht-doc-wrapper h1,
.ht-doc-wrapper h2,
.ht-doc-wrapper h3 {
  line-height: 1.3;
  margin-top: 1.4em;
}
.ht-doc-wrapper p {
  margin: 0.9em 0;
}

/* Sur mobile, on réduit encore un peu les marges internes */
@media (max-width: 640px) {
  .ht-doc-wrapper {
    padding: 16px;
  }
}

/* ---------- Footer ---------- */
.ht-footer {
  text-align: center;
  padding: 24px;
  font-size: 0.85rem;
  color: #666;
  background: #eee;
}

/* ---------- Lightbox (clic pour agrandir une image) ---------- */
.ht-zoomable { cursor: zoom-in; }
.ht-lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.88);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  cursor: zoom-out;
}
.ht-lightbox-overlay.ht-open {
  opacity: 1;
  pointer-events: auto;
}
.ht-lightbox-overlay img {
  max-width: 92vw;
  max-height: 92vh;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  border-radius: 2px;
}
