/*
Theme Name: EsthéBeauty
Description: Custom block theme for EsthéBeauty — built from a Figma design (REST-API-extracted tokens). FSE / Full Site Editing.
Version: 0.3.1
Requires at least: 6.5
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: esthebeauty
Tags: full-site-editing, block-theme
*/

/* ---------- Content frame + prose width ----------
   `--eb-frame` is the shared section width (matches theme.json
   contentSize). Headings + block content fill the frame via WP's
   constrained layout. Body copy needs a readable measure (~66ch):
     .eb-prose         capped at 66ch, left edge ON the frame so it
                       lines up under a left-aligned title
     .eb-prose-center  capped at 66ch, centered in the section
   `.eb-prose`'s left margin = the frame's side gap, so a narrow
   paragraph starts exactly where a full-frame block would — not at the
   section padding edge. `max(0px, …)` collapses the offset on viewports
   narrower than the frame. `!important` beats WP's is-layout-constrained
   `margin-inline: auto`.                                                 */
:root { --eb-frame: 1280px; }
.eb-prose,
.eb-prose-center {
	max-width: 66ch;
}
.eb-prose {
	margin-left: max(0px, (100% - var(--eb-frame)) / 2) !important;
	margin-right: auto !important;
}
.eb-prose-center {
	margin-left: auto !important;
	margin-right: auto !important;
}

/* ---------- Strategia (tecnologie /) ----------
   Full-bleed cover with `strategia.jpg` behind. Two soft gradients
   bridge it to the dark-overlay hero above (accent-dark) and the cream
   "Le nostre tecnologie" section below (accent-light). Body paragraphs
   are styled more loosely than the default to keep the section feeling
   calm — lighter weight, no letter-spacing, no transform.                */
.eb-strategia { position: relative; }
/* Lift the actual text content above the gradients (z:2) so they sit
   between the bg photo and the prose, not on top of it. */
.eb-strategia .wp-block-cover__inner-container {
	position: relative;
	z-index: 3;
}
.eb-strategia::before,
.eb-strategia::after {
	content: "";
	position: absolute;
	left: 0; right: 0;
	/* Each gradient covers ~55% of the section height so they overlap in
	   the middle — no more crisp "window" of unfaded bg between them. */
	height: 55%;
	z-index: 2;
	pointer-events: none;
}
.eb-strategia::before {
	top: 0;
	background: linear-gradient(to bottom,
		rgba(74, 68, 61, 0.92) 0%,
		rgba(74, 68, 61, 0.75) 20%,
		rgba(74, 68, 61, 0.50) 45%,
		rgba(74, 68, 61, 0.20) 75%,
		rgba(74, 68, 61, 0) 100%);
}
.eb-strategia::after {
	bottom: 0;
	background: linear-gradient(to top,
		rgba(222, 217, 211, 0.95) 0%,
		rgba(222, 217, 211, 0.75) 20%,
		rgba(222, 217, 211, 0.50) 45%,
		rgba(222, 217, 211, 0.20) 75%,
		rgba(222, 217, 211, 0) 100%);
}
/* Per Figma: title spaced at 7px tracking, body at 3px and uppercased.   */
.eb-strategia h2 {
	letter-spacing: 7px !important;
}
.eb-strategia .wp-block-cover__inner-container > p {
	font-weight: 400 !important;
	letter-spacing: 3px !important;
	text-transform: uppercase !important;
	font-size: 0.875rem;
	max-width: 60ch;
	margin-left: auto !important;
	margin-right: auto !important;
}

/* ---------- Global overflow & word-break safety ----------
   Long Italian words like "COLLABORAZIONI" can blow out narrow viewports
   if a heading refuses to break. Two-layer defense:
     1) clip any horizontal overflow at the body level (no rogue scrollbars),
     2) allow word-internal breaking on text elements as a graceful fallback
        when a single word is wider than its container.                    */
html, body { overflow-x: clip; }
h1, h2, h3, h4, h5, h6,
.wp-block-heading,
p {
	overflow-wrap: break-word;
	word-wrap: break-word;
}

/* ---------- Square photos everywhere ----------
   Brand decision: no rounded borders on any image. Wins over per-block
   `border-radius` inline styles via !important so legacy seed markup that
   still carries `style="border-radius:16px"` gets neutralised too.        */
.wp-block-image img,
.wp-block-image figure { border-radius: 0 !important; }

/* `.eb-hero-bottom` — content sits at the bottom of the hero (vertical)
   while keeping the inner-container full width, so the title still
   aligns to the 1280 frame. (WP's `contentPosition:"bottom left"`
   would shrink-wrap the container off-frame instead.) */
.wp-block-cover.eb-hero-bottom { justify-content: flex-end; }

/* `.eb-hero-no-fade` disables the cream bottom gradient on `.eb-hero`
   (used when the section below isn't cream — e.g. tecnologie hero now
   sits over the Strategia cover and the fade looked out of place).      */
.eb-hero-no-fade::after { display: none !important; }

/* ---------- Button size variants ----------
   `eb-btn-sm` shrinks the pill button used in the hero CTA. `eb-btn-filled`
   flips the colour scheme so the button is solid dark with white text
   (used on the Tecnologie /prenota-una-consulenza CTA, where a hollow
   pill on cream visually disappears).                                     */
.eb-btn-sm .wp-block-button__link {
	padding: 0.55rem 1.5rem !important;
	font-size: 0.875rem !important;
	font-weight: 700 !important;
	border-width: 2px !important;
}
.eb-btn-filled .wp-block-button__link,
.eb-btn-filled .wp-block-button__link.wp-element-button {
	background-color: var(--wp--preset--color--accent-dark) !important;
	color: #ffffff !important;
	border-color: var(--wp--preset--color--accent-dark) !important;
}
.eb-btn-filled .wp-block-button__link:hover,
.eb-btn-filled .wp-block-button__link.wp-element-button:hover {
	background-color: transparent !important;
	color: var(--wp--preset--color--accent-dark) !important;
}

