/*
Theme Name: Ardkawiya Light
Theme URI: https://ardkawiya.com
Author: Ardkawiya
Description: قالب مضيء نظيف لمنصة الأرض كروية — مجلة علمية عربية
Version: 2.0.0
Requires at least: 6.3
Tested up to: 6.6
Requires PHP: 8.1
License: GPL-2.0-or-later
Text Domain: ardkawiya
Tags: rtl-language, science, magazine, light, members, webtv
*/

/* ============================================================
   GOOGLE FONTS + DESIGN TOKENS
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Amiri:ital,wght@0,400;0,700;1,400&family=IBM+Plex+Sans+Arabic:wght@300;400;500;600;700&family=Lora:wght@600;700&display=swap');

:root {
  --white:       #ffffff;
  --bg:          #f7f8fa;
  --bg2:         #eef0f4;
  --surface:     #ffffff;
  --border:      #e2e5eb;
  --border2:     #d0d5de;
  --text:        #1a1d27;
  --text2:       #444c5e;
  --muted:       #7a849a;
  --blue:        #1a56db;
  --blue-light:  #e8f0fe;
  --blue-mid:    #3b6fd4;
  --green:       #0d7a55;
  --green-light: #e6f7f1;
  --red:         #d93025;
  --red-light:   #fce8e8;
  --gold:        #b45309;
  --gold-light:  #fef3c7;
  --live:        #dc2626;

  --font-ar:      'IBM Plex Sans Arabic', 'Tahoma', sans-serif;
  --font-title:   'Amiri', 'Scheherazade New', serif;
  --font-en:      'Lora', Georgia, serif;

  --r:    8px;
  --r2:   12px;
  --r3:   16px;
  --pill: 999px;
  --shadow-sm: 0 1px 4px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
  --shadow:    0 2px 12px rgba(0,0,0,.08), 0 1px 3px rgba(0,0,0,.04);
  --shadow-md: 0 4px 24px rgba(0,0,0,.10), 0 2px 6px rgba(0,0,0,.04);
  --t: all .2s ease;
}

/* ============================================================
   BASE
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { direction: rtl; scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ar);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--blue); text-decoration: none; transition: var(--t); }
a:hover { color: var(--blue-mid); }
img { max-width: 100%; display: block; }

/* ============================================================
   LAYOUT
   ============================================================ */
.container { max-width: 1280px; margin: 0 auto; padding: 0 20px; }

/* 3-column home layout: articles | sidebar */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 32px;
  align-items: start;
  padding: 32px 0 60px;
}
@media (max-width: 1024px) { .home-layout { grid-template-columns: 1fr; } }

/* ============================================================
   HEADER
   ============================================================ */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.header-top {
  background: var(--blue);
  padding: 6px 0;
}
.header-top-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .78rem;
  color: rgba(255,255,255,.85);
}
.header-top-inner a { color: rgba(255,255,255,.85); }
.header-top-inner a:hover { color: #fff; }
.live-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--live);
  color: #fff;
  padding: 2px 9px;
  border-radius: var(--pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.live-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: #fff;
  animation: pulse 1.3s ease-in-out infinite;
}
@keyframes pulse {
  0%,100% { opacity: 1; transform: scale(1); }
  50%      { opacity: .5; transform: scale(1.3); }
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 20px;
  max-width: 1280px;
  margin: 0 auto;
  gap: 20px;
}
.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-globe {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #2563eb 0%, #0ea5e9 50%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  box-shadow: 0 2px 8px rgba(37,99,235,.3);
  flex-shrink: 0;
}
.logo-text-ar {
  font-family: var(--font-title);
  font-size: 1.55rem;
  color: var(--blue);
  line-height: 1.1;
  font-weight: 700;
}
.logo-text-sub {
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .04em;
}

.header-nav {
  display: flex;
  gap: 2px;
  align-items: center;
  flex-wrap: wrap;
}
.header-nav a {
  padding: 7px 14px;
  border-radius: var(--pill);
  color: var(--text2);
  font-size: .88rem;
  font-weight: 500;
  white-space: nowrap;
}
.header-nav a:hover, .header-nav a.current { background: var(--blue-light); color: var(--blue); }

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

