:root {
  --reader-background: #f6f3ed;
  --reader-surface: rgba(255, 255, 255, 0.72);
  --reader-text: #25231f;
  --reader-muted: #777168;
  --reader-border: rgba(37, 35, 31, 0.14);
  --reader-accent: #34312c;
}

* {
  box-sizing: border-box;
}

body.reader {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(
      circle at top,
      rgba(255, 255, 255, 0.92),
      transparent 38rem
    ),
    var(--reader-background);
  color: var(--reader-text);
  font-family:
    "Noto Naskh Arabic",
    "Geeza Pro",
    "Traditional Arabic",
    serif;
}

.article-page {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 0 24px 48px;
}

.reader-hero {
  min-height: 52vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 0 48px;
  text-align: center;
}

.reader-hero-content {
  width: min(100%, 760px);
}

.article-type {
  display: inline-block;
  margin-bottom: 20px;
  color: var(--reader-muted);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.84rem;
  letter-spacing: 0.04em;
}

.reader-hero h1 {
  margin: 0;
  font-size: clamp(2.5rem, 8vw, 5.6rem);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

.reader-intro {
  max-width: 650px;
  margin: 28px auto 0;
  color: var(--reader-muted);
  font-size: clamp(1.1rem, 2.6vw, 1.4rem);
  line-height: 2;
}

.reader-content {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 28px 0 64px;
}

/*
  حماية نصوص القارئ من السلاسل الطويلة
  التي قد تسبب horizontal overflow
  على الشاشات الضيقة.
*/
.reader-hero h1,
.reader-intro,
.reader-content,
.reader-support-text,
.reader-authorship,
.reader-footer {
  overflow-wrap: anywhere;
  word-break: normal;
}

.reader-content p {
  margin: 0 0 1.55em;
  font-size: clamp(1.24rem, 2.8vw, 1.52rem);
  line-height: 2.15;
  text-align: right;
}

.reader-expression {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 32px 0 80px;
}

.expression-divider {
  width: 1px;
  height: 76px;
  margin: 0 auto 48px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--reader-border),
    transparent
  );
}

.reader-expression-form {
  width: 100%;
}

.expression-field {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--reader-border);
  border-radius: 24px;
  background: var(--reader-surface);
  box-shadow:
    0 18px 60px rgba(37, 35, 31, 0.05);
  backdrop-filter: blur(10px);
}

.expression-field::before {
  content: "بعد القراءة...";
  position: absolute;
  top: 22px;
  right: 24px;
  z-index: 0;
  color: rgba(37, 35, 31, 0.08);
  font-size: clamp(2rem, 7vw, 4.6rem);
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  user-select: none;
}

.expression-field textarea {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  min-height: 220px;
  resize: vertical;
  border: 0;
  outline: 0;
  padding: 46px 30px 30px;
  background: transparent;
  color: var(--reader-text);
  font: inherit;
  font-size: 1.24rem;
  line-height: 2;
}

.expression-field textarea::placeholder {
  color: rgba(37, 35, 31, 0.24);
  opacity: 1;
}

.expression-field:focus-within {
  border-color: rgba(37, 35, 31, 0.32);
  box-shadow:
    0 20px 70px rgba(37, 35, 31, 0.09);
}

.expression-actions {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 18px;
}

.expression-actions button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  background: var(--reader-accent);
  color: #ffffff;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.95rem;
  cursor: pointer;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.expression-actions button:hover {
  transform: translateY(-1px);
}

.expression-actions button:disabled {
  cursor: default;
  opacity: 0.55;
  transform: none;
}

.expression-optional {
  color: var(--reader-muted);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.82rem;
}

.expression-message {
  margin: 22px 4px 0;
  color: var(--reader-muted);
  font-size: 1rem;
  line-height: 1.8;
}

.expression-message.is-error {
  color: #8a332b;
}

.reader-footer {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 28px 0;
  border-top: 1px solid var(--reader-border);
  text-align: center;
}

.reader-footer a {
  color: var(--reader-muted);
  text-decoration: none;
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.9rem;
}

