/* Story and profile page family
   Extends the canonical site.css shell while retaining safe preview fallbacks. */

:root {
  --sp-paper: var(--color-paper, #f7f3e9);
  --sp-surface: var(--color-surface, #fffdf8);
  --sp-surface-soft: #eef3e5;
  --sp-ink: var(--color-ink, #183126);
  --sp-muted: var(--color-muted, #637066);
  --sp-leaf: var(--color-primary, #245c3a);
  --sp-leaf-dark: #123d27;
  --sp-sprout: #a7c957;
  --sp-clay: var(--color-accent, #b65f3a);
  --sp-marigold: #e8ad32;
  --sp-line: rgba(24, 49, 38, 0.15);
  --sp-shadow: 0 18px 50px rgba(37, 55, 39, 0.1);
  --sp-radius-sm: 0.75rem;
  --sp-radius-md: 1.2rem;
  --sp-radius-lg: 1.8rem;
  --sp-font: "Noto Sans Bengali", "Hind Siliguri", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
  box-sizing: border-box;
}

.story-profile-page {
  margin: 0;
  min-width: 20rem;
  background: var(--sp-paper);
  color: var(--sp-ink);
  font-family: var(--sp-font);
  font-size: 1rem;
  line-height: 1.65;
}

.story-profile-page::before {
  position: fixed;
  z-index: -1;
  inset: 0;
  background-image: radial-gradient(rgba(36, 92, 58, 0.055) 0.65px, transparent 0.65px);
  background-size: 7px 7px;
  content: "";
  pointer-events: none;
}

.story-profile-page img {
  display: block;
  max-width: 100%;
}

.story-profile-page a {
  color: inherit;
}

.story-profile-page button,
.story-profile-page input,
.story-profile-page textarea,
.story-profile-page select {
  font: inherit;
}

.story-profile-page button,
.story-profile-page a {
  -webkit-tap-highlight-color: transparent;
}

.story-profile-page :where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid var(--sp-marigold);
  outline-offset: 3px;
}

.story-profile-page :where(.post-hero__layout, .post-reading-layout, .comments-layout, .author-card, .profile-identity, .profile-identity__heading, .profile-context-layout, .related-grid, .profile-post-grid, .site-footer__grid, .section-heading--row, .article-actions, .comment__header, .saved-state) > * {
  min-width: 0;
}

.story-profile-page :where(h1, h2, h3, p, a, li, dd, blockquote) {
  overflow-wrap: anywhere;
}

.shell {
  width: min(100% - 2.5rem, 74rem);
  margin-inline: auto;
}

.section-shell {
  padding-block: clamp(3.4rem, 6vw, 6.5rem);
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.skip-link {
  position: fixed;
  z-index: 1000;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  border-radius: 0.6rem;
  background: var(--sp-leaf-dark);
  color: #fff !important;
  transform: translateY(-150%);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

/* Canonical shell fallbacks */
.site-header {
  position: relative;
  z-index: 20;
  border-bottom: 1px solid var(--sp-line);
  background: color-mix(in srgb, var(--sp-paper) 92%, transparent);
  backdrop-filter: blur(12px);
}

.site-header__inner {
  min-height: 4.8rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex: none;
  color: var(--sp-ink);
  font-size: 1.3rem;
  font-weight: 850;
  text-decoration: none;
}

.brand__mark {
  width: 2.35rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 48% 52% 46% 54%;
  background: var(--sp-leaf);
  color: #fff;
  font-size: 0.88rem;
  transform: rotate(-5deg);
}

.brand__text {
  letter-spacing: -0.025em;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 0.2rem;
  margin-inline: auto;
}

.site-nav a {
  padding: 0.55rem 0.75rem;
  border-radius: 999px;
  color: #385045;
  font-weight: 650;
  text-decoration: none;
}

.site-nav a:is(:hover, [aria-current="page"]) {
  background: rgba(36, 92, 58, 0.09);
  color: var(--sp-leaf-dark);
}

.site-header__actions,
.profile-actions,
.article-actions__secondary,
.reaction-group,
.comment__actions,
.fact-pills,
.tag-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.site-header__menu {
  display: none;
  width: 2.75rem;
  aspect-ratio: 1;
  border: 1px solid var(--sp-line);
  border-radius: 50%;
  background: var(--sp-surface);
  color: var(--sp-ink);
  cursor: pointer;
}

.button {
  min-height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  padding: 0.7rem 1.15rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, border-color 160ms ease;
}

.button:hover {
  transform: translateY(-1px);
}

.button--primary {
  border-color: var(--sp-leaf);
  background: var(--sp-leaf);
  color: #fff !important;
  box-shadow: 0 8px 20px rgba(36, 92, 58, 0.18);
}

.button--primary:hover {
  background: var(--sp-leaf-dark);
}

.button--secondary {
  border-color: rgba(36, 92, 58, 0.32);
  background: var(--sp-surface);
  color: var(--sp-leaf-dark) !important;
}

.button--secondary:hover,
.button--quiet:hover {
  background: var(--sp-surface-soft);
}

.button--quiet {
  border-color: transparent;
  background: transparent;
  color: var(--sp-leaf-dark) !important;
}

.button--full {
  width: 100%;
}

.site-footer {
  padding-block: 3.5rem;
  border-top: 1px solid var(--sp-line);
  background: var(--sp-leaf-dark);
  color: rgba(255, 255, 255, 0.78);
}

.site-footer__grid {
  display: grid;
  grid-template-columns: 1.35fr 0.7fr 1fr;
  gap: clamp(2rem, 5vw, 5rem);
  align-items: start;
}

.brand--footer {
  color: #fff !important;
}

.site-footer p {
  max-width: 34rem;
  margin: 1rem 0 0;
}

.site-footer nav {
  display: grid;
  gap: 0.7rem;
}

.site-footer nav a {
  color: #fff;
  text-decoration-color: rgba(255, 255, 255, 0.3);
  text-underline-offset: 0.25em;
}

.site-footer__note {
  padding: 1rem 1.1rem;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--sp-radius-sm);
  background: rgba(255, 255, 255, 0.06);
}

/* Shared typography and controls */
.eyebrow {
  margin: 0 0 0.6rem;
  color: var(--sp-clay);
  font-size: 0.79rem;
  font-weight: 850;
  letter-spacing: 0.07em;
  line-height: 1.35;
  text-transform: uppercase;
}

.eyebrow span {
  color: var(--sp-sprout);
}

.section-heading {
  max-width: 47rem;
  margin-bottom: 2rem;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
  color: var(--sp-ink);
  font-size: clamp(1.65rem, 3vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.section-heading--compact {
  margin-bottom: 1.5rem;
}

.section-heading--row {
  max-width: none;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1.5rem;
}

.section-heading--row > p {
  max-width: 26rem;
  margin: 0;
  color: var(--sp-muted);
  font-size: 0.92rem;
  text-align: right;
}

.text-link {
  color: var(--sp-leaf) !important;
  font-weight: 800;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.28em;
}

.compact-select {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--sp-muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.compact-select select {
  min-height: 2.6rem;
  padding: 0.45rem 2rem 0.45rem 0.75rem;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  background: var(--sp-surface);
  color: var(--sp-ink);
}

/* Post hero */
.post-hero {
  position: relative;
  overflow: hidden;
  padding-top: clamp(2.5rem, 5vw, 5rem);
  background: linear-gradient(135deg, #f6f0df 0%, var(--sp-paper) 48%, #e9efe0 100%);
}

.post-hero::after {
  position: absolute;
  top: -8rem;
  right: -5rem;
  width: 26rem;
  aspect-ratio: 1;
  border: 1px solid rgba(36, 92, 58, 0.08);
  border-radius: 38% 62% 58% 42%;
  content: "";
  transform: rotate(22deg);
}

.post-hero__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(22rem, 0.98fr);
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: center;
}

.breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0;
  margin: 0 0 2.2rem;
  list-style: none;
  color: var(--sp-muted);
  font-size: 0.83rem;
}

.breadcrumbs li + li::before {
  margin-right: 0.45rem;
  color: #97a097;
  content: "/";
}

.breadcrumbs a {
  text-underline-offset: 0.2em;
}

.post-hero h1,
.profile-identity h1 {
  margin: 0;
  color: var(--sp-ink);
  font-size: clamp(2.35rem, 5vw, 4.75rem);
  line-height: 1.07;
  letter-spacing: -0.05em;
}

.post-hero__summary {
  max-width: 41rem;
  margin: 1.35rem 0 1.6rem;
  color: #44554c;
  font-size: clamp(1.05rem, 1.5vw, 1.22rem);
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  color: var(--sp-muted);
  font-size: 0.84rem;
}

.post-meta > span {
  padding-left: 1rem;
  border-left: 1px solid var(--sp-line);
}

.person-chip {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--sp-ink) !important;
  text-decoration: none;
}

.person-chip__avatar {
  width: 2.65rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--sp-clay);
  color: #fff;
  font-weight: 800;
}

.person-chip strong,
.person-chip small {
  display: block;
  line-height: 1.4;
}

.person-chip small {
  color: var(--sp-muted);
}

.tag-list {
  padding: 0;
  margin: 1.5rem 0 0;
  list-style: none;
}

.tag-list a,
.fact-pills li {
  display: inline-flex;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(36, 92, 58, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  color: var(--sp-leaf-dark);
  font-size: 0.78rem;
  font-weight: 750;
  text-decoration: none;
}

.post-hero__media {
  position: relative;
  margin: 0;
  padding: 0.65rem;
  border-radius: var(--sp-radius-lg);
  background: rgba(255, 255, 255, 0.65);
  box-shadow: var(--sp-shadow);
  transform: rotate(1deg);
}

.post-hero__media img {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: calc(var(--sp-radius-lg) - 0.4rem);
  object-fit: cover;
}

.post-hero__media figcaption {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  left: 1.5rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.7rem;
  background: rgba(18, 61, 39, 0.9);
  color: #fff;
  font-size: 0.82rem;
  backdrop-filter: blur(8px);
}

/* Post article */
.post-body {
  background: var(--sp-surface);
}

.post-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 16rem;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.prose-card {
  max-width: 48rem;
}

.prose {
  color: #33463c;
  font-size: 1.06rem;
  line-height: 1.9;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin-block: 1.2rem;
}

.prose blockquote {
  margin: 2rem 0;
  padding: 1.25rem 1.4rem;
  border-left: 4px solid var(--sp-clay);
  border-radius: 0 var(--sp-radius-sm) var(--sp-radius-sm) 0;
  background: #faf2e8;
  color: #493d34;
  font-size: 1.08rem;
}

.care-log {
  margin-block: 3rem;
  padding: 1.5rem;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  background: #f8f9f2;
}

.care-log h3 {
  margin: 0 0 1rem;
  font-size: 1.18rem;
}

.care-log dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-sm);
  background: var(--sp-line);
}

.care-log dl > * {
  min-width: 0;
}

.care-log dl div {
  padding: 0.9rem 1rem;
  background: var(--sp-surface);
}

.care-log dt {
  color: var(--sp-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.care-log dd {
  margin: 0.15rem 0 0;
  font-weight: 750;
}

.diagnostic-gallery {
  margin-top: 3.5rem;
}

.media-gallery {
  display: grid;
  gap: 0.8rem;
}

.media-gallery > * {
  min-width: 0;
}

.media-gallery--diagnostic {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.gallery-tile {
  position: relative;
  min-height: 13rem;
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: var(--sp-radius-md);
  background: #123a29;
  color: #fff;
  cursor: zoom-in;
}

.gallery-tile img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  transition: transform 280ms ease, filter 280ms ease;
}

.gallery-tile::after {
  position: absolute;
  inset: 40% 0 0;
  background: linear-gradient(transparent, rgba(12, 35, 22, 0.74));
  content: "";
}

.gallery-tile span {
  position: absolute;
  z-index: 1;
  right: 1rem;
  bottom: 0.8rem;
  left: auto;
  max-width: calc(100% - 2rem);
  padding: 0.42rem 0.68rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 0.55rem;
  color: #fff;
  background: #123a29;
  box-shadow: 0 4px 14px rgba(7, 25, 17, 0.22);
  font-weight: 800;
  text-align: left;
}

.gallery-tile:hover img {
  filter: saturate(1.06);
  transform: scale(1.035);
}

.gallery-tile--wide {
  min-height: 17rem;
}

.article-actions {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: 1.5rem;
  margin-top: 3rem;
  border-top: 1px solid var(--sp-line);
}

.reaction-button,
.icon-text-button,
.comment__actions button,
.comment__actions a {
  min-height: 2.45rem;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 0.75rem;
  border: 1px solid var(--sp-line);
  border-radius: 999px;
  background: transparent;
  color: var(--sp-muted);
  font-size: 0.82rem;
  font-weight: 750;
  text-decoration: none;
  cursor: pointer;
}

.reaction-button[aria-pressed="true"],
.icon-text-button[aria-pressed="true"],
.comment__actions button[aria-pressed="true"] {
  border-color: rgba(182, 95, 58, 0.36);
  background: #fbede5;
  color: #8a3c21;
}

.action-feedback {
  position: absolute;
  right: 0;
  bottom: -1.75rem;
  margin: 0;
  color: var(--sp-leaf);
  font-size: 0.78rem;
  font-weight: 750;
}

.post-aside {
  position: sticky;
  top: 1.5rem;
  display: grid;
  gap: 1rem;
}

.aside-note,
.on-page-nav {
  padding: 1.15rem;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  background: #f8faf4;
}

.aside-note {
  display: flex;
  gap: 0.75rem;
}

.aside-note__icon {
  width: 2rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--sp-leaf);
  color: #fff;
}

.aside-note p {
  margin: 0.25rem 0 0;
  color: var(--sp-muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.on-page-nav {
  display: grid;
  gap: 0.6rem;
}

.on-page-nav a {
  color: var(--sp-muted);
  font-size: 0.86rem;
  text-decoration-color: rgba(36, 92, 58, 0.25);
  text-underline-offset: 0.2em;
}

/* Author */
.author-card-section {
  padding-block: clamp(2.5rem, 5vw, 4rem);
  background: #eaf0df;
}

.author-card {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr) auto;
  gap: 1.5rem;
  align-items: center;
  padding: 1.4rem;
  border: 1px solid rgba(36, 92, 58, 0.14);
  border-radius: var(--sp-radius-lg);
  background: rgba(255, 253, 248, 0.82);
  box-shadow: 0 10px 35px rgba(36, 92, 58, 0.08);
}

.author-card__portrait {
  width: 8rem;
  aspect-ratio: 1;
  border-radius: 1.2rem;
  object-fit: cover;
}

.author-card h2 {
  margin: 0;
  font-size: 1.75rem;
  line-height: 1.2;
}

.author-card h2 a {
  text-decoration: none;
}

.author-card__content > p:not(.eyebrow) {
  max-width: 42rem;
  margin: 0.55rem 0 0;
  color: var(--sp-muted);
}

.fact-pills {
  padding: 0;
  margin: 1rem 0 0;
  list-style: none;
}

.follow-button[aria-pressed="true"] {
  border-color: var(--sp-leaf);
  background: var(--sp-surface);
  color: var(--sp-leaf-dark) !important;
  box-shadow: none;
}

/* Comments */
.comments-section {
  background: var(--sp-paper);
}

.comments-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 23rem);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: start;
}

.comment-thread,
.comment__replies,
.profile-reply-list {
  padding: 0;
  margin: 0;
  list-style: none;
}

.comment-thread {
  display: grid;
  gap: 1rem;
}

.comment {
  min-width: 0;
}

.comment > article {
  padding: 1.3rem;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  background: var(--sp-surface);
}

.comment--accepted > article {
  border: 2px solid rgba(36, 92, 58, 0.42);
  background: linear-gradient(145deg, #fffdf8, #f4f8ed);
  box-shadow: 0 12px 35px rgba(36, 92, 58, 0.08);
}

.comment__header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.comment__header h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.25;
}

.comment__header h3 a {
  text-decoration: none;
}

.comment__header p {
  margin: 0.1rem 0 0;
  color: var(--sp-muted);
  font-size: 0.76rem;
}

.comment__avatar {
  width: 2.65rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  flex: none;
  border-radius: 50%;
  background: var(--sp-leaf);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 850;
}

.comment__avatar--warm {
  background: var(--sp-clay);
}

.comment__avatar--leaf {
  background: #6d8134;
}

.accepted-badge,
.author-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.3rem 0.55rem;
  border-radius: 999px;
  background: var(--sp-leaf);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 850;
  white-space: nowrap;
}

.accepted-badge {
  margin-left: auto;
}

.author-badge {
  margin-left: 0.35rem;
  background: #eee6d4;
  color: #675638;
  vertical-align: middle;
}

.comment__body {
  padding-left: 3.4rem;
  color: #34463c;
}

.comment__body p {
  margin: 0.85rem 0;
}

.comment__body ol {
  padding-left: 1.35rem;
}

.comment__body li + li {
  margin-top: 0.45rem;
}

.comment__actions {
  padding-left: 3.4rem;
  margin-top: 0.9rem;
}

.comment__actions button,
.comment__actions a {
  min-height: auto;
  padding: 0.2rem 0.4rem;
  border: 0;
}

.comment__replies {
  padding-left: 2.25rem;
  margin-top: 0.75rem;
  border-left: 2px solid rgba(36, 92, 58, 0.14);
}

.comment--reply > article {
  background: rgba(255, 253, 248, 0.62);
}

.reply-form {
  position: sticky;
  top: 1.5rem;
  padding: 1.4rem;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-lg);
  background: var(--sp-surface);
  box-shadow: var(--sp-shadow);
}

.reply-form__heading {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
}

.reply-form__heading h2 {
  margin: 0;
  font-size: 1.42rem;
  line-height: 1.2;
}

.reply-form__cancel {
  align-self: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sp-clay);
  font-size: 0.76rem;
  font-weight: 800;
  text-decoration: underline;
  cursor: pointer;
}

.reply-form__context {
  padding: 0.55rem 0.7rem;
  border-radius: 0.6rem;
  background: #eef3e5;
  color: var(--sp-leaf-dark);
  font-size: 0.82rem;
}

.reply-form > label:not(.checkbox-field) {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.88rem;
  font-weight: 800;
}

.reply-form textarea {
  width: 100%;
  resize: vertical;
  padding: 0.8rem 0.9rem;
  border: 1px solid #aab4ab;
  border-radius: 0.75rem;
  background: #fff;
  color: var(--sp-ink);
  line-height: 1.65;
}

.reply-form textarea[aria-invalid="true"] {
  border-color: #a8392d;
  box-shadow: 0 0 0 2px rgba(168, 57, 45, 0.1);
}

.field-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 0.35rem;
  color: var(--sp-muted);
  font-size: 0.7rem;
}

.field-meta small:first-child {
  max-width: 17rem;
}

.field-error {
  min-height: 1.4rem;
  margin: 0.3rem 0;
  color: #9f2f25;
  font-size: 0.78rem;
  font-weight: 750;
}

.checkbox-field {
  display: flex;
  align-items: start;
  gap: 0.6rem;
  margin: 0.4rem 0 1rem;
  color: var(--sp-muted);
  font-size: 0.78rem;
}

.checkbox-field input {
  width: 1.1rem;
  height: 1.1rem;
  flex: none;
  margin-top: 0.16rem;
  accent-color: var(--sp-leaf);
}

.form-success {
  display: grid;
  gap: 0.1rem;
  padding: 0.9rem;
  margin-top: 0.9rem;
  border-radius: 0.75rem;
  background: #e5f1df;
  color: var(--sp-leaf-dark);
  font-size: 0.82rem;
}

.form-success[hidden] {
  display: none;
}

/* Related posts */
.related-section {
  background: var(--sp-surface);
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.related-card,
.profile-post-card {
  overflow: hidden;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  background: var(--sp-surface);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.related-card:hover,
.profile-post-card:hover {
  box-shadow: 0 12px 35px rgba(36, 92, 58, 0.1);
  transform: translateY(-3px);
}

.related-card__image,
.profile-post-card__image {
  position: relative;
  display: block;
  overflow: hidden;
}

.related-card__image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 240ms ease;
}

.related-card:hover img,
.profile-post-card:hover img {
  transform: scale(1.025);
}

.related-card__body {
  padding: 1.05rem;
}

.related-card h3,
.profile-post-card h3 {
  margin: 0;
  font-size: 1.1rem;
  line-height: 1.45;
}

.related-card h3 a,
.profile-post-card h3 a {
  text-decoration: none;
}

.related-card__body > p:last-child {
  margin: 0.7rem 0 0;
  color: var(--sp-muted);
  font-size: 0.76rem;
}

/* Profile hero */
.profile-hero {
  padding-top: 1.4rem;
  background: linear-gradient(#eef2e5, var(--sp-paper));
}

.profile-cover {
  overflow: hidden;
  padding: 0.55rem;
  border-radius: var(--sp-radius-lg);
  background: rgba(255, 255, 255, 0.6);
  box-shadow: var(--sp-shadow);
}

.profile-cover img {
  width: 100%;
  max-height: 30rem;
  aspect-ratio: 2.25 / 1;
  border-radius: calc(var(--sp-radius-lg) - 0.35rem);
  object-fit: cover;
}

.profile-identity {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 1.6rem;
  align-items: start;
  margin-top: -5.5rem;
}

.profile-identity__avatar {
  position: relative;
  width: 11rem;
  aspect-ratio: 1;
  border: 0.5rem solid var(--sp-paper);
  border-radius: 50%;
  background: #d9e2d1;
  object-fit: cover;
  box-shadow: 0 10px 28px rgba(30, 52, 37, 0.14);
}

.profile-identity__main {
  padding-top: 6rem;
}

.profile-identity__heading {
  display: flex;
  justify-content: space-between;
  gap: 2rem;
}

.profile-identity h1 {
  font-size: clamp(2.3rem, 4vw, 4.1rem);
}

.profile-handle,
.profile-bio {
  color: var(--sp-muted);
}

.profile-handle {
  margin: 0.35rem 0 0;
}

.profile-bio {
  max-width: 46rem;
  margin: 1.15rem 0;
  font-size: 1.04rem;
}

.profile-actions {
  justify-content: flex-end;
}

.icon-only-button {
  width: 2.8rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid var(--sp-line);
  border-radius: 50%;
  background: var(--sp-surface);
  color: var(--sp-ink);
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
}

.profile-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 1.4rem 0 0;
}

.profile-stats div {
  min-width: 7.5rem;
  padding: 0 1.3rem;
  border-left: 1px solid var(--sp-line);
}

.profile-stats div:first-child {
  padding-left: 0;
  border-left: 0;
}

.profile-stats dt {
  color: var(--sp-muted);
  font-size: 0.72rem;
  font-weight: 750;
}

.profile-stats dd {
  margin: 0;
  color: var(--sp-ink);
  font-size: 1.2rem;
  font-weight: 850;
}

.profile-feedback {
  position: static;
  min-height: 1.3rem;
  margin-top: 0.7rem;
}

/* Profile context and gallery */
.garden-notes {
  background: var(--sp-surface);
}

.profile-context-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(19rem, 0.72fr);
  gap: clamp(3rem, 8vw, 7rem);
  align-items: start;
}

.garden-notes__story {
  max-width: 45rem;
}

.garden-facts {
  margin: 0;
  padding: 0.5rem 1.3rem;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-lg);
  background: #f7f9f2;
}

