/* ============================================================
   Halcyon — Blog index (data-driven, search + filter + paginate)
   Built to scale to 50+ posts with no layout changes.
   ============================================================ */

/* ---------- Search + toolbar (inline: categories lead, quiet search right) ---------- */
.blog-toolbar {
  display: flex; align-items: center; gap: 24px;
  border-bottom: 1.5px solid var(--line);
  padding-bottom: 22px; margin-bottom: 34px;
}
.blog-search {
  position: relative; flex: none; width: 240px;
}
.blog-search i {
  position: absolute; left: 16px; top: 50%; transform: translateY(-50%);
  color: var(--teal); font-size: .9rem; pointer-events: none;
}
.blog-search input {
  width: 100%; font-family: var(--sans); font-size: .92rem; color: var(--ink);
  background: #fff; border: 1.5px solid var(--line); border-radius: 999px;
  padding: 11px 40px 11px 40px;
  transition: border-color .25s, box-shadow .25s;
}
.blog-search input::placeholder { color: var(--ink-soft); }
.blog-search input:focus {
  outline: none; border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(10,147,150,.12);
}
.blog-search .clear {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border: 0; border-radius: 50%; cursor: pointer;
  background: var(--mint); color: var(--green); display: none; place-items: center;
  font-size: .8rem;
}
.blog-search .clear.show { display: grid; }

/* ---------- Category pills ---------- */
.blog-filters {
  display: flex; flex-wrap: wrap; justify-content: flex-start; gap: 10px;
  flex: 1; min-width: 0;
}
.blog-filters button {
  font-family: var(--sans); font-size: .86rem; font-weight: 600;
  color: var(--ink-soft); background: #fff; border: 1.5px solid var(--line);
  border-radius: 999px; padding: 9px 18px; cursor: pointer;
  transition: color .2s, background .2s, border-color .2s, transform .2s var(--ease);
}
.blog-filters button:hover { border-color: var(--teal); color: var(--green); transform: translateY(-2px); }
.blog-filters button.active { background: var(--green); border-color: var(--green); color: #fff; }
.blog-filters button .count { opacity: .6; font-weight: 500; margin-left: 4px; }

/* ---------- Result count ---------- */
.blog-count {
  font-size: .86rem; color: var(--ink-soft);
  letter-spacing: .04em; margin: 0 0 18px;
}
.blog-count strong { color: var(--green); font-weight: 600; }

/* ---------- Featured (latest) article ---------- */
.post-featured {
  display: grid; grid-template-columns: 1.1fr .9fr; overflow: hidden;
  color: inherit; font-weight: 400; border: 1.5px solid var(--line);
}
.post-featured .thumb { overflow: hidden; min-height: 340px; }
.post-featured img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-featured:hover img { transform: scale(1.04); }
.post-featured .body { padding: 52px 48px; display: flex; flex-direction: column; justify-content: center; }
.post-featured h2 { font-size: clamp(1.6rem, 2.8vw, 2.2rem); margin: 10px 0 14px; }
.post-featured p { font-size: 1rem; margin-bottom: 20px; }
.featured-flag {
  display: inline-flex; align-items: center; gap: 8px; align-self: flex-start;
  font-size: .72rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--teal); margin-bottom: 14px;
}
.featured-flag::before { content: "\2726"; font-size: .9rem; }

/* ---------- Grid ---------- */
.post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 24px; }
.post-card { overflow: hidden; color: inherit; font-weight: 400; display: flex; flex-direction: column; padding: 0; border: 1.5px solid var(--line); }
.post-card .thumb { aspect-ratio: 3/2; overflow: hidden; }
.post-card img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s var(--ease); }
.post-card:hover img { transform: scale(1.05); }
.post-card .body { padding: 24px 26px 26px; display: flex; flex-direction: column; flex: 1; }
.post-card h3 { font-size: 1.24rem; margin: 8px 0 10px; line-height: 1.3; }
.post-card p { font-size: .92rem; flex: 1; }

/* card entrance */
.post-card.reveal-card { opacity: 0; transform: translateY(16px); animation: cardIn .5s var(--ease) forwards; }
@media (prefers-reduced-motion: reduce) { .post-card.reveal-card { animation: none; opacity: 1; transform: none; } }
@keyframes cardIn { to { opacity: 1; transform: none; } }

/* ---------- Meta / links ---------- */
.post-meta { display: flex; align-items: center; gap: 10px; font-size: .74rem; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--teal); }
.post-meta .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--teal); flex: none; }
.post-foot { display: flex; align-items: center; gap: 10px; margin-top: 16px; font-size: .78rem; color: var(--ink-soft); }
.post-foot .dotsep { width: 3px; height: 3px; border-radius: 50%; background: var(--ink-soft); }
.read-link { margin-top: 16px; font-size: .9rem; color: var(--teal); font-weight: 600; display: inline-flex; align-items: center; gap: 8px; }
.read-link i { transition: transform .25s var(--ease); font-size: .8rem; }
.post-card:hover .read-link i, .post-featured:hover .read-link i { transform: translateX(4px); }

/* ---------- Highlight matched text ---------- */
mark.hit { background: var(--mint); color: var(--green-deep); border-radius: 3px; padding: 0 2px; }

/* ---------- Load more ---------- */
.blog-more { text-align: center; margin-top: 44px; }
.blog-more.hide { display: none; }

/* ---------- Empty state ---------- */
.blog-empty { text-align: center; padding: 70px 20px; display: none; }
.blog-empty.show { display: block; }
.blog-empty .ring {
  width: 74px; height: 74px; border-radius: 50%; margin: 0 auto 22px;
  background: var(--mint-soft); display: grid; place-items: center; color: var(--teal); font-size: 1.5rem;
}
.blog-empty h3 { font-size: 1.5rem; color: var(--green); margin-bottom: 10px; }
.blog-empty p { max-width: 40ch; margin: 0 auto 20px; }
.blog-empty button {
  font-family: var(--sans); font-weight: 600; font-size: .9rem; color: var(--teal);
  background: none; border: 0; cursor: pointer;
}

@media (max-width: 960px) {
  .post-featured { grid-template-columns: 1fr; }
  .post-featured .thumb { min-height: 0; aspect-ratio: 16/9; width: 100%; }
  .post-featured .body { padding: 34px 28px; }
  .post-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .post-grid { grid-template-columns: 1fr; }
  .blog-toolbar { flex-wrap: wrap; gap: 16px; }
  .blog-search { width: 100%; order: -1; }
  .blog-search input { font-size: .98rem; }
}
