/* NABAT THEME */
:root {
  --primary:       #2e7d32;
  --primary-light: #66bb6a;
  --primary-dark:  #1b5e20;
}

/* ═══════════════════════════════════════════════════
   Dictionary Sites — Shared CSS
   Color theme driven by CSS variables set per-site
   ═══════════════════════════════════════════════════ */

/* ── CSS Variables (overridden per-site via <style> in <head>) ── */
:root {
  --primary:       #5d4037;
  --primary-light: #8d6e63;
  --primary-dark:  #3e2723;
  --accent:        #d4a017;
  --accent-light:  #f9e79f;
  --bg:            #fdfcf8;
  --bg-card:       #ffffff;
  --text:          #1a1a2e;
  --text-muted:    #5d6d7e;
  --border:        #e8dcc8;
  --shadow:        0 2px 12px rgba(0,0,0,0.07);
  --shadow-hover:  0 8px 30px rgba(0,0,0,0.14);
  --radius:        12px;
  --radius-sm:     8px;
  --font-main:     'Cairo', 'Tahoma', sans-serif;
  --font-serif:    'Amiri', serif;
  --max-width:     1200px;
}

/* ── Reset ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font-main);
  background: var(--bg);
  color: var(--text);
  direction: rtl;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; }

/* ── Layout ── */
.container { max-width: var(--max-width); margin: 0 auto; padding: 0 20px; }

/* ══════════════════════════════════
   HEADER
══════════════════════════════════ */
.site-header {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  position: sticky; top: 0; z-index: 1000;
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 20px; max-width: var(--max-width); margin: 0 auto;
}
.site-logo {
  display: flex; align-items: center; gap: 12px; text-decoration: none;
}
.logo-icon {
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.logo-text { color: white; }
.logo-name    { display: block; font-size: 1.2rem; font-weight: 800; line-height: 1.2; }
.logo-tagline { display: block; font-size: 0.72rem; opacity: 0.75; }

/* Nav */
.main-nav { display: flex; gap: 6px; align-items: center; }
.main-nav a {
  color: rgba(255,255,255,0.88); text-decoration: none;
  padding: 8px 16px; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 600;
  border: 1px solid rgba(255,255,255,0.2);
  transition: all 0.2s;
}
.main-nav a:hover, .main-nav a.active {
  background: rgba(255,255,255,0.18); color: var(--accent-light);
  border-color: rgba(255,255,255,0.4);
}
.hamburger {
  display: none; background: none; border: none;
  cursor: pointer; padding: 8px; color: white; font-size: 24px;
}

/* ══════════════════════════════════
   HERO
══════════════════════════════════ */
.hero {
  background: linear-gradient(160deg, var(--primary-dark) 0%, var(--primary) 55%, var(--primary-light) 100%);
  color: white; text-align: center; padding: 70px 20px 80px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 50%, rgba(255,255,255,0.05) 0%, transparent 60%),
              radial-gradient(circle at 80% 20%, rgba(255,255,255,0.04) 0%, transparent 50%);
}
.hero-content { position: relative; z-index: 1; }
.hero-emoji   { font-size: 4rem; display: block; margin-bottom: 16px; }
.hero h1      { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 900; margin-bottom: 14px; }
.hero h1 span { color: var(--accent-light); }
.hero p       { font-size: clamp(0.95rem, 2vw, 1.15rem); opacity: 0.88; max-width: 600px; margin: 0 auto 32px; }
.hero-stats   { display: flex; justify-content: center; gap: 40px; flex-wrap: wrap; }
.stat-num     { font-size: 2.2rem; font-weight: 900; color: var(--accent-light); display: block; }
.stat-label   { font-size: 0.82rem; opacity: 0.8; }

/* ══════════════════════════════════
   SEARCH BAR
══════════════════════════════════ */
.search-section {
  background: white; padding: 28px 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.07);
}
.search-wrap {
  max-width: 600px; margin: 0 auto;
  display: flex; border-radius: 50px; overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.12);
  border: 2px solid var(--primary);
}
.search-wrap input {
  flex: 1; padding: 13px 22px;
  font-family: var(--font-main); font-size: 0.97rem;
  border: none; outline: none; direction: rtl; background: white;
}
.search-wrap button {
  padding: 13px 26px; background: var(--primary); color: white;
  border: none; cursor: pointer;
  font-family: var(--font-main); font-size: 0.92rem; font-weight: 700;
  transition: background 0.2s;
}
.search-wrap button:hover { background: var(--primary-dark); }

