/* assets/css/09-posts.css
 *
 * Post content, tags, and meta styles.
 */

/* --- Post header-anchor links (added by markdown-it-anchor) --- */
.header-anchor {
  margin-left: 0.5rem;
  text-decoration: none;
  opacity: 0;
}

h2:hover .header-anchor,
h3:hover .header-anchor,
h4:hover .header-anchor,
.header-anchor:focus {
  opacity: 1;
}

/* --- Post meta / tags --- */
.post-meta {
  color: var(--color-darkGrey);
  margin-bottom: 1.5rem;
  font-family: var(--font-family-sans);
}

.post-stats {
  font-size: 0.9rem;
}

/* Post content body should use serif font */
.e-content {
  font-family: var(--font-family-sans);
}

/* Add underlines to links on hover in main content. */
.e-content a:hover {
  text-decoration: underline;
}

/* postType is stored lowercase ("article", "note") since it also doubles
   as a CSS class hook on the <article> element. Capitalized here for
   display only. */
.post-type {
  text-transform: capitalize;
}

.post-tags {
  margin-top: 1.5rem;
}

/* Tags as simple links with minimal styling */
.tag {
  display: inline-flex;
  color: var(--font-color);
  padding: 0.25rem;
  margin: 0 0.15rem 0.15rem 0;
  font-size: 0.85rem;
  text-decoration: none;
  text-transform: none;
  letter-spacing: normal;
  white-space: nowrap;
  align-items: center;
  gap: 0.25rem;
  line-height: 1;
  text-box: trim-both cap alphabetic;
}

.tag:hover {
  color: var(--color-primary);
  text-decoration: underline;
}

/* --- Homepage post list (h-feed of h-entry previews) --- */
.h-feed .h-entry {
  border-top: 1px solid var(--color-lightGrey);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}

.h-feed .h-entry:first-of-type {
  border-top: none;
  padding-top: 0;
  margin-top: 0;
}

.post-title {
  margin-bottom: 0;
}

.post-title a {
  color: var(--color-primary);
}

.post-title a:hover {
  text-decoration: underline;
}

.post-preview .post-meta {
  margin: 0.1rem 0 0.25rem;
  font-size: 0.9rem;
}

.post-meta-archive {
  margin: 0.1rem 0 0.25rem;
  font-size: 0.9rem;
}

.post-tags-small {
  margin: 0 0 0.5rem;
}

.tag-small {
  font-size: 0.8rem;
  padding: 0.1rem 0.2rem;
  margin: 0;
}

.post-blurb {
  color: var(--color-darkGrey);
  margin: 0;
  line-height: 1.6;
}

.pagination {
  margin-top: 1.5rem;
}

/* --- Figures and captions --- */
figure {
  margin: 1.5rem 0;
  max-width: 100%;
  overflow: hidden;
}

figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: var(--color-darkGrey);
  text-align: center;
}

/* --- Featured image --- */
.featured-image {
  margin: 0 0 1.5rem;
  max-width: 100%;
  overflow: hidden;
}

.featured-image img {
  max-width: 100%;
}

.grid {
  display: grid;
  grid-template-columns: repeat(
    var(--grid-placement, auto-fill),
    minmax(var(--grid-min-item-size, 16rem), 1fr)
  );
  gap: var(--gutter, var(--space-s-l));
}

/* Two column when space permits */
.grid[data-layout='50-50'] {
  --grid-placement: auto-fit;
  --grid-min-item-size: clamp(16rem, 50vw, 26rem);
}

/* Three column when space permits */
.grid[data-layout='33x3'] {
  --grid-placement: auto-fit;
  --grid-min-item-size: clamp(16rem, 33vw, 18rem);
}

.bookshelf-info * {
  margin: 0 0 0.725rem;
}

.bookshelf__name {
  margin: 0.75rem 0 0.75rem;
  font-size: var(--step--1);
}

.bookshelf-summary {
  max-width: 25ch;
}

.bookshelf-filter-label {
  padding-right: 0.825rem;
  text-decoration: underline;
  font-weight: 600;
}
