/* ATNews — public static site
   مرز دانش و فناوری · رسانهٔ عمومی و آگاهی‌بخش زیر چتر alef.ba
   Persian-first, RTL, self-contained. No build step.
   Palette extends the existing newsroom branding (navy #091c3b→#133b7a). */

:root {
  --navy-900: #061427;
  --navy-800: #091c3b;
  --navy-700: #102a56;
  --navy-600: #133b7a;
  --blue-500: #155eef;
  --blue-400: #2f7bff;
  --accent: #14b8a6;        /* علم/فناوری — سبزآبی */
  --accent-warm: #f5a623;   /* تأکید گرم */
  --ink: #17202a;
  --ink-soft: #445;
  --muted: #667085;
  --line: #e4e9f2;
  --bg: #f6f7fb;
  --surface: #ffffff;
  --surface-2: #f0f4fb;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 12px 30px rgba(16, 24, 40, .08);
  --shadow-sm: 0 4px 14px rgba(16, 24, 40, .06);
  --container: min(1180px, calc(100vw - 2rem));
  --maxread: 760px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  direction: rtl;
  text-align: right;
  font-family: Vazirmatn, "Segoe UI", Tahoma, system-ui, sans-serif;
  background: var(--bg);
  color: var(--ink);
  margin: 0;
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--blue-500); }

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

.container { width: var(--container); margin: 0 auto; }

/* ---------- Top bar / header ---------- */
.topbar {
  background: linear-gradient(135deg, var(--navy-900), var(--navy-600));
  color: #fff;
}
.topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1rem 0;
  flex-wrap: wrap;
}
.brand {
  display: flex;
  align-items: center;
  gap: .7rem;
  text-decoration: none;
  color: #fff;
}
.brand__logo { width: 42px; height: 42px; flex: 0 0 auto; }
.brand__name { font-size: 1.45rem; font-weight: 800; letter-spacing: .3px; }
.brand__tag {
  font-size: .8rem;
  color: #b9c9e6;
  font-weight: 500;
  display: block;
  margin-top: -2px;
}
.nav {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
  align-items: center;
}
.nav a {
  color: #dce6f7;
  text-decoration: none;
  padding: .45rem .8rem;
  border-radius: 999px;
  font-size: .98rem;
  font-weight: 600;
  transition: background .15s, color .15s;
}
.nav a:hover, .nav a[aria-current="page"] {
  background: rgba(255, 255, 255, .12);
  color: #fff;
}

/* small kicker strip under header */
.kicker-strip {
  background: var(--navy-800);
  color: #aec1e3;
  font-size: .82rem;
  border-top: 1px solid rgba(255,255,255,.06);
}
.kicker-strip .container {
  display: flex;
  gap: .6rem;
  align-items: center;
  padding: .5rem 0;
  flex-wrap: wrap;
}
.kicker-strip strong { color: var(--accent); }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 380px at 85% -10%, rgba(20,184,166,.18), transparent 60%),
    linear-gradient(135deg, var(--navy-900), var(--navy-700));
  color: #fff;
  padding: 3rem 0 3.4rem;
}
.hero__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 2rem;
  align-items: stretch;
}
.hero__lead-tag {
  display: inline-block;
  background: rgba(20,184,166,.18);
  color: #7ff0e1;
  border: 1px solid rgba(20,184,166,.4);
  padding: .25rem .8rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 700;
  margin-bottom: 1rem;
}
.hero h1 {
  font-size: 2.3rem;
  line-height: 1.45;
  margin: 0 0 .8rem;
  font-weight: 800;
}
.hero p.hero__sub {
  font-size: 1.12rem;
  color: #cdd9ef;
  margin: 0 0 1.5rem;
  max-width: 46ch;
}
.hero__cta {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--accent);
  color: #042a26;
  text-decoration: none;
  font-weight: 800;
  padding: .8rem 1.4rem;
  border-radius: 999px;
  box-shadow: 0 8px 20px rgba(20,184,166,.3);
}
.hero__cta:hover { filter: brightness(1.05); }

