/* ==========================================================================
   PALATEFUL — COMPONENTS
   Masthead, navigation, cards, figures, article furniture, footer.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Brand mark
   -------------------------------------------------------------------------- */
.brand {
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.brand__logo {
  height: 72px;
  width: auto;
  display: block;
}

/* The supplied logo carries a forest-green wordmark and forest-green leaves.
   Those disappear against the dark-green footer, so on inverted grounds the
   mark sits on a cream plaque — the logo itself is never recoloured. */
.brand--invert .brand__logo {
  height: 104px;
  background: var(--pf-cream);
  padding: var(--sp-4) var(--sp-5);
  box-sizing: content-box;
}

.brand--lg .brand__logo {
  height: 104px;
}

@media (max-width: 900px) {
  .brand__logo {
    height: 48px;
  }
  .brand--invert .brand__logo {
    height: 84px;
    padding: var(--sp-3) var(--sp-4);
  }
}

/* Typographic fallback used only until the supplied logo file is in place. */
.brand--fallback .brand__word {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: var(--wt-semi);
  letter-spacing: 0.02em;
  color: var(--pf-forest-700);
}

.brand--lg.brand--fallback .brand__word {
  font-size: 2.4rem;
}

.brand--invert.brand--fallback .brand__word {
  color: var(--pf-on-dark);
}

/* --------------------------------------------------------------------------
   Masthead
   -------------------------------------------------------------------------- */
.masthead {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: color-mix(in srgb, var(--pf-cream) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--rule);
  transition: transform var(--dur-base) var(--ease-editorial);
}

.masthead.is-hidden {
  transform: translateY(-100%);
}

.masthead__inner {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-5);
}

.masthead__brand {
  display: inline-flex;
  flex-shrink: 0;
}

.nav__list {
  display: flex;
  align-items: center;
  gap: clamp(var(--sp-4), 2vw, var(--sp-7));
}

.nav__link {
  font-size: var(--fs-meta);
  font-weight: var(--wt-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-soft);
  padding-block: var(--sp-2);
  position: relative;
  transition: color var(--dur-fast) ease;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: var(--pf-terracotta);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--dur-base) var(--ease-editorial);
}

.nav__link:hover,
.nav__link.is-active {
  color: var(--pf-forest-700);
}

.nav__link:hover::after,
.nav__link.is-active::after {
  transform: scaleX(1);
}

.masthead__utils {
  display: flex;
  align-items: center;
  gap: var(--sp-2);
  flex-shrink: 0;
}

.live-links {
  display: flex;
  gap: var(--sp-2);
  margin: 0 var(--sp-2) 0 0;
  padding: 0;
  list-style: none;
}

.live-links__btn {
  display: inline-block;
  padding: 0.4rem 0.8rem;
  font-size: var(--fs-meta);
  font-weight: var(--wt-medium);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--pf-forest-700);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.live-links__btn:hover,
.live-links__btn.is-active {
  background: var(--pf-forest-700);
  color: var(--pf-on-dark);
}

.icon-btn {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: var(--text-soft);
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}

.icon-btn:hover {
  color: var(--pf-forest-700);
}

.icon-btn svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
  stroke-linecap: round;
}

.icon-btn--menu {
  display: none;
}

.icon-btn__bars {
  display: block;
  width: 20px;
}

.icon-btn__bars i {
  display: block;
  height: 1.4px;
  background: currentColor;
  border-radius: 2px;
}

.icon-btn__bars i + i {
  margin-top: 5px;
  width: 68%;
}

@media (max-width: 1040px) {
  .nav {
    display: none;
  }
  .icon-btn--menu {
    display: grid;
  }
}

/* Too tight next to the full nav below this width — the drawer lists them instead. */
@media (max-width: 1240px) {
  .live-links {
    display: none;
  }
  .icon-btn--menu {
    display: grid;
  }
}

/* --------------------------------------------------------------------------
   Mobile drawer
   -------------------------------------------------------------------------- */
