/* ==========================================================================
   Blog styles. Loaded only by generated post and listing pages, so nothing
   here can affect the hand-built pages you edit in Pinegrow.
   ========================================================================== */

:root { --post-measure: 760px; }

/* ── Shared page intro ── */
.page-intro {
  max-width: 1200px;
  margin: 0 auto;
  padding: 4.5rem 2rem 0;
}
.page-intro h1 {
  font-family: var(--font-display);
  font-size: clamp(2.25rem, 5vw, 3.25rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.1;
  margin-bottom: 1rem;
}
.page-intro p {
  font-size: 1rem;
  color: var(--color-text-muted);
  max-width: 52ch;
}

.rule-head {
  max-width: 1200px;
  margin: 3.5rem auto 0;
  padding: 0 2rem;
  display: flex;
  align-items: baseline;
  gap: 1.25rem;
}
.rule-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}
.rule-line { flex: 1; height: 1px; background: var(--color-border); }

.topic-bar {
  max-width: 1200px;
  margin: 1.75rem auto 0;
  padding: 0 2rem;
  display: flex; flex-wrap: wrap; gap: 1.25rem;
}
.topic-chip {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
  transition: all 0.18s ease;
}
.topic-chip:hover { color: var(--color-text); border-bottom-color: var(--color-text); }

/* ── Post cards ── */
.post-list-wrap { max-width: 1200px; margin: 0 auto; padding: 2.5rem 2rem 6rem; }
.post-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2.5rem 1.75rem;
}
@media (max-width: 900px) { .post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) {
  .post-grid { grid-template-columns: 1fr; gap: 2.25rem; }
  .page-intro, .rule-head, .topic-bar, .post-list-wrap { padding-left: 1.25rem; padding-right: 1.25rem; }
}

.post-card { display: block; text-decoration: none; }
.post-card-media {
  display: block;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #ece9e4;
  margin-bottom: 1rem;
}
.post-card-media img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.6s ease;
}
.post-card:hover .post-card-media img { transform: scale(1.04); }
.post-card-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.25;
  color: var(--color-text);
}
.post-card-meta {
  display: block;
  margin-top: 0.4rem;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}
/* No tags means no meta line at all, rather than a reserved empty row. */
.post-card-meta:empty { display: none; }

.empty-note, .back-note { color: var(--color-text-muted); font-size: 0.9375rem; }
.back-note { margin-top: 3rem; }
.back-note a { color: var(--color-accent); }

/* ── Single post ── */
.post { padding-bottom: 2rem; }

/* Header actions. Back link on the left, the send utility on the right, so
   the top of a post carries both its navigation and its one action. */
.post-actions {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem 0;
}
.post-back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.9375rem;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.18s ease;
}
.post-back-link svg { width: 14px; height: 14px; transition: transform 0.18s ease; }
.post-back-link:hover { color: var(--color-accent-dark); }
.post-back-link:hover svg { transform: translateX(-3px); }

.post-head {
  max-width: var(--post-measure);
  margin: 0 auto;
  padding: 2rem 1.5rem 0;
  text-align: center;
}

/* Label, not navigation. Same treatment as the eyebrow on every other page. */
.post-eyebrow {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 1.25rem;
}

.post-meta:empty { display: none; }
.post-meta {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin-top: 1.5rem;
  display: flex; flex-wrap: wrap; gap: 0.75rem; justify-content: center;
}
.post-tag { color: var(--color-accent); text-decoration: none; }
.post-tag:hover { text-decoration: underline; }
.post-head h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 3rem);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.12;
}
.post-standfirst {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  margin-top: 1.25rem;
  line-height: 1.6;
}

.post-hero {
  max-width: 1000px;
  margin: 3rem auto 0;
  padding: 0 1.5rem;
}
.post-hero img { width: 100%; display: block; }
.post-hero figcaption {
  font-size: 0.75rem; color: var(--color-text-muted);
  text-align: center; margin-top: 0.75rem;
}

