/**
 * CBC design-block styles — SHARED between the front end and the block editor.
 *
 * Loaded twice on purpose (see functions.php):
 *   - front end via the `cbc-blocks` handle, after `cbc-style` so it keeps the
 *     precedence it had when these rules lived at the foot of style.css;
 *   - block editor via add_editor_style(), so the Gutenberg canvas previews the
 *     real design instead of naked core blocks.
 * Keep it free of `.brz-*`-ancestor selectors: those only exist on the front end
 * and would be dead weight (or misleading) in the editor. Front-end-only Brizy
 * overrides belong in style.css.
 *
 * Structure is built from core blocks (Cover / Columns / Buttons / Group); these
 * classes carry the visual design so the block markup stays clean and
 * validation-safe. Requires core block-library CSS, loaded on the front end for
 * block pages via `cbc-block-library` (Brizy strips the default
 * wp-block-library handle). The content column is 1170px in both contexts.
 *
 * The `!important`s throughout are for the FRONT END, where the dustin-neue
 * parent theme and Brizy both force colour/margin inside .brz-wp-post-content.
 * They are harmless in the editor, where nothing competes.
 */

/* Readable measure for prose sections (headings + body) on the wide column.
   Left-aligned (no auto margins) so prose shares the left edge with the
   full-width feature rows below it; it just doesn't run the full 1170px. */
.cbc-constrained { max-width: 900px; }
/* !important because Brizy resets `.brz .brz-wp-post-content > div > * { margin: revert }`,
   which zeroes these section margins (sections would otherwise touch each other / the hero). */
.cbc-section { margin-top: 3rem !important; }

/* Hero cover — tagline sits in a centred, comfortable measure over the photo.
   The parent theme (dustin-neue) forces text colour inside .brz-wp-post-content
   with !important, so the white/contrast rules here must be !important too. */
