/*
 * Tothiq Folio — layout and details theme.json cannot express.
 * Colours, type and spacing come from theme.json tokens; this file arranges
 * the sidebar and the sections. Every rule is keyed to a class the patterns
 * and templates set, so pages the owner builds are not affected.
 */

/* ---------- Base ---------- */

:root {
	--tothiq-side: 320px;
	--tothiq-radius: 18px;
	--tothiq-bar: var(--wp-admin--admin-bar--height, 0px);
}

body {
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

body .wp-site-blocks > * {
	margin-block: 0;
}

:where(h1, h2, h3) {
	text-wrap: balance;
}

.tothiq-ltr-number {
	direction: ltr;
	unicode-bidi: isolate;
	white-space: nowrap;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 3px;
	border-radius: 3px;
}

::selection {
	background: rgb(180 83 42 / 0.16);
}

/* Arabic: taller lines, no negative tracking, no uppercase. */
.is-arabic,
.tothiq-lang-ar {
	line-height: 1.9;
}

.is-arabic :is(h1, h2, h3),
.tothiq-lang-ar :is(h1, h2, h3) {
	line-height: 1.45;
	letter-spacing: 0;
}

mark.has-accent-color {
	background: none;
	color: var(--wp--preset--color--accent);
}

/* ---------- The shell: sidebar beside the content ---------- */

.tothiq-shell {
	display: grid;
	grid-template-columns: var(--tothiq-side) minmax(0, 1fr);
	min-height: 100vh;
}

.tothiq-shell > * {
	margin: 0 !important;
}

.tothiq-shell__side {
	background: var(--wp--preset--color--surface);
	border-inline-end: 1px solid var(--wp--preset--color--divider);
}

.tothiq-shell__main {
	width: 100%;
	max-width: 1040px;
	padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.75rem, 6vw, 6rem) 2rem;
}

.tothiq-shell__main > * {
	margin-block: 0;
}

/* ---------- Sidebar ---------- */

.tothiq-side {
	position: sticky;
	top: var(--tothiq-bar);
	display: flex;
	flex-direction: column;
	gap: 1.2rem;
	max-height: calc(100vh - var(--tothiq-bar));
	overflow-y: auto;
	padding: 2rem 1.75rem;
	scrollbar-width: thin;
}

.tothiq-side > * {
	margin: 0 !important;
}

.tothiq-side__photo img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 15 / 16;
	object-fit: cover;
	border-radius: var(--tothiq-radius);
	background: var(--wp--preset--color--soft);
}

.tothiq-side__who > * {
	margin: 0;
}

.tothiq-side__name {
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.3;
}

.tothiq-side__role {
	margin-top: 0.25rem !important;
	color: var(--wp--preset--color--muted);
	font-size: 0.9375rem;
	line-height: 1.5;
}

.tothiq-side__city {
	margin-top: 0.4rem !important;
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 600;
}

.tothiq-lang-switch:empty {
	display: none;
}

.tothiq-lang-switch {
	position: absolute;
	top: 2.6rem;
	inset-inline-end: 2.35rem;
	font-size: 0.8125rem;
}

.tothiq-lang-switch a {
	background: var(--wp--preset--color--surface);
}

.tothiq-lang-switch a {
	display: inline-block;
	padding: 0.2rem 0.8rem;
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: 99px;
	color: var(--wp--preset--color--ink);
	font-weight: 600;
	text-decoration: none;
}

.tothiq-lang-switch a:hover {
	border-color: var(--wp--preset--color--ink);
}

/* Section links */
.tothiq-side__nav {
	padding-top: 0.9rem;
	border-top: 1px solid var(--wp--preset--color--divider);
}

/* WordPress repeats the navigation's class on its list. */
.tothiq-side__nav .tothiq-side__nav {
	padding-top: 0;
	border-top: 0;
}

.tothiq-side__nav .wp-block-navigation__container {
	width: 100%;
	gap: 0.15rem;
}

.tothiq-side__nav .wp-block-navigation-item {
	width: 100%;
}