/* ---------- Single-line headline helper ----------
   For section titles that must not wrap (e.g. the "Prenota una consulenza
   tecnica" CTA on /tecnologie/). Use sparingly — only when shrinking the
   font is preferable to wrapping.                                         */
.eb-nowrap {
	white-space: nowrap;
	font-size: clamp(1.2rem, 3.5vw, 2.4rem) !important;
}

/* ---------- Header overlay: hero extends UNDER the header pill ----------
   Per Figma: the hero photo bleeds to the very top of the page, with the
   rounded header pill floating on top. We do this with a single CSS layer
   so all content (logo, nav, hero copy) stays edited via the site editor.

   Structure that emerges:
     <header>  ← position: absolute (this rule)
     <main>    ← starts at top:0 because <header> is out of flow
       <eb-hero>  ← has extra padding-top to clear the floating header
*/
header.wp-block-template-part {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	z-index: 50;
}
/* The header pill should float with the SAME breathing room on top as on the
   sides — i.e. ~md from the viewport edge on every axis. The wrap inside the
   header already has padding-left/right via inline style; force a matching
   padding-top here so the pill never touches the page edge.                 */
header.wp-block-template-part > .wp-block-group {
	padding-top: var(--wp--preset--spacing--md) !important;
}
/* Cancel the browser's default top margin on <main> if any. */
main.wp-block-group { margin-top: 0; }
/* Same for the footer — WP's `:where(.wp-site-blocks) > *` rule otherwise
   inserts `margin-block-start: var(--wp--preset--spacing--md)` between
   <main> and <footer>, surfacing the page's white bg as a thin strip
   between the last content section and the dark footer.                 */
footer.wp-block-template-part { margin-top: 0 !important; }
/* WP's flow layout puts `margin-top: var(--wp--style--block-gap)` (1.5rem)
   between sibling blocks inside `.wp-block-post-content`. With our alignfull
   sections that gap shows the body's white background between sections,
   producing a "white stripe" between bands. Zero it on ALL direct children
   so even stray empty <p> blocks (which the editor sometimes inserts when a
   page is re-saved) cannot reintroduce the gap. Sections own their own
   vertical rhythm via padding (see "Section vertical rhythm" below).       */
.wp-block-post-content > * {
	margin-top: 0 !important;
	margin-bottom: 0 !important;
}
/* Hide any empty paragraph blocks the editor injects during save — they
   would otherwise add one line-height of dead space between sections.     */
.wp-block-post-content > p:empty,
.wp-block-post-content > p.is-empty {
	display: none !important;
}
/* Push hero content below the floating header so titles aren't covered.
   Compound selector + !important is required to beat WP core's
   `.wp-block-cover .wp-block-cover__inner-container { padding: 0 }`.
   Bumped to 24vh so the H1 cap-height clears the pill on shorter viewports. */
.wp-block-cover.eb-hero .wp-block-cover__inner-container {
	padding-top: 24vh !important;
	z-index: 3 !important;
}

/* ---------- Header pill: dark accent at 60% transparency ----------
   No backdrop-filter — per user, plain transparency is fine and avoids
   the GPU-blur cost on scroll.                                             */
.eb-header-pill {
	background: rgba(74, 68, 61, 0.60) !important;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 9999px;
}
.eb-header-pill .wp-block-site-title a,
.eb-header-pill .wp-block-navigation a {
	color: #ffffff !important;
}

/* Site logo image inside the header pill — sits at the height of the pill */
.eb-header-pill .wp-block-image img {
	height: 48px;
	width: auto;
	display: block;
}

/* ---------- Mobile nav overlay ----------
   When the hamburger opens the nav at mobile widths, WP's default styling
   shows a white panel. Our nav links are forced to white via the pill rule
   above, so the result was white-on-white = blank screen. Give the overlay
   a dark backdrop matching the pill so the white labels remain readable.   */
.wp-block-navigation__responsive-container.is-menu-open {
	background: #4A443D !important;
	color: #ffffff !important;
	padding: 4rem 1.5rem 2rem !important;
	opacity: 1 !important;
	visibility: visible !important;
}
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation-item__content,
.wp-block-navigation__responsive-container.is-menu-open a {
	color: #ffffff !important;
	font-size: 1.25rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
}
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__responsive-close,
.wp-block-navigation__responsive-container.is-menu-open
	.wp-block-navigation__responsive-close svg {
	color: #ffffff !important;
	fill: #ffffff !important;
}
/* The hamburger trigger button itself sits inside the dark pill — make
   sure its icon is visible too. */
.eb-header-pill .wp-block-navigation__responsive-container-open svg,
.eb-header-pill .wp-block-navigation__responsive-container-open {
	color: #ffffff !important;
	fill: #ffffff !important;
}

/* ---------- Hero ----------
   The hero cover's own padding is forced to 0 — the inner-container's
   24vh top padding (set above) does all the work pushing content below
   the floating header. Without this, the inline `padding:xxxl` on the
   cover element double-stacks and pushes the H1 way too far down.       */
.eb-hero {
	min-height: 92vh;
	position: relative;
	align-items: flex-start !important;
	justify-content: flex-start !important;
	padding-top: 0 !important;
	padding-bottom: 0 !important;
}
/* Hero parallax: WP's `has-parallax` already sets background-attachment:
   fixed. Force background-size: cover (some setups default to auto) and
   provide a touch-device fallback because iOS Safari & some Android
   browsers silently ignore `fixed` and would render the image enormous /
   misaligned. On touch devices we fall back to a normal scrolling bg —
   no parallax, but the photo still renders correctly.                     */
