/* =====================================================================
   Ricardo Caria: subpage hero (Turism, Muzica, Ciclism...)
   Colours and fonts come from base.css (no new values here).

   Structure
     .rc-sub                     wrapper of the page template "rc-subpage"
     .rc-sub__header             shared header template part "rc-header", laid over the hero
     .rc-subhero (core/cover)    the hero; PHP adds .hero--{page-slug} automatically
       .rc-subhero__content      left column: title, subtitle, text, button
       .rc-subnav                rc/subpage-nav block: arrows + dots
     .rc-continut (#continut)    empty section below the hero, target of the button
   ===================================================================== */

/* ---------- frame and fluid sizes ----------
   Set on the template wrapper and on the hero itself, so the hero also looks
   right in the block editor, where the template wrapper is not shown. */
.rc-sub,
.rc-subhero {
	container-type: inline-size;   /* cqi units below follow the page width */
	--rc-gutter: clamp(16px, 4cqi, 56px);
	--rc-logo-h: clamp(28px, 1.4cqi + 22px, 44px);
	--rc-nav-size: clamp(15px, .3cqi + 14px, 17px);
	--rc-arrow-size: clamp(40px, 3cqi + 28px, 52px);
	--rc-header-h: calc(var(--rc-logo-h) + 20px);
	--rc-title-size: clamp(48px, 5cqi + 24px, 104px);
	--rc-subtitle-size: clamp(20px, 1cqi + 15px, 30px);
	--rc-body-size: clamp(16px, .3cqi + 15px, 18px);
	--rc-col: 600px;               /* width of the left text column */

	position: relative;
	margin: 0 !important;
	padding: 0 !important;
	background: var(--rc-bg);
	color: var(--rc-text);
	font-family: var(--rc-font);
	font-weight: var(--rc-weight-regular);
}
body:has(.rc-sub) { background: var(--rc-bg); }
.rc-sub *, .rc-sub *::before, .rc-sub *::after { box-sizing: border-box; }
/* the theme adds block gaps between template blocks; the hero must start at the very top */
.rc-sub > *,
.rc-sub > .wp-block-post-content > * { margin-block: 0 !important; }
.rc-sub > .wp-block-post-content { margin: 0 !important; padding: 0 !important; }
.rc-sub :where(h1, h2, p) { font-family: var(--rc-font); }

/* smooth scroll for "Află mai mult", unless the visitor asked for less motion */
html:has(.rc-subhero) { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html:has(.rc-subhero) { scroll-behavior: auto; } }

/* ---------- shared header, laid over the hero ----------
   Same blocks and class names as the landing page header (.rc-hero__*),
   scoped to .rc-sub so the landing page CSS is untouched. */
.rc-sub__header { position: absolute; inset: 0 0 auto 0; z-index: 20; margin: 0 !important; }
.rc-sub .rc-hero__header {
	display: flex; align-items: center; justify-content: space-between; gap: 16px;
	margin: 0 !important; padding: 20px var(--rc-gutter) 0 !important;
}
.rc-sub .rc-hero__header > * { margin: 0 !important; }
.rc-sub .rc-hero__logo { flex: none; }
.rc-sub .rc-hero__logo img { height: var(--rc-logo-h) !important; width: auto !important; max-width: none; display: block; }
.rc-sub .rc-hero__logo a { display: inline-block; border-radius: 4px; }
.rc-sub .rc-hero__logo a:focus-visible { outline: 3px solid var(--rc-gold); outline-offset: 4px; }
.rc-sub .rc-hero__right { display: flex; align-items: center; gap: clamp(12px, 2.5cqi, 36px); margin: 0 !important; }
.rc-sub .rc-hero__right > * { margin: 0 !important; }