/* featured card inside hero */
.hero__feature {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-decoration: none;
  color: #fff;
  min-height: 220px;
  background-size: cover;
  background-position: center;
  position: relative;
  overflow: hidden;
}
.hero__feature::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(0deg, rgba(6,20,39,.85), rgba(6,20,39,.15));
}
.hero__feature > * { position: relative; z-index: 1; }
.hero__feature .tag {
  align-self: flex-start;
  background: var(--accent-warm);
  color: #3a2700;
  font-weight: 800;
  font-size: .74rem;
  padding: .2rem .6rem;
  border-radius: 999px;
  margin-bottom: .6rem;
}
.hero__feature h3 { margin: 0; font-size: 1.2rem; line-height: 1.6; }

/* ---------- Section headers ---------- */
.section { padding: 2.6rem 0; }
.section__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.4rem;
  border-bottom: 2px solid var(--line);
  padding-bottom: .6rem;
}
.section__head h2 {
  font-size: 1.5rem;
  margin: 0;
  position: relative;
  padding-right: .8rem;
}
.section__head h2::before {
  content: "";
  position: absolute;
  right: 0; top: .15em;
  width: 5px; height: 1.1em;
  border-radius: 3px;
  background: var(--accent);
}
.section__head a { font-size: .92rem; font-weight: 600; text-decoration: none; }

/* ---------- Category chips ---------- */
.cats {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 .4rem;
}
.cats a, .chip {
  text-decoration: none;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  padding: .4rem .9rem;
  border-radius: 999px;
  font-size: .9rem;
  font-weight: 600;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, border-color .12s;
}
.cats a:hover { transform: translateY(-2px); border-color: var(--accent); }

/* ---------- Card grid ---------- */
.grid {
  display: grid;
  gap: 1.3rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.card {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  transition: transform .15s, box-shadow .15s;
  border: 1px solid transparent;
}
.card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(16,24,40,.14);
  border-color: var(--surface-2);
}
.card__thumb {
  height: 170px;
  background: linear-gradient(135deg, var(--navy-700), var(--blue-500));
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 2.4rem;
  position: relative;
}
.card__cat {
  position: absolute;
  top: .8rem; right: .8rem;
  background: rgba(6,20,39,.78);
  color: #fff;
  font-size: .74rem;
  font-weight: 700;
  padding: .25rem .7rem;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}
.card__body { padding: 1.1rem 1.2rem 1.3rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.card__body h3 { margin: 0; font-size: 1.12rem; line-height: 1.6; }
.card__excerpt { color: var(--ink-soft); font-size: .96rem; margin: 0; }
.card__meta {
  margin-top: auto;
  color: var(--muted);
  font-size: .85rem;
  display: flex;
  gap: .6rem;
  align-items: center;
  padding-top: .4rem;
}
.card__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); display: inline-block; }