.wp-block-cover.has-parallax.eb-hero {
	background-size: cover !important;
	background-repeat: no-repeat !important;
}
@media (hover: none) and (pointer: coarse) {
	.wp-block-cover.has-parallax.eb-hero {
		background-attachment: scroll !important;
	}
}
/* The verified Figma gradient: hero photo fades into the cream below.    */
/* Sits BELOW the inner content via a low z-index. The content gets z=3.  */
.eb-hero::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg,
		rgba(0, 0, 0, 0)        0%,
		rgba(0, 0, 0, 0)        45%,
		rgba(222, 217, 211, 0.4) 70%,
		rgba(222, 217, 211, 0.95) 90%,
		#DED9D3                 100%);
	pointer-events: none;
	z-index: 1;
}
.eb-hero .wp-block-cover__inner-container {
	position: relative;
	z-index: 3;
	width: 100%;
	padding-top: 6vh;
	/* No own max-width — let WP's constrained layout (1280px frame) place
	   the hero content so it aligns with every other section + the menu. */
}

/* Hero title: industry-standard hero sizing (was 40-64px, now 30-48px). */
.eb-hero h1 {
	font-size: clamp(1.875rem, 4vw, 3rem) !important;
	line-height: 1 !important;
	font-weight: 500;
	letter-spacing: 0.01em;
	text-transform: none;
}
/* Hero subhead: was 20-28px → now 17-20px (typical lead size). */
.eb-hero p {
	font-size: clamp(1.0625rem, 1.6vw, 1.25rem) !important;
	line-height: 1.35 !important;
}

/* Hero CTA — white outline pill, Inter 800 (per Figma node 4175:15) */
.is-style-on-dark .wp-block-button__link,
.eb-hero .wp-block-button__link {
	background: transparent !important;
	color: #ffffff !important;
	border: 3px solid #ffffff !important;
	border-radius: 9999px !important;
	font-weight: 800;
	font-size: 1.125rem;
	letter-spacing: 0.05em;
	padding: 1rem 2.5rem;
	text-transform: none;
}
.is-style-on-dark .wp-block-button__link:hover,
.eb-hero .wp-block-button__link:hover {
	background: #ffffff !important;
	color: #4A443D !important;
}

/* ---------- Background watermark text ---------- */
/* Used as a `core/heading` with extra class `eb-watermark`. Sits behind the
   real heading via negative z-index. Stays inside its container. */
.eb-watermark {
	font-family: Inter, system-ui, sans-serif !important;
	font-weight: 700 !important;
	font-size: clamp(8rem, 22vw, 25rem) !important;
	line-height: 0.9 !important;
	letter-spacing: 0.01em;
	color: #4A443D !important;
	opacity: 0.10;
	text-transform: uppercase;
	margin: 0 !important;
	pointer-events: none;
	user-select: none;
}
.eb-watermark-wrap {
	position: relative;
	overflow: hidden;
}
/* The watermark is absolute-positioned inside a `.eb-watermark-title` row
   (which wraps the watermark + the immediately-following title/columns
   block). That way the watermark centers on the title's vertical position,
   not the whole section's — matches the Figma design. */
.eb-watermark-title {
	position: relative;
}
.eb-watermark-title > .eb-watermark {
	position: absolute;
	top: 50%;
	/* Anchor to the left edge with a small positive offset so the
	   watermark begins slightly after the foreground title — gives a
	   subtle stagger between the two. */
	left: clamp(1rem, 2vw, 2rem);
	transform: translateY(-50%);
	z-index: 0;
	white-space: nowrap;
}
.eb-watermark-title > *:not(.eb-watermark) {
	position: relative;
	z-index: 1;
}
/* When .eb-watermark-title is a direct child of .eb-watermark-wrap (Tech
   Gallery, Filosofia, etc.), the huge watermark's lower half overflows
   past the title and bleeds into whatever follows (cards, body text).
   Push the next sibling down to clear it. */
.eb-watermark-wrap > .eb-watermark-title,
.wp-block-column > .eb-watermark-title {
	margin-bottom: clamp(5rem, 12vw, 10rem);
}
/* And lift the OTHER column's content (e.g. the La Mente portrait) above
   the watermark's z-index:0 — without this the image sits behind it. */
.eb-watermark-wrap .wp-block-columns > .wp-block-column + .wp-block-column {
	position: relative;
	z-index: 1;
}

/* ---------- Tagline strip (between hero and Tech Gallery) ---------- */
.eb-tagline {
	background: #DED9D3;  /* match the bottom of the hero gradient seamlessly */
}
.eb-tagline p {
	font-size: clamp(1.5rem, 2.5vw, 2rem) !important;
	line-height: 1.15 !important;
	font-weight: 500;
	letter-spacing: 0.012em;
	color: #4A443D !important;
}

/* ---------- Section heading rhythm ---------- */
.wp-block-heading.has-h-xl-font-size,
.wp-block-heading.has-h-lg-font-size {
	letter-spacing: 0.01em;
	line-height: 1.28;
}

/* ---------- Tech Gallery cards ---------- */
.eb-tech-card {
	background: #ffffff;
	border-radius: 0;
	overflow: hidden;
	border: 1px solid #DED9D3;
}
.eb-tech-card .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

