/*
 Theme Name:   FluxPress Child
 Theme URI:    https://fluxpress.net
 Description:  Thème enfant GeneratePress pour FluxPress — portail d'actualités RTL rapide, clair/sombre, recherche rapide, barre de catégories et encadré « اقرأ أيضًا ».
 Author:       FluxPress Studio
 Template:     generatepress
 Version:      1.1.0
 Text Domain:  fluxpress-child
*/

:root {
  --fp-bg: #070b14;
  --fp-surface: #0e1525;
  --fp-surface-2: #141e33;
  --fp-border: rgba(148, 163, 184, 0.16);
  --fp-text: #f1f5f9;
  --fp-muted: #94a3b8;
  --fp-accent: #e11d48;
  --fp-accent-soft: rgba(225, 29, 72, 0.16);
  --fp-font: 'IBM Plex Sans Arabic', 'Cairo', system-ui, -apple-system, sans-serif;
}

html[data-fp-theme="light"] {
  --fp-bg: #f8fafc;
  --fp-surface: #ffffff;
  --fp-surface-2: #f1f5f9;
  --fp-border: rgba(15, 23, 42, 0.12);
  --fp-text: #0f172a;
  --fp-muted: #475569;
  --fp-accent: #c81e3a;
  --fp-accent-soft: rgba(200, 30, 58, 0.1);
}

body.rtl,
[dir="rtl"] {
  font-family: var(--fp-font);
  background-color: var(--fp-bg);
  color: var(--fp-text);
  margin: 0;
}

.fp-wrap,
.fp-wrap *,
.fp-topbar-wrap,
.fp-topbar-wrap * {
  font-family: var(--fp-font);
  box-sizing: border-box;
}

.fp-wrap {
  max-width: 1360px;
  margin-inline: auto;
  padding: 16px 20px 48px;
}

/* Barre supérieure des catégories + recherche rapide + نهاري / ليلي */
.fp-topbar-wrap {
  position: sticky;
  top: 0;
  z-index: 900;
  background: var(--fp-bg);
  border-bottom: 1px solid var(--fp-border);
}

.fp-topbar-inner {
  max-width: 1360px;
  margin-inline: auto;
  padding: 8px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.fp-topbar-nav-scroll {
  flex: 1;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}

.fp-topbar-nav-scroll::-webkit-scrollbar {
  display: none;
}

.fp-topbar-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.fp-topbar-link,
.fp-topbar-menu a {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--fp-text);
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  white-space: nowrap;
  transition: 0.15s ease;
}

.fp-topbar-link:hover,
.fp-topbar-link.is-active,
.fp-topbar-menu a:hover,
.fp-topbar-menu .current-menu-item > a {
  background: var(--fp-accent);
  border-color: var(--fp-accent);
  color: #fff;
}

.fp-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.fp-search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.fp-search-input {
  width: 190px;
  padding: 6px 12px 6px 34px;
  border-radius: 999px;
  border: 1px solid var(--fp-border);
  background: var(--fp-surface);
  color: var(--fp-text);
  font-family: var(--fp-font);
  font-size: 0.88rem;
  outline: none;
  transition: width 0.2s ease, border-color 0.15s ease;
}

.fp-search-input:focus {
  width: 240px;
  border-color: var(--fp-accent);
}

.fp-search-input::placeholder {
  color: var(--fp-muted);
}

.fp-search-submit {
  position: absolute;
  inset-inline-end: 6px;
  background: transparent;
  border: 0;
  color: var(--fp-muted);
  cursor: pointer;
  font-size: 0.88rem;
  padding: 4px;
  line-height: 1;
}

.fp-search-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  inset-inline-end: 0;
  width: min(360px, 88vw);
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: 16px;
  padding: 8px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.35);
  z-index: 1200;
}

.fp-search-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border-radius: 12px;
  text-decoration: none;
  color: var(--fp-text);
  transition: background 0.15s ease;
}

.fp-search-item:hover {
  background: var(--fp-surface-2);
}

.fp-search-thumb {
  width: 52px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.fp-search-meta-wrap {
  min-width: 0;
  flex: 1;
}

.fp-search-meta {
  font-size: 0.75rem;
  color: var(--fp-muted);
}

.fp-search-title {
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.fp-search-empty {
  padding: 12px;
  font-size: 0.86rem;
  color: var(--fp-muted);
  text-align: center;
}

.fp-search-all {
  display: block;
  margin-top: 6px;
  padding: 8px 10px;
  border-top: 1px solid var(--fp-border);
  text-align: center;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--fp-accent);
  text-decoration: none;
}

.fp-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--fp-surface-2);
  color: var(--fp-text);
  border: 1px solid var(--fp-border);
  font-family: var(--fp-font);
  font-size: 0.88rem;
  font-weight: 700;
  white-space: nowrap;
  flex-shrink: 0;
  cursor: pointer;
  transition: 0.15s ease;
}

