/**
 * fbl-ui.css — W7 "mobile floaters + widgets" layer (vegan-recipe.net, 2026-10-21).
 *
 * Zone owner: W7. Enqueued globally by the functions.php enqueue guard (W0),
 * after fbl-child/style.css (priority 20 convention, blueprint 7.2).
 *
 * Scope (materials/reports/2026-10-21-mobile-widgets-audit.md P1–P3 +
 * design/ui-upgrade-blueprint.md 5.7 target scheme):
 *   1. jump-bar: normalized z-index + horizontal safe-area insets;
 *   2. jump-bar yields the bottom strip to the CookieAdmin banner (first visit);
 *   3. ShareMyPost modal: touch targets >= 44px, label >= 12px;
 *   4. no sticky hover on touch devices;
 *   5. reduced-motion floor for everything this file touches.
 * CookieAdmin banner/re-consent geometry lives in `<style id="fbl-ca-tokens">`
 * (option cookieadmin_notice_title) — not here.
 *
 * z-index scale (audit 9 / blueprint 5.7, fixed here on purpose):
 *   content/media 0-10 · sticky sidebar (>=1024) 100 · jump-bar 9000 ·
 *   ShareMyPost modal 10000 · CookieAdmin banner + re-consent 99999 ·
 *   adminbar 110000. No widget may exceed 10000; CookieAdmin is the only
 *   99999 layer (consent must stay clickable above everything).
 */

/* --------------------------------------------------------------------------
 * 1. Jump-to-recipe bar (style.css 5, single-post, <=767px only).
 *    9999 -> 9000: below the ShareMyPost modal (10000), far below consent.
 *    Horizontal safe-area for notched devices (audit P3, 390px+).
 * ------------------------------------------------------------------------ */
.fbl-jump-bar {
	z-index: 9000;
	padding-left: calc(var(--fbl-space-16, 16px) + env(safe-area-inset-left, 0px));
	padding-right: calc(var(--fbl-space-16, 16px) + env(safe-area-inset-right, 0px));
}

/* --------------------------------------------------------------------------
 * 2. First-visit conflict (audit P1): the consent banner (~17% of a 375x667
 *    viewport, z 99999) covers the jump-bar completely, so "Jump to recipe"
 *    silently never works on the first visit — exactly where it matters.
 *    Target scheme (audit 9): the banner owns the bottom strip while it is up,
 *    the jump-bar returns the moment consent.js hides it.
 *    consent.js toggles the banner with an inline `style.display`, so the
 *    visible state is the `[style*="display: block"]` attribute. Older browsers
 *    without :has() keep today's stacking (banner over bar) — still clickable.
 * ------------------------------------------------------------------------ */
@supports selector(body:has(*)) {
	body:has(.cookieadmin_law_container[style*="display: block"]) .fbl-jump-bar {
		display: none !important;
	}
}

/* --------------------------------------------------------------------------
 * 3. ShareMyPost modal (audit P3): close button 32x32 -> 44x44 touch target,
 *    labels 10px -> 12px floor. Plugin CSS is not edited; these rules load
 *    after it (filemtime version, priority 20).
 * ------------------------------------------------------------------------ */
.sharemypost-modal-close {
	width: 44px !important;
	height: 44px !important;
	min-width: 44px;
	min-height: 44px;
}

.sharemypost-modal-label {
	font-size: 12px !important;
}

/* --------------------------------------------------------------------------
 * 4. Sticky hover on touch (audit P3): the plugin's .sharemypost-share-button
 *    hover transform/shadow has no (hover:hover) guard, so after a tap the
 *    button stays "lifted". Lift only on real hover devices.
 * ------------------------------------------------------------------------ */
@media (hover: none) {
	.sharemypost-share-button:hover {
		transform: none !important;
		box-shadow: none !important;
	}
}

/* --------------------------------------------------------------------------
 * 4b. Floating rail order (gemini-claims-verify F2): the plugin renders the
 *     enabled networks in its own hardcoded order, so the verdict order
 *     "Pinterest, Facebook, WhatsApp, Copy, X" is enforced with flex `order`
 *     on the desktop rail only. The inline bar is already correct and stays
 *     untouched. Composition itself comes from the plugin option
 *     sharemypost_settings[floating_enabled_networks] (no CSS hacks there).
 * ------------------------------------------------------------------------ */
