/*
Theme Name: Truberries
Theme URI: https://www.truberries.com/
Author: Truberries
Author URI: https://www.truberries.com/
Description: Block theme in the Truberries brand: berry accents, Ubuntu typography, and ready-made homepage patterns (intro, truTOOLS, what we do, what makes us different, clients).
Requires at least: 6.6
Tested up to: 7.1
Requires PHP: 7.4
Version: 1.3.7
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: truberries
Tags: block-theme, full-site-editing, one-column, wide-blocks, custom-colors, editor-style, block-patterns
*/

html { scroll-behavior: smooth; }
:target { scroll-margin-top: 110px; }

/* Sections butt directly against each other, the header and the footer. */
.wp-site-blocks > * + * { margin-block-start: 0; }

/* ---------- Header ---------- */
.tru-header {
	position: sticky;
	top: 0;
	z-index: 100;
	border-bottom: 1px solid rgba(35, 35, 35, 0.08);
}
.admin-bar .tru-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .tru-header { top: 46px; } }

.tru-header .wp-block-navigation-item__content {
	padding: 0.6em 0.75em;
	transition: background-color .2s, color .2s;
}
.tru-header .wp-block-navigation > .wp-block-navigation__container > .wp-block-navigation-item > .wp-block-navigation-item__content:hover {
	background: var(--wp--preset--color--berry);
	color: var(--wp--preset--color--white);
}
.tru-header .wp-block-navigation__submenu-container {
	border: 0 !important;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
	text-transform: none;
	letter-spacing: 0.02em;
	font-weight: 400;
}
.tru-header .wp-block-navigation__submenu-container .wp-block-navigation-item__content:hover {
	color: var(--wp--preset--color--berry);
}
.tru-header .wp-block-social-links { gap: 0.6em; }

/* ---------- Section titles: uppercase berry, as on truberries.com ---------- */
.tru-title {
	color: var(--wp--preset--color--berry) !important;
	text-transform: uppercase;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.02em;
}

/* ---------- Hero ---------- */
.tru-hero {
	position: relative;
	overflow: hidden;
}
.tru-hero::before,
.tru-hero::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	height: 65px;
	pointer-events: none;
}
/* White wedge at the top: the grey starts higher on the right. */
.tru-hero::before {
	top: 0;
	background: var(--wp--preset--color--white);
	clip-path: polygon(0 0, 100% 0, 0 100%);
}
/* Silver wedge at the bottom, flowing into the truTOOLS band. */
.tru-hero::after {
	bottom: 0;
	background: var(--wp--preset--color--silver);
	clip-path: polygon(0 100%, 100% 0, 100% 100%);
}
.tru-hero > * { position: relative; z-index: 1; }

.tru-vertical-label {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	white-space: nowrap;
	margin: 0 auto;
}
.tru-badges img { max-width: 120px; height: auto; }
.tru-badges .wp-block-image { margin: 0; }
.tru-hero-subtitle { letter-spacing: 0.08em; }

/* Below 1100px the three hero columns are too cramped: stack map, text, then label + badges. */
@media (max-width: 1100px) {
	.tru-hero > .wp-block-columns { flex-wrap: wrap !important; }
	.tru-hero > .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
	.tru-hero > .wp-block-columns > .wp-block-column:nth-child(3) { max-width: 760px; margin-inline: auto; }
	.tru-hero-aside { order: 3; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 1rem 2rem; }
	.tru-vertical-label { writing-mode: horizontal-tb; transform: none; text-align: center; margin: 0; }
	.tru-badges { flex-direction: row !important; justify-content: center; align-items: center; flex-wrap: wrap; margin-top: 0 !important; }
	.tru-badges img { max-width: 90px; }
}

/* ---------- truTOOLS ---------- */
.tru-chevron {
	display: block;
	width: 34px;
	height: 34px;
	margin: 0 auto;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg) scaleY(.6);
}

/* ---------- What we do: V-shaped bottom edge ---------- */
.tru-v-bottom {
	clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), 50% 100%, 0 calc(100% - 40px));
}
.tru-what-grid .tru-what-item img { width: 60px; height: 60px; }
.tru-what-grid .tru-what-item .wp-block-image { margin: 0 auto 0.75rem; }
.tru-what-grid .tru-what-item p { font-size: 0.95rem; line-height: 1.35; }

/* ---------- Berry slanted banner ---------- */
.tru-slant {
	clip-path: polygon(0 45px, 100% 0, 100% calc(100% - 45px), 0 100%);
}

/* ---------- Clients: logo carousel (one logo per step, like the original Owl carousel) ---------- */
.tru-carousel {
	--tru-carousel-items: 2;
	--tru-carousel-gap: 20px;
	max-width: 1170px;
	margin-inline: auto;
	overflow: hidden;
}
@media (min-width: 480px) { .tru-carousel { --tru-carousel-items: 3; } }
@media (min-width: 700px) { .tru-carousel { --tru-carousel-items: 4; } }
@media (min-width: 1000px) { .tru-carousel { --tru-carousel-items: 5; } }
.tru-carousel__track {
	display: flex;
	gap: var(--tru-carousel-gap);
	touch-action: pan-y;
	user-select: none;
	-webkit-user-select: none;
	cursor: grab;
}
.tru-carousel.is-dragging .tru-carousel__track { cursor: grabbing; }
.tru-carousel__item {
	flex: 0 0 calc((100% - (var(--tru-carousel-items) - 1) * var(--tru-carousel-gap)) / var(--tru-carousel-items));
	display: block;
	transition: opacity .35s ease-in-out;
}
.tru-carousel__item:hover,
.tru-carousel__item:focus-visible { opacity: .6; }
.tru-carousel__item img {
	display: block;
	width: 100%;
	height: auto;
}

