/**
 * 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 — Premium 17-Color Palette (Teal + Amber Gold)
───────────────────────────────────────────────────────────────────────────── */
.cg-hero-layout {
	--cg-accent:    var(--charityglow-accent, #F5A623);
	--cg-accent-dk: var(--charityglow-accent-dark, #8B5A10);
	--cg-accent-bg: var(--charityglow-accent-bg, rgba(245,166,35,0.08));
	--cg-primary:   var(--charityglow-primary, #16645A);
	--cg-secondary: var(--charityglow-secondary, #123A32);
	--cg-text:      #17332C;
	--cg-muted:     #54706A;
	--cg-muted-light: #7C948D;
	--cg-border:    #E5EEEB;
	--cg-surface:   #FFFFFF;
	--cg-bg:        #F2F7F5;
	--cg-hero-dark: linear-gradient(150deg, #0A2B27 0%, #0E3B36 40%, #16645A 100%);
	--cg-hero-dark-solid: #0A2B27;
	--cg-sidebar-w: 380px;
	--cg-gap:       40px;
	--cg-radius:    20px;
	--cg-radius-pill: 999px;
	--cg-shadow:    0 4px 24px rgba(10,43,39,.06);
	--cg-shadow-lg: 0 8px 48px rgba(10,43,39,.10);
	--cg-shadow-gold: 0 6px 20px rgba(245,166,35,0.30);
	--cg-ease:      cubic-bezier(0.4, 0, 0.2, 1);
	--cg-text-dark: #FFE3AC;
	--cg-text-gold-on: #17332C;
}

/* ─────────────────────────────────────────────────────────────────────────────
   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 — Premium Dark Teal Gradient
───────────────────────────────────────────────────────────────────────────── */
.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, #0A2B27 0%, #0E3B36 40%, #16645A 100%);
}
.cg-hero--no-image .cg-hero__bg { display: none; }

.cg-hero__overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(10,43,39,.95) 0%,
		rgba(10,43,39,.55) 45%,
		rgba(10,43,39,.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;
	align-items: center;
	vertical-align: middle;
	gap: 7px;
	background: linear-gradient(135deg, #F5A623 0%, #FDBA3B 50%, #FFC24D 100%);
	color: #17332C;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .1em;
	text-transform: uppercase;
	padding: 6px 16px;
	border-radius: 999px;
	margin-right: 8px;
	margin-bottom: 0;
	line-height: 1;
	white-space: nowrap;
	box-shadow: 0 2px 10px rgba(245,166,35,0.35);
	transition: transform .2s var(--cg-ease);
}
.cg-hero__live-badge:hover { transform: translateY(-1px); }

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

.cg-hero__category {
	display: inline-flex;
	align-items: center;
	vertical-align: middle;
	background: rgba(255,227,172,0.14);
	border: 1px solid rgba(255,227,172,0.28);
	color: #FFE3AC;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	padding: 5px 14px;
	border-radius: 999px;
	line-height: 1;
	margin: 0;
	white-space: nowrap;
	transition: all .2s var(--cg-ease);
}
.cg-hero__category:hover {
	background: rgba(255,227,172,0.22);
	border-color: rgba(255,227,172,0.42);
}

.cg-hero__title {
	display: block;
	font-size: clamp(26px, 3.5vw, 52px) !important;
	font-weight: 800 !important;
	color: #FFE3AC !important;
	line-height: 1.15 !important;
	max-width: 680px;
	margin: 16px 0 18px !important;
	text-shadow: 0 2px 12px rgba(10,43,39,.30);
}

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

.cg-hero__meta-item {
	display: flex;
	align-items: center;
	gap: 6px;
	color: rgba(255,227,172,.65);
	font-size: 13px;
	font-weight: 500;
}
.cg-hero__meta-item strong { color: #FFE3AC; 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) — Premium Surface
───────────────────────────────────────────────────────────────────────────── */
.cg-section-card {
	background: var(--cg-surface);
	border-radius: var(--cg-radius);
	box-shadow: var(--cg-shadow);
	border: 1px solid #E5EEEB;
	padding: 36px;
	margin-bottom: 24px;
	transition: transform .25s var(--cg-ease), box-shadow .25s var(--cg-ease);
}
.cg-section-card:hover {
	box-shadow: 0 6px 28px rgba(10,43,39,.08);
}
.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: #16645A;
	margin-bottom: 20px;
}
.cg-section-label::before {
	content: '';
	display: block;
	width: 26px;
	height: 3px;
	background: linear-gradient(90deg, #F5A623, #FDBA3B);
	border-radius: 2px;
	flex-shrink: 0;
}

/* Description content */
.cg-description { line-height: 1.8; }
.cg-description p  { font-size: 15px; color: #17332C; margin-bottom: 16px; }
.cg-description h2,
.cg-description h3 { color: #123A32 !important; margin-bottom: 12px !important; }
.cg-description ul,
.cg-description ol { padding-left: 22px; margin-bottom: 16px; color: #17332C; font-size: 15px; line-height: 1.75; }
.cg-description blockquote {
	border-left: 4px solid #F5A623;
	background: rgba(245,166,35,0.08);
	padding: 16px 20px;
	border-radius: 0 12px 12px 0;
	margin: 20px 0;
	font-style: italic;
	color: #17332C;
}

/* ─────────────────────────────────────────────────────────────────────────────
   6. RECENT DONORS LIST — Premium Avatars
───────────────────────────────────────────────────────────────────────────── */
.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);
	transition: padding-left .2s var(--cg-ease);
}
.cg-donor-item:hover { padding-left: 4px; }
.cg-donor-item:last-child { border-bottom: none; }

.cg-donor-avatar {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: linear-gradient(150deg, #0A2B27 0%, #0E3B36 50%, #16645A 100%);
	color: #FFE3AC;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 14px;
	font-weight: 800;
	flex-shrink: 0;
	border: 2px solid rgba(22,100,90,0.40);
	box-shadow: 0 2px 10px rgba(10,43,39,0.18);
	letter-spacing: 0.3px;
}
.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: #F5A623;
	white-space: nowrap;
	letter-spacing: 0.3px;
}

/* ─────────────────────────────────────────────────────────────────────────────
   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: 12px;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none !important;
	border: 1px solid #E5EEEB;
	cursor: pointer;
	transition: all .2s var(--cg-ease);
	color: #123A32 !important;
	background: #FFFFFF;
	box-shadow: none !important;
}
.cg-hero-layout .cg-share-btns .share-btn:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 14px rgba(10,43,39,.10) !important;
	border-color: #16645A;
	color: #16645A !important;
}

/* ─────────────────────────────────────────────────────────────────────────────
   8. SIDEBAR & DONATE CARD — Premium Dark Top + Gold Progress
───────────────────────────────────────────────────────────────────────────── */
.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 #E5EEEB;
	overflow: hidden;
}

/* Dark top — progress + raised amount */
.cg-donate-card__top {
	background: linear-gradient(150deg, #0A2B27 0%, #0E3B36 50%, #16645A 100%);
	padding: 28px 28px 24px;
	position: relative;
	overflow: hidden;
}
.cg-donate-card__top::before {
	content: '';
	position: absolute;
	top: -40%;
	right: -20%;
	width: 240px;
	height: 240px;
	background: radial-gradient(circle, rgba(245,166,35,0.10) 0%, transparent 70%);
	border-radius: 50%;
	pointer-events: none;
}

.cg-raised-amount {
	font-size: 34px;
	font-weight: 800;
	color: #FFE3AC;
	line-height: 1;
	margin-bottom: 2px;
	letter-spacing: 0.3px;
	position: relative;
}
.cg-goal-line {
	font-size: 13px;
	color: rgba(255,227,172,.55);
	margin-bottom: 18px;
	font-weight: 500;
	position: relative;
}

.cg-prog-track {
	height: 10px;
	background: rgba(255,227,172,.12);
	border-radius: 999px;
	overflow: hidden;
	margin-bottom: 10px;
	position: relative;
}
.cg-prog-fill {
	height: 100%;
	background: linear-gradient(90deg, #F5A623 0%, #FDBA3B 50%, #FFC24D 100%);
	border-radius: 999px;
	transition: width .6s var(--cg-ease);
	box-shadow: 0 0 0 1px rgba(255,227,172,0.18);
}

.cg-prog-labels        { display: flex; justify-content: space-between; position: relative; }
.cg-prog-labels span   { font-size: 12px; color: rgba(255,227,172,.50); font-weight: 600; }
.cg-prog-labels strong { font-size: 12px; color: #FFE3AC; font-weight: 700; letter-spacing: 0.2px; }

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

/* ─────────────────────────────────────────────────────────────────────────────
   9. CAMPAIGN ENDED NOTICE — Warm Gold Tint
───────────────────────────────────────────────────────────────────────────── */
.cg-campaign-ended {
	background: rgba(245,166,35,0.08);
	border: 1px solid rgba(245,166,35,0.22);
	border-radius: 14px;
	padding: 20px;
	text-align: center;
	color: #8B5A10;
	font-size: 14px;
	font-weight: 600;
}
.cg-campaign-ended svg { display: block; margin: 0 auto 10px; color: #F5A623; }

/* ─────────────────────────────────────────────────────────────────────────────
  10. URGENCY STRIP — Premium Gold Gradient
───────────────────────────────────────────────────────────────────────────── */
.cg-urgency-strip {
	background: linear-gradient(135deg, #F5A623 0%, #FDBA3B 50%, #FFC24D 100%);
	color: #17332C;
	text-align: center;
	padding: 12px 20px;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: .03em;
	box-shadow: 0 2px 12px rgba(245,166,35,0.25);
}
.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 var(--cg-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 var(--cg-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; }
	/* 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; }
}
