/* چتر آبی — Status & Announcements
   Design concept: a weather log behind glass. The umbrella brand becomes
   a literal sky: clear (all good), cloudy (planned maintenance),
   stormy (incidents / security advisories). The hero is a slow drifting
   sky gradient; the feed is a vertical timeline reading top-to-bottom,
   right-aligned for RTL, because order here carries real information. */

:root {
  --ink: #0e1b2c;
  --umbrella: #2f6fa6;
  --sky: #6fb7e0;
  --clear: #3fbf83;
  --amber: #e8a33d;
  --storm: #e15b5b;
  --cloud-gray: #b9c4d0;
  --cloud-white: #f5f8fb;

  --bg: #0b1622;
  --panel: #12233a;
  --panel-border: #1f3a58;
  --text-primary: #eef3f8;
  --text-muted: #9fb1c4;

  --radius: 14px;
  --mono: 'Space Mono', 'JetBrains Mono', ui-monospace, SFMono-Regular, monospace;
  --display: 'Vazirmatn', 'Tahoma', sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--display);
  direction: rtl;
  text-align: right;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: inherit; text-decoration: none; }

img, svg { display: block; }

/* ---------- Top alert banner ---------- */

.top-alert-banner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 10px 20px;
  text-align: center;
  font-size: 13.5px;
  font-weight: 700;
  border-bottom: 1px solid var(--panel-border);
  background: var(--panel);
  color: var(--text-primary);
}

.top-alert-banner svg { width: 17px; height: 17px; flex: none; color: currentColor; }

.top-alert-banner .arrow { opacity: .8; transition: transform .15s ease; }
.top-alert-banner:hover .arrow { transform: translateX(-3px); }

.top-alert-banner.clear  { background: rgba(63, 191, 131, 0.14); color: var(--clear); }
.top-alert-banner.cloudy { background: rgba(232, 163, 61, 0.14); color: var(--amber); }
.top-alert-banner.storm  { background: rgba(225, 91, 91, 0.16); color: var(--storm); }

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

.sky-hero {
  position: relative;
  overflow: hidden;
  padding: 28px 24px 34px;
  background: linear-gradient(120deg, #0b1622 0%, #12283f 35%, #1c3f60 65%, #2f6fa6 100%);
  background-size: 220% 220%;
  animation: drift 22s ease-in-out infinite;
  border-bottom: 1px solid var(--panel-border);
}

@media (prefers-reduced-motion: reduce) {
  .sky-hero { animation: none; }
}

@keyframes drift {
  0%   { background-position: 0% 30%; }
  50%  { background-position: 100% 70%; }
  100% { background-position: 0% 30%; }
}

.sky-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(2px 2px at 12% 22%, rgba(255,255,255,0.35) 0, transparent 60%),
    radial-gradient(2px 2px at 78% 12%, rgba(255,255,255,0.25) 0, transparent 60%),
    radial-gradient(3px 3px at 60% 40%, rgba(255,255,255,0.15) 0, transparent 60%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  max-width: 880px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.brand-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-text strong {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

.brand-text span {
  font-size: 12px;
  color: var(--cloud-gray);
}

.vip-badge {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.6px;
  color: var(--cloud-white);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.18);
  padding: 5px 10px;
  border-radius: 999px;
  direction: ltr;
}

.overall-status {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: var(--radius);
  padding: 14px 16px;
  backdrop-filter: blur(2px);
}

.overall-status .dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--clear);
  box-shadow: 0 0 0 4px rgba(63,191,131,0.18);
  flex-shrink: 0;
}

.overall-status .txt strong {
  display: block;
  font-size: 14.5px;
  font-weight: 700;
}

.overall-status .txt span {
  font-size: 12.5px;
  color: var(--cloud-gray);
}

.hero-title h1 {
  margin: 4px 0 2px;
  font-size: clamp(22px, 4vw, 30px);
  font-weight: 800;
}

.hero-title p {
  margin: 0;
  color: var(--cloud-gray);
  font-size: 14px;
  max-width: 60ch;
}

/* ---------- Layout ---------- */

main {
  flex: 1;
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 34px 24px 60px;
}

