| 1 |
<?php |
| 2 |
/** |
| 3 |
* Shared CSS partial for the Beacon family hero. |
| 4 |
* |
| 5 |
* Used by every Beacon variant (beacon-split, beacon-single, etc.) to keep |
| 6 |
* the overlapping hero + donation widget positioning in one place. Expects |
| 7 |
* two variables set by the including file: |
| 8 |
* |
| 9 |
* $wrapper — the CSS wrapper selector (e.g. `.charitable-campaign-wrap.template-beacon-split`) |
| 10 |
* $hero_row_class — the CSS class on the locked hero row (e.g. `beacon-hero-row`) |
| 11 |
* |
| 12 |
* @package Charitable |
| 13 |
* @since 1.8.11.1 |
| 14 |
*/ |
| 15 |
|
| 16 |
if ( ! defined( 'ABSPATH' ) ) { |
| 17 |
exit; |
| 18 |
} |
| 19 |
|
| 20 |
if ( ! isset( $wrapper ) || ! isset( $hero_row_class ) ) { |
| 21 |
return; |
| 22 |
} |
| 23 |
?> |
| 24 |
|
| 25 |
/* ── Beacon hero — shared positioning ────────────────────────────────── */ |
| 26 |
|
| 27 |
<?php echo $wrapper; // phpcs:ignore ?> .<?php echo $hero_row_class; // phpcs:ignore ?> { |
| 28 |
position: relative; |
| 29 |
overflow: visible; |
| 30 |
padding: 0; |
| 31 |
margin: 0; |
| 32 |
} |
| 33 |
|
| 34 |
<?php echo $wrapper; // phpcs:ignore ?> .<?php echo $hero_row_class; // phpcs:ignore ?> .charitable-campaign-column { |
| 35 |
padding: 0; |
| 36 |
border: 0; |
| 37 |
flex: 1 1 100%; |
| 38 |
max-width: 100%; |
| 39 |
} |
| 40 |
|
| 41 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero { |
| 42 |
position: relative; |
| 43 |
width: 100%; |
| 44 |
min-height: 420px; |
| 45 |
margin: 0; |
| 46 |
display: block; |
| 47 |
} |
| 48 |
|
| 49 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__banner { |
| 50 |
position: absolute; |
| 51 |
inset: 0; |
| 52 |
background-size: cover; |
| 53 |
background-position: center; |
| 54 |
z-index: 1; |
| 55 |
} |
| 56 |
|
| 57 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__overlay { |
| 58 |
position: relative; |
| 59 |
z-index: 2; |
| 60 |
display: grid; |
| 61 |
grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); |
| 62 |
gap: 32px; |
| 63 |
padding: 32px 32px 24px; |
| 64 |
min-height: 420px; |
| 65 |
align-items: end; |
| 66 |
} |
| 67 |
|
| 68 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__identity { |
| 69 |
display: flex; |
| 70 |
align-items: flex-end; |
| 71 |
gap: 20px; |
| 72 |
min-width: 0; |
| 73 |
align-self: end; |
| 74 |
} |
| 75 |
|
| 76 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__avatar { |
| 77 |
width: clamp(105px, 12vw, 157px); |
| 78 |
height: clamp(105px, 12vw, 157px); |
| 79 |
flex-shrink: 0; |
| 80 |
background: #fff; |
| 81 |
border: 1px solid rgba(255, 255, 255, 0.7); |
| 82 |
border-radius: 4px; |
| 83 |
overflow: hidden; |
| 84 |
box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3); |
| 85 |
transform: translateY(calc(67% - 30px)); |
| 86 |
} |
| 87 |
|
| 88 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__avatar img { |
| 89 |
display: block; |
| 90 |
width: 100%; |
| 91 |
height: 100%; |
| 92 |
object-fit: cover; |
| 93 |
} |
| 94 |
|
| 95 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__title { |
| 96 |
color: #fff; |
| 97 |
font-size: clamp(28px, 3.6vw, 44px); |
| 98 |
font-weight: 700; |
| 99 |
margin: 0 0 16px 0; |
| 100 |
text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5); |
| 101 |
flex: 1 1 auto; |
| 102 |
line-height: 1.15; |
| 103 |
} |
| 104 |
|
| 105 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__widget-shell { |
| 106 |
background: #fff; |
| 107 |
border: 1px solid rgba(255, 255, 255, 0.7); |
| 108 |
border-radius: 0; |
| 109 |
overflow: hidden; |
| 110 |
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2); |
| 111 |
position: relative; |
| 112 |
align-self: end; |
| 113 |
margin-bottom: -80px; |
| 114 |
} |
| 115 |
|
| 116 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__raised { |
| 117 |
background: var(--charitable-hero-accent, #1d3a8a); |
| 118 |
color: #fff; |
| 119 |
padding: 10px 16px; |
| 120 |
} |
| 121 |
|
| 122 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__raised-text { |
| 123 |
font-size: 13px; |
| 124 |
font-weight: 600; |
| 125 |
margin-bottom: 6px; |
| 126 |
} |
| 127 |
|
| 128 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__progress { |
| 129 |
background: rgba(255, 255, 255, 0.25); |
| 130 |
height: 4px; |
| 131 |
border-radius: 2px; |
| 132 |
overflow: hidden; |
| 133 |
} |
| 134 |
|
| 135 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__progress span { |
| 136 |
display: block; |
| 137 |
height: 100%; |
| 138 |
background: #fff; |
| 139 |
} |
| 140 |
|
| 141 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__widget { |
| 142 |
padding: 14px 16px 16px; |
| 143 |
} |
| 144 |
|
| 145 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__widget .charitable-mini-widget { |
| 146 |
max-width: none; |
| 147 |
width: 100%; |
| 148 |
} |
| 149 |
|
| 150 |
/* Donate Now CTA inside the hero follows the theme Button color (separate from the primary accent). */ |
| 151 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__widget .charitable-mini-widget__cta { |
| 152 |
background-color: var(--charitable-hero-button, var(--charitable-hero-accent, #1d3a8a)); |
| 153 |
} |
| 154 |
|
| 155 |
/* Mobile: stack the hero overlay grid, drop the widget below the banner. */ |
| 156 |
@media ( max-width: <?php echo intval( $mobile_width ); // phpcs:ignore ?>px ) { |
| 157 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__overlay { |
| 158 |
grid-template-columns: 1fr; |
| 159 |
padding: 24px 16px; |
| 160 |
min-height: 320px; |
| 161 |
gap: 16px; |
| 162 |
} |
| 163 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__avatar { |
| 164 |
transform: none; |
| 165 |
} |
| 166 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero__widget-shell { |
| 167 |
margin-bottom: 0; |
| 168 |
} |
| 169 |
<?php echo $wrapper; // phpcs:ignore ?> .charitable-campaign-hero { |
| 170 |
min-height: auto; |
| 171 |
} |
| 172 |
} |
| 173 |
|