/* ---------- I NOSTRI VALORI dark band ---------- */
.eb-valori {
	background: #4A443D;
	color: #ffffff;
}
.eb-valori * { color: #ffffff !important; }
.eb-valori .has-accent-light-color { color: #DED9D3 !important; }

/* ---------- Crescere insieme: 6-card 2×3 grid ---------- */
.eb-crescere-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
}
.eb-crescere-grid > * {
	margin: 0 !important;
}
.eb-crescere-grid img {
	display: block;
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 16px;
}
@media (max-width: 900px) {
	.eb-crescere-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.eb-crescere-grid { grid-template-columns: 1fr; }
}

/* ---------- Recensioni cards: white background inside the dark band needs dark text ---------- */
.has-accent-dark-background-color .has-surface-background-color,
.has-accent-dark-background-color .has-surface-background-color * {
	color: var(--wp--preset--color--accent-dark) !important;
}
.has-accent-dark-background-color .has-surface-background-color .has-text-color {
	/* leave inline color overrides alone */
	color: inherit !important;
}

/* Partner-logo marquee ("Solide collaborazioni") — uniform logo height
   so mismatched source artwork lines up on one optical baseline. */
.eb-collab-strip .wp-block-group { gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
.eb-collab-logo { margin: 0 !important; flex: 0 0 auto; }
.eb-collab-logo img {
	height: 68px;
	width: auto;
	max-width: 200px;
	object-fit: contain;
}

/* ---------- Auto-marquee carousel ---------- */
/* Applied via the `is-style-eb-marquee` block style on a `core/group`.    */
.is-style-eb-marquee { overflow: hidden; }
.eb-marquee-track {
	display: flex !important;
	flex-wrap: nowrap !important;
	width: max-content !important;
	will-change: transform;
	animation-name: eb-marquee-loop !important;
	animation-timing-function: linear !important;
	animation-iteration-count: infinite !important;
	animation-duration: var(--eb-marquee-duration, 40s) !important;
}
@keyframes eb-marquee-loop {
	from { transform: translate3d(0, 0, 0); }
	to   { transform: translate3d(-50%, 0, 0); }
}
.is-style-eb-marquee:hover .eb-marquee-track {
	animation-play-state: paused !important;
}
@media (prefers-reduced-motion: reduce) {
	.eb-marquee-track { animation: none !important; transform: none !important; }
}

/* ---------- Google reviews carousel ----------
   Rendered by the [eb_google_reviews] shortcode. A user-scrollable strip
   of clickable review cards with prev/next arrows + a slow autoplay
   (assets/eb-reviews.js). Replaces the old fast CSS marquee.            */
.eb-reviews-rating-link {
	color: inherit;
	text-decoration: none;
}
.eb-reviews-rating-link:hover,
.eb-reviews-rating-link:focus-visible {
	text-decoration: underline;
}

.eb-reviews-carousel {
	position: relative;
	margin-top: var(--wp--preset--spacing--md);
}

.eb-rc-track {
	display: flex;
	gap: 1.5rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	/* Vertical padding leaves room for the card hover-lift + shadow. */
	padding: 1.25rem 0.25rem 1.5rem;
	scrollbar-width: none;          /* Firefox */
	cursor: grab;
}
.eb-rc-track::-webkit-scrollbar { display: none; } /* Chrome / Safari */
.eb-rc-track.is-dragging {
	cursor: grabbing;
	scroll-behavior: auto;
	scroll-snap-type: none;
}

.eb-review-card {
	flex: 0 0 clamp(258px, 78vw, 340px);
	scroll-snap-align: start;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: 0.7rem;
	min-height: 224px;
	padding: 1.75rem;
	border-radius: 16px;
	background: var(--wp--preset--color--surface, #faf7f2);
	color: #2b2622;
	text-decoration: none;
	transition: transform 220ms ease, box-shadow 220ms ease;
}
a.eb-review-card:hover,
a.eb-review-card:focus-visible {
	transform: translateY(-4px);
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32);
	outline: none;
}
.eb-review-stars {
	color: #f4b400;
	font-size: 0.95rem;
	letter-spacing: 0.12em;
}
.eb-review-text {
	flex: 1;
	font-size: 0.95rem;
	line-height: 1.6;
}
.eb-review-meta {
	font-size: 0.82rem;
	font-weight: 600;
	opacity: 0.6;
}

.eb-rc-arrow {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 3;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: var(--wp--preset--color--surface, #faf7f2);
	color: #2b2622;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(0, 0, 0, 0.4);
	transition: opacity 200ms ease, transform 200ms ease;
}
.eb-rc-arrow:hover { transform: translateY(-50%) scale(1.09); }
.eb-rc-arrow svg { width: 22px; height: 22px; display: block; }
.eb-rc-prev { left: 6px; }
.eb-rc-next { right: 6px; }
.eb-rc-arrow:disabled {
	opacity: 0;
	pointer-events: none;
}

/* ---------- Section vertical rhythm ----------
   Every full-width section in <main> gets generous, symmetric block padding
   so adjacent sections never feel glued together. This OVERRIDES the inline
   `xxxl` preset that the seed markup applies (the preset is fine for inner
   spacing but visually too tight as section padding on tall viewports).
   .eb-hero is excluded — its size is driven by min-height + a one-sided
   header-clearance padding rule above.                                      */
main .wp-block-group.alignfull:not(.eb-hero),
main .wp-block-cover.alignfull:not(.eb-hero) {
	padding-top: clamp(5rem, 10vh, 9rem) !important;
	padding-bottom: clamp(5rem, 10vh, 9rem) !important;
}
/* Tagline strip is intentionally taller than the rest — it acts as a beat
   between hero and content. Vertically center its 4 lines.                 */
.eb-tagline {
	min-height: 55vh;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

/* ---------- I NOSTRI VALORI: tabbed experience ----------
   Three tabs (TRASPARENZA / COMPETENZA / AFFIDABILITÀ) backed by
   `assets/eb-tabs.js`. Markup is plain core blocks (group + heading +
   columns) so the user keeps editing labels & content in the site editor;
   JS just toggles `is-active` on click and on keyboard navigation.  */
.eb-tabs-nav {
	display: flex !important;
	justify-content: center;
	flex-wrap: wrap;
	/* Gap shrinks proportionally on narrow viewports so the 3 labels can
	   sit on a single row at mobile widths. */
	gap: clamp(0.75rem, 3vw, 2.5rem);
}
.eb-tabs-nav .wp-block-heading {
	cursor: pointer;
	margin: 0 !important;
	padding: 0.75rem 0;
	/* Font + letter-spacing scale down on mobile so "TRASPARENZA / COMPETENZA
	   / AFFIDABILITÀ" all fit on one row at ~360 px viewports. Caps out at
	   the original 1 rem on desktop.                                       */
	font-size: clamp(0.75rem, 2vw, 1rem) !important;
	letter-spacing: clamp(0.05em, 0.8vw, 0.18em);
	font-weight: 700;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55) !important;
	border-bottom: 2px solid transparent;
	transition: color 200ms ease, border-color 200ms ease;
	user-select: none;
	white-space: nowrap;
}
.eb-tabs-nav .wp-block-heading:hover {
	color: #ffffff !important;
}
.eb-tabs-nav .wp-block-heading.is-active {
	color: #ffffff !important;
	border-bottom-color: #ffffff;
}
.eb-tab-panel {
	display: none;
	animation: eb-tab-fade 280ms ease;
}
.eb-tab-panel.is-active {
	display: block;
}
/* Cover-block-flavoured tab panels (the "text overlaid on photo" pattern)
   need their natural flex layout to preserve content-position alignment. */
.eb-tab-panel.wp-block-cover.is-active {
	display: flex;
}
/* Disable the parallax fixed-attachment on tab-panel covers — we use the
   parallax markup variant (div bg, no <img>) for clean validator output,
   but want the image to scroll with the section. */
.eb-tabs .eb-tab-panel .wp-block-cover__image-background {
	background-attachment: scroll !important;
}
@keyframes eb-tab-fade {
	from { opacity: 0; transform: translateY(8px); }
	to   { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
	.eb-tab-panel { animation: none; }
}

/* ---------- About-page sections ----------
   Cream sections sit edge-to-edge (no gap between them — `.alignfull`
   children of the post content already get `margin: 0`). The hero's
   `::after` gradient fades the photo into the cream below, just like
   the homepage hero pattern.                                            */
.eb-about-cream {
	color: var(--wp--preset--color--accent-dark);
}
/* Tile marquee (used on /about after the timeline). Inner flex group is
   picked up by the marquee runtime as the track. */
.eb-tile-marquee .wp-block-group { gap: 1rem; }
.eb-tile-marquee .wp-block-image {
	flex: 0 0 auto;
	width: clamp(180px, 22vw, 280px);
	margin: 0 !important;
}
.eb-tile-marquee .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

/* Tile row: 4 photos side by side at desktop, 2x2 at tablet, 1 col mobile */
.eb-tile-row {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1rem;
}
.eb-tile-row .wp-block-image { margin: 0 !important; }
.eb-tile-row .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 8px;
}
@media (max-width: 900px) {
	.eb-tile-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
	.eb-tile-row { grid-template-columns: 1fr; }
}

/* About-page secondary photo (between tile-row and Filosofia). Portrait
   orientation; cap height so it doesn't dominate the page. Width auto
   shrinks proportionally; img is centered.                             */
.eb-about-cream figure.aligncenter img[src*="about-secondary"] {
	max-width: 100%;
	max-height: 70vh;
	width: auto;
	height: auto;
}

/* Filosofia photo grid: 2 rows × 3 cols on desktop, 2 cols tablet, 1 mobile.
   Spans inside the dark accent band.                                    */
.eb-philo-grid {
	display: grid;
	grid-template-columns: repeat(6, 1fr);
	grid-auto-rows: clamp(160px, 22vw, 240px);
	grid-template-areas:
		"big big big big t1 t1"
		"big big big big t2 t2"
		"b1 b1 b2 b2 b3 b3";
	gap: 1rem;
}
.eb-philo-grid > :nth-child(1) { grid-area: big; }
.eb-philo-grid > :nth-child(2) { grid-area: t1; }
.eb-philo-grid > :nth-child(3) { grid-area: t2; }
.eb-philo-grid > :nth-child(4) { grid-area: b1; }
.eb-philo-grid > :nth-child(5) { grid-area: b2; }
.eb-philo-grid > :nth-child(6) { grid-area: b3; }
.eb-philo-grid .wp-block-image { margin: 0 !important; height: 100%; }
.eb-philo-grid .wp-block-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}
@media (max-width: 900px) {
	.eb-philo-grid {
		grid-template-columns: 1fr 1fr;
		grid-auto-rows: clamp(140px, 32vw, 220px);
		grid-template-areas:
			"big big"
			"t1 t2"
			"b1 b2"
			"b3 b3";
	}
}
@media (max-width: 480px) {
	.eb-philo-grid {
		grid-template-columns: 1fr;
		grid-template-areas:
			"big"
			"t1"
			"t2"
			"b1"
			"b2"
			"b3";
	}
}

/* Filosofia bullet list — center-aligned within the dark band. */
.eb-filosofia-list {
	max-width: 65ch;
	margin: var(--wp--preset--spacing--md) auto 0 !important;
	padding-left: 1.25rem;
	color: #ffffff;
}
.eb-filosofia-list li { margin-block: 0.4rem !important; }

/* Watermark on dark bg needs to be light not dark, and almost invisible. */
.eb-filosofia .eb-watermark,
.eb-tec-gallery .eb-watermark { color: #ffffff !important; opacity: 0.07; }

/* Stats counters row — 3 stats evenly distributed with vertical dividers. */
.eb-stats-row {
	display: flex;
	justify-content: space-evenly;
	align-items: center;
	gap: 0;
}
.eb-stats-row .eb-stat {
	margin: 0 !important;
	position: relative;
	flex: 0 0 auto;
	text-align: center;
}
.eb-stats-row .eb-stat + .eb-stat::before {
	content: "";
	position: absolute;
	top: 15%;
	bottom: 15%;
	/* Sit roughly halfway between this stat and the previous one — since
	   we use space-evenly, the gap to either side is identical. 4vw works
	   across viewport widths. */
	left: -4vw;
	width: 1px;
	background: var(--wp--preset--color--accent-dark);
	opacity: 0.35;
}
.eb-stats-row .eb-stat h3 {
	font-size: clamp(2.5rem, 6vw, 4rem) !important;
	line-height: 1 !important;
	margin: 0 !important;
}
.eb-stats-row .eb-stat p { margin-top: 0.5rem !important; }

/* CTA button on cream — make sure the button uses dark stroke (theme.json
   default is fine, but be explicit just in case).                        */
.eb-about-cta .wp-block-button__link {
	border-color: var(--wp--preset--color--accent-dark) !important;
	color: var(--wp--preset--color--accent-dark) !important;
}

/* ---------- Tecnologie page: tabs nav variant on cream bg ----------
   The default `.eb-tabs-nav` styling assumes the dark VALORI band on the
   homepage (white labels). When the same tabs sit on a cream band, flip
   the colors to dark.                                                    */
.eb-tabs-nav-dark .wp-block-heading {
	color: rgba(74, 68, 61, 0.55) !important;
	border-bottom-color: transparent;
}
.eb-tabs-nav-dark .wp-block-heading:hover {
	color: var(--wp--preset--color--accent-dark) !important;
}
.eb-tabs-nav-dark .wp-block-heading.is-active {
	color: var(--wp--preset--color--accent-dark) !important;
	border-bottom-color: var(--wp--preset--color--accent-dark);
}

/* ---------- Contatti page: search hero ----------
   Searchbar styled to look like a clean pill with a dark-accent button
   inside. WP's `core/search` block already gives the basic structure;
   we just override colors and shape.

   Top padding has to beat the global `main .alignfull { padding: 80px }`
   rule because the floating header pill (bottom at ~98 px) would otherwise
   cut into the H1. The Contatti page doesn't use a parallax `.eb-hero`
   cover, so this section is the FIRST alignfull child of <main> — it
   needs the same kind of header-clearance the hero gets via its 24 vh
   inner-container padding.                                              */
/* Selector specificity must match the global `main .wp-block-group.alignfull:not(.eb-hero)`
   rule (specificity 0,3,1) — bare `.eb-contatti-search` (0,1,0) loses
   even with !important. Adding the same compound prefix wins by being
   later in the source.                                                  */
main .wp-block-group.alignfull.eb-contatti-search:not(.eb-hero) {
	padding-top: clamp(10rem, 22vh, 16rem) !important;
}
.eb-contatti-searchbar {
	margin-top: var(--wp--preset--spacing--xxl) !important;
	margin-inline: auto !important;
	max-width: 720px !important;
}
.eb-contatti-searchbar .wp-block-search__inside-wrapper {
	border: 1px solid rgba(74, 68, 61, 0.15) !important;
	border-radius: 8px !important;
	background: #ffffff !important;
	overflow: hidden;
}
.eb-contatti-searchbar .wp-block-search__input {
	border: none !important;
	padding: 1.1rem 1.25rem !important;
	font-size: 1rem;
	background: transparent !important;
}
.eb-contatti-searchbar .wp-block-search__button {
	background: var(--wp--preset--color--accent-dark) !important;
	color: #ffffff !important;
	border: none !important;
	border-radius: 0 !important;
	padding: 0 2rem !important;
	font-weight: 600;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	font-size: 0.875rem;
}
.eb-contatti-searchbar .wp-block-search__button:hover {
	background: #000000 !important;
}

/* ---------- Help accordion (FAQ / Pagamenti / Assistenza) ----------
   Built from `core/details` blocks (HTML5 `<details>`/`<summary>`) so
   expand-collapse is native, accessible, and works without JS. Closed
   state is a row with the title + a `+` icon; open swaps the icon to
   `−` and reveals the content. Anchor IDs on each section let the footer
   deep-link straight into the right panel.                              */
.eb-help-accordion .eb-acc {
	border-top: 1px solid rgba(74, 68, 61, 0.2);
	margin: 0 auto !important;
	max-width: var(--eb-frame);
	padding: 0;
}
.eb-help-accordion .eb-acc:last-child {
	border-bottom: 1px solid rgba(74, 68, 61, 0.2);
}
.eb-help-accordion .eb-acc > summary {
	list-style: none;
	cursor: pointer;
	padding: 1.5rem 0;
	font-weight: 700;
	font-size: 1.125rem;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent-dark);
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	transition: color 200ms ease;
}
.eb-help-accordion .eb-acc > summary::-webkit-details-marker { display: none; }
.eb-help-accordion .eb-acc > summary::after {
	content: "+";
	font-size: 1.6rem;
	font-weight: 300;
	line-height: 1;
	width: 1.2em;
	height: 1.2em;
	display: inline-flex;
	justify-content: center;
	align-items: center;
	transition: transform 200ms ease;
	flex-shrink: 0;
}
.eb-help-accordion .eb-acc[open] > summary::after {
	content: "−";
}
.eb-help-accordion .eb-acc > summary:hover {
	color: rgba(74, 68, 61, 0.7);
}
/* Inner content of an open panel */
.eb-help-accordion .eb-acc[open] {
	padding-bottom: 1.5rem;
}
.eb-help-accordion .eb-acc h4 {
	color: var(--wp--preset--color--accent-dark) !important;
}
.eb-help-accordion .eb-acc p {
	color: var(--wp--preset--color--accent-dark);
	line-height: 1.6;
	max-width: 65ch;
}
.eb-help-accordion .eb-acc p a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* FAQ page: "no results" message — hidden until eb-faq.js shows it. */
.eb-faq-empty {
	display: none;
	color: var(--wp--preset--color--accent-dark);
	opacity: 0.75;
	margin-top: var(--wp--preset--spacing--lg) !important;
}

/* Contatti dark band: bordered contact-method cards with icons. */
.eb-contatti-cards {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
}
.eb-contatti-card {
	border: 1px solid rgba(255, 255, 255, 0.18);
	border-radius: 12px;
	padding: 2rem !important;
	margin: 0 !important;
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}
.eb-contatti-card-icon {
	color: #ffffff;
	margin-bottom: 0.5rem;
}
.eb-contatti-card h3 {
	margin: 0 !important;
}
.eb-contatti-card p {
	margin: 0 !important;
	color: rgba(255, 255, 255, 0.8) !important;
}
.eb-contatti-card a {
	color: #ffffff !important;
	text-decoration: underline;
	text-decoration-color: rgba(255, 255, 255, 0.4);
	text-underline-offset: 4px;
}
.eb-contatti-card a:hover {
	text-decoration-color: #ffffff;
}
@media (max-width: 900px) { .eb-contatti-cards { grid-template-columns: 1fr; } }

/* ---------- Contact Form 7 styling ----------
   Match the cream-band aesthetic. Two-column rows for compact layout.   */
.wpcf7 form { color: var(--wp--preset--color--accent-dark); }
.wpcf7 .eb-form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
@media (max-width: 600px) {
	.wpcf7 .eb-form-row { grid-template-columns: 1fr; }
}
.wpcf7 label {
	display: block;
	font-weight: 600;
	font-size: 0.875rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	margin-bottom: 1.25rem;
	color: var(--wp--preset--color--accent-dark);
}
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 input[type="tel"],
.wpcf7 textarea {
	display: block;
	width: 100%;
	margin-top: 0.5rem;
	padding: 0.85rem 1rem;
	font: inherit;
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: 0.012em;
	color: var(--wp--preset--color--accent-dark);
	background: #ffffff;
	border: 1px solid rgba(74, 68, 61, 0.18);
	border-radius: 8px;
	box-sizing: border-box;
	transition: border-color 200ms ease, box-shadow 200ms ease;
	text-transform: none;
}
.wpcf7 input::placeholder,
.wpcf7 textarea::placeholder {
	color: rgba(74, 68, 61, 0.5);
	font-weight: 400;
	letter-spacing: 0.012em;
	text-transform: none;
}
.wpcf7 input:focus,
.wpcf7 textarea:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent-dark);
	box-shadow: 0 0 0 3px rgba(74, 68, 61, 0.1);
}
.wpcf7 textarea { resize: vertical; min-height: 140px; }

