/**
 * Phase 0 shell layout — structural chrome only.
 */

/*
 * حارس تموضع: أسماء الأسطح (jf-fahras · jf-404 …) تُضاف كذلك إلى <body>،
 * فأي قاعدة تحمل نفس الاسم قد تحصر الصفحة كلها. العرض ملك .jf-main وحده.
 */
body.janoob-figma {
  max-width: none;
  margin-inline: 0;
}

.jf-header {
  position: relative;
  top: auto;
  z-index: 40;
  background: var(--jf-card);
  border-bottom: 2px solid var(--jf-primary);
  box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

@media (min-width: 1024px) {
  .jf-header {
    position: sticky;
    top: 0;
  }
}

.jf-header__inner {
  max-width: var(--jf-max);
  margin: 0 auto;
  padding: 0 1rem;
  height: var(--jf-header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.jf-brand {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
  text-decoration: none;
  color: inherit;
}

.jf-brand__logo {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  display: block;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.12);
}

.jf-brand__mark {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--jf-primary);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
}

.jf-brand__text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  min-width: 0;
}

.jf-brand__name {
  font-size: 0.98rem;
  font-weight: 900;
  color: var(--jf-ink);
  white-space: nowrap;
  letter-spacing: -0.01em;
}

@media (max-width: 360px) {
  .jf-brand__name {
    font-size: 0.88rem;
  }
}

