/* ============================================================
   HERO  —  .db-hero
   Built on core/cover: the block handles the background image,
   the gradient overlay, min-height and content position.

   Replaces 17 near-identical prefixed copies from the prototype
   (.hero, .ab-hero, .cs-hero, .fq-hero, .lp-hero, .wc-hero, …).
   Their differences were copy-paste drift, not design intent:
     min-height   720 / 760 / 900px
     overlay      .05→.32  vs  .5→.5  vs  .12→.75
     title clamp  9vw  vs  11vw
     line-height  1.0 / 1.02 / 1.05
   Normalised here to the majority values. Per-instance deviation
   is available through the Cover block's own controls, so it
   stays visible in the editor rather than hidden in a stylesheet.
   ============================================================ */

.db-hero.wp-block-cover {
	min-height: min(92vh, 720px);
	padding: 0;
	color: var(--white);

	/* Fallback base so the white headline stays legible before an editor picks
	   a background image — the overlay gradient alone is near-transparent, and
	   without this the hero renders white-on-cream. Cover's <img> background
	   paints over this once an image is set. */
	background-color: var(--ink);
}

/* The prototype's .hero__inner: page gutter, bottom-aligned stack. */
.db-hero.wp-block-cover > .wp-block-cover__inner-container {
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 24px;

	width: 100%;
	max-width: var(--maxw);
	margin-inline: auto;
	padding-inline: var(--pad);
	padding-top: 96px;    /* clear the fixed header */
	padding-bottom: 20px;
}

/* ---- breadcrumb ---------------------------------------------------------
   Pinned to the top by margin-bottom:auto inside the bottom-aligned stack.
   Hidden on mobile — the prototype relies on the hamburger nav there. */
.db-hero__breadcrumb {
	display: none;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.4);
}

.db-hero__breadcrumb a:hover,
.db-hero__breadcrumb .is-active {
	color: var(--white);
}

.db-hero__breadcrumb .sep {
	opacity: 0.6;
}

/* ⚠️ `margin-bottom: auto` is what pins the breadcrumb to the top of the hero
   [Figma 368:541 — the content frame is space-between over a fixed height, with
   the crumbs at the very top and the title block at the bottom].

   On the class alone it lost: WordPress emits layout rules for the cover's inner
   container that set `margin-block-end: 0` on its children, later in source order
   and at matching specificity — so the crumbs collapsed to 32px above the title
   instead. Re-asserted through the container to outrank it. */
.db-hero.wp-block-cover > .wp-block-cover__inner-container > .db-hero__breadcrumb {
	margin-bottom: auto;
}

/* ---- title -------------------------------------------------------------- */
.db-hero__title {
	font-size: clamp(2.5rem, 11vw, 7.5rem);
	/* 1, not 1.02: every 120px hero title in Figma sets its line height equal
	   to the size (368:3082, 368:2464, 368:2981). */
	line-height: 1;
	color: rgba(255, 255, 255, 0.8);
	max-width: 16ch;
	overflow-wrap: break-word;   /* long German compounds must not overflow */
}

/* ---- optional text + CTA ------------------------------------------------ */
.db-hero__meta {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 24px;
}

.db-hero__text {
	font-size: 16px;
	line-height: 1.75;
	color: rgba(255, 255, 255, 0.8);
	max-width: 680px;
}

.db-hero__text a {
	color: var(--white);
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, 0.6);
}

/* ---- desktop ------------------------------------------------------------
   The prototype's hero grows substantially at 861px and the meta row goes
   horizontal. Missing this on the first pass made the WP hero 720px tall with
   a stacked meta, against 900px and text-beside-CTA in the original.

     min-height   900px on 8 pages, 796px on 4  -> 900
     padding      120px top / 48px bottom
     gap          32px
     meta         row, bottom-aligned, space-between, 40px gap
     text         flex: 0 1 680px  */
@media (min-width: 861px) {
	.db-hero__breadcrumb { display: flex; }

	.db-hero.wp-block-cover {
		min-height: 900px;
	}

	.db-hero.wp-block-cover > .wp-block-cover__inner-container {
		gap: 32px;
		padding-top: 120px;
		padding-bottom: 48px;
	}

	.db-hero__meta {
		flex-direction: row;
		align-items: flex-end;
		justify-content: space-between;
		gap: 40px;
	}

	.db-hero__text { flex: 0 1 680px; }
	.db-hero__meta .wp-block-buttons { flex: 0 0 auto; }
}

/* Editor: Cover renders the same markup, but the admin bar and canvas
   padding make the 96px header offset unnecessary. */
.editor-styles-wrapper .db-hero.wp-block-cover > .wp-block-cover__inner-container {
	padding-top: 48px;
}

/* --- variant: light, no image  (.db-hero--light) --------------------------
   blog.php and gallery.php have no hero image at all: cream background, ink
   text, auto height. Found while rebuilding the pages from patterns — the
   image-backed hero was not enough. Not a Cover block; a plain Group. */
.db-hero--light {
	background: var(--cream);
	color: var(--ink);
	min-height: 0;
}
.db-hero--light .db-hero__inner {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 32px;
	padding-top: 96px;
	padding-bottom: 20px;
}
.db-hero--light .db-hero__title { color: var(--ink); line-height: 1.05; }
/* ⚠️ The base breadcrumb is `display:none` until 861px, copied from the
   prototype. The Blog mobile frame (368:5026) shows it, at 12/16 rather than
   the desktop 14/20 — so the light hero brings it back. The image hero's own
   mobile frames have not been checked, so that one is left hidden. */
.db-hero--light .db-hero__breadcrumb {
	display: flex;
	margin-bottom: 0;
	font-size: 12px;
	line-height: 16px;
	color: var(--muted);
}
.db-hero--light .db-hero__breadcrumb a:hover,
.db-hero--light .db-hero__breadcrumb .is-active { color: var(--ink); }
@media (min-width: 861px) {
	.db-hero--light .db-hero__inner { gap: 60px; padding-top: 136px; padding-bottom: 48px; }
	.db-hero--light .db-hero__title { font-size: 7.5rem; line-height: 1; }
	.db-hero--light .db-hero__breadcrumb { font-size: 14px; line-height: 20px; }
}