.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border-radius: var(--pill);
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--t);
  border: none;
  white-space: nowrap;
  font-family: var(--font-ar);
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-mid); color: #fff; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(26,86,219,.3); }
.btn-outline { background: transparent; color: var(--text2); border: 1px solid var(--border2); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.btn-sm { padding: 6px 14px; font-size: .8rem; }

/* ============================================================
   NEWS TICKER
   ============================================================ */
.ticker-bar {
  background: var(--blue-light);
  border-bottom: 1px solid #c7d7f7;
  overflow: hidden;
  padding: 7px 0;
}
.ticker-inner { display: flex; align-items: center; max-width: 1280px; margin: 0 auto; padding: 0 20px; }
.ticker-tag {
  background: var(--blue);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 3px 12px;
  border-radius: var(--pill);
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: .05em;
}
.ticker-scroll {
  flex: 1;
  overflow: hidden;
  margin-right: 16px;
}
.ticker-content {
  display: inline-flex;
  gap: 48px;
  white-space: nowrap;
  animation: tickScroll 40s linear infinite;
  font-size: .85rem;
  color: var(--text2);
}
.ticker-content a { color: var(--text2); }
.ticker-content a:hover { color: var(--blue); }
.ticker-sep { color: var(--blue); opacity: .4; }
@keyframes tickScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* ============================================================
   CATEGORY NAV BAR
   ============================================================ */
.cat-bar {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0;
  overflow: hidden;
}
.cat-bar-inner {
  display: flex;
  align-items: center;
  gap: 0;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cat-bar-inner::-webkit-scrollbar { display: none; }
.cat-link {
  padding: 12px 18px;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: var(--t);
  text-decoration: none;
}
.cat-link:hover { color: var(--blue); }
.cat-link.active { color: var(--blue); border-bottom-color: var(--blue); font-weight: 600; }

/* ============================================================
   FEATURED ARTICLE (HERO)
   ============================================================ */
.featured-hero {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  overflow: hidden;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
  display: grid;
  grid-template-columns: 1fr 400px;
  min-height: 320px;
}
@media (max-width: 800px) { .featured-hero { grid-template-columns: 1fr; } }
.featured-hero-img {
  position: relative;
  overflow: hidden;
  min-height: 260px;
}
.featured-hero-img img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .5s ease;
}
.featured-hero:hover .featured-hero-img img { transform: scale(1.03); }
.featured-hero-body {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
}
.featured-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--blue-light);
  color: var(--blue);
  padding: 3px 10px;
  border-radius: var(--pill);
  font-size: .72rem;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  align-self: flex-start;
}
.featured-title {
  font-family: var(--font-title);
  font-size: 1.6rem;
  line-height: 1.35;
  color: var(--text);
  font-weight: 700;
}
.featured-title a { color: inherit; }
.featured-title a:hover { color: var(--blue); }
.featured-excerpt { font-size: .9rem; color: var(--text2); line-height: 1.65; }
.featured-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: .8rem;
  color: var(--muted);
}
.featured-meta img {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
}

/* ============================================================
   ARTICLES GRID
   ============================================================ */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--blue);
}
.section-title {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-title::before {
  content: '';
  width: 4px; height: 20px;
  background: var(--blue);
  border-radius: var(--pill);
  display: block;
}
.see-all { font-size: .82rem; color: var(--blue); font-weight: 500; }
.see-all:hover { text-decoration: underline; }

.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
  margin-bottom: 28px;
}
@media (max-width: 700px) { .articles-grid { grid-template-columns: 1fr; } }

/* ============================================================
   ARTICLE CARD
   ============================================================ */
.card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  transition: var(--t);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
}
.card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
  border-color: var(--blue);
}
.card-img {
  position: relative;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg2);
}
.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s ease;
}
.card:hover .card-img img { transform: scale(1.04); }

