/* Campaign page layout: media-led top, a section bar that stays in reach,
   and a story read beside its contents list and the rewards. */

/* Top: title centred above the media on wide screens. */
.project-page .project-intro { max-width: none; justify-self: center; text-align: center; }
.project-page .project-intro .project-meta { justify-content: center; }
.project-page .project-intro h1 { font-size: clamp(2rem, 3.6vw, 3rem); letter-spacing: -.04em; line-height: 1.1; }
.project-page .project-intro .tagline { max-width: 60ch; margin-inline: auto; }
.c-summary:not(.is-campaign) .c-amount { display: block; font-size: 1.75rem; letter-spacing: -.035em; }
.c-summary .project-primary { margin-top: 14px; }

/* Section bar: tabs plus the main action, pinned while reading. */
.project-bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 1.5rem; background: var(--paper); border-bottom: 1px solid var(--line); box-shadow: 0 0 0 100vmax var(--paper); clip-path: inset(0 -100vmax); }
.project-page .project-bar .project-tabs { position: static; display: flex; flex: 1; min-width: 0; margin: 0; padding: 0; border-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.project-page .project-bar .project-tabs::-webkit-scrollbar { display: none; }
.project-page .project-bar .project-tab { flex-shrink: 0; cursor: pointer; transition: color .15s ease; }
.project-bar-actions { display: none; flex-shrink: 0; align-items: center; gap: .5rem; }
.project-bar-actions .btn { width: auto; min-height: 44px; margin: 0; padding: .5rem 1rem; border-radius: 10px; font-size: .8125rem; white-space: nowrap; }
/* The page already reserves scroll room for the header; this clears the pinned bar too. */
[id^="story-section-"] { scroll-margin-top: 8px; }

/* Story beside its contents list and the reward rail. */
.project-page .detail-grid { grid-template-columns: minmax(0, 1fr) 340px; gap: 3rem; align-items: start; }
.project-page .detail-grid.has-toc { grid-template-columns: 190px minmax(0, 1fr) 340px; gap: 2.5rem; }
.project-page .detail-main { width: 100%; max-width: 720px; justify-self: center; }
.project-page .detail-grid:has(.detail-main .er-section) .detail-main { max-width: none; }
.story-toc { position: sticky; top: 84px; display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - 110px); overflow-y: auto; }
.story-toc .eyebrow { margin: 0 0 .5rem .75rem; }
.story-toc-link { min-height: 36px; padding: .5rem .75rem; border-left: 2px solid transparent; background: none; color: var(--muted); font-size: .8125rem; line-height: 1.4; text-align: left; cursor: pointer; overflow-wrap: anywhere; transition: color .15s ease, border-color .15s ease; }
.story-toc-link:hover, .story-toc-link[aria-current="true"] { color: var(--ink); border-left-color: var(--ink); }
.story-toc-link:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.story-funding > h2 { margin-top: 0; }