@media (min-width: 769px) {
	.sharemypost-floating-bar .sharemypost-network-pinterest {
		order: 1;
	}

	.sharemypost-floating-bar .sharemypost-network-facebook {
		order: 2;
	}

	.sharemypost-floating-bar .sharemypost-network-whatsapp {
		order: 3;
	}

	.sharemypost-floating-bar .sharemypost-network-universal {
		order: 4;
	}

	.sharemypost-floating-bar .sharemypost-network-twitter {
		order: 5;
	}
}

/* --------------------------------------------------------------------------
 * 5. Reduced-motion floor (blueprint 6): this file adds no animation, but the
 *    plugin transitions it overrides must not fight the user preference.
 * ------------------------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
	.fbl-jump-bar,
	.sharemypost-share-button,
	.sharemypost-modal-close {
		transition: none !important;
	}
}


/* ==========================================================================
   13. Divi blue purge (2026-10-22, Gemini directive S1.1)
   Residual compiled-Divi accent (#2ea3f2) surfaces -> FBL tokens. The Divi
   system global colors were re-pointed the same day (primary/link ->
   --accent, secondary -> --accent-warm, heading/body -> --text); this block
   covers the literal leftovers in Divi's compiled CSS. Rationale:
   materials/reports/2026-10-22-gemini-directive-delta.md
   ========================================================================== */
.et_pb_bg_layout_light .et_pb_more_button,
.et_pb_bg_layout_light_tablet .et_pb_more_button,
.et_pb_bg_layout_light_phone .et_pb_more_button,
.nav-single a,
.posted_in a,
.tagged_as a {
	color: var(--accent);
}

.et_pb_widget a:hover,
.et_pb_widget li a:hover {
	color: var(--accent-hover);
}

.et-search-form,
blockquote {
	border-color: var(--border);
}

.et_mobile_menu {
	border-top-color: var(--accent);
}

.et_audio_content,
.et_link_content,
.et_quote_content {
	color: var(--accent);
}

.et_overlay:before {
	color: var(--accent);
}

.nav li ul,
.et_pb_menu .et-menu-nav > ul.upwards li ul {
	border-color: var(--border);
}

/* ==========================================================================
   ShareMyPost cleanup (2026-10-22, owner feedback): the "universal" (+ icon)
   button in the share bars opens the all-networks modal and reads as a stray
   plus. Hidden in the inline and floating bars only (same-element override,
   ShareMyPost lesson fix-ui 6.3). The modal itself is unreachable after this,
   which is the requested behavior.
   ========================================================================== */
.sharemypost-share-bar .sharemypost-share-button.sharemypost-network-universal {
	display: none !important;
}

/* ==========================================================================
   Trust strip (2026-10-22, owner feedback #3): the four hero benefit chips
   sat in fixed 25% Divi columns and the long one ("100% Whole Food
   Plant-Based") wrapped to two lines, which made the text sizes look ragged.
   Chips now size to their content on one line each and wrap as whole chips.
   ========================================================================== */
.fbl-trust {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	justify-content: center;
	gap: var(--fbl-space-8);
}

.fbl-trust > .et_pb_column {
	flex: 0 0 auto;
	width: auto !important;
	max-width: 100%;
	float: none;
	margin: 0 !important;
	padding: 0 !important;
}

.fbl-trust .fbl-trust__item {
	display: flex;
	align-items: center;
	height: 100%;
}

.fbl-trust .fbl-trust__item .et_pb_text_inner p {
	white-space: nowrap;
	margin: 0;
}

/* ==========================================================================
   Hero photo frame (2026-10-22, owner feedback #5): the home hero image sat
   square and bare while every other photo on the site lives in the standard
   media frame — 8px radius with the 1px --border hairline (the card look).
   Applied to .fbl-hero-image so the home and single-recipe heroes match.
   ========================================================================== */
.fbl-hero-image .et_pb_image_wrap {
	display: block;
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--fbl-radius-8);
}

.fbl-hero-image .et_pb_image_wrap img,
.fbl-hero-image img {
	display: block;
	border-radius: var(--fbl-radius-8);
}

