/* Text / legal pages -------------------------------------------------------
   Editorial / Medical Minimal typography
   Optimized for long-form Persian reading.
------------------------------------------------------------------------- */
.text-page{
  --tp-text:#514d46;
  --tp-text-soft:#6f6a62;
  --tp-heading:#24231f;
  --tp-paper:#fffdf9;
  --tp-paper-soft:#fffcf7;
  --tp-gold:#b98f4f;
  --tp-gold-soft:rgba(185,143,79,.12);
  --tp-line:rgba(45,42,36,.09);
  background:var(--paper);
  color:var(--tp-text);
}

/* Compact, calm document hero */
.text-page__hero{
  position:relative;
  overflow:hidden;
  padding:48px 0 42px;
  border-bottom:1px solid var(--tp-line);
  background:
    radial-gradient(circle at 82% 18%,rgba(185,146,80,.085),transparent 31%),
    linear-gradient(180deg,rgba(255,253,249,.42),rgba(244,240,232,.10));
}
.text-page__hero:after{
  content:"";
  position:absolute;
  inset:auto 0 0;
  height:1px;
  background:linear-gradient(90deg,transparent,rgba(185,146,80,.34),transparent);
}
.text-page__hero-inner{max-width:1120px}
.text-page__breadcrumb{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-bottom:13px;
  color:#89837a;
  font-size:11.5px;
  font-weight:400;
}
.text-page__breadcrumb a{transition:color .2s ease}
.text-page__breadcrumb a:hover{color:var(--tp-gold)}
.text-page__breadcrumb span[aria-hidden="true"]{color:rgba(17,18,15,.23)}
.text-page__hero h1{
  max-width:900px;
  margin:0;
  color:var(--tp-heading);
  font-size:clamp(36px,4.15vw,52px);
  line-height:1.45;
  letter-spacing:-.035em;
  font-weight:600;
}

.text-page__section{padding:52px 0 88px}
.text-page__container{max-width:1160px}
.text-page__layout{
  display:grid;
  direction:ltr;
  grid-template-columns:minmax(0,1fr) 276px;
  align-items:start;
  gap:34px;
}
.text-page__layout--no-toc{grid-template-columns:minmax(0,900px);justify-content:center}
.text-page__article,
.text-page__toc-desktop{direction:rtl}
.text-page__article{
  min-width:0;
  border:1px solid var(--tp-line);
  border-radius:25px;
  background:var(--tp-paper-soft);
  box-shadow:0 14px 42px rgba(22,24,20,.035);
}

/* Main reading column: deliberately narrow and light */
.text-page__content{
  width:min(100%,760px);
  margin-inline:auto;
  padding:52px 42px 64px;
  color:var(--tp-text);
  font-size:16px;
  font-weight:400;
  line-height:2.08;
  text-rendering:optimizeLegibility;
}
.text-page__content > :first-child{margin-top:0!important}
.text-page__content > :last-child{margin-bottom:0!important}
.text-page__content p{
  margin:0 0 24px;
  color:var(--tp-text);
  font-weight:400;
}
.text-page__content > p:first-of-type{
  color:#403d37;
  font-size:16.5px;
  font-weight:500;
  line-height:2.08;
}

.text-page__content h2,
.text-page__content h3{
  color:var(--tp-heading);
  letter-spacing:-.018em;
  scroll-margin-top:145px;
}
.text-page__content h2{
  position:relative;
  margin:58px 0 21px;
  padding-top:18px;
  font-size:clamp(24px,2vw,28px);
  font-weight:600;
  line-height:1.65;
}
.text-page__content h2:before{
  content:"";
  position:absolute;
  right:0;
  top:0;
  width:38px;
  height:2px;
  border-radius:999px;
  background:linear-gradient(90deg,rgba(185,143,79,.20),var(--tp-gold));
}
.text-page__content h3{
  margin:38px 0 15px;
  font-size:clamp(19px,1.55vw,21px);
  font-weight:600;
  line-height:1.75;
}
.text-page__content h4,
.text-page__content h5,
.text-page__content h6{
  margin:31px 0 13px;
  color:var(--tp-heading);
  line-height:1.8;
  font-weight:600;
}

