/**
 * Generic archive index + static page + 404 — mobile-first Lab shell.
 */

.jf-idx-wrap,
.jf-page-prose,
.jf-404-wrap {
  padding-bottom: 5.5rem;
}

.jf-idx {
  max-width: 42rem;
  margin: 0 auto;
  padding: 1rem 1rem 2.25rem;
  font-family: "Cairo", system-ui, sans-serif;
}

.jf-idx__head {
  margin-bottom: 1rem;
  padding: 1rem 1.05rem 1.1rem;
  border-radius: 1rem;
  border: 1px solid color-mix(in srgb, #e3000f 14%, #e2e8f0);
  background:
    radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, #e3000f 9%, transparent), transparent 55%),
    #fff;
}

.jf-idx__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  color: #e3000f;
}

.jf-idx__title {
  margin: 0 0 0.35rem;
  font-size: 1.45rem;
  font-weight: 900;
  line-height: 1.3;
  color: #0f172a;
  border-inline-start: 4px solid #e3000f;
  padding-inline-start: 0.6rem;
}

.jf-idx__sub {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.6;
  color: #475569;
}

.jf-idx__count {
  margin: 0.55rem 0 0;
  font-size: 0.72rem;
  font-weight: 800;
  color: #94a3b8;
}

.jf-idx__river {
  display: grid;
  gap: 0.55rem;
}

.jf-idx__empty {
  padding: 1.75rem 1rem;
  text-align: center;
  border-radius: 1rem;
  border: 1px dashed #cbd5e1;
  background: #f8fafc;
}

.jf-idx__empty-text {
  margin: 0 0 0.9rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #64748b;
  line-height: 1.55;
}

.jf-idx__pager {
  margin-top: 1.25rem;
}

.jf-idx--opinion .jf-idx__eyebrow {
  color: #7c3aed;
}

.jf-idx--opinion .jf-idx__title {
  border-inline-start-color: #7c3aed;
}

.jf-idx--tag .jf-idx__eyebrow {
  color: #0369a1;
}

.jf-idx--author .jf-idx__eyebrow {
  color: #0f766e;
}

/* —— Static page prose —— */
.jf-page {
  max-width: 40rem;
  margin: 0 auto;
  padding: 1rem 1rem 2.5rem;
  font-family: "Cairo", system-ui, sans-serif;
}

.jf-page__head {
  margin-bottom: 1rem;
}

.jf-page__eyebrow {
  margin: 0 0 0.3rem;
  font-size: 0.7rem;
  font-weight: 800;
  color: #e3000f;
}

.jf-page__title {
  margin: 0 0 0.4rem;
  font-size: 1.55rem;
  font-weight: 900;
  line-height: 1.35;
  color: #0f172a;
}

.jf-page__lead {
  margin: 0;
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.6;
  color: #475569;
}

.jf-page__media {
  margin: 0 0 1.1rem;
  border-radius: 0.85rem;
  overflow: hidden;
}

.jf-page__media img {
  display: block;
  width: 100%;
  height: auto;
}

.jf-page__content {
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.8;
  color: #1e293b;
}

.jf-page__content > *:first-child {
  margin-top: 0;
}

.jf-page__content p,
.jf-page__content ul,
.jf-page__content ol {
  margin: 0 0 1rem;
}

.jf-page__content a {
  color: #e3000f;
  font-weight: 700;
}

.jf-page__content h2,
.jf-page__content h3 {
  margin: 1.4rem 0 0.55rem;
  font-weight: 900;
  line-height: 1.35;
}

/* —— 404 —— */
/* مقيَّد بالغلاف: الجسم نفسه يحمل كلاس jf-404 ولا يجوز حصره في 26rem. */
.jf-404-wrap .jf-404 {
  max-width: 26rem;
  margin: 0 auto;
  padding: 2.5rem 1.15rem 3rem;
  text-align: center;
  font-family: "Cairo", system-ui, sans-serif;
}

.jf-404__code {
  margin: 0 0 0.35rem;
  font-size: 2.75rem;
  font-weight: 900;
  line-height: 1;
  color: #e3000f;
  letter-spacing: 0.04em;
}

.jf-404__title {
  margin: 0 0 0.5rem;
  font-size: 1.35rem;
  font-weight: 900;
  color: #0f172a;
}

.jf-404__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.65;
  color: #64748b;
}

.jf-404__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.55rem;
}

.jf-btn--ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  background: #fff;
  color: #0f172a;
  font-size: 0.85rem;
  font-weight: 800;
  text-decoration: none;
}

@media (min-width: 640px) {
  .jf-idx__title {
    font-size: 1.7rem;
  }

  .jf-page__title {
    font-size: 1.85rem;
  }
}

html.dark .jf-idx__head,
html.dark .jf-idx__empty,
html.dark .jf-btn--ghost,
body.dark-mode .jf-idx__head,
body.dark-mode .jf-idx__empty,
body.dark-mode .jf-btn--ghost {
  background: #0f172a;
  border-color: #334155;
}

html.dark .jf-idx__title,
html.dark .jf-page__title,
html.dark .jf-404__title,
body.dark-mode .jf-idx__title,
body.dark-mode .jf-page__title,
body.dark-mode .jf-404__title {
  color: #e2e8f0;
}

html.dark .jf-idx__sub,
html.dark .jf-page__lead,
html.dark .jf-page__content,
html.dark .jf-404__lead,
body.dark-mode .jf-idx__sub,
body.dark-mode .jf-page__lead,
body.dark-mode .jf-page__content,
body.dark-mode .jf-404__lead {
  color: #94a3b8;
}