.drawer {
  position: fixed;
  inset: 0;
  z-index: var(--z-drawer);
  background: rgba(18, 36, 29, 0.44);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-editorial);
}

.drawer.is-open {
  opacity: 1;
}

.drawer__panel {
  position: absolute;
  inset: 0 0 0 auto;
  width: min(420px, 90vw);
  background: var(--pf-cream);
  padding: var(--sp-5) var(--sp-6) var(--sp-7);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--dur-base) var(--ease-editorial);
  overflow-y: auto;
}

.drawer.is-open .drawer__panel {
  transform: none;
}

.drawer__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--sp-6);
}

.drawer__nav li + li {
  border-top: 1px solid var(--rule);
}

.drawer__nav a {
  display: block;
  padding-block: var(--sp-4);
}

.drawer__label {
  display: block;
  font-family: var(--font-display);
  font-size: 1.7rem;
  line-height: 1.15;
  letter-spacing: var(--ls-heading);
  color: var(--text);
}

.drawer__blurb {
  display: block;
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-top: 2px;
}

.drawer__foot {
  margin-top: auto;
  padding-top: var(--sp-6);
}

.drawer__tagline {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: var(--sp-4);
}

.drawer__social {
  display: flex;
  gap: var(--sp-5);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .drawer,
  .drawer__panel {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Search overlay
   -------------------------------------------------------------------------- */
.search {
  position: fixed;
  inset: 0;
  z-index: var(--z-search);
  background: rgba(18, 36, 29, 0.5);
  opacity: 0;
  transition: opacity var(--dur-base) var(--ease-editorial);
}

.search.is-open {
  opacity: 1;
}

.search__panel {
  background: var(--pf-cream);
  padding: var(--sp-5) var(--gutter) var(--sp-7);
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(-14px);
  transition: transform var(--dur-base) var(--ease-editorial);
}

.search.is-open .search__panel {
  transform: none;
}

.search__bar {
  max-width: var(--container-narrow);
  margin-inline: auto;
  display: flex;
  align-items: center;
  gap: var(--sp-4);
  border-bottom: 1px solid var(--rule-strong);
  padding-bottom: var(--sp-4);
}

.search__icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: var(--text-muted);
  stroke-width: 1.4;
  flex-shrink: 0;
}

.search__input {
  flex: 1;
  border: 0;
  background: none;
  font-family: var(--font-display);
  font-size: clamp(1.4rem, 1rem + 1.6vw, 2.2rem);
  padding: var(--sp-2) 0;
}

.search__input:focus {
  outline: none;
}

.search__results {
  max-width: var(--container-narrow);
  margin: var(--sp-6) auto 0;
}

.search__hint {
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.search__hint em {
  font-style: normal;
  color: var(--pf-terracotta);
}

.result {
  display: block;
  padding: var(--sp-4) 0;
  border-top: 1px solid var(--rule);
}

.result__kicker {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--pf-terracotta);
}

.result__title {
  font-family: var(--font-display);
  font-size: 1.3rem;
  line-height: 1.2;
  margin-top: 2px;
}

.result__dek {
  font-size: var(--fs-small);
  color: var(--text-muted);
  margin-top: 4px;
  max-width: var(--measure);
}

.result:hover .result__title {
  color: var(--pf-terracotta);
}

.search__empty {
  color: var(--text-muted);
  font-size: var(--fs-small);
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */
.crumbs {
  padding-block: var(--sp-5) 0;
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  font-size: var(--fs-meta);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--text-muted);
}

.crumbs i {
  margin-left: var(--sp-2);
  color: var(--pf-ink-faint);
  font-style: normal;
}

.crumbs a:hover {
  color: var(--pf-terracotta);
}

/* --------------------------------------------------------------------------
   Meta separators
   -------------------------------------------------------------------------- */
.meta__sep {
  margin-inline: 0.55em;
  color: var(--pf-ink-faint);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */
.card__link {
  display: block;
  height: 100%;
}

.card__media {
  position: relative;
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.card__kicker {
  margin-bottom: var(--sp-3);
}

.card__title {
  transition: color var(--dur-base) var(--ease-editorial);
  text-wrap: balance;
}

.card__link:hover .card__title {
  color: var(--pf-terracotta);
}

.card__romanised {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.card__dek {
  margin-top: var(--sp-3);
  color: var(--text-soft);
  font-size: var(--fs-small);
  line-height: 1.6;
  max-width: 46ch;
}

.card__meta {
  margin-top: var(--sp-4);
}

.card__badge {
  position: absolute;
  left: var(--sp-3);
  top: var(--sp-3);
  background: color-mix(in srgb, var(--pf-cream) 92%, transparent);
  backdrop-filter: blur(4px);
  color: var(--pf-forest-700);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-weight: var(--wt-semi);
  padding: 6px 10px;
}

.card__specs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-5);
  margin-top: var(--sp-4);
  padding-top: var(--sp-4);
  border-top: 1px solid var(--rule);
  font-size: var(--fs-meta);
  color: var(--text-soft);
}

.card__specs span {
  display: block;
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 3px;
}

/* Feature card — large, image-led */
.card--feature .card__title {
  max-width: 18ch;
}

.card--feature .card__dek {
  font-size: var(--fs-lead);
  max-width: 52ch;
}

/* Wide card — image beside text */
.card--wide .card__link {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1fr);
  gap: var(--sp-6);
  align-items: center;
}

.card--wide .card__media {
  margin-bottom: 0;
}

@media (max-width: 760px) {
  .card--wide .card__link {
    grid-template-columns: 1fr;
    gap: var(--sp-4);
  }
}

/* Minimal card — text only, rule separated */
.card--minimal {
  border-top: 1px solid var(--rule);
}

.card--minimal .card__link {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--sp-5);
  align-items: start;
  padding-block: var(--sp-5);
  transition: background var(--dur-base) ease;
}