/* ── Post body typography ── */
.post-body {
  max-width: var(--post-measure);
  margin: 0 auto;
  /* Was 3.5rem. With the tag row gone from a project there is nothing between
     the button and the first image, so that much space read as a hole. */
  padding: 2rem 1.5rem 0;
  font-size: 1.0625rem;
  line-height: 1.75;
  color: #2b2b2b;
}
.post-body > * + * { margin-top: 1.4em; }
.post-body h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-top: 2.75em;
  color: var(--color-text);
}
.post-body h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 400;
  margin-top: 2.25em;
  color: var(--color-text);
}
.post-body a { color: var(--color-accent); text-underline-offset: 2px; }
.post-body ul, .post-body ol { padding-left: 1.4em; }
.post-body li + li { margin-top: 0.5em; }
.post-body blockquote {
  border-left: 2px solid var(--color-accent);
  padding-left: 1.25rem;
  color: var(--color-text-muted);
  font-style: italic;
}
.post-body hr { border: none; border-top: 1px solid var(--color-border); margin: 3em 0; }
.post-body code {
  background: var(--color-accent-light);
  padding: 0.1em 0.35em;
  font-size: 0.9em;
}

/* Images inserted with the editor's own image button arrive as plain markdown
   images. They get the same treatment as the shortcode version so WYSIWYG
   inserts look identical to hand-written ones: wider than the text column,
   with the title attribute rendered as a caption when present. */
.post-body p > img:only-child,
.post-body > img {
  display: block;
  width: 100%;
  margin-top: 2.5em;
  margin-bottom: 2.5em;
  margin-left: calc((var(--post-measure) - 1000px) / 2);
  margin-right: calc((var(--post-measure) - 1000px) / 2);
  max-width: 1000px;
}
.post-body p:has(> img:only-child) {
  margin-left: 0;
  margin-right: 0;
}
@media (max-width: 1040px) {
  .post-body p > img:only-child,
  .post-body > img { margin-left: 0; margin-right: 0; }
}

/* Images inside a post break wider than the text measure. */
.post-figure {
  margin-top: 2.5em; margin-bottom: 2.5em;
  margin-left: calc((var(--post-measure) - 1000px) / 2);
  margin-right: calc((var(--post-measure) - 1000px) / 2);
}
.post-figure img { width: 100%; display: block; }
.post-figure figcaption {
  font-size: 0.75rem; color: var(--color-text-muted);
  text-align: center; margin-top: 0.75rem;
}
@media (max-width: 1040px) {
  .post-figure { margin-left: 0; margin-right: 0; }
}

/* ── Product callout: always public, always crawlable ── */
.product-callout {
  display: flex; gap: 1.25rem; align-items: flex-start;
  border: 1px solid var(--color-border);
  padding: 1.25rem;
  margin-top: 2.5em; margin-bottom: 2.5em;
}
.product-callout img {
  width: 110px; height: 110px; object-fit: cover; flex-shrink: 0; display: block;
}
.product-body h4 {
  font-family: var(--font-display);
  font-size: 1.0625rem; font-weight: 400; margin-bottom: 0.35rem;
}
.product-body p { font-size: 0.9375rem; color: var(--color-text-muted); margin: 0 0 0.75rem; }
.product-link {
  display: inline-block;
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); text-decoration: none;
  border-bottom: 1px solid var(--color-accent); padding-bottom: 2px;
}
@media (max-width: 560px) {
  .product-callout { flex-direction: column; }
  .product-callout img { width: 100%; height: 180px; }
}