.garden-facts div {
  padding-block: 1.15rem;
  border-bottom: 1px solid var(--sp-line);
}

.garden-facts div:last-child {
  border-bottom: 0;
}

.garden-facts dt {
  color: var(--sp-muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.garden-facts dt span {
  display: inline-block;
  width: 1.4rem;
  color: var(--sp-clay);
}

.garden-facts dd {
  margin: 0.2rem 0 0 1.4rem;
  font-weight: 750;
}

.profile-gallery-section {
  background: #e8eee0;
}

.media-gallery--profile {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 14rem;
}

.media-gallery--profile .gallery-tile {
  min-height: 0;
}

.gallery-tile--feature {
  grid-column: span 2;
  grid-row: span 2;
}

.gallery-tile--landscape {
  grid-column: span 2;
}

/* Tabs and profile content */
.profile-tabs-section {
  padding-bottom: 0;
  background: var(--sp-surface);
}

.profile-tabs {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  border-bottom: 1px solid var(--sp-line);
  scrollbar-width: thin;
}

.profile-tabs button {
  position: relative;
  flex: none;
  padding: 0.85rem 1rem 1rem;
  border: 0;
  background: transparent;
  color: var(--sp-muted);
  font-weight: 800;
  cursor: pointer;
}

.profile-tabs button span {
  display: inline-grid;
  min-width: 1.5rem;
  min-height: 1.5rem;
  place-items: center;
  margin-left: 0.25rem;
  padding-inline: 0.35rem;
  border-radius: 999px;
  background: #edf0e8;
  font-size: 0.7rem;
}

.profile-tabs button[aria-selected="true"] {
  color: var(--sp-leaf-dark);
}

.profile-tabs button[aria-selected="true"]::after {
  position: absolute;
  right: 0.7rem;
  bottom: -1px;
  left: 0.7rem;
  height: 3px;
  border-radius: 3px 3px 0 0;
  background: var(--sp-clay);
  content: "";
}

.profile-content {
  padding-top: 2.2rem;
  background: var(--sp-surface);
}

.profile-post-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.profile-post-card {
  display: flex;
  flex-direction: column;
}

.profile-post-card__image img {
  width: 100%;
  aspect-ratio: 1.38 / 1;
  object-fit: cover;
  transition: transform 240ms ease;
}

.status-chip {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  padding: 0.32rem 0.6rem;
  border-radius: 999px;
  background: rgba(18, 61, 39, 0.9);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 850;
  backdrop-filter: blur(6px);
}

.profile-post-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 1.05rem;
}

.profile-post-card__body > p:not(.eyebrow) {
  margin: 0.7rem 0 1rem;
  color: var(--sp-muted);
  font-size: 0.86rem;
}

.profile-post-card footer {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  margin-top: auto;
  padding-top: 0.75rem;
  border-top: 1px solid var(--sp-line);
  color: var(--sp-muted);
  font-size: 0.74rem;
}

.profile-post-card footer button {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--sp-leaf);
  font-weight: 800;
  cursor: pointer;
}