.reader-footer a:hover {
  color: var(--reader-text);
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (max-width: 640px) {
  .article-page {
    padding-right: 18px;
    padding-left: 18px;
  }

  .reader-hero {
    min-height: 45vh;
    padding-top: 54px;
  }

  .reader-content {
    padding-top: 16px;
  }

  .reader-content p {
    line-height: 2;
  }

  .reader-expression {
    padding-bottom: 54px;
  }

  .expression-field {
    border-radius: 18px;
  }

  .expression-field textarea {
    min-height: 200px;
    padding: 38px 22px 24px;
  }

  .expression-actions {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .expression-actions button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .expression-actions button {
    transition: none;
  }
}


/* =========================================================
   Published authorship
   ========================================================= */

.reader-authorship {
  margin: 42px 0 18px;
  padding-top: 24px;
  border-top: 1px solid rgba(0, 0, 0, 0.10);
}

.reader-authorship-item + .reader-authorship-item {
  margin-top: 18px;
}

.reader-authorship-role {
  display: block;
  margin-bottom: 5px;
  font-size: 0.82rem;
  opacity: 0.58;
}

.reader-authorship-name {
  display: inline-block;
  font-size: 1rem;
}

.reader-authorship-signature {
  display: inline-block;
  margin-inline-start: 8px;
  font-size: 0.92rem;
  opacity: 0.72;
}

.reader-authorship-note {
  margin: 6px 0 0;
  font-size: 0.9rem;
  line-height: 1.7;
  opacity: 0.66;
}


/* =========================================================
   Presentation Render Spec
   Controlled presets only
   ========================================================= */

/* ---------------------------------------------------------
   Themes
   --------------------------------------------------------- */

body.reader[data-reader-theme="PAPER"] {
  --reader-background: #f6f3ed;
  --reader-surface: rgba(255, 255, 255, 0.72);
  --reader-text: #25231f;
  --reader-muted: #777168;
  --reader-border: rgba(37, 35, 31, 0.14);
  --reader-accent: #34312c;
}

body.reader[data-reader-theme="SOFT_WARM"] {
  --reader-background: #f3ede5;
  --reader-surface: rgba(255, 251, 246, 0.74);
  --reader-text: #2d2722;
  --reader-muted: #796d64;
  --reader-border: rgba(72, 57, 46, 0.14);
  --reader-accent: #51453d;
}

body.reader[data-reader-theme="SOFT_COOL"] {
  --reader-background: #eef1f2;
  --reader-surface: rgba(250, 252, 253, 0.74);
  --reader-text: #22292d;
  --reader-muted: #69757b;
  --reader-border: rgba(36, 49, 55, 0.14);
  --reader-accent: #38464d;
}

body.reader[data-reader-theme="REFLECTIVE"] {
  --reader-background: #f0eee9;
  --reader-surface: rgba(250, 249, 246, 0.72);
  --reader-text: #262724;
  --reader-muted: #707169;
  --reader-border: rgba(38, 39, 36, 0.13);
  --reader-accent: #444740;
}

body.reader[data-reader-theme="DEEP"] {
  --reader-background: #1f2223;
  --reader-surface: rgba(255, 255, 255, 0.055);
  --reader-text: #ece9e2;
  --reader-muted: #aaa9a4;
  --reader-border: rgba(255, 255, 255, 0.13);
  --reader-accent: #dedbd4;

  background:
    radial-gradient(
      circle at top,
      rgba(255, 255, 255, 0.055),
      transparent 38rem
    ),
    var(--reader-background);
}

body.reader[data-reader-theme="DEEP"]
.expression-actions button {
  background: var(--reader-text);
  color: var(--reader-background);
}


/* ---------------------------------------------------------
   Font profiles
   --------------------------------------------------------- */

body.reader[data-reader-font="CLASSIC"] {
  font-family:
    "Noto Naskh Arabic",
    "Geeza Pro",
    "Traditional Arabic",
    serif;
}

body.reader[data-reader-font="LITERARY"] {
  font-family:
    "Amiri",
    "Noto Naskh Arabic",
    "Geeza Pro",
    serif;
}

body.reader[data-reader-font="HUMAN"] {
  font-family:
    "Tahoma",
    "Arial",
    sans-serif;
}

body.reader[data-reader-font="CONTEMPORARY"] {
  font-family:
    system-ui,
    -apple-system,
    "Segoe UI",
    "Tahoma",
    sans-serif;
}


/* ---------------------------------------------------------
   Text size
   --------------------------------------------------------- */

body.reader[data-reader-size="COMPACT"]
.reader-content p {
  font-size: clamp(1.08rem, 2.4vw, 1.3rem);
}

body.reader[data-reader-size="STANDARD"]
.reader-content p {
  font-size: clamp(1.24rem, 2.8vw, 1.52rem);
}

body.reader[data-reader-size="GENEROUS"]
.reader-content p {
  font-size: clamp(1.38rem, 3.1vw, 1.72rem);
}


/* ---------------------------------------------------------
   Column width
   --------------------------------------------------------- */

body.reader[data-reader-width="NARROW"]
.reader-content,
body.reader[data-reader-width="NARROW"]
.reader-expression,
body.reader[data-reader-width="NARROW"]
.reader-footer {
  width: min(100%, 620px);
}

body.reader[data-reader-width="STANDARD"]
.reader-content,
body.reader[data-reader-width="STANDARD"]
.reader-expression,
body.reader[data-reader-width="STANDARD"]
.reader-footer {
  width: min(100%, 720px);
}

body.reader[data-reader-width="WIDE"]
.reader-content,
body.reader[data-reader-width="WIDE"]
.reader-expression,
body.reader[data-reader-width="WIDE"]
.reader-footer {
  width: min(100%, 820px);
}


/* ---------------------------------------------------------
   Reading rhythm
   --------------------------------------------------------- */

body.reader[data-reader-spacing="TIGHT"]
.reader-content p {
  margin-bottom: 1.05em;
  line-height: 1.9;
}

body.reader[data-reader-spacing="BALANCED"]
.reader-content p {
  margin-bottom: 1.55em;
  line-height: 2.15;
}

body.reader[data-reader-spacing="OPEN"]
.reader-content p {
  margin-bottom: 2.25em;
  line-height: 2.25;
}


/* ---------------------------------------------------------
   Controlled emphasis
   --------------------------------------------------------- */


.reader-content p[data-emphasis-role="CLOSING_TURN"][data-emphasis-start="true"] {
  margin-top: 2.8em;
  padding-top: 1.8em;
  border-top: 1px solid var(--reader-border);
}


/* ---------------------------------------------------------
   Motion
   --------------------------------------------------------- */

body.reader[data-reader-motion="SUBTLE"]
.reader-content p {
  animation:
    reader-paragraph-arrival
    520ms ease both;
}

body.reader[data-reader-motion="SUBTLE"]
.reader-content p:nth-child(2) {
  animation-delay: 45ms;
}

body.reader[data-reader-motion="SUBTLE"]
.reader-content p:nth-child(3) {
  animation-delay: 90ms;
}

@keyframes reader-paragraph-arrival {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  body.reader[data-reader-motion="SUBTLE"]
  .reader-content p {
    animation: none;
  }
}


/* =========================================================
   Bound presentation moments
   ========================================================= */

.reader-content
p[data-emphasis-role="CLOSING_TURN"] {
  position: relative;
}

.reader-content
p[data-emphasis-role="CLOSING_TURN"][data-emphasis-start="true"] {
  margin-top: 3.2em;
  padding-top: 2em;
  border-top: 1px solid var(--reader-border);
}

.reader-content
p[data-emphasis-role="CLOSING_TURN"][data-emphasis-end="true"] {
  margin-bottom: 3em;
}



/* =========================================================
   Title presence
   ========================================================= */

/*
   LOW:
   العنوان موجود وله هويته، لكنه لا يحتل التجربة.
*/

body.reader[data-reader-title="LOW"]
.reader-hero {
  min-height: 28vh;
  padding-top: 56px;
  padding-bottom: 42px;
}

body.reader[data-reader-title="LOW"]
.reader-hero-content {
  width: min(100%, 680px);
}

body.reader[data-reader-title="LOW"]
.reader-hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.4rem);
  font-weight: 600;
  line-height: 1.3;
}

