/*
 * The blog.
 *
 * Depends on flipside.css for the palette and flipside-cars.css for the page
 * head and breadcrumb.
 *
 * The prose rules matter more than the cards here. The articles came out of
 * WordPress as bare `p`, `h2`, `ul`, `figure` and `img` with no classes of
 * their own, so everything they look like is decided below — measure, rhythm,
 * and what an image does when it is wider than the column.
 */

/* ------------------------------------------------------------------ *
 * Index — the lead article
 * ------------------------------------------------------------------ */

.fl-lead {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 0;
  border: 1px solid var(--fl-border);
  border-radius: 18px;
  overflow: hidden;
  background: #fff;
  margin-bottom: 42px;
  transition: box-shadow 0.25s, border-color 0.25s;
}
.fl-lead:hover { box-shadow: 0 18px 44px rgba(28, 35, 31, 0.1); border-color: transparent; }
@media (max-width: 860px) { .fl-lead { grid-template-columns: 1fr; } }

.fl-lead-media { display: block; overflow: hidden; }
.fl-lead-media img {
  width: 100%;
  height: 100%;
  min-height: 300px;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fl-lead:hover .fl-lead-media img { transform: scale(1.03); }

.fl-lead-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 12px;
  padding: 40px;
}
@media (max-width: 575px) { .fl-lead-body { padding: 26px; } }
.fl-lead-body h2 {
  font-size: 30px;
  line-height: 1.25;
  margin: 0;
  color: var(--fl-heading);
}
@media (max-width: 575px) { .fl-lead-body h2 { font-size: 23px; } }
.fl-lead-body p { margin: 0; font-size: 15px; line-height: 1.75; }

.fl-blog-more {
  font-size: 14px;
  font-weight: 600;
  color: var(--fl-primary);
  margin-top: 4px;
}
.fl-blog-more::after { content: ' →'; }

/* ------------------------------------------------------------------ *
 * Index — the grid
 * ------------------------------------------------------------------ */

.fl-blog-grid {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}

.fl-blog-card {
  border: 1px solid var(--fl-border);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  transition: box-shadow 0.25s, border-color 0.25s;
}
.fl-blog-card:hover { box-shadow: 0 14px 34px rgba(28, 35, 31, 0.09); border-color: transparent; }
.fl-blog-card > a { display: flex; flex-direction: column; height: 100%; }

.fl-blog-media { display: block; overflow: hidden; aspect-ratio: 8 / 5; }
.fl-blog-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fl-blog-card:hover .fl-blog-media img { transform: scale(1.04); }

.fl-blog-body { display: flex; flex-direction: column; gap: 9px; padding: 22px; }
.fl-blog-body h3 {
  font-size: 18px;
  line-height: 1.35;
  margin: 0;
  color: var(--fl-heading);
}
.fl-blog-body p { margin: 0; font-size: 14px; line-height: 1.7; color: var(--fl-text); }

.fl-blog-meta {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--fl-text);
}

.fl-blog-empty {
  border: 1px dashed var(--fl-border);
  border-radius: 16px;
  padding: 48px;
  text-align: center;
}

