/* Text links: both internal and external, including visited sources. */
body.tamirpc-rtl :is(.article-content,.archive-description,.tamirpc-author-bio,.comment-content) a[href]:not(.wp-block-button__link):not(.wp-element-button){color:#ff5f00!important;text-decoration:underline;text-decoration-thickness:1px;text-underline-offset:4px;transition:color .16s ease}
body.tamirpc-rtl :is(.article-content,.archive-description,.tamirpc-author-bio,.comment-content) a[href]:not(.wp-block-button__link):not(.wp-element-button):is(:hover,:focus-visible){color:#0875e1!important}
body.tamirpc-rtl :is(.article-content,.archive-description,.tamirpc-author-bio,.comment-content) a[href]:focus-visible{outline:2px solid #0875e1;outline-offset:4px;border-radius:2px}
body.tamirpc-rtl :is(.article-content,.archive-description,.tamirpc-author-bio,.comment-content) a[href] :is(strong,em,span){color:inherit}

/* All front-end data tables. Keep semantic table elements and cell directions. */
body.tamirpc-rtl{--tpc-table-text:#26313e;--tpc-table-cell:#fafafa;--tpc-table-stripe:#eef0f3;--tpc-table-hover:#fff3e9;--tpc-table-line:#d9dee5;--tpc-table-head-text:#fff}
body.tamirpc-rtl.dark{--tpc-table-text:#f0f2f5;--tpc-table-cell:#24272c;--tpc-table-stripe:#30343a;--tpc-table-hover:#403226;--tpc-table-line:#4b5159}
body.tamirpc-rtl :is(.article-content,.archive-description,.tamirpc-author-bio){min-width:0}
body.tamirpc-rtl table:not([role="presentation"]){width:100%;max-width:100%!important;border-collapse:separate;border-spacing:0;border:1px solid var(--tpc-table-line);border-block-start:3px solid #ff5f00;border-radius:12px;margin:24px 0;background:var(--tpc-table-cell);color:var(--tpc-table-text);font-family:inherit;font-size:14px;line-height:1.9;box-sizing:border-box;text-align:start}
body.tamirpc-rtl table:not([role="presentation"]) :is(th,td){padding:14px 16px;border:0;border-inline-end:1px solid var(--tpc-table-line)!important;border-block-end:1px solid var(--tpc-table-line)!important;vertical-align:top;font-family:inherit;line-height:1.9;overflow-wrap:anywhere;box-sizing:border-box}
body.tamirpc-rtl table:not([role="presentation"]) th{background:#ff5f00!important;color:var(--tpc-table-head-text)!important;font-weight:700}
body.tamirpc-rtl table:not([role="presentation"]) td{background:var(--tpc-table-cell)!important;color:var(--tpc-table-text)!important}
body.tamirpc-rtl table:not([role="presentation"]) tbody>tr:nth-child(even)>td{background:var(--tpc-table-stripe)!important}
@media(hover:hover){body.tamirpc-rtl table:not([role="presentation"]) tbody>tr:hover>td{background:var(--tpc-table-hover)!important}}
body.tamirpc-rtl table:not([role="presentation"]) tr>:last-child{border-inline-end:0!important}
body.tamirpc-rtl table:not([role="presentation"]) :is(tbody,tfoot):last-child>tr:last-child>:is(th,td){border-block-end:0!important}
body.tamirpc-rtl table:not([role="presentation"]) caption:not(.screen-reader-text){caption-side:top;text-align:start;padding:0 0 10px;font-size:13px;color:var(--muted);font-family:inherit}
body.tamirpc-rtl table:not([role="presentation"]) :is(th,td)>:first-child{margin-block-start:0}
body.tamirpc-rtl table:not([role="presentation"]) :is(th,td)>:last-child{margin-block-end:0}
body.tamirpc-rtl :is(.tamirpc-table-scroll,.wp-block-table,.tmgr-table-wrap){display:block;max-width:100%;min-width:0;overflow-x:auto;overscroll-behavior-x:contain;border:1px solid var(--tpc-table-line);border-radius:12px;margin-block:24px;scrollbar-width:thin;scrollbar-color:#ff5f00 var(--tpc-table-stripe);box-sizing:border-box}
body.tamirpc-rtl :is(.tamirpc-table-scroll,.wp-block-table,.tmgr-table-wrap)>table{margin:0!important;border-inline:0;border-block-end:0;border-radius:0}
body.tamirpc-rtl :is(.tamirpc-table-scroll,.wp-block-table,.tmgr-table-wrap):focus-visible{outline:2px solid #0875e1;outline-offset:3px}
body.tamirpc-rtl .wp-block-table figcaption{padding:10px 12px;font-family:inherit;font-size:12px;line-height:1.9;color:var(--muted);text-align:center}
@media(max-width:620px){body.tamirpc-rtl table:not([role="presentation"]){font-size:13px}body.tamirpc-rtl table:not([role="presentation"]) :is(th,td){padding:11px 12px}body.tamirpc-rtl :is(.tamirpc-table-scroll,.wp-block-table,.tmgr-table-wrap){border-radius:10px}}
@media(prefers-reduced-motion:reduce){body.tamirpc-rtl .article-content a[href]{transition:none}}

/* Orange header cells retain white text even in pasted rich text. */
body.tamirpc-rtl table:not([role="presentation"]) th :is(p,strong,em,span){color:inherit!important}

/* Existing post tags, linked to their native WordPress archives. */
.tamirpc-post-tags{display:flex;align-items:baseline;flex-wrap:wrap;gap:12px;max-width:1030px;margin:28px auto 0;padding:16px 18px;border:1px solid var(--line);border-radius:12px;background:var(--soft);font-family:inherit}
.tamirpc-post-tags>strong{font-size:13px;color:var(--ink);white-space:nowrap}.tamirpc-post-tags ul{display:flex;flex-wrap:wrap;gap:8px;list-style:none;padding:0;margin:0;min-width:0}.tamirpc-post-tags li{margin:0;padding:0}
.tamirpc-post-tags a{display:inline-flex;align-items:center;gap:5px;border:1px solid #ffd1b6;border-radius:8px;padding:5px 10px;background:var(--white);color:#ff5f00;font-family:inherit;font-size:12px;line-height:1.9;overflow-wrap:anywhere;text-decoration:none;transition:color .16s,border-color .16s}
.tamirpc-post-tags a::before{content:'#';font-family:Arial,sans-serif}.tamirpc-post-tags a:hover,.tamirpc-post-tags a:focus-visible{color:#0875e1;border-color:#0875e1}.tamirpc-post-tags a:focus-visible{outline:2px solid #0875e1;outline-offset:3px}
@media(max-width:620px){.tamirpc-post-tags{padding:14px 12px;gap:10px}.tamirpc-post-tags a{padding:6px 10px}}
@media(prefers-reduced-motion:reduce){.tamirpc-post-tags a{transition:none}}

/* Compact single-post H1 with readable spacing on smaller screens. */
.single-article .article-header h1{font-size:32px;line-height:1.65}
@media(max-width:1080px){.single-article .article-header h1{font-size:28px}}
@media(max-width:620px){.single-article .article-header h1{font-size:24px}}

.tamirpc-legacy-anchor{display:block;height:0;scroll-margin-top:140px}

/* Keep data cells intact. Horizontal scrolling belongs to the table region. */
body.tamirpc-rtl table:not([role="presentation"]){width:max-content!important;min-width:100%;max-width:none!important;table-layout:auto!important}
body.tamirpc-rtl table:not([role="presentation"]) :is(th,td){white-space:nowrap!important;overflow-wrap:normal!important;word-break:normal!important}
body.tamirpc-rtl table:not([role="presentation"]) :is(th,td) :is(p,span,a,strong,em,li){white-space:inherit;overflow-wrap:normal;word-break:normal}
/* Before deferred JS wraps a classic table (or when JS is unavailable), prevent page-wide overflow. */
body.tamirpc-rtl :is(.article-content,.archive-description,.tamirpc-author-bio):has(>table:not([role="presentation"])){overflow-x:auto}

/* A single H2 navigation is shared by desktop and mobile. */
.single-article .article-aside[hidden]{display:none!important}
.tamirpc-toc{min-width:0}
.tamirpc-toc>summary{display:flex;align-items:center;justify-content:space-between;gap:12px;list-style:none;font-size:14px;font-weight:700;color:var(--ink);cursor:pointer;line-height:1.9}
.tamirpc-toc>summary::-webkit-details-marker{display:none}
.tamirpc-toc>summary::marker{content:''}
.tamirpc-toc>summary:focus-visible{outline:2px solid #0875e1;outline-offset:5px;border-radius:4px}
.tamirpc-toc__arrow{flex:0 0 9px;width:9px;height:9px;border-inline-end:2px solid #ff5f00;border-block-end:2px solid #ff5f00;transform:rotate(45deg);transition:transform .16s ease}
.tamirpc-toc[open] .tamirpc-toc__arrow{transform:rotate(225deg)}
.tamirpc-toc #toc{margin-top:12px;padding-top:8px;border-top:1px solid var(--line)}
.tamirpc-toc #toc a{font-size:12px;line-height:1.9;padding:7px 0;overflow-wrap:anywhere}
.tamirpc-toc #toc a:hover,.tamirpc-toc #toc a:focus-visible{color:#0875e1}
@media(max-width:1080px){
 .single-article .article-layout{grid-template-columns:minmax(0,1fr);gap:24px}
 .single-article .article-aside{display:block;min-width:0}
 .single-article .tamirpc-toc{position:static;padding:16px 18px;border-inline-start:3px solid #ff5f00;background:var(--soft)}
 .tamirpc-toc>summary{font-size:15px}
 .tamirpc-toc #toc a{font-size:13px;padding:9px 0}
}
@media(max-width:620px){
 /* 20 CSS px at either edge, instead of the former 12. */
 .single-article.container{width:min(calc(100% - 40px),var(--max))}
 .single-article .article-layout{gap:20px}
 .single-article .article-meta{gap:8px 12px;align-items:center;line-height:1.9}
 .single-article .article-meta>span,.single-article .article-meta>time{white-space:nowrap}
 /* Actual card footers occupy normal flow, so longer titles cannot overlap dates. */
 body.tamirpc-rtl .news-card__body{display:flex;flex-direction:column;gap:16px;min-height:0;padding:14px 12px}
 body.tamirpc-rtl .news-card__body>h3{margin:0}
 body.tamirpc-rtl .news-card__body>.news-card__footer{position:static;margin-block-start:auto;min-height:36px;width:100%}
 body.tamirpc-rtl :is(.news-card__footer,.hero-side-card__footer){display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;column-gap:6px;row-gap:0}
 body.tamirpc-rtl :is(.news-card__footer,.hero-side-card__footer)>.post-meta{grid-column:1;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;justify-content:center;justify-self:start;gap:0;width:auto;flex-basis:auto;font-size:9px;line-height:1.7;white-space:nowrap}
 body.tamirpc-rtl :is(.news-card__footer,.hero-side-card__footer)>.post-meta>*{line-height:1.7}
 body.tamirpc-rtl :is(.news-card__footer,.hero-side-card__footer)>.post-meta>[aria-hidden="true"]{display:none}
 body.tamirpc-rtl :is(.news-card__footer,.hero-side-card__footer)>.post-views{grid-column:2;grid-row:1;justify-self:center}
 body.tamirpc-rtl .news-card__footer>.news-card__more,body.tamirpc-rtl .hero-side-card__footer>.hero-side-card__more{grid-column:3;grid-row:1;justify-self:end}
}
@media(prefers-reduced-motion:reduce){.tamirpc-toc__arrow{transition:none}}

/* Footer latest posts: full linked titles wrap naturally in their existing column. */
.site-footer .footer-latest-posts{min-width:0}
.site-footer .footer-latest-posts li{margin-bottom:10px}
.site-footer .footer-latest-posts li:last-child{margin-bottom:0}
.site-footer .footer-latest-posts a{display:block;line-height:1.9;overflow-wrap:anywhere}
.site-footer .footer-latest-empty{font-size:12px;line-height:1.9;color:#b9bed3}

/* Article prose only: table cell direction and caption alignment remain independent. */
body.tamirpc-rtl .single-article .article-content{text-align:justify}
body.tamirpc-rtl .single-article .article-content :is(p,li,dd,blockquote):not(table *):not(figure *):not(.wp-caption *):not(pre *):not(code *){text-align:justify;text-align-last:start}
body.tamirpc-rtl .single-article .article-content :is(h2,h3,h4,h5,h6,summary,pre){text-align:start}

/* Center author identity on mobile; justify prose without touching table cells. */
@media(max-width:620px){
 .tamirpc-author-profile{justify-items:center;text-align:center}
 .tamirpc-author-profile>.tamirpc-author-avatar{display:flex;justify-content:center;width:100%}
 .tamirpc-author-profile>.tamirpc-author-avatar img{display:block;margin-inline:auto}
 .tamirpc-author-profile>div:not(.tamirpc-author-avatar){width:100%;min-width:0;box-sizing:border-box;margin-inline:auto}
 .tamirpc-author-profile :is(h1,h2){text-align:center}
 .tamirpc-author-profile .tamirpc-author-bio{text-align:justify}
 .tamirpc-author-profile :is(p,li,dd,blockquote):not(table *):not(figure *):not(.wp-caption *){text-align:justify;text-align-last:start}
}

/* Mobile editor pick: use the remaining flex space above the footer, never below it. */
@media(max-width:620px){
 .home-shell .editorial-panel--editor .editor-pick{padding-bottom:0}
 .home-shell .editorial-panel--editor .editor-pick>.news-card__footer{position:static;flex:0 0 auto;margin: auto 0 0;width:100%;min-height:48px;padding:15px 0 0}
}

/* Editor pick: date and reading time share one baseline on mobile. */
@media(max-width:620px){
 body.tamirpc-rtl .home-shell .editorial-panel--editor .editor-pick>.news-card__footer{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);align-items:center;column-gap:6px}
 body.tamirpc-rtl .home-shell .editorial-panel--editor .editor-pick>.news-card__footer>.post-meta{display:inline-flex;flex-direction:row;flex-wrap:nowrap;align-items:center;justify-content:flex-start;gap:5px;width:auto;font-size:10px;line-height:22px;min-height:22px;white-space:nowrap}
 body.tamirpc-rtl .home-shell .editorial-panel--editor .editor-pick>.news-card__footer>.post-meta>*{line-height:inherit;margin:0;white-space:nowrap}
 body.tamirpc-rtl .home-shell .editorial-panel--editor .editor-pick>.news-card__footer>.post-meta>[aria-hidden="true"]{display:inline}
}

@media(max-width:380px){body.tamirpc-rtl .home-shell .editorial-panel--editor .editor-pick>.news-card__footer>.post-meta{font-size:9px;gap:3px}}

/* v1.3.52: justify reading copy throughout the site, including author biographies. */
body.tamirpc-rtl :is(main,.site-footer,.newsletter-wrap) :is(p,li,dd,blockquote):not(:where(table *,pre *,code *,figure *,nav *,.wp-caption *,.post-meta *,.news-card__footer *,.hero-side-card__footer *,.tamirpc-post-tags *,.tpc-brand-tags *,.search-form *,.tamirpc-newsletter-form *)){text-align:justify!important;text-align-last:start}
body.tamirpc-rtl :is(.tamirpc-author-bio,.archive-description,.comment-content){text-align:justify!important;text-align-last:start}
body.tamirpc-rtl .tamirpc-author-bio :is(p,li,dd,blockquote):not(:where(table *,pre *,code *,figure *)){text-align:justify!important;text-align-last:start}
.is-style-tamirpc-justify{text-align:justify;text-align-last:start}

/* v1.3.53: author website action at the lower left, within existing card padding. */
.tamirpc-author-profile .tamirpc-author-actions{display:flex;justify-content:flex-end;width:100%;margin-top:20px;padding-top:4px;box-sizing:border-box}
.tamirpc-author-profile a.tamirpc-author-website.wp-element-button{display:inline-flex;align-items:center;justify-content:center;min-height:44px;max-width:100%;padding:10px 20px;border:0;border-radius:10px;background:#ff5f00;color:#fff!important;font:inherit;font-size:14px;font-weight:700;line-height:1.8;text-align:center;text-decoration:none!important;box-sizing:border-box;transition:background .16s ease}
.tamirpc-author-profile a.tamirpc-author-website.wp-element-button:hover{background:#0875e1;color:#fff!important}
.tamirpc-author-profile a.tamirpc-author-website.wp-element-button:focus-visible{outline:2px solid #0875e1;outline-offset:4px}
@media(prefers-reduced-motion:reduce){.tamirpc-author-profile a.tamirpc-author-website.wp-element-button{transition:none}}
/* Featured images on standard pages share the article hero styling. */
.standard-page>.page-featured-image{margin-block:24px 32px}

/* v1.3.57: center the main title of every standard page on all screen sizes. */
body.tamirpc-rtl .standard-page>header h1{width:100%;max-width:none;text-align:center}

/* v1.3.59: keep articles readable after the empty TOC is hidden. */
.single-article .article-layout.article-layout--no-toc,
.single-article .article-layout:has(>.article-aside[hidden]){grid-template-columns:minmax(0,760px);justify-content:center}
.single-article .article-layout.article-layout--no-toc>.article-content,
.single-article .article-layout:has(>.article-aside[hidden])>.article-content{grid-column:1/-1;width:100%;min-width:0}

/* v1.3.60: related posts use four real columns, with readable smaller-screen layouts. */
.single-article .related>.card-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:16px;align-items:stretch}
.single-article .related>.card-grid>.news-card{min-width:0;display:flex;flex-direction:column}
.single-article .related .news-card__image{aspect-ratio:16/9;flex-shrink:0}
.single-article .related .news-card__body{flex:1}
@media(max-width:1080px){.single-article .related>.card-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:620px){.single-article .related>.card-grid{grid-template-columns:minmax(0,1fr)}}

/* Keep both the eye and count white against the orange web content panel. */
.editorial-panel--web .post-views,.editorial-panel--web .post-views__number{color:#fff}
.editorial-panel--web .post-views svg{color:inherit;stroke:currentColor}

/* Keep every hero sidebar footer inside its card, regardless of title length. */
body.tamirpc-rtl .hero-side{min-height:0}
body.tamirpc-rtl .hero-side-card{min-height:145px}
body.tamirpc-rtl .hero-side-card__copy{min-height:0;padding:10px 12px;gap:6px;display:flex;flex-direction:column}
body.tamirpc-rtl .hero-side-card__copy>.chip{align-self:flex-start;flex-shrink:0}
body.tamirpc-rtl .hero-side-card__copy>h2{margin:0;flex-shrink:0}
body.tamirpc-rtl .hero-side-card__footer{position:static;inset:auto;margin-top:auto;width:100%;min-height:30px;flex-shrink:0;display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:6px;align-items:center}
body.tamirpc-rtl .hero-side-card__footer>.post-meta{grid-column:1;grid-row:1;display:flex;flex-direction:column;align-items:flex-start;gap:0;font-size:9px;line-height:1.6;white-space:nowrap}
body.tamirpc-rtl .hero-side-card__footer>.post-meta>[aria-hidden="true"]{display:none}
body.tamirpc-rtl .hero-side-card__footer>.post-views{grid-column:2;grid-row:1}
body.tamirpc-rtl .hero-side-card__footer>.hero-side-card__more{grid-column:3;grid-row:1}

/* Compact hero metadata stays on one horizontal baseline at every viewport. */
body.tamirpc-rtl .hero-side-card__footer{grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:5px}
body.tamirpc-rtl .hero-side-card__footer>.post-meta{flex-direction:row;align-items:center;gap:3px;font-size:8px;white-space:nowrap}
body.tamirpc-rtl .hero-side-card__footer>.post-meta>[aria-hidden="true"]{display:inline}
body.tamirpc-rtl .hero-side-card__footer>.post-meta>span[title="مدت مطالعه"]{display:none}
body.tamirpc-rtl .hero-side-card__footer>.post-meta>[aria-hidden="true"]{display:none}
body.tamirpc-rtl .hero-side-card__footer>.post-views{grid-row:1;grid-column:2;font-size:9px;white-space:nowrap}
body.tamirpc-rtl .hero-side-card__footer>.hero-side-card__more{grid-row:1;grid-column:3;font-size:9px;white-space:nowrap}
