/* =====================================================
   BLOCK STYLES (widgets and other StreamField blocks)
   1.  Author profile block (base, main content, sidebar)
   2.  Latest posts block
   3.  Tablet (768px and wider)
   ===================================================== */
/* Colors, spacing and radius come from the variables in the main
   stylesheet (:root), so one change there updates the blocks too.
   Load this file AFTER the main stylesheet. */


/* ---------- 1. Author profile block ---------- */
/* Shared base (mobile: image on top, text below) */
.author-profile {
  padding: 2rem;
  background-color: var(--color-surface);
  border-radius: 1.2rem;
}

.author-profile-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-primary);
  margin-bottom: var(--card-space);
}

.author-profile-body {
  display: flex;
  flex-direction: column;
  gap: var(--card-space);
}

.author-photo {
  display: block;
  width: 100%;
  max-width: 16rem;
  height: auto;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: 0.8rem;
}

.author-profile-text {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.author-name {
  font-size: 2.4rem;
  font-weight: 600;
  line-height: 1.2;
}

.author-description {
  line-height: 1.6;
}

.author-link {
  color: var(--color-link);
  font-weight: 600;
}

.author-link:hover {
  color: var(--color-link-hover);
}

/* In the main content (home page) */
.page-main .author-profile {
  margin: 3rem 0;   /* same outer space as the blog cards */
}

/* In the sidebar: title gets a bottom border, same as the other sidebar widgets */
.sidebar .author-profile-title {
  padding-bottom: 1.2rem;                          /* space between text and border */
  border-bottom: 1px solid var(--color-grey-50);   /* thin line under the title */
}

/* Everything centered: round image, name, bio, link */
.sidebar .author-profile-body {
  align-items: center;
  text-align: center;
}

.sidebar .author-photo {
  width: 14rem;
  border-radius: 50%;   /* round image */
}

.sidebar .author-profile-text {
  align-items: center;
}


/* ---------- 2. Latest posts block ---------- */
/* Card box: same padding, background and corners as .author-profile */
.latest-posts {
  padding: 2rem;
  background-color: var(--color-surface);
  border-radius: 1.2rem;
}

/* Title: purple text with a thin line under it, like the other widget titles */
.latest-posts-title {
  font-size: 2rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--color-primary);
  padding-bottom: 1.2rem;                          /* space between text and border */
  border-bottom: 1px solid var(--color-grey-50);   /* thin line under the title */
  margin-bottom: var(--card-space);                /* space between border and list */
}

/* The list: one post under another with equal space between */
.latest-posts-list {
  display: flex;
  flex-direction: column;
  gap: var(--card-space);
}

/* One post row: [thumbnail] text (same layout on every screen size) */
.latest-posts-item {
  display: flex;
  align-items: center;   /* thumbnail and text share the same middle line */
  gap: 1.2rem;           /* space between thumbnail and text */
}

/* Thumbnail link (line-height 0 removes the small gap under inline images) */
.latest-posts-thumb-link {
  display: block;
  flex-shrink: 0;        /* never squeeze the thumbnail in the flex row */
  line-height: 0;
}

.latest-posts-thumb {
  display: block;
  width: 8rem;
  height: 8rem;
  object-fit: cover;               /* crop instead of stretching */
  border-radius: 0.8rem;
}

/* Title + date stacked (min-width 0 lets long titles wrap inside the row) */
.latest-posts-text {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  min-width: 0;
}

.latest-posts-link {
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
}

/* Teal on hover, same as .card-link (the global a:hover would turn it grey) */
.latest-posts-link:hover {
  color: var(--color-link);
}

.latest-posts-date {
  font-size: 1.4rem;
  color: var(--color-text-muted);   /* same as .post-date */
}

.latest-posts-empty {
  font-size: 1.4rem;
  color: var(--color-text-muted);
}

/* In the main content (if you ever place it there): same outer space as the blog cards */
.page-main .latest-posts {
  margin: 3rem 0;
}


/* =====================================================
   MEDIA QUERIES (all small-screen styles are above)
   ===================================================== */

/* ---------- 3. Tablet (768px and wider) ---------- */
@media screen and (min-width: 768px) {

  /* Author profile in main content: image left, name + bio + link right */
  .page-main .author-profile-body {
    flex-direction: row;
    align-items: flex-start;
  }

  .page-main .author-photo {
    flex: 0 0 16rem;
    width: 16rem;
  }

  .page-main .author-profile-text {
    flex: 1;
  }
}

/* Latest posts needs no tablet or desktop rules: it lives in the
   sidebar, which stays one fixed width (30rem). Add a desktop
   section here later only if a block needs one. */