.fp-theme-toggle:hover {
  border-color: var(--fp-accent);
}

/* Bandeau عاجل */
.fp-breaking {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(90deg, #450a14 0%, #1c0c14 100%);
  border: 1px solid rgba(225, 29, 72, 0.35);
  border-radius: 14px;
  padding: 10px 14px;
  margin-bottom: 18px;
  color: #fff;
}

.fp-breaking-badge {
  background: var(--fp-accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.85rem;
  padding: 5px 12px;
  border-radius: 999px;
  white-space: nowrap;
}

.fp-breaking-controls {
  display: flex;
  gap: 6px;
}

.fp-breaking-btn {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.fp-breaking-text {
  flex: 1;
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fp-breaking-counter {
  font-size: 0.85rem;
  color: #fecdd3;
  white-space: nowrap;
}

/* En-tête de section : النبض الإخباري */
.fp-pulse-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: 18px;
  padding: 16px 20px;
  margin-bottom: 20px;
}

.fp-pulse-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fp-pulse-mark {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--fp-accent);
  color: #fff;
  font-weight: 800;
  font-size: 1.25rem;
  display: grid;
  place-items: center;
}

.fp-pulse-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
}

.fp-pulse-sub {
  margin: 2px 0 0;
  font-size: 0.88rem;
  color: var(--fp-muted);
}

.fp-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fp-cat-btn {
  background: var(--fp-surface-2);
  color: var(--fp-text);
  border: 1px solid var(--fp-border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s ease;
}

.fp-cat-btn.is-active,
.fp-cat-btn:hover {
  background: var(--fp-accent);
  border-color: var(--fp-accent);
  color: #fff;
}

/* Grille principale : آخر التطورات + الخبر الرئيسي */
.fp-grid {
  display: grid;
  grid-template-columns: 360px 1fr;
  gap: 20px;
  align-items: start;
}

.fp-sidebar,
.fp-hero {
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: 20px;
  padding: 18px;
}

.fp-sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--fp-border);
}

.fp-sidebar-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
}

.fp-live-pill {
  font-size: 0.78rem;
  color: #fda4af;
  background: var(--fp-accent-soft);
  padding: 3px 9px;
  border-radius: 999px;
  font-weight: 700;
}

.fp-feed-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 14px;
  background: var(--fp-surface-2);
  border: 1px solid transparent;
  margin-bottom: 12px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.fp-feed-item:last-child {
  margin-bottom: 0;
}

.fp-feed-item:hover {
  border-color: var(--fp-accent);
  transform: translateY(-1px);
}

.fp-feed-thumb {
  width: 78px;
  height: 62px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #1e293b;
}

.fp-feed-meta {
  font-size: 0.78rem;
  color: var(--fp-muted);
  margin-bottom: 4px;
}

.fp-feed-heading {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 700;
  line-height: 1.45;
}

.fp-hero-media {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #0f172a;
  margin-bottom: 16px;
}

.fp-hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.fp-hero-tags {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  font-size: 0.85rem;
}

.fp-badge-live {
  background: var(--fp-accent);
  color: #fff;
  padding: 3px 10px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
}

.fp-badge-cat {
  background: var(--fp-surface-2);
  color: var(--fp-text);
  padding: 3px 10px;
  border-radius: 6px;
  border: 1px solid var(--fp-border);
}

.fp-hero-title {
  margin: 0 0 10px;
  font-size: clamp(1.35rem, 2.4vw, 2rem);
  font-weight: 800;
  line-height: 1.35;
}

.fp-hero-title a {
  color: inherit;
  text-decoration: none;
}

.fp-hero-excerpt {
  margin: 0;
  color: var(--fp-muted);
  font-size: 0.98rem;
  line-height: 1.7;
}

/* Barre de progression de lecture */
.fp-reading-progress-wrap {
  position: fixed;
  top: 0;
  inset-inline: 0;
  height: 4px;
  background: transparent;
  z-index: 9999;
}

.fp-reading-progress-bar {
  height: 100%;
  width: 0;
  background: var(--fp-accent);
  transition: width 0.08s linear;
}

/* Fil d'Ariane & Article Single */
.fp-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.85rem;
  color: var(--fp-muted);
  margin-bottom: 16px;
}

.fp-breadcrumb a {
  color: var(--fp-text);
  text-decoration: none;
}

.fp-article-card {
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: 20px;
  padding: 24px;
  margin-bottom: 28px;
}

.fp-article-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.fp-article-meta {
  font-size: 0.88rem;
  color: var(--fp-muted);
}

.fp-article-title {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 3vw, 2.35rem);
  font-weight: 800;
  line-height: 1.35;
}

.fp-article-lead {
  margin: 0 0 18px;
  font-size: 1.08rem;
  line-height: 1.65;
  color: var(--fp-muted);
}