/* thumb accent variants per category */
.thumb--ai     { background: linear-gradient(135deg, #4c1d95, #7c3aed); }
.thumb--bio    { background: linear-gradient(135deg, #065f46, #10b981); }
.thumb--space  { background: linear-gradient(135deg, #0b1f3a, #1d4ed8); }
.thumb--energy { background: linear-gradient(135deg, #7c2d12, #f59e0b); }
.thumb--mat    { background: linear-gradient(135deg, #334155, #0ea5e9); }

/* ---------- About / mission ---------- */
.mission {
  background: linear-gradient(135deg, var(--surface), var(--surface-2));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2rem;
}
.mission h2 { margin-top: 0; }
.mission__points {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.1rem;
  margin-top: 1.4rem;
  list-style: none;
  padding: 0;
}
.mission__points li {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem;
}
.mission__points b { display: block; margin-bottom: .3rem; color: var(--navy-700); }
.mission__seal {
  margin-top: 1.4rem;
  font-size: .92rem;
  color: var(--muted);
  border-top: 1px dashed var(--line);
  padding-top: 1rem;
}

/* ---------- Article page ---------- */
.article {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: var(--maxread);
  margin: 2rem auto;
  padding: 2.2rem clamp(1.2rem, 4vw, 2.6rem);
}
.article__breadcrumb { font-size: .85rem; color: var(--muted); margin-bottom: 1rem; }
.article__breadcrumb a { text-decoration: none; }
.article__cat {
  display: inline-block;
  background: var(--surface-2);
  color: var(--navy-700);
  font-weight: 700;
  font-size: .82rem;
  padding: .25rem .8rem;
  border-radius: 999px;
  margin-bottom: .8rem;
}
.article h1 { font-size: 2rem; line-height: 1.5; margin: 0 0 .6rem; }
.article__lead { font-size: 1.18rem; color: var(--ink-soft); line-height: 1.95; }
.article__meta {
  display: flex; gap: .8rem; flex-wrap: wrap; align-items: center;
  color: var(--muted); font-size: .9rem;
  border-bottom: 1px solid var(--line);
  padding-bottom: 1rem; margin-bottom: 1.4rem;
}
.article__hero {
  height: clamp(180px, 34vw, 300px);
  border-radius: var(--radius-sm);
  margin-bottom: 1.6rem;
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 3rem;
}
.prose { font-size: 1.08rem; line-height: 2.05; }
.prose h2 { font-size: 1.35rem; color: var(--navy-700); margin: 2rem 0 .6rem; }
.prose h3 { font-size: 1.12rem; color: var(--navy-700); margin: 1.5rem 0 .4rem; }
.prose p { margin: 0 0 1rem; }
.prose ul, .prose ol { padding-right: 1.3rem; margin: 0 0 1rem; }
.prose li { margin-bottom: .4rem; }
.prose blockquote {
  margin: 1.4rem 0;
  padding: .8rem 1.2rem;
  border-right: 4px solid var(--accent);
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  color: var(--ink-soft);
}
.callout {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin: 1.4rem 0;
}
.callout b { color: var(--navy-700); }

.article__footer {
  margin-top: 2rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: .92rem;
  color: var(--muted);
}
.article__sources { margin-top: 1rem; }
.article__sources b { color: var(--ink-soft); }
.tags { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.tags span {
  background: var(--surface-2);
  color: var(--ink-soft);
  font-size: .82rem;
  padding: .2rem .7rem;
  border-radius: 999px;
}

.backlink {
  display: inline-block;
  margin: 1.5rem auto 0;
  color: var(--blue-500);
  text-decoration: none;
  font-weight: 600;
}

/* ---------- "Explain simpler" optional AI widget ---------- */
.explain {
  margin: 1.8rem 0;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 1.1rem 1.2rem;
}
.explain__head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
}
.explain__head b { color: var(--navy-700); }
.explain__head small { color: var(--muted); display:block; font-weight: 500; }
.explain__btn {
  background: var(--accent);
  color: #042a26;
  border: none;
  font: inherit; font-weight: 800;
  padding: .55rem 1.1rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.explain__btn:hover { filter: brightness(1.05); }
.explain__btn:disabled { opacity: .6; cursor: progress; }
.explain__out {
  margin-top: .9rem;
  line-height: 2;
  color: var(--ink);
  white-space: pre-wrap;
}
.explain__out:empty { display: none; }
.explain__out--fallback { color: var(--ink-soft); font-style: italic; }

/* ---------- Newsletter / explainer banner ---------- */
.band {
  background: linear-gradient(135deg, var(--navy-800), var(--navy-600));
  color: #fff;
  border-radius: var(--radius);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.band h2 { margin: 0 0 .4rem; }
.band p { margin: 0; color: #cdd9ef; }
.band__cta {
  background: #fff; color: var(--navy-700);
  text-decoration: none; font-weight: 800;
  padding: .7rem 1.3rem; border-radius: 999px;
  white-space: nowrap;
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-900);
  color: #aec1e3;
  margin-top: 3rem;
  padding: 2.4rem 0 1.6rem;
  font-size: .95rem;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.6rem;
}
.site-footer h4 { color: #fff; margin: 0 0 .7rem; font-size: 1rem; }
.site-footer a { color: #aec1e3; text-decoration: none; display: block; margin-bottom: .4rem; }
.site-footer a:hover { color: #fff; }
.footer__brand { display:flex; align-items:center; gap:.6rem; margin-bottom:.7rem; }
.footer__brand .brand__name { font-size: 1.2rem; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.08);
  margin-top: 1.6rem; padding-top: 1.2rem;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: .6rem;
  color: #7e93b8; font-size: .85rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
  .hero__grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 1.8rem; }
  .footer__grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .topbar__inner { flex-direction: column; align-items: flex-start; }
  .nav { width: 100%; }
  .section__head { flex-direction: column; align-items: flex-start; gap: .3rem; }
}

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