/* ============================================
   SALAF.ID — Main Stylesheet
   Aesthetic: Islamic Manuscript × Modern Editorial
   Palette: Deep green, burnished gold, warm cream
============================================ */

:root {
  --cream:        #faf7f0;
  --cream-dark:   #f2ead8;
  --cream-mid:    #e8dcc4;
  --parchment:    #ede0c4;
  --green-deep:   #1a3a2a;
  --green-mid:    #234d38;
  --green-light:  #2e6349;
  --green-accent: #3d7d5c;
  --green-pale:   #d4e8dc;
  --gold:         #c8963c;
  --gold-bright:  #d4a853;
  --gold-dark:    #a07230;
  --gold-pale:    #f5e8cc;
  --text-dark:    #1e1a14;
  --text-mid:     #3d3528;
  --text-light:   #6b5d48;
  --text-muted:   #7a6d5f;
  --border:       #d8c9a8;
  --border-light: #ede0c4;
  --shadow-sm:    0 2px 8px rgba(26,58,42,.08);
  --shadow-md:    0 4px 20px rgba(26,58,42,.12);
  --shadow-lg:    0 8px 40px rgba(26,58,42,.16);
  --radius:       10px;
  --radius-lg:    16px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--cream);
  color: var(--text-dark);
  font-family: 'Source Sans 3', sans-serif;
  font-size: 16px;
  line-height: 1.7;
}

/* ─── TYPOGRAPHY ─── */
h1, h2, h3, h4 {
  font-family: 'Lora', Georgia, serif;
  line-height: 1.3;
  color: var(--green-deep);
}

.arabic-text, .arabic-quote, .card-arabic, .ayah-arabic, 
.qb-arabic, .arabic-inline, .logo-arabic {
  font-family: 'Amiri', 'Traditional Arabic', serif;
  direction: rtl;
}

/* ─── LAYOUT ─── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ─── HEADER ─── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--green-deep);
  border-bottom: 2px solid var(--gold);
  box-shadow: var(--shadow-md);
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  align-items: center;
  gap: 2rem;
  height: 68px;
}

.logo-block {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  flex-shrink: 0;
}

.logo-arabic {
  font-family: 'Amiri', serif;
  font-size: 2.2rem;
  color: var(--gold);
  line-height: 1;
  direction: rtl;
}

.logo-arabic.small { font-size: 1.6rem; }

.logo-text-block {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.logo-name {
  font-family: 'Lora', serif;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cream);
  letter-spacing: 0.02em;
}

.logo-dot { color: var(--gold); }

.logo-tagline {
  font-size: 0.68rem;
  color: rgba(250,247,240,.55);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
}

.main-nav {
  display: flex;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  color: rgba(250,247,240,.75);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.5rem 0.9rem;
  border-radius: 6px;
  transition: all 0.2s;
}

.nav-link:hover, .nav-link.active {
  color: var(--cream);
  background: rgba(200,150,60,.2);
}

.nav-search-btn {
  background: none;
  border: 1.5px solid rgba(200,150,60,.4);
  color: var(--gold-bright);
  width: 38px; height: 38px;
  border-radius: 8px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}
.nav-search-btn:hover {
  background: rgba(200,150,60,.15);
  border-color: var(--gold);
}

/* ─── ARTICLES BAR ─── */
.main-content { padding-top: 0; }

.articles-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.4rem 0 0;
  gap: 1rem;
  flex-wrap: nowrap;
}

.articles-bar-left {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
}

.articles-bar-title {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  color: var(--green-deep);
}

.articles-bar-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.sf-toggle-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 1.4rem;
  background: white;
  border: 1.5px solid var(--border);
  border-radius: 999px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-mid);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,.07);
}

.sf-toggle-btn:hover {
  border-color: var(--green-accent);
  color: var(--green-mid);
}

.sf-toggle-btn[aria-expanded="true"] {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: white;
}

/* ─── COLLAPSIBLE PANEL ─── */
.sf-panel {
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  transition: max-height 0.32s ease, opacity 0.25s ease, margin 0.32s ease;
  margin-top: 0;
}