.card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border-radius: var(--pill);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.badge-blue  { background: var(--blue); color: #fff; }
.badge-green { background: var(--green); color: #fff; }
.badge-gold  { background: var(--gold); color: #fff; }
.badge-red   { background: var(--red); color: #fff; }

/* Card icon placeholder when no image */
.card-icon-ph {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  background: linear-gradient(135deg, var(--blue-light), var(--bg2));
}

.card-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.card-cat {
  font-size: .72rem;
  font-weight: 700;
  color: var(--blue);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.card-title {
  font-family: var(--font-title);
  font-size: 1rem;
  line-height: 1.45;
  color: var(--text);
  font-weight: 700;
  flex: 1;
}
.card-title a { color: inherit; }
.card-title a:hover { color: var(--blue); }
.card-excerpt {
  font-size: .82rem;
  color: var(--text2);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card-footer {
  padding: 10px 16px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .76rem;
  color: var(--muted);
}
.card-footer img {
  width: 22px; height: 22px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border);
}
.card-footer strong { color: var(--text2); }

/* Editor overlay for logged-in editors */
.card-edit-bar {
  display: none;
  padding: 8px 12px;
  background: var(--blue-light);
  border-top: 1px solid #c7d7f7;
  gap: 6px;
}
.card:hover .card-edit-bar { display: flex; }
.edit-link {
  font-size: .75rem;
  color: var(--blue);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--pill);
  background: var(--white);
  border: 1px solid var(--border2);
  cursor: pointer;
}
.edit-link:hover { background: var(--blue); color: #fff; border-color: var(--blue); }

/* NEW badge */
.new-badge {
  background: var(--red);
  color: #fff;
  font-size: .65rem;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: var(--pill);
  letter-spacing: .06em;
  flex-shrink: 0;
}

/* ============================================================
   LIST-STYLE ARTICLE (for secondary articles)
   ============================================================ */
.article-list-item {
  display: flex;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
  align-items: flex-start;
}
.article-list-item:last-child { border-bottom: none; }
.ali-num {
  font-family: var(--font-en);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--border2);
  line-height: 1;
  min-width: 32px;
  text-align: center;
  flex-shrink: 0;
}
.ali-body { flex: 1; }
.ali-cat { font-size: .7rem; font-weight: 700; color: var(--blue); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.ali-title { font-family: var(--font-title); font-size: .95rem; line-height: 1.4; color: var(--text); font-weight: 700; }
.ali-title a { color: inherit; }
.ali-title a:hover { color: var(--blue); }
.ali-meta { font-size: .74rem; color: var(--muted); margin-top: 5px; }
.ali-thumb {
  width: 72px; height: 52px;
  border-radius: var(--r);
  object-fit: cover;
  border: 1px solid var(--border);
  flex-shrink: 0;
  background: var(--bg2);
}

/* ============================================================
   SIDEBAR
   ============================================================ */
.sidebar { display: flex; flex-direction: column; gap: 20px; }

.widget {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r2);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.widget-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: .9rem;
  color: var(--text);
  background: var(--bg);
}
.widget-icon { font-size: 1rem; }
.widget-body { padding: 16px 18px; }

/* WebTV widget */
.webtv-widget { overflow: hidden; }
.webtv-player {
  aspect-ratio: 16/9;
  background: #000;
  position: relative;
}
.webtv-player iframe { width: 100%; height: 100%; border: none; }
.webtv-placeholder {
  width: 100%; height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: linear-gradient(135deg, #0f172a, #1e3a5f);
}
.webtv-play-btn {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--live);
  border: none;
  color: #fff;
  font-size: 20px;
  cursor: pointer;
  transition: var(--t);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 0 20px rgba(220,38,38,.4);
}
.webtv-play-btn:hover { transform: scale(1.1); }

.stream-list { padding: 8px 0; }
.stream-item {
  display: flex;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: var(--t);
  border-bottom: 1px solid var(--border);
  align-items: center;
}
.stream-item:hover { background: var(--bg); }
.stream-item.active { background: var(--blue-light); }
.stream-thumb-mini {
  width: 56px; height: 32px;
  border-radius: 6px;
  background: var(--bg2);
  object-fit: cover;
  flex-shrink: 0;
  overflow: hidden;
}
.stream-info { flex: 1; min-width: 0; }
.stream-title-mini { font-size: .82rem; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stream-source-mini { font-size: .72rem; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 4px; }

/* Editors widget */
.editors-scroll {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 14px 18px;
}
.editor-mini {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: var(--r);
  transition: var(--t);
  text-decoration: none;
}
.editor-mini:hover { background: var(--bg); }
.editor-mini-avatar {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2px solid var(--border);
  object-fit: cover;
  flex-shrink: 0;
}
.editor-mini-name { font-weight: 600; font-size: .88rem; color: var(--text); }
.editor-mini-role { font-size: .74rem; color: var(--muted); margin-top: 1px; }
.editor-mini-socials { display: flex; gap: 4px; margin-top: 4px; }
.social-dot {
  width: 20px; height: 20px;
  border-radius: 50%;
  font-size: .6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  transition: var(--t);
}
.social-dot:hover { transform: scale(1.2); }
.sd-tw { background: #1da1f2; }
.sd-fb { background: #1877f2; }
.sd-yt { background: #ff0000; }
.sd-tt { background: #010101; }

/* Newsletter widget */
.newsletter-widget { padding: 20px 18px; text-align: center; }
.newsletter-widget p { font-size: .85rem; color: var(--text2); margin-bottom: 14px; }
.newsletter-widget input {
  width: 100%;
  border: 1px solid var(--border2);
  border-radius: var(--pill);
  padding: 9px 16px;
  font-family: var(--font-ar);
  font-size: .88rem;
  color: var(--text);
  margin-bottom: 8px;
  background: var(--bg);
  outline: none;
  direction: rtl;
  transition: var(--t);
}
.newsletter-widget input:focus { border-color: var(--blue); background: #fff; }

/* ============================================================
   SINGLE ARTICLE
   ============================================================ */
.article-wrap { max-width: 820px; }
.article-top-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.article-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  border-radius: var(--pill);
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .05em;
}
.tag-blue  { background: var(--blue-light); color: var(--blue); }
.tag-green { background: var(--green-light); color: var(--green); }
.tag-gold  { background: var(--gold-light); color: var(--gold); }

.article-title-main {
  font-family: var(--font-title);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  line-height: 1.3;
  color: var(--text);
  margin-bottom: 20px;
}
.article-byline {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
  flex-wrap: wrap;
}
.byline-author {
  display: flex;
  align-items: center;
  gap: 9px;
}
.byline-author img {
  width: 38px; height: 38px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}
.byline-author-name { font-weight: 600; font-size: .9rem; color: var(--text); }
.byline-date { font-size: .8rem; color: var(--muted); }
.byline-read { font-size: .8rem; color: var(--muted); }

.article-content {
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--text2);
}
.article-content p { margin-bottom: 1.4em; }
.article-content h2 {
  font-family: var(--font-title);
  font-size: 1.45rem;
  color: var(--text);
  margin: 2.5em 0 .8em;
  padding-right: 14px;
  border-right: 4px solid var(--blue);
}
.article-content h3 {
  font-family: var(--font-title);
  font-size: 1.2rem;
  color: var(--text);
  margin: 2em 0 .6em;
}
.article-content blockquote {
  background: var(--bg);
  border-right: 4px solid var(--blue);
  padding: 16px 20px;
  margin: 2em 0;
  border-radius: 0 var(--r2) var(--r2) 0;
  font-style: italic;
  color: var(--text2);
}
.info-box {
  background: var(--blue-light);
  border: 1px solid #c7d7f7;
  border-radius: var(--r2);
  padding: 20px;
  margin: 2em 0;
}
.info-box-title {
  font-weight: 700;
  color: var(--blue);
  margin-bottom: 8px;
  font-size: .95rem;
}
.embed-wrap {
  aspect-ratio: 16/9;
  border-radius: var(--r2);
  overflow: hidden;
  margin: 2em 0;
  background: #000;
}
.embed-wrap iframe { width: 100%; height: 100%; border: none; }

/* ============================================================
   EDITORS FULL SECTION (homepage bottom)
   ============================================================ */
.editors-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--r3);
  padding: 28px;
  margin-bottom: 28px;
  box-shadow: var(--shadow-sm);
}
.editors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.editor-card {
  border: 1px solid var(--border);
  border-radius: var(--r2);
  padding: 20px 16px;
  text-align: center;
  transition: var(--t);
  background: var(--bg);
  text-decoration: none;
  display: block;
}
.editor-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
  background: var(--white);
  transform: translateY(-2px);
}
.editor-card-avatar {
  width: 72px; height: 72px;
  border-radius: 50%;
  border: 3px solid var(--blue-light);
  object-fit: cover;
  margin: 0 auto 12px;
  display: block;
}
.editor-card-name { font-family: var(--font-title); font-size: 1rem; color: var(--text); font-weight: 700; margin-bottom: 3px; }
.editor-card-role { font-size: .75rem; color: var(--blue); font-weight: 600; margin-bottom: 8px; }
.editor-card-spec { font-size: .78rem; color: var(--muted); margin-bottom: 12px; }
.editor-card-socials { display: flex; justify-content: center; gap: 6px; }

/* ============================================================
   FOOTER
   ============================================================ */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,.7);
  padding: 48px 0 24px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}
@media (max-width: 900px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 500px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand-name { font-family: var(--font-title); font-size: 1.4rem; color: #fff; margin-bottom: 10px; }
.footer-brand-desc { font-size: .85rem; line-height: 1.7; }
.footer-col-title { font-size: .78rem; font-weight: 700; color: rgba(255,255,255,.9); text-transform: uppercase; letter-spacing: .1em; margin-bottom: 14px; }
.footer-links { list-style: none; }
.footer-links li { margin-bottom: 9px; }
.footer-links a { font-size: .85rem; color: rgba(255,255,255,.6); transition: var(--t); }
.footer-links a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .8rem;
  flex-wrap: wrap;
  gap: 10px;
}
.footer-socials { display: flex; gap: 8px; }
.footer-social-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  color: rgba(255,255,255,.7);
  transition: var(--t);
  text-decoration: none;
}
.footer-social-btn:hover { background: rgba(255,255,255,.2); color: #fff; }

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  padding: 20px 0;
}
.page-link {
  width: 36px; height: 36px;
  border-radius: var(--r);
  border: 1px solid var(--border2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .85rem;
  color: var(--text2);
  transition: var(--t);
  text-decoration: none;
  background: var(--white);
}
.page-link:hover, .page-link.current {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

/* ============================================================
   SEARCH MODAL
   ============================================================ */
.search-modal {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,.96);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 120px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s;
  backdrop-filter: blur(8px);
}
.search-modal.open { opacity: 1; pointer-events: all; }
.search-modal-box { width: min(640px, 92vw); position: relative; }
.search-modal-input {
  width: 100%;
  border: 2px solid var(--blue);
  border-radius: var(--pill);
  padding: 16px 24px;
  font-size: 1.1rem;
  font-family: var(--font-ar);
  color: var(--text);
  background: var(--white);
  outline: none;
  direction: rtl;
  box-shadow: var(--shadow-md);
}
.search-close {
  position: absolute;
  top: -48px;
  left: 0;
  background: none;
  border: none;
  font-size: 1.1rem;
  color: var(--muted);
  cursor: pointer;
}
.search-results { margin-top: 16px; background: var(--white); border-radius: var(--r2); box-shadow: var(--shadow-md); border: 1px solid var(--border); overflow: hidden; }
.search-result-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--border); cursor: pointer; transition: var(--t); }
.search-result-item:hover { background: var(--bg); }
.search-result-item img { width: 50px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.search-result-title { font-size: .9rem; font-weight: 600; color: var(--text); }
.search-result-excerpt { font-size: .78rem; color: var(--muted); margin-top: 2px; }

/* ============================================================
   READING PROGRESS
   ============================================================ */
.reading-progress { position: fixed; top: 0; right: 0; height: 3px; width: 0%; background: var(--blue); z-index: 9999; transition: width .1s linear; }

/* ============================================================
   SCROLL TOP
   ============================================================ */
.scroll-top {
  position: fixed;
  bottom: 28px;
  left: 28px;
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  border: none;
  cursor: pointer;
  font-size: .9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 12px rgba(26,86,219,.35);
  transition: var(--t);
  opacity: 0;
  z-index: 88;
}
.scroll-top.visible { opacity: 1; }
.scroll-top:hover { transform: translateY(-3px); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .header-nav { display: none; }
  .featured-hero { grid-template-columns: 1fr; }
  .articles-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   TIKTOK FEED BLOCK — sidebar homepage
   ============================================================ */
.tiktok-feed-block .widget-head i.fa-tiktok {
  color: #010101;
}

/* Wrapper du feed injecté par FTS / Ninja — uniformise l'affichage */
.tiktok-feed-inner {
  overflow: hidden;
}

/* Force les grilles FTS/Ninja à s'adapter à la largeur de la sidebar */
.tiktok-feed-inner .fts-tiktok-videos-wrap,
.tiktok-feed-inner .nf-tiktok-wrap,
.tiktok-feed-inner [class*="tiktok"],
.tiktok-feed-inner [class*="ninja"],
.tiktok-feed-inner [class*="social-feed"] {
  width: 100% !important;
  max-width: 100% !important;
}

/* Grille interne : 2 colonnes dans la sidebar */
.tiktok-feed-inner .fts-tiktok-video-wrap,
.tiktok-feed-inner .nf-item {
  width: calc(50% - 4px) !important;
  float: left !important;
  margin: 0 4px 4px 0 !important;
}

/* Notice plugin manquant */
.tt-notice-missing {
  font-size: .82rem;
  color: var(--muted);
  padding: 12px 16px;
  margin: 0;
  background: var(--bg2);
  border-radius: var(--r);
  line-height: 1.5;
}

/* Fallback : bloc lien profil */
.tt-fallback-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg2);
  border-radius: var(--r);
  margin: 8px 12px;
}
.tt-fallback-icon {
  width: 40px; height: 40px;
  background: #010101;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.tt-fallback-icon i { color: #fff; font-size: 1.1rem; }
.tt-fallback-text {
  flex: 1;
  display: flex; flex-direction: column; gap: 2px;
}
.tt-fallback-text strong { font-size: .9rem; color: var(--text); }
.tt-fallback-text span   { font-size: .78rem; color: var(--muted); }
.btn-tt-goto {
  background: #010101;
  color: #fff;
  padding: 7px 14px;
  border-radius: var(--pill);
  font-size: .8rem;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity .2s;
}
.btn-tt-goto:hover { opacity: .8; color: #fff; }