.card--minimal .card__index {
  font-family: var(--font-display);
  font-size: 1rem;
  color: var(--pf-ink-faint);
  padding-top: 2px;
}

.card--minimal .card__arrow {
  color: var(--pf-ink-faint);
  transition: transform var(--dur-base) var(--ease-editorial), color var(--dur-base) ease;
  padding-top: 2px;
}

.card--minimal .card__link:hover .card__arrow {
  transform: translateX(5px);
  color: var(--pf-terracotta);
}

.card--minimal .card__meta {
  margin-top: var(--sp-3);
}

@media (max-width: 600px) {
  .card--minimal .card__link {
    grid-template-columns: minmax(0, 1fr) auto;
  }
  .card--minimal .card__index {
    display: none;
  }
}

/* --------------------------------------------------------------------------
   Index grids
   -------------------------------------------------------------------------- */
.index-grid {
  display: grid;
  gap: clamp(var(--sp-6), 3.5vw, var(--sp-9)) var(--sp-6);
}

.index-grid--recipes,
.index-grid--three {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.index-grid--ingredients {
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
}

.index-grid--two {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.index-empty {
  padding-block: var(--sp-9);
  text-align: center;
  color: var(--text-muted);
  font-family: var(--font-display);
  font-size: 1.3rem;
}

/* --------------------------------------------------------------------------
   Filters
   -------------------------------------------------------------------------- */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: var(--sp-5) var(--sp-7);
  padding-bottom: var(--sp-6);
  margin-bottom: clamp(var(--sp-6), 4vw, var(--sp-8));
  border-bottom: 1px solid var(--rule);
}

.filters__search {
  flex: 1 1 260px;
}

.filters__input,
.search-page__input {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--rule-strong);
  background: none;
  padding: var(--sp-3) 0;
  font-family: var(--font-display);
  font-size: 1.15rem;
}

.filters__input:focus,
.search-page__input:focus {
  outline: none;
  border-color: var(--pf-forest-700);
}

.filters__legend {
  display: block;
  margin-bottom: var(--sp-3);
}

.filters__chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
}

.chip {
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  padding: 8px 14px;
  border: 1px solid var(--rule);
  color: var(--text-soft);
  min-height: 38px;
  transition: all var(--dur-fast) ease;
}