body.reader[data-reader-title="LOW"]
.article-type {
  margin-bottom: 12px;
}


/*
   STANDARD:
   تبقى القواعد الأساسية الحالية هي المرجع.
*/


/*
   STRONG:
   يستخدم فقط عندما قرر المخرج أن العنوان
   هو عتبة أساسية في تجربة المقالة.
*/

body.reader[data-reader-title="STRONG"]
.reader-hero {
  min-height: 64vh;
}

body.reader[data-reader-title="STRONG"]
.reader-hero-content {
  width: min(100%, 820px);
}

body.reader[data-reader-title="STRONG"]
.reader-hero h1 {
  font-size: clamp(3rem, 9vw, 6.4rem);
  font-weight: 750;
  line-height: 1.08;
}


@media (max-width: 640px) {
  body.reader[data-reader-title="LOW"]
  .reader-hero {
    min-height: 22vh;
    padding-top: 44px;
    padding-bottom: 34px;
  }

  body.reader[data-reader-title="LOW"]
  .reader-hero h1 {
    font-size: clamp(1.65rem, 7vw, 2.65rem);
  }

  body.reader[data-reader-title="STRONG"]
  .reader-hero {
    min-height: 56vh;
  }
}


/* =========================================================
   Opening presence
   Binding decides WHERE.
   Opening profile decides HOW MUCH.
   ========================================================= */