.rc-sub .rc-hero__nav { font-family: var(--rc-font); font-size: var(--rc-nav-size); font-weight: var(--rc-weight-regular); color: var(--rc-text); }
.rc-sub .rc-hero__nav .wp-block-navigation__container { gap: clamp(14px, 2.4cqi, 32px); }
.rc-sub .rc-hero__nav a { color: var(--rc-text); text-decoration: none; padding: 12px 0; line-height: 1; }
.rc-sub .rc-hero__nav a:hover,
.rc-sub .rc-hero__nav a:focus-visible { text-decoration: underline; text-decoration-color: var(--rc-gold); text-underline-offset: 6px; text-decoration-thickness: 2px; }
.rc-sub .rc-hero__nav a:focus-visible { outline: 2px solid var(--rc-gold); outline-offset: 4px; border-radius: 2px; }
.rc-sub .rc-hero__nav .wp-block-navigation__responsive-container-open,
.rc-sub .rc-hero__nav .wp-block-navigation__responsive-container-close { color: var(--rc-text); }
.rc-sub .rc-hero__nav .wp-block-navigation__responsive-container.is-menu-open { background: var(--rc-bg) !important; color: var(--rc-text) !important; }
.rc-sub .rc-hero__nav .is-menu-open .wp-block-navigation__container { font-size: 22px; gap: 18px; }

.rc-sub .rc-hero__social { gap: 6px !important; }
.rc-sub .rc-hero__social .wp-social-link { color: var(--rc-text) !important; background: transparent !important; }
.rc-sub .rc-hero__social .wp-social-link a { display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border-radius: 50%; transition: transform .2s ease-out; }
.rc-sub .rc-hero__social .wp-social-link a:hover { transform: translateY(-2px); }
.rc-sub .rc-hero__social .wp-social-link a:focus-visible { outline: 2px solid var(--rc-gold); outline-offset: 2px; }
.rc-sub .rc-hero__social svg { width: 24px; height: 24px; fill: currentColor; }

/* ---------- the hero (core/cover with class rc-subhero) ---------- */
.rc-subhero.wp-block-cover {
	/* Mood of the overlay. Each page can override the tint and strength on its
	   own class (see "Moods per page" below) without touching the hero. */
	--rc-subhero-tint: var(--rc-bg);
	--rc-subhero-strong: 94%;      /* left edge, behind the text */
	--rc-subhero-text: 86%;        /* still this strong at the end of the text column */
	--rc-subhero-col-end: calc(var(--rc-gutter) * 2 + var(--rc-arrow-size) + var(--rc-col));
	--rc-subhero-overlay:
		/* top band: keeps the menu readable on bright skies */
		linear-gradient(to bottom, color-mix(in srgb, var(--rc-subhero-tint) 70%, transparent) 0, transparent 26%),
		/* bottom band: keeps the dots readable */
		linear-gradient(to top, color-mix(in srgb, var(--rc-subhero-tint) 75%, transparent) 0, transparent 26%),
		/* left to right: strong behind the text, transparent on the right */
		linear-gradient(90deg,
			color-mix(in srgb, var(--rc-subhero-tint) var(--rc-subhero-strong), transparent) 0,
			color-mix(in srgb, var(--rc-subhero-tint) var(--rc-subhero-text), transparent) var(--rc-subhero-col-end),
			transparent 100%);

	min-height: 100svh;
	margin: 0 !important;
	padding: 0 !important;
	align-items: stretch;
	color: var(--rc-text);
	background-color: var(--rc-bg);
}
/* the cover's own overlay layer becomes our gradient (the block's dim slider is not used) */
.rc-subhero.wp-block-cover > .wp-block-cover__background {
	background: var(--rc-subhero-overlay) !important;
	opacity: 1 !important;
}
.rc-subhero.wp-block-cover > .wp-block-cover__inner-container {
	position: relative; z-index: 1;
	/* !important: core's "content position" rule (doubled class) would shrink this to the text width */
	width: 100% !important; max-width: none !important; margin: 0 !important; min-height: 100svh;
	display: flex; flex-direction: column; justify-content: center;
	/* room for the header on top, the arrows left and right, the dots below */
	padding: calc(var(--rc-header-h) + 48px) calc(var(--rc-gutter) * 2 + var(--rc-arrow-size)) 104px !important;
	color: var(--rc-text);
}
.rc-subhero.wp-block-cover > .wp-block-cover__inner-container > * { margin-block: 0 !important; }

/* ---------- Moods per page ----------
   PHP adds hero--{slug} to the hero (hero--turism, hero--muzica, hero--ciclism).
   Use only design colours; keep --rc-subhero-text at 86% or more for AA contrast. */
.rc-subhero.hero--turism  { --rc-subhero-tint: var(--rc-bg); }