.wpcf7 .eb-form-consent {
	margin: 1.5rem 0 !important;
}
.wpcf7 .eb-form-consent .wpcf7-list-item {
	margin: 0;
	display: block;
}
.wpcf7 .eb-form-consent label {
	display: flex !important;
	gap: 0.6rem;
	align-items: flex-start;
	font-weight: 400 !important;
	font-size: 0.875rem;
	letter-spacing: 0.012em;
	text-transform: none;
	cursor: pointer;
	margin: 0;
}
.wpcf7 .eb-form-consent input[type="checkbox"] {
	margin: 0.2rem 0 0 !important;
	flex-shrink: 0;
	accent-color: var(--wp--preset--color--accent-dark);
}

.wpcf7 .eb-form-submit,
.wpcf7 input[type="submit"] {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	margin: 1.5rem auto 0;
	padding: 1rem 2.5rem;
	background: var(--wp--preset--color--accent-dark);
	color: #ffffff;
	border: 3px solid var(--wp--preset--color--accent-dark);
	border-radius: 9999px;
	font-family: inherit;
	font-weight: 800;
	font-size: 1rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background 200ms ease, color 200ms ease;
}
.wpcf7 .eb-form-submit:hover {
	background: transparent;
	color: var(--wp--preset--color--accent-dark);
}