.chip:hover {
  border-color: var(--pf-forest-700);
  color: var(--pf-forest-700);
}

.chip.is-active {
  background: var(--pf-forest-700);
  border-color: var(--pf-forest-700);
  color: var(--pf-rice);
}

.filters__count {
  margin-left: auto;
}

/* --------------------------------------------------------------------------
   Editorial feature block
   -------------------------------------------------------------------------- */
.feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: clamp(var(--sp-6), 5vw, var(--sp-10));
  align-items: center;
}

.feature--flip .feature__media {
  order: 2;
}

.feature__title {
  margin-block: var(--sp-4) var(--sp-5);
}

.feature__title a {
  transition: color var(--dur-base) ease;
}

.feature__title a:hover {
  color: var(--pf-terracotta);
}

.feature__kicker {
  color: var(--pf-terracotta);
  margin-top: var(--sp-3);
}

.feature__dek {
  margin-bottom: var(--sp-4);
}

.feature__body {
  color: var(--text-soft);
  font-size: var(--fs-small);
  line-height: 1.7;
  max-width: 52ch;
  margin-bottom: var(--sp-6);
}

@media (max-width: 900px) {
  .feature {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
  }
  .feature--flip .feature__media {
    order: 0;
  }
}

/* --------------------------------------------------------------------------
   Section tiles
   -------------------------------------------------------------------------- */
.tile {
  display: block;
  position: relative;
}

.tile__media {
  overflow: hidden;
  margin-bottom: var(--sp-4);
}

.tile__body {
  display: flex;
  flex-direction: column;
  gap: var(--sp-2);
}

.tile__n {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  color: var(--pf-ink-faint);
}

.tile__title {
  transition: color var(--dur-base) ease;
}

.tile:hover .tile__title {
  color: var(--pf-terracotta);
}

.tile__blurb {
  color: var(--text-muted);
  font-size: var(--fs-small);
}

.tile__cue {
  color: var(--pf-ink-faint);
  transition: transform var(--dur-base) var(--ease-editorial);
  margin-top: var(--sp-2);
}

.tile:hover .tile__cue {
  transform: translateX(6px);
  color: var(--pf-terracotta);
}

/* --------------------------------------------------------------------------
   Article furniture
   -------------------------------------------------------------------------- */
.art-hero {
  padding-top: clamp(var(--sp-6), 4vw, var(--sp-9));
}

.art-hero__title {
  margin-block: var(--sp-4) var(--sp-4);
  max-width: 20ch;
}

.art-hero__romanised {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 1rem + 0.6vw, 1.5rem);
  color: var(--pf-moss-500);
  margin-bottom: var(--sp-4);
}

.art-hero__dek {
  margin-bottom: var(--sp-5);
}

.art-hero__media {
  margin-top: clamp(var(--sp-6), 4vw, var(--sp-8));
}

.article {
  padding-block: clamp(var(--sp-7), 5vw, var(--sp-10));
}

.standfirst {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 1.05rem + 1vw, 1.75rem);
  line-height: 1.42;
  font-style: italic;
  font-weight: var(--wt-light);
  color: var(--pf-forest-700);
  max-width: var(--measure);
  padding-bottom: clamp(var(--sp-6), 4vw, var(--sp-8));
  margin-bottom: clamp(var(--sp-6), 4vw, var(--sp-8));
  border-bottom: 1px solid var(--rule);
  text-wrap: balance;
}

.pull-quote--block {
  margin-block: clamp(var(--sp-6), 4vw, var(--sp-8));
  padding-left: var(--sp-6);
  border-left: 2px solid var(--pf-terracotta);
  max-width: var(--measure);
}

.note {
  margin-block: var(--sp-6);
  padding: var(--sp-5) var(--sp-6);
  background: var(--pf-cream-warm);
  border-left: 2px solid var(--pf-moss-500);
  max-width: var(--measure);
}

.note--warn {
  background: color-mix(in srgb, var(--pf-terracotta) 8%, var(--pf-cream));
  border-left-color: var(--pf-terracotta);
}

