/* ============================================================
   Araz News — global stylesheet
   ------------------------------------------------------------
   Path in MVC project: /wwwroot/css/araz.css
   Reference in _Layout.cshtml:
   <link rel="stylesheet" href="~/css/araz.css" asp-append-version="true" />
   ============================================================ */

/* ---------- design tokens ---------- */
:root {
  --red:        #C8102E;
  --red-deep:   #9E0A24;
  --red-ink:    #5F0613;
  --live:       #E81E2C;

  --ink:        #111418;
  --ink-2:      #2A2E35;
  --ink-3:      #4A4F58;
  --mute:       #6E747D;

  --rule:       #DCD7CE;
  --rule-soft:  #ECE7DE;

  --paper:      #F7F5F1;
  --paper-2:    #FBF9F4;
  --paper-3:    #EFEBE2;

  --gold:       #B8893A;

  --max:        1280px;
  --gutter:     32px;
}

/* ---------- base ---------- */
html, body { margin: 0; padding: 0; background: var(--paper); color: var(--ink); }
body { font-family: 'Inter', system-ui, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; height: auto; display: block; }

/* root variants — apply to <body> via culture */
body.fa { font-family: 'Vazirmatn','Estedad', system-ui, sans-serif; direction: rtl; font-feature-settings: "ss01","ss02"; }
body.az { font-family: 'Manrope','Inter', system-ui, sans-serif; direction: ltr; font-feature-settings: "ss01","ss03","cv11"; }

body.az .display { font-family: 'Manrope','Inter', system-ui, sans-serif; font-weight: 800; letter-spacing: -0.018em; }
body.az .display.italic { font-style: italic; }