/* ── Email gated download ── */
.download-gate {
  max-width: 480px;
  margin: 3rem auto;
  text-align: center;
}
.download-rule { width: 40px; height: 1px; background: var(--color-border); margin: 0 auto 1.75rem; }
.download-gate h3 {
  font-family: var(--font-display);
  font-size: 1.375rem; font-weight: 400; margin-bottom: 0.5rem;
}
.download-gate p { font-size: 0.9375rem; color: var(--color-text-muted); margin-bottom: 1.5rem; }
.download-form { display: flex; gap: 0.5rem; }
.download-form input {
  flex: 1; font-family: var(--font-body); font-size: 0.9375rem;
  padding: 0.8rem 1rem; border: 1px solid var(--color-border); background: #fff;
  color: var(--color-text);
}
.download-form input:focus { outline: none; border-color: var(--color-accent); }
.download-form button {
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 500;
  padding: 0.8rem 1.5rem; background: var(--color-accent); color: #fff;
  border: none; cursor: pointer; white-space: nowrap; transition: background 0.2s ease;
}
.download-form button:hover { background: var(--color-accent-dark); }
.download-form button[disabled] { opacity: 0.6; cursor: default; }
.download-error { font-size: 0.8125rem; color: #a3302a; margin-top: 0.6rem; min-height: 1.1em; }
.download-fine { font-size: 0.75rem; color: var(--color-text-muted); margin: 0.85rem 0 0; }
.download-ready a {
  display: inline-block; margin-top: 0.5rem;
  font-size: 0.9375rem; color: var(--color-accent);
}
@media (max-width: 480px) { .download-form { flex-direction: column; } }

/* ── Closing CTA ── */
.post-cta {
  max-width: var(--post-measure);
  margin: 4.5rem auto 0;
  padding: 0 1.5rem;
}
.cta-block {
  border-top: 1px solid var(--color-border);
  padding-top: 2.5rem;
  text-align: center;
}
.cta-block + .cta-block { margin-top: 3rem; }
.cta-block h3 {
  font-family: var(--font-display);
  font-size: 1.5rem; font-weight: 400; margin-bottom: 0.6rem;
}
.cta-block p { font-size: 0.9375rem; color: var(--color-text-muted); margin-bottom: 1.5rem; }
.cta-button {
  display: inline-block;
  font-family: var(--font-body); font-size: 0.9375rem; font-weight: 500;
  padding: 0.8rem 1.75rem;
  background: var(--color-accent); color: #fff; text-decoration: none;
  transition: background 0.2s ease;
}
.cta-button:hover { background: var(--color-accent-dark); }
.cta-email .download-gate { margin-top: 0; }

/* ── Related ── */
.post-related { margin-top: 5rem; }
.post-related .rule-head { margin-top: 0; }


/* ==========================================================================
   Ghost card styles.
   Ghost returns rendered HTML carrying its own kg- classes but none of its
   theme CSS. These rules make galleries, wide images, bookmarks and callouts
   render in this site's fonts and colours instead of arriving unstyled.
   ========================================================================== */

/* Width variants. Ghost lets you set an image or card to regular, wide or
   full. Regular sits in the text column; wide breaks out; full goes edge to
   edge with the viewport. */
.kg-canvas > * { }

.kg-width-wide {
  margin-left: calc((var(--post-measure) - 1000px) / 2);
  margin-right: calc((var(--post-measure) - 1000px) / 2);
  max-width: 1000px;
}
.kg-width-full {
  position: relative;
  left: 50%;
  right: 50%;
  width: 100vw;
  max-width: 100vw;
  margin-left: -50vw;
  margin-right: -50vw;
}
@media (max-width: 1040px) {
  .kg-width-wide { margin-left: 0; margin-right: 0; }
}

/* Image cards */
.kg-card { margin-top: 2.5em; margin-bottom: 2.5em; }
.kg-image-card img,
.kg-image { width: 100%; height: auto; display: block; }
.kg-card figcaption,
.post-body figcaption {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 0.75rem;
  line-height: 1.5;
}
.kg-card figcaption a { color: var(--color-accent); }

/* Gallery cards: Ghost emits rows of images that should share a line. */
.kg-gallery-container { display: flex; flex-direction: column; }
.kg-gallery-row { display: flex; flex-direction: row; justify-content: center; }
.kg-gallery-row:not(:first-of-type) { margin-top: 0.75rem; }
.kg-gallery-image:not(:first-of-type) { margin-left: 0.75rem; }
.kg-gallery-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
@media (max-width: 560px) {
  .kg-gallery-row { flex-direction: column; }
  .kg-gallery-image:not(:first-of-type) { margin-left: 0; margin-top: 0.75rem; }
}

/* Bookmark cards */
.kg-bookmark-card { margin-top: 2.5em; margin-bottom: 2.5em; }
.kg-bookmark-container {
  display: flex;
  border: 1px solid var(--color-border);
  text-decoration: none;
  color: inherit;
  min-height: 148px;
}
.kg-bookmark-content { flex: 1 1 auto; padding: 1.25rem; }
.kg-bookmark-title {
  font-family: var(--font-display);
  font-size: 1.0625rem;
  font-weight: 400;
  margin-bottom: 0.35rem;
}
.kg-bookmark-description {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kg-bookmark-metadata {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.75rem; color: var(--color-text-muted); margin-top: 0.85rem;
}
.kg-bookmark-icon { width: 18px; height: 18px; }
.kg-bookmark-thumbnail { flex: 0 0 33%; }
.kg-bookmark-thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 560px) {
  .kg-bookmark-container { flex-direction: column-reverse; }
  .kg-bookmark-thumbnail { height: 180px; }
}

/* Callout cards */
.kg-callout-card {
  display: flex; gap: 0.75rem;
  padding: 1.1rem 1.25rem;
  background: var(--color-accent-light);
  margin-top: 2em; margin-bottom: 2em;
}
.kg-callout-emoji { flex-shrink: 0; }
.kg-callout-text { font-size: 0.9375rem; line-height: 1.6; }

/* Buttons */
.kg-button-card { display: flex; margin-top: 2em; margin-bottom: 2em; }
.kg-button-card.kg-align-center { justify-content: center; }
.kg-btn {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.9375rem; font-weight: 500;
  padding: 0.8rem 1.75rem;
  background: var(--color-accent); color: #fff;
  text-decoration: none;
  transition: background 0.2s ease;
}
.kg-btn:hover { background: var(--color-accent-dark); }

/* Toggle cards need a little JS, handled in blog.js */
.kg-toggle-card {
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  padding: 1.1rem 0;
  margin-top: 1.5em; margin-bottom: 1.5em;
}
.kg-toggle-heading {
  display: flex; justify-content: space-between; align-items: center;
  cursor: pointer; gap: 1rem;
}
.kg-toggle-heading-text {
  font-family: var(--font-display); font-size: 1.0625rem; font-weight: 400;
}
.kg-toggle-card-icon { width: 14px; height: 14px; transition: transform 0.2s ease; flex-shrink: 0; }
.kg-toggle-card[data-kg-toggle-state="close"] .kg-toggle-content { display: none; }
.kg-toggle-card[data-kg-toggle-state="open"] .kg-toggle-card-icon { transform: rotate(180deg); }
.kg-toggle-content { font-size: 0.9375rem; margin-top: 0.85rem; }

/* Embeds, video and audio */
.kg-embed-card { display: flex; flex-direction: column; align-items: center; }
.kg-embed-card iframe { max-width: 100%; }
.kg-video-card video, .kg-audio-card audio { width: 100%; display: block; }

/* Horizontal rule and blockquote already styled above in .post-body */

/* ==========================================================================
   Page hero. A tan band that runs straight out of the fixed nav so the two
   read as one block, matching the rest of the site.
   ========================================================================== */

.page-hero {
  background: var(--color-bg);
  padding: 7rem 2rem 3.5rem;
  text-align: center;
}

.page-hero-inner { max-width: 720px; margin: 0 auto; }
.page-hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-display);
  font-weight: 400;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 1rem;
}
.page-hero p {
  font-size: var(--text-large);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 auto;
  max-width: 52ch;
}
@media (max-width: 560px) {
  .page-hero { padding: 6rem 1.25rem 2.75rem; }
}