.tothiq-side__nav .wp-block-navigation-item__content {
	display: flex !important;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	padding: 0.45rem 0.75rem !important;
	border-radius: 10px;
	color: var(--wp--preset--color--muted) !important;
	font-size: 0.9375rem;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.tothiq-side__nav .wp-block-navigation-item__content::before {
	content: "";
	flex: none;
	width: 14px;
	height: 2px;
	background: var(--wp--preset--color--divider);
	transition: width 0.2s ease, background-color 0.2s ease;
}

.tothiq-side__nav .wp-block-navigation-item__content:hover,
.tothiq-side__nav .is-current > .wp-block-navigation-item__content {
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--ink) !important;
}

.tothiq-side__nav .is-current > .wp-block-navigation-item__content::before {
	width: 22px;
	background: var(--wp--preset--color--accent);
}

/* Social profiles: round icon links, each named for screen readers. */
.tothiq-socials:empty {
	display: none;
}

.tothiq-socials {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	line-height: 1;
}

.tothiq-social {
	position: relative;
	display: inline-block;
	width: 38px;
	height: 38px;
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: 50%;
	overflow: hidden;
	color: transparent !important;
	font-size: 0;
	transition: border-color 0.15s ease;
}

.tothiq-social::before {
	content: "";
	position: absolute;
	inset: 0;
	margin: auto;
	width: 18px;
	height: 18px;
	background: var(--wp--preset--color--ink);
	-webkit-mask: center / contain no-repeat;
	mask: center / contain no-repeat;
}

.tothiq-social:hover {
	border-color: var(--wp--preset--color--ink);
}

.tothiq-social--linkedin::before { -webkit-mask-image: url(icons/linkedin.svg); mask-image: url(icons/linkedin.svg); }
.tothiq-social--x::before { -webkit-mask-image: url(icons/x.svg); mask-image: url(icons/x.svg); }
.tothiq-social--instagram::before { -webkit-mask-image: url(icons/instagram.svg); mask-image: url(icons/instagram.svg); }
.tothiq-social--youtube::before { -webkit-mask-image: url(icons/youtube.svg); mask-image: url(icons/youtube.svg); }

/* ---------- Buttons ---------- */

.tothiq-side__actions,
.tothiq-cta__actions {
	flex-wrap: nowrap !important;
	gap: 0.6rem !important;
}

.tothiq-side__actions .wp-block-button {
	flex: 1;
}

.tothiq-side__actions .wp-block-button__link {
	width: 100%;
}

.tothiq-btn .wp-block-button__link {
	white-space: nowrap;
	transition: background-color 0.18s ease, color 0.18s ease;
}

.tothiq-btn--dark .wp-block-button__link {
	background: var(--wp--preset--color--ink) !important;
	color: #fff !important;
}

.tothiq-btn--dark .wp-block-button__link:hover {
	background: var(--wp--preset--color--contrast-hover) !important;
}

.tothiq-btn--primary .wp-block-button__link {
	background: var(--wp--preset--color--accent) !important;
	color: #fff !important;
}

.tothiq-btn--primary .wp-block-button__link:hover {
	background: var(--wp--preset--color--accent-dark) !important;
}

.tothiq-btn--whatsapp .wp-block-button__link {
	background: var(--wp--preset--color--whatsapp) !important;
	color: #fff !important;
}

.tothiq-btn--whatsapp .wp-block-button__link:hover {
	background: #0e7468 !important;
}

.tothiq-btn--ghost .wp-block-button__link {
	background: transparent !important;
	color: var(--wp--preset--color--ink) !important;
	border-color: var(--wp--preset--color--divider) !important;
}

/* ---------- Sections ---------- */

.tothiq-section {
	padding-block: 2.75rem;
	border-bottom: 1px solid var(--wp--preset--color--divider);
}

.tothiq-section > * {
	margin-block: 0;
}

.tothiq-section h2 {
	margin-block-end: 1.6rem !important;
}

.tothiq-eyebrow {
	margin: 0 0 0.75rem !important;
	color: var(--wp--preset--color--accent);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.is-arabic .tothiq-eyebrow,
.tothiq-lang-ar .tothiq-eyebrow {
	font-size: 0.9375rem;
	letter-spacing: 0;
}

.tothiq-muted {
	color: var(--wp--preset--color--muted);
}

.tothiq-lead {
	max-width: 42rem;
	margin-block: 1.25rem 2rem !important;
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--large);
}

