/* Posts grid — featured row + three cards in one row (four posts) */

.posts-grid {
  --pg-muted: #64748b;
  --pg-muted-soft: #94a3b8;
  --pg-title-hover: #2563eb;
  --pg-border: #e5e7eb;
  --pg-surface: #f8fafc;
  --pg-badge: #f1f5f9;
  --pg-visual-bg: #eef2ff;
  --pg-radius: 28px;
  min-width: 0;
  max-width: 100%;
}

.posts-grid__inner {
  max-width: 1160px;
  width: 100%;
  min-width: 0;
  margin-left: auto;
  margin-right: auto;
}

.posts-grid__empty--admin {
  margin: 0;
  padding: 1rem 1.25rem;
  font-size: 0.9375rem;
  color: var(--pg-muted);
  background: var(--pg-surface);
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
}

/* —— Featured: two separate panels + image zoom on row hover —— */

.posts-grid__featured-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 0.7fr);
  grid-gap: 1.25rem;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
  align-items: stretch;
}

.posts-grid__featured-panel {
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.5),
    -12.251px 18.376px 18.376px 0px rgba(0, 166, 255, 0.05),
    12.251px 18.376px 18.376px 0px rgba(255, 82, 183, 0.05);
  margin: 0;
  min-width: 0;
  background: #fff;
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  overflow: hidden;
}

.posts-grid__featured-panel--content {
  display: flex;
  flex-direction: column;
  padding: max(1.5rem, min(4vw, 2.5rem));
}

.posts-grid__featured-panel--media {
  display: flex;
  padding: 0;
  min-height: 240px;
}

.posts-grid__featured-media-clip {
  flex: 1;
  width: 100%;
  min-height: 220px;
  overflow: hidden;
  background: var(--pg-visual-bg);
}

.posts-grid__pill {
  display: inline-flex;
  align-self: flex-start;
  margin: 0 0 1rem;
  padding: 0.4rem 0.75rem 0.32rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4f5d70;
  background: #e8ebf3;
  border-radius: 8px;
}

.posts-grid__pill--compact {
  margin: 0;
}

.posts-grid__featured-title {
  margin: 0 0 0.75rem;
  font-size: clamp(1.35rem, 1.1rem + 1.4vw, 2.15rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.02em;
  word-wrap: break-word;
  word-break: break-word;
}

.posts-grid__featured-title a {
  color: inherit;
  font-weight: inherit;
  -webkit-text-decoration: none;
  text-decoration: none;
  transition: color 0.2s ease;
}

.posts-grid__featured-row:hover .posts-grid__featured-title a,
.posts-grid__featured-title a:hover {
  color: var(--pg-title-hover);
}

.posts-grid__featured-title a:hover {
  -webkit-text-decoration: underline;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.posts-grid__excerpt {
  flex: 1;
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--pg-muted);
  word-wrap: break-word;
  word-break: break-word;
}

.posts-grid__featured-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.posts-grid__byline {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.posts-grid__avatar-img {
  display: block;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  -o-object-fit: cover;
     object-fit: cover;
}

.posts-grid__date {
  font-size: 0.875rem;
  font-weight: 500;
}

.posts-grid__date--muted {
  font-weight: 400;
  color: var(--pg-muted-soft);
}

.posts-grid__read {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.9375rem;
  font-weight: 700;
  -webkit-text-decoration: none;
  text-decoration: none;
}

.posts-grid__read:hover {
  -webkit-text-decoration: underline;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.posts-grid__read-chevron {
  font-weight: 700;
  line-height: 1;
}

.posts-grid__featured-thumb-link {
  display: block;
  height: 100%;
  min-height: 220px;
}

.posts-grid__featured-img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 220px;
  max-width: 100%;
  -o-object-fit: cover;
     object-fit: cover;
  transform: scale(1);
  transition: transform 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

@media (hover: hover) and (pointer: fine) {
  .posts-grid__featured-row:hover .posts-grid__featured-img {
    transform: scale(1.08);
  }

  .posts-grid__featured-row:hover .posts-grid__featured-placeholder {
    transform: scale(1.05);
  }
}

.posts-grid__featured-placeholder {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  min-height: 260px;
  overflow: hidden;
  transform: scale(1);
  transition: transform 0.55s cubic-bezier(0.25, 0.1, 0.25, 1);
}

.posts-grid__featured-dots {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  opacity: 0.45;
  background-image: radial-gradient(
    circle,
    rgb(199, 210, 254) 1.25px,
    transparent 1.25px
  );
  background-size: 18px 18px;
}

.posts-grid__terminal {
  position: relative;
  z-index: 1;
  width: min(52%, 220px);
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--pg-border);
  box-shadow:
    0 18px 40px rgba(99, 102, 241, 0.12),
    0 4px 12px rgba(15, 23, 42, 0.06);
  transform: perspective(520px) rotateY(-6deg) rotateX(4deg);
}

.posts-grid__terminal-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--pg-border);
  background: var(--pg-surface);
  border-radius: 14px 14px 0 0;
}