/* Compact signup, used in the hero and again after the cards. */
.signup {
  max-width: 460px;
  margin: 2rem auto 0;
}
.signup-form { display: flex; gap: 0.5rem; }
.signup-form input {
  flex: 1 1 0%;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  box-sizing: border-box;
}
.signup-form input:focus { outline: none; border-color: var(--color-accent); }
.signup-form button {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 500;
  padding: 0.875rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border: 1.5px solid var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.2s ease;
}
.signup-form button:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.signup-form button[disabled] { opacity: 0.6; cursor: default; }
.signup-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  margin: 0.85rem 0 0;
}
@media (max-width: 480px) { .signup-form { flex-direction: column; } }

/* The second ask, after someone has actually scrolled the work. */
.signup-tail {
  border-top: 1px solid var(--color-border);
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2rem 6rem;
  text-align: center;
}
.signup-tail h2 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-bottom: 0.6rem;
}
.signup-tail > p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  max-width: 48ch;
  margin: 0 auto;
}
.signup-tail .signup { margin-top: 1.75rem; }
@media (max-width: 560px) {
  .signup-tail { padding: 3rem 1.25rem 4rem; }
}

/* ==========================================================================
   In-post email gate. Public preview, then the ask, then the remainder held
   behind a fade until an email is entered.
   ========================================================================== */

