/* ==========================================================================
   vinayai.in — Blog Index
   Layers on top of portfolio.css. Load BOTH, in this order:

     <link rel="stylesheet" href="/css/portfolio.css">
     <link rel="stylesheet" href="/css/blog.css">

   Tokens, reset, nav, footer, buttons, chips, tags and the .author card all
   come from portfolio.css / post.css. Nothing is redefined here.

   The .author card at the foot of this page lives in portfolio.css
   (section 15b) so it is shared with the post page — nothing extra to load.

   Drop at /css/blog.css
   ========================================================================== */

/* Page hook for blog-only overrides */
.page-blog { background: var(--bg); }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* --------------------------------------------------------------------------
   1. Blog header
   -------------------------------------------------------------------------- */
.blog-head {
  padding: 52px 0 34px;
  background:
    radial-gradient(820px 380px at 85% -18%, var(--accent-soft) 0%, transparent 62%),
    linear-gradient(180deg, #fdfefe 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line-2);
}

.blog-head__eyebrow {
  font-size: .76rem; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--accent); margin: 0 0 12px;
}

.blog-head__title {
  font-size: clamp(2rem, 4.4vw, 2.85rem);
  font-weight: 800; letter-spacing: -.032em; margin: 0 0 16px;
}

.blog-head__lead {
  font-size: 1.06rem; color: var(--ink-2); line-height: 1.65;
  max-width: 62ch; margin: 0 0 30px;
}

/* --------------------------------------------------------------------------
   2. Search
   -------------------------------------------------------------------------- */
.blog-tools { margin-bottom: 22px; }

.search {
  position: relative;
  display: flex; align-items: center; gap: 8px;
  max-width: 620px;
  background: var(--bg); border: 1.5px solid var(--line);
  border-radius: 10px; padding: 5px 6px 5px 14px;
  box-shadow: var(--sh-1);
  transition: border-color .18s ease, box-shadow .18s ease;
}
.search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(30,111,217,.11);
}
.search__icon {
  width: 18px; height: 18px; flex-shrink: 0;
  fill: none; stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round;
}
.search:focus-within .search__icon { stroke: var(--accent); }

.search__input {
  flex: 1; min-width: 0;
  border: 0; outline: 0; background: none;
  font-family: var(--font); font-size: .96rem; color: var(--ink);
  padding: 9px 4px;
}
.search__input::placeholder { color: var(--ink-3); }
.search__input::-webkit-search-cancel-button { cursor: pointer; }

.search__submit { flex-shrink: 0; }

.search__status {
  font-size: .9rem; color: var(--ink-3); margin: 14px 0 0;
}
.search__status strong { color: var(--ink); }
.search__status em { color: var(--accent); font-style: normal; font-weight: 600; }
.search__clear {
  margin-left: 10px; font-size: .84rem; font-weight: 600;
  color: var(--ink-3); border-bottom: 1px solid var(--line);
}
.search__clear:hover { color: var(--accent); border-color: var(--accent); }

/* --------------------------------------------------------------------------
   3. Tag filters
   -------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; }

.filter {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 7px 14px; border-radius: 100px;
  background: var(--bg); border: 1px solid var(--line);
  font-size: .87rem; font-weight: 500; color: var(--ink-2);
  transition: background .16s ease, border-color .16s ease, color .16s ease;
}
.filter span {
  font-family: var(--mono); font-size: .74rem;
  color: var(--ink-3); background: var(--bg-chip);
  padding: 1px 6px; border-radius: 20px;
}
.filter:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.filter.is-on {
  background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600;
}
.filter.is-on span { background: rgba(255,255,255,.16); color: #cfe0f5; }

/* --------------------------------------------------------------------------
   4. Article list
   -------------------------------------------------------------------------- */
.art-list { display: flex; flex-direction: column; gap: 14px; }
.latest-art + .art-list { margin-top: 14px; }