/* Introduction */
.tothiq-intro {
	padding-top: 0;
}

.tothiq-intro__title {
	max-width: 48rem;
	letter-spacing: -0.02em;
}

.tothiq-stats {
	display: flex;
	flex-wrap: wrap;
	gap: 1.5rem 2.75rem;
}

.tothiq-stats > *,
.tothiq-stat > * {
	margin: 0 !important;
}

.tothiq-stat__number {
	font-size: 2.125rem;
	font-weight: 600;
	line-height: 1.1;
}

.tothiq-stat__label {
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
}

/* Services: numbered, two columns */
.tothiq-services__list {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0 2.5rem;
}

.tothiq-services__list > * {
	margin: 0 !important;
}

.tothiq-service {
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 0.25rem 1.1rem;
	padding-block: 1.25rem;
	border-top: 1px solid var(--wp--preset--color--divider);
}

.tothiq-service > * {
	margin: 0 !important;
}

.tothiq-service__number {
	grid-row: span 2;
	padding-top: 0.2rem;
	color: var(--wp--preset--color--accent);
	font-size: 0.875rem;
	font-weight: 600;
}

.tothiq-service h3,
.tothiq-card h3,
.tothiq-role h3 {
	font-size: 1.1875rem;
	letter-spacing: 0;
}

