/* ==========================================================================
   Razima — pages/content.css
   صفحه‌های محتوایی: برگه‌ها (درباره‌ی ما، ارسال، تعویض، قوانین، راهنمای سایز، FAQ)، تماس با ما،
   مجله و مطلب. سربرگ مشترک `.chead` هم‌خانواده‌ی `.lhead` فروشگاه است: سطح نرم، لاتین کوچک، تیتر با دوخت زیگزاگ.
   ========================================================================== */

/* ---------- سربرگ ---------- */
.chead { background: var(--tint); border-bottom: 1px solid var(--line); }
.chead__inner { display: grid; grid-template-columns: minmax(0, 1fr); justify-items: start; gap: 6px; padding-block: clamp(20px, 3.6vw, 40px) clamp(18px, 3vw, 32px); }
.chead__latin { margin-top: 6px; color: var(--tone); }
.chead h1 { position: relative; padding-bottom: 14px; font-size: var(--fs-3xl); line-height: 1.5; text-wrap: balance; }
.chead h1::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 48px; height: 8px; background: var(--tone); -webkit-mask: var(--zz-mask); mask: var(--zz-mask); }
.chead p { max-width: 64ch; color: var(--fg-muted); line-height: 2; }
.chead__search { width: min(520px, 100%); margin-top: 10px; }
.chead__chips { display: flex; max-width: 100%; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.chead__chips .chip { background: var(--surface); }
.chead__chips .chip.is-active { border-color: var(--tone); box-shadow: inset 0 0 0 1px var(--tone); }

/* ---------- برگه‌ی ثابت ---------- */
.doc-layout { display: grid; gap: 28px; align-items: start; padding-block: clamp(22px, 4vw, 40px) 0; }
@media (min-width: 1025px) {
  .doc-layout { grid-template-columns: minmax(0, 1fr) 280px; gap: 44px; }
  .doc-layout__aside { position: sticky; top: calc(var(--header-h) + 24px); }
}
@media (max-width: 1024px) { .doc-layout__aside { order: -1; } .doc-layout__aside .side-nav { display: none; } }
.doc-layout__main { display: grid; gap: 28px; min-width: 0; }
.doc-layout__aside { display: grid; gap: 14px; min-width: 0; }
.doc { max-width: none; padding: clamp(20px, 3.4vw, 40px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.doc:empty { display: none; }
.doc.is-faq { padding: 0; border: 0; background: none; }
.page-image { max-width: 100%; border-radius: var(--r-xl); }

.side-nav { display: grid; padding: 8px; border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.side-nav__title { padding: 8px 12px; color: var(--fg-subtle); font-size: var(--fs-xs); font-weight: 750; }
.side-nav a { position: relative; padding: 10px 12px; border-radius: var(--r); color: var(--fg-muted); font-size: var(--fs-sm); font-weight: 650; transition: background-color var(--dur-2), color var(--dur-2); }
.side-nav a:hover { background: var(--bg-soft); color: var(--fg); }
.side-nav a[aria-current] { background: var(--accent-soft); color: var(--fg); font-weight: 750; }
.side-nav a[aria-current]::after { content: ""; position: absolute; inset-inline-end: 12px; top: 50%; width: 20px; height: 8px; transform: translateY(-50%); background: var(--accent); -webkit-mask: var(--zz-mask); mask: var(--zz-mask); }

.toc { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.toc__title { margin-bottom: 6px; color: var(--fg-subtle); font-size: var(--fs-xs); font-weight: 750; }
.toc ol { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.toc a { display: block; padding: 5px 10px; border-inline-start: 2px solid var(--line); color: var(--fg-muted); font-size: var(--fs-sm); line-height: 1.8; transition: color var(--dur-2), border-color var(--dur-2); }
.toc a.is-sub { padding-inline-start: 22px; font-size: var(--fs-xs); }
.toc a:hover { color: var(--fg); }
.toc a.is-active { border-color: var(--accent); color: var(--fg); font-weight: 700; }
@media (min-width: 1025px) { [data-toc-inline] { display: none; } }
@media (max-width: 1024px) { .article__aside [data-toc] { display: none; } }

/* پرسش‌های متداول: content.js هر h3 و پاسخ پس از آن را به یک بخش بازشونده تبدیل می‌کند */
.faq-list { display: grid; gap: 10px; }
.faq-item { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: border-color var(--dur-2); }
.faq-item[open] { border-color: var(--line-strong); }
.faq-item > summary { display: flex; align-items: center; gap: 12px; padding: 16px 18px; font-weight: 750; line-height: 1.8; cursor: pointer; list-style: none; }
.faq-item > summary::-webkit-details-marker { display: none; }
.faq-item > summary:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; border-radius: var(--r-lg); }
.faq-item > summary::after { content: "+"; display: grid; place-items: center; flex: none; width: 28px; height: 28px; margin-inline-start: auto; border-radius: 50%; background: var(--bg-soft); color: var(--fg); font-weight: 700; transition: transform var(--dur-2) var(--ease); }
.faq-item[open] > summary::after { transform: rotate(45deg); }
.faq-item__body { padding: 0 18px 18px; color: var(--fg-muted); line-height: 2; }
.faq-item__body > * + * { margin-top: .8em; }
.doc.is-faq h2 { margin-top: 1.6em; }

/* راهنمای سایز (صفحه) */
.gsec { display: grid; gap: 14px; padding: clamp(18px, 3vw, 30px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.gsec__title { position: relative; padding-bottom: 14px; font-size: var(--fs-xl); }
.gsec__title::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 48px; height: 8px; background: var(--tone); -webkit-mask: var(--zz-mask); mask: var(--zz-mask); }
.gsec .sguide__table table { display: table; width: 100%; }
.gsec__guide + .gsec__guide { margin-top: 12px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }

/* درباره‌ی ما: دسته‌ها */
.page-cats { display: grid; gap: 16px; }
.page-cats__title { position: relative; padding-bottom: 14px; font-size: var(--fs-xl); }
.page-cats__title::after { content: ""; position: absolute; inset-inline-start: 0; bottom: 0; width: 48px; height: 8px; background: var(--tone); -webkit-mask: var(--zz-mask); mask: var(--zz-mask); }
.page-cats__grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.page-cat { display: flex; align-items: center; gap: 12px; padding: 10px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--tint); font-size: var(--fs-sm); font-weight: 750; transition: transform var(--dur-3) var(--ease), box-shadow var(--dur-3); }
.page-cat:hover { transform: translateY(-3px); box-shadow: var(--sh-2); }
.page-cat__img { display: grid; place-items: center; flex: none; width: 58px; height: 58px; overflow: hidden; border-radius: var(--r); background: var(--surface); color: var(--tone); }
.page-cat__img img { width: 100%; height: 100%; object-fit: cover; }
.page-cat__name { flex: 1; line-height: 1.6; }
.page-cat__arrow { color: var(--tone); }

/* «بپرسید» پایین برگه‌ها: برچسب آویز + دو دکمه، روی سطح نرم */
.ask { display: grid; justify-items: start; gap: 10px; padding: clamp(20px, 3vw, 32px); border-radius: var(--r-xl); background: var(--bg-soft); }
.ask__title { font-size: var(--fs-xl); }
.ask p { color: var(--fg-muted); }

/* ---------- تماس با ما ---------- */
.contact-top { padding-top: clamp(20px, 3vw, 32px); }
.contact-strip { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); }
.contact-card { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); transition: transform var(--dur-2) var(--ease), box-shadow var(--dur-2); }
a.contact-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); }
.contact-card__icon { display: grid; place-items: center; flex: none; width: 44px; height: 44px; border-radius: var(--r); background: var(--tint); color: var(--tone); }
.contact-card__body { display: grid; gap: 2px; min-width: 0; }
.contact-card__label { display: inline-flex; align-items: center; gap: 6px; color: var(--fg-subtle); font-size: var(--fs-xs); font-weight: 650; }
.contact-card__value { font-weight: 750; line-height: 1.8; overflow-wrap: anywhere; }
.contact { display: grid; gap: 24px; align-items: start; padding-block: 24px 0; }
@media (min-width: 961px) {
  .contact { grid-template-columns: 340px minmax(0, 1fr); gap: 32px; }
  .contact__side { position: sticky; top: calc(var(--header-h) + 24px); }
}
.contact__side { display: grid; gap: 12px; }
.addr-card, .contact-social-card { display: grid; gap: 10px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--tint); }
.addr-card__address { font-weight: 750; line-height: 1.9; }
.contact-socials { display: flex; flex-wrap: wrap; gap: 8px; }
.contact-social { display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px 6px 8px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--surface); font-size: var(--fs-sm); font-weight: 650; transition: transform var(--dur-2) var(--ease); }
.contact-social .icon { width: 28px; height: 28px; padding: 5px; border-radius: 50%; background: var(--bg-soft); color: var(--tone); }
.contact-social:hover { transform: translateY(-2px); }
.contact-form { position: relative; display: grid; gap: 16px; padding: clamp(20px, 3vw, 30px); padding-top: clamp(26px, 3.4vw, 36px); border: 1px solid var(--line); border-radius: var(--r-xl); background: var(--surface); }
.contact-form::before { content: ""; position: absolute; inset-inline: 24px; top: 0; height: 8px; background: var(--accent); -webkit-mask: var(--zz-mask); mask: var(--zz-mask); }
.contact-form__head h2 { font-size: var(--fs-xl); }
.contact-form__head p { color: var(--fg-muted); font-size: var(--fs-sm); }
.contact-form__row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.contact-form__row > .field { align-content: start; }
.subject-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.subject-chips input { position: absolute; opacity: 0; pointer-events: none; }
.subject-chips input:checked + .chip { border-color: var(--primary); background: var(--primary); color: var(--on-primary); }