/* ---------- Footer ---------- */
.tru-footer a { color: inherit; }
.tru-footer a:hover { color: var(--wp--preset--color--white); }

/* ---------- Global experience map ---------- */
.jvm-tooltip {
	font-family: var(--wp--preset--font-family--ubuntu);
	background: var(--wp--preset--color--ink);
	border-radius: 0;
	padding: 4px 10px;
	font-size: 13px;
	/* The tooltip lives on <body>; stay above the hero's z-index:1 children and the sticky header. */
	z-index: 1000;
	pointer-events: none;
}
.tru-world-map__canvas {
	width: 100%;
	aspect-ratio: 900 / 441;
	max-height: var(--tru-map-max, 700px);
	min-height: 0;
	position: relative;
	overflow: hidden;
}
/* Keep the drawn map out of layout so the box follows the aspect ratio on resize. */
.tru-world-map__canvas > svg { position: absolute; inset: 0; }

/* ---------- Generic: berry underline for titles on inner templates ---------- */
.tru-title-bar::after {
	content: "";
	display: block;
	width: 60px;
	height: 3px;
	margin-top: 0.6em;
	background: var(--wp--preset--color--berry);
}
.has-text-align-center.tru-title-bar::after { margin-left: auto; margin-right: auto; }
@media (max-width: 600px) {
	.tru-header .wp-block-social-links { display: none; }
}

/* Small uppercase label above contact details. */
.tru-eyebrow { text-transform: uppercase; letter-spacing: 0.15em; }

/* ---------- Inner pages ---------- */
.tru-page-banner .wp-block-post-title { letter-spacing: 0.04em; margin-bottom: 0.25em; }
.tru-banner-subtitle { letter-spacing: 0.12em; font-size: 0.95rem; max-width: 46rem; margin-inline: auto; }

.tru-page-content h2.wp-block-heading { color: var(--wp--preset--color--berry); font-size: clamp(1.5rem, 3vw, 2rem); }
.tru-page-content h3.wp-block-heading { font-size: 1.25rem; }
.tru-page-content ul li::marker { color: var(--wp--preset--color--berry); }
.tru-page-content figure.wp-block-image img { height: auto; }

/* Accordions (core/details): Services, Path pages, Our Story. */
.tru-page-content .wp-block-details {
	border-bottom: 1px solid #e3e3e5;
	padding: 0.85rem 0;
	margin: 0;
}
.tru-page-content .wp-block-details summary {
	color: var(--wp--preset--color--berry);
	font-weight: 500;
	cursor: pointer;
	list-style: none;
	position: relative;
	padding-right: 1.75rem;
}
.tru-page-content .wp-block-details summary::-webkit-details-marker { display: none; }
.tru-page-content .wp-block-details summary::after {
	content: "";
	position: absolute;
	right: 0.3rem;
	top: 0.35em;
	width: 0.55em;
	height: 0.55em;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .2s;
}
.tru-page-content .wp-block-details[open] summary::after { transform: rotate(-135deg); }
.tru-page-content .wp-block-details > :not(summary) { margin-top: 0.75rem; }

/* Cards and tiles. */
.tru-card {
	background: var(--wp--preset--color--mist);
	border-radius: 6px;
	height: 100%;
}
.tru-card-dark {
	background: #5a5a5c;
	color: #fff;
	border-radius: 6px;
}
.tru-card-dark :where(h2, h3, h4) { color: #fff !important; }
.tru-icon-60 img { width: 60px; height: 60px; object-fit: contain; }
.tru-icon-80 img { width: 80px; height: 80px; object-fit: contain; }

/* Testimonials. */
.tru-quote {
	border-left: 3px solid var(--wp--preset--color--berry);
	padding-left: 1.25rem;
	font-style: italic;
	color: #555;
	margin: 0 0 2rem;
}
.tru-quote cite {
	display: block;
	margin-top: 0.75rem;
	font-style: normal;
	font-weight: 700;
	font-size: 0.9rem;
	color: var(--wp--preset--color--berry);
}

/* Colour logo wall (Clients page). */
.tru-logo-wall .wp-block-image {
	display: flex;
	align-items: center;
	justify-content: center;
	aspect-ratio: 3 / 2;
	margin: 0;
	padding: 0.75rem;
	border: 1px solid #ececee;
	background: #fff;
}
.tru-logo-wall img { max-height: 70px; width: auto; max-width: 100%; object-fit: contain; }

/* Trend report covers (TRUtrends). */
.tru-trend img { aspect-ratio: 3 / 4; object-fit: cover; width: 100%; box-shadow: 0 2px 10px rgba(0,0,0,.08); }

/* Big numbers (ADD benefits). */
.tru-num { color: var(--wp--preset--color--berry); font-size: 2.4rem; font-weight: 700; line-height: 1; margin-bottom: 0.25rem; }

/* Mission & Vision photo grid. */
.tru-mv-grid > * { margin: 0 !important; aspect-ratio: 4 / 3; border-radius: 6px; overflow: hidden; }
.tru-mv-grid .wp-block-image img { width: 100%; height: 100%; object-fit: cover; }
.tru-mv-card { display: flex; flex-direction: column; justify-content: center; }
@media (max-width: 781px) { .tru-mv-blank { display: none; } }

/* "Let us Guide you" band on Services. */
.tru-band-title { color: #fff; font-size: 1.5rem; font-weight: 700; margin: 0; }

/* Path-to-Growth tile labels: "GAIN" dark, "ATTENTION" berry. */
.tru-two-tone a { color: var(--wp--preset--color--ink); }
.tru-two-tone strong { color: var(--wp--preset--color--berry); }
.tru-page-content h3 a { color: inherit; }
.tru-page-content h3.tru-eyebrow { font-size: 0.95rem; }