/* Cards: work and reviews */
.tothiq-cards {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.tothiq-cards > *,
.tothiq-card > * {
	margin: 0 !important;
}

.tothiq-card {
	padding: 1.5rem;
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: var(--tothiq-radius);
	background: var(--wp--preset--color--surface);
}

.tothiq-card__client {
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
}

.tothiq-card h3 {
	margin-block: 0.25rem 1.1rem !important;
}

.tothiq-card__number {
	color: var(--wp--preset--color--accent);
	font-size: 2.25rem;
	font-weight: 600;
	line-height: 1;
}

.tothiq-card .tothiq-muted {
	margin-top: 0.35rem !important;
	font-size: 0.875rem;
}

.tothiq-quote__text {
	margin-bottom: 1rem !important;
	font-size: 1.0625rem;
}

.tothiq-quote__by {
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
	line-height: 1.5;
}

.tothiq-quote__by strong {
	color: var(--wp--preset--color--ink);
	font-size: 1rem;
}

/* Experience timeline */
.tothiq-timeline > * {
	margin: 0 !important;
}

.tothiq-role {
	display: grid;
	grid-template-columns: 150px 1fr;
	gap: 1.5rem;
	padding-block: 1.1rem;
	border-top: 1px solid var(--wp--preset--color--divider);
}

.tothiq-role > *,
.tothiq-role__text > * {
	margin: 0 !important;
}

.tothiq-role__years {
	padding-top: 0.15rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.875rem;
}

.tothiq-role__text .tothiq-muted {
	margin-top: 0.25rem !important;
}

/* Closing card */
.tothiq-cta {
	margin-top: 2.75rem !important;
	padding: clamp(1.75rem, 4vw, 2.75rem);
	border: 0;
	border-radius: 22px;
}

.tothiq-cta h2 {
	margin-bottom: 0.5rem !important;
}

.tothiq-cta__text {
	margin: 0 0 1.5rem !important;
	color: #c9c2b8;
}

.tothiq-cta__actions .wp-block-button__link {
	min-width: 11rem;
}

/* ---------- Footer ---------- */

.tothiq-footer {
	padding-block: 1.75rem;
	color: var(--wp--preset--color--muted);
	font-size: 0.8125rem;
}

.tothiq-footer p {
	margin: 0;
}

.tothiq-footer a {
	color: inherit;
}

/* ---------- Inner pages ---------- */

.tothiq-page > .wp-block-post-title,
.tothiq-page > .wp-block-query-title {
	margin-bottom: 1.5rem;
}

.tothiq-page > * {
	max-width: 46rem;
}

.tothiq-page :where(input[type="text"], input[type="email"], input[type="url"], input[type="search"], textarea) {
	width: 100%;
	padding: 0.7rem 0.9rem;
	border: 1px solid var(--wp--preset--color--divider);
	border-radius: 10px;
	background: var(--wp--preset--color--surface);
	font: inherit;
}

.tothiq-page :where(input, textarea):focus {
	border-color: var(--wp--preset--color--ink);
	outline: none;
}

.tothiq-posts .wp-block-post {
	padding-block: 1.5rem;
	border-bottom: 1px solid var(--wp--preset--color--divider);
}

.tothiq-posts .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.tothiq-posts .wp-block-post-title a:hover {
	color: var(--wp--preset--color--accent);
}

/* Short laptop screens: a smaller photo so the section links stay in view. */
@media (min-width: 861px) and (max-height: 860px) {
	.tothiq-side {
		gap: 0.9rem;
		padding-block: 1.25rem;
	}

	.tothiq-side__photo img {
		width: auto;
		max-width: 100%;
		height: clamp(110px, 24vh, 220px);
		aspect-ratio: 15 / 16;
	}

	.tothiq-lang-switch {
		top: 1.75rem;
	}

	.tothiq-side__nav {
		padding-top: 0.6rem;
	}

	.tothiq-side__nav .wp-block-navigation-item__content {
		padding-block: 0.3rem !important;
	}
}

/* ---------- Phones and tablets: the sidebar becomes a compact header ---------- */

@media (max-width: 860px) {
	.tothiq-shell {
		display: block;
	}

	.tothiq-shell__side {
		border-inline-end: 0;
		border-bottom: 1px solid var(--wp--preset--color--divider);
	}

	.tothiq-side {
		position: relative;
		top: auto;
		display: grid;
		grid-template-columns: 84px 1fr;
		align-items: center;
		gap: 1rem;
		max-height: none;
		overflow: visible;
		padding: 1.25rem;
	}

	.tothiq-side__photo img {
		width: 84px;
		height: 84px;
		aspect-ratio: auto;
		border-radius: 50%;
	}

	.tothiq-side__who {
		padding-inline-end: 4.25rem;
	}

	.tothiq-side__name {
		font-size: 1.1875rem;
	}

	.tothiq-side__nav,
	.tothiq-socials,
	.tothiq-side__actions {
		grid-column: 1 / -1;
	}

	.tothiq-lang-switch {
		top: 1.25rem;
		inset-inline-end: 1.25rem;
	}

	.tothiq-side__nav {
		padding-top: 0;
		border-top: 0;
		overflow-x: auto;
		scrollbar-width: none;
	}

	.tothiq-side__nav .wp-block-navigation__container {
		flex-direction: row !important;
		flex-wrap: nowrap !important;
		gap: 0.35rem;
		width: max-content;
	}

	.tothiq-side__nav .wp-block-navigation-item {
		width: auto;
	}

	.tothiq-side__nav .wp-block-navigation-item__content {
		padding: 0.45rem 0.9rem !important;
		border-radius: 99px;
		background: var(--wp--preset--color--base);
		white-space: nowrap;
	}

	.tothiq-side__nav .wp-block-navigation-item__content::before {
		display: none;
	}

	.tothiq-side__nav .is-current > .wp-block-navigation-item__content {
		background: var(--wp--preset--color--ink);
		color: #fff !important;
	}

	.tothiq-shell__main {
		padding: 2.25rem 1.25rem 1rem;
	}

	.tothiq-services__list,
	.tothiq-cards {
		grid-template-columns: 1fr;
	}

	.tothiq-role {
		grid-template-columns: 1fr;
		gap: 0.25rem;
	}

	.tothiq-stats {
		gap: 1rem 1.5rem;
	}

	.tothiq-stat__number {
		font-size: 1.625rem;
	}

	.tothiq-footer {
		flex-direction: column;
		align-items: flex-start !important;
		gap: 0.25rem;
	}
}

@media (max-width: 420px) {
	.tothiq-cta__actions {
		flex-wrap: wrap !important;
	}

	.tothiq-cta__actions .wp-block-button,
	.tothiq-cta__actions .wp-block-button__link {
		width: 100%;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tothiq-side__nav .wp-block-navigation-item__content,
	.tothiq-side__nav .wp-block-navigation-item__content::before {
		transition: none;
	}
}