/* Muzica: warmer and darker, a sunset mood. The tint is mixed only from design
   tokens (charcoal ink + 10% of the warm glow) = a deep warm brown, no new colour.
   Stronger overlay behind the text; worst case (white photo behind) keeps
   body text above 8:1, so AA holds. */
.rc-subhero.hero--muzica {
	--rc-subhero-tint: color-mix(in srgb, var(--rc-ink) 90%, var(--rc-glow));
	--rc-subhero-strong: 96%;
	--rc-subhero-text: 90%;
}

.rc-subhero.hero--ciclism { --rc-subhero-tint: var(--rc-bg); }

/* ---------- left column ---------- */
.rc-subhero .rc-subhero__content {
	max-width: var(--rc-col);
	margin: 0 !important;
	text-shadow: 0 1px 14px color-mix(in srgb, var(--rc-bg) 55%, transparent);
}
.rc-subhero .rc-subhero__content > * { margin-block: 0 !important; }
.rc-subhero .rc-subhero__title {
	font-family: var(--rc-font); font-weight: var(--rc-weight-black);
	font-size: var(--rc-title-size); line-height: 1.05; letter-spacing: -.01em;
	color: var(--rc-text); text-wrap: balance;
}
/* short gold underline under the title (decoration only) */
.rc-subhero .rc-subhero__title::after {
	content: ""; display: block; width: 72px; height: 4px; margin-top: 20px;
	border-radius: 2px; background: var(--rc-gold);
}
.rc-subhero .rc-subhero__subtitle {
	margin-top: 24px !important;
	font-style: normal; font-weight: var(--rc-weight-regular);
	font-size: var(--rc-subtitle-size); line-height: 1.3; color: var(--rc-text);
}
.rc-subhero .rc-subhero__text {
	margin-top: 14px !important; max-width: 34em;
	font-size: var(--rc-body-size); line-height: 1.5; color: var(--rc-text-soft);
}
.rc-subhero .rc-subhero__content > .wp-block-buttons { margin-top: 32px !important; }

/* ---------- gold button: block style "Auriu" on core/button ----------
   Same look as the landing page button (.rc-btn). */
.wp-block-button.is-style-rc-gold .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 12px 28px;
	border-radius: 999px; background: var(--rc-gold); color: var(--rc-ink); border: 0;
	font-family: var(--rc-font); font-weight: var(--rc-weight-bold); font-size: 16px; line-height: 1;
	text-decoration: none; white-space: nowrap; text-shadow: none;
	transition: transform .2s ease-out, box-shadow .2s ease-out;
}
.wp-block-button.is-style-rc-gold .wp-block-button__link:hover {
	transform: translateY(-2px); color: var(--rc-ink); background: var(--rc-gold);
	box-shadow: 0 10px 24px -10px color-mix(in srgb, var(--rc-gold) 80%, transparent);
}
.wp-block-button.is-style-rc-gold .wp-block-button__link:focus-visible { outline: 3px solid var(--rc-text); outline-offset: 3px; }

/* ---------- arrows and dots (rc/subpage-nav) ---------- */
.rc-subnav { position: absolute; inset: 0; z-index: 2; pointer-events: none; margin: 0 !important; }
.rc-subnav__arrow {
	position: absolute; top: 50%; transform: translateY(-50%); pointer-events: auto;
	display: grid; place-items: center; width: var(--rc-arrow-size); height: var(--rc-arrow-size);
	border-radius: 50%; border: 1px solid color-mix(in srgb, var(--rc-text) 35%, transparent);
	background: var(--rc-arrow-bg); color: var(--rc-text); text-decoration: none;
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
	transition: border-color .2s ease-out;
}
.rc-subnav__arrow--prev { left: var(--rc-gutter); }
.rc-subnav__arrow--next { right: var(--rc-gutter); }
.rc-subnav__arrow svg { width: 46%; height: 46%; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.rc-subnav__arrow--next svg { transform: scaleX(-1); }
.rc-subnav__arrow:hover { border-color: var(--rc-gold); color: var(--rc-text); }
.rc-subnav__arrow:focus-visible { outline: 3px solid var(--rc-gold); outline-offset: 3px; }

.rc-subnav__dots {
	position: absolute; left: 50%; bottom: clamp(20px, 4svh, 40px); transform: translateX(-50%); pointer-events: auto;
	display: flex; gap: 4px; margin: 0; padding: 0; list-style: none;
}
.rc-subnav__dots li { margin: 0; padding: 0; }
/* 28px target around a 10px dot */
.rc-subnav__dot { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; }
.rc-subnav__dot::before {
	content: ""; width: 10px; height: 10px; border-radius: 50%;
	background: color-mix(in srgb, var(--rc-text) 70%, transparent);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--rc-bg) 45%, transparent);
	transition: background-color .2s ease-out, transform .2s ease-out;
}
.rc-subnav__dot:hover::before { background: var(--rc-text); }
.rc-subnav__dot[aria-current="page"]::before { background: var(--rc-gold); transform: scale(1.2); }
.rc-subnav__dot:focus-visible { outline: 2px solid var(--rc-gold); outline-offset: 0; }