.cbc-hero { margin-bottom: 0.5rem; }
.cbc-hero .wp-block-cover__background { opacity: .68 !important; }
.cbc-hero .wp-block-cover__inner-container { max-width: 820px; margin-inline: auto; }
.cbc-hero-text { color: #fff !important; text-shadow: 0 1px 10px rgba(0,0,0,.45); }
/* Hero tagline is an <h3> — keep default heading size; just ease the line spacing
   since it runs to a few lines. */
.cbc-lead { line-height: 1.35; }

/* Equal-height cards inside a Columns row (the column stretches; the card fills). */
.cbc-steps .wp-block-column,
.cbc-tiers .wp-block-column { display: flex; }

/* Gap between the cards. The core "block gap" layout style doesn't emit in the
   Brizy-rendered content, so the columns collapse to a 0 gap (cards touch) —
   set it explicitly. Applies as both column and row (wrapped/stacked) spacing. */
.cbc-steps,
.cbc-tiers { gap: 20px; }

/* How it works — numbered step cards. */
.cbc-step {
	height: 100%;
	background: #eef3f8;
	border-radius: 12px;
	padding: 24px 22px;
}
.cbc-step .cbc-step-num {
	margin: 0 0 8px;
	color: #01447d !important; /* default heading size/weight; just the brand navy */
}
.cbc-step p { margin: 0; }

/* Key dates — tinted card. */
.cbc-datecard {
	max-width: 640px;
	background: #f4f6f8;
	border: 1px solid #e2e2e2;
	border-radius: 14px;
	padding: 8px 30px;
}
.cbc-datecard ul { margin: 0; list-style: none; padding-left: 0; }
.cbc-datecard li { padding: 11px 0; border-bottom: 1px solid #e2e2e2; }
.cbc-datecard li:last-child { border-bottom: 0; }

/* Key dates paired with the awards-dinner photo in a two-column row. */
.cbc-datecols { gap: 32px; align-items: center; }
.cbc-datecols .cbc-datecard { max-width: none; } /* fill the 50% column */
.cbc-datephoto img { width: 100%; height: auto; display: block; border-radius: 14px; }

/* Sponsor tier cards. Column direction so a logo sits under the tier name. */
.cbc-tier {
	height: 100%;
	background: #fff;
	border: 1px solid #e2e2e2;
	border-radius: 12px;
	padding: 28px 24px;
	text-align: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
}
.cbc-tier h4 { margin: 0; color: #01447d; line-height: 1.3; }
/* The card's top padding is measured to the heading's LINE BOX, but the eye reads
   it to the cap height, and Poppins at line-height 1.3 leaves dead space above
   the caps — a symmetric 28px otherwise renders as ~41px top / 28px bottom.
   Trim that leading so the ink sits where the padding says it should. Value set
   by measuring the rendered line box against canvas actualBoundingBoxAscent, not
   guessed; in em so it survives a change of heading size. */
.cbc-tier h4::before { content: ''; display: block; height: 0; margin-top: -0.33em; }
/* The column is the flex container (see .cbc-tiers above); without this the card
   sizes to its content and sits narrow in the middle of a half-width column. */
.cbc-tiers .wp-block-column > .cbc-tier { flex: 1 1 auto; width: 100%; max-width: none; }
.cbc-tier--platinum { background: #01447d; border-color: #01447d; }
.cbc-tier--platinum h4 { color: #fff !important; }

/* Vertical rhythm between the three sponsor rows (Platinum / the two named tiers
   / Category). They are separate sibling blocks with no margins of their own —
   Platinum sat flush against the row below it while core left 28px under the
   columns. 20px matches the column gap in .cbc-tiers so the grid reads evenly.
   !important because the Brizy content wrapper resets these margins (.cbc-section). */
.cbc-tier--platinum,
.cbc-tiers { margin-bottom: 20px !important; }

/* Sponsor logos. The uploaded files are trimmed to their artwork, so a fixed
   box plus object-fit gives every logo the same optical weight whatever its
   aspect ratio — without that, the ones with baked-in padding render small. */
.cbc-logo { margin: 0; }
.cbc-logo img {
	display: block;
	width: auto;
	height: auto;
	max-width: 190px;
	max-height: 84px;
	object-fit: contain;
}
.cbc-tier--platinum .cbc-logo img { max-width: 268px; max-height: 108px; }

/* Category sponsors — one card holding many logos. Hand-rolled flex on purpose:
   core's block-gap and flex layout CSS never reaches Brizy-rendered content,
   which is the same trap documented above on .cbc-tiers. */
.cbc-logo-grid {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 26px 40px;
	width: 100%;
}
.cbc-logo-grid .cbc-logo img { max-width: 170px; max-height: 76px; }

@media (max-width: 781px) {
	.cbc-logo-grid { gap: 22px 30px; }
	.cbc-logo-grid .cbc-logo img { max-width: 132px; max-height: 62px; }
	.cbc-tier--platinum .cbc-logo img { max-width: 210px; max-height: 88px; }
}

/* Closing call-to-action band. */
.cbc-cta {
	margin-top: 3rem !important; /* beat Brizy's margin:revert (see .cbc-section) */
	background: #01447d;
	border-radius: 16px;
	padding: 46px 32px;
	text-align: center;
}
.cbc-cta h2 { margin: 0 0 12px; color: #fff !important; }
.cbc-cta p { max-width: 640px; margin: 0 auto 24px; color: #fff !important; }
.cbc-cta .wp-block-buttons { justify-content: center; }
.cbc-cta .wp-block-button__link { padding: 13px 28px; border-radius: 8px; font-weight: 600; }
.cbc-btn-white .wp-block-button__link { background: #fff !important; color: #01447d !important; }
.cbc-btn-white .wp-block-button__link:hover { background: #eaf1f8 !important; }
.cbc-btn-outline .wp-block-button__link { background: transparent !important; color: #fff !important; box-shadow: inset 0 0 0 2px #fff; }
.cbc-btn-outline .wp-block-button__link:hover { background: #fff !important; color: #01447d !important; }

@media (max-width: 600px) {
	.cbc-cta { padding: 34px 22px; }
	.cbc-datecard { padding: 8px 20px; }
}

/* Generic two-column content row (text + media) — reused across content pages
   (e.g. Business Networking). Vertically centred, with a gap the Brizy content
   wrapper doesn't otherwise emit. */
.cbc-cols { gap: 32px; align-items: center !important; }
.cbc-media img { width: 100%; height: auto; display: block; border-radius: 14px; }

/* Navy solid button for LIGHT backgrounds (the on-dark variants are
   .cbc-btn-white / .cbc-btn-outline above). */
.cbc-btn-navy .wp-block-button__link { background: #01447d !important; color: #fff !important; padding: 13px 28px; border-radius: 8px; font-weight: 600; }
.cbc-btn-navy .wp-block-button__link:hover { background: #023a6a !important; }

/* "Nominations are now open" panel (Customer Service Awards, page 1057) — sits
   directly under the hero, above "Who can be nominated?". Light tinted card with
   a brand-green accent bar so it reads as an active/open state without competing
   with the navy hero above it or the navy CTA band at the foot of the page. */
.cbc-nominate {
	max-width: 900px;
	background: #eef3f8;
	border-left: 6px solid #0aad80;
	border-radius: 12px;
	padding: 30px 34px;
}
/* Parent theme (dustin-neue) forces colour inside .brz-wp-post-content with
   !important — see the hero/CTA notes above. */
.cbc-nominate h2 { margin: 0 0 14px; color: #01447d !important; }
.cbc-nominate p { margin: 0 0 22px; }
.cbc-nominate .wp-block-buttons { margin-bottom: 18px; }
/* Compound selector so it outweighs `.cbc-nominate p` above. font-weight needs
   !important as well: Brizy emits an inline `.brz .brz-css-… :not(h1):not(h2)…`
   rule (a 13-long :not() chain, specificity 0,2,13) that sets paragraph weight
   and otherwise wins — the same override trap as the colour rules above. */
.cbc-nominate p.cbc-nominate-close { margin: 0; font-weight: 600 !important; }

/* The panel is paired with "Who can be nominated?" in a two-column row. Its own
   class rather than .cbc-cols, because that row is vertically centred — here the
   columns must align at the TOP so the two <h2>s sit on the same line. */
.cbc-nominate-row {
	gap: 32px;                    /* core block-gap doesn't emit in the Brizy wrapper */
	margin-top: 3rem !important;  /* beat Brizy's `margin: revert` (see .cbc-section) */
}
/* align-items MUST be set on the compound `.wp-block-columns.cbc-nominate-row`
   (0,2,0). Core block-library ships `.wp-block-columns { align-items: normal
   !important }` (0,1,0) AND the page carries a second inline copy of it that
   lands after the child stylesheet — so a single-class rule ties on specificity
   and loses on source order even with !important. This is why `.cbc-cols`
   (above) never managed to centre. */
.wp-block-columns.cbc-nominate-row { align-items: flex-start !important; }
.cbc-nominate-row .cbc-nominate { max-width: none; }  /* fill the 50% column */
/* Drop the plain prose column by the card's top padding so the headings align.
   The card's h2 has no top margin (.cbc-nominate h2 zeroes it) but this one
   inherits the UA sheet's `margin-block-start: .83em` — ~40px at 48px — so zero
   that too or the right-hand heading sits 40px lower than the left. */
.cbc-nominate-prose { max-width: none; padding-top: 30px; }
.cbc-nominate-prose h2 { margin-top: 0; }

@media (max-width: 781px) {   /* core stacks .wp-block-column at this width */
	.cbc-nominate-prose { padding-top: 0; }
}

@media (max-width: 600px) {
	.cbc-nominate { padding: 26px 22px; }
}

/* ---------------------------------------------------------------------------
   Event page — details on the left, booking form on the right (page 2082).
   A Columns block, NOT a flex Group: generated layout CSS never reaches the
   Brizy-rendered content, so a flex Group would silently stack.
   --------------------------------------------------------------------------- */
.cbc-eventcols {
	gap: 40px;                    /* core block-gap doesn't emit in the Brizy wrapper */
	margin-top: 2rem !important;
}
/* align-items is deliberately NOT set here. Core's `.wp-block-columns
   { align-items: normal !important }` leaves the columns stretching full
   height, which is exactly what the sticky form below needs — overriding it to
   flex-start would collapse the column and stop the sticky working. */
.cbc-eventcols .cbc-datecard { max-width: none; }   /* fill the column */
.cbc-eventcols .cbc-ticket-form { margin-top: 0; }

/* Keep the booking form in view while reading the event details. Only above the
   stacking breakpoint — once stacked, sticky would pin the form over the copy. */
@media (min-width: 782px) {
	.cbc-eventcols .cbc-ticket-form {
		position: sticky;
		top: 24px;
	}
}

@media (max-width: 781px) {
	.cbc-eventcols { gap: 28px; }
}

/* ---------------------------------------------------------------------------
   Member resources — downloadable files on the members-only News & Resources
   page (521). A Columns block, NOT a flex Group: generated layout CSS never
   reaches the Brizy-rendered content, so a flex Group would silently stack
   (same trap as .cbc-eventcols above).
   --------------------------------------------------------------------------- */
.cbc-resource {
	margin-top: 2rem !important;   /* beat Brizy's `margin: revert` (see .cbc-section) */
	background: #eef3f8;
	border: 1px solid #e2e2e2;
	border-radius: 14px;
	padding: 28px 30px;
}

/* align-items on the COMPOUND `.wp-block-columns.cbc-resource-row` (0,2,0).
   Core ships `.wp-block-columns { align-items: normal !important }` and the page
   carries a second inline copy that lands after this stylesheet, so a
   single-class rule ties on specificity and loses on source order — the
   documented reason .cbc-cols never managed to centre. */
.wp-block-columns.cbc-resource-row { align-items: center !important; }
.cbc-resource-row { gap: 30px; }   /* core block-gap doesn't emit in the Brizy wrapper */

/* The tile is square and 1080px; cap it so it reads as a preview beside the
   text rather than dominating the card. */
.cbc-resource-art img { width: 100%; max-width: 210px; height: auto; display: block; }

/* Parent theme (dustin-neue) forces colour inside .brz-wp-post-content with
   !important — see the hero/CTA notes above. */
.cbc-resource h3 { margin: 0 0 10px; color: #01447d !important; }
.cbc-resource p { margin: 0 0 20px; }
.cbc-resource .wp-block-buttons { margin: 0; }

/* Compound selector so it outweighs `.cbc-resource p` above; font-weight/size
   need care for the same Brizy :not()-chain reason as .cbc-nominate-close. */
.cbc-resource p.cbc-resource-meta { margin: 14px 0 0; font-size: .88em; opacity: .7; }

@media (max-width: 781px) {   /* core stacks .wp-block-column at this width */
	.cbc-resource-art img { margin-inline: auto; max-width: 170px; }
}

@media (max-width: 600px) {
	.cbc-resource { padding: 24px 22px; }
}

/* Centred images.
   Brizy's `.brz .brz-wp-post-content > div > * { margin: revert }` reverts a
   <figure> to the UA default `margin: 1em 40px`, which ties core's
   `.wp-block-image.aligncenter { margin-inline: auto }` on specificity and wins
   on source order — so an aligncenter image sits 40px from the left instead of
   centred. Same root cause as the `margin: revert` note on .cbc-section above,
   and the same fix. */
.wp-block-image.aligncenter {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* Left/right aligned images (2026-08-12).
   Same root cause as the centred rule above, but worse: with `margin: revert`
   restoring the UA `margin: 1em 40px`, core's float never reaches the figure at
   all — computed float on an `.alignright` figure was `none`, so choosing "Align
   right" in the editor did literally nothing. Restore the float and clear the
   outer margin on the aligned side.

   The width cap is the point of the rule, not a detail. These images are
   inserted at full size (the laneway photo is 864px in a 1170px column), and an
   uncapped float leaves a ~300px ribbon of text beside it that is unreadable.
   60% keeps the image dominant while leaving the wrapping text a readable
   measure — about 450px at the 1170px column. */
.wp-block-image.alignright {
	float: right !important;
	max-width: 60%;
	margin-left: 1.5em !important;
	margin-right: 0 !important;
}

.wp-block-image.alignleft {
	float: left !important;
	max-width: 60%;
	margin-right: 1.5em !important;
	margin-left: 0 !important;
}

/* Below the stacking breakpoint a 50% float is a postage stamp beside an
   unreadable column, so drop the float entirely and centre it full width. */
@media (max-width: 781px) {
	.wp-block-image.alignright,
	.wp-block-image.alignleft {
		float: none !important;
		max-width: 100%;
		margin-left: auto !important;
		margin-right: auto !important;
	}
}
