/* ==============================================================
   GENIUS HOST · LATEST BLOG POSTS WIDGET
   Loaded after style.css. Every rule is scoped to .gh-latest-posts / .gh-lp-*
   and reuses the site's existing tokens (--gh-*), section heading (.section-heading,
   .kicker), buttons (.btn .btn-gh-ghost), glass card surface and breakpoints
   (991.98px / 575.98px). No new colours, fonts or global selectors.
   Markup and options: see assets/js/gh-latest-posts.js and README.md.
   ============================================================== */

/* The widget section uses the site's normal section spacing. Inside a page that is
   already a .section, add class "gh-latest-posts--embedded" to drop the extra padding. */
.gh-latest-posts { padding: 84px 0; }
.gh-latest-posts.gh-latest-posts--embedded { padding: 0; }
@media (max-width: 767.98px) { .gh-latest-posts { padding: 58px 0; } }

/* heading keeps the site's section-heading look at any level (h2 by default) */
.gh-latest-posts .section-heading .gh-lp-heading { margin: 9px 0 12px; font-size: clamp(1.75rem, 3.6vw, 2.6rem); line-height: 1.15; letter-spacing: -.03em; font-weight: 800; color: var(--gh-navy); }
.page-dark .gh-latest-posts .section-heading .gh-lp-heading { color: #fff; }

/* ---------- grid ---------- */
.gh-lp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; list-style: none; margin: 0; padding: 0; }
.gh-lp-grid[data-cols="1"] { grid-template-columns: minmax(0, 420px); justify-content: center; }
.gh-lp-grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 420px)); justify-content: center; }
.gh-lp-grid > li { display: flex; min-width: 0; }
@media (max-width: 991.98px) {
  .gh-lp-grid, .gh-lp-grid[data-cols="2"] { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 575.98px) {
  .gh-lp-grid, .gh-lp-grid[data-cols="1"], .gh-lp-grid[data-cols="2"] { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

/* ---------- card (same glass surface and hover as the site's dark cards) ---------- */
.gh-lp-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  overflow: hidden;
  border-radius: var(--gh-radius-lg);
  border: 1px solid rgba(255, 255, 255, .14);
  background:
    radial-gradient(620px 320px at 50% -12%, rgba(17, 157, 58, .18), transparent 70%),
    linear-gradient(165deg, rgba(22, 40, 62, .75) 0%, rgba(14, 28, 46, .75) 55%, rgba(12, 36, 34, .75) 100%);
  box-shadow: 0 24px 60px rgba(3, 8, 20, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.gh-lp-card:hover,
.gh-lp-card:focus-within { transform: translateY(-6px); border-color: rgba(111, 224, 143, .55); box-shadow: 0 30px 70px rgba(17, 157, 58, .22), inset 0 1px 0 rgba(255, 255, 255, .1); }

/* image: fixed 16:9 box so nothing shifts while images load */
.gh-lp-media { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: #10233a; }
.gh-lp-media img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.gh-lp-card:hover .gh-lp-media img { transform: scale(1.04); }
.gh-lp-media::after { content: ""; position: absolute; inset: auto 0 0 0; height: 40%; background: linear-gradient(180deg, transparent, rgba(10, 18, 38, .55)); pointer-events: none; }

/* no featured image: branded placeholder */
.gh-lp-media--fallback { display: grid; place-items: center; background: radial-gradient(circle at 50% 40%, rgba(17, 157, 58, .32), transparent 65%), var(--gh-dark-bg); }
.gh-lp-media--fallback .icon-glow { width: 64px; height: 64px; font-size: 1.8rem; border-radius: 16px; }

.gh-lp-cat {
  position: absolute;
  z-index: 1;
  top: 14px;
  left: 14px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(111, 224, 143, .45);
  background: rgba(10, 18, 38, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: var(--gh-mint);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .4px;
  text-transform: uppercase;
}

.gh-lp-body { display: flex; flex: 1 1 auto; flex-direction: column; padding: 22px 24px 24px; }
.gh-lp-date { display: inline-flex; align-items: center; gap: 7px; margin: 0 0 10px; color: #9fb0c4; font-size: .82rem; font-weight: 700; }
.gh-lp-date i { color: #6fe08f; }
.gh-lp-title { margin: 0 0 10px; font-size: 1.18rem; font-weight: 800; line-height: 1.35; letter-spacing: -.01em; }
.gh-lp-title a {
  color: #fff;
  text-decoration: none;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.gh-lp-title a:hover { color: #9de5b0; }
.gh-lp-excerpt {
  margin: 0 0 20px;
  color: #c9d7e3;
  font-size: .93rem;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.gh-lp-more { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; color: #6fe08f; font-weight: 800; font-size: .92rem; text-decoration: none; }
.gh-lp-more i { transition: transform .2s ease; }
.gh-lp-more:hover { color: #9de5b0; }
.gh-lp-more:hover i, .gh-lp-card:hover .gh-lp-more i { transform: translateX(4px); }

/* ---------- footer link ---------- */
.gh-lp-footer { display: flex; justify-content: center; margin-top: 34px; }

/* ---------- loading skeleton ---------- */
.gh-lp-card--skeleton { pointer-events: none; }
.gh-lp-card--skeleton:hover { transform: none; border-color: rgba(255, 255, 255, .14); }
.gh-lp-sk { display: block; border-radius: 8px; background: linear-gradient(90deg, rgba(255, 255, 255, .06) 0%, rgba(255, 255, 255, .13) 50%, rgba(255, 255, 255, .06) 100%); background-size: 200% 100%; animation: ghLpShimmer 1.4s ease-in-out infinite; }
.gh-lp-sk--media { aspect-ratio: 16 / 9; border-radius: 0; }
.gh-lp-sk--line { height: 12px; margin-bottom: 12px; }
.gh-lp-sk--title { height: 20px; width: 85%; margin-bottom: 14px; }
@keyframes ghLpShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ---------- empty / error message ---------- */
.gh-lp-status {
  max-width: 620px;
  margin: 0 auto;
  padding: 28px;
  text-align: center;
  border-radius: var(--gh-radius);
  border: 1px solid rgba(255, 255, 255, .14);
  background: rgba(255, 255, 255, .045);
  color: #c9d7e3;
}
.gh-lp-status .icon-glow { margin: 0 auto 14px; }
.gh-lp-status p { margin: 0 0 18px; }

@media (max-width: 575.98px) {
  .gh-lp-body { padding: 18px 18px 20px; }
  .gh-lp-footer .btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .gh-lp-card:hover, .gh-lp-card:focus-within { transform: none; }
  .gh-lp-card:hover .gh-lp-media img { transform: none; }
  .gh-lp-sk { animation: none; }
}