.note__title {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  font-weight: var(--wt-semi);
  color: var(--pf-forest-700);
  margin-bottom: var(--sp-2);
}

.note--warn .note__title {
  color: var(--pf-terracotta-dark);
}

.note__body {
  font-size: var(--fs-small);
  line-height: 1.65;
  color: var(--text-soft);
}

.figure-block {
  margin-block: clamp(var(--sp-6), 4vw, var(--sp-8));
}

.figure-block--full {
  margin-inline: calc(var(--gutter) * -1);
}

/* --------------------------------------------------------------------------
   Tags
   -------------------------------------------------------------------------- */
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-2);
  margin-top: clamp(var(--sp-7), 5vw, var(--sp-9));
  padding-top: var(--sp-5);
  border-top: 1px solid var(--rule);
}

.tag {
  font-size: var(--fs-meta);
  letter-spacing: 0.04em;
  color: var(--text-muted);
  border: 1px solid var(--rule);
  padding: 5px 11px;
}

/* --------------------------------------------------------------------------
   Author block
   -------------------------------------------------------------------------- */
.author-block {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: var(--sp-5);
  align-items: start;
  margin-top: var(--sp-7);
  padding: var(--sp-6);
  background: var(--pf-cream-warm);
}

.author-block__name {
  margin-top: var(--sp-2);
}

.author-block__role {
  margin-top: 2px;
}

.author-block__intro {
  margin-block: var(--sp-3) var(--sp-4);
  font-size: var(--fs-small);
  line-height: 1.65;
  color: var(--text-soft);
  max-width: 54ch;
}

@media (max-width: 620px) {
  .author-block {
    grid-template-columns: 84px minmax(0, 1fr);
    gap: var(--sp-4);
    padding: var(--sp-5);
  }
}

/* --------------------------------------------------------------------------
   Engagement — likes + comments (features/engagement.js)
   -------------------------------------------------------------------------- */
.engagement {
  margin-top: var(--sp-7);
  padding-top: var(--sp-6);
  border-top: 1px solid var(--rule);
}

/* The form and .btn set their own display, which would beat [hidden]. */
.engagement [hidden] {
  display: none !important;
}

.engagement__likes {
  display: flex;
  align-items: center;
  gap: var(--sp-3);
}

.engagement__likes[data-state='unknown'] .engagement__count {
  color: var(--pf-ink-faint);
}

.like-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  color: var(--text-soft);
  transition: color var(--dur-base) ease, border-color var(--dur-base) ease,
    background var(--dur-base) ease;
}

.like-btn:hover:not(:disabled) {
  color: var(--pf-terracotta);
  border-color: var(--pf-terracotta);
}

.like-btn:disabled {
  cursor: default;
  opacity: 0.55;
}

.like-btn__icon {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
}

.like-btn[aria-pressed='true'] {
  color: var(--pf-terracotta);
  border-color: var(--pf-terracotta);
  background: rgba(169, 80, 60, 0.08);
}

.like-btn[aria-pressed='true'] .like-btn__icon {
  fill: currentColor;
}

.comments {
  margin-top: var(--sp-6);
}

.comments__count {
  margin-left: var(--sp-1);
}

.comments__status:empty {
  display: none;
}

.comments__status {
  margin-top: var(--sp-4);
  font-size: var(--fs-small);
  color: var(--text-muted);
}

.comments__cta {
  margin-top: var(--sp-4);
}

.comments__list {
  margin-top: var(--sp-4);
}

.comment {
  padding-block: var(--sp-4);
  border-bottom: 1px solid var(--rule);
}

.comment:first-child {
  border-top: 1px solid var(--rule);
}

.comment__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-1) var(--sp-3);
}

.comment__author {
  color: var(--text);
  font-weight: var(--wt-semi);
}

.comment__edited {
  font-style: italic;
  text-transform: none;
}

.comment__reply {
  margin-top: var(--sp-1);
  font-size: var(--fs-meta);
  color: var(--pf-forest-600);
}

