/* ==========================================================================
   Blog post detail
   Matches the Stitch "blog_post_detail_page" screen.
   ========================================================================== */

.post {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  padding-bottom: 4rem;
}

/* ---- Hero ---------------------------------------------------------------- */
.post-hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  width: 100%;
  /* The design fixes the height at 60vh; min-height lets the title grow on phones. */
  min-height: max(60vh, 400px);
  padding-top: 4rem;
  padding-bottom: 4rem;
  text-align: center;
}
.post-hero__bg { position: absolute; inset: 0; z-index: 0; }
.post-hero__bg img { width: 100%; height: 100%; object-fit: cover; }
.post-hero__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top,
    var(--color-surface),
    color-mix(in srgb, var(--color-surface) 60%, transparent),
    transparent);
}
.post-hero__inner {
  position: relative;
  z-index: 10;
  max-width: 800px;
  padding-inline: var(--page-margin);
}

.post-hero__title {
  margin-bottom: 1.5rem;
  font-size: 3rem;
  line-height: 3.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 4px rgb(0 0 0 / 0.1);
}
.post-hero__lead {
  max-width: 600px;
  margin: 0 auto 2rem;
  font-size: 1.125rem;
  line-height: 1.75rem;
  color: var(--color-on-surface-variant);
}

.post-meta {
  display: flex;
  flex-wrap: wrap; /* the meta row is wider than a phone screen */
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1rem;
  color: var(--color-on-surface-variant);
}
.post-meta__author {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.05em;
}
.post-meta__author img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-soft);
  object-fit: cover;
}
.post-meta__dot {
  width: 0.25rem;
  height: 0.25rem;
  border-radius: var(--radius-soft);
  background: var(--color-outline-variant);
}
.post-meta__info {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--color-outline);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.post-meta__topic {
  color: var(--color-primary);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}
.post-meta__topic:hover { text-decoration: underline; }
.post-meta__info .material-symbols-outlined { font-size: 16px; }

/* On phones the title fills the whole hero, so darken less of the photo behind it. */
@media (max-width: 767.98px) {
  .post-hero__bg::after {
    background: linear-gradient(to top,
      var(--color-surface) 30%,
      color-mix(in srgb, var(--color-surface) 75%, transparent) 70%,
      color-mix(in srgb, var(--color-surface) 45%, transparent));
  }
}

@media (min-width: 768px) {
  .post-hero__inner { padding-inline: 0; }
  .post-hero__title { font-size: 3.5rem; line-height: 4rem; }
}

/* ---- Article body -------------------------------------------------------- */
.post-body {
  width: 100%;
  max-width: 720px;
  margin-top: 2rem;
  padding-inline: var(--page-margin);
}

.post-content__intro { margin-bottom: 1.5rem; font-size: 1.125rem; line-height: 1.75rem; }
.post-content__intro::first-letter {
  float: left;
  margin-right: 1rem;
  font-family: var(--font-headline);
  font-size: 3rem;
  line-height: 1; /* the design's code asks for purple, but its render shows the body colour; this matches the render */
}
.post-content__para { margin-bottom: 1.5rem; }
.post-content__para--loose { margin-bottom: 2rem; }

.post-content__h2 { margin: 3rem 0 1.5rem; font-size: 2rem; line-height: 2.5rem; font-weight: 700; }
.post-content__h2--sm { margin: 2.5rem 0 1rem; font-size: 1.5rem; line-height: 2rem; font-weight: 600; }

.post-quote { position: relative; margin: 3rem 0; }
.post-quote::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1rem;
  width: 0.25rem;
  border-radius: var(--radius-soft);
  background: linear-gradient(to bottom, var(--color-primary), transparent);
}
.post-quote blockquote {
  margin: 0;
  padding: 1rem 0 1rem 2rem;
  font-family: var(--font-headline);
  font-size: 2rem;
  line-height: 2.5rem;
  font-weight: 700;
  font-style: italic;
  color: var(--color-primary-container);
}
.post-quote__cite {
  margin-top: 0.5rem;
  padding-left: 2rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  color: var(--color-outline);
}

/* The design bleeds the photo 5vw past the text on small screens; capped at the page margin so it never overflows. */
.post-figure { margin: 2.5rem max(-5vw, calc(-1 * var(--page-margin))); }
.post-figure img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-card);
  box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05);
}
.post-figure figcaption {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--color-outline);
}

