/* SaeidPix Stage 25A — article reading page (25B layout) */
.rd-page { --rd-ink: #15160f; --rd-text: #2b2b25; --rd-muted: #6e6a60; --rd-faint: #a19b90; --rd-line: #e9e3d7; --rd-soft: #f6f2ea; --rd-card: #fffdf9; --rd-green: #0f6b4f; --rd-green-soft: #e7f3ee; --rd-gold: #d6a849; --rd-gold-ink: #8a6512; --rd-gold-soft: #fbf3de; }
.rd-page .sp13a-breadcrumbs { background: transparent; border: 0; }
.rd { color: var(--rd-text); }
.rd *, .rd *::before, .rd *::after { box-sizing: border-box; }
.rd a { text-decoration: none; }
.rd svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* progress */
.rd-progress { position: fixed; inset: 0 0 auto 0; z-index: 2000; height: 3px; pointer-events: none; }
.rd-progress i { display: block; width: 100%; height: 100%; background: linear-gradient(90deg, var(--rd-gold), var(--rd-green)); transform: scaleX(0); transform-origin: right center; transition: transform .08s linear; }

/* hero: copy + image side by side, image always fills the card height */
.rd-hero { display: grid; grid-template-columns: minmax(0, 1fr); max-width: 1180px; margin: 22px auto 0; overflow: hidden; border: 1px solid var(--rd-line); border-radius: 28px; background: radial-gradient(120% 140% at 100% 0%, #fff8e7 0%, var(--rd-card) 55%); box-shadow: 0 24px 60px rgba(30, 26, 18, .07); }
.rd-hero.has-media { grid-template-columns: minmax(0, 1fr) minmax(0, 1.12fr); min-height: 440px; }
.rd-hero-copy { display: flex; flex-direction: column; justify-content: center; gap: 16px; padding: 44px 44px 40px; }
.rd-hero:not(.has-media) .rd-hero-copy { align-items: center; max-width: 860px; margin: 0 auto; text-align: center; }
.rd-cat { display: inline-flex; align-self: flex-start; align-items: center; height: 30px; padding: 0 14px; border-radius: 99px; background: var(--rd-gold-soft); color: var(--rd-gold-ink) !important; font-size: 13px; font-weight: 850; }
.rd-hero:not(.has-media) .rd-cat { align-self: center; }
.rd-cat:hover { background: #f6e7bf; }
.rd-hero h1 { margin: 0; color: var(--rd-ink); font-size: clamp(25px, 2.35vw, 34px); font-weight: 900; line-height: 1.55; letter-spacing: -.2px; text-wrap: balance; }
.rd-hero h1.is-long { font-size: clamp(23px, 2.05vw, 30px); }
.rd-lead { margin: 0; color: var(--rd-muted); font-size: 15.5px; line-height: 2; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 18px; margin-top: 6px; padding-top: 18px; border-top: 1px solid var(--rd-line); color: var(--rd-muted); font-size: 13px; }
.rd-hero:not(.has-media) .rd-meta { justify-content: center; }
.rd-meta-row { display: inline-flex; flex-wrap: wrap; gap: 8px 16px; }
.rd-author { display: inline-flex; align-items: center; gap: 9px; text-align: right; }
.rd-author > span:last-child { display: flex; flex-direction: column; line-height: 1.5; }
.rd-author b { color: var(--rd-ink); font-size: 14px; font-weight: 850; }
.rd-author small { color: var(--rd-faint); font-size: 11.5px; }
.rd-author-avatar { display: grid; flex: none; place-items: center; overflow: hidden; width: 40px; height: 40px; border-radius: 50%; background: linear-gradient(160deg, #2c2a20, #15140f); color: #e9c46a; font-size: 15px; font-weight: 900; }
.rd-author-avatar.is-lg { width: 64px; height: 64px; font-size: 22px; }
.rd-author-avatar img, .rd-author-avatar picture { display: block; width: 100%; height: 100%; object-fit: cover; }
.rd-meta-item { display: inline-flex; align-items: center; gap: 6px; }
.rd-meta-item svg { color: var(--rd-faint); }
.rd-meta-item.is-updated { color: var(--rd-green); font-weight: 750; }
.rd-meta-item.is-updated svg { color: var(--rd-green); }
.rd-hero-media { position: relative; margin: 0; min-height: 100%; background: var(--rd-soft); }
.rd-hero-media picture, .rd-hero-media img { position: absolute; inset: 0; display: block; width: 100% !important; height: 100% !important; max-width: none; object-fit: cover; }

/* layout: wide white reading card + slim contents list */
.rd-layout { display: grid; grid-template-columns: minmax(0, 860px); justify-content: center; gap: 28px; max-width: 1180px; margin: 28px auto 0; }
.rd-layout.has-toc { grid-template-columns: minmax(0, 1fr) 280px; }
.rd-main { min-width: 0; padding: 44px 52px 40px; border: 1px solid var(--rd-line); border-radius: 26px; background: #fff; box-shadow: 0 14px 40px rgba(30, 26, 18, .04); }
.rd-aside { grid-column: 2; grid-row: 1; }

/* toc — main sections only */
.rd-toc { position: sticky; top: 96px; border: 1px solid var(--rd-line); border-radius: 20px; background: var(--rd-card); overflow: hidden; }
.rd-toc summary { display: flex; align-items: center; gap: 8px; padding: 15px 18px; cursor: pointer; list-style: none; border-bottom: 1px solid var(--rd-line); }
.rd-toc summary::-webkit-details-marker { display: none; }
.rd-toc summary span { flex: 1; color: var(--rd-ink); font-size: 14.5px; font-weight: 900; }
.rd-toc summary small { color: var(--rd-faint); font-size: 12px; }
.rd-toc-chev { width: 8px; height: 8px; border-left: 2px solid var(--rd-faint); border-bottom: 2px solid var(--rd-faint); transform: rotate(-45deg); transition: transform .2s; }
.rd-toc[open] .rd-toc-chev { transform: rotate(135deg); }
.rd-toc nav { display: flex; flex-direction: column; gap: 2px; max-height: min(60vh, 560px); padding: 10px 10px; overflow: auto; scrollbar-width: thin; }
.rd-toc nav a { display: flex; align-items: flex-start; gap: 10px; padding: 8px 10px; border-radius: 12px; color: var(--rd-muted) !important; font-size: 13.5px; line-height: 1.85; transition: background .15s, color .15s; }
.rd-toc nav a em { display: grid; flex: none; place-items: center; width: 22px; height: 22px; margin-top: 2px; border-radius: 50%; background: var(--rd-soft); color: var(--rd-faint); font-size: 11px; font-style: normal; font-weight: 900; }
.rd-toc nav a:hover { background: var(--rd-soft); color: var(--rd-ink) !important; }
.rd-toc nav a.is-active { background: var(--rd-gold-soft); color: var(--rd-ink) !important; font-weight: 800; }
.rd-toc nav a.is-active em { background: var(--rd-gold); color: #fff; }
.rd-toc-progress { display: flex; align-items: center; gap: 10px; padding: 11px 18px 14px; border-top: 1px solid var(--rd-line); }
.rd-toc-progress i { position: relative; flex: 1; height: 5px; border-radius: 99px; background: var(--rd-soft); overflow: hidden; }
.rd-toc-progress i::after { content: ""; position: absolute; inset: 0 0 0 auto; width: var(--p, 0%); border-radius: 99px; background: var(--rd-green); }
.rd-toc-progress small { color: var(--rd-faint); font-size: 11.5px; white-space: nowrap; }

/* body typography */
.rd-body { color: var(--rd-text); font-size: 17.5px; line-height: 2.1; overflow-wrap: break-word; }
.rd-body > *:first-child { margin-top: 0; }
.rd-body p { margin: 0 0 1.25em; }
.rd-body h2, .rd-body h3, .rd-body h4 { color: var(--rd-ink); font-weight: 900; line-height: 1.6; scroll-margin-top: 100px; text-wrap: balance; }
.rd-body h2 { position: relative; margin: 1.9em 0 .7em; padding-right: 18px; font-size: clamp(22px, 2.1vw, 27px); }
.rd-body h2::before { content: ""; position: absolute; top: .38em; bottom: .38em; right: 0; width: 5px; border-radius: 5px; background: linear-gradient(180deg, var(--rd-gold), #e8c77a); }
.rd-body h3 { margin: 1.6em 0 .55em; font-size: clamp(19px, 1.7vw, 21.5px); }
.rd-body h4 { margin: 1.4em 0 .5em; font-size: 18.5px; }
.rd-body a { color: var(--rd-green); font-weight: 700; text-decoration: underline; text-decoration-color: rgba(15, 107, 79, .3); text-decoration-thickness: 2px; text-underline-offset: 5px; }
.rd-body a:hover { text-decoration-color: var(--rd-green); }
.rd-body strong, .rd-body b { color: var(--rd-ink); font-weight: 850; }
.rd-body ul, .rd-body ol { margin: 0 0 1.4em; padding: 0 1.4em 0 0; }
.rd-body ul { list-style: disc outside; }
.rd-body ol { list-style: decimal outside; }
.rd-body li { display: list-item; }
.rd-body li { margin: .35em 0; padding-right: .3em; }
.rd-body ul li::marker { color: var(--rd-gold); font-size: 1.15em; }
.rd-body ol { list-style-type: persian; }
.rd-body ol li::marker { color: var(--rd-gold-ink); font-weight: 900; }
.rd-body blockquote { position: relative; margin: 1.6em 0; padding: 16px 22px; border: 0; border-right: 4px solid var(--rd-green); border-radius: 14px; background: var(--rd-green-soft); color: #1f3d33; font-size: 16.5px; line-height: 2; }
.rd-body blockquote p:last-child { margin-bottom: 0; }
.rd-body blockquote.is-warn { border-right-color: #d2802f; background: #fdf1e5; color: #5a3410; }
.rd-body blockquote.is-tip { border-right-color: var(--rd-gold); background: var(--rd-gold-soft); color: #4c3a10; }
.rd-body hr { height: 1px; margin: 2.4em auto; border: 0; background: var(--rd-line); }
.rd-body img { max-width: 100%; height: auto; border-radius: 16px; }
.rd-body figure { margin: 2em 0; }
.rd-body figure img, .rd-body figure picture { display: block; width: 100%; height: auto; border-radius: 16px; background: var(--rd-soft); }
.rd-body figure.is-size-small { max-width: 380px; margin-inline: auto; }
.rd-body figure.is-size-medium { max-width: 580px; margin-inline: auto; }
.rd-body figcaption { margin-top: 10px; color: var(--rd-faint); font-size: 13px; line-height: 1.9; text-align: center; }
.rd-body code { padding: 2px 7px; border-radius: 6px; background: var(--rd-soft); font-size: .88em; direction: ltr; unicode-bidi: isolate; }
.rd-body pre { padding: 16px; border-radius: 14px; background: #1c1b16; color: #f1ece0; overflow: auto; direction: ltr; }
.rd-table { margin: 1.8em 0; border: 1px solid var(--rd-line); border-radius: 16px; overflow-x: auto; background: var(--rd-card); }
.rd-body table { width: 100%; min-width: 520px; border-collapse: collapse; font-size: 15px; line-height: 1.9; }
.rd-body th, .rd-body td { padding: 11px 14px; border-bottom: 1px solid #f0eadf; text-align: right; vertical-align: top; }
.rd-body th { background: var(--rd-soft); color: var(--rd-ink); font-weight: 850; }
.rd-body tr:last-child td { border-bottom: 0; }

/* faq accordion */
.rd-faq { margin: .5em 0 1.6em; border: 1px solid var(--rd-line); border-radius: 18px; background: var(--rd-card); overflow: hidden; }
.rd-faq details + details { border-top: 1px solid var(--rd-line); }
.rd-faq summary { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 15px 20px; color: var(--rd-ink); font-size: 16.5px; font-weight: 850; line-height: 1.8; cursor: pointer; list-style: none; }
.rd-faq summary::-webkit-details-marker { display: none; }
.rd-faq summary::after { content: "+"; display: grid; flex: none; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--rd-soft); color: var(--rd-gold-ink); font-size: 18px; font-weight: 700; transition: transform .2s; }
.rd-faq details[open] summary::after { content: "−"; background: var(--rd-gold-soft); }
.rd-faq summary h3 { all: unset; }
.rd-faq .rd-faq-a { padding: 0 20px 16px; color: var(--rd-text); font-size: 16px; line-height: 2.05; }
.rd-faq .rd-faq-a p:last-child { margin-bottom: 0; }

/* compact course card (re-uses the existing partial) */
.rd-promo { margin: 2.2em 0; }
.rd-promo .sp-cde-premium-promo { margin: 0; padding: 18px; border-radius: 20px; box-shadow: none; }
.rd-promo .sp-cde-premium-promo__intro { margin-bottom: 12px; }
.rd-promo .sp-cde-premium-promo__intro h2 { margin: 6px 0 2px; font-size: 18px; line-height: 1.7; }
.rd-promo .sp-cde-premium-promo__intro p { margin: 0; font-size: 13.5px; line-height: 1.9; }
.rd-promo .sp-cde-premium-promo__card { display: grid; grid-template-columns: 230px minmax(0, 1fr); min-height: 0; }
.rd-promo .sp-cde-premium-promo__media { min-height: 0; aspect-ratio: auto; }
.rd-promo .sp-cde-premium-promo__media img, .rd-promo .sp-cde-premium-promo__media picture { width: 100%; height: 100%; object-fit: cover; }
.rd-promo .sp-cde-premium-promo__body { padding: 16px 18px; gap: 10px; }
.rd-promo .sp-cde-premium-promo__copy p { display: -webkit-box; margin: 4px 0 0; font-size: 13.5px; line-height: 1.9; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rd-promo .sp-cde-premium-promo__copy h3 { margin: 2px 0 0; font-size: 16.5px; }
.rd-promo .sp-cde-premium-promo__points, .rd-promo .sp-cde-premium-promo__floating-tag { display: none; }
.rd-promo .sp-cde-premium-promo__footer { padding-top: 10px; }

/* tags + share + author */
.rd-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 34px; }
.rd-tags a { padding: 5px 13px; border-radius: 99px; background: var(--rd-soft); color: #5d584e !important; font-size: 13px; font-weight: 750; }
.rd-tags a:hover { background: var(--rd-gold-soft); color: var(--rd-gold-ink) !important; }
.rd-share { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 24px; padding: 18px 20px; border: 1px solid var(--rd-line); border-radius: 18px; background: var(--rd-card); }
.rd-share > div:first-child { display: flex; flex-direction: column; gap: 2px; }
.rd-share strong { color: var(--rd-ink); font-size: 15px; font-weight: 900; }
.rd-share span { color: var(--rd-muted); font-size: 13px; }
.rd-share-btns { display: flex; flex-wrap: wrap; gap: 8px; }
.rd-share-btns a, .rd-share-btns button { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 14px; border: 1px solid var(--rd-line); border-radius: 12px; background: #fff; color: var(--rd-ink) !important; font: inherit; font-size: 13px; font-weight: 800; cursor: pointer; }
.rd-share-btns a.is-tg svg { color: #2a9bd8; }
.rd-share-btns a.is-wa svg { color: #1fa855; }
.rd-share-btns a:hover, .rd-share-btns button:hover { background: var(--rd-soft); }
.rd-share-btns button.is-done { border-color: #bfe1d2; background: var(--rd-green-soft); color: var(--rd-green) !important; }
.rd-author-card { display: flex; align-items: center; gap: 16px; margin-top: 14px; padding: 18px 20px; border-radius: 18px; background: linear-gradient(160deg, #1f1d16, #14130e); color: #e9e4d8; }
.rd-author-card > div { display: flex; flex: 1; flex-direction: column; min-width: 0; }
.rd-author-card small { color: #a9a292; font-size: 12px; }
.rd-author-card strong { color: #fff; font-size: 16.5px; font-weight: 900; }
.rd-author-card p { margin: 3px 0 0; color: #c9c2b3; font-size: 13.5px; line-height: 1.9; }
.rd-author-card > a { flex: none; padding: 9px 14px; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #f4d38a !important; font-size: 13px; font-weight: 850; }
.rd-author-card > a:hover { background: rgba(255, 255, 255, .14); }

/* next + related */
.rd-next { display: grid; grid-template-columns: 340px minmax(0, 1fr); align-items: center; gap: 28px; max-width: 1140px; margin: 56px auto 0; padding: 18px; border: 1px solid var(--rd-line); border-radius: 26px; background: var(--rd-card); box-shadow: 0 18px 44px rgba(30, 26, 18, .06); transition: transform .2s, box-shadow .2s; }
.rd-next:hover { transform: translateY(-2px); box-shadow: 0 24px 54px rgba(30, 26, 18, .1); }
.rd-next-media, .rd-card-media { display: block; overflow: hidden; aspect-ratio: 16 / 10; border-radius: 18px; background: var(--rd-soft); }
.rd-next-media img, .rd-next-media picture, .rd-card-media img, .rd-card-media picture { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .4s; }
.rd-next:hover .rd-next-media img, .rd-card:hover .rd-card-media img { transform: scale(1.04); }
.rd-ph { display: grid; place-items: center; width: 100%; height: 100%; background: linear-gradient(160deg, #2c2a20, #15140f); color: #e9c46a; font-size: 26px; font-weight: 900; letter-spacing: 2px; }
.rd-next-copy { display: flex; flex-direction: column; gap: 8px; padding-left: 10px; }
.rd-next-copy small { color: var(--rd-gold-ink); font-size: 13px; font-weight: 900; }
.rd-next-copy b { color: var(--rd-ink); font-size: clamp(19px, 2vw, 25px); font-weight: 900; line-height: 1.6; text-wrap: balance; }
.rd-next-copy span { color: var(--rd-muted); font-size: 14.5px; line-height: 1.95; }
.rd-next-copy em { color: var(--rd-green); font-size: 14px; font-style: normal; font-weight: 850; }
.rd-related { max-width: 1140px; margin: 48px auto 0; }
.rd-related header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; padding: 0 20px; }
.rd-related h2 { margin: 0; color: var(--rd-ink); font-size: 21px; font-weight: 900; }
.rd-related header a { color: var(--rd-green) !important; font-size: 13.5px; font-weight: 850; }
.rd-related-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; padding: 0 20px; }
.rd-card { display: flex; flex-direction: column; gap: 12px; padding: 12px; border: 1px solid var(--rd-line); border-radius: 20px; background: var(--rd-card); transition: transform .2s, box-shadow .2s; }
.rd-card:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(30, 26, 18, .08); }
.rd-card-copy { display: flex; flex-direction: column; gap: 5px; padding: 0 6px 6px; }
.rd-card-copy small { color: var(--rd-gold-ink); font-size: 12px; font-weight: 850; }
.rd-card-copy b { color: var(--rd-ink); font-size: 15.5px; font-weight: 900; line-height: 1.75; }
.rd-card-copy span { color: var(--rd-faint); font-size: 12.5px; }
.rd { padding-bottom: 64px; }

.rd-top { position: fixed; bottom: 22px; left: 22px; z-index: 900; display: grid; place-items: center; width: 46px; height: 46px; border: 0; border-radius: 50%; background: var(--rd-ink); color: #fff; box-shadow: 0 10px 24px rgba(0, 0, 0, .2); cursor: pointer; }
.rd-top[hidden] { display: none; }
.rd-top svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }

@media (max-width: 1180px) {
    .rd-hero, .rd-layout, .rd-next, .rd-related { margin-left: 16px; margin-right: 16px; }
}
@media (max-width: 1080px) {
    .rd-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
    .rd-aside { grid-column: 1; grid-row: 1; }
    .rd-toc { position: static; }
    .rd-toc nav { max-height: none; }
    .rd-toc-progress { display: none; }
    .rd-main { padding: 34px 32px; }
}
@media (max-width: 860px) {
    .rd-hero.has-media { grid-template-columns: minmax(0, 1fr); min-height: 0; }
    .rd-hero-media { order: -1; aspect-ratio: 16 / 9; min-height: 0; }
    .rd-hero-copy { padding: 22px 20px 20px; gap: 12px; }
}
@media (max-width: 760px) {
    .rd-hero { margin: 12px 12px 0; border-radius: 22px; }
    .rd-hero h1, .rd-hero h1.is-long { font-size: 23px; line-height: 1.6; }
    .rd-lead { font-size: 14.5px; -webkit-line-clamp: 4; }
    .rd-meta { gap: 10px 14px; font-size: 12.5px; }
    .rd-meta .rd-author { flex-basis: 100%; }
    .rd-layout { gap: 14px; margin: 14px 12px 0; }
    .rd-main { padding: 22px 18px; border-radius: 20px; }
    .rd-body { font-size: 16.5px; line-height: 2.05; }
    .rd-body h2 { font-size: 20.5px; }
    .rd-body h3 { font-size: 18px; }
    .rd-body figure { margin-inline: -18px; }
    .rd-body figure img, .rd-body figure picture { border-radius: 0; }
    .rd-body figure.is-size-small, .rd-body figure.is-size-medium { margin-inline: auto; }
    .rd-body figure.is-size-small img, .rd-body figure.is-size-medium img { border-radius: 14px; }
    .rd-promo .sp-cde-premium-promo__card { grid-template-columns: minmax(0, 1fr); }
    .rd-promo .sp-cde-premium-promo__media { aspect-ratio: 16 / 9; }
    .rd-share { flex-direction: column; align-items: stretch; }
    .rd-share-btns > * { flex: 1; justify-content: center; }
    .rd-author-card { flex-wrap: wrap; }
    .rd-author-card > a { width: 100%; text-align: center; }
    .rd-next { grid-template-columns: minmax(0, 1fr); gap: 14px; margin: 28px 12px 0; padding: 12px; border-radius: 22px; }
    .rd-next-copy { padding: 0 6px 6px; }
    .rd-related header, .rd-related-grid { padding: 0 12px; }
    .rd-related-grid { grid-template-columns: minmax(0, 1fr); }
    .rd-top { bottom: calc(86px + env(safe-area-inset-bottom, 0px)); left: 14px; width: 42px; height: 42px; }
}
@media (prefers-reduced-motion: reduce) {
    .rd-next, .rd-card, .rd-next-media img, .rd-card-media img, .rd-progress i { transition: none; }
}