/* ---------- مجله ---------- */
.blog { display: grid; gap: 28px; padding-block: clamp(22px, 4vw, 36px) 0; }
.blog__grid { display: grid; gap: 22px 20px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.blog__count { color: var(--fg-muted); font-size: var(--fs-sm); }
.blog__count a { color: var(--brand); text-decoration: underline; }
.post-feature { position: relative; display: grid; overflow: hidden; border-radius: var(--r-xl); background: var(--tint); transition: box-shadow var(--dur-2); }
@media (min-width: 861px) { .post-feature { grid-template-columns: 1.25fr 1fr; } }
.post-feature:hover { box-shadow: var(--sh-2); }
.post-feature__media { display: block; aspect-ratio: 16 / 10; max-width: 100%; overflow: hidden; background: var(--grad-media); }
.post-feature__media img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--dur-4) var(--ease); }
.post-feature:hover .post-feature__media img { transform: scale(1.03); }
.post-feature__body { display: grid; align-content: center; justify-items: start; gap: 12px; padding: clamp(20px, 3vw, 36px); }
.post-feature__title { font-size: var(--fs-2xl); line-height: 1.6; }
.post-feature__title a::after { content: ""; position: absolute; inset: 0; }
.post-feature__excerpt { color: var(--fg-muted); line-height: 2; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; color: var(--fg-subtle); font-size: var(--fs-xs); }
.blog-empty { display: grid; justify-items: center; gap: 10px; padding: clamp(36px, 6vw, 64px) 20px; border: 1px dashed var(--line-strong); border-radius: var(--r-xl); text-align: center; }
.blog-empty__icon { display: grid; place-items: center; width: 72px; height: 72px; border-radius: 50%; background: var(--bg-soft); color: var(--tone); }
.blog-empty p { color: var(--fg-muted); font-size: var(--fs-sm); }

