/* ---- Journal-style Home Page CSS ----
   - Responsive, modular, readable
   - Uses Newsreader for content; Inter for UI text
*/

/* Reset / base */
html, body { height: 100%; margin: 0; padding: 0; }
.journal-body {
  background: #fdfcfb; /* warm off-white */
  color: #1e1e1e;
  font-family: "Newsreader", "Inter", serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.55;
  font-size: 16px;
}

html, body {
  width: 100%;
  overflow-x: hidden; /* prevents sideways scroll */
}

/* Layout wrapper */
.site-wrapper {
  display: flex;
  min-height: 100vh;
  flex-direction: column;
}

/* Hero (big journal title) */
.hero {
  position: relative;
  padding: 54px 0px 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 40px;
  background: rgba(255,255,255,0.85);
  padding: 36px 48px;
  border-radius: 12px;
  border: 1px solid rgba(30,30,30,0.06);
  box-shadow: 0 6px 30px rgba(30,30,30,0.04);
  opacity: 0;
  animation: fadeUp 2s ease 0.2s forwards;
}

.hero-inner h1 {
  max-width: 800px; /* keeps text line length ideal */
  margin: 0 auto;
}

.hero-title {
  font-family: "DM Serif Text", "Newsreader", serif;
  font-size: 44px;
  margin: 0 0 6px;
  line-height: 1.05;
}

.hero-subtitle {
  margin: 0;
  font-family: "Inter", sans-serif;
  font-size: 16px;
  color: rgba(30,30,30,0.8);
}

/* Main content container */
.container {
  max-width: 1200px;
  margin: auto;
  padding: 0 20px 80px;
  width: 100%;
}

/* Grid: featured, recent posts, sidebar */
.home-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  padding: 0 16px;
}

/* On medium+ screens, switch to multi-column layout */
@media (min-width: 900px) {
  .home-grid {
    grid-template-columns: 1.25fr 1fr; /* left column (featured + recent) and sidebar */
    grid-template-areas:
      "featured sidebar"
      "recent  sidebar";
    align-items: start;
    gap: 40px;
  }

  .featured { grid-area: featured; }
  .recent { grid-area: recent; }
  .sidebar { grid-area: sidebar; }
}

/* Featured post styles */

.featured-wrapper {
  display: flex;
  flex-direction: column;
  gap: 0px;
}

/* Align heading */
.featured-heading {
  font-size: 24px;
  font-family: "DM Serif Text", serif;
  margin: 0px;
  padding-left: 4px;
  color: #1e1e1e;
}

.featured {
  background: white;
  border: 1px solid rgba(30,30,30,0.06);
  border-radius: 12px;
  box-shadow: 0 8px 28px rgba(30,30,30,0.04);
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  will-change: transform, box-shadow;
  overflow: visible;
  position: relative;
}

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

.featured-link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  height: 100%;
}


.featured-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.featured-media { 
  position: relative;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

.featured-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease, filter 0.25s ease;
  border-top-left-radius: 12px;
  border-top-right-radius: 12px;
}

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


.featured-tag {
  position: absolute;
  left: 18px;
  bottom: 18px;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(4px);
  padding: 8px 12px;
  border-radius: 999px;
  font-family: "Inter", sans-serif;
  font-size: 13px;
  border: 1px solid rgba(30,30,30,0.05);
}

.featured-body { padding: 20px 22px 28px; }
.featured-meta { display: flex; gap: 12px; align-items: center; justify-content: space-between; font-family: "Inter", sans-serif; color: rgba(30,30,30,0.7); font-size: 14px; margin-bottom: 10px; }
.featured-title { margin: 0 0 8px; font-size: 22px; font-weight: 600; }
.featured-excerpt { margin: 0; color: rgba(30,30,30,0.85); }
.featured-category {
  padding: 2px 8px;
  background: rgba(107, 76, 230, 0.08);
  border-radius: 999px;
  font-size: 14px;
  color: #4f39c4;
}

/* Recent posts list */
.section-heading { font-family: "DM Serif Text", serif; font-size: 24px; margin: 0 0 12px; }