.posts-grid__terminal-bar span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #e2e8f0;
}

.posts-grid__terminal-bar span:first-child {
  background: #fca5a5;
}

.posts-grid__terminal-bar span:nth-child(2) {
  background: #fcd34d;
}

.posts-grid__terminal-bar span:nth-child(3) {
  background: #86efac;
}

.posts-grid__terminal-body {
  padding: 1.25rem 1.15rem 1.5rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 1rem;
}

.posts-grid__terminal-prompt {
  color: var(--pg-muted);
}

/* —— Bottom row: three posts in one row —— */

.posts-grid__cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-gap: 1.25rem;
  gap: 1.25rem;
}

.posts-grid__card {
  box-shadow:
    0 0 1px rgba(0, 0, 0, 0.5),
    -12.251px 18.376px 18.376px 0px rgba(0, 166, 255, 0.05),
    12.251px 18.376px 18.376px 0px rgba(255, 82, 183, 0.05);
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  padding: 1.5rem;
  background: #fff;
  border: 1px solid var(--pg-border);
  border-radius: var(--pg-radius);
  transition: box-shadow 0.2s ease;
}

.posts-grid__card:hover {
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.posts-grid__card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem 1rem;
}

.posts-grid__card-title {
  margin: 0;
  font-size: clamp(1.15rem, 1rem + 0.6vw, 1.5rem);
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.01em;
  word-wrap: break-word;
  word-break: break-word;
}

@media (min-width: 1025px) {
  .posts-grid__card-title {
    min-height: 88px;
    display: flex;
    align-items: center;
  }
}

.posts-grid__card-title a {
  color: inherit;
  font-weight: inherit;
  -webkit-text-decoration: none;
  text-decoration: none;
  transition: color 0.2s ease;
}

.posts-grid__card:hover .posts-grid__card-title a,
.posts-grid__card-title a:hover {
  color: var(--pg-title-hover);
}

.posts-grid__card-title a:hover {
  -webkit-text-decoration: underline;
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 1024px) {
  .posts-grid__cards {
    grid-template-columns: 1fr;
  }

  .posts-grid__card {
    padding: 1.25rem 1.35rem;
  }
}

@media (max-width: 782px) {
  .posts-grid {
    --pg-radius: 20px;
  }

  .posts-grid__featured-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
  }

  .posts-grid__featured-panel--content {
    padding: 1.25rem 1.35rem;
  }

  .posts-grid__featured-panel--media {
    order: -1;
    min-height: 0;
    aspect-ratio: 16 / 10;
  }

  .posts-grid__featured-media-clip,
  .posts-grid__featured-thumb-link,
  .posts-grid__featured-img,
  .posts-grid__featured-placeholder {
    min-height: 0;
    height: 100%;
  }

  .posts-grid__featured-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.85rem;
  }

  .posts-grid__excerpt {
    margin-bottom: 1.15rem;
  }

  .posts-grid__cards {
    gap: 1rem;
  }
}

@media (max-width: 480px) {
  .posts-grid__featured-panel--content,
  .posts-grid__card {
    padding: 1.1rem 1.15rem;
  }

  .posts-grid__featured-panel--media {
    aspect-ratio: 3 / 2;
  }

  .posts-grid__terminal {
    width: min(64%, 180px);
  }
}