/* QUIET */

body.reader[data-reader-opening="QUIET"]
.reader-content
p[data-emphasis-role="OPENING_PAUSE"][data-emphasis-start="true"] {
  margin-bottom: 1.9em;
}


/* CLEAR */

body.reader[data-reader-opening="CLEAR"]
.reader-content
p[data-emphasis-role="OPENING_PAUSE"][data-emphasis-start="true"] {
  margin-bottom: 2.8em;
  font-size: 1.08em;
  line-height: 2.2;
}

body.reader[data-reader-opening="CLEAR"]
.reader-content
p[data-emphasis-role="OPENING_PAUSE"][data-emphasis-start="true"]::after {
  content: "";
  display: block;
  width: 2.4rem;
  height: 1px;
  margin-top: 1.55em;
  background: var(--reader-border);
}


/* STRONG */

body.reader[data-reader-opening="STRONG"]
.reader-content
p[data-emphasis-role="OPENING_PAUSE"][data-emphasis-start="true"] {
  margin-top: 0.8em;
  margin-bottom: 3.6em;
  font-size: 1.18em;
  line-height: 2.25;
}

body.reader[data-reader-opening="STRONG"]
.reader-content
p[data-emphasis-role="OPENING_PAUSE"][data-emphasis-start="true"]::after {
  content: "";
  display: block;
  width: 4rem;
  height: 1px;
  margin-top: 1.8em;
  background: var(--reader-border);
}


/* =========================================================
   Reader content structure
   ========================================================= */

.reader-section-heading,
.reader-question-heading {
  margin: 2.8em 0 1.05em;
  color: var(--reader-text);
  font: inherit;
  font-size: clamp(1.35rem, 3vw, 1.72rem);
  font-weight: 700;
  line-height: 1.65;
  text-align: right;
}

.reader-question-heading {
  margin-top: 3.4em;
}


/* مقدمة قائمة تبقى جزءًا من المتن وليست عنوانًا */

.reader-content
.reader-block-list_intro {
  margin-bottom: 0.7em;
}


/*
   النص يحتوي علامة • أصلًا.
   لذلك نستخدم HTML list دلاليًا دون إضافة marker ثانٍ.
*/

.reader-list {
  margin: 0 0 2em;
  padding: 0;
  list-style: none;
}

.reader-list-item {
  margin: 0 0 0.72em;
  padding: 0;
  font-size: clamp(1.24rem, 2.8vw, 1.52rem);
  line-height: 2;
  text-align: right;
}


/* الإغلاق يظل فقرة لكنه يحصل على مساحة خفيفة */

.reader-block-closing {
  margin-top: 1.8em;
}


/* ---------------------------------------------------------
   Reading presets must include structured blocks
   --------------------------------------------------------- */

body.reader[data-reader-size="COMPACT"]
.reader-list-item {
  font-size: clamp(1.08rem, 2.4vw, 1.3rem);
}

body.reader[data-reader-size="STANDARD"]
.reader-list-item {
  font-size: clamp(1.24rem, 2.8vw, 1.52rem);
}

body.reader[data-reader-size="GENEROUS"]
.reader-list-item {
  font-size: clamp(1.38rem, 3.1vw, 1.72rem);
}