.fl-blog-pagination { margin-top: 38px; }
.fl-blog-pagination svg { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ *
 * The article
 * ------------------------------------------------------------------ */

.fl-article-head { padding: 54px 0 26px; }
.fl-article-head h1 {
  font-size: 40px;
  line-height: 1.2;
  margin: 10px 0 14px;
  /* A headline is read, not scanned — it gets a measure of its own rather
     than running the full width of the container. */
  max-width: 940px;
}
@media (max-width: 767px) { .fl-article-head { padding: 34px 0 20px; } .fl-article-head h1 { font-size: 28px; } }

.fl-article-hero {
  margin: 0 0 40px;
  border-radius: 18px;
  overflow: hidden;
}
.fl-article-hero img { width: 100%; height: auto; display: block; }

/*
 * The prose.
 *
 * One column, about 68 characters wide, centred. Everything the imported HTML
 * can contain is given a rule here, because the markup carries no classes of
 * its own — if a tag is not styled below it will render at browser defaults,
 * which is how an article ends up with 1990s margins halfway down.
 */
.fl-prose {
  max-width: 68ch;
  margin-inline: auto;
  font-size: 17px;
  line-height: 1.8;
  color: var(--fl-text);
  padding-bottom: 20px;
}

/*
 * The rhythm is one rule on the direct children, set as a bottom margin.
 *
 * Not `* + * { margin-top }` with a `p { margin: 0 }` reset beside it: the
 * reset is a class *and* a type, so it out-specifies the rhythm and every
 * paragraph ends up touching the one above it. Spacing every child the same
 * way, from one declaration, cannot drift like that.
 */
.fl-prose > * { margin: 0 0 1.4em; }
.fl-prose > *:last-child { margin-bottom: 0; }

.fl-prose h2,
.fl-prose h3,
.fl-prose h4 {
  color: var(--fl-heading);
  line-height: 1.3;
  /* More space above a heading than below it, so it belongs to what follows
     rather than floating between two blocks. */
  margin-top: 2em;
  margin-bottom: 0.6em;
}
.fl-prose > h2:first-child,
.fl-prose > h3:first-child { margin-top: 0; }
.fl-prose h2 { font-size: 26px; }
.fl-prose h3 { font-size: 21px; }
.fl-prose h4 { font-size: 18px; }

.fl-prose a { color: var(--fl-primary); text-decoration: underline; text-underline-offset: 3px; }
.fl-prose a:hover { color: var(--fl-heading); }

.fl-prose strong, .fl-prose b { color: var(--fl-heading); font-weight: 600; }

.fl-prose ul, .fl-prose ol { padding-left: 1.3em; }
.fl-prose li + li { margin-top: 0.5em; }
.fl-prose ul { list-style: disc; }
.fl-prose ol { list-style: decimal; }

.fl-prose blockquote {
  padding: 4px 0 4px 22px;
  border-left: 3px solid var(--fl-primary);
  font-size: 19px;
  line-height: 1.7;
  color: var(--fl-heading);
}

/* Images break out of the measure: the text is 68ch for reading, but a
   photograph at 68ch in a 1140px container looks like a mistake. */
.fl-prose figure { margin-block: 2.2em; }
.fl-prose figure img { border-radius: 14px; }
.fl-prose img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 14px;
}
@media (min-width: 1100px) {
  .fl-prose figure,
  .fl-prose > img { width: calc(100% + 160px); margin-inline: -80px; }
}

.fl-prose figcaption {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--fl-text);
  text-align: center;
}

.fl-prose hr { border: 0; border-top: 1px solid var(--fl-border); margin: 2.6em 0; }

.fl-prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.fl-prose th, .fl-prose td { padding: 11px 12px; border-bottom: 1px solid var(--fl-border); text-align: left; }
.fl-prose th { color: var(--fl-heading); font-weight: 600; }

.fl-prose sup { font-size: 0.7em; }

/* ------------------------------------------------------------------ *
 * Previous and next
 * ------------------------------------------------------------------ */

.fl-article-nav { padding: 20px 0 54px; }
.fl-article-nav-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  padding-top: 30px;
  border-top: 1px solid var(--fl-border);
}
@media (max-width: 767px) { .fl-article-nav-row { grid-template-columns: 1fr; } }

.fl-article-nav-link {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 20px 22px;
  border: 1px solid var(--fl-border);
  border-radius: 14px;
  transition: border-color 0.25s;
}
.fl-article-nav-link:hover { border-color: var(--fl-primary); }
.fl-article-nav-link span {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fl-text);
}
.fl-article-nav-link strong { font-size: 15px; line-height: 1.5; color: var(--fl-heading); font-weight: 600; }
.fl-article-nav-link.is-next { text-align: right; }

.fl-more-head { font-size: 24px; margin: 0 0 26px; }