.post-gate {
  max-width: 480px;
  margin: 3.5rem auto 0;
  text-align: center;
  position: relative;
  z-index: 5;
}
.post-gate-rule {
  width: 40px; height: 1px;
  background: var(--color-border);
  margin: 0 auto 2rem;
}
.post-gate h3 {
  font-family: var(--font-display);
  font-size: 1.625rem;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-bottom: 0.6rem;
}
.post-gate p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  line-height: 1.6;
  margin-bottom: 1.75rem;
}

/* Locked remainder.
   Everything behind the gate is shown, not just the next item, because the
   volume is the pitch. It is condensed into a blurred mosaic so eleven images
   occupy one screen instead of ten, and nobody has to scroll past a wall of
   blur to reach the footer. */
/* The locked body is also a .post-body, so it inherits that block's 3.5rem
   top padding. Locked, the gate sits between them and it reads fine. Unlocked,
   the gate is hidden and the padding plus margin stack into a ~96px hole that
   only members ever see. Zero the padding here and control the gap explicitly. */
.post-locked {
  position: relative;
  padding-top: 0;
  margin-top: 2.5rem;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.75rem;
  max-height: 620px;
  overflow: hidden;
  -webkit-user-select: none;
  user-select: none;
  pointer-events: none;
}
.post-locked > * {
  margin: 0;
  overflow: hidden;
  max-height: 190px;
}
/* Blur the image, not its wrapper.
   A filter renders outside the element box, so blurring the figure smears
   roughly six pixels past its own edge and leaves a halo beside the tile.
   Blurring the image inside a clipping wrapper puts the clip outside the
   blur instead of inside it. The slight scale hides the soft image edges
   that the blur would otherwise reveal at the tile borders. */
.post-locked img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  filter: blur(6px);
  opacity: 0.5;
  transform: scale(1.08);
}
/* Text between images gets the same treatment, with nothing to clip against. */
.post-locked > p,
.post-locked > h2,
.post-locked > h3,
.post-locked > ul,
.post-locked > ol { filter: blur(4px); opacity: 0.5; }
/* Text between the images should not eat a tile of its own. */
.post-locked > p,
.post-locked > h2,
.post-locked > h3,
.post-locked > ul,
.post-locked > ol { grid-column: 1 / -1; max-height: 60px; }

/* Contain any remaining bleed at the container edges. */
.post-locked { isolation: isolate; }

.post-locked-fade {
  position: absolute; inset: auto 0 0 0; height: 45%;
  grid-column: 1 / -1;
  background: linear-gradient(to bottom, rgba(255,255,255,0) 0%, var(--color-surface) 92%);
  pointer-events: none;
  filter: none;
  opacity: 1;
  max-height: none;
}

@media (max-width: 700px) {
  .post-locked { grid-template-columns: repeat(2, 1fr); max-height: 460px; }
  .post-locked > *, .post-locked img { max-height: 130px; }
  .post-locked img { height: 130px; }
}

/* Unlocked: back to a normal single-column article at full size. */
.post-locked.is-unlocked {
  display: block;
  max-height: none;
  overflow: visible;
  user-select: auto;
  pointer-events: auto;
  /* The last public image already carries 2.5em of bottom margin, so the
     unlocked remainder needs none of its own. */
  margin-top: 0;
  padding-top: 0;
}
/* First unlocked child sits directly against the public content above it. */
.post-locked.is-unlocked > *:first-child { margin-top: 0; }
.post-locked.is-unlocked > * {
  filter: none;
  opacity: 1;
  max-height: none;
  overflow: visible;
}
/* The mosaic zeroes margins to keep the grid tight. Put the article rhythm
   back once it is a single column again, or the images stack flush. */