.fp-article-author-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: 14px;
  border-block: 1px solid var(--fp-border);
  margin-bottom: 20px;
}

.fp-author-info {
  display: flex;
  align-items: center;
  gap: 12px;
}

.fp-author-avatar {
  border-radius: 999px;
}

.fp-author-name {
  display: block;
  font-size: 0.95rem;
}

.fp-author-role {
  font-size: 0.82rem;
  color: var(--fp-muted);
}

.fp-article-cover {
  margin: 0 0 24px;
  border-radius: 16px;
  overflow: hidden;
  background: var(--fp-surface-2);
}

.fp-article-cover img {
  width: 100%;
  height: auto;
  display: block;
}

.fp-article-cover figcaption {
  padding: 10px 14px;
  font-size: 0.84rem;
  color: var(--fp-muted);
}

.fp-article-content {
  max-width: 72ch;
  margin-inline: auto;
  font-size: 1.08rem;
  line-height: 1.85;
}

.fp-article-content p {
  margin-bottom: 1.25em;
}

/* Encadré mid-article : اقرأ أيضًا */
.fp-mid-read {
  margin: 24px 0;
  padding: 14px 16px;
  border-radius: 16px;
  background: var(--fp-surface-2);
  border: 1px solid var(--fp-border);
  border-inline-start: 4px solid var(--fp-accent);
}

.fp-mid-read-tag {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.fp-mid-read-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--fp-text);
}

.fp-mid-read-thumb {
  width: 68px;
  height: 52px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
}

.fp-mid-read-title {
  flex: 1;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.45;
}

.fp-mid-read-arrow {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--fp-accent);
}

.fp-article-tags {
  max-width: 72ch;
  margin: 24px auto 0;
  padding-top: 16px;
  border-top: 1px solid var(--fp-border);
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.fp-article-tags a {
  background: var(--fp-surface-2);
  color: var(--fp-text);
  border: 1px solid var(--fp-border);
  padding: 4px 12px;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.85rem;
}

/* Articles liés */
.fp-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.fp-section-heading {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
}

.fp-section-link {
  color: var(--fp-accent);
  text-decoration: none;
  font-weight: 700;
  font-size: 0.92rem;
}

.fp-related-grid,
.fp-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.fp-related-card,
.fp-cat-card {
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: 16px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.fp-related-thumb img,
.fp-cat-card-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}

.fp-related-body,
.fp-cat-card-body {
  padding: 14px 16px;
}

.fp-related-title,
.fp-cat-card-title {
  margin: 6px 0 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.45;
}

.fp-cat-card-title a,
.fp-cat-featured-title a {
  color: inherit;
  text-decoration: none;
}

.fp-cat-card-excerpt {
  margin: 8px 0 0;
  font-size: 0.88rem;
  color: var(--fp-muted);
  line-height: 1.55;
}

/* Page Catégorie supérieure */
.fp-cat-hero {
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: 20px;
  padding: 22px;
  margin-bottom: 22px;
}

.fp-cat-hero-top {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.fp-cat-title {
  margin: 8px 0 6px;
  font-size: clamp(1.5rem, 2.8vw, 2.1rem);
  font-weight: 800;
}

.fp-cat-desc {
  color: var(--fp-muted);
  max-width: 65ch;
  line-height: 1.6;
}

.fp-cat-count {
  background: var(--fp-surface-2);
  border: 1px solid var(--fp-border);
  padding: 8px 14px;
  border-radius: 12px;
  font-weight: 700;
  font-size: 0.9rem;
}

.fp-subcats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--fp-border);
}

.fp-cat-featured {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 20px;
  align-items: center;
  background: var(--fp-surface);
  border: 1px solid var(--fp-border);
  border-radius: 20px;
  padding: 18px;
  margin-bottom: 22px;
}

.fp-cat-featured-media img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
  display: block;
}

.fp-cat-featured-title {
  margin: 10px 0;
  font-size: clamp(1.25rem, 2.2vw, 1.75rem);
  font-weight: 800;
  line-height: 1.35;
}

.fp-pagination {
  margin-top: 28px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.fp-pagination .page-numbers {
  background: var(--fp-surface);
  color: var(--fp-text);
  border: 1px solid var(--fp-border);
  padding: 8px 14px;
  border-radius: 10px;
  text-decoration: none;
  font-weight: 700;
}

.fp-pagination .page-numbers.current {
  background: var(--fp-accent);
  border-color: var(--fp-accent);
  color: #fff;
}

@media (max-width: 960px) {
  .fp-grid {
    grid-template-columns: 1fr;
  }

  .fp-sidebar {
    order: 2;
  }

  .fp-hero {
    order: 1;
  }
}

@media (max-width: 900px) {
  .fp-related-grid,
  .fp-cat-grid {
    grid-template-columns: 1fr;
  }

  .fp-cat-featured {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .fp-search-input,
  .fp-search-input:focus {
    width: 135px;
  }
}
