/* =========================================================
   نقطه آرامش — استایل مشترک سایت
   راست‌به‌چپ، فونت وزیرمتن، پالت کاج/خزه/کتان/اُخرا
   ========================================================= */

@import url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@300;400;500;600;700;800&display=swap');

:root {
  --ink:      #16241F;
  --pine:     #1E3630;
  --moss:     #3C5A50;
  --sage:     #8FA69B;
  --paper:    #EAEDE7;
  --paper-2:  #DFE4DC;
  --linen:    #D6CCBC;
  --ochre:    #B5813A;
  --text:     #1B2621;
  --muted:    #5C6B64;
  --rule:     #C4CDC3;

  --serif: 'Vazirmatn', Tahoma, sans-serif;
  --sans:  'Vazirmatn', Tahoma, sans-serif;

  --measure: 66ch;
  --pad: clamp(1.25rem, 5vw, 4rem);
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--text);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.85;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: 0;
  margin: 0 0 0.6em;
}

h1 { font-size: clamp(2.1rem, 6vw, 3.6rem); }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.2vw, 1.4rem); font-weight: 600; }

p { margin: 0 0 1.15em; }

a { color: var(--moss); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ochre); }

img { max-width: 100%; height: auto; display: block; }

:focus-visible {
  outline: 2px solid var(--ochre);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap { max-width: 1160px; margin: 0 auto; padding-inline: var(--pad); }
.narrow { max-width: 42rem; }

.skip {
  position: absolute; inset-inline-start: -9999px; top: 0;
  background: var(--ink); color: var(--paper);
  padding: .7rem 1rem; z-index: 99;
}
.skip:focus { inset-inline-start: 0; }

/* ---------------- header ---------------- */

.site-head {
  position: sticky; top: 0; z-index: 40;
  background: rgba(234,237,231,.86);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.site-head.on-dark {
  background: rgba(30,54,48,.82);
  border-bottom-color: rgba(143,166,155,.25);
}
.head-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; min-height: 4.5rem;
}
.brand {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  display: inline-flex; align-items: baseline; gap: .5rem;
}
.brand span { font-family: var(--sans); font-size: .78rem; color: var(--muted); font-weight: 500; }
.on-dark .brand { color: var(--paper); }
.on-dark .brand span { color: var(--sage); }

.nav { display: flex; gap: clamp(1rem, 3vw, 2.25rem); align-items: center; }
.nav a {
  font-size: .95rem; color: var(--muted); text-decoration: none;
  padding: .35rem 0; border-bottom: 1px solid transparent;
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); border-bottom-color: var(--ochre); }
.on-dark .nav a { color: var(--sage); }
.on-dark .nav a:hover, .on-dark .nav a[aria-current="page"] { color: var(--paper); }

/* ---------------- buttons ---------------- */

.btn {
  display: inline-block;
  font-family: var(--sans);
  font-size: .98rem; font-weight: 600;
  padding: .85rem 1.7rem;
  border-radius: 999px;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  text-decoration: none; cursor: pointer;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.btn:hover { background: var(--ochre); border-color: var(--ochre); color: #1B1408; }
.btn-ghost { background: transparent; color: var(--paper); border-color: rgba(214,204,188,.55); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-quiet { background: transparent; color: var(--text); border-color: var(--rule); }
.btn-quiet:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }

/* ---------------- hero ---------------- */

.hero {
  position: relative;
  background: var(--pine);
  color: var(--paper);
  overflow: hidden;
  padding: clamp(5rem, 14vh, 9rem) 0 clamp(4rem, 10vh, 7rem);
}
.hero::after {
  content: '';
  position: absolute; inset: auto 0 0 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(181,129,58,.5), transparent);
}
.breath {
  position: absolute;
  left: 50%; top: 46%;
  width: min(70vw, 620px); aspect-ratio: 1;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, rgba(143,166,155,.22) 0%, rgba(143,166,155,.07) 45%, transparent 70%);
  animation: breathe 13s ease-in-out infinite;
  pointer-events: none;
}
.breath::before {
  content: '';
  position: absolute; inset: 14%;
  border-radius: 50%;
  border: 1px solid rgba(181,129,58,.22);
}
@keyframes breathe {
  0%, 100% { transform: translate(-50%, -50%) scale(.86); opacity: .75; }
  45%      { transform: translate(-50%, -50%) scale(1.06); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .breath { animation: none; }
  html { scroll-behavior: auto; }
}

.hero-inner { position: relative; max-width: 32ch; }
.hero h1 { color: var(--paper); margin-bottom: .45em; }
.hero-lede {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  color: var(--sage);
  max-width: 44ch;
  margin-bottom: 2.2rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .85rem; }

/* ---------------- sections ---------------- */

section { padding-block: clamp(3.5rem, 9vw, 7rem); }
.section-lead { max-width: var(--measure); }

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(2rem, 5vw, 4.5rem);
}
@media (min-width: 900px) {
  .split { grid-template-columns: 0.85fr 1.15fr; align-items: start; }
}