.search-dropdown {
  max-width: 600px; margin: 6px auto 0;
  background: white; border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover); display: none;
  max-height: 280px; overflow-y: auto; position: relative; z-index: 200;
}
.search-dropdown.show { display: block; }
.search-drop-item {
  padding: 11px 20px; cursor: pointer;
  border-bottom: 1px solid var(--border); transition: background 0.15s;
}
.search-drop-item:last-child { border-bottom: none; }
.search-drop-item:hover { background: #f0f7ff; }
.search-drop-item a { text-decoration: none; color: var(--text); display: flex; align-items: center; gap: 10px; }
.drop-letter-badge {
  font-size: 0.7rem; padding: 2px 8px; border-radius: 20px; font-weight: 700;
  background: var(--accent-light); color: #7d6608;
}

/* ══════════════════════════════════
   SECTION TITLES
══════════════════════════════════ */
.section-title { text-align: center; margin-bottom: 36px; }
.section-title h2 { font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 800; color: var(--primary); margin-bottom: 6px; }
.section-title p  { color: var(--text-muted); font-size: 0.95rem; }
.section-divider  { width: 70px; height: 4px; background: linear-gradient(90deg, var(--accent), var(--primary-light)); border-radius: 2px; margin: 10px auto 0; }

/* ══════════════════════════════════
   LETTERS GRID
══════════════════════════════════ */
.letters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 10px; margin-bottom: 40px;
}
.letter-btn {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 14px 8px; background: white;
  border: 2px solid var(--border); border-radius: var(--radius-sm);
  text-decoration: none; color: var(--primary);
  font-weight: 800; font-size: 1.4rem; font-family: var(--font-serif);
  transition: all 0.2s;
}
.letter-btn small { font-size: 0.62rem; color: var(--text-muted); font-family: var(--font-main); font-weight: 400; margin-top: 3px; }
.letter-btn:hover, .letter-btn.active {
  background: var(--primary); color: white; border-color: var(--primary);
  transform: translateY(-3px); box-shadow: var(--shadow);
}
.letter-btn:hover small, .letter-btn.active small { color: rgba(255,255,255,0.75); }

/* ══════════════════════════════════
   ITEMS GRID (cards)
══════════════════════════════════ */
.items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.item-card {
  background: white; border-radius: var(--radius);
  border: 1px solid var(--border); padding: 20px;
  text-decoration: none; color: var(--text);
  transition: all 0.25s; display: flex; flex-direction: column; gap: 8px;
}
.item-card:hover {
  border-color: var(--primary); box-shadow: var(--shadow-hover);
  transform: translateY(-4px);
}
.item-card-name    { font-size: 1.35rem; font-weight: 800; color: var(--primary); font-family: var(--font-serif); }
.item-card-preview { font-size: 0.82rem; color: var(--text-muted); line-height: 1.5; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-card-badge   { font-size: 0.7rem; background: var(--accent-light); color: #7d6608; padding: 3px 10px; border-radius: 20px; align-self: flex-start; }

/* ══════════════════════════════════
   SINGLE ITEM PAGE
══════════════════════════════════ */
.item-hero {
  background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary) 100%);
  color: white; padding: 50px 20px; text-align: center; margin-bottom: 40px;
}
.item-title { font-size: clamp(2.5rem, 6vw, 4.5rem); font-weight: 900; font-family: var(--font-serif); margin-bottom: 10px; }
.item-subtitle { font-size: 1rem; opacity: 0.85; }
.item-badges   { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
.item-badge    { padding: 6px 18px; border-radius: 25px; font-size: 0.82rem; font-weight: 600; background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.35); color: white; }