.post-locked.is-unlocked > * + * { margin-top: 2.5em; }
.post-locked.is-unlocked > figure,
.post-locked.is-unlocked > .kg-card { margin-top: 2.5em; margin-bottom: 2.5em; }
.post-locked.is-unlocked img {
  height: auto;
  object-fit: fill;
  filter: none;
  opacity: 1;
  transform: none;
}
.post-locked.is-unlocked > p,
.post-locked.is-unlocked > h2,
.post-locked.is-unlocked > h3,
.post-locked.is-unlocked > ul,
.post-locked.is-unlocked > ol { filter: none; opacity: 1; }
.post-locked.is-unlocked .post-locked-fade { display: none; }

/* Hero signup shares the gate plumbing, so it needs the gate's error slot
   and fine print to sit correctly inside .hero-text-form. */
.hero-text-form .download-error {
  font-size: 0.8125rem;
  color: #a3302a;
  margin-top: 0.7rem;
  min-height: 1.1em;
  text-align: center;
}
.hero-text-form .download-ready {
  font-family: var(--font-display);
  font-size: 1.25rem;
  text-align: center;
}

@media (max-width: 560px) {
  .post-back { padding: 1.75rem 1.25rem 0; }
  .post-head { padding-left: 1.25rem; padding-right: 1.25rem; }
}

/* ==========================================================================
   Lightbox
   ========================================================================== */

.post-body img.is-zoomable { cursor: zoom-in; }

.lb {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 500;
}
.lb.is-open { display: flex; }

.lb-stage {
  margin: 0;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.85rem;
}
.lb-stage img {
  max-width: 92vw;
  max-height: 82vh;
  width: auto;
  height: auto;
  display: block;
  transition: filter 0.25s ease;
}
/* While the full-size file is arriving, the cached page copy is on screen.
   A slight softening says "sharpening" rather than "broken". */
.lb.is-loading .lb-stage img { filter: blur(1px); }
.lb.is-loading .lb-count::after {
  content: '';
  display: inline-block;
  width: 10px; height: 10px;
  margin-left: 0.5rem;
  vertical-align: -1px;
  border: 1.5px solid rgba(255,255,255,0.3);
  border-top-color: rgba(255,255,255,0.9);
  border-radius: 50%;
  animation: lb-spin 0.7s linear infinite;
}
@keyframes lb-spin { to { transform: rotate(360deg); } }
.lb-stage figcaption {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.8125rem;
  text-align: center;
  max-width: 60ch;
}

.lb-close,
.lb-prev,
.lb-next {
  position: absolute;
  background: none;
  border: none;
  color: #fff;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.18s ease;
  display: grid;
  place-items: center;
}
.lb-close:hover,
.lb-prev:hover,
.lb-next:hover { opacity: 1; }

.lb-close {
  top: 1rem; right: 1.25rem;
  font-size: 2rem; line-height: 1;
  padding: 0.25rem 0.6rem;
}
.lb-prev, .lb-next {
  top: 50%;
  transform: translateY(-50%);
  width: 56px; height: 56px;
}
.lb-prev { left: 0.5rem; }
.lb-next { right: 0.5rem; }
.lb-prev svg, .lb-next svg { width: 26px; height: 26px; }

.lb-count {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.55);
  font-size: 0.75rem;
  letter-spacing: 0.08em;
}

@media (max-width: 700px) {
  /* Arrows shrink out of the way; swipe is the primary control on touch. */
  .lb-prev, .lb-next { width: 44px; height: 44px; }
  .lb-prev svg, .lb-next svg { width: 20px; height: 20px; }
  .lb-stage img { max-height: 74vh; }
}

/* ==========================================================================
   Share button
   Members only, one per image. Sits over the image rather than beside it so
   it does not disturb the reading rhythm of the stacked layout.
   ========================================================================== */

.post-body .has-share { position: relative; }

.img-share {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.45);
  backdrop-filter: blur(6px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.15s ease, background 0.2s ease;
  z-index: 2;
}
.img-share svg { width: 19px; height: 19px; }
.has-share:hover .img-share { opacity: 1; }
.img-share:hover { background: rgba(10, 12, 16, 0.7); }
.img-share:active { transform: scale(0.9); }

