/**
 * HTML created by the user with tinyMCE rich text editor
 */
.rich-text {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  overflow-wrap: anywhere;

  h1,
  h2,
  h3,
  h4 {
    font-weight: bold;
  }

  .table-wrap {
    overflow-x: auto;
  }

  table {
    width: 100%;
    border-collapse: collapse;
    border: 1px solid var(--gray-200);
    margin: 8px 0 12px;
  }

  th,
  td {
    border: 1px solid var(--gray-200);
    padding: 8px 10px;
    vertical-align: top;
  }

  thead th {
    background: var(--gray-50);
    font-weight: 600;
  }

  tbody tr:nth-child(even) {
    background: var(--gray-50);
  }

  caption {
    text-align: left;
    font-weight: 600;
    color: var(--gray-700);
    padding: 4px 0 6px;
  }

  img,
  video,
  iframe {
    max-width: 100%;
    height: auto;
  }


  img.zoomable {
    cursor: zoom-in;
    transition:
      transform 180ms ease,
      box-shadow 180ms ease;
  }

  img.zoomable:hover {
    transform: scale(1.03);
    box-shadow: 0 14px 28px rgba(15, 23, 42, 0.18);
  }

  pre,
  code {
    max-width: 100%;
    overflow-x: auto;
  }

  .code.panel {
    border: 1px solid var(--gray-200);
    border-radius: 10px;
    background: var(--gray-50);
    padding: 10px 12px;
  }

  .code.panel .codeContent {
    overflow-x: auto;
  }

  .code.panel pre {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
  }

  .expand-container {
    border: 1px solid color-mix(in srgb, var(--primary-color-300, #9fd9cb) 55%, #ffffff 45%);
    border-radius: 10px;
    padding: 10px 12px;
    background: color-mix(in srgb, #ffffff 92%, var(--primary-color-100, #e6f5f1) 8%);
  }

  .expand-control {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--primary-color-800, #1a5840);
    user-select: none;
  }

  .expand-control:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary-color-300, #9fd9cb) 60%, #ffffff 40%);
    outline-offset: 4px;
    border-radius: 8px;
  }

  .expand-control-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    transition: transform 180ms ease;
  }

  .expand-control-image {
    width: 14px;
    height: 14px;
  }

  .expand-content {
    display: none;
    margin-top: 12px;
  }

  .expand-container.is-open .expand-content {
    display: block;
  }

  .expand-container.is-open .expand-control-icon {
    transform: rotate(180deg);
  }
}

.image-zoom-modal {
  position: fixed;
  inset: 0;
  background: rgba(12, 16, 22, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(16px, 4vw, 40px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 9999;
}

.image-zoom-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

.image-zoom-modal img {
  max-width: min(96vw, 1400px);
  max-height: 86vh;
  width: auto;
  height: auto;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.image-zoom-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(20, 22, 28, 0.7);
  color: #ffffff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.image-zoom-close:hover {
  transform: scale(1.04);
  background: rgba(20, 22, 28, 0.9);
}

body.image-zoom-open {
  overflow: hidden;
}
