/**
 * Styles for the search, page, blog and article templates
 * (sections/main-search.liquid, main-page.liquid, main-blog.liquid,
 * main-article.liquid, blog-posts.liquid).
 *
 * NOT the 404 template, despite what this header used to claim - that has
 * its own section-404.css and none of its class names appear here.
 *
 * Every one of those sections must render a stylesheet_tag for this file.
 * main-page.liquid did not, so its rules were dead on the page template.
 */

/* ------------------------------------------------------------------ */
/* Search                                                              */
/* ------------------------------------------------------------------ */
.search-header {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
  margin-bottom: var(--space-7);
}

.search-header__title {
  margin-bottom: var(--space-5);
}

.search-header__form {
  display: flex;
  gap: var(--space-2);
}

.search-header__input {
  flex: 1;
}

/* Square, and the SAME height as the field beside it. .btn is 56px tall
   while .field__input is 48px, so the button hung 8px below the input on a
   top-aligned flex row. */
.search-header__submit {
  flex-shrink: 0;
  width: var(--field-height);
  height: var(--field-height);
  min-height: var(--field-height);
  padding-inline: 0;
}

.search-blank-prompt {
  text-align: center;
  color: var(--color-muted);
}

.search-results__count {
  color: var(--color-muted);
  margin-bottom: var(--space-5);
}

.search-results__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4);
}

@media screen and (min-width: 990px) {
  .search-results__grid {
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-5);
  }
}

.search-results__list {
  margin-top: var(--space-6);
  border-top: 1px solid var(--color-line);
}

.search-results__list-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-block: var(--space-3);
  border-bottom: 1px solid var(--color-line);
}

.search-results__list-type {
  flex-shrink: 0;
}

.search-results__list-link {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.search-empty {
  padding-block: var(--space-9);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-3);
}

.search-empty__text {
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

/* ------------------------------------------------------------------ */
/* Page (prose)                                                        */
/* ------------------------------------------------------------------ */
.page-prose {
  max-width: 720px;
  margin-inline: auto;
}

.page-prose__title {
  margin-bottom: var(--space-6);
  text-align: center;
}

/* ------------------------------------------------------------------ */
/* Blog listing                                                        */
/* ------------------------------------------------------------------ */
.blog-header {
  margin-bottom: var(--space-6);
}

.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

@media screen and (min-width: 750px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.blog-empty {
  color: var(--color-muted);
}

.article-card {
  display: block;
  color: inherit;
  text-decoration: none;
}

.article-card__media {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: var(--radius-m);
  background-color: var(--color-line);
}

.article-card__image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card__image--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-card__body {
  padding-top: var(--space-4);
}

.article-card__date {
  color: var(--color-muted);
  margin-bottom: var(--space-1);
}

.article-card__title {
  text-transform: none;
  margin-bottom: var(--space-2);
}

.article-card__excerpt {
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

.article-card__read-more {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ------------------------------------------------------------------ */
/* Article                                                             */
/* ------------------------------------------------------------------ */
.article-prose {
  max-width: 720px;
  margin-inline: auto;
}

.article-prose__back {
  display: inline-block;
  margin-bottom: var(--space-5);
  color: var(--color-muted);
}

.article-prose__title {
  margin-bottom: var(--space-2);
  text-align: center;
}

.article-prose__meta {
  color: var(--color-muted);
  text-align: center;
  margin-bottom: var(--space-6);
}

.article-prose__image {
  width: 100%;
  border-radius: var(--radius-m);
  margin-bottom: var(--space-6);
}

.article-comments {
  margin-top: var(--space-9);
  padding-top: var(--space-7);
  border-top: 1px solid var(--color-line);
}

.article-comments__list {
  margin-block: var(--space-5);
}

.article-comments__item {
  padding-block: var(--space-4);
  border-bottom: 1px solid var(--color-line);
}

.article-comments__author {
  font-weight: 500;
}

.article-comments__date {
  color: var(--color-muted);
  margin-bottom: var(--space-2);
}

.article-comment-form {
  margin-top: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  max-width: 480px;
}

.article-comment-form__textarea {
  height: 120px;
  padding-block: var(--space-3);
  resize: vertical;
}
