/* ═══════════════════════════════════════════════════════════════════
   .tpl-hero — Hero unificat pentru template-uri
   ───────────────────────────────────────────────────────────────────
   Markup: <section class="tpl-hero [tpl-hero--large] [tpl-hero--has-image]">
     <div class="tpl-hero__overlay"></div>   (doar cu imagine)
     <div class="tpl-hero__shell">
       <div class="tpl-hero__inner">
         <p class="tpl-hero__eyebrow">…</p>
         <h1 class="tpl-hero__title">…</h1>
         <p class="tpl-hero__subtitle">…</p>
         <ul class="tpl-hero__meta">
           <li class="tpl-hero__meta-item"><i></i><span></span></li>
         </ul>
         <div class="tpl-hero__actions">
           <a class="tpl-hero__btn tpl-hero__btn--primary"></a>
           <a class="tpl-hero__btn tpl-hero__btn--ghost"></a>
         </div>
       </div>
     </div>
   </section>

   Tipografie: --type-eyebrow-*, --type-title-*, --type-subtitle-*
   Spacing:    --gap-hero-y, --gap-hero-y-large
               --gap-eyebrow-to-title, --gap-title-to-desc
   ═══════════════════════════════════════════════════════════════════ */


/* ─── BLOCK ─────────────────────────────────────────────── */

