/* ==========================================================================
   Home: "Insights, Guides & Success Stories" — the three newest blog posts.
   Markup comes from js/blog-showcase.js. Class names avoid the "-card" suffix,
   which luxury.js would otherwise animate.
   Shared type sizes and section spacing come from css/home-scale.css.
   ========================================================================== */

.blg-section {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  padding: 88px 0 96px;
  background: linear-gradient(180deg, #F8FAFD 0%, #F1F6FD 100%);
  font-family: var(--font-sans);
}

.blg-wave {
  position: absolute;
  z-index: -1;
  pointer-events: none;
  border-radius: 50%;
}

.blg-wave--left {
  top: -200px;
  left: -240px;
  width: 600px;
  height: 480px;
  background: radial-gradient(closest-side, rgba(191, 219, 254, 0.8), rgba(191, 219, 254, 0));
}

.blg-wave--right {
  right: -220px;
  bottom: -240px;
  width: 600px;
  height: 500px;
  background: radial-gradient(closest-side, rgba(147, 197, 253, 0.6), rgba(147, 197, 253, 0));
}

/* small dot grids near the heading */
.blg-dots {
  position: absolute;
  z-index: -1;
  width: 96px;
  height: 80px;
  background-image: radial-gradient(#93C5FD 2px, transparent 2.5px);
  background-size: 18px 18px;
  pointer-events: none;
}

.blg-dots--left {
  top: 190px;
  left: 6%;
}

.blg-dots--right {
  top: 80px;
  right: 6%;
}

.blg-inner {
  max-width: 1440px;
}

/* ---- Heading ---- */
.blg-header {
  max-width: 1120px;
  margin: 0 auto 52px;
  text-align: center;
}

.blg-pill {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 22px;
  border: 1px solid #BFDBFE;
  border-radius: 999px;
  background: #E8F1FD;
  color: #1D4ED8;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.blg-pill svg {
  width: 18px;
  height: 18px;
}

.blg-heading {
  margin: 18px 0 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 4.2vw, 58px);
  font-weight: 800;
  line-height: 1.12;
  letter-spacing: -0.03em;
  color: #071827;
  text-wrap: balance;
}

.blg-accent {
  position: relative;
  display: inline-block;
  padding-bottom: 6px;
  color: #1D4ED8;
}

.blg-swoosh {
  position: absolute;
  left: 18%;
  bottom: -8px;
  width: 82%;
  height: 16px;
}

.blg-sub {
  max-width: 760px;
  margin: 20px auto 0;
  font-size: 18px;
  line-height: 1.6;
  color: #334155;
  text-wrap: pretty;
}

/* ---- Cards ---- */
.blg-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.blg-item {
  height: 100%;
}

.blg-post {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  padding: 8px;
  border: 1px solid #E3EBF6;
  border-radius: 26px;
  background: #FFFFFF;
  box-shadow: 0 22px 46px -30px rgba(11, 34, 57, 0.45);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.blg-post:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 54px -30px rgba(20, 92, 161, 0.5);
}

.blg-media {
  position: relative;
  aspect-ratio: 1.85;
  overflow: hidden;
  border-radius: 20px;
  background: #DBEAFE;
}

.blg-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.blg-topic {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: calc(100% - 28px);
  padding: 7px 14px 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0B2239;
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  box-shadow: 0 8px 18px -10px rgba(11, 34, 57, 0.5);
}

.blg-topic-icon {
  flex: none;
  display: grid;
  place-items: center;
  color: #2563EB;
}

.blg-topic-icon svg {
  width: 18px;
  height: 18px;
}

.blg-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px 18px 18px;
}

.blg-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 0;
  color: #334155;
  font-size: 14.5px;
}

.blg-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.blg-meta-item svg {
  width: 17px;
  height: 17px;
  color: #2563EB;
}

.blg-meta-item:nth-child(2) svg {
  color: #475569;
}

.blg-title {
  display: -webkit-box;
  margin: 14px 0 0;
  overflow: hidden;
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.015em;
  color: #071827;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.blg-excerpt {
  display: -webkit-box;
  margin: 10px 0 0;
  overflow: hidden;
  font-size: 15.5px;
  line-height: 1.6;
  color: #334155;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.blg-link {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 10px;
  margin-top: auto;
  padding-top: 18px;
  color: #1D4ED8;
  font-size: 16px;
  font-weight: 800;
  text-decoration: none;
}

/* the whole card opens the article */
.blg-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  border-radius: inherit;
}

.blg-link svg {
  width: 20px;
  height: 20px;
  transition: transform 0.25s ease;
}

.blg-post:hover .blg-link svg {
  transform: translateX(4px);
}

.blg-link:focus-visible {
  outline: none;
}

.blg-link:focus-visible::after {
  outline: 3px solid #2563EB;
  outline-offset: -3px;
}

.blg-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- View all ---- */
.blg-more {
  margin-top: 48px;
  text-align: center;
}

.blg-all {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  height: 58px;
  padding: 0 38px;
  border-radius: 18px;
  background: linear-gradient(135deg, #1D4ED8 0%, #0B2B6B 100%);
  color: #FFFFFF;
  font-size: 17px;
  font-weight: 700;
  white-space: nowrap;
  text-decoration: none;
  box-shadow: 0 18px 30px -16px rgba(29, 78, 216, 0.75);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.blg-all svg {
  width: 20px;
  height: 20px;
  transition: transform 0.2s ease;
}

.blg-all:hover {
  color: #FFFFFF;
  transform: translateY(-2px);
  box-shadow: 0 24px 36px -16px rgba(29, 78, 216, 0.8);
}

.blg-all:hover svg {
  transform: translateX(3px);
}

.blg-all:focus-visible {
  outline: 3px solid #2563EB;
  outline-offset: 3px;
}

/* ---- Responsive ---- */
@media (max-width: 1279px) {
  .blg-grid {
    gap: 22px;
  }

  .blg-title {
    font-size: 20px;
  }

  .blg-excerpt {
    font-size: 15px;
  }
}

@media (max-width: 1023px) {
  .blg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .blg-item:nth-child(3) {
    display: none; /* two across: show the two newest */
  }

  .blg-dots {
    display: none;
  }
}

@media (max-width: 680px) {
  .blg-section {
    padding: 72px 0;
  }

  .blg-header {
    margin-bottom: 40px;
  }

  .blg-sub {
    font-size: 16px;
  }

  .blg-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .blg-item:nth-child(3) {
    display: block;
  }

  .blg-title {
    font-size: 20px;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .blg-post:hover .blg-media img {
    transform: scale(1.04);
  }
}

@media (prefers-reduced-motion: reduce) {
  .blg-post,
  .blg-link svg,
  .blg-all,
  .blg-all svg {
    transition: none;
  }

  .blg-post:hover,
  .blg-all:hover {
    transform: none;
  }
}