.pull {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.4vw, 1.85rem);
  line-height: 1.55;
  color: var(--pine);
  border-inline-start: 2px solid var(--ochre);
  padding-inline-start: 1.4rem;
  margin: 0;
}
.pull cite { display: block; font-family: var(--sans); font-weight: 400; font-size: .9rem; font-style: normal; color: var(--muted); margin-top: 1rem; }

.prose { max-width: var(--measure); }
.prose p:last-child { margin-bottom: 0; }

/* benefits */

.tinted { background: var(--paper-2); }

.benefits {
  display: grid; gap: 0;
  grid-template-columns: 1fr;
  margin-top: 3rem;
  border-top: 1px solid var(--rule);
}
@media (min-width: 780px) {
  .benefits { grid-template-columns: 1fr 1fr; column-gap: clamp(2rem, 5vw, 4rem); }
}
.benefit {
  padding: 1.7rem 0;
  border-bottom: 1px solid var(--rule);
}
.benefit h3 { margin-bottom: .35em; }
.benefit p { margin: 0; color: var(--muted); font-size: .98rem; }
.benefit .when {
  display: block; margin-top: .8rem;
  font-size: .85rem; color: var(--moss);
  font-weight: 600;
}

/* روند زمانی — واقعاً ترتیبی است، پس شماره‌گذاری شده */

.arc { margin-top: 3rem; display: grid; gap: 0; }
.arc-step {
  display: grid; gap: .35rem 1.6rem;
  grid-template-columns: 3.4rem 1fr;
  padding: 1.6rem 0;
  border-top: 1px solid var(--rule);
}
.arc-step:last-child { border-bottom: 1px solid var(--rule); }
.arc-step .marker {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ochre);
  padding-top: .2rem;
}
.arc-step h3 { margin: 0 0 .3em; }
.arc-step p { margin: 0; color: var(--muted); max-width: 58ch; }

/* منوی خدمات */

.menu { margin-top: 2.5rem; border-top: 1px solid var(--rule); }
.menu-item {
  display: grid; gap: .3rem 2rem;
  grid-template-columns: 1fr;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--rule);
}
@media (min-width: 720px) {
  .menu-item { grid-template-columns: 1fr auto; align-items: baseline; }
}
.menu-item h3 { margin: 0; }
.menu-item p { grid-column: 1; margin: .3rem 0 0; color: var(--muted); max-width: 60ch; }
.menu-meta {
  font-size: .92rem; color: var(--moss); font-weight: 600;
  white-space: nowrap;
}

/* تماس */

.contact { background: var(--pine); color: var(--paper); }
.contact h2 { color: var(--paper); }
.contact a { color: var(--sage); }
.contact a:hover { color: var(--ochre); }
.contact-grid {
  display: grid; gap: 2rem clamp(2rem, 5vw, 4rem);
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  margin-top: 2.5rem;
  border-top: 1px solid rgba(143,166,155,.3);
  padding-top: 2.5rem;
}
.contact-grid h3 { color: var(--paper); font-size: 1.05rem; margin-bottom: .5em; }
.contact-grid p { color: var(--sage); margin: 0; font-size: .98rem; }

/* فوتر */

.site-foot {
  background: var(--ink); color: var(--sage);
  padding-block: 2.5rem;
  font-size: .9rem;
}
.foot-inner { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; }
.site-foot a { color: var(--sage); }

/* ---------------- وبلاگ ---------------- */

.page-head {
  background: var(--pine); color: var(--paper);
  padding-block: clamp(3.5rem, 9vw, 6rem);
}
.page-head h1 { color: var(--paper); margin-bottom: .3em; }
.page-head p { color: var(--sage); max-width: 52ch; margin: 0; }