/* ---------- placeholder section below the hero ---------- */
.rc-continut { min-height: 40svh; background: var(--rc-bg); }

/* ---------- tablets ----------
   The text column fills most of the width here, so the fade never reaches
   fully transparent (avoids a hard band at the right edge, keeps AA contrast). */
@media (min-width: 601px) and (max-width: 1024px) {
	.rc-subhero.wp-block-cover {
		--rc-subhero-overlay:
			linear-gradient(to bottom, color-mix(in srgb, var(--rc-subhero-tint) 70%, transparent) 0, transparent 26%),
			linear-gradient(to top, color-mix(in srgb, var(--rc-subhero-tint) 75%, transparent) 0, transparent 26%),
			linear-gradient(90deg,
				color-mix(in srgb, var(--rc-subhero-tint) var(--rc-subhero-strong), transparent) 0,
				color-mix(in srgb, var(--rc-subhero-tint) var(--rc-subhero-text), transparent) 55%,
				color-mix(in srgb, var(--rc-subhero-tint) 60%, transparent) 100%);
	}
}

/* ---------- phones ---------- */
@media (max-width: 600px) {
	.rc-sub, .rc-subhero { --rc-gutter: 16px; --rc-arrow-size: 40px; --rc-logo-h: 26px; }
	/* text stacks over an evenly darker overlay instead of the left-to-right fade */
	.rc-subhero.wp-block-cover {
		--rc-subhero-overlay: linear-gradient(to bottom,
			color-mix(in srgb, var(--rc-subhero-tint) 78%, transparent) 0,
			color-mix(in srgb, var(--rc-subhero-tint) 86%, transparent) 55%,
			color-mix(in srgb, var(--rc-subhero-tint) 93%, transparent) 100%);
	}
	.rc-subhero.wp-block-cover > .wp-block-cover__inner-container {
		padding: calc(var(--rc-header-h) + 56px) var(--rc-gutter) calc(var(--rc-arrow-size) + 56px) !important;
	}
	/* arrows leave the sides and join the dots in one row at the bottom */
	.rc-subnav {
		inset: auto 0 20px 0; pointer-events: auto;
		display: flex; align-items: center; justify-content: center; gap: 12px;
	}
	.rc-subnav__arrow, .rc-subnav__dots { position: static; transform: none; }
	.rc-sub .rc-hero__header { padding-top: 14px !important; }
	.rc-sub .rc-hero__right { gap: 4px; }
	.rc-sub .rc-hero__social .wp-social-link a { width: 36px; height: 36px; }
	.rc-sub .rc-hero__social svg { width: 20px; height: 20px; }
}
@media (max-width: 380px) {
	.rc-sub, .rc-subhero { --rc-logo-h: 22px; }
	.rc-sub .rc-hero__social .wp-social-link a { width: 32px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.rc-subhero .wp-block-button__link, .rc-subnav__arrow, .rc-subnav__dot::before, .rc-sub .rc-hero__social a { transition: none !important; }
}

/* ---------- editor only: show arrows and dots as a simple row ---------- */
.rc-subnav-editor { padding: 12px 0; }
.rc-subnav-editor .rc-subnav { position: static; display: flex; align-items: center; justify-content: center; gap: 12px; pointer-events: none; }
.rc-subnav-editor .rc-subnav__arrow,
.rc-subnav-editor .rc-subnav__dots { position: static; transform: none; }