.posts-list { display: grid; gap: 18px; }

@media (min-width: 900px) {
  .posts-list { grid-template-columns: 1fr; } /* stacked under featured on left column */
  .featured-heading {
  padding-left: 4px;
  margin-top: 4px;
  }
    .featured-wrapper {
    grid-area: featured;
  }
}

/* Post card */

.post-card {
  background: white;
  border: 1px solid rgba(30,30,30,0.06);
  border-radius: 12px;
  overflow: visible; /* show the shadow */
  transition: transform 0.14s ease, box-shadow 0.14s ease;
  will-change: transform, box-shadow;
  position: relative;
}

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

.post-link { display: flex; text-decoration: none; color: inherit; width: 100%; }

.post-media {
  flex: 0 0 42%;
  min-width: 140px;
  overflow: hidden;
  border-top-left-radius: 12px;
  border-bottom-left-radius: 12px;
  position: relative;
}

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

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


.post-body { padding: 18px; display: flex; flex-direction: column; justify-content: center; }
.post-meta { font-family: "Inter", sans-serif; color: rgba(30,30,30,0.7); font-size: 13px; margin-bottom: 6px; display: flex; gap: 12px; align-items: center; justify-content: space-between; }
.post-title { margin: 0 0 8px; font-size: 18px; font-weight: 600; }
.post-excerpt { margin: 0; color: rgba(30,30,30,0.86); font-size: 15px; }
.post-category {
  padding: 2px 8px;
  background: rgba(107, 76, 230, 0.08);
  border-radius: 999px;
  font-size: 12px;
  color: #4f39c4;
}

/* Sidebar */
.sidebar { background: transparent; }
.about-card {
  background: white;
  border: 1px solid rgba(30,30,30,0.06);
  border-radius: 12px;
  padding: 18px;
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.about-image-wrap { width: 92px; height: 92px; border-radius: 10px; overflow: hidden; flex-shrink: 0; border: 1px solid rgba(30,30,30,0.06); margin-top: 16px; }
.about-image { width: 100%; height: 100%; object-fit: cover; display: block; }
.about-text { font-size: 14px; color: rgba(30,30,30,0.9); }
.about-cta { margin-top: 12px; }

.sidebar-block { margin-top: 18px; background: white; border-radius: 12px; padding: 14px; border: 1px solid rgba(30,30,30,0.06); }

/* Footer */
.site-footer { margin-top: auto; padding: 22px 20px; border-top: 1px solid rgba(30,30,30,0.04); background: transparent; }
.footer-inner { max-width: 1200px; margin: 0 auto; color: rgba(30,30,30,0.7); font-family: "Inter", sans-serif; font-size: 14px; }

/* Small screens tweaks */
@media (max-width: 899px) {
  .hero-inner { padding: 28px 20px; }
  .hero-title { font-size: 34px; }
  .featured-media { min-height: 200px; }
  .post-media { 
    border-bottom-left-radius: 0px;
    border-top-right-radius: 12px;
    max-height: 200px;
  } 
  .post-link { flex-direction: column; }
  .post-body { padding: 14px; }

  .home-container,
  main,
  .page-main,
  .page-content {
    max-width: 100%;
    margin: 0 auto;
    box-sizing: border-box;
  }

  /* Optional: ensure hero and cards align evenly */
  .hero-section,
  .featured-post,
  .recent-posts {
    padding-left: 16px;
    padding-right: 16px;
  }
}



/* --- Fade-Up on Load --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.featured,
body.home .post-card,
body.journal .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;
}

/* Fade animation on load */
.animate-in .featured,
.animate-in .post-card {
  animation: fadeUp 0.8s ease forwards;
  animation-fill-mode: forwards;
}

/* Hover lift (smooth springy motion) */
.animate-in .featured:hover,
.animate-in .post-card:hover {
  transform: translateY(-6px) !important;
  box-shadow: 0 12px 32px rgba(30,30,30,0.06);
  cursor: pointer;
}

/* Image hover (same easing) */
.featured-image,
.post-image {
  transition: transform 1s cubic-bezier(0.16, 1, 0.3, 1),
              filter 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

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