.jf-brand__tag {
  font-size: 0.62rem;
  font-weight: 500;
  color: var(--jf-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.jf-header__tools {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.jf-icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.35rem 0.45rem;
  border-radius: 6px;
  color: var(--jf-muted);
}

.jf-theme-toggle {
  position: relative;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
}

.jf-theme-icon {
  display: block;
}

.jf-theme-icon--sun {
  display: none;
}

html.dark .jf-theme-icon--moon {
  display: none;
}

html.dark .jf-theme-icon--sun {
  display: block;
}

.jf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  font-family: var(--jf-font);
  font-weight: 700;
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
}

.jf-btn--primary {
  background: var(--jf-primary);
  color: var(--jf-primary-fg);
}

.jf-search-panel {
  border-top: 1px solid var(--jf-border);
  padding: 0.65rem 1rem;
  max-width: var(--jf-max);
  margin: 0 auto;
}

.jf-search-panel[hidden] {
  display: none !important;
}

.jf-search-form {
  display: flex;
  gap: 0.5rem;
}

.jf-search-form input[type="search"] {
  flex: 1;
  padding: 0.55rem 0.9rem;
  border-radius: var(--jf-radius-pill);
  border: 1px solid var(--jf-border);
  background: var(--jf-bg);
  font-family: var(--jf-font);
  font-size: 0.82rem;
  color: var(--jf-text);
  outline: none;
}

.jf-main {
  max-width: var(--jf-max);
  margin: 0 auto;
  padding: 1rem 1rem 5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.jf-section__head {
  margin-bottom: 0.35rem;
}

.jf-section__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 900;
}

.jf-news-river {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.jf-card {
  background: var(--jf-card);
  border: 1px solid var(--jf-border);
  border-radius: var(--jf-radius-card);
  overflow: hidden;
}

.jf-card__media {
  display: block;
  aspect-ratio: 16 / 9;
  background: #1a1a1a;
  overflow: hidden;
}

.jf-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.jf-card__body {
  padding: 0.75rem 0.9rem 0.9rem;
}

.jf-hero__link {
  color: inherit;
  text-decoration: none;
}

.jf-hero__link:hover,
.jf-hero__link:focus-visible {
  text-decoration: underline;
}

.jf-ticker-card a,
.jf-ticker-list__text a,
.jf-micro-item__title a {
  color: inherit;
  text-decoration: none;
}

.jf-ticker-card a:hover,
.jf-ticker-list__text a:hover,
.jf-micro-item__title a:hover {
  color: var(--jf-primary);
}

.jf-card__title {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.55;
}

.jf-card__title a {
  color: inherit;
  text-decoration: none;
}

.jf-card__meta {
  margin: 0;
  font-size: 0.75rem;
  color: var(--jf-muted);
  font-weight: 600;
}

.jf-placeholder {
  padding: 1rem;
  border: 1px dashed var(--jf-border);
  border-radius: var(--jf-radius-card);
  background: var(--jf-card);
  color: var(--jf-muted);
  font-size: 0.82rem;
  font-weight: 700;
  text-align: center;
}

.jf-ticker {
  background: var(--jf-primary);
  color: #fff;
  border-radius: var(--jf-radius-card);
  padding: 0.55rem 0.85rem;
  font-size: 0.78rem;
  font-weight: 700;
}

.jf-hero {
  position: relative;
  border-radius: var(--jf-radius-card);
  overflow: hidden;
  min-height: 200px;
  background: linear-gradient(145deg, #8b0008, var(--jf-primary) 55%, #3a0004);
  color: #fff;
  padding: 1.35rem 1.15rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 0.4rem;
}

.jf-hero__badge {
  align-self: flex-start;
  background: #fff;
  color: var(--jf-primary);
  font-size: 0.72rem;
  font-weight: 900;
  padding: 0.2rem 0.7rem;
  border-radius: var(--jf-radius-pill);
}

.jf-hero__title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1.45;
}

.jf-hero__meta {
  margin: 0;
  font-size: 0.78rem;
  opacity: 0.8;
}

.jf-chips {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.jf-chips::-webkit-scrollbar {
  display: none;
}

.jf-chip {
  flex-shrink: 0;
  padding: 0.3rem 0.85rem;
  border-radius: var(--jf-radius-pill);
  border: 1.5px solid var(--jf-border);
  background: var(--jf-card);
  color: var(--jf-muted);
  font-family: var(--jf-font);
  font-weight: 600;
  font-size: 0.75rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}

.jf-chip.is-active {
  border-color: var(--jf-primary);
  background: color-mix(in srgb, var(--jf-primary) 12%, transparent);
  color: var(--jf-primary);
  font-weight: 700;
}

.jf-pulse-tabs {
  display: flex;
  gap: 0.45rem;
  overflow-x: auto;
  scrollbar-width: none;
  margin-bottom: 0.75rem;
}

.jf-pulse-tabs::-webkit-scrollbar {
  display: none;
}

.jf-pulse-tab {
  flex-shrink: 0;
  padding: 0.4rem 0.85rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: none;
  font-family: var(--jf-font);
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--jf-muted);
  cursor: pointer;
}

.jf-pulse-tab.is-active {
  color: var(--jf-primary);
  border-bottom-color: var(--jf-primary);
}

.jf-pulse-panel__more {
  margin: 0.55rem 0 0;
  text-align: start;
}

.jf-pulse-panel__more a {
  font-size: 0.75rem;
  font-weight: 800;
  color: var(--jf-primary);
  text-decoration: none;
}

.jf-micro-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.jf-micro-item {
  display: flex;
  gap: 0.55rem;
  align-items: flex-start;
  padding: 0.65rem 0.75rem;
  background: var(--jf-card);
  border: 1px solid var(--jf-border);
  border-radius: 8px;
}

.jf-micro-item__emoji {
  font-size: 1.1rem;
  line-height: 1;
}

.jf-micro-item__title {
  margin: 0 0 0.2rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.jf-micro-item__meta {
  margin: 0;
  font-size: 0.7rem;
  color: var(--jf-muted);
  font-weight: 600;
}

.jf-midan-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.jf-midan-cell {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 1.15rem 0.5rem;
  min-height: 5.25rem;
  border: none;
  background: var(--jf-card);
  border-inline-end: 1px solid var(--jf-border);
  border-bottom: 1px solid var(--jf-border);
  font-family: var(--jf-font);
  font-weight: 700;
  font-size: 0.72rem;
  color: var(--jf-text);
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: color-mix(in srgb, var(--jf-primary) 18%, transparent);
  transition: background 0.15s ease, transform 0.15s ease;
}
.jf-midan-cell__icon {
  font-size: 1.35rem;
  line-height: 1;
}
.jf-midan-cell__label {
  text-align: center;
  line-height: 1.25;
}
.jf-midan-cell:hover {
  background: color-mix(in srgb, var(--jf-primary) 6%, var(--jf-card));
}
.jf-midan-cell:active {
  transform: scale(0.98);
}

.jf-midan-cell:nth-child(3n) {
  border-inline-end: none;
}

.jf-midan-cell:nth-child(n + 4) {
  border-bottom: none;
}

.jf-midan-head {
  background: var(--jf-primary);
  color: #fff;
  padding: 0.7rem 1rem;
  font-weight: 900;
  font-size: 0.88rem;
  border-radius: var(--jf-radius-card) var(--jf-radius-card) 0 0;
}

.jf-footer {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--jf-border);
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--jf-bg) 88%, var(--jf-card)) 0%,
    color-mix(in srgb, var(--jf-card) 92%, #0b3d5c08) 100%
  );
  padding: 0 0 calc(5.75rem + env(safe-area-inset-bottom, 0px));
}

