/*
 * Podcast category card
 * Displayed in the right sidebar, above the WordPress sidebar widgets.
 */

.podcast-sidebar-column {
  display: flex;
  flex-direction: column;
}

/*
 * Compact header:
 * Larger image on the left, deliberately narrower title/icon column at right.
 */
.podcast-sidebar-card {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 16px;
  align-items: start;

  width: 100%;
  margin: 0 0 30px;
  padding: 20px;
  background: #fff;
  border: 1px solid #e5e5e5;
  border-radius: 24px;
}

/* Stack podcast card vertically on single posts and category archives */
.single .podcast-sidebar-card,
.archive .podcast-sidebar-card,
.category .podcast-sidebar-card {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: auto;
}

/* Content below image */
.single .podcast-sidebar-card .podcast-sidebar-content,
.archive .podcast-sidebar-card .podcast-sidebar-content,
.category .podcast-sidebar-card .podcast-sidebar-content {
    width: 100%;
    min-height: auto;
    grid-column: auto;
    grid-row: auto;
}

/* Description full width below content */
.single .podcast-sidebar-card .podcast-sidebar-description-wrap,
.archive .podcast-sidebar-card .podcast-sidebar-description-wrap,
.category .podcast-sidebar-card .podcast-sidebar-description-wrap {
    width: 100%;
    grid-column: auto;
    grid-row: auto;
}

.podcast-sidebar-cover {
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: auto;
  display: block;
  margin: 0;
  overflow: hidden;
  border-radius: 8px;
}
.podcast-sidebar-cover img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 0;
}

/*
 * We use display: contents so that the existing title, description,
 * and link elements can be positioned in the parent card grid.
 */
.podcast-sidebar-content {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-width: 0;
  min-height: 150px;
}

.podcast-sidebar-meta {
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: flex-start;
  gap: 0;

  width: 100%;
  max-width: 100%;
}

.podcast-sidebar-title {
  width: 100%;
  max-width: none;
  margin: 0 !important;
  padding: 0 !important;
  padding-bottom: 5px !important;

  color: #111;
  font-family: 'Adobe Caslon Pro', serif !important;
  font-size: 1.5rem;
  line-height: 1.05;
  text-transform: capitalize !important;
  overflow-wrap: break-word;
}


/*
 * Icons are placed below the title in the same right-hand column.
 * If title wraps across multiple lines, they will still start beneath it.
 */
.podcast-sidebar-links {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;

  width: 100%;
  max-width: 100%;
  gap: 6px;
  margin: 0 !important;
  padding: 0 !important;
}

.podcast-sidebar-icon-link {
  display: inline-flex;
  flex: 0 0 34px;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #222;
  background: #f3f3f3;
  border-radius: 50%;
  font-size: 17px;
  line-height: 1;
  text-decoration: none;
  transition: background-color 0.2s ease, color 0.2s ease,
    transform 0.2s ease;
}

.podcast-sidebar-icon-link:hover,
.podcast-sidebar-icon-link:focus {
  color: #fff;
  background: #111;
  transform: translateY(-2px);
}
/*
 * Description takes the full card width below the image/title row.
 * It is initially clamped to three lines.
 */
.podcast-sidebar-description-wrap {
  grid-column: 1 / -1;
  grid-row: 2;
  min-width: 0;
}

.podcast-sidebar-description {
  color: #555;
  font-family: 'Neue Haas Display Roman', sans-serif !important;
  font-size: 0.95rem;
  line-height: 1.45;
}

.podcast-sidebar-description p {
  margin: 0;
}

