/* -------------------------
   Posts (Index + Show)
   Matches homepage card style (lift-on-hover)
-------------------------- */

/* List (Index) */

html, body {
scroll-behavior: smooth;
}

.posts-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(420px, 1fr));
  gap: 28px 32px; /* vertical + horizontal gaps */
  width: 100%;
  margin-left: auto;
  margin-right: auto;
  max-width: 1200px; /* matches hero/title width */
  justify-content: center;
  max-width: 1100px;
}

.post-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.06);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(30,30,30,0.04);
  text-decoration: none;
  color: inherit;
  overflow: visible; /* show shadow */
  transition: transform 0.18s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.18s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
  width: 100%;
  height: 100%;
  margin: 0px;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 32px rgba(30,30,30,0.06);
  cursor: pointer;
}

.post-card-inner {
  display: grid;
  grid-template-columns: 1fr;
}

.posts-list .post-media {
  position: relative;
  overflow: hidden;
  border-radius: 12px 12px 0 0;
  min-height: 180px; /* placeholder height to prevent pop-in */
  background: #f2f1f0;
}

.post-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 0.25s ease, filter 0.25s ease;
}

.post-card:hover .post-image {
  transform: scale(1.03);
  filter: brightness(1.05);
}

.post-info {
  padding: 16px 18px 18px;
}

.post-meta {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 14px;
  color: rgba(30,30,30,0.65);
  margin-bottom: 6px;
}

.post-index-subcategory {
  padding: 2px 8px;
  background: rgba(107, 76, 230, 0.08);
  border-radius: 999px;
  font-size: 13px;
  color: #4f39c4;
}

.post-title {
  font-family: "DM Serif Text", serif;
  font-size: 22px;
  line-height: 1.25;
  margin: 4px 0 6px;
  color: #1e1e1e;
}

.post-subtitle {
  margin: 0;
  font-size: 15px;
  color: rgba(30,30,30,0.75);
}

/* Show page */
.post-article {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.post-topline {
  display: flex;
  align-items: center;
  gap: 10px;
  color: rgba(30,30,30,0.65);
  font-size: 14px;
}

.post-hero-media {
  overflow: hidden;
  border-radius: 12px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 8px 28px rgba(30,30,30,0.04);
  background: #fff;
}

.post-hero-image {
  width: 100%;
  height: auto;
  display: block;
}

.cover-image-credit {
  margin: 8px 10px 10px;
  font-size: 12px;
  color: rgba(30,30,30,0.55);
}

/* Body content spacing */
#post-body h2, #post-body h3, #post-body h4 {
  margin-top: 24px;
  margin-bottom: 10px;
  font-family: "DM Serif Text", serif;
  color: #1e1e1e;
}

#post-body p {
  margin: 10px 0 16px;
  line-height: 1.7;
}

/* Admin links on show */
.admin-actions {
  margin-top: 16px;
  font-size: 14px;
}

/* Responsive adjustments */
@media (max-width: 900px) {
  .post-title { font-size: 20px; }
  .post-subtitle { font-size: 14px; }
}

@media (max-width: 900px) {
  .posts-list {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .page-header,
  .page-main,
  .page-sidebar {
    grid-column: 1/2;
  }
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.posts-list .post-card {
  opacity: 0;
  transform: translateY(20px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1),
              box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: transform, box-shadow;
}

.posts-list.images-loaded .post-card {
  animation: fadeUp 0.7s ease forwards;
  animation-fill-mode: forwards;
}

.post-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 32px rgba(30,30,30,0.06);
  cursor: pointer;
}

/* Add a nice stagger effect */
.posts-list .post-card:nth-child(1) {
  animation-delay: 0.1s;
}
.posts-list .post-card:nth-child(2) {
  animation-delay: 0.2s;
}
.posts-list .post-card:nth-child(3) {
  animation-delay: 0.3s;
}
.posts-list .post-card:nth-child(4) {
  animation-delay: 0.4s;
}

/* -------------------------
   Post Show - Refined Metadata & Header Alignment
-------------------------- */

.page-header {
  margin-top: 28px; /* pushes down from sticky site header */
  margin-bottom: 28px; /* space before image */
  padding-left: 12px;  /* nudges right to align visually with image border */
  max-width: 840px;   /* aligns header text with post body width */
  margin-left: auto;
  margin-right: auto;
}

/* Metadata Row Above Title */
.page-header .post-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
  font-size: 0.95rem;
  color: rgba(30, 30, 30, 0.7);
  letter-spacing: 0.02em;
  line-height: 1.4;
}

/* Date (left side) */
#created-date {
  font-variant: small-caps;
  letter-spacing: 0.05em;
  font-weight: 500;
  color: rgba(30, 30, 30, 0.65);
}

/* Subcategory (right side, now clickable) */
#individual-post-subcategory {
  display: inline-flex;
  align-items: center;
  background: rgba(107, 76, 230, 0.08);
  color: #4f39c4;
  font-weight: 600;
  padding: 4px 12px;
  border-radius: 9999px;
  text-transform: capitalize;
  font-size: 0.85rem;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

/* Subcategory Hover */
#individual-post-subcategory:hover {
  background: rgba(107, 76, 230, 0.15);
  color: #3a28a0;
  transform: translateY(-1px);
}

/* Optional subtle arrow indicator */
#individual-post-subcategory::after {
  content: "→";
  margin-left: 6px;
  font-size: 0.9em;
  opacity: 0;
  transform: translateX(-3px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

#individual-post-subcategory:hover::after {
  opacity: 1;
  transform: translateX(0);
}

/* Title + Subtitle spacing */
#individual-post-title {
  margin-top: 0;
  margin-bottom: 6px;
}

#individual-post-subtitle {
  margin-top: 0;
  font-size: 1.1rem;
  color: rgba(30, 30, 30, 0.7);
}