/* ---------- مطلب ---------- */
.read-progress { position: fixed; inset: 0 0 auto; z-index: 120; height: 3px; background: var(--accent); transform: scaleX(var(--rz-p, 0)); transform-origin: right; pointer-events: none; }
.article-head { padding-block: clamp(22px, 4vw, 44px) 0; }
.article-head__inner { display: grid; gap: 14px; max-width: 860px; }
.article-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.4rem); line-height: 1.55; text-wrap: balance; }
.article-head__excerpt { color: var(--fg-muted); font-size: var(--fs-md); line-height: 2; max-width: 70ch; }
.article-hero { margin: 24px 0 0; aspect-ratio: 21 / 9; max-width: 100%; overflow: hidden; border-radius: var(--r-xl); background: var(--grad-media); }
.article-hero img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 640px) { .article-hero { aspect-ratio: 16 / 10; } }
.article { display: grid; gap: 32px; align-items: start; padding-top: 32px; }
@media (min-width: 1025px) {
  .article { grid-template-columns: minmax(0, 1fr) 300px; gap: 48px; }
  .article__aside { position: sticky; top: calc(var(--header-h) + 24px); }
}
.article__main { display: grid; gap: 28px; min-width: 0; }
.article__aside { display: grid; gap: 14px; min-width: 0; }
.article .prose { max-width: 72ch; font-size: 1.04rem; }
.share { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.share__label { margin-inline-end: auto; color: var(--fg-muted); font-size: var(--fs-xs); font-weight: 700; }
.advice { display: grid; justify-items: start; gap: 10px; padding: 20px; border-radius: var(--r-lg); background: var(--bg-soft); color: var(--fg-muted); font-size: var(--fs-sm); }
.advice strong { color: var(--fg); font-size: var(--fs-md); }
.tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 18px; border-top: 1px dashed var(--line-strong); }
.tags__label { color: var(--fg-subtle); font-size: var(--fs-xs); font-weight: 700; }
.author-box { display: flex; align-items: center; gap: 14px; padding: 18px; border-radius: var(--r-lg); background: var(--bg-soft); }
.author-box__avatar { display: grid; place-items: center; flex: none; width: 52px; height: 52px; border-radius: var(--r); background: var(--surface); color: var(--tone); }
.author-box p { color: var(--fg-muted); font-size: var(--fs-xs); }

/* ---------- دیدگاه‌های مطلب ---------- */
.comments { display: grid; gap: 18px; }
.comments__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.comments__head h2 { font-size: var(--fs-xl); }
.comment-list { display: grid; gap: 12px; list-style: none; margin: 0; padding: 0; }
.comment { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 4px 14px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.comment.is-new { border-color: var(--accent); }
.comment__avatar { display: grid; place-items: center; grid-row: 1 / span 2; width: 44px; height: 44px; border-radius: var(--r); background: var(--bg-soft); color: var(--tone); font-weight: 800; }
.comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.comment__name { font-weight: 750; }
.comment__date { color: var(--fg-subtle); font-size: var(--fs-xs); }
.comment__text { color: var(--fg-muted); line-height: 2; white-space: pre-line; overflow-wrap: anywhere; }
.comment-form { display: grid; gap: 14px; padding: clamp(18px, 2.4vw, 26px); border-radius: var(--r-lg); background: var(--bg-soft); }
.comment-form__row { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.comment-form__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; }
.comment-form .textarea { min-height: 120px; }

@media (prefers-reduced-motion: reduce) { .read-progress { display: none; } }