.post-list { display: grid; gap: 0; border-top: 1px solid var(--rule); margin-top: 0; }
.post-card {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem clamp(1.5rem, 4vw, 3rem);
  padding: 2.2rem 0;
  border-bottom: 1px solid var(--rule);
  align-items: start;
}
@media (min-width: 760px) {
  .post-card { grid-template-columns: 15rem 1fr; }
}
.post-card .thumb {
  aspect-ratio: 4 / 3;
  background: var(--paper-2) center/cover no-repeat;
  border-radius: 3px;
}
.post-card h2 { font-size: clamp(1.35rem, 2.4vw, 1.7rem); margin-bottom: .3em; }
.post-card h2 a { color: var(--text); text-decoration: none; }
.post-card h2 a:hover { color: var(--moss); text-decoration: underline; }
.post-card .excerpt { color: var(--muted); margin: 0 0 .9rem; max-width: 62ch; }
.post-meta { font-size: .85rem; color: var(--moss); margin: 0 0 .6rem; }
.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.tags li {
  font-size: .78rem; color: var(--moss);
  border: 1px solid var(--rule); border-radius: 999px;
  padding: .18rem .7rem;
}

.empty {
  border: 1px dashed var(--rule);
  border-radius: 4px;
  padding: clamp(2rem, 6vw, 3.5rem);
  text-align: center;
  color: var(--muted);
  margin-block: 3rem;
}
.empty h2 { font-size: 1.5rem; color: var(--text); }

/* ---------------- مقاله ---------------- */

.article { padding-block: clamp(3rem, 8vw, 5rem); }
.article-head { max-width: 46rem; margin: 0 auto 2.5rem; }
.article-head h1 { margin-bottom: .35em; }
.article-head .post-meta { font-size: .9rem; }
.article-cover {
  max-width: 62rem; margin: 0 auto 3rem;
  border-radius: 4px; overflow: hidden;
}
.article-body {
  max-width: 40rem; margin: 0 auto;
  font-size: 1.12rem; line-height: 1.95;
}
.article-body h2 { font-size: clamp(1.4rem, 3vw, 1.8rem); margin-top: 2.2em; }
.article-body h3 { margin-top: 1.9em; }
.article-body img { border-radius: 4px; margin-block: .5rem; }
.article-body figure { margin: 2.4rem 0; }
.article-body figcaption { font-size: .88rem; color: var(--muted); margin-top: .7rem; }
.article-body blockquote {
  margin: 2.2rem 0; padding-inline-start: 1.4rem;
  border-inline-start: 2px solid var(--ochre);
  font-family: var(--serif); font-weight: 600; font-size: 1.2rem; line-height: 1.7;
  color: var(--pine);
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body ul, .article-body ol { padding-inline-start: 1.3rem; margin-bottom: 1.3em; }
.article-body li { margin-bottom: .5em; }
.article-body hr { border: 0; border-top: 1px solid var(--rule); margin-block: 2.5rem; }

.article-foot {
  max-width: 40rem; margin: 3.5rem auto 0;
  padding-top: 2rem; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center;
}

.loading, .notfound { max-width: 40rem; margin: 0 auto; color: var(--muted); }
.notfound h1 { color: var(--text); }

/* ---------------- ادمین ---------------- */

.admin { background: var(--paper); }

.gate {
  min-height: 70vh; display: grid; place-items: center; padding: 2rem var(--pad);
}
.gate-card {
  width: 100%; max-width: 24rem;
  background: #fff; border: 1px solid var(--rule); border-radius: 6px;
  padding: 2.2rem;
}
.gate-card h1 { font-size: 1.7rem; }
.gate-card p { color: var(--muted); font-size: .95rem; }

.field { margin-bottom: 1.3rem; }
.field label {
  display: block; font-size: .88rem; font-weight: 600;
  margin-bottom: .4rem; color: var(--text);
}
.field .hint { font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=password], input[type=url], input[type=date], textarea, select {
  width: 100%;
  font-family: var(--sans); font-size: 1rem;
  padding: .7rem .85rem;
  border: 1px solid var(--rule); border-radius: 4px;
  background: #fff; color: var(--text);
}
textarea { resize: vertical; min-height: 5.5rem; line-height: 1.7; }
input:focus, textarea:focus, select:focus { border-color: var(--moss); }

.editor-layout { display: grid; gap: 2rem; grid-template-columns: 1fr; }
@media (min-width: 1040px) {
  .editor-layout { grid-template-columns: minmax(0,1fr) 20rem; align-items: start; }
}

.panel {
  background: #fff; border: 1px solid var(--rule); border-radius: 6px;
  padding: 1.5rem;
}
.panel + .panel { margin-top: 1.5rem; }
.panel h2 { font-size: 1.15rem; font-family: var(--sans); font-weight: 700; margin-bottom: 1rem; }
.panel p.note { font-size: .88rem; color: var(--muted); }

.toolbar {
  display: flex; flex-wrap: wrap; gap: .3rem;
  padding: .55rem; border: 1px solid var(--rule); border-bottom: 0;
  border-radius: 4px 4px 0 0; background: var(--paper-2);
  position: sticky; top: 4.5rem; z-index: 20;
}
.toolbar button {
  font-family: var(--sans); font-size: .85rem; font-weight: 600;
  background: #fff; color: var(--text);
  border: 1px solid var(--rule); border-radius: 3px;
  padding: .35rem .6rem; cursor: pointer; line-height: 1.5;
}
.toolbar button:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.toolbar .sep { width: 1px; background: var(--rule); margin-inline: .3rem; }

#editor {
  border: 1px solid var(--rule); border-radius: 0 0 4px 4px;
  background: #fff;
  padding: 1.6rem;
  min-height: 26rem;
  font-size: 1.08rem; line-height: 1.95;
  overflow-wrap: break-word;
  direction: rtl;
  text-align: right;
}
#editor:focus { outline: none; border-color: var(--moss); }
#editor:empty::before {
  content: attr(data-placeholder);
  color: var(--muted);
}
#editor h2 { font-size: 1.5rem; margin-top: 1.4em; }
#editor h3 { font-size: 1.2rem; margin-top: 1.3em; }
#editor blockquote {
  margin: 1.4rem 0; padding-inline-start: 1.1rem;
  border-inline-start: 2px solid var(--ochre); color: var(--pine); font-family: var(--serif); font-weight: 600; font-size: 1.15rem;
}
#editor figure { margin: 1.6rem 0; }
#editor figcaption { font-size: .85rem; color: var(--muted); margin-top: .5rem; }
#editor img { border-radius: 4px; }