.sf-panel.open {
  max-height: 400px;
  opacity: 1;
  margin-top: 0.8rem;
}

.sf-panel-inner {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 1.2rem 1.4rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.sf-search-row { display: flex; gap: 0.5rem; }

.search-wrap {
  display: flex;
  align-items: center;
  background: var(--cream);
  border: 1.5px solid var(--border);
  border-radius: 9px;
  padding: 0.35rem 0.35rem 0.35rem 0.9rem;
  gap: 0.5rem;
  flex: 1;
  transition: border-color 0.2s;
}

.search-wrap:focus-within { border-color: var(--green-accent); }
.sf-search-wrap { margin-bottom: 0; box-shadow: none; }

.search-icon { color: var(--text-muted); flex-shrink: 0; }

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  color: var(--text-dark);
  outline: none;
  min-width: 0;
}

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

.search-btn {
  background: var(--green-deep);
  color: var(--cream);
  border: none;
  padding: 0.55rem 1.2rem;
  border-radius: 7px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.search-btn:hover { background: var(--green-light); }

.sf-filter-row {
  display: flex;
  gap: 1.2rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

/* ─── FILTER shared pieces ─── */
.filter-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.filter-title {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  color: var(--green-deep);
}

.article-count {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.article-count strong { color: var(--green-mid); }

.filter-bar {
  display: flex;
  gap: 1.5rem;
  align-items: flex-end;
  flex-wrap: wrap;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
  min-width: 180px;
}

.filter-label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}

.filter-chips {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.chip {
  padding: 0.4rem 0.9rem;
  border-radius: 100px;
  font-size: 0.83rem;
  font-family: 'Source Sans 3', sans-serif;
  font-weight: 500;
  cursor: pointer;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  transition: all 0.2s;
}

.chip:hover {
  border-color: var(--green-accent);
  color: var(--green-accent);
}

.chip.active {
  background: var(--green-deep);
  border-color: var(--green-deep);
  color: white;
}

.filter-select {
  padding: 0.5rem 0.8rem;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.87rem;
  color: var(--text-mid);
  background: white;
  cursor: pointer;
  outline: none;
  transition: border-color 0.2s;
}

.filter-select:focus { border-color: var(--green-accent); }

.reset-filter {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1rem;
  background: none;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
  font-family: 'Source Sans 3', sans-serif;
}

.reset-filter:hover {
  border-color: var(--gold);
  color: var(--gold-dark);
}

.active-filters {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.af-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
}

.af-chips { display: flex; gap: 0.4rem; flex-wrap: wrap; }

.af-chip {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  background: var(--green-pale);
  border: 1px solid #a8d4b8;
  color: var(--green-mid);
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 600;
}

/* ─── ARTICLE CARDS ─── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  margin-bottom: 4rem;
}

.article-card {
  background: white;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
}

.article-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.article-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--green-deep), var(--gold));
}

.card-link {
  display: block;
  padding: 1.5rem;
  text-decoration: none;
  color: inherit;
}

.coming-soon-link { cursor: default; }
.coming-soon-link:hover ~ .article-card { transform: none; }

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.8rem;
}

.card-badge, .label-badge {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  padding: 0.25rem 0.7rem;
  border-radius: 100px;
}

.tafsir-badge {
  background: rgba(26,58,42,.08);
  color: var(--green-mid);
  border: 1px solid rgba(26,58,42,.15);
}

.hadits-badge {
  background: rgba(200,150,60,.1);
  color: var(--gold-dark);
  border: 1px solid rgba(200,150,60,.25);
}

.surah-badge {
  background: var(--cream-dark);
  color: var(--text-mid);
  border: 1px solid var(--border);
}

.card-surah {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

.card-arabic {
  font-family: 'Amiri', serif;
  font-size: 1.5rem;
  color: var(--green-deep);
  text-align: right;
  direction: rtl;
  line-height: 1.6;
  margin-bottom: 0.7rem;
  padding: 0.5rem 0.7rem;
  background: var(--cream);
  border-radius: 8px;
  border-right: 3px solid var(--gold);
}

.card-title {
  font-family: 'Lora', serif;
  font-size: 1.02rem;
  color: var(--green-deep);
  line-height: 1.4;
  margin-bottom: 0.6rem;
}

.card-excerpt {
  font-size: 0.87rem;
  color: var(--text-light);
  line-height: 1.65;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.card-ulama {
  display: flex;
  gap: 0.3rem;
  flex-wrap: wrap;
}

.ulama-tag {
  font-size: 0.7rem;
  padding: 0.18rem 0.55rem;
  background: var(--gold-pale);
  color: #7a5520;
  border-radius: 100px;
  font-weight: 600;
}

.ulama-more {
  font-size: 0.7rem;
  color: var(--text-muted);
  padding: 0.18rem 0;
}

.card-read {
  font-size: 0.75rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.coming-badge {
  font-size: 0.72rem;
  padding: 0.25rem 0.7rem;
  background: var(--cream-dark);
  color: var(--text-muted);
  border-radius: 100px;
  border: 1px dashed var(--border);
}

/* ─── NO RESULTS ─── */
.no-results {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.no-results-icon { font-size: 3rem; margin-bottom: 1rem; }
.no-results h3 { font-size: 1.2rem; color: var(--text-mid); margin-bottom: 0.5rem; }
.no-results p { margin-bottom: 1.5rem; }

.btn-reset-all {
  padding: 0.7rem 1.5rem;
  background: var(--green-deep);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-reset-all:hover { background: var(--green-light); }

/* ─── ABOUT ─── */
.about-section {
  background: var(--green-deep);
  padding: 5rem 2rem;
  margin-top: 2rem;
}

.about-inner {
  max-width: 700px;
  margin: 0 auto;
  text-align: center;
}

.about-ornament {
  font-size: 2rem;
  color: var(--gold);
  margin-bottom: 1rem;
  display: block;
}

.about-title {
  font-family: 'Lora', serif;
  font-size: 1.8rem;
  color: var(--cream);
  margin-bottom: 1.5rem;
}

.about-text {
  color: rgba(250,247,240,.75);
  font-size: 1rem;
  line-height: 1.8;
  margin-bottom: 1rem;
}

.about-text em { color: var(--gold-bright); font-style: normal; }

.about-note {
  font-family: 'Amiri', serif;
  font-size: 1.3rem;
  color: var(--gold-bright);
  direction: rtl;
  margin-top: 2rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(200,150,60,.25);
}

/* ─── FOOTER ─── */
.site-footer {
  background: #0f2218;
  padding: 2.5rem 2rem;
  border-top: 1px solid rgba(200,150,60,.2);
}

.footer-inner {
  text-align: center;
}

.footer-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.footer-name {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  color: var(--cream);
}

.footer-text {
  font-size: 0.85rem;
  color: rgba(250,247,240,.5);
  margin-bottom: 0.3rem;
}

.footer-copy {
  font-size: 0.78rem;
  color: rgba(250,247,240,.3);
}

/* ─── MAIN CONTENT ─── */
.main-content {
  padding: 0 0 4rem;
}

/* ─── HIDDEN (for filtering) ─── */
.article-card.hidden {
  display: none;
}

/* ─── RESPONSIVE ─── */
@media (max-width: 768px) {
  .header-inner {
    padding: 0.6rem 1rem;
    gap: 0.5rem;
    height: auto;
    flex-wrap: wrap;
  }
  .logo-block { flex: 1; }
  .main-nav {
    display: flex;
    order: 3;
    width: 100%;
    gap: 0;
    border-top: 1px solid rgba(200,150,60,.15);
    padding-top: 0.3rem;
    padding-bottom: 0.15rem;
  }
  .nav-link {
    flex: 1;
    text-align: center;
    font-size: 0.78rem;
    padding: 0.4rem 0.3rem;
  }
  .container { padding: 0 1rem; }
  .filter-bar { flex-direction: column; gap: 1rem; }
  .articles-grid { grid-template-columns: 1fr; }
}