.podcast-sidebar-description:not(.is-expanded) {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.podcast-sidebar-description.is-expanded {
  display: block;
  overflow: visible;
  -webkit-line-clamp: unset;
}

.podcast-read-more {
  display: inline-flex;
  align-items: center;
  margin: 8px 0 0;
  padding: 0;
  color: #111;
  background: transparent;
  border: 0;
  font-family: 'Neue Haas Display Roman', sans-serif !important;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.4;
  text-decoration: underline;
  cursor: pointer;
}

.podcast-sidebar-content {
  min-height: 100px;
}
/*
 * Full-bleed podcast card layout on category and single-post pages.
 * The image touches the card's left, right, and top edges.
 */
.single .podcast-sidebar-card,
.category .podcast-sidebar-card,
.archive .podcast-sidebar-card {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    overflow: hidden;
}

/* Full-width image wrapper */
.single .podcast-sidebar-card .podcast-sidebar-cover,
.category .podcast-sidebar-card .podcast-sidebar-cover,
.archive .podcast-sidebar-card .podcast-sidebar-cover {
    display: block;
    width: 100%;
    height: auto;
    max-width: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
    border-radius: 0;
    order: 1;
}

/* Full-width image */
.single .podcast-sidebar-card .podcast-sidebar-cover img,
.category .podcast-sidebar-card .podcast-sidebar-cover img,
.archive .podcast-sidebar-card .podcast-sidebar-cover img {
    display: block;
    width: 100%;
    max-width: none;
    height: auto;
    margin: 0;
    padding: 0;
    object-fit: cover;
    border-radius: 0;
}

/* Text area below the image */
.single .podcast-sidebar-card .podcast-sidebar-content,
.category .podcast-sidebar-card .podcast-sidebar-content,
.archive .podcast-sidebar-card .podcast-sidebar-content {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 0;
    padding: 20px 20px 0;
    order: 2;
}

/* Description area below the title and icons */
.single .podcast-sidebar-card .podcast-sidebar-description-wrap,
.category .podcast-sidebar-card .podcast-sidebar-description-wrap,
.archive .podcast-sidebar-card .podcast-sidebar-description-wrap {
    display: block;
    width: 100%;
    min-width: 0;
    padding: 0 20px 20px;
    order: 3;
}

/* Reset grid-only properties */
.single .podcast-sidebar-card .podcast-sidebar-cover,
.category .podcast-sidebar-card .podcast-sidebar-cover,
.archive .podcast-sidebar-card .podcast-sidebar-cover,
.single .podcast-sidebar-card .podcast-sidebar-content,
.category .podcast-sidebar-card .podcast-sidebar-content,
.archive .podcast-sidebar-card .podcast-sidebar-content,
.single .podcast-sidebar-card .podcast-sidebar-description-wrap,
.category .podcast-sidebar-card .podcast-sidebar-description-wrap,
.archive .podcast-sidebar-card .podcast-sidebar-description-wrap {
    grid-column: auto;
    grid-row: auto;
}

/*
 * Podcast-card recap archive link.
 * Appears beneath platform icons and before the podcast description.
 */
.podcast-view-recaps {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    margin-top: 12px;
    color: #111;
    font-family: 'Neue Haas Display Roman', sans-serif !important;
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.3;
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.podcast-view-recaps:hover,
.podcast-view-recaps:focus {
    color: #111;
    opacity: 0.7;
    transform: translateX(2px);
}

.podcast-view-recaps span {
    font-size: 1.05em;
    line-height: 1;
}

@media (max-width: 420px) {
  .podcast-sidebar-card {
    grid-template-columns: 108px minmax(0, 1fr);
    column-gap: 13px;
    padding: 16px;
    border-radius: 18px;
  }

  .podcast-sidebar-cover {
    width: 108px;
    height: 108px;
  }

  .podcast-sidebar-title {
    max-width: 142px;
    font-size: 1.3rem;
  }

  .podcast-sidebar-links {
    width: 142px;
    gap: 6px;
  }

  .podcast-sidebar-icon-link {
    flex-basis: 31px;
    width: 31px;
    height: 31px;
    font-size: 16px;
  }
}

/*
 * Desktop arrangement:
 * Category posts are left; podcast card and widgets are right.
 *
 * Mobile arrangement:
 * 1. Podcast card
 * 2. Category posts
 * 3. Search, Popular Posts, remaining widgets
 */
@media (min-width: 992px) {
  .podcast-card-column {
    order: 2;
  }

  .category-posts-column {
    order: 1;
  }

  .category-widgets-column {
    order: 3;
    margin-left: auto;
    margin-top: -30px;
  }

  #vibenews_recent_post-1 {
    display: none !important;
  }
}

@media (max-width: 991px) {
  #main-content .row {
    display: flex;
    flex-direction: column;
  }

  .podcast-card-column {
    order: 1;
    width: 100%;
    max-width: 100%;
    margin-bottom: 28px;
  }

  .category-posts-column {
    order: 2;
    width: 100%;
    max-width: 100%;
  }

  .category-widgets-column {
    order: 3;
    width: 100%;
    max-width: 100%;
    margin-top: 30px;
  }

  #vibenews_recent_post-1 {
    display: none !important;
  }
}

