/* Darayar: articles, article lists and content pages. Loaded only where needed. */

/* ---------- page heads ---------- */
.page-head { padding: 36px 0 56px; }
.page-head--blog { padding-bottom: 64px; position: relative; isolation: isolate; overflow: clip; }
.page-head--blog::before { content: ""; position: absolute; z-index: -1; width: 420px; height: 420px; inset-inline-start: -120px; top: -160px; border-radius: 50%; background: var(--d-emerald); filter: blur(90px); opacity: .14; }
.page-head .eyebrow { margin-bottom: 10px; }

/* ---------- list ---------- */
.page--list { padding-top: 40px; }
.cat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.cat-chips a { padding: 7px 16px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); font-size: .9375rem; color: var(--ink-2); transition: border-color .2s, color .2s, background-color .2s; }
.cat-chips a:hover { border-color: var(--line-strong); color: var(--ink); }
.cat-chips a[aria-current] { background: var(--ink); border-color: var(--ink); color: #fff; }
.cards { display: grid; gap: 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.pcard { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-card); box-shadow: var(--shadow-card); overflow: hidden; transition: transform .3s var(--ease), box-shadow .3s var(--ease); }
@media (hover: hover) { .pcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lift); } }
.pcard__media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.pcard__body { display: flex; flex-direction: column; gap: 8px; padding: 22px 24px 20px; flex: 1; }
.pcard__cat { font-size: .8125rem; font-weight: 650; color: var(--cta); }
.pcard__title { font-size: 1.125rem; font-weight: 750; line-height: 1.65; }
.pcard__title a::after { content: ""; position: absolute; inset: 0; }
.pcard__title a:focus-visible { outline: none; }
.pcard:focus-within { outline: 2px solid var(--brand); outline-offset: 2px; }
.pcard__excerpt { color: var(--ink-2); font-size: .9688rem; line-height: 1.85; }
.pcard__meta { margin-top: auto; padding-top: 8px; font-size: .8125rem; color: var(--muted); }

.pagination { margin-top: 40px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers { min-width: 44px; height: 44px; padding-inline: 14px; display: inline-grid; place-items: center; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-2); font-weight: 600; }
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: #fff; }
.pagination a.page-numbers:hover { border-color: var(--line-strong); color: var(--ink); }
.empty { text-align: center; padding: 56px 24px; display: grid; justify-items: center; gap: 12px; background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-card); }
.empty p:not(.h3) { color: var(--ink-2); }

/* ---------- article head ---------- */
.post-head { position: relative; isolation: isolate; overflow: clip; background: var(--navy); color: var(--on-dark); padding: 32px 0 44px; }
.post-head::before { content: ""; position: absolute; z-index: -1; width: 460px; height: 460px; inset-inline-end: -140px; top: -200px; border-radius: 50%; background: var(--d-blue); filter: blur(100px); opacity: .16; }
.post-head .wrap { max-width: calc(1080px + 2 * var(--gutter)); }
.post-head__cat { display: inline-flex; padding: 4px 12px; border-radius: 999px; font-size: .8125rem; font-weight: 650; color: #7FD8BF; background: rgb(255 255 255 / .06); border: 1px solid rgb(255 255 255 / .12); }
.post-head__title { margin-top: 14px; font-size: clamp(1.75rem, 1.2rem + 2.1vw, 2.75rem); font-weight: 800; line-height: 1.45; letter-spacing: -0.01em; max-width: 26ch; text-wrap: balance; }
.byline { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-top: 24px; }
.byline__avatar { width: 48px; height: 48px; border-radius: 50%; object-fit: cover; border: 2px solid rgb(255 255 255 / .16); }
.byline__text { display: grid; line-height: 1.5; }
.byline__name { font-weight: 700; color: var(--on-dark); }
.byline__name:hover { color: #7FD8BF; }
.byline__role { font-size: .8125rem; color: var(--on-dark-2); }
.byline__meta { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .875rem; color: var(--on-dark-2); }
@media (min-width: 640px) { .byline__meta { margin-inline-start: auto; } }
.byline__meta li { display: inline-flex; align-items: center; gap: 6px; }
.byline__meta .icon { width: 16px; height: 16px; color: #7FD8BF; }

/* ---------- article layout ---------- */
.post-layout { display: grid; gap: 32px; padding-block: 36px 72px; max-width: calc(1080px + 2 * var(--gutter)); }
@media (min-width: 1100px) { .post-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; } }
.post { min-width: 0; max-width: 740px; }
.post__cover { margin-bottom: 28px; }
.post__cover img { width: 100%; border-radius: var(--r-card); aspect-ratio: 16 / 9; object-fit: cover; }

.answer { padding: 20px 24px; border-radius: 18px; background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--cta) 18%, transparent); margin-bottom: 28px; }
.answer__label { display: inline-flex; align-items: center; gap: 8px; font-size: .8125rem; font-weight: 700; color: var(--cta); margin-bottom: 6px; }
.answer__label::before { content: ""; width: 14px; height: 2px; border-radius: 2px; background: currentColor; }
.answer__text { color: var(--ink); font-size: 1.0625rem; line-height: 1.95; font-weight: 500; }