/* ---------------------------------------------------------
   Emphasis must work on headings too, not only <p>.
   --------------------------------------------------------- */

.reader-content
[data-emphasis-role="CLOSING_TURN"][data-emphasis-start="true"] {
  margin-top: 3.2em;
  padding-top: 2em;
  border-top: 1px solid var(--reader-border);
}

.reader-content
[data-emphasis-role="CLOSING_TURN"][data-emphasis-end="true"] {
  margin-bottom: 3em;
}


/* =========================================================
   Local support MOTION primitives
   ========================================================= */

.reader-content
[data-local-motion] {
  --local-motion-duration: 1100ms;
}


/* ---------------------------------------------------------
   SPATIAL_DRIFT
   إحساس امتداد مكاني بطيء وخافت.
   --------------------------------------------------------- */

html.reader-local-motion-enabled
.reader-content
[data-local-motion="SPATIAL_DRIFT"] {
  opacity: 0.88;
  transform: translateY(3px) scaleX(0.996);
}

.reader-content
[data-local-motion="SPATIAL_DRIFT"].local-motion-active {
  animation:
    reader-local-spatial-drift
    var(--local-motion-duration)
    ease-out
    both;
}

@keyframes reader-local-spatial-drift {
  from {
    opacity: 0.88;
    transform: translateY(3px) scaleX(0.996);
  }

  to {
    opacity: 1;
    transform: translateY(0) scaleX(1);
  }
}


/* ---------------------------------------------------------
   LIGHT_SHIFT
   عودة تدريجية وخافتة للمرئية.
   --------------------------------------------------------- */

html.reader-local-motion-enabled
.reader-content
[data-local-motion="LIGHT_SHIFT"] {
  opacity: 0.78;
  filter: brightness(0.94);
}

.reader-content
[data-local-motion="LIGHT_SHIFT"].local-motion-active {
  animation:
    reader-local-light-shift
    1500ms
    ease-out
    both;
}

@keyframes reader-local-light-shift {
  from {
    opacity: 0.78;
    filter: brightness(0.94);
  }

  to {
    opacity: 1;
    filter: brightness(1);
  }
}


/* ---------------------------------------------------------
   SLOW_REVEAL
   ظهور هادئ عام.
   --------------------------------------------------------- */

html.reader-local-motion-enabled
.reader-content
[data-local-motion="SLOW_REVEAL"] {
  opacity: 0;
  transform: translateY(4px);
}

.reader-content
[data-local-motion="SLOW_REVEAL"].local-motion-active {
  animation:
    reader-local-slow-reveal
    1000ms
    ease-out
    both;
}

@keyframes reader-local-slow-reveal {
  from {
    opacity: 0;
    transform: translateY(4px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}


/* ---------------------------------------------------------
   Accessibility
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .reader-content
  [data-local-motion] {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
  }
}


/* =========================================================
   Local support INTERACTION primitives
   ========================================================= */

/*
   READING_PAUSE

   وقفة قرائية غير قسرية:
   لا تخفي النص، لا تمنع التمرير، ولا تنتظر click.
   تزيد فقط زمن العبور المكاني بعد نهاية النطاق.
*/

html:not([data-reader-timeline-ready="true"])
.reader-content
[data-local-interaction="READING_PAUSE"] {
  margin-bottom: 3.15em;
}


/* لا توجد حركة فعلية يجب تعطيلها هنا،
   لكن نبقي السلوك محافظًا في بيئات reduced motion. */

@media (prefers-reduced-motion: reduce) {
  html:not([data-reader-timeline-ready="true"])
  .reader-content
  [data-local-interaction="READING_PAUSE"] {
    margin-bottom: 2.4em;
  }
}

/* =========================================================
   Inline visual support
   ========================================================= */

.reader-content
.reader-support-image {
  width: min(82%, 590px);
  margin: 2.4em auto 2.8em;
}

.reader-content
.reader-support-image img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

@media (max-width: 640px) {
  .reader-content
  .reader-support-image {
    width: 100%;
    margin-top: 2em;
    margin-bottom: 2.3em;
  }
}


/* ---------------------------------------------------------
   Universal reader narration
   --------------------------------------------------------- */

.reader-narration {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: 1.25rem;
}

.reader-narration-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.6rem;
  padding: 0.55rem 1rem;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.reader-narration-toggle:hover {
  opacity: 0.78;
}

.reader-narration-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.reader-narration-toggle.is-playing {
  font-weight: 600;
}

.reader-narration-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1rem;
  font-size: 0.8em;
}

.reader-narration-time {
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 0.88rem;
  opacity: 0.65;
  font-variant-numeric: tabular-nums;
}

#readerNarrationAudio {
  display: none;
}

