/* تحصیل یار — mobile-first, performance-minded */
@font-face {
  font-family: "Vazirmatn";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("fonts/Vazirmatn-Regular.woff2") format("woff2");
}

:root {
  --bg: #f3f7f9;
  --surface: #ffffff;
  --ink: #0f2a37;
  --muted: #5b7380;
  --line: #d7e3ea;
  --brand: #0b4f6c;
  --brand-2: #14728f;
  --accent: #c4a35a;
  --accent-ink: #3d2f12;
  --radius: 14px;
  --shadow: 0 10px 30px rgba(11, 79, 108, 0.08);
  --max: 1120px;
  --font: "Vazirmatn", Tahoma, sans-serif;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  line-height: 1.85;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand-2); text-decoration: none; }
a:hover { color: var(--brand); }
.skip-link {
  position: absolute; inset-inline-start: -999px; top: 0;
  background: #000; color: #fff; padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { inset-inline-start: 0; }
.container {
  width: min(var(--max), calc(100% - 1.5rem));
  margin-inline: auto;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; min-height: 4rem;
}
.brand {
  display: flex; align-items: center; gap: .7rem; color: var(--ink);
}
.brand img { width: 42px; height: 42px; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 1.1rem; }
.brand-tag { font-size: .78rem; color: var(--muted); }
.nav-toggle {
  border: 1px solid var(--line); background: #fff; border-radius: 10px;
  padding: .45rem .7rem; font: inherit; cursor: pointer;
}
.site-nav { display: none; }
.site-nav.is-open { display: flex; }
.site-nav {
  flex-direction: column; gap: .35rem;
  position: absolute; inset-inline: 0; top: 100%;
  background: #fff; border-bottom: 1px solid var(--line);
  padding: .75rem 1rem 1rem;
}
.site-nav a {
  color: var(--ink); font-weight: 500; padding: .45rem .2rem;
}
.site-nav .nav-link {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
}
.site-nav .nav-ico {
  flex: 0 0 auto;
  opacity: .85;
  color: var(--brand);
}
.site-nav .nav-link:hover .nav-ico { opacity: 1; }
.header-cta {
  display: none;
  background: var(--brand); color: #fff !important;
  border-radius: 999px; padding: .55rem 1rem; font-weight: 600; font-size: .92rem;
}
.header-cta:hover { background: var(--brand-2); color: #fff !important; }

@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav {
    display: flex !important; position: static; flex-direction: row;
    gap: 1.1rem; border: 0; padding: 0; background: transparent;
  }
  .header-cta { display: inline-flex; }
}

/* Hero */
.hero {
  position: relative; isolation: isolate;
  min-height: clamp(22rem, 72vw, 32rem);
  display: grid; align-items: end;
  color: #fff; overflow: hidden;
}
.hero-media {
  position: absolute; inset: 0; z-index: -2;
}
.hero-media img {
  width: 100%; height: 100%; object-fit: cover;
}
.hero-shade {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(7,34,48,.25) 0%, rgba(7,34,48,.82) 78%);
}
.hero-content {
  width: min(var(--max), calc(100% - 1.5rem));
  margin: 0 auto 2rem;
  padding-top: 4rem;
}
.hero h1 {
  margin: 0 0 .75rem;
  font-size: clamp(1.7rem, 5vw, 2.75rem);
  line-height: 1.35; max-width: 16ch;
}
.hero p {
  margin: 0 0 1.25rem; max-width: 38ch;
  color: rgba(255,255,255,.9); font-size: 1.02rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 999px; padding: .7rem 1.2rem; font-weight: 600;
  border: 0; cursor: pointer; font: inherit;
}
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { filter: brightness(1.05); color: var(--accent-ink); }
.btn-ghost {
  background: rgba(255,255,255,.12); color: #fff;
  border: 1px solid rgba(255,255,255,.35);
}
.btn-ghost:hover { background: rgba(255,255,255,.2); color: #fff; }

/* Sections */
.section { padding: 2.5rem 0; }
.section-head {
  display: flex; align-items: end; justify-content: space-between;
  gap: 1rem; margin-bottom: 1.25rem;
}
.section-head h2 { margin: 0; font-size: 1.35rem; }
.section-head p { margin: .2rem 0 0; color: var(--muted); font-size: .95rem; }

.cat-row {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem;
}
.cat-chip {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 12px; padding: .85rem 1rem; color: var(--ink);
  font-weight: 600; transition: border-color .2s, transform .2s;
}
.cat-chip:hover { border-color: var(--brand-2); transform: translateY(-1px); color: var(--brand); }
@media (min-width: 700px) {
  .cat-row { grid-template-columns: repeat(3, 1fr); }
}
@media (min-width: 1000px) {
  .cat-row { grid-template-columns: repeat(6, 1fr); }
}

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

.card-grid { display: grid; gap: 1rem; }
@media (min-width: 700px) {
  .card-grid { grid-template-columns: repeat(2, 1fr); }
}
.post-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column;
  transition: transform .2s ease;
}
.post-card:hover { transform: translateY(-3px); }
.post-card .thumb {
  aspect-ratio: 16/9; background: #d9e6ee; overflow: hidden;
}
.post-card .thumb img {
  width: 100%; height: 100%; object-fit: cover;
}
.post-card .body { padding: 1rem 1.1rem 1.2rem; flex: 1; display: flex; flex-direction: column; }
.post-card h3 { margin: 0 0 .45rem; font-size: 1.05rem; line-height: 1.5; }
.post-card h3 a { color: var(--ink); }
.post-card .meta { color: var(--muted); font-size: .86rem; margin-bottom: .55rem; }
.post-card .excerpt {
  color: var(--muted); font-size: .94rem; margin: 0 0 .9rem;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card .more { margin-top: auto; font-weight: 600; color: var(--brand-2); }

.side-panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.1rem;
  box-shadow: var(--shadow);
}
.side-panel + .side-panel { margin-top: 1rem; }
.side-panel h3 {
  margin: 0 0 .8rem; font-size: 1rem;
  padding-bottom: .55rem; border-bottom: 1px solid var(--line);
}
.side-panel ul { margin: 0; padding: 0 1rem 0 0; }
.side-panel li { margin-bottom: .4rem; }
.consult-box {
  background: linear-gradient(160deg, #0b4f6c, #14728f);
  color: #fff; border: 0;
}
.consult-box h3 { border-color: rgba(255,255,255,.2); color: #fff; }
.consult-box p { margin: 0 0 1rem; color: rgba(255,255,255,.9); font-size: .95rem; }
.consult-box .btn { width: 100%; margin-top: .45rem; }
.consult-box a.btn-primary { color: var(--accent-ink) !important; }
.consult-box a.btn-ghost { color: #fff !important; }

/* Article */
.article-hero { margin-bottom: 1rem; border-radius: var(--radius); overflow: hidden; }
.article-hero img { width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.page-title { margin: 0 0 .5rem; font-size: clamp(1.5rem, 3.5vw, 2.1rem); line-height: 1.4; }
.entry-body { color: #243b47; }
.entry-body h2 { margin: 1.6rem 0 .7rem; font-size: 1.25rem; color: var(--ink); }
.entry-body ul { padding-inline-start: 1.2rem; }
.entry-body p { margin: 0 0 1rem; }
.crumbs { color: var(--muted); font-size: .9rem; margin-bottom: .8rem; }
.crumbs a { color: var(--muted); }

.site-footer {
  margin-top: 2rem; padding: 2rem 0 2.4rem;
  border-top: 1px solid var(--line); color: var(--muted); font-size: .92rem;
}
.footer-grid {
  display: grid; gap: 1.2rem;
}
@media (min-width: 800px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.site-footer h4 { margin: 0 0 .5rem; color: var(--ink); font-size: 1rem; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .3rem; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--brand); }

.empty { color: var(--muted); }
.prose-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow);
}

.faq-list { display: grid; gap: .65rem; }
.faq-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: .85rem 1rem;
}
.faq-item summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item[open] summary { margin-bottom: .55rem; color: var(--brand-2); }
.faq-item p { margin: 0; color: var(--muted); line-height: 1.7; }

.hero-content { animation: rise .7s ease both; }
.hero-media img { animation: zoomSoft 12s ease-out both; }
.post-card { animation: rise .55s ease both; }
.post-card:nth-child(2) { animation-delay: .06s; }
.post-card:nth-child(3) { animation-delay: .12s; }
.post-card:nth-child(4) { animation-delay: .18s; }
.post-card:nth-child(5) { animation-delay: .24s; }
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}
@keyframes zoomSoft {
  from { transform: scale(1.06); }
  to { transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero-content, .hero-media img, .post-card { animation: none; }
}