/*
 * Bootstrap .row is already a flex container on desktop.
 * On mobile, show the podcast card + Search column first.
 */
@media (max-width: 991px) {
  #main-content .row {
    display: flex;
    flex-direction: column;
  }

  #main-content .podcast-sidebar-column {
    order: 1;
    width: 100%;
    max-width: 100%;
    margin-bottom: 30px;
  }

  #main-content .category-posts-column {
    order: 2;
    width: 100%;
    max-width: 100%;
  }

  #vibenews_recent_post-1 {
    display: none !important;
  }
}

/*
 * Phone layout: larger cover and move title/icons higher.
 * Place this at the very bottom of podcast.css.
 */
@media (max-width: 640px) {
  .podcast-sidebar-card {
    grid-template-columns: 138px minmax(0, 1fr);
    column-gap: 14px;
    row-gap: 16px;
    padding: 18px;
  }

  .podcast-sidebar-cover {
    width: 138px;
    height: 138px;
  }

  /*
   * Match the image height, but do not push the metadata all the
   * way to the lower edge of the image.
   */
  .podcast-sidebar-content {
    min-height: 138px;
    justify-content: flex-end;
    padding-bottom: 20px;
  }

  .podcast-sidebar-meta {
    width: 100%;
    max-width: 100%;
    gap: 0;
  }

  .podcast-sidebar-title {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 1.55rem;
    line-height: 1.05;
  }

  .podcast-sidebar-links {
    width: 100%;
    max-width: 100%;
    gap: 6px;
    margin: 0 !important;
    padding: 0 !important;
  }

  .podcast-sidebar-icon-link {
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    font-size: 17px;
  }

  #vibenews_recent_post-1 {
    display: none !important;
  }
}

@media (max-width: 640px) {
    .single .podcast-sidebar-card,
    .category .podcast-sidebar-card,
    .archive .podcast-sidebar-card {
        padding: 0;
    }

    .single .podcast-sidebar-card .podcast-sidebar-cover,
    .category .podcast-sidebar-card .podcast-sidebar-cover,
    .archive .podcast-sidebar-card .podcast-sidebar-cover {
        width: 100%;
        height: auto;
    }

    .single .podcast-sidebar-card .podcast-sidebar-cover img,
    .category .podcast-sidebar-card .podcast-sidebar-cover img,
    .archive .podcast-sidebar-card .podcast-sidebar-cover img {
        width: 100%;
        height: auto;
    }

    .single .podcast-sidebar-card .podcast-sidebar-content,
    .category .podcast-sidebar-card .podcast-sidebar-content,
    .archive .podcast-sidebar-card .podcast-sidebar-content {
        min-height: 0;
        padding: 16px 16px 0;
    }

    .single .podcast-sidebar-card .podcast-sidebar-description-wrap,
    .category .podcast-sidebar-card .podcast-sidebar-description-wrap,
    .archive .podcast-sidebar-card .podcast-sidebar-description-wrap {
        padding: 0 16px 16px;
    }
}