/*
 * Layout primitives shared by every custom template/macro: a page container,
 * a responsive card grid, and section spacing. Keep these generic — page-
 * specific look (hero, player, etc.) belongs in components/*.css.
 */

.md-grid {
  max-width: var(--container-max);
}

.pod-container {
  max-width: var(--container-max);
  margin-inline: auto;
  padding-inline: var(--space-5);
}

.pod-section {
  margin-block: var(--space-9);
}

.pod-section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-4);
  margin-bottom: var(--space-5);
}

.pod-section-head h2 {
  margin: 0;
  padding: 0;
  border: none;
}

.pod-section-head a {
  white-space: nowrap;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Responsive auto-fit grid — used for show/episode/related-content cards.
   Column count is driven purely by available width, so it scales from 1
   column on mobile to N columns on desktop with no breakpoint bookkeeping. */
.pod-grid {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.pod-grid--2 {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.pod-grid--tight {
  gap: var(--space-3);
}

@media screen and (max-width: 44.9375em) {
  .pod-container {
    padding-inline: var(--space-4);
  }

  .pod-section {
    margin-block: var(--space-7);
  }
}

/*
 * Episode/article pages (overrides/blog-post.html): Material's stock layout
 * crams the breadcrumb into the narrow post-meta sidebar column (wrapping
 * onto several lines) and splits the remaining width between that sidebar
 * and the article. This site already shows date/reading-time/author inline
 * in the article itself (post_meta(), author_card()), so the sidebar only
 * duplicates that — drop it, let the breadcrumb span a full row above the
 * article, and give the article the width that frees up.
 */
.md-sidebar--post {
  display: none;
}

[dir="ltr"] .md-content--post > .md-content__inner {
  margin-left: 0;
}

.md-content--post > .md-content__inner {
  max-width: var(--container-article);
  margin-inline: auto;
}

@media screen and (min-width: 76.25em) {
  .md-content--post {
    flex-wrap: wrap;
  }

  .md-content--post > .md-path {
    order: -1;
    flex: 1 0 100%;
    max-width: var(--container-article);
    margin-inline: auto;
  }
}

@media screen and (max-width: 76.234375em) {
  /* Material stacks `.md-content--post` in `column-reverse` below this
     breakpoint, so the *highest* order value ends up first visually. */
  .md-content--post > .md-path {
    order: 2;
  }
}

/* Material only sets `white-space: nowrap` on breadcrumb items other than
   the first, so "ホーム" alone can wrap onto two lines under flex shrink. */
.md-path__item:first-child {
  white-space: nowrap;
}

/* Material lets `.md-path` scroll horizontally when the trail overflows.
   Truncate the last (current page) crumb with an ellipsis instead. */
.md-path {
  overflow: hidden;
}

.md-path__list {
  flex-wrap: nowrap;
}

.md-path__item {
  flex-shrink: 0;
  min-width: 0;
}

.md-path__item:last-child {
  flex-shrink: 1;
  overflow: hidden;
}

.md-path__item:last-child .md-path__link,
.md-path__item:last-child .md-ellipsis {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
