/* ==========================================================================
   Digitalize Hub — Custom Block Styles
   ----------------------------------------------------------------------------
   CSS for the custom block styles registered in inc/block-styles.php.

   Loaded in BOTH the block editor AND the front end via enqueue_block_assets
   (see dh_enqueue_block_styles_css() in inc/block-styles.php).

   Every color / radius / shadow here uses a CSS variable so dark mode and
   the Theme Options panel's color overrides apply automatically. The theme
   emits :root vars via dh_inline_theme_css() before this stylesheet runs.

   v3.9.0 — W1E-MOD (item 18).
   ========================================================================== */

/* Defensive fallbacks: these vars exist on the front end (emitted by
   dh_inline_theme_css()), but in the block editor they may not be present
   unless the theme's editor-style.css has already loaded them. Define
   light-mode defaults here so the editor preview always has something. */
:root {
	--shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.18);
}
html.dh-mode-dark,
body.dh-mode-dark {
	--shadow: 0 18px 50px -20px rgba(0, 0, 0, 0.65);
}

/* --------------------------------------------------------------------------
   core/button — three variants
   -------------------------------------------------------------------------- */

/* Accent (pill) — primary brand color, white text, pill radius. */
.is-style-dh-btn-primary .wp-block-button__link,
.wp-block-button.is-style-dh-btn-primary .wp-block-button__link {
	background: var(--accent);
	color: #fff;
	border: 2px solid var(--accent);
	border-radius: 999px;
	padding: 14px 26px;
	font-weight: 600;
	transition: background .25s var(--ease, ease), color .25s var(--ease, ease);
}
.is-style-dh-btn-primary .wp-block-button__link:hover,
.wp-block-button.is-style-dh-btn-primary .wp-block-button__link:hover {
	background: transparent;
	color: var(--accent);
}

/* Ghost — transparent bg, accent border + accent text. */
.is-style-dh-btn-ghost .wp-block-button__link,
.wp-block-button.is-style-dh-btn-ghost .wp-block-button__link {
	background: transparent;
	color: var(--accent);
	border: 2px solid var(--accent);
	border-radius: var(--btn-radius, 12px);
	padding: 14px 26px;
	font-weight: 600;
	transition: background .25s var(--ease, ease), color .25s var(--ease, ease);
}
.is-style-dh-btn-ghost .wp-block-button__link:hover,
.wp-block-button.is-style-dh-btn-ghost .wp-block-button__link:hover {
	background: var(--accent);
	color: #fff;
}

/* Small — reduced padding. */
.is-style-dh-btn-sm .wp-block-button__link,
.wp-block-button.is-style-dh-btn-sm .wp-block-button__link {
	padding: 8px 16px;
	font-size: 0.85rem;
	border-radius: var(--btn-radius, 12px);
}

/* --------------------------------------------------------------------------
   core/image — three treatments
   -------------------------------------------------------------------------- */

/* Rounded corners — uses --radius (16px default). */
.is-style-dh-img-rounded img,
.wp-block-image.is-style-dh-img-rounded img {
	border-radius: var(--radius, 16px);
}

/* Drop shadow — uses --shadow (defined above with dark-mode variant). */
.is-style-dh-img-shadow img,
.wp-block-image.is-style-dh-img-shadow img {
	box-shadow: var(--shadow);
}

/* Zoom on hover — scale image up on hover (front-end only; editor preview
   won't show the hover state but the transform is harmless). */
.is-style-dh-img-zoom-hover img,
.wp-block-image.is-style-dh-img-zoom-hover img {
	transition: transform .35s var(--ease, ease);
	overflow: hidden;
}
.is-style-dh-img-zoom-hover:hover img,
.wp-block-image.is-style-dh-img-zoom-hover:hover img {
	transform: scale(1.04);
}

/* --------------------------------------------------------------------------
   core/quote — large display
   -------------------------------------------------------------------------- */

.is-style-dh-quote-large,
.wp-block-quote.is-style-dh-quote-large {
	font-family: var(--font-heading, "Fraunces", Georgia, serif);
	font-size: clamp(1.5rem, 2.5vw, 2rem);
	font-style: italic;
	line-height: 1.4;
	border-left: 4px solid var(--accent);
	padding-left: 24px;
	color: var(--text);
}

/* --------------------------------------------------------------------------
   core/separator — accent-colored, thicker
   -------------------------------------------------------------------------- */

.is-style-dh-sep-accent,
.wp-block-separator.is-style-dh-sep-accent {
	border-top: 3px solid var(--accent);
	width: 80px;
	margin-left: 0;
	margin-right: 0;
}

/* --------------------------------------------------------------------------
   core/group — card surface + alt background
   -------------------------------------------------------------------------- */

/* Card surface — bg-card, padding, border, radius. */
.is-style-dh-group-card,
.wp-block-group.is-style-dh-group-card {
	background: var(--bg-card, #fbfaf6);
	border: 1px solid var(--border, #e6e3da);
	border-radius: var(--radius, 16px);
	padding: 32px;
	box-shadow: var(--shadow);
}

/* Alt background — slightly different shade from the page background. */
.is-style-dh-group-alt,
.wp-block-group.is-style-dh-group-alt {
	background: var(--bg-alt, #f7f5f0);
	border-radius: var(--radius, 16px);
	padding: 32px;
}

/* --------------------------------------------------------------------------
   core/cover — accent overlay at 38% opacity
   -------------------------------------------------------------------------- */

.is-style-dh-cover-overlay .wp-block-cover__image-background,
.wp-block-cover.is-style-dh-cover-overlay .wp-block-cover__image-background,
.is-style-dh-cover-overlay.has-background-dim,
.wp-block-cover.is-style-dh-cover-overlay.has-background-dim {
	/* When no image is set, paint the accent color at 38% opacity. */
	background-color: var(--accent, #d8402a);
}
.is-style-dh-cover-overlay .wp-block-cover__gradient-background,
.wp-block-cover.is-style-dh-cover-overlay .wp-block-cover__gradient-background {
	background: linear-gradient(
		180deg,
		color-mix(in srgb, var(--accent, #d8402a) 38%, transparent) 0%,
		color-mix(in srgb, var(--accent, #d8402a) 62%, transparent) 100%
	);
}