.jf-footer__inner {
  max-width: var(--jf-max);
  margin: 0 auto;
  padding-inline: 1rem;
  text-align: right;
}

.jf-footer__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.35rem 1.1rem;
  padding: 1.65rem 0 0.75rem;
}

@media (min-width: 640px) {
  .jf-footer__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem 1.25rem;
    padding-top: 2rem;
  }
}

.jf-footer__title {
  margin: 0 0 0.65rem;
  font-size: 0.8rem;
  font-weight: 900;
  color: var(--jf-ink, var(--jf-text));
  letter-spacing: -0.01em;
}

.jf-footer__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.jf-footer__list a {
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--jf-muted);
  text-decoration: none;
  line-height: 1.35;
}

.jf-footer__list a:hover,
.jf-footer__list a:focus-visible {
  color: var(--jf-ink, var(--jf-text));
}

.jf-footer__bottom {
  margin-top: 0.75rem;
  padding: 1.15rem 0 1.35rem;
  border-top: 1px solid var(--jf-border);
  text-align: center;
}

.jf-footer__brand {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
  font-weight: 900;
  color: var(--jf-ink, var(--jf-text));
  letter-spacing: -0.02em;
}

.jf-footer__note {
  margin: 0;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--jf-muted);
  line-height: 1.45;
}

.jf-footer__hint {
  margin: 0.4rem 0 0;
  font-size: 0.65rem;
  color: var(--jf-muted);
  font-weight: 700;
}