/* Content layout */
.content-grid { display: grid; grid-template-columns: 1fr 300px; gap: 32px; align-items: start; }
.info-card {
  background: white; border-radius: var(--radius); padding: 28px;
  border: 1px solid var(--border); margin-bottom: 24px; box-shadow: var(--shadow);
}
.info-card h2 { font-size: 1.15rem; font-weight: 700; color: var(--primary); margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid var(--accent-light); }
.info-card p  { color: var(--text); line-height: 1.9; }
.info-grid    { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.info-row     { background: #f8f9fa; padding: 12px 14px; border-radius: var(--radius-sm); }
.info-label   { font-size: 0.72rem; color: var(--text-muted); font-weight: 600; display: block; }
.info-value   { font-size: 0.92rem; font-weight: 700; color: var(--text); }

/* Sidebar */
.sidebar { position: sticky; top: 80px; }
.sidebar-widget {
  background: white; border-radius: var(--radius); padding: 22px;
  border: 1px solid var(--border); margin-bottom: 22px; box-shadow: var(--shadow);
}
.sidebar-widget h3 { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-bottom: 14px; padding-bottom: 8px; border-bottom: 2px solid var(--accent-light); }
.sidebar-widget ul { list-style: none; }
.sidebar-widget ul li { border-bottom: 1px solid #f0f0f0; }
.sidebar-widget ul li:last-child { border-bottom: none; }
.sidebar-widget ul li a { display: flex; align-items: center; gap: 8px; padding: 8px 0; text-decoration: none; color: var(--text); font-size: 0.88rem; transition: color 0.2s; }
.sidebar-widget ul li a:hover { color: var(--primary); }
.sidebar-widget ul li a::before { content: '›'; color: var(--accent); font-weight: 700; }

/* ══════════════════════════════════
   BREADCRUMB
══════════════════════════════════ */
.breadcrumb { padding: 12px 0; border-bottom: 1px solid var(--border); margin-bottom: 28px; }
.breadcrumb ol { display: flex; align-items: center; gap: 8px; list-style: none; flex-wrap: wrap; }
.breadcrumb ol li a { color: var(--primary-light); text-decoration: none; font-size: 0.86rem; }
.breadcrumb ol li a:hover { text-decoration: underline; }
.breadcrumb ol li span { font-size: 0.86rem; color: var(--text-muted); }
.breadcrumb .separator { color: var(--text-muted); font-size: 0.7rem; }

/* ══════════════════════════════════
   ADS
══════════════════════════════════ */
.ad-container {
  background: #f8f9fa; border: 1px dashed var(--border);
  border-radius: var(--radius-sm); padding: 4px;
  text-align: center; margin: 26px 0; min-height: 90px;
  position: relative;
}
.ad-container::before {
  content: 'إعلان'; display: block;
  font-size: 0.62rem; color: var(--text-muted); margin-bottom: 2px;
}

/* ══════════════════════════════════
   FOOTER
══════════════════════════════════ */
.site-footer {
  background: #0d1b2a; color: rgba(255,255,255,0.78);
  padding: 48px 0 20px; margin-top: 60px;
}
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 30px; margin-bottom: 36px; }
.footer-logo { font-size: 1.1rem; font-weight: 800; color: white; margin-bottom: 12px; }
.footer-col p { font-size: 0.83rem; line-height: 1.7; }
.footer-col h4 { color: white; font-size: 0.95rem; margin-bottom: 14px; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: 7px; }
.footer-col ul li a { color: rgba(255,255,255,0.62); text-decoration: none; font-size: 0.83rem; transition: color 0.2s; }
.footer-col ul li a:hover { color: var(--accent); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.1); padding-top: 18px; text-align: center; font-size: 0.8rem; }
.footer-bottom a { color: var(--accent); text-decoration: none; }

/* ══════════════════════════════════
   BACK TO TOP + UTILS
══════════════════════════════════ */
#backToTop {
  position: fixed; bottom: 24px; left: 24px;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--primary); color: white;
  border: none; cursor: pointer; font-size: 18px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.25);
  opacity: 0; transform: translateY(10px);
  transition: opacity .3s, transform .3s;
  z-index: 998; display: flex; align-items: center; justify-content: center;
}
#backToTop.visible { opacity: 1; transform: translateY(0); }
#backToTop:hover   { background: var(--primary-dark); }

.main-section { padding: 48px 0; }
.no-results   { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.no-results .big-emoji { font-size: 3rem; display: block; margin-bottom: 14px; }
.btn-primary {
  display: inline-block; padding: 13px 32px;
  background: var(--primary); color: white; border-radius: 50px;
  text-decoration: none; font-weight: 700; transition: all .2s;
}
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* ══════════════════════════════════
   RESPONSIVE
══════════════════════════════════ */
@media (max-width: 900px) {
  .content-grid { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  .hamburger { display: block; }
  .main-nav {
    display: none; flex-direction: column; gap: 4px;
    position: absolute; top: 68px; right: 0; left: 0;
    background: var(--primary); padding: 10px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.2);
  }
  .main-nav.open { display: flex; }
  .main-nav a { padding: 11px 18px; }
  .header-inner { position: relative; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .info-grid   { grid-template-columns: 1fr; }
  .hero-stats  { gap: 24px; }
}
@media (max-width: 480px) {
  .hero { padding: 48px 16px 56px; }
  .footer-grid { grid-template-columns: 1fr; }
  .letters-grid { grid-template-columns: repeat(auto-fill, minmax(62px,1fr)); }
  #backToTop { bottom: 14px; left: 14px; width: 38px; height: 38px; font-size: 15px; }
}