.comment__text {
  margin-top: var(--sp-2);
  max-width: var(--measure);
  font-size: var(--fs-small);
  line-height: 1.65;
  color: var(--text-soft);
  white-space: pre-line;
  overflow-wrap: anywhere;
}

.comment__actions {
  display: flex;
  gap: var(--sp-4);
  margin-top: var(--sp-2);
}

.comment__action {
  padding: 0;
  font-size: var(--fs-meta);
  font-weight: var(--wt-semi);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--pf-forest-700);
  border-bottom: 1px solid transparent;
}

.comment__action:hover {
  border-color: currentColor;
}

.comment__action--danger {
  color: var(--pf-terracotta-dark);
}

.comment-form {
  display: grid;
  gap: var(--sp-2);
  margin-top: var(--sp-4);
}

.comment-form__input {
  width: 100%;
  min-height: 6rem;
  padding: var(--sp-3);
  font: inherit;
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg-raised);
  border: 1px solid var(--rule-strong);
  resize: vertical;
}

.comment-form__input:focus {
  border-color: var(--pf-forest-700);
}

.comment-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.comment-form--edit {
  margin-top: var(--sp-2);
}

.comments__load-more {
  margin-top: var(--sp-5);
}

@media (prefers-reduced-motion: reduce) {
  .like-btn {
    transition: none;
  }
}

/* --------------------------------------------------------------------------
   Related
   -------------------------------------------------------------------------- */
.related {
  border-top: 1px solid var(--rule);
}

.related__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  gap: var(--sp-6);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.footer {
  background: var(--pf-forest-900);
  color: var(--pf-on-dark);
  padding-bottom: var(--sp-7);
}

.footer__main {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1.4fr);
  gap: clamp(var(--sp-6), 5vw, var(--sp-10));
  padding-block: clamp(var(--sp-7), 5vw, var(--sp-9));
}

.footer__statement {
  color: var(--pf-on-dark-muted);
  font-size: var(--fs-small);
  line-height: 1.7;
  max-width: 44ch;
  margin-top: var(--sp-5);
}

.footer__creed {
  margin-top: var(--sp-5);
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--pf-moss-300);
}

.footer__creed i {
  margin-inline: 0.6em;
  font-style: normal;
  color: var(--pf-terracotta-soft);
}

.footer__cols {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: var(--sp-6);
}

.footer__col ul {
  margin-top: var(--sp-4);
  display: grid;
  gap: var(--sp-3);
}

.footer__col a {
  color: var(--pf-on-dark-muted);
  font-size: var(--fs-small);
  transition: color var(--dur-fast) ease;
}

.footer__col a:hover {
  color: var(--pf-saffron);
}

.footer__base {
  border-top: 1px solid var(--rule-invert);
  padding-top: var(--sp-5);
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3) var(--sp-6);
  justify-content: space-between;
  font-size: var(--fs-meta);
  color: var(--pf-on-dark-muted);
}

.footer__colophon a {
  color: var(--pf-moss-300);
  text-decoration: underline;
  text-underline-offset: 3px;
}

@media (max-width: 860px) {
  .footer__main {
    grid-template-columns: 1fr;
  }
}

/* --------------------------------------------------------------------------
   Tables (credits)
   -------------------------------------------------------------------------- */
.credits {
  width: 100%;
  border-collapse: collapse;
  margin-top: var(--sp-7);
  font-size: var(--fs-small);
  display: block;
  overflow-x: auto;
  white-space: nowrap;
}

.credits th,
.credits td {
  text-align: left;
  padding: var(--sp-3) var(--sp-4) var(--sp-3) 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: top;
}

.credits th {
  font-size: var(--fs-label);
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: var(--wt-semi);
}

.credits code {
  font-size: 0.85em;
  color: var(--pf-terracotta-dark);
}

.credits a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--sp-3);
  margin-top: var(--sp-6);
}

/* ==========================================================================
   TOASTS — alerts from src/scripts/toast.js
   Dark forest cards in the corner. Each type has one accent colour (--tc)
   that tints the icon, the action link and the timer bar along the bottom.
   ========================================================================== */