html.dark .jf-footer {
  background: linear-gradient(180deg, #0f1720 0%, #0c1218 100%);
}
html.dark .jf-footer__title,
html.dark .jf-footer__brand {
  color: #e8eef3;
}
html.dark .jf-footer__list a:hover,
html.dark .jf-footer__list a:focus-visible {
  color: #fff;
}

.jf-article__title {
  margin: 0 0 0.5rem;
  font-size: 1.45rem;
  font-weight: 900;
}

.jf-article__meta {
  margin: 0 0 1rem;
  color: var(--jf-muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.jf-article__content {
  font-size: 1rem;
  line-height: 1.75;
}

/* Breadcrumbs — Lab shell (FLOWS §10 · parent collector) */
.jf-breadcrumbs {
  border-bottom: 1px solid color-mix(in srgb, var(--jf-border, #e5e7eb) 80%, transparent);
  background: color-mix(in srgb, var(--jf-bg, #fafafa) 92%, var(--jf-card, #fff));
}

.jf-breadcrumbs__inner {
  max-width: var(--jf-max);
  padding-block: 0.45rem;
}

.jf-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem 0.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--jf-muted, #6b7280);
}

.jf-breadcrumbs__link {
  color: inherit;
  text-decoration: none;
}

.jf-breadcrumbs__link:hover {
  color: var(--jf-primary, #e3000f);
}

.jf-breadcrumbs__current {
  color: var(--jf-fg, #111);
  font-weight: 800;
  max-width: 14rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  display: inline-block;
  vertical-align: bottom;
}

.jf-breadcrumbs__sep {
  padding-inline: 0.2rem;
  opacity: 0.45;
  font-weight: 400;
}

/* ——— M1 Agency shell ——— */
.jf-home--agency {
  gap: calc(var(--jf-space) * 1.5);
}

.jf-section--agency .jf-section__title {
  font-size: 1.1rem;
  letter-spacing: -0.01em;
}

.jf-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.jf-hero__badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.35);
  animation: jf-pulse 1.6s ease-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .jf-hero__badge-dot {
    animation: none;
  }
}

@keyframes jf-pulse {
  0% { opacity: 1; transform: scale(1); }
  70% { opacity: 0.45; transform: scale(0.85); }
  100% { opacity: 1; transform: scale(1); }
}

/* Banner slots — live placements */
.jf-ad {
  position: relative;
  max-width: var(--jf-max);
  margin-inline: auto;
  padding: calc(var(--jf-space) * 0.75) var(--jf-pad-x);
}

.jf-ad__badge {
  position: absolute;
  inset-block-start: calc(var(--jf-space) * 1.25);
  inset-inline-start: calc(var(--jf-pad-x) + 6px);
  z-index: 1;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.jf-ad__link {
  display: block;
  border-radius: var(--jf-radius-card);
  overflow: hidden;
  border: 1px solid var(--jf-border);
  background: var(--jf-card);
}

.jf-ad__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 120px;
  object-fit: contain;
  background: var(--jf-card);
}

.jf-ad--header .jf-ad__img {
  max-height: 90px;
}

.jf-ad--inline {
  padding-inline: 0;
  max-width: none;
}

.jf-ad--sticky_bottom {
  position: sticky;
  bottom: calc(var(--jf-dock-h) + env(safe-area-inset-bottom, 0px));
  z-index: 35;
  max-width: none;
  margin: 0;
  padding: 0;
  background: var(--jf-card);
  border-top: 1px solid var(--jf-border);
  box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.06);
}

.jf-ad--sticky_bottom .jf-ad__badge {
  inset-block-start: 6px;
}

.jf-ad--sticky_bottom .jf-ad__img {
  max-height: 56px;
  object-fit: cover;
  width: 100%;
}

/* VIP business (plan meta) */
.jf-vip {
  background: var(--jf-card);
  border: 1px solid var(--jf-border);
  border-radius: var(--jf-radius-card);
  overflow: hidden;
}

.jf-vip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--jf-space);
  padding: calc(var(--jf-space) * 1.25) calc(var(--jf-space) * 1.5);
  border-bottom: 1px solid var(--jf-border);
}

.jf-vip__badge {
  font-size: 0.68rem;
  font-weight: 900;
  color: var(--jf-accent);
  letter-spacing: 0.06em;
}

.jf-vip__more {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--jf-primary);
  text-decoration: none;
}

.jf-vip__card {
  display: block;
  text-decoration: none;
  color: inherit;
}

.jf-vip__img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: var(--jf-bg);
}

.jf-vip__ph {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #8b0008, var(--jf-primary) 55%, #3a0004);
  color: #fff;
  font-size: 2.5rem;
  font-weight: 900;
}

.jf-vip__title {
  display: block;
  padding: calc(var(--jf-space) * 1.25) calc(var(--jf-space) * 1.5);
  font-size: 0.95rem;
  font-weight: 800;
  line-height: var(--jf-lh-title);
}

/* Dock — touch targets (Blueprint) */
.jf-dock {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 45;
  display: flex;
  align-items: stretch;
  justify-content: space-around;
  min-height: var(--jf-dock-h);
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: var(--jf-card);
  border-top: 1px solid var(--jf-border);
  box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.06);
}

.jf-dock__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--jf-touch);
  padding: 0.35rem 0.2rem;
  text-decoration: none;
  color: var(--jf-muted);
  font-family: var(--jf-font);
}

.jf-dock__item.is-active {
  color: var(--jf-primary);
}

.jf-dock__icon {
  font-size: 1.05rem;
  line-height: 1;
}

.jf-dock__label {
  font-size: 0.62rem;
  font-weight: 800;
}

body.has-jf-dock {
  padding-bottom: calc(var(--jf-dock-h) + env(safe-area-inset-bottom, 0px));
}
