/* The editorial block and the dialog its cards open, from the legacy
   `SymbolContent.vue`, `SymbolContentCard.vue` and `SymbolContentPopup.vue`. */

/* "قیمت لحظه‌ای بیت‌کوین", over the prose. */
.symbol-prose-title {
  margin-bottom: 8px;
  color: var(--gray-900);
  font-size: 24px;
  font-weight: 700;
}

.symbol-prose-text {
  color: var(--gray-500);
  font-size: 16px;
  font-weight: 400;
  line-height: 26px;
  text-align: justify;
}

.symbol-prose-text p {
  margin: 0 0 12px;
}

.symbol-prose-text ul,
.symbol-prose-text ol {
  padding-inline-start: 1.5rem;
  margin: 0 0 12px;
}

.symbol-prose-text a {
  color: var(--identity);
  text-decoration: underline;
}

/* One column on a phone, two from 1000px, with the first card spanning both —
   the legacy's `full-width-card`, which it puts on index 0. */
.symbol-prose-cards {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin: 16px 0;
}

/* A button, so it is focusable and answers the keyboard; reset to look like the
   legacy's div rather than like a control. */
.symbol-prose-card {
  display: block;
  width: 100%;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background-color: var(--gray-0);
  font: inherit;
  color: inherit;
  text-align: start;
  cursor: pointer;
}

.symbol-prose-card:focus-visible {
  outline: 2px solid var(--identity);
  outline-offset: 2px;
}

/* Flex for the gap the legacy leaves for an icon it has commented out; the gap
   costs nothing while the icon is absent and keeps the line-box the same. */
.symbol-prose-card-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--gray-900);
  font-size: 16px;
  font-weight: 700;
}

/* Three lines on the face; the rest is what the dialog is for. `pre-line`
   because an editor's newlines are how these are written. */
.symbol-prose-card-short {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 16px;
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 400;
  line-height: 20px;
  white-space: pre-line;
}

/* "مشاهده بیشتر" and its arrow, at the foot of every card. */
.symbol-prose-card-action {
  display: flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  margin-top: 16px;
  color: var(--gray-900);
  font-size: 14px;
  font-weight: 400;
}

.symbol-prose-card-action-icon {
  flex: none;
  color: var(--gray-900);
}

@media (min-width: 1000px) {
  .symbol-prose-cards {
    grid-template-columns: repeat(2, 1fr);
    margin: 16px 0 80px;
  }

  .symbol-prose-card--wide {
    grid-column: 1 / -1;
  }
}

/* --- The dialog --- */

/* A bottom sheet on a phone and a centred 500px panel from 1000px, which is
   what the legacy's `.popup-inner` is: fixed to the bottom edge with only its
   top corners rounded, then re-anchored and given a width at the breakpoint.

   `max-width: none` and the explicit `inset` override the UA's centring for a
   modal dialog; `margin: 0` because on a phone this is flush to the bottom, and
   the global reset has already removed the UA's `margin: auto`. */
.symbol-prose-dialog {
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: none;
  max-height: calc(100vh - 32px);
  margin: 0;
  padding: 16px;
  border: none;
  border-radius: 16px 16px 0 0;
  background-color: var(--gray-0);
  color: var(--gray-900);
  overflow: auto;
}

.symbol-prose-dialog::backdrop {
  background-color: rgba(0, 0, 0, 0.4);
}

/* The legacy's close control is absolutely positioned with no offsets, so it
   renders at its static position — the start of the first line, which in an RTL
   document is the top right. `inset-inline-start` is that edge. */
.symbol-prose-dialog-close {
  position: absolute;
  inset-block-start: 16px;
  inset-inline-start: 16px;
  display: flex;
  padding: 0;
  border: none;
  background: none;
  color: var(--gray-500);
  cursor: pointer;
}

.symbol-prose-dialog-close:focus-visible {
  outline: 2px solid var(--identity);
  outline-offset: 2px;
}

/* Centred, and padded rather than margined — the legacy uses `padding-bottom`
   here so the rule it sits over is the panel's, not the title's. */
.symbol-prose-dialog-title {
  padding-bottom: 12px;
  color: var(--gray-900);
  font-size: 20px;
  font-weight: 700;
  text-align: center;
}

/* 12px from the title and 12px again inside the item that wraps it in the
   legacy, which is 24px in total before the first line of body copy. */
.symbol-prose-dialog-body {
  margin-top: 24px;
  color: var(--gray-500);
  font-size: 14px;
  font-weight: 400;
  line-height: 23px;
}

.symbol-prose-dialog-body p {
  margin: 0 0 10px;
}

.symbol-prose-dialog-body ul,
.symbol-prose-dialog-body ol {
  padding-inline-start: 1.5rem;
  margin: 0 0 10px;
}

.symbol-prose-dialog-body a {
  color: var(--identity);
  text-decoration: underline;
}

@media (min-width: 1000px) {
  /* Centred and fixed-width, with every corner rounded. `inset: 0` plus
     `margin: auto` is what centres a fixed box in both axes. */
  .symbol-prose-dialog {
    inset: 0;
    width: 500px;
    height: fit-content;
    margin: auto;
    border-radius: 16px;
  }
}