/* CF7 response messages — clean, theme-colored */
.wpcf7-response-output {
	margin-top: 1.25rem !important;
	padding: 0.85rem 1rem !important;
	border-radius: 8px;
	border-width: 1px !important;
	font-size: 0.9375rem;
}
.wpcf7-not-valid-tip {
	color: #b3261e;
	font-size: 0.8125rem;
	margin-top: 0.25rem;
	font-weight: 500;
	letter-spacing: 0.012em;
	text-transform: none;
}

/* ---------- Tecnologie page: 4 product cards on dark band ----------    */
.eb-tec-cards {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 1.5rem;
}
.eb-tec-card {
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--accent-dark);
	border-radius: 0;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	margin: 0 !important;
}
.eb-tec-card .wp-block-image { margin: 0 !important; }
.eb-tec-card .wp-block-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 10;
	object-fit: cover;
}
.eb-tec-card h4 {
	margin: 1rem 1rem 0.25rem !important;
	color: var(--wp--preset--color--accent-dark) !important;
}
.eb-tec-card p {
	margin: 0 1rem 1.25rem !important;
	color: var(--wp--preset--color--accent-dark) !important;
	opacity: 0.7;
}
@media (max-width: 900px) { .eb-tec-cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 540px) { .eb-tec-cards { grid-template-columns: 1fr; } }