/* ---------- layout ---------- */
.az-strip       { height: 4px; background: var(--red); }
.az-container   { max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.az-section     { padding: 28px 0; }

/* ---------- header ---------- */
.az-masthead {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0;
}
.az-masthead .brand { display: flex; align-items: center; gap: 14px; text-decoration: none; color: inherit; }
.az-masthead .brand-text { text-align: start; }
.az-masthead .brand-name {
  font-family: 'Vazirmatn', serif; font-weight: 900; font-size: 30px; line-height: 1;
}
body.az .az-masthead .brand-name { font-family: 'Source Serif 4', serif; font-style: italic; }
.az-masthead .brand-tag { font-size: 11px; color: var(--mute); margin-top: 6px; }
.az-masthead .date { font-size: 13px; color: var(--ink-2); font-weight: 600; text-align: end; }

.az-logomark {
  width: 60px; height: 60px; background: var(--red); color: #fff;
  display: grid; place-items: center; flex-shrink: 0;
  font-family: 'Source Serif 4', Georgia, serif; font-style: italic; font-weight: 800;
  text-align: center; line-height: 1;
}
.az-logomark .logo-top  { font-size: 12px; }
.az-logomark .logo-bot  { font-size: 10px; font-style: normal; letter-spacing: .1em; margin-top: 2px; }

/* ---------- nav ---------- */
.az-nav {
  display: flex; align-items: stretch; justify-content: space-between;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.az-nav ul {
  display: flex; align-items: center; list-style: none;
  margin: 0; padding: 0; font-size: 14px; font-weight: 700;
}
.az-nav ul a {
  display: inline-block; padding: 14px 16px;
  color: var(--ink); text-decoration: none; position: relative;
}
.az-nav ul a.active { color: var(--red); }
.az-nav ul a.active::after {
  content: ""; position: absolute; inset-inline: 16px; bottom: -1px;
  height: 3px; background: var(--red);
}
.az-nav-tools { display: flex; align-items: center; gap: 12px; padding-block: 8px; }
.az-lang { display: flex; }
.az-lang a {
  padding: 6px 14px; font-size: 12px; font-weight: 700;
  text-decoration: none; letter-spacing: .04em;
  background: var(--ink); color: #fff;
}
.az-lang a.active { background: var(--red); }
.az-search {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 12px; background: var(--paper-2);
  width: 220px; border: 1px solid var(--rule);
}
.az-search input {
  border: none; background: transparent; outline: none;
  font-size: 13px; font-family: inherit; flex: 1; color: var(--ink);
}

/* ---------- section head ---------- */
.az-sechead {
  display: flex; align-items: center; justify-content: space-between;
  border-bottom: 2px solid var(--red); margin-bottom: 18px;
}
.az-sechead h2 {
  margin: 0; font-size: 16px; font-weight: 800;
  background: var(--red); color: #fff; padding: 8px 18px;
}
.az-sechead.green     { border-bottom-color: #1F8A5B; }
.az-sechead.green h2  { background: #1F8A5B; }
.az-sechead.ink       { border-bottom-color: var(--ink); }
.az-sechead.ink h2    { background: var(--ink); }
.az-sechead .more {
  font-size: 12px; color: var(--mute); text-decoration: none;
}

/* ---------- cards ---------- */
.az-card { display: flex; flex-direction: column; gap: 10px; }
.az-card .thumb { position: relative; }
.az-card .thumb .chip {
  position: absolute; bottom: 0; inset-inline-start: 0;
  background: var(--red); color: #fff;
  padding: 4px 10px; font-size: 11px; font-weight: 700;
}
.az-card h3 {
  font-size: 16px; font-weight: 800; line-height: 1.6;
  margin: 0; text-wrap: pretty;
}
.az-card.large h3 { font-size: 22px; }
.az-card h3 a { color: inherit; text-decoration: none; }
.az-card h3 a:hover { color: var(--red-deep); }
.az-card .meta { font-size: 11px; color: var(--mute); }

/* image placeholder (server-side fallback when no image) */
.az-ph {
  aspect-ratio: 16 / 10; width: 100%; position: relative; overflow: hidden;
  background:
    repeating-linear-gradient(45deg, rgba(0,0,0,.04) 0 6px, rgba(0,0,0,.07) 6px 12px),
    linear-gradient(135deg, #d6cfc2, #b9b0a0);
}
.az-ph[data-ratio="4/3"]  { aspect-ratio: 4 / 3; }
.az-ph[data-ratio="16/9"] { aspect-ratio: 16 / 9; }
.az-ph[data-ratio="21/9"] { aspect-ratio: 21 / 9; }
.az-ph[data-ratio="1/1"]  { aspect-ratio: 1; }
.az-ph img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
}

/* hero card with title overlay */
.az-hero-card { position: relative; }
.az-hero-card .scrim {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0,0,0,.8));
}
.az-hero-card .copy {
  position: absolute; inset-inline: 0; bottom: 0; padding: 18px;
}
.az-hero-card .copy .chip {
  background: var(--red); color: #fff;
  padding: 3px 10px; font-size: 11px; font-weight: 700;
  display: inline-block; margin-bottom: 8px;
}
.az-hero-card .copy h2 {
  font-size: 22px; font-weight: 800; line-height: 1.6; margin: 0;
  color: #fff; text-wrap: balance;
}
.az-hero-card .copy h2 a { color: #fff; text-decoration: none; }

/* list row (text + thumb) */
.az-listrow {
  display: grid; grid-template-columns: 1fr 96px; gap: 14px;
  padding: 14px 0; border-bottom: 1px solid var(--rule-soft);
}
.az-listrow .chip {
  display: inline-block; background: var(--red); color: #fff;
  padding: 2px 8px; font-size: 10px; font-weight: 700; margin-bottom: 6px;
}
.az-listrow .chip.green { background: #1F8A5B; }
.az-listrow .chip.ink   { background: var(--ink); }
.az-listrow h4 { font-size: 14px; font-weight: 700; line-height: 1.7; margin: 0; }
.az-listrow h4 a { color: inherit; text-decoration: none; }
.az-listrow .meta { font-size: 11px; color: var(--mute); margin-top: 4px; }

/* numbered card (most-viewed strip) */
.az-numcard { position: relative; }
.az-numcard .num {
  position: absolute; top: 8px; inset-inline-start: 8px;
  background: var(--red); color: #fff;
  width: 28px; height: 28px; display: grid; place-items: center;
  font-size: 14px; font-weight: 800;
}
.az-numcard h4 { font-size: 14px; font-weight: 700; line-height: 1.7; margin: 12px 0 6px; }
.az-numcard h4 a { color: inherit; text-decoration: none; }
.az-numcard .views { font-size: 11px; color: var(--mute); display: flex; align-items: center; gap: 4px; }

/* grids */
.az-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.az-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.az-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.az-hero-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 36px; }

/* ---------- TV widget ---------- */
.az-tv {
  background: var(--ink); color: #fff; position: relative;
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.az-tv .head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 8px 12px; border-bottom: 1px solid rgba(255,255,255,.08);
  font-size: 12px; font-weight: 700;
}
.az-tv .head .live {
  display: inline-flex; align-items: center; gap: 6px;
}
.az-tv .head .open {
  text-decoration: none; font-size: 11px;
  background: var(--red); color: #fff; padding: 3px 8px; letter-spacing: .04em;
}
.az-tv .screen { aspect-ratio: 16/9; position: relative; background: #0a0b0f; overflow: hidden; }
.az-tv .screen .bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(60% 80% at 30% 40%, rgba(200,16,46,.18), transparent 70%),
    linear-gradient(135deg, #1a1d24 0%, #0a0b0f 100%);
}
.az-tv .screen .scan {
  position: absolute; inset: 0;
  background: repeating-linear-gradient(0deg, transparent 0 3px, rgba(255,255,255,.02) 3px 4px);
  pointer-events: none;
}
.az-tv .screen .wm {
  position: absolute; top: 8px; inset-inline-end: 8px;
  background: var(--red); color: #fff;
  padding: 2px 6px; font-size: 9px; font-weight: 800; letter-spacing: .06em;
  direction: ltr;
}
.az-tv .screen .play {
  position: absolute; inset: 0; display: grid; place-items: center;
}
.az-tv .screen .play button {
  width: 44px; height: 44px; border-radius: 50%;
  border: none; background: rgba(255,255,255,.12);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  color: #fff; cursor: pointer; display: grid; place-items: center;
}
.az-tv .controls {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px; background: #0a0b0f;
  font-size: 11px; color: rgba(255,255,255,.75);
  direction: ltr;
}
.az-tv .controls button {
  width: 22px; height: 22px; border: none; background: transparent;
  color: rgba(255,255,255,.7); cursor: pointer; padding: 0;
  display: grid; place-items: center;
}
.az-tv .controls .time { font-family: ui-monospace, Menlo, monospace; }
.az-tv .controls .bar { flex: 1; height: 3px; background: rgba(255,255,255,.15); position: relative; }
.az-tv .controls .bar > i {
  position: absolute; inset: 0; background: var(--red); width: 100%;
  display: block;
}

/* live dot */
.live-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--live); position: relative; }
.live-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 50%;
  background: var(--live); opacity: .35;
  animation: livepulse 1.4s ease-out infinite;
}
@keyframes livepulse {
  0%   { transform: scale(.6); opacity: .5; }
  100% { transform: scale(1.8); opacity: 0; }
}

/* ---------- article detail ---------- */
.az-article-head { max-width: 980px; margin: 24px auto 0; padding: 0 var(--gutter); }
.az-article-head .chip-cat {
  display: inline-block; background: var(--red); color: #fff;
  padding: 4px 12px; font-size: 12px; font-weight: 700; margin-bottom: 16px;
}
.az-article-head h1 {
  font-size: 44px; font-weight: 900; line-height: 1.4; margin: 0 0 18px;
  text-wrap: balance;
}
.az-article-head .lede {
  font-size: 19px; line-height: 1.95; color: var(--ink-2); margin: 0 0 24px;
  font-weight: 500; text-wrap: pretty;
}
.az-byline {
  display: flex; align-items: center; justify-content: space-between;
  padding-block: 14px; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
}
.az-byline .by { display: flex; align-items: center; gap: 12px; }
.az-byline .avatar {
  width: 40px; height: 40px; border-radius: 50%; background: var(--ink);
  color: #fff; display: grid; place-items: center; font-size: 14px; font-weight: 700;
}
.az-byline .by-info .name { font-size: 13px; font-weight: 700; }
.az-byline .by-info .meta { font-size: 11px; color: var(--mute); display: flex; gap: 8px; }
.az-byline .share { display: flex; gap: 6px; }
.az-byline .share a {
  padding: 6px 12px; font-size: 11px; font-weight: 700;
  border: 1px solid var(--ink); color: var(--ink); text-decoration: none;
}

.az-article-hero { max-width: 980px; margin: 24px auto 0; padding: 0 var(--gutter); }
.az-article-hero .caption { font-size: 12px; color: var(--mute); margin-top: 8px; font-style: italic; text-align: start; }

.az-article-body-wrap { max-width: var(--max); margin: 36px auto 0; padding: 0 var(--gutter); }
.az-article-grid {
  display: grid; grid-template-columns: 1fr 300px; gap: 60px;
}
.az-article-body { max-width: 680px; justify-self: start; font-size: 17px; line-height: 2.1; color: var(--ink); text-wrap: pretty; }
.az-article-body > p:first-child { margin-top: 0; }
.az-article-body h2 { font-size: 24px; font-weight: 900; margin: 32px 0 16px; line-height: 1.5; }
.az-article-body blockquote {
  border-inline-start: 3px solid var(--red);
  padding-inline-start: 20px; padding-block: 10px;
  margin: 32px 0;
  font-size: 20px; font-weight: 700; font-style: italic;
  line-height: 1.7; color: var(--ink);
}
.az-article-body blockquote footer { font-size: 13px; font-weight: 500; font-style: normal; color: var(--mute); margin-top: 10px; }

.az-tagline {
  margin-top: 36px; padding: 20px 0 0; border-top: 1px solid var(--rule);
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
}
.az-tagline .label { font-size: 12px; color: var(--mute); }
.az-tag {
  font-size: 11px; padding: 4px 10px;
  background: var(--paper-3); color: var(--ink-2); text-decoration: none;
}

.az-author-bio {
  margin-top: 36px; padding: 20px; background: var(--paper-3);
  display: flex; gap: 16px; align-items: flex-start;
}
.az-author-bio .avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--ink); color: #fff;
  display: grid; place-items: center; font-size: 18px; font-weight: 700; flex-shrink: 0;
}
.az-author-bio .name { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.az-author-bio .bio  { font-size: 13px; line-height: 1.85; color: var(--ink-2); margin: 0; }

.az-related-head {
  font-size: 18px; font-weight: 800; margin: 48px 0 16px;
  padding-bottom: 8px; border-bottom: 2px solid var(--ink);
}

/* sidebar */
.az-side h3 {
  margin: 0 0 14px; font-size: 15px; font-weight: 800;
  padding-bottom: 8px; border-bottom: 2px solid var(--red);
}
.az-side .topread {
  list-style: none; padding: 0; margin: 0;
}
.az-side .topread li {
  display: grid; grid-template-columns: auto 1fr; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--rule-soft);
  align-items: start;
}
.az-side .topread .n {
  font-size: 20px; font-weight: 900; color: var(--red);
  line-height: 1; width: 22px; text-align: center;
}
.az-side .topread a { color: var(--ink); text-decoration: none; font-size: 12px; font-weight: 600; line-height: 1.7; }