/* Touch devices have no hover, and this is mostly a phone feature. */
@media (hover: none) {
  .img-share { opacity: 1; }
}

/* Fetching the file before the share sheet can open takes a moment on a
   large render, so the button says so rather than looking dead. */
.img-share.is-busy { opacity: 1; pointer-events: none; }
.img-share.is-busy svg { animation: share-pulse 0.9s ease-in-out infinite; }
@keyframes share-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Never on a locked image. Belt and braces: the script skips them too. */
.post-locked:not(.is-unlocked) .img-share { display: none; }

/* ==========================================================================
   Send to me
   One button under the title. Anything requiring typing happens in a dialog,
   so the page keeps a single action rather than a form beside the headline.
   ========================================================================== */

.post-send { margin-top: 1.75rem; text-align: center; }

/* An attribute cannot beat a class on specificity, so .post-send-done setting
   display:inline-flex was overriding [hidden] and the confirmation showed on
   every load. */
.post-send [hidden],
.post-send-done[hidden] { display: none !important; }

.post-send-btn {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 500;
  padding: 0.8rem 1.6rem;
  background: var(--color-accent);
  color: #fff;
  border: 1.5px solid var(--color-accent);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.post-send-btn:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.post-send-btn[disabled] { opacity: 0.6; cursor: default; }

/* Confirmation replaces the button, then steps back out of the way. A
   permanent green badge under the title is state nobody needs to keep
   looking at. */
.post-send-done {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.8rem 1.4rem;
  background: #eef6f0;
  border: 1.5px solid #cfe6d8;
  color: #1f6b43;
  font-size: 0.9375rem;
  animation: send-done 0.3s ease-out;
  transition: opacity 0.4s ease;
}
.post-send-done.is-leaving { opacity: 0; }
.post-send-check { width: 18px; height: 18px; flex-shrink: 0; }
@keyframes send-done {
  from { opacity: 0; transform: translateY(5px); }
  to   { opacity: 1; transform: translateY(0); }
}

.post-send-status {
  margin-top: 0.7rem;
  font-size: 0.8125rem;
  color: #a3302a;
  min-height: 1.1em;
}

/* ==========================================================================
   Email dialog
   ========================================================================== */

.send-dialog {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 16, 0.55);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 600;
  padding: 1.25rem;
}
.send-dialog.is-open { display: flex; }