.art {
  display: grid; grid-template-columns: minmax(0,1fr) 150px;
  gap: 28px; align-items: start;
  padding: 26px 28px; color: inherit;
  background: var(--bg); border: 1px solid var(--line);
  border-radius: var(--r);
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.art:hover {
  border-color: var(--accent); box-shadow: var(--sh-2);
  transform: translateX(3px); color: inherit;
}

.art__main { min-width: 0; }
.art__tags { margin-bottom: 11px; }
.art__tags .tag { margin: 0; }

.art__title {
  font-size: 1.18rem; letter-spacing: -.018em; line-height: 1.36;
  margin: 0 0 9px;
}
.art:hover .art__title { color: var(--accent); }

.art__excerpt {
  font-size: .94rem; color: var(--ink-3); line-height: 1.62; margin: 0;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  line-clamp: 3; overflow: hidden;
}

.art__aside {
  display: flex; flex-direction: column; align-items: flex-end; gap: 5px;
  font-family: var(--mono); font-size: .78rem; color: var(--ink-3);
  padding-top: 3px; text-align: right;
}
.art__read { color: var(--ink-3); opacity: .8; }
.art__go {
  margin-top: 8px; font-size: 1.15rem; color: var(--line);
  transition: color .18s ease, transform .18s ease;
}
.art:hover .art__go { color: var(--accent); transform: translateX(4px); }

/* --------------------------------------------------------------------------
   6. Empty state
   -------------------------------------------------------------------------- */
.empty {
  text-align: center; padding: 72px 24px;
  border: 2px dashed var(--line); border-radius: var(--r-lg);
  background: var(--bg-tint);
}
.empty__icon {
  width: 56px; height: 56px; margin: 0 auto 20px;
  border-radius: 50%; background: var(--bg-chip);
  display: grid; place-items: center;
}
.empty__icon svg {
  width: 26px; height: 26px;
  fill: none; stroke: var(--ink-3); stroke-width: 1.9; stroke-linecap: round;
}
.empty h2 { font-size: 1.25rem; margin-bottom: 8px; }
.empty h2::after { display: none; }
.empty p { color: var(--ink-3); margin-bottom: 22px; }
.empty em { color: var(--accent); font-style: normal; font-weight: 600; }

/* --------------------------------------------------------------------------
   7. Pagination
   -------------------------------------------------------------------------- */
.pagination {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; flex-wrap: wrap;
  margin-top: 42px;
}

.page-btn {
  padding: 9px 18px; border-radius: var(--r-sm);
  border: 1px solid var(--line); background: var(--bg);
  font-size: .89rem; font-weight: 600; color: var(--ink);
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.page-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Disabled state — render as <span class="page-btn is-disabled">, never <a>.
   This is what fixes the page=-1 and past-the-end links. */
.page-btn.is-disabled {
  color: var(--line); border-color: var(--line-2);
  background: var(--bg-tint); cursor: not-allowed; pointer-events: none;
}

.page-nums { display: flex; gap: 6px; }

.page-num {
  min-width: 38px; height: 38px; padding: 0 10px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); border: 1px solid var(--line);
  background: var(--bg); font-size: .89rem; font-weight: 600;
  color: var(--ink-2); font-family: var(--mono);
  transition: border-color .16s ease, color .16s ease, background .16s ease;
}
.page-num:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.page-num.is-current {
  background: var(--navy); border-color: var(--navy); color: #fff;
}

.page-count {
  text-align: center; font-size: .85rem; color: var(--ink-3);
  margin: 16px 0 0;
}
.page-count strong { color: var(--ink-2); }

/* --------------------------------------------------------------------------
   8. Responsive
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
}

@media (max-width: 720px) {
  .blog-head { padding: 34px 0 26px; }
  .blog-head__lead { font-size: 1rem; margin-bottom: 24px; }

  .search { flex-wrap: wrap; padding: 8px; }
  .search__input { flex: 1 1 100%; order: 2; padding: 8px 6px; }
  .search__icon { order: 1; margin-left: 6px; }
  .search__submit { order: 3; width: 100%; justify-content: center; margin-top: 6px; }

  .filters { gap: 6px; }
  .filter { font-size: .82rem; padding: 6px 12px; }

  .art {
    grid-template-columns: 1fr; gap: 14px;
    padding: 22px 20px;
  }
  .art:hover { transform: none; }
  .art__aside {
    flex-direction: row; align-items: center; gap: 10px;
    text-align: left; padding-top: 0;
  }
  .art__go { margin-top: 0; margin-left: auto; }

  .art__title { font-size: 1.08rem; }

  .pagination { gap: 8px; }
  .page-btn { padding: 8px 14px; font-size: .84rem; }
}

@media (max-width: 420px) {
  .page-nums { order: -1; width: 100%; justify-content: center; margin-bottom: 6px; }
  .pagination { gap: 6px; }
  .page-btn { flex: 1; text-align: center; }
}

/* --------------------------------------------------------------------------
   9. Print
   -------------------------------------------------------------------------- */
@media print {
  .search, .filters, .pagination, .nav, .footer__links { display: none; }
  .art { break-inside: avoid; border-color: #ccc; box-shadow: none; }
  a { color: inherit; text-decoration: none; }
}