.az-tagcloud { display: flex; flex-wrap: wrap; gap: 6px; }

/* breadcrumb */
.az-breadcrumb {
  font-size: 12px; color: var(--mute); display: flex; gap: 8px;
  margin-bottom: 12px;
}
.az-breadcrumb a { color: var(--mute); text-decoration: none; }
.az-breadcrumb .current { color: var(--ink); }

/* category title block */
.az-cattitle {
  display: flex; align-items: baseline; justify-content: space-between;
  padding-bottom: 14px; border-bottom: 2px solid var(--ink); margin-bottom: 28px;
}
.az-cattitle h1 { margin: 0; font-size: 36px; font-weight: 900; line-height: 1; }
.az-cattitle .pre { font-size: 10px; letter-spacing: .2em; color: var(--red); font-weight: 800; margin-bottom: 4px; }
.az-cattitle .count { font-size: 12px; color: var(--mute); }

/* category sidebar inline header */
.az-catbar {
  background: var(--red); color: #fff;
  padding: 8px 14px; font-size: 14px; font-weight: 800;
  display: inline-block;
}

/* pagination */
.az-pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 4px; margin-top: 32px; font-size: 13px;
}
.az-pagination a {
  padding: 8px 12px; text-decoration: none; color: var(--ink);
  border: 1px solid var(--rule);
}
.az-pagination a.current {
  background: var(--red); color: #fff; border-color: var(--red); font-weight: 700;
}
.az-pagination a.disabled { color: var(--mute); }
.az-pagination .dots { padding: 8px 4px; color: var(--mute); }