.profile-post-card footer button[aria-pressed="true"] {
  color: var(--sp-clay);
}

.profile-reply-list {
  display: grid;
  gap: 0.8rem;
  max-width: 52rem;
}

.profile-reply-list article {
  padding: 1.2rem 1.3rem;
  border: 1px solid var(--sp-line);
  border-radius: var(--sp-radius-md);
  background: #fafaf5;
}

.profile-reply-list h3 {
  margin: 0;
  font-size: 1.15rem;
}

.profile-reply-list blockquote {
  margin: 0.8rem 0;
  color: #425248;
}

.profile-reply-list article > p:last-child {
  margin: 0;
  color: var(--sp-muted);
  font-size: 0.76rem;
}

.saved-state {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 1rem;
  align-items: center;
  padding: 1.5rem;
  border: 1px dashed rgba(36, 92, 58, 0.3);
  border-radius: var(--sp-radius-md);
  background: #f7f9f2;
}

.saved-state__icon {
  width: 3rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #e5ebdd;
  color: var(--sp-leaf);
  font-size: 1.4rem;
}

.saved-state h3,
.saved-state p {
  margin: 0;
}

.saved-state p {
  margin-top: 0.25rem;
  color: var(--sp-muted);
  font-size: 0.84rem;
}

.content-footer {
  display: flex;
  justify-content: center;
  margin-top: 2.2rem;
}

