.afra-rich-content {
  display: flow-root;
  gap: 16px;
  min-width: 0;
  max-width: 100%;
  color: #111827;
  font-size: 14px;
  line-height: 2;
}

.afra-rich-content > * {
  min-width: 0;
  max-width: 100%;
  margin: 0;
}

.afra-rich-content::after {
  content: "";
  display: block;
  clear: both;
}

.afra-rich-content h1,
.afra-rich-content h2,
.afra-rich-content h3,
.afra-rich-content h4,
.afra-rich-content h5,
.afra-rich-content h6 {
  color: #111827;
  line-height: 1.6;
  font-weight: 800;
}

.afra-rich-content h1 {
  font-size: clamp(26px, 2.1vw, 34px);
}

.afra-rich-content h2 {
  font-size: clamp(22px, 1.9vw, 29px);
}

.afra-rich-content h3 {
  font-size: clamp(19px, 1.6vw, 24px);
}

.afra-rich-content h4 {
  font-size: 18px;
}

.afra-rich-content h5,
.afra-rich-content h6 {
  font-size: 15px;
}

.afra-rich-content p,
.afra-rich-content li,
.afra-rich-content blockquote,
.afra-rich-content td,
.afra-rich-content th,
.afra-rich-content figcaption {
  color: #4b5563;
}

.afra-rich-content ul,
.afra-rich-content ol {
  margin: 0;
  padding-inline-start: 22px;
  display: grid;
  gap: 10px;
}

.afra-rich-content a {
  color: #8c5a12;
  font-weight: 700;
  text-decoration: none;
}

.afra-rich-content blockquote {
  padding: 14px 16px;
  border-inline-start: 4px solid rgba(180, 124, 18, 0.36);
  border-radius: 0 18px 18px 0;
  background: rgba(255, 247, 228, 0.9);
}

.afra-rich-content figure {
  display: grid;
  gap: 10px;
}

.afra-rich-content figure.image,
.afra-rich-content figure.afra-media-block {
  margin: 1.5rem auto;
  max-width: 100%;
}

.afra-rich-content figure.image.image-style-side {
  float: inline-end;
  width: min(46%, 360px);
  margin-block: 0.2rem 1rem;
  margin-inline: 1.25rem 0;
}

.afra-rich-content figure.image.image-style-align-left {
  float: left;
  width: min(46%, 360px);
  margin: 0.2rem 1.25rem 1rem 0;
}

.afra-rich-content figure.image.image-style-align-right {
  float: right;
  width: min(46%, 360px);
  margin: 0.2rem 0 1rem 1.25rem;
}

.afra-rich-content figure.image.image-style-align-center {
  margin-inline: auto;
}

.afra-rich-content .afra-media-block {
  display: grid;
  gap: 10px;
  margin-inline: auto;
}

.afra-rich-content img,
.afra-rich-content video,
.afra-rich-content audio,
.afra-rich-content iframe {
  display: block;
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 24px;
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.08);
}

.afra-rich-content img,
.afra-rich-content video {
  max-height: 620px;
  object-fit: contain;
}

.afra-rich-content audio {
  width: min(100%, 460px);
  padding: 10px 12px;
}

.afra-rich-content figure.table {
  display: block;
  width: 100%;
  margin: 1.5rem 0;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgba(229, 231, 235, 0.88);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
  scrollbar-color: rgba(168, 131, 31, 0.42) rgba(250, 250, 251, 0.95);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.afra-rich-content table {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.88);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.07);
  color: var(--text-secondary, #4b5563);
  font-size: 13px;
  line-height: 1.85;
  text-align: start;
  direction: rtl;
}

.afra-rich-content > table {
  margin: 1.5rem 0;
}

