/*==============================================*\
|| TerraLoc – the newsroom                        ||
|| template/terraloc/assets/css/news.css          ||
\*==============================================*/

/*
 * The news pages shipped as JScms stock: Bootstrap cards on a transparent
 * ground, an h4 title jammed under the navigation, and the category tabs
 * beside it. They read as a different product from every other list page on
 * the site, so they use the same header and the same card vocabulary now.
 */

/* The categories are a filter row, so they sit in the shared filter bar. */
.tl-news-filterbar {
  gap: 0.4rem;
}

.tl-news-filterbar .nav,
.tl-news-filterbar ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0;
  padding: 0;
  list-style: none;
  border: 0;
}

.tl-news-filterbar a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 0.85rem;
  border-radius: 999px;
  border: 1px solid var(--tl-hairline, #DFDCCB);
  background: var(--tl-panel, #FAF9F4);
  color: var(--tl-muted, #5C6253);
  font-size: 0.8rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.tl-news-filterbar a:hover {
  border-color: var(--tl-accent, #46603C);
  color: var(--tl-accent, #46603C);
}

.tl-news-filterbar a.active,
.tl-news-filterbar .active > a {
  background: var(--tl-ink, #23281F);
  border-color: var(--tl-ink, #23281F);
  color: var(--tl-paper, #F3F2EC);
}

/* ------------------------------------------------------------------
   The grid

   One article was rendering as a lone block of text in a page of empty
   space. Cards give it an edge, and the grid gives the next nine a shape
   to arrive into.
   ------------------------------------------------------------------ */

.tl-news-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1.25rem;
  margin-top: 1.5rem;
}

/* The news shortcode wraps every article in a Bootstrap column, and a
   col-md-4 inside a grid track takes a third of THAT track rather than a
   third of the row: every card came out a third of its own cell wide. The
   grid owns the columns here, so the widths are handed back to it. */
.tl-news-grid > * {
  min-width: 0;
  width: auto !important;
  max-width: none !important;
  flex: initial !important;
  padding: 0 !important;
}

.tl-news-grid article.card,
.tl-news-grid .card {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 0;
  border: 1px solid var(--tl-hairline, #DFDCCB) !important;
  border-radius: 12px;
  background: var(--tl-panel, #FAF9F4) !important;
  overflow: hidden;
  transition: border-color 0.15s ease;
}

.tl-news-grid article.card:hover {
  border-color: var(--tl-accent, #46603C) !important;
}

.tl-news-grid .card-img-top,
.tl-news-grid img {
  width: 100%;
  height: auto;
  display: block;
}

.tl-news-grid .card-body {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.1rem 1.25rem 1.25rem !important;
}

.tl-news-grid .card-title {
  margin: 0;
  font-family: var(--tl-font-display, 'Bricolage Grotesque', system-ui, sans-serif);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.tl-news-grid .card-title a {
  color: var(--tl-ink, #23281F);
  text-decoration: none;
}

.tl-news-grid .card-title a:hover {
  color: var(--tl-accent, #46603C);
}

/* The read time is a note about the article, not a line of its body. */
.tl-news-grid .card-body > p.small:first-of-type {
  margin: 0;
  font-family: var(--tl-font-mono, ui-monospace, monospace);
  font-size: 0.62rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--tl-dim, #8B8F80);
}

.tl-news-grid .card-body p {
  color: var(--tl-muted, #5C6253);
  font-size: 0.9rem;
  line-height: 1.55;
}

.tl-news-grid .card-footer,
.tl-news-grid .card-body > .d-flex:last-child {
  margin-top: auto;
  padding-top: 0.5rem;
  border: 0;
  background: none;
}

.tl-news-pagination {
  margin-top: 2rem;
}

/* ------------------------------------------------------------------
   The article

   The stock block put a three-level breadcrumb, the headline, a black
   Bootstrap badge and four pipe-separated greys above the article. On an
   article written as a finished page that meant the headline twice, in two
   different type systems. What is left is a way back to the newsroom, an
   optional header for articles that do not bring their own, and a foot.
   ------------------------------------------------------------------ */

.tl-article-shell {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.tl-article-back {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  align-self: flex-start;
  font-family: var(--tl-font-mono, ui-monospace, monospace);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tl-muted, #5C6253);
  text-decoration: none;
}

.tl-article-back:hover,
.tl-article-back:focus-visible {
  color: var(--tl-accent, #46603C);
}

.tl-article-head .tl-pagehead-kicker {
  text-decoration: none;
}

.tl-article-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin: 0.75rem 0 0;
  font-family: var(--tl-font-mono, ui-monospace, monospace);
  font-size: 0.72rem;
  color: var(--tl-dim, #8B8F80);
}

.tl-article-meta-sep {
  color: var(--tl-hairline-strong, #C9C5B2);
}

.tl-article-lead-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 1px solid var(--tl-hairline, #DFDCCB);
}

.tl-article-body {
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--tl-ink, #23281F);
}

/* A plain body needs a reading measure. One authored as a page brings its own
   container and column, and a 68ch cap on the outside squeezed that to a
   third of the width it asks for, so the cap goes on the paragraphs instead
   of on the wrapper. */
.tl-article-body > p,
.tl-article-body > ul,
.tl-article-body > ol,
.tl-article-body > h2,
.tl-article-body > h3,
.tl-article-body > blockquote {
  max-width: 68ch;
}

.tl-article-body h2,
.tl-article-body h3 {
  font-family: var(--tl-font-display, 'Bricolage Grotesque', system-ui, sans-serif);
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-top: 2rem;
}

.tl-article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
}

/* Nesting a container inside the page container doubles the gutters. */
.tl-article-body > .container,
.tl-article-body > * > .container {
  padding-left: 0;
  padding-right: 0;
}

.tl-article-foot {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 1rem;
  margin-top: 1rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--tl-hairline, #DFDCCB);
}

.tl-article-tags,
.tl-article-helpful {
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--tl-hairline, #DFDCCB);
  border-radius: 12px;
  background: var(--tl-panel, #FAF9F4);
}

.tl-article-foot-title {
  margin: 0 0 0.75rem;
  font-family: var(--tl-font-mono, ui-monospace, monospace);
  font-size: 0.66rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--tl-dim, #8B8F80);
}

/*
 * The tag cloud is core JScms and ships each tag as a Bootstrap button in one
 * of four contextual colours with an inline font-size for its weight: yellow,
 * blue, green and dark pills between 12px and 30px, on a page whose whole
 * palette is paper and one green. The colour carries nothing (it is picked per
 * tag, not per meaning) and the size only repeats what the ordering already
 * says, so both are dropped. The !important is for the inline style, which is
 * written by the core renderer and cannot be reached any other way.
 */
.tl-article-tags .btn {
  --bs-btn-bg: transparent;
  --bs-btn-border-color: var(--tl-hairline-strong, #C9C5B2);
  --bs-btn-color: var(--tl-ink, #23281F);
  --bs-btn-hover-bg: var(--tl-accent, #46603C);
  --bs-btn-hover-border-color: var(--tl-accent, #46603C);
  --bs-btn-hover-color: var(--tl-accent-ink, #F3F2EC);
  font-size: 0.78rem !important;
  font-weight: 600;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  margin: 0 0.35rem 0.35rem 0;
}

/* The helpful box is core too, and arrives as a pair of outline buttons. */
.tl-article-helpful .btn {
  --bs-btn-border-color: var(--tl-hairline-strong, #C9C5B2);
  --bs-btn-color: var(--tl-ink, #23281F);
  --bs-btn-hover-bg: var(--tl-accent, #46603C);
  --bs-btn-hover-border-color: var(--tl-accent, #46603C);
  --bs-btn-hover-color: var(--tl-accent-ink, #F3F2EC);
}