.row { display: flex; flex-wrap: wrap; gap: .7rem; }
.row .btn { flex: 0 0 auto; }

.post-admin-list { list-style: none; margin: 0; padding: 0; }
.post-admin-list li {
  padding: .8rem 0; border-bottom: 1px solid var(--rule);
  display: flex; gap: .6rem; justify-content: space-between; align-items: baseline;
}
.post-admin-list li:last-child { border-bottom: 0; }
.post-admin-list .t { font-weight: 600; font-size: .95rem; }
.post-admin-list .d { font-size: .8rem; color: var(--muted); }
.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-family: var(--sans); font-size: .85rem; color: var(--moss);
  text-decoration: underline; text-underline-offset: 3px;
}
.linkbtn:hover { color: var(--ochre); }
.linkbtn.danger { color: #92402F; }

.status {
  margin-top: 1rem; padding: .85rem 1rem; border-radius: 4px;
  font-size: .92rem; display: none;
}
.status.show { display: block; }
.status.ok { background: #E2EBE2; color: #24422F; border: 1px solid #B9CFBC; }
.status.warn { background: #F5E9D7; color: #6B4A16; border: 1px solid #E0C89A; }

.steps { list-style: none; margin: 0; padding: 0; font-size: .92rem; color: var(--muted); counter-reset: s; }
.steps li { counter-increment: s; padding-inline-start: 1.9rem; position: relative; margin-bottom: .8rem; }
.steps li::before {
  content: counter(s);
  position: absolute; inset-inline-start: 0; top: 0;
  width: 1.35rem; height: 1.35rem; border-radius: 50%;
  background: var(--pine); color: var(--paper);
  font-size: .75rem; font-weight: 700;
  display: grid; place-items: center;
}
.steps code { background: var(--paper-2); padding: .1rem .35rem; border-radius: 3px; font-size: .88em; direction: ltr; display: inline-block; }

.img-tool {
  display: none; gap: .6rem; flex-wrap: wrap;
  padding: 1rem; margin-top: -1px;
  border: 1px solid var(--moss); border-radius: 4px; background: #fff;
  margin-bottom: 1rem;
}
.img-tool.open { display: grid; }
@media (min-width: 720px) { .img-tool.open { grid-template-columns: 2fr 1fr auto; align-items: end; } }
.img-tool .field { margin: 0; }

/* اعداد و آدرس‌های لاتین همیشه چپ‌به‌راست بمانند */
code, .ltr { direction: ltr; unicode-bidi: isolate; }