.tpl-hero {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;

	padding-top: var(--gap-hero-y);
	padding-bottom: var(--gap-hero-y);
	min-height: var(--tpl-hero-min-h, clamp(380px, 50vh, 540px));
	color: var(--tpl-hero-color, #fff);

	/* Default fără imagine → gradient navy */
	background: var(--tpl-hero-bg, linear-gradient(135deg, #0a2440 0%, #153a63 100%));
	background-repeat: no-repeat;
	background-size: cover;
	background-position: center center;
	overflow: hidden;
}

/* Fără imagine: păstrează explicit gradientul default.
   Important: nu seta background-image:none aici, altfel ștergi gradientul din shorthand-ul background. */
.tpl-hero--no-image {
	background: var(--tpl-hero-bg, linear-gradient(135deg, #0a2440 0%, #153a63 100%));
}

/* Cu imagine: background-image vine inline din PHP. */
.tpl-hero--has-image {
	background-color: var(--color-brand-navy, #0a2440); /* fallback dacă imaginea nu se încarcă */
}

/* Modifier: large size */
.tpl-hero--large {
	padding-top: var(--gap-hero-y-large);
	padding-bottom: var(--gap-hero-y-large);
	min-height: clamp(460px, 60vh, 640px);
}


/* ─── ELEMENTS ──────────────────────────────────────────── */

.tpl-hero__overlay {
	position: absolute;
	inset: 0;
	/* background: var(
		--tpl-hero-overlay,
		linear-gradient(180deg, rgba(10, 36, 64, 0.56) 0%, rgba(10, 36, 64, 0.82) 100%)
	); */
	background: linear-gradient(180deg, rgba(10, 36, 64, 0.56) 0%, rgba(10, 36, 64, 0.82) 100%), rgba(10, 36, 64, 0.24);
	pointer-events: none;
	z-index: 1;
}

.tpl-hero__shell {
	position: relative;
	z-index: 2;
	width: 100%;
	padding-inline: 1.5rem;
}

.tpl-hero__inner {
	max-width: 800px;
	margin: 0 auto;
	text-align: center;
}


/* ─── Eyebrow ──────────────────────────────────────────── */

.tpl-hero__eyebrow {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.4rem 0.85rem;

	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.08);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);

	font-family: var(--type-eyebrow-family);
	font-size: var(--type-eyebrow-size);
	font-weight: var(--type-eyebrow-weight);
	line-height: var(--type-eyebrow-leading);
	letter-spacing: var(--type-eyebrow-tracking);
	text-transform: var(--type-eyebrow-transform, uppercase);
	color: var(--tpl-hero-eyebrow-color, rgba(255, 255, 255, 0.78));

	margin: 0 0 var(--gap-eyebrow-to-title);
}


/* ─── Title ────────────────────────────────────────────── */

.tpl-hero__title {
	margin: 0 0 var(--gap-title-to-desc);

	font-family: var(--type-title-family);
	font-size: var(--type-title-size);
	font-weight: var(--type-title-weight);
	line-height: var(--type-title-leading);
	letter-spacing: var(--type-title-tracking);
	color: var(--color-on-dark, #fff);
}


/* ─── Subtitle ─────────────────────────────────────────── */

.tpl-hero__subtitle {
	max-width: 760px;
	margin: 0 auto;

	font-family: var(--type-subtitle-family);
	font-size: var(--type-subtitle-size);
	font-weight: var(--type-subtitle-weight);
	line-height: var(--type-subtitle-leading);
	letter-spacing: var(--type-subtitle-tracking);
	color: rgba(255, 255, 255, 0.88);
}


/* ─── Meta (optional) ──────────────────────────────────── */

.tpl-hero__meta {
	list-style: none;
	margin: var(--gap-title-to-desc) 0 0;
	padding: 0;

	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem 1.25rem;

	color: rgba(255, 255, 255, 0.78);
	font-family: var(--font-ui);
	font-size: 0.9rem;
}

.tpl-hero__meta-item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.35rem 0.85rem;

	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.14);
	border-radius: 999px;
}

.tpl-hero__meta-item i {
	font-size: 0.85rem;
	color: var(--color-accent, #e5bd07);
}


/* ─── Actions (optional) ───────────────────────────────── */

.tpl-hero__actions {
	margin-top: var(--gap-title-to-desc);

	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.75rem;
}

.tpl-hero__btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.75rem 1.5rem;

	border-radius: 999px;
	border: 1px solid transparent;

	font-family: var(--font-ui);
	font-size: 0.92rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	text-decoration: none;

	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		color 0.2s ease,
		transform 0.2s ease,
		box-shadow 0.2s ease;
}

.tpl-hero__btn:hover,
.tpl-hero__btn:focus-visible {
	transform: translateY(-1px);
	text-decoration: none;
}

/* Primary — auriu pe navy */
.tpl-hero__btn--primary {
	background: var(--color-accent, #e5bd07);
	color: var(--color-brand-navy, #0a2440);
}

.tpl-hero__btn--primary:hover,
.tpl-hero__btn--primary:focus-visible {
	background: #f0c92b;
	color: var(--color-brand-navy, #0a2440);
	box-shadow: 0 8px 22px rgba(229, 189, 7, 0.32);
}

/* Ghost — transparent cu border alb */
.tpl-hero__btn--ghost {
	background: transparent;
	border-color: rgba(255, 255, 255, 0.4);
	color: rgba(255, 255, 255, 0.95);
}

.tpl-hero__btn--ghost:hover,
.tpl-hero__btn--ghost:focus-visible {
	background: rgba(255, 255, 255, 0.08);
	border-color: rgba(255, 255, 255, 0.65);
	color: #fff;
}


/* ─── Modifier: legal pages (privacy / cookies) ─────────────
   Hero compact, strict title-only layout. The legal templates use
   page.php, so this modifier prevents the default editorial hero from
   becoming a huge empty navy block. */

.tpl-hero--legal {
	--tpl-hero-min-h: clamp(180px, 22vw, 260px);
	--tpl-hero-bg: linear-gradient(135deg, #0a2440 0%, #153a63 100%);

	padding-top: clamp(2.75rem, 4.5vw, 4rem);
	padding-bottom: clamp(2.75rem, 4.5vw, 4rem);
	min-height: var(--tpl-hero-min-h);
}

.tpl-hero--legal .tpl-hero__inner {
	max-width: var(--shell-content, 960px);
}

.tpl-hero--legal .tpl-hero__title {
	margin-bottom: 0;
	font-size: var(--type-title-size);
	line-height: var(--type-title-leading);
	letter-spacing: var(--type-title-tracking);
}

.tpl-hero--legal .tpl-hero__eyebrow,
.tpl-hero--legal .tpl-hero__subtitle,
.tpl-hero--legal .tpl-hero__meta,
.tpl-hero--legal .tpl-hero__actions {
	display: none;
}


/* ─── Responsive ───────────────────────────────────────── */

@media (max-width: 767.98px) {
	.tpl-hero {
		min-height: clamp(320px, 40vh, 400px);
	}

	.tpl-hero--large {
		min-height: clamp(380px, 50vh, 480px);
	}

	.tpl-hero__shell {
		padding-inline: 1rem;
	}

	.tpl-hero__actions {
		flex-direction: column;
		align-items: stretch;
		max-width: 320px;
		margin-left: auto;
		margin-right: auto;
	}

	.tpl-hero__btn {
		justify-content: center;
	}

	.tpl-hero__meta {
		font-size: 0.85rem;
		gap: 0.5rem;
	}

	.tpl-hero__meta-item {
		padding: 0.3rem 0.7rem;
	}
}

/* ─── Small composition helpers for templates that keep tools below hero ─── */
.search-tools {
	max-width: 760px;
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
	margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}

.error-page--after-hero {
	min-height: auto;
	background: transparent;
	padding: clamp(2rem, 4vw, 3.5rem) 1.5rem clamp(3rem, 5vw, 5rem);
}

.error-page--after-hero .error-page__inner {
	width: min(100%, 680px);
	padding: clamp(1.5rem, 3vw, 2.25rem);
	background: rgba(255, 255, 255, 0.96);
	border: 1px solid rgba(15, 23, 42, 0.08);
	border-radius: var(--radius-xl, 18px);
	box-shadow: 0 20px 56px rgba(15, 23, 42, 0.08);
}

.error-page--after-hero .error-page__links-label {
	color: var(--color-text-muted, #6b7280);
}

.error-page--after-hero .error-page__link {
	background: rgba(10, 36, 64, 0.06);
	border-color: rgba(10, 36, 64, 0.12);
	color: var(--color-brand-navy, #0a2440);
}

.error-page--after-hero .error-page__link:hover {
	background: rgba(10, 36, 64, 0.1);
	color: var(--color-brand-navy, #0a2440);
}

/* ─── Mobile hero calibration — reduced version ───────────────
   Legal heroes are title-only and should stay compact. Page/category
   heroes still keep enough presence, but no longer consume half the
   first mobile viewport. Desktop hierarchy is untouched. */
@media (max-width: 767.98px) {
	.tpl-hero {
		--type-title-size: clamp(1.72rem, 6.7vw, 2.08rem);
		--type-subtitle-size: clamp(0.96rem, 3.65vw, 1.04rem);
		--gap-eyebrow-to-title: 0.58rem;
		--gap-title-to-desc: 0.72rem;

		min-height: clamp(220px, 28vh, 270px);
		padding-top: clamp(1.7rem, 6.2vw, 2.5rem);
		padding-bottom: clamp(1.7rem, 6.2vw, 2.5rem);
	}

	.tpl-hero--has-image {
		min-height: clamp(235px, 31vh, 295px);
		background-position: center 42%;
	}

	.tpl-hero--large {
		min-height: clamp(255px, 34vh, 320px);
		padding-top: clamp(1.9rem, 6.8vw, 2.75rem);
		padding-bottom: clamp(1.9rem, 6.8vw, 2.75rem);
	}

	.tpl-hero--legal {
		min-height: clamp(145px, 18vh, 185px);
		padding-top: clamp(1.35rem, 4.6vw, 1.9rem);
		padding-bottom: clamp(1.35rem, 4.6vw, 1.9rem);
	}

	.tpl-hero__inner {
		max-width: min(100%, 33rem);
	}

	.tpl-hero__eyebrow {
		padding: 0.28rem 0.62rem;
		font-size: 0.68rem;
		letter-spacing: 0.07em;
	}

	.tpl-hero__title {
		margin-bottom: var(--gap-title-to-desc);
	}

	.tpl-hero__subtitle {
		max-width: 31rem;
		line-height: 1.42;
	}

	.tpl-hero__meta {
		margin-top: 0.8rem;
		font-size: 0.78rem;
	}

	.tpl-hero__meta-item {
		padding: 0.25rem 0.62rem;
	}

	.tpl-hero__actions {
		gap: 0.55rem;
		max-width: 286px;
		margin-top: 0.75rem;
	}

	.tpl-hero__btn {
		min-height: var(--mobile-hero-button-height, 42px);
		padding: 0.56rem 1rem;
		font-size: 0.82rem;
		line-height: 1.15;
	}

	.tpl-hero__btn--ghost {
		min-height: 38px;
		padding-block: 0.48rem;
		font-size: 0.78rem;
		background: rgba(255, 255, 255, 0.06);
		border-color: rgba(255, 255, 255, 0.38);
		opacity: 0.94;
	}

}

@media (max-width: 420px) {
	.tpl-hero {
		min-height: clamp(210px, 26vh, 255px);
	}

	.tpl-hero--has-image {
		min-height: clamp(230px, 29vh, 275px);
		background-position: center 42%;
	}

	.tpl-hero--large {
		min-height: clamp(240px, 31vh, 295px);
	}

	.tpl-hero--legal {
		min-height: clamp(135px, 17vh, 170px);
	}

	.tpl-hero__actions {
		max-width: 270px;
	}

	.tpl-hero__btn {
		min-height: 40px;
		padding: 0.52rem 0.9rem;
		font-size: 0.8rem;
	}

	.tpl-hero__btn--ghost {
		min-height: 38px;
		font-size: 0.77rem;
	}

}