.send-dialog-card {
  background: var(--color-surface);
  width: 100%;
  max-width: 420px;
  padding: 2rem 1.75rem 1.75rem;
  position: relative;
  text-align: center;
  animation: send-dialog 0.24s ease-out;
}
@keyframes send-dialog {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
/* Body font, not display. This is an instruction inside a small dialog, and
   a serif headline gives it more ceremony than a one-field form deserves. */
.send-dialog-card h3 {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 500;
  line-height: 1.5;
  color: var(--color-text);
  margin-bottom: 0.5rem;
  text-wrap: balance;
}
.send-dialog-card p {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin-bottom: 1.5rem;
}
.send-dialog-sub:empty { display: none; }
.send-dialog-title { margin-bottom: 1.75rem; }
.send-dialog-address {
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0 0 1.5rem;
}
.send-dialog-address strong {
  display: inline-block;
  margin-top: 0.2rem;
  font-weight: 500;
  color: var(--color-text);
}
.send-dialog-primary {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 500;
  padding: 0.875rem 2rem;
  background: var(--color-accent);
  color: #fff;
  border: 1.5px solid var(--color-accent);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.send-dialog-primary:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.send-dialog-primary[disabled] { opacity: 0.6; cursor: default; }
.send-dialog-switch {
  display: block;
  margin: 1rem auto 0;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.send-dialog-switch:hover { color: var(--color-text); }

.send-dialog-card [hidden] { display: none !important; }

.send-dialog-form { display: flex; gap: 0.5rem; }
.send-dialog-form input {
  flex: 1 1 0%;
  min-width: 0;
  font-family: var(--font-body);
  font-size: 0.9375rem;
  padding: 0.875rem 1rem;
  border: 1.5px solid var(--color-border);
  background: #fff;
  color: var(--color-text);
  box-sizing: border-box;
}
.send-dialog-form input:focus { outline: none; border-color: var(--color-accent); }
.send-dialog-form button {
  flex: 0 0 auto;
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 500;
  padding: 0.875rem 1.5rem;
  background: var(--color-accent);
  color: #fff;
  border: 1.5px solid var(--color-accent);
  cursor: pointer;
  white-space: nowrap;
}
.send-dialog-form button:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); }
.send-dialog-form button[disabled] { opacity: 0.6; cursor: default; }
.send-dialog-error {
  font-size: 0.8125rem;
  color: #a3302a;
  margin-top: 0.7rem;
  min-height: 1.1em;
}
.send-dialog-close {
  position: absolute;
  top: 0.5rem; right: 0.75rem;
  background: none; border: none;
  font-size: 1.5rem; line-height: 1;
  color: var(--color-text-muted);
  cursor: pointer;
}
@media (max-width: 480px) { .send-dialog-form { flex-direction: column; } }

/* ==========================================================================
   Share button
   Members only, one per image. Sits over the image rather than beside it so
   it does not disturb the reading rhythm of the stacked layout.
   ========================================================================== */

.post-body .has-share { position: relative; }

.img-share {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: rgba(10, 12, 16, 0.45);
  backdrop-filter: blur(6px);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.15s ease, background 0.2s ease;
  z-index: 2;
}
.img-share svg { width: 19px; height: 19px; }
.has-share:hover .img-share { opacity: 1; }
.img-share:hover { background: rgba(10, 12, 16, 0.7); }
.img-share:active { transform: scale(0.9); }

/* Touch devices have no hover, and this is mostly a phone feature. */
@media (hover: none) {
  .img-share { opacity: 1; }
}

/* Fetching the file before the share sheet can open takes a moment on a
   large render, so the button says so rather than looking dead. */
.img-share.is-busy { opacity: 1; pointer-events: none; }
.img-share.is-busy svg { animation: share-pulse 0.9s ease-in-out infinite; }
@keyframes share-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Never on a locked image. Belt and braces: the script skips them too. */
.post-locked:not(.is-unlocked) .img-share { display: none; }


/* Typo suggestion inside the dialog error slot. Advisory, so it reads as a
   question rather than a rejection. */
.send-dialog-fix {
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: inherit;
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.send-dialog-fix:hover { color: var(--color-accent-dark); }



/* State switching, decided in the head before first paint. */
.pr-known-only { display: none; }
html.pr-known .pr-known-only { display: block; }
html.pr-known .pr-anon-only { display: none !important; }


/* Tighter band: with the pitch moved below the form there is less to hold up,
   and the grid should start sooner. */
.hero-text { padding-top: 6rem; padding-bottom: 3rem; }
@media (max-width: 560px) {
  .hero-text { padding-top: 5.5rem; padding-bottom: 2.25rem; }
}

/* Subscribed, on a later visit. States what is true and offers the one action
   it implies. */
.hero-subscribed {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin: 0;
  text-align: center;
}
.hero-subscribed-email { color: var(--color-text); font-weight: 500; }
.hero-subscribed-change {
  display: block;
  margin: 0.4rem auto 0;
  background: none;
  border: none;
  padding: 0;
  font-family: var(--font-body);
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.hero-subscribed-change:hover { color: var(--color-text); }

/* Just subscribed. Confirms it worked and points at the next action. */
.hero-welcome {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  animation: hero-welcome-in 0.32s ease-out;
}
.hero-welcome-check { width: 32px; height: 32px; color: #1f6b43; }
.hero-welcome-title {
  font-family: var(--font-display);
  font-size: 1.375rem;
  font-weight: 400;
  color: var(--color-text);
  margin: 0.25rem 0 0;
}
.hero-welcome-sub {
  font-size: 0.9375rem;
  color: var(--color-text-muted);
  margin: 0;
  max-width: 36ch;
  text-align: center;
  text-wrap: balance;
}
@keyframes hero-welcome-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.hero-welcome-inline {
  display: block;
  font-size: 0.9375rem;
  color: #1f6b43;
  text-align: center;
  text-wrap: balance;
  max-width: 40ch;
  margin: 0 auto;
}
