/* ============================================================
   PHUKET360 — rich-term.css
   Texte enrichi interactif.
   Desktop : popover au clic.
   Mobile  : bottom sheet.
   Mobile-first.
   ============================================================ */

/* ── Terme dans le texte ─────────────────────────────────────── */
.rich-term {
  cursor: pointer;
  border-bottom: 1.5px dotted var(--ocean);
  color: inherit;
  text-decoration: none;
  display: inline;
  transition: color var(--transition);
}
.rich-term:hover,
.rich-term.rt-open {
  color: var(--ocean);
}

/* ── Popover desktop ─────────────────────────────────────────── */
.rt-popover {
  position: fixed;
  z-index: 4000;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.18), 0 0 0 1px rgba(0, 0, 0, 0.06);
  max-width: 260px;
  min-width: 180px;
  max-height: 80vh;
  overflow-x: hidden;
  overflow-y: auto;
  opacity: 0;
  transform: translateY(6px) scale(0.97);
  transition: opacity 0.18s ease, transform 0.18s ease;
  pointer-events: none;
}
.rt-popover.rt-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Version large quand image présente */
.rt-popover.rt-has-img {
  max-width: 340px;
  min-width: 280px;
}

.rt-pop-img {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  display: block;
}

.rt-pop-content {
  padding: 13px 15px;
}

.rt-pop-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ocean-deep);
  margin: 0 0 5px;
  line-height: 1.2;
}

.rt-pop-desc {
  font-size: 0.84rem;
  color: var(--text-light);
  line-height: 1.55;
  margin: 0;
}

.rt-pop-caption {
  font-size: 0.72rem;
  color: #aaa;
  margin: 8px 0 0;
  font-style: italic;
  text-align: center;
  padding: 6px 12px 2px;
}

.rt-pop-close {
  position: absolute;
  top: 7px;
  right: 7px;
  background: rgba(0, 0, 0, 0.32);
  border: none;
  border-radius: 50%;
  width: 22px;
  height: 22px;
  color: var(--white);
  font-size: 0.75rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  z-index: 1;
}
.rt-popover.rt-no-img .rt-pop-close {
  background: #e8edf2;
  color: var(--text);
}

/* ── Overlay ─────────────────────────────────────────────────── */
.rt-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.42);
  z-index: 4000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s;
}
.rt-overlay.rt-visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Bottom sheet ────────────────────────────────────────────── */
.rt-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--white);
  border-radius: 20px 20px 0 0;
  z-index: 4001;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
  max-height: 78vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  will-change: transform;
}
.rt-sheet.rt-visible {
  transform: translateY(0);
}

.rt-sheet-handle {
  width: 36px;
  height: 4px;
  background: #dde1e7;
  border-radius: 2px;
  margin: 12px auto 0;
  flex-shrink: 0;
  touch-action: none;
}

.rt-sheet-head {
  display: flex;
  justify-content: flex-end;
  padding: 6px 16px 4px;
  flex-shrink: 0;
}

.rt-sheet-close {
  background: var(--sable);
  border: none;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  font-size: 0.82rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  line-height: 1;
}
.rt-sheet-close:active { background: #e8edf2; }

.rt-sheet-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.rt-sheet-img {
  width: 100%;
  max-height: 220px;
  object-fit: cover;
  display: block;
}

.rt-sheet-content {
  padding: 16px 20px 36px;
}

.rt-sheet-title {
  font-family: 'Barlow Condensed', sans-serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--ocean-deep);
  margin: 0 0 8px;
  line-height: 1.2;
}

.rt-sheet-desc {
  font-size: 0.92rem;
  color: var(--text-light);
  line-height: 1.6;
  margin: 0;
}

.rt-sheet-caption {
  font-size: 0.78rem;
  color: #aaa;
  margin-top: 10px;
  font-style: italic;
  text-align: center;
  padding: 6px 12px 2px;
}

/* ── Desktop uniquement : on masque overlay + sheet ─────────── */
@media (min-width: 768px) {
  .rt-overlay,
  .rt-sheet { display: none !important; }
}

/* ── Mobile uniquement : on masque popover ──────────────────── */
@media (max-width: 767px) {
  .rt-popover { display: none !important; }
}
