/**
 * Campaign Single Page — Hero + Sticky Sidebar Layout
 *
 * Location: assets/css/campaign-single-hero.css
 * Loaded after: frontend.css, brand.css
 * Scope prefix: .cg-hero-layout
 *
 * Synced with templates/campaign-single.php (Document 2):
 *  • No .cg-hero__badge-row wrapper div in PHP → CSS-only sibling alignment
 *  • No cg-card-stats block in PHP            → rules removed
 *  • No cg-trust-bar block in PHP             → rules removed
 *
 * @package CharityGlow
 * @since   1.2.0
 */

/* ─────────────────────────────────────────────────────────────────────────────
   1. CSS VARIABLES
───────────────────────────────────────────────────────────────────────────── */
.cg-hero-layout {
	--cg-accent:    var(--charityglow-accent, #DC2626);
	--cg-accent-dk: var(--charityglow-accent-dark, #B91C1C);
	--cg-accent-bg: var(--charityglow-accent-bg, #fee2e2);
	--cg-primary:   var(--charityglow-primary, #15803D);
	--cg-secondary: var(--charityglow-secondary, #1E40AF);
	--cg-text:      #111827;
	--cg-muted:     #6B7280;
	--cg-border:    #E5E7EB;
	--cg-surface:   #ffffff;
	--cg-bg:        #F8FAFC;
	--cg-hero-dark: #0f172a;
	--cg-sidebar-w: 380px;
	--cg-gap:       40px;
	--cg-radius:    20px;
	--cg-shadow:    0 4px 24px rgba(0,0,0,.07);
	--cg-shadow-lg: 0 8px 48px rgba(0,0,0,.12);
}

/* ─────────────────────────────────────────────────────────────────────────────
   2. THEME COMPATIBILITY & FULL-BLEED NORMALISATION
   Tested with: Astra · Hello Elementor · Twenty Twenty-Five
───────────────────────────────────────────────────────────────────────────── */
.cg-hero-layout *,
.cg-hero-layout *::before,
.cg-hero-layout *::after { box-sizing: border-box; }

.cg-hero-layout {
	background: var(--cg-bg);
	position: relative;
	margin-left:  calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	width: 100vw;
	max-width: 100vw;
}

/* Force breakout even inside theme content wrappers */
.ast-article-single     .cg-hero-layout,
.ast-separate-container .cg-hero-layout,
.single-page-content    .cg-hero-layout,
.wp-block-post-content  .cg-hero-layout,
.entry-content          .cg-hero-layout,
.elementor-page         .cg-hero-layout {
	margin-left:  calc(-50vw + 50%);
	margin-right: calc(-50vw + 50%);
	width: 100vw;
}

/* Typography reset — prevent theme h-tag styles bleeding into plugin */
.cg-hero-layout h1,
.cg-hero-layout h2,
.cg-hero-layout h3,
.cg-hero-layout h4 {
	font-family: inherit;
	letter-spacing: normal;
	text-transform: none;
	border: none;
	padding: 0;
	margin: 0;
}
/* Some themes add decorative ::before on headings */
.cg-section-card h1::before,
.cg-section-card h2::before,
.cg-section-card h3::before { display: none; }

/* Prevent theme link styles hitting share buttons */
.cg-hero-layout a.share-btn,
.cg-hero-layout a.share-btn:hover,
.cg-hero-layout a.share-btn:visited {
	text-decoration: none;
	box-shadow: none;
	outline: none;
}

/* Form element normalisation */
.cg-donate-card__body input,
.cg-donate-card__body select,
.cg-donate-card__body textarea,
.cg-donate-card__body button {
	font-family: inherit;
	font-size: inherit;
	line-height: normal;
}

/* ─────────────────────────────────────────────────────────────────────────────
   3. HERO SECTION
───────────────────────────────────────────────────────────────────────────── */
.cg-hero {
	position: relative;
	min-height: 480px;
	display: flex;
	align-items: flex-end;
	overflow: hidden;
	background: var(--cg-hero-dark);
}

.cg-hero__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center 30%;
	background-repeat: no-repeat;
	opacity: .38;
}

.cg-hero--no-image {
	background: linear-gradient(150deg,#0f172a 0%,#1a1035 40%,#0d2847 100%);
}
.cg-hero--no-image .cg-hero__bg { display: none; }

.cg-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(15,23,42,.95) 0%,
		rgba(15,23,42,.55) 45%,
		rgba(15,23,42,.10) 100%
	);
}

.cg-hero__inner {
	position: relative;
	z-index: 2;
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 40px 52px;
}

/* ──────────────────────────────────────────────────────────────────────────
   BADGE + CATEGORY — CSS-ONLY ALIGNMENT (no wrapper div in PHP)
   ──────────────────────────────────────────────────────────────────────────
   Template structure:
     <div class="cg-hero__live-badge">…</div>     ← always shown
     <span class="cg-hero__category">…</span>     ← conditional
     <h1 class="cg-hero__title">…</h1>

   Fix: Both set to display:inline-flex so they sit on one text line.
   vertical-align:middle on both ensures they share the same centre axis.
   margin-right on badge = gap between them.
   margin-top on title = spacing below the badge row in all cases.
──────────────────────────────────────────────────────────────────────────── */
.cg-hero__live-badge {
	display: inline-flex;        /* inline → sits on same line as category span */
	align-items: center;
	vertical-align: middle;      /* aligns centre with adjacent category         */
	gap: 7px;
	background: var(--cg-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 5px 14px;
	border-radius: 100px;
	margin-right: 8px;           /* gap between badge and category               */
	margin-bottom: 0;
	line-height: 1;
	white-space: nowrap;
}

.cg-hero__live-dot {
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: #fff;
	flex-shrink: 0;
	animation: cgPulse 2s ease-in-out infinite;
}
@keyframes cgPulse {
	0%,100% { opacity: 1; transform: scale(1); }
	50%     { opacity: .4; transform: scale(.8); }
}

.cg-hero__category {
	display: inline-flex;        /* keeps on same line as live badge              */
	align-items: center;
	vertical-align: middle;      /* exactly matches badge centre axis             */
	background: rgba(255,255,255,.12);
	border: 1px solid rgba(255,255,255,.2);
	color: rgba(255,255,255,.85);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	padding: 5px 12px;           /* same vertical padding as live badge           */
	border-radius: 4px;
	line-height: 1;              /* matches live badge line-height                */
	margin: 0;
	white-space: nowrap;
}

.cg-hero__title {
	display: block;              /* guarantees own line below the inline badges   */
	font-size: clamp(26px, 3.5vw, 52px) !important;
	font-weight: 800 !important;
	color: #fff !important;
	line-height: 1.15 !important;
	max-width: 680px;
	/* top 16px = spacing from badge+category row (works whether or not      */
	/* the category span is rendered); bottom 18px = space before meta row. */
	margin: 16px 0 18px !important;
	text-shadow: 0 2px 12px rgba(0,0,0,.3);
}

.cg-hero__meta { display: flex; flex-wrap: wrap; gap: 20px; }

.cg-hero__meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
	color: rgba(255,255,255,.65);
	font-size: 13px;
	font-weight: 500;
}
.cg-hero__meta-item strong { color: #fff; font-weight: 700; }
.cg-hero__meta-icon { width: 14px; height: 14px; opacity: .7; flex-shrink: 0; }

/* ─────────────────────────────────────────────────────────────────────────────
   4. CONTENT GRID
───────────────────────────────────────────────────────────────────────────── */
.cg-content-wrap {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 40px 80px;
}

.cg-content-grid {
	display: grid;
	grid-template-columns: 1fr var(--cg-sidebar-w);
	gap: var(--cg-gap);
	margin-top: -72px;
	align-items: start;
}

/* ─────────────────────────────────────────────────────────────────────────────
   5. SECTION CARDS (left column)
───────────────────────────────────────────────────────────────────────────── */
.cg-section-card {
	background: var(--cg-surface);
	border-radius: var(--cg-radius);
	box-shadow: var(--cg-shadow);
	border: 1px solid rgba(0,0,0,.04);
	padding: 36px;
	margin-bottom: 24px;
}
.cg-section-card:last-child { margin-bottom: 0; }

.cg-section-label {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--cg-secondary);
	margin-bottom: 20px;
}
.cg-section-label::before {
	content: '';
	display: block;
	width: 26px;
	height: 3px;
	background: var(--cg-secondary);
	border-radius: 2px;
	flex-shrink: 0;
}

/* Description content */
.cg-description { line-height: 1.8; }
.cg-description p  { font-size: 15px; color: #374151; margin-bottom: 16px; }
.cg-description h2,
.cg-description h3 { color: var(--cg-secondary) !important; margin-bottom: 12px !important; }
.cg-description ul,
.cg-description ol { padding-left: 22px; margin-bottom: 16px; color: #374151; font-size: 15px; line-height: 1.75; }
.cg-description blockquote {
	border-left: 4px solid var(--cg-accent);
	background: var(--cg-accent-bg);
	padding: 16px 20px;
	border-radius: 0 10px 10px 0;
	margin: 20px 0;
	font-style: italic;
	color: var(--cg-text);
}

/* ─────────────────────────────────────────────────────────────────────────────
   6. RECENT DONORS LIST
───────────────────────────────────────────────────────────────────────────── */
.cg-donors-list { list-style: none; padding: 0; margin: 0; }

.cg-donor-item {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 12px 0;
	border-bottom: 1px solid var(--cg-border);
}
.cg-donor-item:last-child { border-bottom: none; }

.cg-donor-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--cg-accent);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 800;
	flex-shrink: 0;
}
.cg-donor-name   { font-size: 14px; font-weight: 700; color: var(--cg-text); }
.cg-donor-meta   { font-size: 12px; color: var(--cg-muted); margin-top: 2px; }
.cg-donor-amount { margin-left: auto; font-size: 14px; font-weight: 800; color: var(--cg-primary); white-space: nowrap; }

/* ─────────────────────────────────────────────────────────────────────────────
   7. SHARE BUTTONS
───────────────────────────────────────────────────────────────────────────── */
.cg-share-label { font-size: 13px; font-weight: 600; color: var(--cg-muted); margin-bottom: 14px; }
.cg-share-btns  { display: flex; flex-wrap: wrap; gap: 10px; }

/* Scoped — only inside cg-hero-layout so Elementor widgets are unaffected */
.cg-hero-layout .cg-share-btns .share-btn {
	display: inline-flex !important;
	align-items: center;
	gap: 7px;
	padding: 9px 18px;
	border-radius: 9px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none !important;
	border: none;
	cursor: pointer;
	transition: opacity .15s, transform .15s;
	color: #fff !important;
	box-shadow: none !important;
}
.cg-hero-layout .cg-share-btns .share-btn:hover {
	opacity: .85;
	transform: translateY(-1px);
}

/* ─────────────────────────────────────────────────────────────────────────────
   8. SIDEBAR & DONATE CARD
───────────────────────────────────────────────────────────────────────────── */
.cg-sidebar { position: sticky; top: 24px; }

.cg-donate-card {
	background: var(--cg-surface);
	border-radius: var(--cg-radius);
	box-shadow: var(--cg-shadow-lg);
	border: 1px solid rgba(0,0,0,.05);
	overflow: hidden;
}

/* Dark top — progress + raised amount */
.cg-donate-card__top {
	background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 100%);
	padding: 28px 28px 24px;
}

.cg-raised-amount {
	font-size: 34px;
	font-weight: 800;
	color: #fff;
	line-height: 1;
	margin-bottom: 2px;
}
.cg-goal-line {
	font-size: 13px;
	color: rgba(255,255,255,.5);
	margin-bottom: 18px;
	font-weight: 500;
}

.cg-prog-track {
	height: 8px;
	background: rgba(255,255,255,.12);
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 10px;
}
.cg-prog-fill {
	height: 100%;
	background: linear-gradient(90deg, #DC2626, #B91C1C);
	border-radius: 4px;
	transition: width .6s ease;
}

.cg-prog-labels        { display: flex; justify-content: space-between; }
.cg-prog-labels span   { font-size: 12px; color: rgba(255,255,255,.45); font-weight: 600; }
.cg-prog-labels strong { font-size: 12px; color: #fca5a5; font-weight: 700; }

/* Form body */
.cg-donate-card__body { padding: 24px 24px 20px; }

/* ─────────────────────────────────────────────────────────────────────────────
   9. CAMPAIGN ENDED NOTICE
───────────────────────────────────────────────────────────────────────────── */
.cg-campaign-ended {
	background: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 12px;
	padding: 20px;
	text-align: center;
	color: var(--cg-accent);
	font-size: 14px;
	font-weight: 600;
}
.cg-campaign-ended svg { display: block; margin: 0 auto 10px; color: var(--cg-accent); }

/* ─────────────────────────────────────────────────────────────────────────────
  10. URGENCY STRIP
───────────────────────────────────────────────────────────────────────────── */
.cg-urgency-strip {
	background: linear-gradient(135deg, var(--cg-accent), var(--cg-accent-dk));
	color: #fff;
	text-align: center;
	padding: 10px 20px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .03em;
}
.cg-urgency-strip span { opacity: .85; font-weight: 500; margin-left: 6px; }

/* ─────────────────────────────────────────────────────────────────────────────
  11. FORM INTEGRATION RESETS
   Strip outer card box from every built-in and Pro form template so they
   blend seamlessly into the sidebar .cg-donate-card__body.
───────────────────────────────────────────────────────────────────────────── */
.cg-donate-card__body .charityglow-donation-form,
.cg-donate-card__body .charityglow-donation-form-wrapper,
.cg-donate-card__body .charityglow-card-form,
.cg-donate-card__body .cg-custom-form-wrap,
.cg-donate-card__body .charityglow-inline-form,
.cg-donate-card__body .charityglow-minimal-form,
.cg-donate-card__body .charityglow-wizard-form {
	box-shadow: none !important;
	border: none !important;
	border-radius: 0 !important;
	background: transparent !important;
	padding: 0 !important;
	margin: 0 !important;
}

.cg-donate-card__body .charityglow-card-form .card-form-inner,
.cg-donate-card__body .charityglow-wizard-form .wizard-inner {
	padding: 0 !important;
}

/* Hide duplicate progress bars inside forms — card top already shows it */
.cg-donate-card__body .campaign-progress-section,
.cg-donate-card__body .charityglow-card-form .progress-bar,
.cg-donate-card__body .charityglow-card-form .progress-stats,
.cg-donate-card__body .charityglow-minimal-form .progress-section {
	display: none !important;
}

/* Full-width donate buttons inside sidebar */
.cg-donate-card__body .donate-button,
.cg-donate-card__body .charityglow-donate-btn,
.cg-donate-card__body .cg-btn--submit,
.cg-donate-card__body .card-submit-btn,
.cg-donate-card__body .inline-submit-btn,
.cg-donate-card__body .inline-donate-btn,
.cg-donate-card__body .minimal-submit,
.cg-donate-card__body .btn-submit,
.cg-donate-card__body button[type="submit"] {
	width: 100% !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
  12. ANIMATIONS
───────────────────────────────────────────────────────────────────────────── */
@keyframes cgFadeUp {
	from { opacity: 0; transform: translateY(16px); }
	to   { opacity: 1; transform: translateY(0); }
}
.cg-section-card              { animation: cgFadeUp .4s ease both; }
.cg-section-card:nth-child(1) { animation-delay: .05s; }
.cg-section-card:nth-child(2) { animation-delay: .12s; }
.cg-section-card:nth-child(3) { animation-delay: .18s; }
.cg-donate-card               { animation: cgFadeUp .4s ease .08s both; }

@media (prefers-reduced-motion: reduce) {
	.cg-section-card,
	.cg-donate-card { animation: none; }
}

/* ─────────────────────────────────────────────────────────────────────────────
  13. RESPONSIVE
───────────────────────────────────────────────────────────────────────────── */
@media (max-width: 900px) {
	/* Disable full-bleed on tablet/mobile */
	.cg-hero-layout,
	.ast-article-single     .cg-hero-layout,
	.wp-block-post-content  .cg-hero-layout,
	.entry-content          .cg-hero-layout,
	.elementor-page         .cg-hero-layout {
		margin-left: 0;
		margin-right: 0;
		width: auto;
		max-width: 100%;
	}

	.cg-hero__inner  { padding: 0 24px 40px; }
	.cg-content-wrap { padding: 0 20px 60px; }

	.cg-content-grid {
		grid-template-columns: 1fr;
		margin-top: -40px;
	}

	.cg-sidebar { position: static; order: -1; }

	.cg-hero       { min-height: 360px; }
	.cg-hero__title { font-size: clamp(22px, 5vw, 36px) !important; }
}

@media (max-width: 600px) {
	.cg-hero__inner       { padding: 0 16px 32px; }
	.cg-hero              { min-height: 300px; }
	.cg-content-wrap      { padding: 0 14px 50px; }
	.cg-section-card      { padding: 24px 20px; }
	.cg-donate-card__top  { padding: 22px 20px 18px; }
	.cg-donate-card__body { padding: 18px 18px 14px; }
	.cg-hero__meta        { gap: 12px; }
	.cg-hero__live-badge  { margin-right: 5px; }    /* tighten badge gap on mobile */
	/* Block display on mobile gives .cg-hero__category a reliable margin-bottom
	   so there is a clear vertical gap before .cg-hero__title.
	   (inline-flex siblings don't push block margins on narrow viewports.) */
	.cg-hero__category {
		display: block;
		width: -webkit-fit-content; /* Safari */
		width: fit-content;         /* shrink pill to text width, not full row */
		margin-top: 8px;
		margin-bottom: 14px;
	}
	.cg-share-btns        { gap: 8px; }
	.cg-hero-layout .cg-share-btns .share-btn { padding: 8px 12px; font-size: 12px; }
}