/* وبلاگ: کارت نوشته، فهرست، صفحهٔ نوشته و تایپوگرافی متن. RTL-first. این فایل در ویرایشگر پنل (پیش‌نمایش) هم بارگذاری می‌شود؛ پس همهٔ رنگ‌ها fallback دارند. */

/* ---------- کارت نوشته ---------- */
.post-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,19rem),1fr));gap:clamp(1.8rem,3vw,2.6rem) clamp(1.2rem,2.5vw,2rem)}
.post-card{min-inline-size:0}
.post-card__link{display:flex;flex-direction:column;gap:1.1rem;block-size:100%;text-decoration:none}
.post-card__cover{position:relative;overflow:hidden;aspect-ratio:16/10;border-radius:1.25rem;background:var(--ts-mist,#dfe8d8);box-shadow:0 1px 2px rgba(18,36,27,.06),0 16px 32px -22px rgba(18,36,27,.4)}
.post-card__cover>:is(img,svg){display:block;inline-size:100%;block-size:100%;object-fit:cover;transition:transform .7s var(--ease,ease)}
.post-card__link:hover .post-card__cover>:is(img,svg){transform:scale(1.04)}
.post-card__body{display:flex;flex-direction:column;flex:1;gap:.55rem}
.post-card__tags{display:flex;flex-wrap:wrap;gap:.4rem;align-items:center}
.post-chip{display:inline-block;max-inline-size:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;padding:.02rem .75rem;border-radius:2rem;font-size:.82rem;font-weight:700;background:var(--ts-mist,#dfe8d8);color:var(--ts-primary,#2f6b45)}
.post-card__title{margin:0;font-size:clamp(1.15rem,1.05rem + .5vw,1.45rem);line-height:1.6}
.post-card__title{background:linear-gradient(var(--ts-accent,#e0a82e),var(--ts-accent,#e0a82e)) no-repeat 100% 100%/0 .16em;transition:background-size .45s var(--ease,ease);padding-block-end:.1em}
.post-card__link:hover .post-card__title{background-size:100% .16em}
.post-card__text{margin:0;color:#35493c;font-size:.98rem;line-height:1.9;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.post-card .post-meta{margin-block-start:auto;padding-block-start:.5rem}

/* اولین نوشتهٔ صفحهٔ اول: افقی و بزرگ‌تر (فقط وقتی دست‌کم سه نوشته هست) */
.post-grid--lead>.post-card:first-child{grid-column:1/-1}
@media (min-width:52em){
	.post-grid--lead>.post-card:first-child .post-card__link{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,.85fr);gap:clamp(1.5rem,3vw,2.8rem);align-items:center}
	.post-grid--lead>.post-card:first-child .post-card__cover{aspect-ratio:16/10;border-radius:1.6rem}
	.post-grid--lead>.post-card:first-child .post-card__title{font-size:clamp(1.6rem,1.2rem + 1.2vw,2.3rem)}
	.post-grid--lead>.post-card:first-child .post-card__text{font-size:1.08rem;-webkit-line-clamp:4}
	.post-grid--lead>.post-card:first-child .post-card__body{gap:.8rem}
}

/* ---------- نویسنده، تاریخ، زمان مطالعه ---------- */
.post-meta{display:flex;flex-wrap:wrap;align-items:center;gap:.35rem 1.1rem;font-size:.9rem;color:#4a5f50}
.post-meta__author{display:inline-flex;align-items:center;gap:.55rem;font-weight:700;color:var(--ts-ink,#12241b)}
.post-meta__img{inline-size:1.75rem;block-size:1.75rem;border-radius:50%;object-fit:cover;flex:none;background:var(--ts-mist,#dfe8d8)}
.post-meta__item{white-space:nowrap}
.post-meta__item+.post-meta__item{padding-inline-start:1.1rem;border-inline-start:1px solid var(--ts-line,#c3d0bb)}

/* ---------- صفحهٔ فهرست ---------- */
.blog-head .page-head__lead{margin-block-end:0}
.blog-filters{margin-block-start:1.6rem}
.blog-scope{margin:0 0 1.6rem;color:#35493c}
.blog-scope a{margin-inline-start:.6rem;font-weight:700}
.blog-sec-head{display:flex;flex-wrap:wrap;align-items:end;justify-content:space-between;gap:.6rem 2rem;margin-block-end:1.6rem}
.blog-sec-head h2{margin:0}
.section--blog{padding-block-start:clamp(1rem,2vw,2rem)}

/* ---------- صفحهٔ نوشته ---------- */
.wrap--post{width:min(100% - 2*var(--gutter,1.5rem),44rem)}
.wrap--wide{width:min(100% - 2*var(--gutter,1.5rem),62rem)}
.post-head{padding-block:clamp(2rem,5vw,4rem) clamp(1.2rem,2.5vw,2rem)}
.post-head__crumb{margin:0 0 1rem;font-size:.92rem;color:#4a5f50}
.post-head__crumb a{text-decoration:none;border-block-end:1px solid var(--ts-line,#c3d0bb)}
.post-head__crumb a:hover{border-color:var(--ts-accent,#e0a82e)}
.post-head h1{font-size:clamp(1.9rem,1.3rem + 2.6vw,3.1rem);line-height:1.5;margin-block-end:.5em}
.post-head__lead{font-size:clamp(1.1rem,1.04rem + .35vw,1.3rem);line-height:1.9;color:#2b4034;margin-block-end:1.4rem}
.post-head .post-meta{font-size:.95rem;margin-block-end:1.2rem}
.post-head .post-meta__img{inline-size:2.5rem;block-size:2.5rem}
.post-head__tools{display:flex;flex-wrap:wrap;align-items:center;gap:.6rem;margin:1.2rem 0 0}

.post-pill{display:inline-flex;align-items:center;gap:.7rem;max-inline-size:100%;padding:.35rem 1.1rem .35rem .5rem;border:1px solid var(--ts-line,#c3d0bb);border-radius:2rem;background:rgba(255,255,255,.6);text-decoration:none;font-size:.95rem;transition:border-color .2s,background .2s}
.post-pill:hover{border-color:var(--ts-primary,#2f6b45);background:#fff}
.post-pill__mark{display:inline-grid;place-items:center;flex:none;inline-size:2rem;block-size:2rem}
.post-pill__mark>img{inline-size:2rem;block-size:2rem;border-radius:50%;object-fit:cover}
.post-pill__mark .lbadge{--lh:2rem;box-shadow:none}
.post-pill__mark:empty{display:none}
.post-pill:has(.post-pill__mark:empty){padding-inline-start:1.1rem}

.post-cover{margin-block:0 clamp(1.8rem,3.5vw,3rem)}
.post-cover img{display:block;inline-size:100%;max-block-size:min(34rem,70vh);object-fit:cover;border-radius:1.5rem;box-shadow:0 24px 50px -30px rgba(18,36,27,.55)}

/* ---------- متن نوشته ---------- */
.post-body{font-size:1.12rem;line-height:2.1;overflow-wrap:anywhere}
.post-body>*+*{margin-block-start:1.2em}
.post-body h2,.post-body h3,.post-body h4{line-height:1.6;margin-block:2.1em .55em}
.post-body h2{font-size:clamp(1.45rem,1.25rem + .8vw,1.85rem)}
.post-body h3{font-size:1.28rem}
.post-body h2+*,.post-body h3+*,.post-body h4+*{margin-block-start:0}
.post-body a{color:var(--ts-primary,#2f6b45);text-underline-offset:.25em;text-decoration-thickness:1px}
.post-body a:hover{text-decoration-thickness:2px}
.post-body ul,.post-body ol{padding-inline-start:1.5rem;list-style:revert}
.post-body li+li{margin-block-start:.4em}
.post-body blockquote{margin-inline:0;padding:.2rem 1.3rem;border-inline-start:4px solid var(--ts-accent,#e0a82e);background:rgba(255,255,255,.55);border-radius:.8rem;color:#2b4034}
.post-body blockquote p{margin:.5em 0}
.post-body code{font-family:ui-monospace,Menlo,Consolas,monospace;font-size:.9em}
.post-body :not(pre)>code{background:var(--ts-mist,#dfe8d8);padding:.1em .4em;border-radius:.4em;direction:ltr;unicode-bidi:isolate}
.post-body pre{background:var(--ts-forest,#0f2118);color:#e8f0e2;padding:1rem 1.3rem;border-radius:1rem;overflow-x:auto;direction:ltr;text-align:left;line-height:1.7;font-size:.95rem}
.post-body hr{border:0;border-block-start:2px dashed var(--ts-line,#c3d0bb);margin-block:2.6rem}

/* تصویر و ویدیوی میان متن */
.post-body .md-media{margin-inline:0;margin-block:2rem}
.post-body .md-media a{display:block;cursor:zoom-in}
.post-body .md-media img,.post-body .md-media video{display:block;inline-size:100%;block-size:auto;max-block-size:38rem;object-fit:contain;border-radius:1.1rem;background:var(--ts-mist,#dfe8d8)}
.post-body .md-media video{background:#0d1a12;aspect-ratio:16/9}
.post-body .md-media figcaption{margin-block-start:.7rem;text-align:center;font-size:.9rem;line-height:1.8;color:#4a5f50}
/* اندازه و چینش انتخاب‌شده در ویرایشگر: وسط، یا شناور کنار متن (راست/چپ فیزیکی) */
.post-body .md-media--sized{inline-size:var(--w);margin-inline:auto}
.post-body .md-media--right{float:right;margin:.4rem 0 1rem 1.6rem}
.post-body .md-media--left{float:left;margin:.4rem 1.6rem 1rem 0}
.post-body::after{content:"";display:block;clear:both}
.post-body :is(h2,h3,hr,pre){clear:both}
@media (min-width:62em){
	.post-body .md-media:not(.md-media--sized){margin-inline:-3.5rem}
}
@media (max-width:40em){
	.post-body .md-media--sized{float:none;inline-size:max(var(--w),60%);margin:1.6rem auto}
}

/* ---------- پایان نوشته: پروژه و نویسنده ---------- */
.post-foot{display:grid;gap:1rem;margin-block:clamp(2.5rem,5vw,4rem) 0;padding-block-start:2rem;border-block-start:1px solid var(--ts-line,#c3d0bb)}
.post-project{border:1px solid var(--ts-line,#c3d0bb);border-radius:var(--radius,1.25rem);background:rgba(255,255,255,.65);overflow:hidden;transition:border-color .2s,box-shadow .3s}
.post-project:hover{border-color:var(--ts-primary,#2f6b45);box-shadow:0 18px 36px -26px rgba(18,36,27,.5)}
.post-project__link{display:grid;grid-template-columns:minmax(0,9.5rem) minmax(0,1fr);align-items:stretch;text-decoration:none}
.post-project__media{display:block;position:relative;min-block-size:8rem;background:var(--ts-mist,#dfe8d8)}
.post-project__media>:is(img,svg,.media__frame,.media__logo){position:absolute;inset:0;inline-size:100%;block-size:100%}
.post-project__media>svg{object-fit:cover}
.post-project__media .media__logo .lbadge{--lh:4.4rem}
.post-project__text{display:flex;flex-direction:column;gap:.25rem;padding:1.1rem 1.3rem;min-inline-size:0}
.post-project__text small{color:#4a5f50;font-size:.85rem}
.post-project__text strong{font-size:1.25rem;line-height:1.6}
.post-project__text>span{color:#35493c;font-size:.95rem;line-height:1.85}
.post-project__text .link-arrow{align-self:flex-start;margin-block-start:.5rem;font-style:normal;font-size:.95rem}
.post-project:hover .link-arrow .arrow{transform:translateX(-4px)}
@media (max-width:34em){
	.post-project__link{grid-template-columns:1fr}
	.post-project__media{min-block-size:0;aspect-ratio:16/8}
}
.post-author{display:flex;align-items:center;gap:1rem;padding:.4rem .2rem}
.post-author img{inline-size:4rem;block-size:4rem;border-radius:50%;object-fit:cover;flex:none;background:var(--ts-mist,#dfe8d8)}
.post-author p{margin:0}
.post-author__name{font-size:1.05rem}
.post-author__role{color:#4a5f50;font-size:.92rem}
.post-author__links{display:flex;flex-wrap:wrap;gap:.3rem 1.2rem;margin-block-start:.3rem!important;font-size:.92rem}
.post-author__links a{color:var(--ts-primary,#2f6b45);font-weight:700;text-underline-offset:.25em}

@media (prefers-reduced-motion:reduce){
	.post-card__link:hover .post-card__cover>:is(img,svg){transform:none}
}

/* فاصلهٔ بخش‌ها: صفحه‌های وبلاگ home.css را بارگذاری نمی‌کنند؛ مقدارها همان مقدارهای آن‌هاست. */
.post .section--tight,.blog-head+.section--tight,.project-posts{padding-block:clamp(1.5rem,3vw,2.5rem) clamp(2.5rem,5vw,4rem)}
.post .section-title{margin-block-end:1.6rem}
.post-foot{margin-block-end:clamp(1.5rem,3vw,2.5rem)}
.section--blog{padding-block:clamp(3rem,6vw,5.5rem)}
.section--blog .section-head{display:grid;grid-template-columns:1fr auto;gap:.4rem 2rem;align-items:end;margin-block-end:2.2rem}