/* ==========================================================================
   W4.2 — Глобальная полировка (ТЗ W4.2, 2026-11-13). Селекторы по фактической
   разметке home.html / recipe.html (снимки 2026-11-13):
   - пагинация: nav.pagination.fbl-pagination > ul.fbl-pagination__list > li >
     span|a.page-numbers.(fbl-pagination__current|__num|__dots|__nav);
   - крошки: div.et_pb_breadcrumbs…fbl-breadcrumbs > nav.et_pb_breadcrumbs--trail.
   Класса .wp-pagenavi в разметке нет (проверено) — не стилизуется.
   Только токены FBL, без новых HEX/теней/градиентов.
   ========================================================================== */

/* ---------- W4.2.1 Горизонтальный скролл: overflow-x: clip ---------------- */
/* clip (не hidden): не создаёт скролл-контейнер и не ломает position:sticky
   (sticky-сайдбар >=1024, jump-bar). Ранее правила не было ни в одном fbl-*.css. */
html,
body {
	overflow-x: clip;
}

/* ---------- W4.2.2 Пагинация: единый стиль + тач-таргет 44px -------------- */
.fbl-pagination .fbl-pagination__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--fbl-space-8);
	margin: 0;
	padding: 0;
	list-style: none;
}

.fbl-pagination .page-numbers {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px; /* тач-таргет, §8: не меньше 44px */
	min-height: 44px;
	padding: 0 12px;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--fbl-radius-8);
	color: var(--text);
	font-family: var(--fbl-font-body, 'Source Sans 3', system-ui, sans-serif);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	transition: background-color 200ms ease-out, border-color 200ms ease-out,
		color 200ms ease-out;
}

.fbl-pagination a.page-numbers:hover {
	background: var(--accent-soft);
	border-color: var(--accent);
	color: var(--accent-hover);
}

.fbl-pagination a.page-numbers:focus-visible {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

/* Активная страница: --accent + белый текст (= --surface) */
.fbl-pagination .fbl-pagination__current {
	background: var(--accent);
	border-color: var(--accent);
	color: var(--surface);
}

/* Многоточие: тот же ритм 44px, но без «кнопочного» пейнта */
.fbl-pagination .fbl-pagination__dots {
	background: transparent;
	border-color: transparent;
	color: var(--text-muted);
	pointer-events: none;
}

/* ---------- W4.2.3 Хлебные крошки: мета 0.8125rem (исключение §8) -------- */
/* 13px допустим ТОЛЬКО для крошек-мета (смысловой текст — не мельче 16px). */
.fbl-breadcrumbs {
	font-size: 0.8125rem;
	color: var(--text-muted);
	margin-bottom: 12px;
}

/* Divi может задавать свой размер на внутренних элементах модуля — приводим
   их к размеру контейнера; цвета ссылок (глобальные --accent) не трогаем. */
.fbl-breadcrumbs .et_pb_breadcrumbs--trail,
.fbl-breadcrumbs .et_pb_breadcrumbs--breadcrumb,
.fbl-breadcrumbs .et_pb_breadcrumbs--separator {
	font-size: inherit;
}

/* ---------- W4.2.4 Reduced-motion floor (конвенция файла §5) -------------- */
@media (prefers-reduced-motion: reduce) {
	.fbl-pagination .page-numbers {
		transition: none;
	}
}

/* TZ 2026-11-13 QA: CookieAdmin floating re-consent button (plugin widget,
   48px) blends into content when it sits over text/controls. A surface ring
   marks it clearly as a floating control (plugin UI stays untouched). */
.cookieadmin_re_consent {
	box-shadow: 0 0 0 2px var(--surface);
}

/* TZ QA round 3: the cookie re-consent FAB covered flow controls at 375px.
   Compact + corner-hugging + slightly translucent on phones. */
@media (max-width: 767px) {
	.cookieadmin_re_consent {
		width: 40px !important;
		height: 40px !important;
		right: 8px !important;
		bottom: 8px !important;
		left: auto !important;
		opacity: 0.85;
	}

	.cookieadmin_re_consent:hover,
	.cookieadmin_re_consent:focus-visible {
		opacity: 1;
	}
}