.toasts {
  position: fixed;
  z-index: 400;
  right: max(24px, env(safe-area-inset-right));
  bottom: max(24px, env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  width: min(400px, calc(100vw - 32px));
  pointer-events: none;
}

.toast {
  --tc: var(--pf-moss-300);
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 14px;
  align-items: start;
  margin-top: 12px;
  padding: 16px 10px 18px 16px;
  color: var(--pf-on-dark);
  background:
    radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--tc) 14%, transparent), transparent 55%),
    var(--pf-forest-900);
  border: 1px solid rgba(242, 236, 225, 0.08);
  border-radius: 10px;
  box-shadow:
    0 28px 50px -24px rgba(18, 36, 29, 0.6),
    0 2px 8px rgba(18, 36, 29, 0.18);
  overflow: hidden;
  pointer-events: auto;
  touch-action: pan-y;
  user-select: none;
  /* `backwards`, not `both`: once it has landed the animation must let go of
     transform, or dragging the toast would do nothing. */
  animation: toast-in 560ms cubic-bezier(0.34, 1.4, 0.64, 1) backwards;
}

.toast.is-dragging {
  cursor: grabbing;
  transition: none;
}

.toast--success { --tc: #9fd3ae; }
.toast--error   { --tc: #ff9d86; }
.toast--warn    { --tc: #f2c46d; }
.toast--info    { --tc: #b9d0c1; }

.toast__icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: var(--tc);
  background: color-mix(in srgb, var(--tc) 16%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tc) 38%, transparent);
}

/* One soft ripple as the toast arrives. */
.toast__icon::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--tc) 45%, transparent);
  animation: toast-ripple 1100ms 180ms ease-out;
}

.toast__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 30;
  stroke-dashoffset: 30;
  animation: toast-draw 480ms 220ms cubic-bezier(0.65, 0, 0.35, 1) forwards;
}

.toast__body {
  min-width: 0;
  padding-top: 1px;
}

.toast__title {
  font-family: var(--font-display);
  font-size: 1.05rem;
  font-weight: var(--wt-semi);
  line-height: 1.3;
  color: var(--pf-rice);
}

.toast__msg {
  margin-top: 3px;
  font-size: var(--fs-small);
  line-height: 1.45;
  color: var(--pf-on-dark-muted);
  overflow-wrap: anywhere;
}

.toast__action {
  display: inline-block;
  margin-top: 10px;
  font-size: var(--fs-meta);
  font-weight: var(--wt-semi);
  letter-spacing: var(--ls-meta);
  text-transform: uppercase;
  color: var(--tc);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.toast__close {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  margin-top: -3px;
  border-radius: 50%;
  color: var(--pf-on-dark-muted);
  transition: background var(--dur-fast) ease, color var(--dur-fast) ease;
}

.toast__close:hover {
  color: var(--pf-rice);
  background: rgba(242, 236, 225, 0.1);
}

.toast__close svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

/* The timer. When this animation ends, toast.js removes the toast. */
.toast__progress {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 3px;
  background: var(--tc);
  opacity: 0.85;
  transform-origin: left;
  animation: toast-timer linear forwards;
}

.toasts:hover .toast__progress,
.toasts.is-paused .toast__progress,
.toast:focus-within .toast__progress,
.toast.is-dragging .toast__progress {
  animation-play-state: paused;
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.92);
  }
  40% {
    opacity: 1;
  }
}

@keyframes toast-draw {
  to { stroke-dashoffset: 0; }
}

@keyframes toast-ripple {
  to { box-shadow: 0 0 0 12px transparent; }
}

@keyframes toast-timer {
  from { transform: scaleX(1); }
  to { transform: scaleX(0); }
}

@media (max-width: 600px) {
  .toasts {
    left: 16px;
    right: 16px;
    bottom: max(16px, env(safe-area-inset-bottom));
    width: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast__icon::after {
    animation: none;
  }
  .toast__icon svg {
    animation: none;
    stroke-dashoffset: 0;
  }
}