/* Accessible gallery dialog */
body.lightbox-open {
  overflow: hidden;
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(7, 21, 13, 0.88);
  backdrop-filter: blur(10px);
}

.lightbox__panel {
  position: relative;
  z-index: 1;
  width: min(100%, 68rem);
  min-width: 0;
}

.lightbox figure {
  margin: 0;
}

.lightbox figure img {
  width: 100%;
  max-height: min(75vh, 48rem);
  border-radius: var(--sp-radius-md);
  background: #17261d;
  object-fit: contain;
}

.lightbox figcaption {
  padding: 0.8rem 4rem 0;
  color: #fff;
  text-align: center;
}

.lightbox__close,
.lightbox__nav {
  position: absolute;
  z-index: 2;
  width: 3rem;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 50%;
  background: rgba(18, 61, 39, 0.82);
  color: #fff;
  font-size: 1.7rem;
  line-height: 1;
  cursor: pointer;
}

.lightbox__close {
  top: -1rem;
  right: -1rem;
}

.lightbox__nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__nav--previous {
  left: -1.15rem;
}

.lightbox__nav--next {
  right: -1.15rem;
}

.lightbox__position {
  margin: 0.3rem 0 0;
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.75rem;
  text-align: center;
}

@media (max-width: 900px) {
  .post-hero__layout,
  .post-reading-layout,
  .comments-layout,
  .profile-context-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-hero__layout {
    gap: 2.5rem;
  }

  .post-hero__media {
    max-width: 44rem;
  }

  .prose-card {
    max-width: none;
  }

  .post-aside {
    position: static;
    grid-row: 1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reply-form {
    position: static;
  }

  .related-grid,
  .profile-post-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .related-card:last-child,
  .profile-post-card:last-child {
    grid-column: 1 / -1;
  }

  .profile-post-card:last-child {
    display: grid;
    grid-template-columns: minmax(14rem, 0.7fr) minmax(0, 1fr);
  }

  .profile-identity {
    grid-template-columns: 8rem minmax(0, 1fr);
    margin-top: -4rem;
  }

  .profile-identity__avatar {
    width: 8rem;
  }

  .profile-identity__main {
    padding-top: 4.7rem;
  }

  .profile-identity__heading {
    display: grid;
    gap: 1rem;
  }

  .profile-actions {
    justify-content: flex-start;
  }

  .media-gallery--profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 13rem;
  }

  .site-footer__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .site-footer__note {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 1.5rem, 74rem);
  }

  .section-shell {
    padding-block: 3.5rem;
  }

  .site-header__inner {
    min-height: 4.3rem;
    gap: 0.75rem;
  }

  .site-header__menu {
    display: grid;
    place-items: center;
    margin-left: auto;
  }

  .site-nav {
    position: absolute;
    top: calc(100% + 0.5rem);
    right: 0.75rem;
    left: 0.75rem;
    display: none;
    padding: 0.6rem;
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius-md);
    background: var(--sp-surface);
    box-shadow: var(--sp-shadow);
  }

  .site-nav[data-open="true"],
  .site-nav.is-open {
    display: grid;
  }

  .site-header__actions .button--quiet {
    display: none;
  }

  .site-header__actions .button {
    min-height: 2.45rem;
    padding-inline: 0.85rem;
    font-size: 0.82rem;
  }

  .post-hero {
    padding-top: 2rem;
  }

  .post-hero h1,
  .profile-identity h1 {
    font-size: clamp(2.15rem, 10vw, 3.1rem);
  }

  .breadcrumbs ol {
    margin-bottom: 1.6rem;
  }

  .post-meta > span {
    padding-left: 0;
    border-left: 0;
  }

  .section-heading--row,
  .article-actions,
  .author-card,
  .saved-state {
    align-items: start;
    flex-direction: column;
  }

  .section-heading--row {
    display: flex;
  }

  .section-heading--row > p {
    text-align: left;
  }

  .care-log dl,
  .post-aside,
  .related-grid,
  .profile-post-grid,
  .site-footer__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .media-gallery--diagnostic {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-actions__secondary,
  .reaction-group {
    width: 100%;
  }

  .reaction-button {
    flex: 1 1 10rem;
    justify-content: center;
  }

  .action-feedback {
    position: static;
    width: 100%;
  }

  .author-card {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
  }

  .author-card__portrait {
    width: 5.5rem;
  }

  .author-card .follow-button {
    grid-column: 1 / -1;
    width: 100%;
  }

  .comment__header {
    align-items: start;
    flex-wrap: wrap;
  }

  .accepted-badge {
    margin-left: 3.4rem;
  }

  .comment__body,
  .comment__actions {
    padding-left: 0;
  }

  .comment__replies {
    padding-left: 0.75rem;
  }

  .related-card:last-child,
  .profile-post-card:last-child {
    grid-column: auto;
  }

  .profile-post-card:last-child {
    display: flex;
  }

  .profile-cover {
    width: 100%;
    padding: 0;
    border-radius: 0;
  }

  .profile-cover img {
    aspect-ratio: 1.55 / 1;
    border-radius: 0;
  }

  .profile-identity {
    grid-template-columns: minmax(0, 1fr);
    margin-top: -3.6rem;
  }

  .profile-identity__avatar {
    width: 7.2rem;
  }

  .profile-identity__main {
    padding-top: 0;
  }

  .profile-stats {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--sp-line);
    border-radius: var(--sp-radius-sm);
    background: var(--sp-line);
  }

  .profile-stats div,
  .profile-stats div:first-child {
    padding: 0.8rem;
    border: 0;
    background: rgba(255, 253, 248, 0.74);
  }

  .media-gallery--profile {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-rows: 10.5rem;
  }

  .gallery-tile--feature {
    grid-column: 1 / -1;
    grid-row: span 2;
  }

  .gallery-tile--landscape {
    grid-column: 1 / -1;
  }

  .saved-state {
    display: flex;
  }

  .saved-state .button {
    width: 100%;
  }

  .site-footer__note {
    grid-column: auto;
  }

  .lightbox {
    padding: 0.75rem;
  }

  .lightbox__close {
    top: 0.5rem;
    right: 0.5rem;
  }

  .lightbox__nav--previous {
    left: 0.35rem;
  }

  .lightbox__nav--next {
    right: 0.35rem;
  }

  .lightbox figcaption {
    padding-inline: 1rem;
  }
}

@media (max-width: 420px) {
  .brand__text {
    font-size: 1.1rem;
  }

  .site-header__actions .button {
    padding-inline: 0.68rem;
    font-size: 0.76rem;
  }

  .gallery-tile {
    min-height: 11rem;
  }

  .media-gallery--profile {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: 13rem;
  }

  .gallery-tile--feature,
  .gallery-tile--landscape {
    grid-column: auto;
    grid-row: auto;
  }

  .field-meta {
    display: grid;
    gap: 0.15rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .story-profile-page *,
  .story-profile-page *::before,
  .story-profile-page *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