/* Rail: who is behind it, then what backing gets you. */
.project-page .project-sidebar { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.rail-creator { padding: 1.25rem; border: 1px solid var(--line); border-radius: 16px; background: #fffefa; }
.rail-creator-head { display: flex; align-items: center; gap: .75rem; margin-bottom: .75rem; }
.rail-creator-head > div { min-width: 0; }
.rail-creator h3 { margin: 0; font-size: 1rem; font-weight: 600; line-height: 1.35; overflow-wrap: anywhere; }
.rail-creator small { display: block; color: var(--muted); font-size: .75rem; line-height: 1.5; }
.rail-creator p { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; margin: 0 0 1rem; color: var(--secondary); font-size: .8125rem; line-height: 1.6; }
.rail-creator .btn { min-height: 44px; font-size: .8125rem; }
.er-rail { min-width: 0; }
.er-rail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; }
.er-rail-heading h2 { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -.025em; }
.er-rail-all.btn { min-height: 44px; padding: .5rem 0; border: 0; background: transparent; font-size: .8125rem; text-decoration: underline; text-underline-offset: 4px; }
.er-rail .er-context { margin: .25rem 0 0; }
.er-rail .er-risk { margin: 1rem 0 0; text-align: left; }
.er-rail-card { margin-top: .875rem; border: 1px solid #c8cfbc; border-radius: var(--media-radius-small, 16px); overflow: hidden; background: #fffefa; }
.er-rail-card.er-featured { border: 2px solid #496238; }
.er-rail-card > img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }
.er-rail-body { padding: 1rem 1.125rem 1.125rem; }
.er-rail-tag { display: inline-block; margin-bottom: .5rem; padding: 3px 9px; border-radius: 5px; background: #ddf584; font-size: .6875rem; font-weight: 650; }
.er-rail-top { display: flex; align-items: baseline; justify-content: space-between; gap: .75rem; }
.er-rail-top h3 { margin: 0; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; overflow-wrap: anywhere; }
.er-rail-price { font-size: 1.25rem; font-weight: 650; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.er-rail-description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; margin: .5rem 0 .75rem; color: var(--muted); font-size: .8125rem; line-height: 1.55; }
.er-rail-meta { display: grid; gap: .375rem; margin: .75rem 0; font-size: .75rem; }
.er-rail-meta:empty { display: none; }
.er-rail-meta > div { display: flex; justify-content: space-between; gap: .75rem; }
.er-rail-meta dt { color: var(--muted); }
.er-rail-meta dd { margin: 0; font-weight: 550; text-align: right; overflow-wrap: anywhere; }
.er-rail .er-choose.btn { margin-top: .5rem; }

@media (min-width: 900px) {
  .project-bar-actions { display: flex; }
  .project-page .project-action-dock { display: none; }
  body[data-route="project"] { padding-bottom: 0; }
  .project-page .project-overview .creator-mini { display: none; }
}
@media (max-width: 1180px) {
  .project-page .detail-grid.has-toc { grid-template-columns: minmax(0, 1fr) 320px; }
  .story-toc { display: none; }
}
@media (max-width: 899px) {
  .project-page .detail-grid, .project-page .detail-grid.has-toc { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
  .project-page .detail-main { max-width: none; }
}
@media (max-width: 760px) {
  /* Phones lead with the media, then the title, then the numbers. */
  .project-page .project-top { grid-template-areas: "visual" "heading" "overview"; }
  .project-page .project-intro { justify-self: stretch; text-align: left; }
  .project-page .project-intro .project-meta { justify-content: flex-start; }
  .project-page .project-intro .tagline { margin-inline: 0; }
  .project-page .project-bar .project-tabs { gap: 1.375rem; padding-bottom: 0; }
}
@media (max-width: 650px) {
  .er-media { height: 180px; }
}
@media (max-width: 600px) {
  .project-bar { top: var(--header-height, 0px); margin-inline: -20px; padding-inline: 20px; }
  .project-page .project-bar .project-tabs { margin-inline: 0; padding-inline: 0; }
  [id^="story-section-"] { scroll-margin-top: 60px; }
}
@media (max-width: 359px) {
  .project-bar { margin-inline: -16px; padding-inline: 16px; }
}
@media (hover: hover) and (pointer: fine) {
  .er-rail-all.btn:hover { color: var(--focus); }
}
@media (prefers-reduced-motion: reduce) {
  .story-toc-link, .project-page .project-bar .project-tab { transition: none; }
}

/* One quiet line for category, place and stage: under the media on wide screens,
   between the numbers and the button on phones. */
.project-page .project-top { grid-template-areas: "heading heading" "visual overview" "place overview"; grid-template-rows: auto auto 1fr; }
.project-place { grid-area: place; align-self: start; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1.5rem; color: var(--secondary); font-size: .8125rem; line-height: 1.5; }
.project-place > span { display: inline-flex; align-items: center; gap: .4rem; }
.project-place svg { width: 18px; height: 18px; flex: none; }
.c-place-inline { display: none; }

/* Sharing: a reminder button and plain icons, not a box per action. */
.c-share-row { display: flex; align-items: center; gap: .75rem; margin: 10px 0 4px; }
.c-remind.btn { flex: 1 1 0; min-width: 0; min-height: 44px; padding: 10px; gap: .5rem; font-size: .85rem; }
.c-remind svg { width: 18px; height: 18px; flex: none; }
.c-share-icons { display: flex; flex: 0 0 auto; }
.c-share-icon { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 50%; background: none; color: var(--ink); cursor: pointer; transition: background-color .15s ease; }
.c-share-icon svg { width: 22px; height: 22px; }
.c-share-icon:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* Secondary ways to get involved read as links, so one button leads. */
.project-page .project-engagement { display: flex; flex-wrap: wrap; gap: 0 1.5rem; margin: .25rem 0 .5rem; }
.project-page .project-engagement .btn { flex: 0 1 auto; width: auto; min-height: 44px; padding: .5rem 0; border: 0; border-radius: 0; background: transparent; color: var(--secondary); font-size: .8125rem; font-weight: 400; text-decoration: underline; text-decoration-color: #b5bcae; text-underline-offset: 4px; cursor: pointer; }
.project-page .project-engagement .btn[aria-pressed="true"] { background: transparent; color: var(--focus); }
@media (max-width: 760px) {
  .project-page .project-top { grid-template-areas: "visual" "heading" "overview"; grid-template-rows: none; }
  .project-top > .project-place { display: none; }
  .c-place-inline { display: block; margin: 0 0 14px; padding: 0 0 12px; border-bottom: 1px solid var(--line); }
  .project-page .c-summary .btn.project-primary { display: flex; width: 100%; max-width: none; }
}
@media (hover: hover) and (pointer: fine) {
  .c-share-icon:hover { background: #e8ebdf; }
  .project-page .project-engagement .btn:hover { color: var(--ink); text-decoration-color: var(--ink); }
}
@media (prefers-reduced-motion: reduce) { .c-share-icon { transition: none; } }
@media (max-width: 420px) { .c-share-row { gap: .5rem; } .c-remind svg { display: none; } }