/* ---------- Tech Gallery modals ----------
   Cards carry `.eb-modal-open`; `.eb-tec-modals` holds the hidden
   content blocks that eb-modal.js clones into the overlay.            */
.eb-tec-modals { display: none; }
.eb-tec-card.eb-modal-open {
	cursor: pointer;
	transition: transform 200ms ease, box-shadow 200ms ease;
}
.eb-tec-card.eb-modal-open:hover {
	transform: translateY(-4px);
	box-shadow: 0 14px 32px rgba(0, 0, 0, 0.28);
}
.eb-tec-card.eb-modal-open:focus-visible {
	outline: 2px solid var(--wp--preset--color--surface);
	outline-offset: 3px;
}
.eb-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--wp--preset--spacing--md);
	background: rgba(20, 18, 16, 0.82);
}
.eb-modal-overlay[hidden] { display: none; }
.eb-modal-dialog {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: 88vh;
	overflow-y: auto;
	background: var(--wp--preset--color--surface);
	color: var(--wp--preset--color--accent-dark);
	padding: clamp(1.5rem, 4vw, 3rem);
}
.eb-modal-close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	width: 2.5rem;
	height: 2.5rem;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--accent-dark);
	font-size: 1.75rem;
	line-height: 1;
	cursor: pointer;
}
.eb-modal-body .eb-tec-modal { display: block; }
.eb-modal-body video {
	display: block;
	width: 100%;
	height: auto;
}
.eb-modal-body h3 {
	margin: var(--wp--preset--spacing--md) 0 0 !important;
	text-transform: none;
	color: var(--wp--preset--color--accent-dark) !important;
}
.eb-modal-body p {
	margin: var(--wp--preset--spacing--sm) 0 0 !important;
	line-height: 1.6;
}
@media (prefers-reduced-motion: reduce) {
	.eb-tec-card.eb-modal-open { transition: none; }
	.eb-tec-card.eb-modal-open:hover { transform: none; }
}