/* =========================================================
   Guided Reading Timeline
   ========================================================= */

.reader-timeline-controls {
  display: flex;
  justify-content: center;
  margin: 1.5rem 0 2rem;
}

.reader-timeline-toggle {
  appearance: none;
  border: 1px solid currentColor;
  border-radius: 999px;
  background: transparent;
  color: inherit;
  font: inherit;
  padding: 0.55rem 1.1rem;
  cursor: pointer;
}

.reader-timeline-toggle:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 3px;
}

.reader-timeline-line {
  position: absolute;
  z-index: 20;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  pointer-events: none;
  opacity: 0;
  transform-origin: center;
}

.reader-timeline-line.is-visible {
  opacity: 0.72;
}

/* =========================================================
   Reader textual support
   ---------------------------------------------------------
   عنصر نصي إخراجي تابع للمقالة، لا جزء من نص الكاتب.
   يجب أن يبقى مميزًا بصريًا دون أن ينافس القراءة.
   ========================================================= */

.reader-content .reader-support-text,
.reader-support-text {
  max-width: 38rem;
  margin: 2.1em auto;
  padding: 0.85em 1.15em;
  border-inline-start: 2px solid currentColor;
  font-size: 0.92em;
  line-height: 1.75;
  opacity: 0.72;
}

.reader-support-text p {
  margin: 0;
}

.reader-support-before.reader-support-text {
  margin-top: 1.4em;
  margin-bottom: 2.7em;
}

.reader-support-inline.reader-support-text {
  margin-top: 1.8em;
  margin-bottom: 2.2em;
}

@media (max-width: 640px) {
  .reader-content .reader-support-text,
  .reader-support-text {
    max-width: 100%;
    padding-inline-start: 0.9em;
    padding-inline-end: 0.4em;
  }
}


/* =========================================================
   Reader local SYMBOL primitives
   ========================================================= */

.reader-support-symbol {
  width: min(72%, 34rem);
  margin: 2.4rem auto;
  padding: 1.1rem 0;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none;
}

.reader-support-symbol
.reader-symbol-mark {
  display: block;
  width: min(14rem, 52vw);
  height: 1.25rem;
  position: relative;
}

.reader-support-symbol
.reader-symbol-mark::before,
.reader-support-symbol
.reader-symbol-mark::after {
  content: "";
  position: absolute;
  top: 50%;
  height: 1px;
  background: currentColor;
  opacity: 0.32;
}

.reader-support-symbol
.reader-symbol-mark::before {
  left: 0;
  width: 42%;
}

.reader-support-symbol
.reader-symbol-mark::after {
  right: 0;
  width: 42%;
}

.reader-support-symbol
.reader-symbol-mark {
  color: currentColor;
}

.reader-support-symbol
.reader-symbol-mark {
  border-radius: 999px;
}

.reader-support-symbol
.reader-symbol-mark {
  background:
    radial-gradient(
      circle at center,
      currentColor 0,
      currentColor 2px,
      transparent 3px
    );
  opacity: 0.7;
}


/* =========================================================
   Motion perceptibility guard
   ========================================================= */

.reader-content
[data-local-motion] {
  --local-motion-duration: 1800ms;
}

html.reader-local-motion-enabled
.reader-content
[data-local-motion="SPATIAL_DRIFT"] {
  opacity: 0.72;
  transform:
    translateY(10px)
    scaleX(0.985);
}

.reader-content
[data-local-motion="SPATIAL_DRIFT"].local-motion-active {
  animation-duration: 1800ms;
}

html.reader-local-motion-enabled
.reader-content
[data-local-motion="LIGHT_SHIFT"] {
  opacity: 0.62;
  filter:
    brightness(0.78)
    contrast(0.96);
}

