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

:root {
  --navy: #08111f;
  --navy-soft: #101c31;
  --navy-lift: #17243a;
  --gold: #c9a24a;
  --gold-light: #d8c48a;
  --cream: #f8f5ef;
  --white: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e7d8b5;
  --radius: 22px;
  --shadow: 0 22px 50px rgba(8, 17, 31, 0.09);
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--cream);
  font-family: "Vazirmatn", "Inter", sans-serif;
  line-height: 1.8;
  text-rendering: optimizeLegibility;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
.shell { width: min(1180px, calc(100% - 40px)); margin-inline: auto; }
.skip-link {
  position: fixed; inset-block-start: 10px; inset-inline-start: 10px; z-index: 100;
  transform: translateY(-160%); padding: 9px 16px; border-radius: 10px;
  background: var(--gold); color: var(--navy); font-weight: 700;
}
.skip-link:focus { transform: translateY(0); }

.site-header {
  position: sticky; top: 0; z-index: 40; color: var(--white);
  background: rgba(8, 17, 31, 0.96); border-bottom: 1px solid rgba(255,255,255,.1);
  backdrop-filter: blur(18px);
}
.site-header__inner { height: 80px; display: flex; align-items: center; gap: 34px; }
.brand { display: inline-flex; align-items: center; gap: 12px; margin-inline-end: auto; }
.brand__logo { width: 48px; height: 48px; object-fit: contain; padding: 4px; border-radius: 13px; background: #fff; border: 1px solid rgba(201,162,74,.5); }
.brand__copy { display: grid; line-height: 1.25; }
.brand__copy strong { font-size: 20px; font-weight: 800; }
.brand__copy small { margin-top: 4px; color: var(--gold-light); font: 500 12px/1.2 "Inter", sans-serif; }
.site-nav { display: flex; align-items: center; gap: 28px; }
.site-nav a { color: rgba(255,255,255,.74); font-weight: 600; font-size: 14px; transition: color .2s ease; }
.site-nav a:hover, .site-nav a:focus-visible, .site-nav a.is-active { color: var(--gold-light); }
.header-action, .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 10px 22px; border-radius: 999px; font-weight: 700;
  transition: transform .2s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.header-action { color: var(--navy); background: var(--gold); font-size: 14px; }
.header-action:hover, .button--gold:hover { background: #d8b85d; transform: translateY(-1px); }
.button svg { width: 18px; height: 18px; }

.blog-hero {
  color: var(--white); overflow: hidden;
  background:
    radial-gradient(circle at 12% 20%, rgba(201,162,74,.13), transparent 34%),
    linear-gradient(135deg, var(--navy), var(--navy-soft));
}
.blog-hero__inner { position: relative; min-height: 330px; display: flex; align-items: center; padding-block: 74px; }
.blog-hero__copy { position: relative; z-index: 1; max-width: 720px; }
.blog-hero h1 { margin: 0 0 18px; font-size: clamp(38px, 6vw, 64px); line-height: 1.25; letter-spacing: -.04em; }
.blog-hero p { margin: 0; max-width: 660px; color: rgba(255,255,255,.72); font-size: clamp(17px, 2vw, 21px); }
.blog-hero__line {
  position: absolute; inset-inline-end: 0; width: 310px; height: 310px; border-radius: 50%;
  border: 1px solid rgba(216,196,138,.2); box-shadow: 0 0 0 44px rgba(216,196,138,.035), 0 0 0 88px rgba(216,196,138,.025);
}

.blog-index { padding: 76px 0 96px; }
.index-heading { display: flex; align-items: end; justify-content: space-between; gap: 28px; margin-bottom: 34px; }
.index-heading h2 { margin: 0; font-size: clamp(27px, 4vw, 38px); line-height: 1.35; }
.index-heading p { margin: 7px 0 0; color: var(--muted); }
.category-filter { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 9px; }
.category-filter a {
  padding: 8px 15px; border: 1px solid rgba(8,17,31,.12); border-radius: 999px;
  background: rgba(255,255,255,.6); color: #475569; font-size: 14px; font-weight: 600;
}
.category-filter a:hover, .category-filter a:focus-visible, .category-filter a.is-selected { border-color: var(--gold); background: var(--navy); color: var(--white); }

.article-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 25px; }
.article-card {
  min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--white); box-shadow: 0 12px 32px rgba(8,17,31,.055);
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.article-card:hover { transform: translateY(-5px); border-color: rgba(201,162,74,.85); box-shadow: var(--shadow); }
.article-card__media { display: block; height: 220px; overflow: hidden; background: var(--navy-soft); }
.article-card__media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .45s ease; }
.article-card:hover .article-card__media > img { transform: scale(1.035); }
.article-card__fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: radial-gradient(circle at center, rgba(201,162,74,.16), transparent 36%), linear-gradient(145deg, var(--navy-soft), var(--navy));
}
.article-card__fallback img { width: 74px; height: 74px; padding: 6px; border-radius: 18px; background: #fff; box-shadow: 0 14px 35px rgba(0,0,0,.26); }
.article-card__body { padding: 24px 24px 26px; }
.article-card__meta { min-height: 29px; display: flex; align-items: center; justify-content: space-between; gap: 15px; color: var(--muted); font-size: 13px; }
.article-card__meta span { color: #8a6c25; font-weight: 700; }
.article-card h3 { margin: 14px 0 10px; font-size: 21px; line-height: 1.55; }
.article-card h3 a:hover, .article-card h3 a:focus-visible { color: #8a6c25; }
.article-card p { min-height: 87px; margin: 0 0 19px; color: #526074; font-size: 15px; line-height: 1.95; }
.article-card__link { display: inline-flex; align-items: center; gap: 6px; color: var(--navy); font-size: 14px; font-weight: 800; }
.article-card__link svg { width: 18px; height: 18px; transition: transform .2s ease; }
.article-card__link:hover svg { transform: translateX(-3px); }

.pagination { display: flex; align-items: center; justify-content: center; gap: 18px; margin-top: 48px; }
.pagination a { min-width: 100px; padding: 9px 17px; text-align: center; border-radius: 999px; background: var(--navy); color: var(--white); font-weight: 700; font-size: 14px; }
.pagination a:hover { background: var(--navy-soft); }
.pagination span { color: var(--muted); font-size: 14px; }
.empty-state { padding: 70px 24px; text-align: center; border: 1px dashed rgba(201,162,74,.7); border-radius: var(--radius); background: #fff; }
.empty-state img { margin: 0 auto 20px; border-radius: 18px; }
.empty-state h2 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 24px; color: var(--muted); }

.article-header { color: var(--white); background: linear-gradient(135deg, var(--navy), var(--navy-soft)); }
.article-header__inner { max-width: 900px; padding-block: 65px 76px; }
.article-back { display: inline-flex; align-items: center; gap: 7px; margin-bottom: 35px; color: var(--gold-light); font-weight: 700; font-size: 14px; }
.article-back svg { width: 18px; height: 18px; }
.article-header__meta { display: flex; align-items: center; gap: 18px; color: rgba(255,255,255,.68); font-size: 14px; }
.article-header__meta span { color: var(--gold-light); font-weight: 700; }
.article-header__meta span::after { content: ""; display: inline-block; width: 4px; height: 4px; margin-inline-start: 18px; border-radius: 50%; background: var(--gold); vertical-align: middle; }
.article-header h1 { max-width: 870px; margin: 18px 0 15px; font-size: clamp(36px, 6vw, 62px); line-height: 1.35; letter-spacing: -.035em; }
.article-header p { max-width: 760px; margin: 0; color: rgba(255,255,255,.7); font-size: 18px; line-height: 1.95; }
.article-layout { max-width: 940px; padding-block: 54px 90px; }
.featured-image { margin: -8px 0 44px; overflow: hidden; border: 1px solid var(--line); border-radius: 26px; background: #fff; box-shadow: var(--shadow); }
.featured-image img { width: 100%; max-height: 570px; object-fit: cover; }
.featured-image__fallback { min-height: 270px; display: grid; place-items: center; background: radial-gradient(circle at center, rgba(201,162,74,.16), transparent 32%), linear-gradient(145deg, var(--navy-soft), var(--navy)); }
.featured-image__fallback img { width: 96px; height: 96px; padding: 8px; border-radius: 22px; background: #fff; box-shadow: 0 18px 42px rgba(0,0,0,.26); }
.featured-image__credit { padding: 10px 18px 12px; color: var(--muted); background: #fff; font-size: 12px; text-align: center; }
.featured-image__credit a { color: #70571d; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.article-content { padding: clamp(28px, 6vw, 68px); border: 1px solid var(--line); border-radius: 26px; background: var(--white); box-shadow: 0 18px 44px rgba(8,17,31,.065); font-size: 17px; line-height: 2.15; }
.article-content > :first-child { margin-top: 0; }
.article-content > :last-child { margin-bottom: 0; }
.article-content h2, .article-content h3, .article-content h4 { color: var(--navy); line-height: 1.55; }
.article-content h2 { margin: 2.1em 0 .7em; font-size: 30px; }
.article-content h3 { margin: 1.8em 0 .6em; font-size: 24px; }
.article-content p { margin: 0 0 1.35em; }
.article-content a { color: #8a6c25; text-decoration: underline; text-underline-offset: 4px; }
.article-content blockquote { margin: 2em 0; padding: 20px 24px; border-inline-start: 4px solid var(--gold); border-radius: 12px; background: #fbf7ee; color: #334155; }
.article-content pre { overflow-x: auto; direction: ltr; text-align: left; padding: 18px; border-radius: 14px; background: var(--navy); color: #e2e8f0; }
.article-content code { direction: ltr; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.article-content img { height: auto; margin: 30px auto; border-radius: 16px; }
.article-content table { width: 100%; margin: 28px 0; border-collapse: collapse; }
.article-content th, .article-content td { padding: 12px 14px; border: 1px solid #dbe2ea; text-align: right; }
.article-content th { background: #f1f5f9; }
.article-tags { display: flex; align-items: flex-start; gap: 22px; margin-top: 28px; padding: 24px 28px; border: 1px solid var(--line); border-radius: 18px; background: rgba(255,255,255,.72); }
.article-tags strong { padding-top: 5px; white-space: nowrap; }
.article-tags div { display: flex; flex-wrap: wrap; gap: 8px; }
.article-tags span { padding: 5px 12px; border-radius: 999px; background: rgba(201,162,74,.14); color: #70571d; font-size: 13px; font-weight: 700; }
.article-return { display: flex; align-items: center; justify-content: space-between; gap: 28px; margin-top: 45px; padding: 30px; border-radius: 22px; background: var(--navy); color: var(--white); }
.article-return p { max-width: 560px; margin: 0; color: rgba(255,255,255,.7); }
.button--gold { color: var(--navy); background: var(--gold); }
.button--outline { color: var(--white); border: 1px solid rgba(255,255,255,.35); }
.button--outline:hover { color: var(--navy); background: var(--white); }

.not-found { min-height: calc(100vh - 80px); display: grid; place-items: center; padding: 70px 20px; color: var(--white); background: radial-gradient(circle at center, rgba(201,162,74,.12), transparent 30%), var(--navy); }
.not-found__card { width: min(620px, 100%); text-align: center; }
.not-found__card img { margin: 0 auto 12px; padding: 6px; border-radius: 22px; background: #fff; }
.not-found__code { margin: 8px 0 0; color: var(--gold); font: 800 clamp(56px, 12vw, 100px)/1 "Inter", sans-serif; }
.not-found h1 { margin: 12px 0; font-size: clamp(30px, 6vw, 48px); }
.not-found__card > p:not(.not-found__code) { color: rgba(255,255,255,.68); }
.not-found__actions { display: flex; justify-content: center; gap: 12px; margin-top: 28px; }

.site-footer { color: var(--white); background: linear-gradient(135deg, var(--navy), var(--navy-soft), var(--navy)); }
.site-footer__inner { min-height: 210px; display: grid; grid-template-columns: 1.2fr 1fr auto; align-items: center; gap: 38px; padding-block: 42px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand__mark { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 14px; background: var(--gold); color: var(--navy); font: 800 19px/1 "Inter", sans-serif; }
.footer-brand strong { font-size: 21px; }
.footer-brand p { margin: 2px 0 0; color: rgba(255,255,255,.62); font-size: 13px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 17px; color: rgba(255,255,255,.68); font-size: 14px; }
.footer-links a:hover { color: var(--gold-light); }
.footer-copy { margin: 0; color: rgba(255,255,255,.45); font-size: 13px; direction: ltr; }

:focus-visible { outline: 3px solid rgba(201,162,74,.55); outline-offset: 3px; }

@media (max-width: 980px) {
  .site-nav { display: none; }
  .article-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-footer__inner { grid-template-columns: 1fr 1fr; }
  .footer-copy { grid-column: 1 / -1; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 28px, 1180px); }
  .site-header__inner { height: 72px; gap: 12px; }
  .brand__logo { width: 42px; height: 42px; border-radius: 11px; }
  .brand__copy strong { font-size: 17px; }
  .brand__copy small { font-size: 10px; }
  .header-action { min-height: 39px; padding: 8px 14px; font-size: 12px; }
  .blog-hero__inner { min-height: 270px; padding-block: 55px; }
  .blog-hero__line { width: 190px; height: 190px; inset-inline-end: -70px; opacity: .65; }
  .blog-hero h1 { font-size: 37px; }
  .blog-hero p { font-size: 16px; }
  .blog-index { padding: 52px 0 72px; }
  .index-heading { display: block; }
  .category-filter { justify-content: flex-start; margin-top: 22px; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 5px; }
  .category-filter a { flex: 0 0 auto; }
  .article-grid { grid-template-columns: 1fr; }
  .article-card__media { height: 210px; }
  .article-card p { min-height: 0; }
  .pagination { flex-wrap: wrap; gap: 10px; }
  .pagination span { order: -1; flex-basis: 100%; text-align: center; }
  .article-header__inner { padding-block: 44px 54px; }
  .article-back { margin-bottom: 27px; }
  .article-header h1 { font-size: 35px; }
  .article-header p { font-size: 16px; }
  .article-layout { padding-block: 30px 60px; }
  .article-content { padding: 25px 21px; border-radius: 19px; font-size: 16px; }
  .article-content h2 { font-size: 25px; }
  .article-content h3 { font-size: 21px; }
  .article-content table { display: block; overflow-x: auto; }
  .article-tags { display: block; padding: 21px; }
  .article-tags div { margin-top: 12px; }
  .article-return { display: block; padding: 24px; }
  .article-return .button { width: 100%; margin-top: 20px; }
  .not-found__actions { flex-direction: column; }
  .site-footer__inner { grid-template-columns: 1fr; gap: 24px; }
  .footer-copy { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