/* ---------- footer ---------- */
.az-foot {
  background: var(--ink); color: #C6C9CF;
  padding: 48px 0 24px; margin-top: 64px;
}
.az-foot h4 {
  color: #fff; font-size: 13px; letter-spacing: .06em;
  text-transform: uppercase; margin: 0 0 12px;
}
body.fa .az-foot h4 { letter-spacing: 0; font-size: 14px; }
.az-foot a { color: #C6C9CF; text-decoration: none; font-size: 14px; }
.az-foot a:hover { color: #fff; }
.az-foot ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.az-foot .grid {
  display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 48px;
}
.az-foot .brand-mark {
  display: inline-flex; align-items: center; gap: 12px; margin-bottom: 14px;
}
.az-foot .brand-mark .name {
  font-family: 'Vazirmatn', serif; font-size: 28px; font-weight: 900; color: #fff;
}
body.az .az-foot .brand-mark .name { font-family: 'Source Serif 4', serif; font-style: italic; font-size: 26px; }
.az-foot .blurb { font-size: 14px; line-height: 1.8; color: #A5A8AE; max-width: 380px; margin: 0; }
.az-foot .copy {
  border-top: 1px solid rgba(255,255,255,.1); margin-top: 30px; padding-top: 18px;
  display: flex; align-items: center; justify-content: space-between;
  font-size: 12px; color: #8B8F95;
}

/* utility classes ============================================ */
.az-mt-24 { margin-top: 24px; }
.az-mt-28 { margin-top: 28px; }
.az-mt-32 { margin-top: 32px; }
.az-mt-48 { margin-top: 48px; }
.az-mt-56 { margin-top: 56px; }