/* Keep editor-applied bold from making whole legal pages visually heavy. */
.text-page__content strong,
.text-page__content b{
  color:#35322d;
  font-weight:500;
}
.text-page__content h2 strong,
.text-page__content h2 b,
.text-page__content h3 strong,
.text-page__content h3 b,
.text-page__content h4 strong,
.text-page__content h4 b{
  color:inherit;
  font-weight:inherit;
}
.text-page__content a:not(.btn){
  color:#88652f;
  font-weight:500;
  text-decoration:underline;
  text-decoration-thickness:1px;
  text-decoration-color:rgba(185,146,80,.34);
  text-underline-offset:5px;
  transition:color .2s ease,text-decoration-color .2s ease;
}
.text-page__content a:not(.btn):hover{color:var(--tp-heading);text-decoration-color:var(--tp-gold)}
.text-page__content ul,
.text-page__content ol{
  margin:17px 0 29px;
  padding:0 26px 0 0;
  color:var(--tp-text);
}
.text-page__content li{
  margin:8px 0;
  padding-right:3px;
  font-weight:400;
}
.text-page__content li::marker{color:#b38b50;font-weight:500}
.text-page__content blockquote{
  margin:34px 0;
  padding:21px 23px 21px 27px;
  border:0;
  border-right:2px solid rgba(185,143,79,.72);
  border-radius:14px;
  background:rgba(185,146,80,.055);
  color:#555048;
}
.text-page__content blockquote p{color:inherit}
.text-page__content blockquote p:last-child{margin-bottom:0}
.text-page__content hr{
  height:1px;
  margin:44px 0;
  border:0;
  background:var(--tp-line);
}
.text-page__content img{
  height:auto;
  margin:34px auto;
  border-radius:18px;
}
.text-page__content figure{max-width:100%;margin:34px 0}
.text-page__content figcaption{margin-top:10px;color:#858078;font-size:12.5px;text-align:center}
.text-page__content table{
  display:block;
  width:100%;
  max-width:100%;
  margin:30px 0;
  overflow-x:auto;
  border-collapse:collapse;
  border:1px solid var(--tp-line);
  border-radius:14px;
}
.text-page__content th,
.text-page__content td{
  min-width:140px;
  padding:13px 15px;
  border-bottom:1px solid var(--tp-line);
  color:var(--tp-text);
  text-align:right;
  font-weight:400;
}
.text-page__content th{background:rgba(185,146,80,.055);color:var(--tp-heading);font-weight:500}

/* Table of contents: quiet by default, clear only where active */
.text-page__toc-card{
  position:sticky;
  top:116px;
  max-height:calc(100vh - 146px);
  overflow:auto;
  padding:20px 18px 17px;
  border:1px solid var(--tp-line);
  border-radius:20px;
  background:rgba(255,253,249,.70);
  box-shadow:0 10px 34px rgba(22,24,20,.03);
  backdrop-filter:blur(12px);
  scrollbar-width:thin;
  scrollbar-color:rgba(185,146,80,.36) transparent;
}
body.admin-bar .text-page__toc-card{top:148px;max-height:calc(100vh - 178px)}
.text-page__toc-head{
  margin-bottom:14px;
  padding-bottom:13px;
  border-bottom:1px solid var(--tp-line);
}
.text-page__toc-kicker{
  display:block;
  margin-bottom:4px;
  color:#a17b42;
  font-size:9.5px;
  font-weight:500;
  letter-spacing:.02em;
}
.text-page__toc-head strong{color:var(--tp-heading);font-size:16px;font-weight:600}
.text-page__toc-nav ol{list-style:none;margin:0;padding:0}
.text-page__toc-item{margin:1px 0}
.text-page__toc-item a{
  position:relative;
  display:block;
  padding:8px 11px 8px 9px;
  border-radius:9px;
  color:#77726a;
  font-size:12px;
  font-weight:400;
  line-height:1.8;
  transition:background .22s ease,color .22s ease,transform .22s ease;
}
.text-page__toc-item a:before{
  content:"";
  position:absolute;
  right:0;
  top:50%;
  width:2px;
  height:0;
  border-radius:999px;
  background:var(--tp-gold);
  transform:translateY(-50%);
  transition:height .22s ease;
}
.text-page__toc-item--level-3 a{padding-right:23px;font-size:11.4px;color:#918c84}
.text-page__toc-item a:hover{background:rgba(185,146,80,.045);color:#4d4942}
.text-page__toc-item a.is-active{
  background:rgba(185,146,80,.075);
  color:#4b4030;
  font-weight:500;
}
.text-page__toc-item a.is-active:before{height:21px}

.text-page__toc-mobile{display:none;margin-bottom:18px;direction:rtl}
.text-page__toc-mobile details{
  border:1px solid var(--tp-line);
  border-radius:17px;
  background:rgba(255,253,249,.76);
  overflow:hidden;
}
.text-page__toc-mobile summary{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:15px;
  padding:16px 17px;
  list-style:none;
  color:var(--tp-heading);
  font-weight:500;
  cursor:pointer;
}
.text-page__toc-mobile summary::-webkit-details-marker{display:none}
.text-page__toc-mobile summary svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;transition:transform .25s ease}
.text-page__toc-mobile details[open] summary svg{transform:rotate(180deg)}
.text-page__toc-mobile-body{padding:0 11px 11px;border-top:1px solid var(--tp-line)}
.text-page__toc-mobile .text-page__toc-nav{padding-top:9px}
.text-page__toc-mobile .text-page__toc-item a{padding-block:9px;font-size:12.5px}

@media (max-width:1020px){
  .text-page__layout{grid-template-columns:minmax(0,1fr)}
  .text-page__toc-desktop{display:none}
  .text-page__toc-mobile{display:block}
  .text-page__container{max-width:900px}
}
@media (max-width:767px){
  .text-page__hero{padding:35px 0 32px}
  .text-page__hero-inner{width:min(100% - 34px,1120px)}
  .text-page__hero h1{font-size:clamp(30px,8.5vw,40px);line-height:1.5;letter-spacing:-.025em}
  .text-page__section{padding:26px 0 58px}
  .text-page__container{width:min(100% - 24px,900px)}
  .text-page__article{border-radius:19px}
  .text-page__content{padding:30px 22px 39px;font-size:15.2px;line-height:2.08}
  .text-page__content > p:first-of-type{font-size:15.5px}
  .text-page__content p{margin-bottom:20px}
  .text-page__content h2{margin-top:43px;padding-top:16px;font-size:23px;scroll-margin-top:110px}
  .text-page__content h2:before{width:32px}
  .text-page__content h3{margin-top:30px;font-size:19px;scroll-margin-top:110px}
  .text-page__content ul,.text-page__content ol{padding-right:22px}
  .text-page__content blockquote{margin:25px 0;padding:17px 18px 17px 19px}
}
@media (max-width:360px){
  .text-page__content{padding-inline:17px}
}
@media (prefers-reduced-motion:reduce){
  .text-page__toc-item a,.text-page__toc-mobile summary svg{transition:none}
}
