/* ==========================================================================
   Candid Billing — WordPress + block-editor integration layer
   Loaded after assets/css/design-system.css.

   The design system was written for a hand-coded site, so this file does one
   job only: stop WordPress core layout rules from interfering with it, and
   keep the block editor looking identical to the front end.
   ========================================================================== */

/* ---------------------------------------------------------------------------
 * 1. Kill WordPress' automatic layout constraints
 *
 * theme.json + core/group normally inject max-width + auto margins. Our own
 * .container / .section-padding classes own all spacing, so strip them.
 * ------------------------------------------------------------------------ */

.wp-site-blocks,
.wp-site-blocks > .wp-block-group,
.wp-block-group.is-layout-constrained,
.wp-block-group.is-layout-flow,
.wp-block-columns,
.wp-block-column {
	/* no opinion — but never let core force a max width on our sections */
	--wp--style--global--content-size: none;
}

/* Our sections own their own vertical rhythm. */
.wp-site-blocks > * + * {
	margin-block-start: 0;
}

/* -------------------------------------------------------------------------
 * Core block wrappers -> our design system
 * ---------------------------------------------------------------------- */

/* A group with class "container" behaves exactly like the original .container. */
.wp-block-group.container {
	width: 100%;
}

.wp-block-group.section-padding > .wp-block-group.container,
.wp-block-group.section-padding > .container {
	width: 100%;
}

/* Columns should collapse like our grids. */
.wp-block-columns {
	gap: 26px;
}

.wp-block-columns.is-not-stacked-on-mobile > .wp-block-column {
	min-width: 0;
}

/* Buttons: keep the design-system look even if theme.json styles are skipped. */
.wp-block-button__link {
	font-family: var(--font-heading, 'Plus Jakarta Sans', sans-serif);
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
}

/* Block editor link/bookmark colours inherit the section.
 * Zero specificity (:where) so design-system class rules - .btn-navy,
 * .btn-primary, .prose-content a ... - keep winning over this default. */
:where(.wp-block-post-content, .entry-content) a {
	color: inherit;
}

/* Solid buttons keep a white label inside post content. */
.wp-block-post-content a.btn-navy,
.wp-block-post-content a.btn-primary,
.wp-block-post-content a.btn-blue,
.entry-content a.btn-navy,
.entry-content a.btn-primary,
.entry-content a.btn-blue {
	color: #ffffff;
}

/* -------------------------------------------------------------------------
 * Images & figures
 * ---------------------------------------------------------------------- */

/* Never let core resize the design's own images: the design system owns sizing. */
.wp-block-image img {
	max-width: 100%;
}

.wp-block-image figcaption {
	font-size: .82rem;
	color: var(--color-text-muted, #64748b);
	text-align: center;
	margin-top: 10px;
}

.wp-block-post-featured-image img {
	width: 100%;
	height: auto;
}

/* -------------------------------------------------------------------------
 * Navigation block -> our nav-list look
 * ---------------------------------------------------------------------- */

.wp-block-navigation .wp-block-navigation-item__content {
	text-decoration: none;
}

/* -------------------------------------------------------------------------
 * Editor-only: make the block editor match the front end
 * ---------------------------------------------------------------------- */

.editor-styles-wrapper {
	font-family: var(--font-body, Inter, sans-serif);
	color: var(--color-text, #334155);
	background: #fff;
}

.editor-styles-wrapper .wp-block {
	max-width: none;
}

.editor-styles-wrapper .block-editor-block-list__layout.is-root-container > .wp-block {
	margin-left: 0;
	margin-right: 0;
}

.editor-styles-wrapper .wp-block-group.container {
	max-width: 1240px;
	margin-left: auto;
	margin-right: auto;
	padding-left: 20px;
	padding-right: 20px;
}

/* Show our section labels clearly while editing. */
.editor-styles-wrapper .cb-section {
	outline: 1px dashed rgba(0, 102, 204, .28);
	outline-offset: -1px;
}

/* -------------------------------------------------------------------------
 * Accessibility
 * ---------------------------------------------------------------------- */

:where(a, button, input, select, textarea):focus-visible {
	outline: 3px solid rgba(0, 102, 204, .45);
	outline-offset: 2px;
	border-radius: 6px;
}

/* -------------------------------------------------------------------------
 * Print
 * ---------------------------------------------------------------------- */

@media print {
	.whatsapp-float,
	.back-to-top,
	.mobile-drawer,
	.mobile-drawer-overlay,
	.site-modal {
		display: none !important;
	}
}