.section-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.section-label .line {
  flex: 1;
  height: 1px;
  background: var(--panel-border);
}

.section-label span {
  font-size: 13px;
  font-weight: 700;
  color: var(--cloud-gray);
  font-family: var(--display);
  white-space: nowrap;
}

/* ---------- Timeline / feed ---------- */

.timeline {
  position: relative;
  padding-right: 26px;
  border-right: 2px solid var(--panel-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 26px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-item::before {
  content: "";
  position: absolute;
  /* Aligns the dot's right edge with the timeline's border line, then
     nudges it out by exactly half its own width so it's centered on the
     line regardless of screen size. */
  right: -26px;
  transform: translateX(50%);
  top: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--panel-border);
  box-sizing: border-box;
}

.timeline-item.clear::before  { border-color: var(--clear); }
.timeline-item.cloudy::before { border-color: var(--amber); }
.timeline-item.storm::before  { border-color: var(--storm); }

.post-card {
  display: block;
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.post-card:hover {
  border-color: var(--umbrella);
  transform: translateY(-1px);
}

.post-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.type-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
}

.type-chip.clear  { background: rgba(63,191,131,0.14); color: var(--clear); }
.type-chip.cloudy { background: rgba(232,163,61,0.14); color: var(--amber); }
.type-chip.storm  { background: rgba(225,91,91,0.14);  color: var(--storm); }

.type-chip svg { width: 13px; height: 13px; }

.post-date {
  font-family: var(--mono);
  font-size: 11.5px;
  color: var(--text-muted);
  direction: ltr;
}

.post-card h2 {
  margin: 0 0 6px;
  font-size: 17px;
  font-weight: 700;
}

.post-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--cloud-gray);
  line-height: 1.7;
}

.empty-state {
  border: 1px dashed var(--panel-border);
  border-radius: var(--radius);
  padding: 40px 20px;
  text-align: center;
  color: var(--cloud-gray);
}

.empty-state svg {
  margin: 0 auto 14px;
  width: 40px;
  height: 40px;
  opacity: 0.6;
}

.empty-state strong {
  display: block;
  color: var(--text-primary);
  font-size: 15px;
  margin-bottom: 6px;
}

/* ---------- Single post page ---------- */

.post-page {
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius);
  padding: 26px 26px 30px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--sky);
  margin-bottom: 18px;
}

.back-link svg { width: 14px; height: 14px; }

.post-page h1 {
  font-size: clamp(20px, 3.4vw, 26px);
  margin: 12px 0 10px;
  font-weight: 800;
}

.post-body {
  font-size: 14.5px;
  line-height: 1.9;
  color: #dbe4ee;
}

.post-body h2, .post-body h3 {
  color: var(--text-primary);
  margin-top: 26px;
}

.post-body ul, .post-body ol {
  padding-inline-start: 22px;
}

.post-body code {
  font-family: var(--mono);
  background: rgba(255,255,255,0.06);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.9em;
  direction: ltr;
  display: inline-block;
}

.post-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 13px;
}

.post-body th, .post-body td {
  border: 1px solid var(--panel-border);
  padding: 8px 10px;
  text-align: right;
}

.post-body th {
  background: rgba(255,255,255,0.04);
}

.severity-box {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 18px 0;
  padding: 14px 16px;
  border-radius: 10px;
  background: rgba(225,91,91,0.08);
  border: 1px solid rgba(225,91,91,0.25);
}

.severity-box .item strong {
  display: block;
  font-size: 11px;
  color: var(--cloud-gray);
  font-weight: 600;
  margin-bottom: 2px;
}

.severity-box .item span {
  font-family: var(--mono);
  font-size: 13px;
  direction: ltr;
  display: inline-block;
}

/* ---------- Footer ---------- */

footer {
  border-top: 1px solid var(--panel-border);
  padding: 22px 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 12.5px;
}

footer a { color: var(--sky); }

/* ---------- Focus & responsive ---------- */

a:focus-visible, .post-card:focus-visible {
  outline: 2px solid var(--sky);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .timeline { padding-right: 20px; }
  .timeline-item::before { right: -20px; }
  .post-meta { flex-wrap: wrap; }
}
