/* --------------------------------------------------------------------------
   Sentiv blog
   Loaded only on /blog and /blog/<slug>, after landing.css — which is where every
   custom property, `.shell`, `.shell--reading`, `.section`, `.prose`, `.btn` and the
   base reset come from.
   -------------------------------------------------------------------------- */


/* --------------------------------------------------------------------------
   Layout
   -------------------------------------------------------------------------- */

/* Deliberately not `.grid--3`: at >=64rem that modifier becomes a six-track span layout
   with :nth-child(4)/(5) hardcoded, tuned for exactly five campaign cards. A blog grows
   one post at a time. */
.post-grid {
  display: grid;
  gap: var(--gap);
  grid-template-columns: 1fr;
  margin-top: var(--gap);
}


/* --------------------------------------------------------------------------
   Tag filter chips (#tagChip)
   -------------------------------------------------------------------------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: clamp(28px, 4vw, 40px);
}

.chip-row--tight {
  justify-content: flex-start;
  margin-top: 16px;
}

.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 15px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-muted);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}

.chip:hover {
  border-color: var(--ink-faint);
  color: var(--ink);
}

.chip--active {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--ink-invert);
}

.chip--active:hover {
  color: var(--ink-invert);
}


/* --------------------------------------------------------------------------
   Post cards
   -------------------------------------------------------------------------- */

/* The whole card is one anchor. A card with a nested "Read post" link would give assistive
   tech two targets for one destination, and clicking the padding would do nothing. */
.post-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-card);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

/* Matches `.logo-tile:hover`, the only lift pattern already on the site. */
.post-card:hover {
  border-color: var(--border-strong);
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), 0 10px 28px rgba(16, 16, 16, 0.06);
}

.post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 22px;
}

.post-card__eyebrow {
  display: block;
  margin-bottom: 10px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
}

.post-card__eyebrow--draft {
  color: var(--danger);
}

.post-card__title {
  margin-top: 12px;
  font-size: 1.0625rem;
  letter-spacing: -0.015em;
}

.post-card__excerpt {
  margin-top: 10px;
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--ink-muted);
  text-wrap: pretty;
}

/* `auto` pins the call to action to the bottom, so cards with different excerpt
   lengths still line up along their last row. */
.post-card__more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: auto;
  padding-top: 18px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.post-card__arrow {
  transition: transform 0.18s ease;
}

.post-card:hover .post-card__arrow {
  transform: translateX(3px);
}

.post-card--featured {
  margin-top: clamp(28px, 4vw, 40px);
}

.post-card--featured .post-card__title {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
}

.post-card--featured .post-card__excerpt {
  max-width: 62ch;
  font-size: 0.9375rem;
}

.blog-empty {
  margin-top: clamp(40px, 5vw, 56px);
  text-align: center;
  color: var(--ink-muted);
}


/* --------------------------------------------------------------------------
   Post header (#postMeta)
   -------------------------------------------------------------------------- */

.post-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink-faint);
}

.post-header {
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.post-header__back a {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-muted);
  text-decoration: none;
}

.post-header__back a:hover {
  color: var(--ink);
}

.post-header__draft {
  margin-top: 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--danger);
}

.post-header__title {
  margin: 14px 0 16px;
  font-size: clamp(2rem, 4.5vw, 2.75rem);
}

.post-header__author {
  margin-top: 12px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.post-hero-image {
  width: 100%;
  margin-top: 32px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}


/* --------------------------------------------------------------------------
   Comments
   -------------------------------------------------------------------------- */

.comments__title {
  font-size: 1.25rem;
}

.comments__notice {
  margin-top: 16px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  font-size: 0.875rem;
}

.comments__notice--warn {
  border-color: var(--border-strong);
  color: var(--ink-muted);
}

.comments__empty {
  margin-top: 16px;
  font-size: 0.875rem;
  color: var(--ink-muted);
}

.comment-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.comment {
  padding: 18px 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.comment__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: var(--ink-faint);
}

.comment__author {
  font-weight: 600;
  color: var(--ink);
}

.comment__body {
  margin-top: 10px;
  font-size: 0.9375rem;
  line-height: 1.65;
  color: var(--ink-muted);
  /* Line breaks come from here, not from <br> in the markup: the body is rendered through
     Leaf's escaping #(...) and no HTML inside it is ever interpreted.
     `anywhere` stops a 400-character unbroken string from blowing out the column. */
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}


/* --------------------------------------------------------------------------
   Comment form

   Intentionally not named `.subscribe*`: initSubscribeValidation() in landing.js queries
   `.subscribe` and would otherwise adopt this form and its Mailchimp-shaped expectations.
   -------------------------------------------------------------------------- */

.comment-form {
  display: grid;
  gap: 14px;
  margin-top: 32px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.comment-form__row {
  display: grid;
  gap: 14px;
}

.comment-form__label {
  display: block;
  margin-bottom: 6px;
  font-size: 0.8125rem;
  font-weight: 600;
}

.comment-form__optional {
  font-weight: 400;
  color: var(--ink-faint);
}

.comment-form__input {
  width: 100%;
  padding: 11px 14px;
  background: var(--canvas);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  color: var(--ink);
  font: inherit;
  font-size: 0.9375rem;
}

.comment-form__textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.6;
}

.comment-form__input[aria-invalid="true"] {
  border-color: var(--danger);
}

.comment-form__counter {
  margin-top: 6px;
  font-size: 0.75rem;
  color: var(--ink-faint);
  text-align: right;
}

.comment-form__counter[data-over="true"] {
  color: var(--danger);
}

.comment-form__hint,
.comment-form__error {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--danger);
}

.comment-form__hint[hidden] {
  display: none;
}

.comment-form__actions {
  justify-self: start;
}

.comment-form__submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.comment-form__submit:disabled:hover {
  transform: none;
}


/* --------------------------------------------------------------------------
   Breakpoints — same rem-based, mobile-first scale as landing.css
   -------------------------------------------------------------------------- */

@media (min-width: 48rem) {
  .post-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .comment-form__row {
    grid-template-columns: 1fr 1fr;
  }

  .post-card--featured .post-card__body {
    padding: clamp(28px, 4vw, 40px);
  }
}

@media (min-width: 64rem) {
  .post-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* --------------------------------------------------------------------------
   Reduced motion

   landing.css has its own copy of this for `.btn` and `.logo-tile`. This file owns the
   hover transforms it introduces, so it owns the reset for them — add any new
   hover-transform in this file to the list below at the same time.
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  .post-card:hover,
  .post-card:hover .post-card__arrow {
    transform: none;
  }
}