.reader-content
[data-local-motion="LIGHT_SHIFT"].local-motion-active {
  animation-duration: 2100ms;
}

.reader-content
[data-local-motion="SLOW_REVEAL"].local-motion-active {
  animation-duration: 1800ms;
}



/* =========================================================
   Author preview approval
   ========================================================= */

.reader-preview-approval {
  width: min(100%, 760px);
  margin: 4.5rem auto 2.5rem;
  padding: 0 1.25rem;
}

.reader-preview-approval-inner {
  padding: 1.75rem;
  border: 1px solid rgba(127, 127, 127, 0.24);
  border-radius: 18px;
  text-align: center;
}

.reader-preview-approval-eyebrow {
  display: block;
  margin-bottom: 0.65rem;
  font-size: 0.82rem;
  opacity: 0.65;
}

.reader-preview-approval h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.7;
}

.reader-preview-approval p {
  margin: 0.85rem auto 1.4rem;
  max-width: 34rem;
  line-height: 1.9;
  opacity: 0.76;
}

.reader-preview-publish-button {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 0.9rem 1.45rem;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.reader-preview-return {
  display: block;
  width: fit-content;
  margin: 1rem auto 0;
  font-size: 0.9rem;
  opacity: 0.7;
  text-decoration: none;
}

.reader-preview-return:hover {
  opacity: 1;
}



/* =========================================================
   Reader Publication Box
   ========================================================= */

.reader-publication-box {
  width: min(100%, 720px);
  margin: 0 auto;
  padding: 18px 0 72px;
}

.publication-divider {
  width: 1px;
  height: 76px;
  margin: 0 auto 48px;
  background: linear-gradient(
    to bottom,
    transparent,
    var(--reader-border),
    transparent
  );
}

.reader-publication-inner {
  border: 1px solid var(--reader-border);
  border-radius: 24px;
  padding: 28px;
  background: var(--reader-surface);
  box-shadow:
    0 18px 60px rgba(37, 35, 31, 0.05);
}

.reader-publication-eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--reader-muted);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.82rem;
}

.reader-publication-inner h2 {
  margin: 0;
  color: var(--reader-text);
  font-size: 1.4rem;
  line-height: 1.6;
}

.reader-publication-intro {
  margin: 10px 0 22px;
  color: var(--reader-muted);
  font-size: 0.96rem;
  line-height: 1.8;
}

.reader-publication-preview {
  padding: 18px 20px;
  border-radius: 18px;
  background: rgba(37, 35, 31, 0.035);
}

.reader-publication-preview p {
  margin: 0 0 12px;
  line-height: 1.9;
}

.reader-publication-preview p:last-child {
  margin-bottom: 0;
}

.reader-publication-invitation {
  font-weight: 650;
}

.reader-publication-summary {
  color: var(--reader-text);
}

.reader-publication-hashtags,
.reader-publication-url {
  color: var(--reader-muted);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.reader-publication-text {
  display: block;
  width: 100%;
  min-height: 180px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid var(--reader-border);
  border-radius: 18px;
  outline: 0;
  resize: vertical;
  background: transparent;
  color: var(--reader-text);
  font: inherit;
  font-size: 0.96rem;
  line-height: 1.9;
}

.reader-publication-text:focus {
  border-color: rgba(37, 35, 31, 0.32);
}

.reader-publication-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-top: 16px;
}

.reader-publication-actions button {
  min-height: 44px;
  border: 1px solid var(--reader-border);
  border-radius: 999px;
  padding: 0 20px;
  background: transparent;
  color: var(--reader-text);
  font-family:
    system-ui,
    -apple-system,
    sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
}

.reader-publication-actions button:first-child {
  border-color: var(--reader-accent);
  background: var(--reader-accent);
  color: #ffffff;
}

.reader-publication-message {
  margin: 16px 2px 0;
  color: var(--reader-muted);
  font-size: 0.9rem;
}

.reader-publication-message.is-error {
  color: #8a332b;
}

@media (max-width: 640px) {
  .reader-publication-box {
    padding-bottom: 56px;
  }

  .reader-publication-inner {
    padding: 22px 18px;
  }

  .reader-publication-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .reader-publication-actions button {
    width: 100%;
  }
}
