/*
 * HCFB Campaign Engine -- staff-only front-end campaign preview (Phase 7E-5).
 * Loaded only on /campaign-preview/{campaign}/. Builds on the public hub
 * styles (campaign-engine.css) and the theme's colour tokens.
 */

.hcfb-ce-preview { overflow-x: clip; }
.hcfb-ce-preview *,
.hcfb-ce-preview *::before,
.hcfb-ce-preview *::after { box-sizing: border-box; }

/* Staff-only strip */
.hcfb-ce-preview__staff { background: #fffbea; border-bottom: 1px solid #e8d48b; color: #4a3b00; font-size: 0.85rem; line-height: 1.35; }
.hcfb-ce-preview__staff-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; width: min(100% - 2rem, 82rem); margin-inline: auto; padding: 0.35rem 0; }
.hcfb-ce-preview__staff strong { padding: 0.1rem 0.45rem; border-radius: 0.3rem; background: #4a3b00; color: #fffbea; text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.7rem; }
.hcfb-ce-preview__staff a { display: inline-flex; min-height: 2.25rem; align-items: center; padding: 0.2rem 0.75rem; border: 1px solid #a88a1d; border-radius: 999px; background: #fff; color: #4a3b00; font-weight: 700; text-decoration: none; }
.hcfb-ce-preview__staff a[aria-pressed="true"] { background: #4a3b00; border-color: #4a3b00; color: #fffbea; }
.hcfb-ce-preview__staff a:hover { border-color: #4a3b00; }
.hcfb-ce-preview__staff-note { color: #5c4a00; }
.hcfb-ce-preview__staff-note { flex-basis: 100%; margin: 0; }

/* Hero additions: always one column (the hub's 1024px rule would otherwise add an empty media column). */
.hcfb-ce-preview .hcfb-ce-preview__hero { grid-template-columns: minmax(0, 1fr); min-height: 0; }
.hcfb-ce-preview__hero .hcfb-ce-hub__hero-content { padding-block: clamp(2rem, 3.6vw, 3.1rem); }
.hcfb-ce-preview .hcfb-ce-preview__hero .hcfb-ce-hub__hero-content { max-width: 60rem; }
/* Compact hero (7E-5): about 60px titles on desktop and tighter vertical rhythm, same look. */
.hcfb-ce-preview__hero .hcfb-ce-hub__eyebrow { margin-bottom: 0.45rem; }
.hcfb-ce-preview__hero h1 { max-width: 22ch; font-size: clamp(2.2rem, 1.4rem + 2.6vw, 3.9rem); line-height: 1.04; text-wrap: balance; }
.hcfb-ce-preview .hcfb-ce-preview__hero h1.hcfb-ce-preview__title--long { max-width: 30ch; font-size: clamp(2rem, 1.25rem + 1.9vw, 3rem); line-height: 1.08; }
.hcfb-ce-preview .hcfb-ce-preview__hero .hcfb-ce-hub__intro { max-width: 44rem; margin-top: 0.8rem; font-size: clamp(1rem, 0.94rem + 0.3vw, 1.15rem); line-height: 1.5; }
.hcfb-ce-preview__raised .hcfb-ce-preview__raised-amount--first { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); line-height: 1.15; }
.hcfb-ce-preview__totals { width: min(100%, 40rem); margin: 1.1rem auto 0; }
.hcfb-ce-preview__raised { margin: 0; font-size: clamp(1.05rem, 1rem + 0.4vw, 1.25rem); }
.hcfb-ce-preview__raised-amount { display: block; font-size: clamp(2.1rem, 1.6rem + 2vw, 3rem); font-weight: 800; line-height: 1.05; color: #fff; }
.hcfb-ce-preview__goal { opacity: 0.85; }
.hcfb-ce-preview__progress { height: 0.6rem; margin: 0.75rem 0; border-radius: 999px; background: var(--hcfb-ce-cream, #faf5ec); overflow: hidden; }
.hcfb-ce-preview__progress span { display: block; height: 100%; border-radius: inherit; background: var(--hcfb-ce-green, #a2c13d); }
.hcfb-ce-preview__progress--hero { height: 0.75rem; margin: 0.55rem 0; background: rgba(255, 255, 255, 0.22); }
.hcfb-ce-preview__stats { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.35rem 1.75rem; margin: 0.55rem 0 0; padding: 0; list-style: none; font-size: 1rem; }
.hcfb-ce-preview__stats strong { font-size: 1.25rem; color: var(--hcfb-ce-orange, #f78d22); }
.hcfb-ce-preview__ctas { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin: 1.2rem 0 0; }
.hcfb-ce-preview__ctas .hcfb-ce-hub__donate,
.hcfb-ce-preview__ctas .hcfb-ce-hub__start { min-height: 3rem; padding-block: 0.7rem; }
.hcfb-ce-preview__ctas .hcfb-ce-hub__donate,
.hcfb-ce-preview__ctas .hcfb-ce-hub__start { margin: 0; }

/* Sections */
.hcfb-ce-preview__section { margin-block: clamp(2.5rem, 6vw, 5rem); }
.hcfb-ce-preview__wrap { width: min(100% - 2rem, 82rem); margin-inline: auto; }
.hcfb-ce-preview__section h2 { margin: 0; color: var(--hcfb-ce-navy, #262760); font-size: clamp(1.75rem, 1.4rem + 1.5vw, 2.6rem); }
.hcfb-ce-preview__count { margin: 0.5rem 0 0; color: var(--hcfb-ce-muted, #5a5a66); }
.hcfb-ce-preview__empty { padding: 2rem; border: 1px dashed var(--hcfb-ce-border, #d8d3c6); border-radius: 1rem; background: var(--hcfb-ce-cream, #faf5ec); text-align: center; font-size: 1.1rem; }

.hcfb-ce-preview__top { width: min(100% - 2rem, 86rem); margin: clamp(2rem, 5vw, 3.5rem) auto 0; padding: clamp(1.5rem, 4vw, 3rem) clamp(1rem, 3vw, 2.25rem); border-radius: 1.5rem; background: var(--hcfb-ce-cream, #faf5ec); }
.hcfb-ce-preview__top .hcfb-ce-preview__wrap { width: 100%; }
.hcfb-ce-preview__top-grid,
.hcfb-ce-preview__grid { display: grid; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }
.hcfb-ce-preview__top-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* One or two leaders stay card-sized and centred instead of stretching into a banner. */
.hcfb-ce-preview__top-grid--n1 { grid-template-columns: minmax(0, 24rem); justify-content: center; }
.hcfb-ce-preview__top-grid--n2 { grid-template-columns: repeat(2, minmax(0, 24rem)); justify-content: center; }
.hcfb-ce-preview__top--n1 .hcfb-ce-hub__section-heading,
.hcfb-ce-preview__top--n2 .hcfb-ce-hub__section-heading { margin-inline: auto; text-align: center; }
.hcfb-ce-preview__grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 16rem), 1fr)); }
.hcfb-ce-preview__grid > li[hidden] { display: none; }

/* Cards */
.hcfb-ce-preview__card { display: flex; flex-direction: column; height: 100%; min-width: 0; overflow: hidden; border: 1px solid var(--hcfb-ce-border, #d8d3c6); border-radius: 1rem; background: #fff; box-shadow: 0 0.45rem 1.4rem rgba(38, 39, 96, 0.07); }
.hcfb-ce-preview__card--top { border-width: 2px; border-color: var(--hcfb-ce-navy, #262760); }
.hcfb-ce-preview__media { position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: var(--hcfb-ce-cream, #faf5ec); }
.hcfb-ce-preview__img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hcfb-ce-preview__img--none[hidden] { display: none; }
.hcfb-ce-preview__img--tall { object-position: 50% 0; }
.hcfb-ce-preview__img--none { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--hcfb-ce-navy, #262760), #3c3d8a); color: #fff; }
.hcfb-ce-preview__img--none span { font-size: 2.6rem; font-weight: 800; letter-spacing: 0.06em; opacity: 0.9; }
.hcfb-ce-preview__rank { position: absolute; top: 0.75rem; left: 0.75rem; padding: 0.25rem 0.7rem; border-radius: 999px; background: var(--hcfb-ce-orange, #f78d22); color: var(--hcfb-ce-navy, #262760); font-weight: 800; }
.hcfb-ce-preview__ended { position: absolute; top: 0.75rem; right: 0.75rem; padding: 0.2rem 0.65rem; border-radius: 999px; background: #fff; color: var(--hcfb-ce-text, #1d1e24); font-size: 0.8rem; font-weight: 700; }
.hcfb-ce-preview__body { display: flex; flex: 1; flex-direction: column; gap: 0.35rem; padding: 1.1rem 1.25rem 1.25rem; }
.hcfb-ce-preview__body h3 { margin: 0 0 0.25rem; color: var(--hcfb-ce-navy, #262760); font-size: 1.2rem; line-height: 1.25; overflow-wrap: anywhere; }
.hcfb-ce-preview__amount { margin: 0; font-size: 1.05rem; }
.hcfb-ce-preview__amount strong { font-size: 1.5rem; color: var(--hcfb-ce-navy, #262760); }
.hcfb-ce-preview__amount--first { font-weight: 700; color: var(--hcfb-ce-navy, #262760); }
.hcfb-ce-preview__meals { margin: 0; color: var(--hcfb-ce-green-text, #627425); font-weight: 600; }
.hcfb-ce-preview__cta { display: inline-flex; align-self: flex-start; align-items: center; min-height: 2.75rem; margin-top: auto; padding: 0.55rem 1.15rem; border: 2px solid var(--hcfb-ce-navy, #262760); border-radius: 999px; background: #fff; color: var(--hcfb-ce-navy, #262760); font-weight: 800; line-height: 1.2; text-decoration: none; }
.hcfb-ce-preview__body > .hcfb-ce-preview__cta { margin-top: auto; }
.hcfb-ce-preview__body > p:last-of-type { margin-bottom: 0.85rem; }
.hcfb-ce-preview__cta:hover { background: var(--hcfb-ce-navy, #262760); color: #fff; }
.hcfb-ce-preview__cta--ended { border-color: var(--hcfb-ce-border, #d8d3c6); color: var(--hcfb-ce-text, #1d1e24); }
.hcfb-ce-preview__cta--ended:hover { border-color: var(--hcfb-ce-navy, #262760); background: var(--hcfb-ce-cream, #faf5ec); color: var(--hcfb-ce-navy, #262760); }

.hcfb-ce-preview__more-wrap { margin: 1.75rem 0 0; text-align: center; }
.hcfb-ce-preview__more { display: inline-flex; min-height: 3rem; align-items: center; padding: 0.75rem 1.5rem; border: 2px solid var(--hcfb-ce-navy, #262760); border-radius: 999px; color: var(--hcfb-ce-navy, #262760); font-weight: 800; text-decoration: none; }
.hcfb-ce-preview__more:hover { background: var(--hcfb-ce-navy, #262760); color: #fff; }
button.hcfb-ce-preview__more { background: transparent; font: inherit; font-weight: 800; cursor: pointer; }
.hcfb-ce-preview button:focus-visible { outline: 3px solid var(--hcfb-ce-orange, #f78d22); outline-offset: 3px; }
/* Supporter-message "Load more": count and button under the list; the first newly shown card takes focus. */
.hcfb-ce-preview__message-list > li[hidden] { display: none; }
.hcfb-ce-preview__messages-count { margin: 1rem 0 0; text-align: center; }
.hcfb-ce-preview__messages-more { margin-top: 0.75rem; }
.hcfb-ce-preview__message:focus { outline: 3px solid var(--hcfb-ce-orange, #f78d22); outline-offset: 2px; }
@media (max-width: 600px) { .hcfb-ce-preview__messages-more .hcfb-ce-preview__more { width: 100%; justify-content: center; } }

.hcfb-ce-preview a:focus-visible { outline: 3px solid var(--hcfb-ce-orange, #f78d22); outline-offset: 3px; }
.hcfb-ce-preview__staff a:focus-visible { outline-color: #262760; }
/* Campaign content layout: Top fundraisers, supporter messages, All fundraisers (narrow order). */
.hcfb-ce-preview__layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(2rem, 4vw, 3rem); width: min(100% - 2rem, 86rem); margin: clamp(2rem, 5vw, 3.5rem) auto clamp(2.5rem, 6vw, 5rem); }
/* Inside the layout the grid sets the width; the shared hub section width/margins do not apply. */
.hcfb-ce-preview .hcfb-ce-preview__layout > .hcfb-ce-hub__section { width: 100%; margin: 0; }
.hcfb-ce-preview__layout .hcfb-ce-preview__wrap { width: 100%; }
@media (min-width: 1280px) {
	/* Wide: fundraisers about 65%, supporter messages a substantial right-hand column (about 33%) level with Top fundraisers.
	   Below 1280px the sections stack (Top, messages, All) so fundraiser cards never get cramped. */
	.hcfb-ce-preview__layout--with-messages { grid-template-columns: minmax(0, 2fr) minmax(22rem, 1fr); grid-template-rows: auto 1fr; grid-template-areas: "top messages" "all messages"; align-items: start; }
	.hcfb-ce-preview__layout--with-messages > .hcfb-ce-preview__top { grid-area: top; }
	.hcfb-ce-preview__layout--with-messages > .hcfb-ce-preview__all { grid-area: all; }
	.hcfb-ce-preview__layout--with-messages > .hcfb-ce-preview__messages { grid-area: messages; padding: clamp(1.75rem, 2.5vw, 2.25rem) clamp(1.25rem, 1.75vw, 1.75rem); border-radius: 1.5rem; background: var(--hcfb-ce-cream, #faf5ec); }
	.hcfb-ce-preview__layout--with-messages .hcfb-ce-preview__messages h2 { font-size: clamp(1.75rem, 1.2rem + 1vw, 2.25rem); }
	.hcfb-ce-preview__layout--with-messages .hcfb-ce-preview__message-list { grid-template-columns: minmax(0, 1fr); gap: 0.9rem; }
	.hcfb-ce-preview__layout--with-messages .hcfb-ce-preview__message { height: auto; }
	/* Narrower fundraiser column: a little less panel padding and gap keeps three Top fundraisers comfortable. */
	.hcfb-ce-preview__layout--with-messages > .hcfb-ce-preview__top { padding-inline: clamp(1rem, 1.6vw, 1.5rem); }
	.hcfb-ce-preview__layout--with-messages .hcfb-ce-preview__top-grid { gap: 1rem; }
}

/* Recent supporter messages (staff preview only) */
.hcfb-ce-preview__message-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr)); gap: 0.85rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
/* Activity-feed card: "Name · 2 days ago", then the message, then the fundraiser. */
.hcfb-ce-preview__message { display: flex; flex-direction: column; gap: 0.55rem; height: 100%; margin: 0; padding: 1.15rem 1.25rem 1.2rem; border: 1px solid #cfc7b5; border-left: 5px solid var(--hcfb-ce-orange, #f78d22); border-radius: 1rem; background: #fff; box-shadow: 0 1px 3px rgba(38, 39, 96, 0.08); box-sizing: border-box; }
.hcfb-ce-preview__message-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 0.45rem; margin: 0; line-height: 1.35; overflow-wrap: anywhere; }
.hcfb-ce-preview__message-name { color: var(--hcfb-ce-navy, #262760); font-size: 0.97rem; font-weight: 700; }
.hcfb-ce-preview__message-when { display: inline-flex; gap: 0.4rem; white-space: nowrap; }
.hcfb-ce-preview__message-sep,
.hcfb-ce-preview__message-meta time { color: var(--hcfb-ce-muted, #5a5a66); font-size: 0.86rem; }
.hcfb-ce-preview__message-text { flex: 1; margin: 0; }
.hcfb-ce-preview__message-text p { margin: 0; color: var(--hcfb-ce-navy, #262760); font-size: 1.1rem; font-weight: 500; line-height: 1.55; overflow-wrap: anywhere; }
.hcfb-ce-preview__message-page { margin: 0.05rem 0 0; color: var(--hcfb-ce-muted, #5a5a66); font-size: 0.84rem; line-height: 1.4; overflow-wrap: anywhere; }
.hcfb-ce-preview__sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* No messages yet: a compact note between the fundraiser sections, never an empty column. */
.hcfb-ce-preview__messages--empty .hcfb-ce-preview__wrap { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.35rem 1.25rem; padding: 1rem 1.5rem; border: 1px dashed var(--hcfb-ce-border, #d8d3c6); border-radius: 1rem; background: var(--hcfb-ce-cream, #faf5ec); }
.hcfb-ce-preview__messages--empty .hcfb-ce-hub__section-heading { margin: 0; }
.hcfb-ce-preview__messages--empty .hcfb-ce-hub__section-kicker { display: none; }
.hcfb-ce-preview .hcfb-ce-preview__messages--empty h2 { font-size: 1.2rem; }
.hcfb-ce-preview__messages--empty .hcfb-ce-preview__messages-empty { margin: 0; padding: 0; border: 0; background: none; text-align: left; font-size: 1rem; color: var(--hcfb-ce-muted, #5a5a66); }

@media (max-width: 760px) {
	.hcfb-ce-preview__top-grid,
	.hcfb-ce-preview__top-grid--n1,
	.hcfb-ce-preview__top-grid--n2 { grid-template-columns: minmax(0, 26rem); justify-content: center; }
}

@media (max-width: 600px) {
	.hcfb-ce-preview__img--none span { font-size: 2rem; }
	/* Mobile hero: one centred, readable column. */
	.hcfb-ce-preview .hcfb-ce-preview__hero .hcfb-ce-hub__hero-content { width: 100%; max-width: 36rem; margin-inline: auto; padding: 1.35rem 1.25rem 1.6rem; text-align: center; }
	.hcfb-ce-preview .hcfb-ce-preview__hero h1 { max-width: 18ch; margin-inline: auto; font-size: clamp(1.85rem, 8vw, 2.4rem); line-height: 1.08; text-wrap: balance; }
	.hcfb-ce-preview .hcfb-ce-preview__hero h1.hcfb-ce-preview__title--long { max-width: 22ch; font-size: clamp(1.6rem, 6.8vw, 2.05rem); }
	.hcfb-ce-preview .hcfb-ce-preview__hero .hcfb-ce-hub__intro { max-width: 36ch; margin: 0.55rem auto 0; font-size: 0.98rem; line-height: 1.42; }
	.hcfb-ce-preview__totals { margin-top: 0.8rem; }
	.hcfb-ce-preview__stats { justify-content: center; gap: 0.35rem 1.5rem; }
	.hcfb-ce-preview__ctas { flex-direction: column; align-items: center; gap: 0.55rem; margin-top: 1rem; }
	.hcfb-ce-preview__ctas .hcfb-ce-hub__donate,
	.hcfb-ce-preview__ctas .hcfb-ce-hub__start { width: 100%; max-width: 20rem; }
	.hcfb-ce-preview__staff-inner { gap: 0.4rem 0.5rem; padding: 0.45rem 0; }
	.hcfb-ce-preview__staff-inner > span { flex: 1 1 12rem; font-size: 0.8rem; }
	.hcfb-ce-preview__staff a { min-height: 2.25rem; padding: 0.15rem 0.6rem; font-size: 0.8rem; }
	.hcfb-ce-preview__staff-note { font-size: 0.78rem; }
	.hcfb-ce-preview__top .hcfb-ce-hub__section-heading { text-align: center; }
}
@media (prefers-reduced-motion: reduce) { .hcfb-ce-preview * { transition: none !important; } }