.post-list { margin: 0 0 2.5rem; padding: 0; list-style: none; }
.post-list li { display: flex; align-items: flex-start; gap: 0.75rem; }
.post-list li + li { margin-top: 1rem; }
.post-list .material-symbols-outlined { margin-top: 0.25rem; color: var(--color-secondary); }

@media (min-width: 768px) {
  .post-body { padding-inline: 0; }
  .post-figure { margin-inline: 0; }
}

/* ---- Tags & share -------------------------------------------------------- */
.post-footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--color-surface-container-highest);
}
.post-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.post-tag {
  padding: 0.25rem 0.75rem;
  border-radius: var(--radius-soft);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  color: var(--color-primary);
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  transition: background-color 150ms var(--ease);
}
.post-tag:hover { background: color-mix(in srgb, var(--color-primary) 18%, transparent); }

.post-share {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: var(--color-on-surface-variant);
}
.post-share__label { font-size: 0.875rem; line-height: 1.25rem; font-weight: 600; letter-spacing: 0.05em; }
.post-share__btn { display: flex; transition: color 150ms var(--ease); }
.post-share__btn:hover,
.post-share__btn[aria-expanded="true"] { color: var(--color-primary); }
.post-share__status {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.share-menu { position: relative; display: flex; }
.share-menu__panel {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  min-width: 11rem;
  padding: 0.5rem;
  border: 1px solid var(--color-outline-variant);
  border-radius: var(--radius-card);
  background: var(--color-surface-container-lowest);
  box-shadow: 0 12px 24px rgb(0 0 0 / 0.08);
}
.share-menu__panel[hidden] { display: none; }
.share-menu__item {
  display: block;
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-control);
  color: var(--color-on-surface);
  font-size: 0.875rem;
  line-height: 1.25rem;
  text-align: left;
}
.share-menu__item:hover { background: var(--color-surface-container); color: var(--color-primary); }

@media (min-width: 768px) {
  .post-footer { flex-direction: row; }
}

/* ---- Preview banner (staff viewing a draft or scheduled post) --------------- */
.post-preview {
  width: 100%;
  padding: 0.75rem var(--page-margin);
  background: var(--color-secondary-container);
  color: var(--color-on-secondary-fixed);
  text-align: center;
  font-weight: 600;
}

/* ---- Article body from the dashboard editor -------------------------------- */
.post-content { line-height: 1.75; }
.post-content.rich-text > * + * { margin-top: 1.5rem; }
.post-content > p:first-child { font-size: 1.125rem; line-height: 1.75rem; }
.post-content > p:first-child::first-letter {
  float: left;
  margin-right: 1rem;
  font-family: var(--font-headline);
  font-size: 3rem;
  line-height: 1;
}
.post-content.rich-text h2 { margin-top: 3rem; font-size: 2rem; line-height: 2.5rem; font-weight: 700; }
.post-content.rich-text h3 { margin-top: 2.5rem; font-size: 1.5rem; line-height: 2rem; font-weight: 600; }
.post-content.rich-text blockquote {
  position: relative;
  margin-block: 3rem;
  padding: 1rem 0 1rem 2rem;
  border-left: 0;
  font-size: 2rem;
  line-height: 2.5rem;
  font-weight: 700;
  color: var(--color-primary-container);
}
.post-content.rich-text blockquote::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: -1rem;
  width: 0.25rem;
  border-radius: var(--radius-soft);
  background: linear-gradient(to bottom, var(--color-primary), transparent);
}
.post-content.rich-text img { width: 100%; box-shadow: 0 1px 2px 0 rgb(0 0 0 / 0.05); }
.post-content.rich-text ul { padding-left: 0; list-style: none; }
.post-content.rich-text ul li { position: relative; padding-left: 2rem; }
.post-content.rich-text ul li + li { margin-top: 1rem; }
.post-content.rich-text ul li::before {
  content: "\25C6";
  position: absolute;
  left: 0.25rem;
  color: var(--color-secondary);
  font-size: 0.875rem;
}
@media (max-width: 639.98px) {
  .post-content.rich-text blockquote { font-size: 1.5rem; line-height: 2rem; }
}