/* ---------- About-page timeline ----------
   Markup is plain core blocks: an outer `.eb-timeline` group wraps N
   `.eb-timeline-item` children (each is an h3 year + h4 title + paragraph).

   Single layout, all aligned (no zigzag): left vertical rail with dot
   markers + content stacked to the right of the rail. Same on desktop
   and mobile — only spacing widens on desktop. The user keeps editing
   each milestone as plain blocks in the site editor.                    */
.eb-timeline {
	--rail-x: 0.6rem;
	--dot-size: 14px;
	position: relative;
	max-width: 720px;
	margin-inline: auto;
	padding-left: 2.5rem;
}
/* Rail segments live on the items so they naturally stop at the last one
   (no extra line past the final dot). One segment per item-except-last,
   running from just under its dot down to the next item's dot.           */
.eb-timeline-item {
	position: relative;
	margin-block-start: 0 !important;
	margin-block-end: 0 !important;
	padding-bottom: 2.5rem;
}
.eb-timeline-item:last-child { padding-bottom: 0; }
/* Dot. Centred on the rail line via the same --rail-x variable.          */
.eb-timeline-item::before {
	content: "";
	position: absolute;
	top: 0.6rem;
	left: calc(-1 * (2.5rem - var(--rail-x) + var(--dot-size) / 2));
	width: var(--dot-size);
	height: var(--dot-size);
	border-radius: 50%;
	background: var(--wp--preset--color--accent-dark);
}
/* Rail segment from this dot down to the next item's dot. Extended past
   item.bottom by 0.6rem so it meets the next item's dot (which is at
   top: 0.6rem of that item) — otherwise there's a visible gap above
   every dot except the first. Omitted on the last item so the line
   stops there.                                                           */
.eb-timeline-item:not(:last-child)::after {
	content: "";
	position: absolute;
	top: calc(0.6rem + var(--dot-size));
	bottom: -0.6rem;
	left: calc(-1 * (2.5rem - var(--rail-x) + 1px));
	width: 2px;
	background: var(--wp--preset--color--accent-dark);
	opacity: 0.18;
}
.eb-timeline-item .wp-block-heading.eb-timeline-year {
	margin: 0 0 0.25rem 0 !important;
	line-height: 1;
}
.eb-timeline-item h4 {
	margin: 0 0 0.5rem 0 !important;
}
.eb-timeline-item p {
	margin: 0 !important;
	max-width: 56ch;
}
@media (min-width: 768px) {
	.eb-timeline { padding-left: 3rem; }
	.eb-timeline-item { padding-bottom: 3rem; }
}

/* Image tiles inside marquee (used on the about page after the timeline,
   and reusable wherever a non-card photo strip is needed).             */
.eb-tile img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

/* ---------- Blog (templates/index.html + single.html) ----------
   Post grid on the index; single-post body sits at a 720px reading
   measure (set on the post-content block itself).                       */
.eb-blog-grid {
	gap: clamp(2rem, 4vw, 3.25rem) !important;
}
@media (max-width: 900px) {
	.eb-blog-grid { grid-template-columns: repeat(2, 1fr) !important; }
}
@media (max-width: 560px) {
	.eb-blog-grid { grid-template-columns: 1fr !important; }
}
.eb-blog-grid .wp-block-post-title {
	letter-spacing: 0.012em;
}
.eb-blog-grid .wp-block-post-title a {
	text-decoration: none;
}
.eb-blog-grid .wp-block-post-date {
	opacity: 0.6;
}
.eb-blog-grid .wp-block-post-excerpt {
	margin-top: 0.5rem;
	line-height: 1.55;
}
.eb-blog-grid .wp-block-post-excerpt__more-link {
	display: inline-block;
	margin-top: 0.6rem;
	font-weight: 600;
	text-underline-offset: 3px;
}
/* Single-post body: a touch more line-height for long-form reading. */
.eb-post-body p { line-height: 1.7; }
.eb-post-body > * { margin-top: var(--wp--preset--spacing--md); }