.afra-rich-content figure.table table {
  margin: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.afra-rich-content caption {
  padding: 0 0 12px;
  color: var(--text-primary, #111827);
  font-size: 14px;
  font-weight: 800;
  text-align: start;
}

.afra-rich-content th,
.afra-rich-content td {
  min-width: 148px;
  padding: 12px 14px;
  border-block-end: 1px solid rgba(229, 231, 235, 0.82);
  color: var(--text-secondary, #4b5563);
  vertical-align: middle;
}

.afra-rich-content th:not(:last-child),
.afra-rich-content td:not(:last-child) {
  border-inline-end: 1px solid rgba(229, 231, 235, 0.62);
}

.afra-rich-content tr:last-child > th,
.afra-rich-content tr:last-child > td {
  border-block-end: 0;
}

.afra-rich-content thead th,
.afra-rich-content tbody th,
.afra-rich-content tr:first-child > th {
  background: linear-gradient(180deg, rgba(250, 250, 251, 0.98), rgba(245, 245, 247, 0.98));
  color: var(--text-primary, #111827);
  font-weight: 900;
}

.afra-rich-content tbody tr:nth-child(even) > th,
.afra-rich-content tbody tr:nth-child(even) > td {
  background: rgba(250, 250, 251, 0.72);
}

.afra-rich-content tbody td:first-child,
.afra-rich-content tbody th:first-child {
  color: var(--text-primary, #111827);
  font-weight: 800;
}

.afra-rich-content tbody tr:hover > th,
.afra-rich-content tbody tr:hover > td {
  background: rgba(201, 162, 39, 0.07);
}

.afra-rich-content figure.table::-webkit-scrollbar {
  height: 7px;
}

.afra-rich-content figure.table::-webkit-scrollbar-track {
  background: rgba(250, 250, 251, 0.95);
}

.afra-rich-content figure.table::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(168, 131, 31, 0.38);
}

.afra-rich-content .afra-embed-frame {
  overflow: hidden;
  border-radius: 24px;
  background: #0f172a;
}

.afra-rich-content .afra-embed-frame iframe {
  border: 0;
  aspect-ratio: 16 / 9;
  min-height: 240px;
}

.afra-rich-content .afra-color-default {
  color: #111827;
}

.afra-rich-content .afra-color-gold {
  color: #8c5a12;
}

.afra-rich-content .afra-color-teal {
  color: #0f766e;
}

.afra-rich-content .afra-color-navy {
  color: #1d4ed8;
}

.afra-rich-content .afra-color-berry {
  color: #b42318;
}

.afra-rich-content .afra-color-muted {
  color: #4b5563;
}

.afra-rich-content .afra-bg-cream {
  background: #fff5dc;
}

.afra-rich-content .afra-bg-lavender {
  background: #ede9fe;
}

.afra-rich-content .afra-bg-mint {
  background: #dcfce7;
}

.afra-rich-content .afra-bg-sky {
  background: #dbeafe;
}

.afra-rich-content .afra-bg-rose {
  background: #fee2e2;
}

.afra-rich-content .afra-bg-smoke {
  background: #f3f4f6;
}

.afra-rich-content [style*="font-family"] {
  font-family: inherit !important;
}

.afra-rich-content .afra-font-default {
  font-family: inherit !important;
}

.afra-rich-content .afra-font-serif {
  font-family: inherit !important;
}

.afra-rich-content .afra-font-sans {
  font-family: inherit !important;
}

.afra-rich-content .afra-font-mono {
  font-family: inherit !important;
}

@media (min-width: 760px) {
  .afra-rich-content figure.table {
    margin-block: 1.75rem;
    border-radius: 24px;
  }

  .afra-rich-content table {
    border-radius: 24px;
    font-size: 14px;
    line-height: 1.95;
  }

  .afra-rich-content th,
  .afra-rich-content td {
    min-width: 164px;
    padding: 15px 18px;
  }
}

@media (max-width: 759px) {
  .afra-rich-content figure.table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    contain: inline-size;
    margin: 1rem 0;
    overflow-x: auto;
    border-radius: 16px;
    box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.04));
  }

  .afra-rich-content figure.table table {
    width: 100%;
    min-width: 0;
  }

  .afra-rich-content table {
    width: 100%;
    inline-size: 100%;
    min-width: 0;
    max-width: 100%;
    max-inline-size: 100%;
    table-layout: fixed;
    border-radius: 16px;
    font-size: 10.5px;
    line-height: 1.65;
  }

  .afra-rich-content th,
  .afra-rich-content td {
    min-width: 0;
    padding: 8px 6px;
    white-space: normal;
    max-width: 0;
    overflow-wrap: anywhere;
    word-break: normal;
  }

  .afra-rich-content th:first-child,
  .afra-rich-content td:first-child {
    width: 34%;
  }

  .afra-rich-content thead th,
  .afra-rich-content tr:first-child > th {
    position: static;
    top: auto;
    z-index: auto;
  }

  .afra-rich-content figure.table th:first-child,
  .afra-rich-content figure.table td:first-child {
    position: static;
    right: auto;
    z-index: auto;
    box-shadow: none;
  }

  .afra-rich-content h1,
  .afra-rich-content h2,
  .afra-rich-content h3,
  .afra-rich-content h4 {
    overflow-wrap: anywhere;
  }
}
