/* ============================================================
   DARB — Journal (Blog) styles
   Index grid + post reading pages. Heritage theme.
   Relies on style.css for the shared heritage palette,
   nav/footer components, and category badge classes.
   ============================================================ */

/* Body is a scrolling page (index.html already sets this, but posts load style.css too) */
html { scroll-behavior: smooth; }

/* ---------------- Blog index layout ---------------- */
.blog-shell {
  min-height: 100vh;
  background: var(--bg-ink, #140d08);
  display: flex;
  flex-direction: column;
}

.blog-main {
  flex-grow: 1;
  width: 100%;
  max-width: 1180px;
  margin: 0 auto;
  padding: 120px 28px 80px;
}

/* Hero strip */
.blog-hero {
  text-align: center;
  margin-bottom: 44px;
}

.blog-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 0.85rem;
  letter-spacing: 3px;
  text-transform: uppercase;
  color: var(--gold, #c9a24b);
  font-weight: 600;
  margin-bottom: 18px;
}

.blog-hero-eyebrow .eyebrow-line { width: 44px; height: 1px; background: linear-gradient(90deg, transparent, var(--gold, #c9a24b)); }

.blog-hero h1 {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: clamp(2.4rem, 5vw, 3.8rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: 0.4px;
  color: var(--parchment, #e8d5a4);
  margin-bottom: 16px;
}

.blog-hero .blog-sub {
  font-size: 1.08rem;
  color: #c8b189;
  max-width: 660px;
  margin: 0 auto;
}

/* Filters row */
.blog-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 36px;
  justify-content: flex-start;
  padding: 18px;
  border: 1px solid rgba(201,162,75,0.12);
  border-radius: 14px;
  background: rgba(20, 13, 8, 0.45);
}

.blog-search-wrapper {
  position: relative;
  flex: 1 1 280px;
  max-width: 380px;
}

.blog-search-wrapper .search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #97835f;
  pointer-events: none;
}

.blog-search {
  width: 100%;
  padding: 13px 16px 13px 44px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--border-color, rgba(201,162,75,0.14));
  border-radius: 10px;
  color: var(--text-primary, #efe1be);
  font-family: var(--font-sans, 'Outfit', sans-serif);
  font-size: 0.92rem;
  transition: var(--transition-smooth, all 0.3s);
}
.blog-search:focus { outline: none; border-color: var(--color-prophets, #c9a24b); box-shadow: 0 0 12px rgba(201,162,75,0.18); background: rgba(0,0,0,0.4); }

.blog-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.blog-filter-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 180px;
}

.blog-filter-label {
  color: var(--gold, #c9a24b);
  font: 600 0.72rem var(--font-sans, 'Outfit', sans-serif);
  letter-spacing: 1.6px;
  text-transform: uppercase;
}

.blog-clear-filters {
  align-self: flex-end;
  margin-left: auto;
  padding: 8px 13px;
  border: 1px solid rgba(201,162,75,0.25);
  border-radius: 999px;
  background: transparent;
  color: #c8b189;
  font: 600 0.85rem var(--font-sans, 'Outfit', sans-serif);
  cursor: pointer;
  transition: var(--transition-smooth, all 0.3s);
}
.blog-clear-filters:hover { color: #efe1be; border-color: var(--gold, #c9a24b); background: rgba(201,162,75,0.1); }

.blog-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 0.92rem;
  font-weight: 600;
  padding: 8px 16px;
  border-radius: 30px;
  border: 1px solid var(--border-color, rgba(201,162,75,0.14));
  background: rgba(255, 255, 255, 0.02);
  color: #c8b189;
  cursor: pointer;
  transition: var(--transition-smooth, all 0.3s);
}
.blog-chip:hover { color: #efe1be; border-color: rgba(201,162,75,0.4); background: rgba(201,162,75,0.08); }
.blog-chip.active { border-color: var(--color-prophets, #c9a24b); color: #efe1be; background: rgba(201,162,75,0.14); }
.blog-chip:not(.active) { color: #80715d; border-color: rgba(255,255,255,0.08); }
.blog-chip.chip-cat.active[data-value="Prophets & Messengers"] { border-color: var(--color-prophets, #c9a24b); background: rgba(201,162,75,0.16); }
.blog-chip.chip-cat.active[data-value="Companions (Sahaba)"] { border-color: var(--color-sahaba, #3f7a62); background: rgba(63,122,98,0.18); }
.blog-chip.chip-cat.active[data-value="Followers & Righteous"] { border-color: var(--color-righteous, #5c7080); background: rgba(92,112,128,0.18); }
.blog-chip.chip-cat.active[data-value="Other Historical & Religious Sites"] { border-color: var(--color-other, #b25e42); background: rgba(178,94,66,0.18); }

.blog-chip-mark {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: #665b4b;
  opacity: 0.6;
}
.blog-chip.chip-cat.active[data-value="Prophets & Messengers"] .blog-chip-mark { background: var(--color-prophets, #c9a24b); opacity: 1; }
.blog-chip.chip-cat.active[data-value="Companions (Sahaba)"] .blog-chip-mark { background: var(--color-sahaba, #3f7a62); opacity: 1; }
.blog-chip.chip-cat.active[data-value="Followers & Righteous"] .blog-chip-mark { background: var(--color-righteous, #5c7080); opacity: 1; }
.blog-chip.chip-cat.active[data-value="Other Historical & Religious Sites"] .blog-chip-mark { background: var(--color-other, #b25e42); opacity: 1; }

.blog-count {
  font-size: 0.85rem;
  color: #97835f;
  text-align: center;
  margin-bottom: 26px;
}
.blog-count strong { color: var(--gold, #c9a24b); }

/* Card grid */
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 22px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  background: #241809;
  border: 1px solid var(--border-color, rgba(201,162,75,0.14));
  border-radius: 10px;
  padding: 26px;
  position: relative;
  overflow: hidden;
  text-decoration: none;
  transition: transform 0.25s var(--transition-smooth, all 0.3s), border-color 0.25s var(--transition-smooth, all 0.3s), box-shadow 0.25s var(--transition-smooth, all 0.3s);
}
.blog-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
}
.blog-card.card-prophets::before { background: var(--color-prophets, #c9a24b); }
.blog-card.card-sahaba::before { background: var(--color-sahaba, #3f7a62); }
.blog-card.card-righteous::before { background: var(--color-righteous, #5c7080); }
.blog-card.card-other::before { background: var(--color-other, #b25e42); }

.blog-card:hover {
  transform: translateY(-5px);
  border-color: rgba(201,162,75,0.3);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.4);
}

.blog-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.blog-card-top .card-category-badge { font-size: 0.68rem; }

.blog-card-arrow { color: #97835f; transition: transform 0.25s var(--transition-smooth, all 0.3s), color 0.25s var(--transition-smooth, all 0.3s); }
.blog-card:hover .blog-card-arrow { color: var(--gold, #c9a24b); transform: translateX(4px); }

.blog-card h3 {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: 1.3rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--parchment, #e8d5a4);
  margin-bottom: 12px;
}

.blog-card .blog-card-excerpt {
  font-size: 0.9rem;
  color: #c8b189;
  line-height: 1.65;
  flex-grow: 1;
  margin-bottom: 18px;
}

.blog-card-meta { display: flex; align-items: center; gap: 6px; font-size: 0.8rem; color: #97835f; }
.blog-card-meta i { color: var(--gold, #c9a24b); }

.blog-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #97835f;
}
.blog-empty i { font-size: 2.6rem; display: block; margin-bottom: 14px; opacity: 0.6; }

/* ---------------- Post reading page ---------------- */
.post-main {
  flex-grow: 1;
  width: 100%;
  max-width: 820px;
  margin: 0 auto;
  padding: 120px 28px 60px;
}

.post-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #c8b189;
  text-decoration: none;
  margin-bottom: 30px;
  padding: 8px 14px;
  border: 1px solid var(--border-color, rgba(201,162,75,0.14));
  border-radius: 8px;
  transition: var(--transition-smooth, all 0.3s);
}
.post-back:hover { color: #efe1be; border-color: rgba(201,162,75,0.4); background: rgba(201,162,75,0.08); }

.post-article {
  background: #241809;
  border: 1px solid var(--border-color, rgba(201,162,75,0.14));
  border-radius: 12px;
  padding: 50px 54px;
  box-shadow: inset 0 0 60px rgba(0,0,0,0.3);
}

.post-header { margin-bottom: 34px; padding-bottom: 28px; border-bottom: 1px solid rgba(201,162,75,0.14); }
.post-header .card-category-badge { margin-bottom: 18px; display: inline-block; }

.post-title {
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-size: clamp(1.9rem, 4vw, 2.7rem);
  font-weight: 700;
  line-height: 1.18;
  color: var(--parchment, #e8d5a4);
  margin-bottom: 18px;
}

.post-meta { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; color: #97835f; flex-wrap: wrap; }
.post-meta i { color: var(--gold, #c9a24b); }
.post-dot { opacity: 0.5; }

.post-paragraph {
  font-family: var(--font-sans, 'Outfit', sans-serif);
  font-size: 1.12rem;
  line-height: 1.9;
  color: #c8b189;
}

.post-footer { margin-top: 40px; padding-top: 26px; border-top: 1px solid rgba(201,162,75,0.14); }

.post-view-map {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-weight: 700;
  font-size: 1.05rem;
  padding: 14px 26px;
  border-radius: 6px;
  background: linear-gradient(120deg, var(--gold, #c9a24b), var(--copper, #a4713f));
  color: #241809;
  text-decoration: none;
  transition: transform 0.25s var(--transition-smooth, all 0.3s), box-shadow 0.25s var(--transition-smooth, all 0.3s);
}
.post-view-map:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(201,162,75,0.3); }

.post-nav {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 30px;
}
.post-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-serif, 'Cormorant Garamond', serif);
  font-weight: 700;
  font-size: 1rem;
  color: #c8b189;
  text-decoration: none;
  padding: 12px 18px;
  border: 1px solid var(--border-color, rgba(201,162,75,0.14));
  border-radius: 8px;
  transition: var(--transition-smooth, all 0.3s);
}
.post-nav-link:hover { color: #efe1be; border-color: rgba(201,162,75,0.4); background: rgba(201,162,75,0.08); }

/* ---------------- Responsive ---------------- */
@media (max-width: 720px) {
  .blog-main { padding: 100px 20px 60px; }
  .post-main { padding: 100px 20px 60px; }
  .post-article { padding: 34px 24px; }
  .blog-controls { flex-direction: column; align-items: stretch; }
  .blog-search-wrapper { max-width: none; }
  .blog-filter-block { min-width: 0; }
  .blog-clear-filters { align-self: flex-start; margin-left: 0; }
}

/* Keep the page heroes aligned with the contact and etiquette pages. */
.blog-main { padding-top: 140px; }
.blog-hero { margin-bottom: 48px; }
.blog-hero h1 { font-size: clamp(2.7rem, 5vw, 4.2rem); line-height: 1.1; min-height: 2.2em; display: flex; align-items: center; justify-content: center; }
.blog-hero .blog-sub { line-height: 1.8; }
@media (max-width: 720px) { .blog-main { padding-top: 110px; } }
