/*
 * Home Page — Premium CSS
 * File: assets/css/home.css
 *
 * Accent palette variables come from jekyll-theme-chirpy.css (global).
 * Chirpy CSS vars used: --main-bg, --sidebar-bg, --text-color,
 *   --heading-color, --main-border-color, --link-color, --text-muted-color
 *
 * No gem files duplicated. Works with Chirpy 6.5.
 */

/* ══════════════════════════════════════════════
   1. POST GRID  —  2-column auto-fill
══════════════════════════════════════════════ */

#post-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 1.2rem;
  margin-top: 2rem;
  align-items: start;
}

/* Remove per-card bottom margin — gap handles spacing */
#post-list .card-wrapper,
#post-list .card-wrapper:not(:last-child) {
  margin-bottom: 0 !important;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* ══════════════════════════════════════════════
   2. CARD BASE — border, radius, hover
══════════════════════════════════════════════ */

#post-list .card {
  border: 1px solid var(--main-border-color) !important;
  background: var(--main-bg) !important;
  border-radius: 16px !important;
  overflow: hidden;
  height: 100%;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

#post-list .card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 32px rgba(0,0,0,.12);
  border-color: var(--c-blue) !important;
}

/* ══════════════════════════════════════════════
   3. CARD LAYOUT  — image top, content below
   Override Bootstrap's flex-md-row-reverse so
   image sits at top and body fills remaining space.
══════════════════════════════════════════════ */

#post-list .post-preview.row {
  flex-direction: column !important;
  height: 100%;
}

/* Every direct div child → full-width, stacked */
#post-list .post-preview.row > div {
  flex: 0 0 auto !important;
  max-width: 100% !important;
  width: 100% !important;
}

/* The text/body div grows to fill card height */
#post-list .post-preview.row > div.col-md-7,
#post-list .post-preview.row > div.col-md-12 {
  flex: 1 1 auto !important;
  display: flex;
  flex-direction: column;
}

/* ══════════════════════════════════════════════
   4. CARD IMAGE
══════════════════════════════════════════════ */

#post-list .post-preview img {
  width: 100%;
  height: 172px;
  object-fit: cover;
  display: block;
  border-radius: 0;
  transition: transform .35s ease;
}

#post-list .card:hover .post-preview img {
  transform: scale(1.03);
}

/* ══════════════════════════════════════════════
   5. CARD BODY TYPOGRAPHY
══════════════════════════════════════════════ */

#post-list .card-body {
  padding: 1.2rem 1.3rem 1rem !important;
  flex: 1;
  display: flex;
  flex-direction: column;
}

#post-list .card-title {
  font-size: 1.02rem !important;
  font-weight: 700 !important;
  letter-spacing: -0.013em;
  line-height: 1.45;
  margin: 0 0 .55rem !important;
  color: var(--heading-color) !important;
  /* 2-line clamp */
  display: -webkit-box !important;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  text-overflow: unset !important;
  white-space: normal !important;
}

#post-list .card-text.content {
  flex: 1;
  margin-bottom: .75rem !important;
  margin-top: 0 !important;
}

#post-list .card-text p {
  font-size: .86rem;
  line-height: 1.62;
  color: var(--text-muted-color) !important;
  /* 3-line clamp */
  display: -webkit-box !important;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden !important;
  text-overflow: unset !important;
  white-space: normal !important;
  margin: 0;
}

/* ══════════════════════════════════════════════
   6. POST META  — date, category, pin badge
══════════════════════════════════════════════ */

#post-list .post-meta {
  font-size: .77rem !important;
  margin-top: auto;
  padding-top: .65rem;
  border-top: 1px solid var(--main-border-color);
}

#post-list .post-meta i {
  opacity: .65;
}

#post-list .post-meta .categories {
  font-size: .74rem;
  font-weight: 600;
  color: var(--c-blue) !important;
  letter-spacing: 0.01em;
}

/* Pinned badge */
#post-list .pin {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: .68rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--c-amber-bg);
  color: var(--c-amber);
  border: 1px solid var(--c-amber);
  white-space: nowrap;
}

/* ══════════════════════════════════════════════
   7. TRENDING TAG PILLS (home page)
══════════════════════════════════════════════ */

#panel-wrapper .post-tag {
  font-size: .73rem !important;
  padding: 2px 10px !important;
  border-radius: 20px !important;
  font-weight: 500 !important;
  margin: 0 .35rem .35rem 0 !important;
  transition: background .2s, border-color .2s, color .2s !important;
}

/* ══════════════════════════════════════════════
   8. PAGINATION IMPROVEMENTS
══════════════════════════════════════════════ */

.pagination {
  font-family: 'Inter', sans-serif !important;
  margin-top: 2rem;
}

.pagination .page-link {
  border-radius: 8px !important;
  font-size: .85rem !important;
  font-weight: 500 !important;
  transition: all .2s !important;
}

/* ══════════════════════════════════════════════
   10. RESPONSIVE
══════════════════════════════════════════════ */

/* Single column on very narrow screens */
@media (max-width: 560px) {
  #post-list {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

/* At medium widths ensure 2-col looks clean */
@media (min-width: 561px) and (max-width: 830px) {
  #post-list {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  }
}

/* Sidebar visible breakpoint — slightly more generous min card size */
@media (min-width: 1200px) {
  #post-list {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.3rem;
  }
}