.toc details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.toc summary { list-style: none; cursor: pointer; padding: 14px 18px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::after { content: ""; width: 8px; height: 8px; border-inline-end: 1.6px solid var(--muted); border-bottom: 1.6px solid var(--muted); transform: rotate(45deg); transition: transform .25s var(--ease); margin-top: -4px; }
.toc details[open] summary::after { transform: rotate(-135deg); margin-top: 4px; }
.toc ol { display: grid; gap: 2px; padding: 0 12px 14px; counter-reset: t; }
.toc li { counter-increment: t; }
.toc a { display: block; padding: 6px 10px; border-radius: 10px; font-size: .9375rem; line-height: 1.7; color: var(--ink-2); transition: background-color .2s, color .2s; }
.toc > details > ol > li > a::before { content: counter(t, persian) ". "; color: var(--muted); }
.toc ol ol { padding: 0 14px 4px 0; }
.toc ol ol a { font-size: .875rem; color: var(--muted); }
.toc a:hover { background: var(--bg-tint); color: var(--ink); }
.toc a.is-active { background: var(--brand-soft); color: #075C49; font-weight: 600; }
.toc-inline { margin-bottom: 32px; }
.toc-side { display: none; }
@media (min-width: 1100px) {
.toc-inline { display: none; }
.toc-side { display: block; }
.post-aside { position: sticky; top: 92px; align-self: start; display: grid; gap: 16px; max-height: calc(100vh - 110px); overflow: auto; scrollbar-width: thin; }
}
@media (max-width: 1099px) { .post-aside { display: none; } }
.side-cta { padding: 22px; border-radius: 18px; background: var(--navy); color: var(--on-dark); display: grid; gap: 10px; }
.side-cta__title { font-weight: 750; }
.side-cta__text { font-size: .875rem; color: var(--on-dark-2); line-height: 1.8; }

/* ---------- article typography ---------- */
.entry { font-size: 1.0625rem; line-height: 2; color: var(--ink); }
@media (min-width: 768px) { .entry { font-size: 1.125rem; } }
.entry > * + * { margin-top: 1.1em; }
.entry h2 { margin-top: 2.1em; font-size: clamp(1.375rem, 1.15rem + .8vw, 1.75rem); font-weight: 780; line-height: 1.55; letter-spacing: -0.005em; scroll-margin-top: 96px; }
.entry h3 { margin-top: 1.7em; font-size: clamp(1.1875rem, 1.1rem + .35vw, 1.3125rem); font-weight: 720; line-height: 1.6; scroll-margin-top: 96px; }
.entry h4 { margin-top: 1.5em; font-size: 1.0625rem; font-weight: 700; }
.entry h2 + *, .entry h3 + * { margin-top: .6em; }
.entry p { color: #1F2937; }
.entry a:not(.btn) { color: var(--cta); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
.entry a:not(.btn):hover { color: var(--cta-hover); text-decoration-thickness: 2px; }
.entry strong, .entry b { font-weight: 720; color: var(--ink); }
.entry ul, .entry ol { padding-inline-start: 1.4em; display: grid; gap: .45em; color: #1F2937; }
.entry ul { list-style: disc; }
.entry ol { list-style: persian; }
.entry li::marker { color: var(--cta); font-weight: 700; }
.entry ul ul, .entry ol ol { margin-top: .4em; }
.entry figure { margin-inline: 0; }
.entry img { border-radius: 16px; }
.entry figcaption, .entry .wp-element-caption { margin-top: 10px; font-size: .875rem; color: var(--muted); text-align: center; line-height: 1.8; }
.entry blockquote { margin-inline: 0; padding: 18px 22px; border-inline-start: 3px solid var(--d-gold); background: var(--surface); border-radius: 0 14px 14px 0; box-shadow: var(--shadow-card); }
.entry blockquote p { font-weight: 600; }
.entry blockquote cite { display: block; margin-top: 6px; font-size: .875rem; color: var(--muted); font-style: normal; }
.entry hr { border: 0; height: 1px; background: var(--line); margin-block: 2.4em; }
.entry code { font-size: .875em; padding: 2px 6px; border-radius: 6px; background: var(--bg-tint); direction: ltr; unicode-bidi: isolate; }
.entry mark { background: #FBF3E2; color: inherit; padding-inline: 3px; border-radius: 4px; }

.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: var(--shadow-card); }
.entry table { width: 100%; border-collapse: collapse; font-size: .9375rem; line-height: 1.75; min-width: 520px; }
.entry th, .entry td { padding: 12px 14px; text-align: start; vertical-align: top; border-bottom: 1px solid var(--line); }
.entry thead th { background: var(--bg); font-weight: 700; color: var(--ink); }
.entry tbody tr:last-child > * { border-bottom: 0; }
.entry tbody th { font-weight: 650; }
.entry .wp-block-table { margin-inline: 0; }
.entry .wp-block-table.is-style-dy-compare td:nth-child(2) { color: var(--ink); font-weight: 600; }

/* block styles */
.entry .is-style-dy-answer, .entry .is-style-dy-note, .entry .is-style-dy-warn { padding: 18px 22px; border-radius: 16px; }
.entry .is-style-dy-answer { background: var(--brand-soft); border: 1px solid color-mix(in srgb, var(--cta) 18%, transparent); }
.entry .is-style-dy-note { background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--d-blue); box-shadow: var(--shadow-card); }
.entry .is-style-dy-warn { background: #FBF3E2; border: 1px solid #EBD7A8; }
.entry .is-style-dy-answer > * + *, .entry .is-style-dy-note > * + *, .entry .is-style-dy-warn > * + * { margin-top: .6em; }
.entry ul.is-style-dy-checks { list-style: none; padding: 0; }
.entry ul.is-style-dy-checks li { position: relative; padding-inline-start: 34px; }
.entry ul.is-style-dy-checks li::before { content: ""; position: absolute; inset-inline-start: 0; top: .45em; width: 22px; height: 22px; border-radius: 50%; background: var(--brand-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230A7D63' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4L18 8'/%3E%3C/svg%3E") center / 15px no-repeat; }

/* in-article CTA */
.entry .cta-inline { margin-block: 2em; padding: 22px 24px; border-radius: 18px; background: var(--surface); border: 1px solid var(--line); border-inline-start: 3px solid var(--cta); box-shadow: var(--shadow-card); display: grid; gap: 8px; justify-items: start; }
.cta-inline__title { font-weight: 750; font-size: 1.0625rem; color: var(--ink) !important; }
.cta-inline__text { font-size: .9688rem; line-height: 1.85; color: var(--ink-2) !important; }
.entry .cta-inline .btn { margin-top: 6px; }

.post__disclaimer { margin-top: 36px; display: flex; gap: 10px; align-items: flex-start; font-size: .875rem; line-height: 1.85; color: var(--muted); padding: 14px 16px; border-radius: 14px; background: var(--bg-tint); }
.post__disclaimer .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--muted); }

.cta-end { position: relative; isolation: isolate; overflow: clip; margin-top: 28px; padding: 32px 28px; border-radius: 24px; background: var(--navy); color: var(--on-dark); display: grid; gap: 12px; justify-items: start; }
.cta-end::before { content: ""; position: absolute; z-index: -1; width: 320px; height: 320px; inset-inline-end: -100px; bottom: -160px; border-radius: 50%; background: var(--d-emerald); filter: blur(80px); opacity: .22; }
.cta-end__title { font-size: clamp(1.25rem, 1.1rem + .6vw, 1.5rem); font-weight: 780; line-height: 1.55; }
.cta-end__text { color: var(--on-dark-2); line-height: 1.9; max-width: 56ch; }
.cta-end .btn { margin-top: 6px; }
@media (max-width: 599px) { .cta-end .btn { width: 100%; } }

.author-box { margin-top: 28px; display: grid; grid-template-columns: 72px 1fr; gap: 18px; align-items: start; padding: 22px; border-radius: 20px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-card); }
.author-box img { width: 72px; height: 72px; border-radius: 50%; object-fit: cover; }
.author-box__name { font-weight: 750; font-size: 1.0625rem; }
.author-box__name a:hover { color: var(--cta); }
.author-box__role { font-size: .875rem; color: var(--cta); font-weight: 600; }
.author-box__bio { margin-top: 8px; font-size: .9375rem; line-height: 1.85; color: var(--ink-2); }
.author-box__links { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: .875rem; }
.author-box__links a { color: var(--ink-2); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.author-box__links a:hover { color: var(--cta); }

.related { padding-block: 64px 88px; background: var(--bg-tint); }
.related .h3 { margin-bottom: 24px; }

/* reading progress (article.js) */
.progress-bar { position: fixed; top: 0; inset-inline: 0; height: 3px; z-index: 60; background: var(--cta); transform-origin: right; transform: scaleX(0); pointer-events: none; }
.admin-bar .progress-bar { top: 32px; }

/* ---------- content pages (about, terms, ...) ---------- */
.prose a:not(.btn) { color: var(--cta); text-decoration: underline; text-underline-offset: 3px; }
.prose h3 { font-size: 1.0625rem; font-weight: 700; margin: 22px 0 8px; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 14px; font-size: .9375rem; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 10px 8px; text-align: start; vertical-align: top; }
.page-head .crumbs { margin-bottom: 14px; }
