/*
Theme Name: Bankers BPO
Description: Multilingual tool site theme with dark/light toggle, language dropdown, interlinked tools and guides.
Author: Site Owner
Version: 2.0.8
License: GPL-2.0-or-later
Text Domain: bankersbpo
*/

/* Tokens. Swap the brand values per site; keep both dark blocks in sync. */
:root {
	--brand: #0e3a5f;
	--brand-strong: #0b2d4a;
	--brand-soft: #e8eff6;
	--accent: #c08a2e;
	--on-brand: #ffffff;
	--hero-from: #0b2d4a;
	--hero-to: #145283;
	--bg: #f3f5f8;
	--surface: #ffffff;
	--text: #10223a;
	--muted: #5a6880;
	--border: #dfe4ec;
	--radius: 16px;
	--radius-sm: 12px;
	--shadow: 0 1px 2px rgba(15, 31, 58, 0.05), 0 10px 28px rgba(15, 31, 58, 0.08);
	--max: 1120px;
	color-scheme: light;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--brand: #7fb3e6;
		--brand-strong: #a9cdf2;
		--brand-soft: #15283d;
		--accent: #e0b05a;
		--on-brand: #061627;
		--hero-from: #09182a;
		--hero-to: #0e2b47;
		--bg: #0b1420;
		--surface: #121e2e;
		--text: #e6edf5;
		--muted: #9aaac0;
		--border: #223449;
		--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--brand: #7fb3e6;
	--brand-strong: #a9cdf2;
	--brand-soft: #15283d;
	--accent: #e0b05a;
	--on-brand: #061627;
	--hero-from: #09182a;
	--hero-to: #0e2b47;
	--bg: #0b1420;
	--surface: #121e2e;
	--text: #e6edf5;
	--muted: #9aaac0;
	--border: #223449;
	--shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 10px 28px rgba(0, 0, 0, 0.35);
	color-scheme: dark;
}

/* Base. Logical properties throughout so RTL languages lay out correctly. */
*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Noto Sans Devanagari", "Noto Sans Arabic", "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.65;
}

img {
	max-width: 100%;
	height: auto;
}

a {
	color: var(--brand-strong);
}

h1,
h2,
h3 {
	line-height: 1.25;
	margin: 0 0 0.6em;
}

h1 { font-size: clamp(1.9rem, 4.5vw, 2.8rem); }
h2 { font-size: clamp(1.4rem, 3.2vw, 1.85rem); }
h3 { font-size: 1.1rem; }

p {
	margin: 0 0 1em;
}

.container {
	width: min(100% - 2rem, var(--max));
	margin-inline: auto;
}

.skip-link {
	position: absolute;
	inset-inline-start: -9999px;
}

.skip-link:focus {
	inset-inline-start: 1rem;
	top: 1rem;
	z-index: 100;
	background: var(--surface);
	padding: 0.5rem 1rem;
}

:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 2px;
}

/* Header */
.site-header {
	background: var(--surface);
	border-block-end: 1px solid var(--border);
	position: sticky;
	top: 0;
	z-index: 50;
}

.site-header .container {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	min-height: 64px;
}

.site-brand {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 800;
	font-size: 1.2rem;
	color: var(--text);
	text-decoration: none;
	white-space: nowrap;
}

.site-brand__logo {
	width: 36px;
	height: 36px;
	object-fit: contain;
}

.main-nav {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex: 1;
	min-width: 0;
}

.main-nav ul {
	display: flex;
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.main-nav a,
.mega summary {
	color: var(--muted);
	text-decoration: none;
	font-weight: 500;
	white-space: nowrap;
}

.main-nav a:hover,
.main-nav .current-menu-item > a,
.mega summary:hover {
	color: var(--text);
}

.chevron {
	transition: transform 0.15s;
}

details[open] > summary .chevron {
	transform: rotate(180deg);
}

/* Tools mega menu */
.mega {
	position: relative;
}

.mega summary {
	display: inline-flex;
	align-items: center;
	gap: 0.3rem;
	cursor: pointer;
	list-style: none;
}

.mega summary::-webkit-details-marker,
.lang-switch summary::-webkit-details-marker {
	display: none;
}

.mega__panel {
	position: absolute;
	inset-inline-start: 0;
	top: calc(100% + 14px);
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 1rem 1.5rem;
	width: min(760px, calc(100vw - 2rem));
	max-height: 75vh;
	overflow-y: auto;
	padding: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.mega__title {
	margin: 0 0 0.4rem;
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted);
}

.mega__panel ul {
	display: block;
}

.mega__panel li a {
	display: block;
	padding: 0.3rem 0;
	color: var(--text);
}

.mega__panel li a:hover,
.mega__panel li a[aria-current] {
	color: var(--brand-strong);
}

.mega__all {
	grid-column: 1 / -1;
	font-weight: 600;
	color: var(--brand-strong) !important;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-inline-start: auto;
}

/* Theme switch: light / dark / system */
.theme-switch {
	display: inline-flex;
	padding: 3px;
	gap: 2px;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--bg);
}

.theme-switch button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 32px;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: var(--muted);
	cursor: pointer;
}

.theme-switch button:hover {
	color: var(--text);
}

.theme-switch button[aria-pressed="true"] {
	background: var(--surface);
	color: var(--brand-strong);
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

/* Language dropdown and menu button */
.lang-switch {
	position: relative;
}

.lang-switch summary,
.nav-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	min-width: 40px;
	height: 40px;
	padding-inline: 0.65rem;
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	cursor: pointer;
	font: inherit;
	font-size: 0.85rem;
	font-weight: 600;
	list-style: none;
}

.lang-switch summary:hover,
.nav-toggle:hover {
	border-color: var(--brand);
}

.lang-switch img,
.footer-langs img {
	width: 18px;
	height: auto;
	border-radius: 2px;
	vertical-align: middle;
}

.lang-switch ul {
	position: absolute;
	inset-inline-end: 0;
	top: calc(100% + 6px);
	min-width: 190px;
	max-height: 70vh;
	overflow-y: auto;
	margin: 0;
	padding: 0.35rem;
	list-style: none;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	box-shadow: var(--shadow);
	z-index: 60;
}

.lang-switch a {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	padding: 0.5rem 0.75rem;
	border-radius: 8px;
	color: var(--text);
	text-decoration: none;
}

.lang-switch a:hover {
	background: var(--brand-soft);
}

.lang-switch a[aria-current="true"] {
	font-weight: 700;
	color: var(--brand-strong);
}

.nav-toggle {
	display: none;
}

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* Hero and sections */
.hero {
	background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
	color: #fff;
	padding-block: 64px;
}

.hero h1 {
	color: #fff;
}

.hero__lead {
	font-size: 1.15rem;
	max-width: 60ch;
	opacity: 0.92;
}

.section {
	padding-block: 56px;
}

.section--alt {
	background: var(--surface);
	border-block: 1px solid var(--border);
}

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
}

.section__more {
	font-weight: 600;
}

/* Cards */
.cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.card {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	transition: border-color 0.15s, transform 0.15s;
}

.section--alt .card {
	background: var(--bg);
}

.card:hover {
	border-color: var(--brand);
	transform: translateY(-2px);
}

.card__link {
	display: block;
	height: 100%;
	padding: 1.25rem;
	color: inherit;
	text-decoration: none;
}

.card h2,
.card h3 {
	font-size: 1.1rem;
	margin-block-end: 0.4rem;
}

.card p {
	color: var(--muted);
	margin: 0;
	font-size: 0.95rem;
}

.card__type {
	display: inline-block;
	margin-block-end: 0.5rem;
	padding: 0.1rem 0.55rem;
	border-radius: 999px;
	background: var(--brand-soft);
	color: var(--brand-strong);
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

/* Content pages */
.content-area {
	padding-block: 32px 56px;
}

.breadcrumbs ol {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	font-size: 0.9rem;
	color: var(--muted);
}

.breadcrumbs li + li::before {
	content: "/";
	margin-inline-end: 0.35rem;
	opacity: 0.6;
}

.breadcrumbs a {
	display: inline-block;
	padding-block: 3px;
	color: var(--muted);
}

.entry {
	max-width: 760px;
}

.entry--tool {
	max-width: none;
}

.entry-meta {
	color: var(--muted);
	font-size: 0.9rem;
	margin-block-end: 1.5rem;
}

.entry-content {
	font-size: 1.05rem;
}

.entry-content h2 {
	margin-block-start: 2em;
}

.entry-content table {
	width: 100%;
	border-collapse: collapse;
	margin-block: 1.5rem;
	font-size: 0.95rem;
	display: block;
	overflow-x: auto;
}

.entry-content th,
.entry-content td {
	padding: 0.6rem 0.75rem;
	border-block-end: 1px solid var(--border);
	text-align: start;
}

.entry-content th {
	background: var(--brand-soft);
}

/* FAQ */
.entry-content details {
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
	margin-block-end: 0.75rem;
}

.entry-content summary {
	cursor: pointer;
	padding: 1rem 1.25rem;
	font-weight: 600;
}

.entry-content details p {
	padding: 0 1.25rem 1rem;
	margin: 0;
	color: var(--muted);
}

/* Related blocks and tool call-to-action */
.related {
	margin-block-start: 3rem;
}

.tool-cta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	flex-wrap: wrap;
	max-width: 760px;
	margin-block-start: 2.5rem;
	padding: 1.25rem 1.5rem;
	background: var(--brand-soft);
	border-radius: var(--radius);
}

.tool-cta p {
	margin: 0;
	font-weight: 600;
}

.btn {
	display: inline-block;
	padding: 0.7rem 1.25rem;
	border-radius: var(--radius-sm);
	background: var(--brand);
	color: var(--on-brand);
	font-weight: 700;
	text-decoration: none;
}


/* Footer: dark in both colour schemes */
.site-footer {
	--f-bg: #0f172a;
	--f-text: #e2e8f0;
	--f-muted: #94a3b8;
	--f-border: #1e293b;
	background: var(--f-bg);
	border-block-start: 1px solid var(--border);
	color: var(--f-muted);
	padding-block: 56px 0;
	font-size: 0.93rem;
}

.site-footer__grid {
	display: grid;
	grid-template-columns: minmax(220px, 1.4fr) repeat(auto-fit, minmax(160px, 1fr));
	gap: 2rem;
	padding-block-end: 40px;
}

.site-footer__name {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	color: var(--f-text);
	font-size: 1.15rem;
	font-weight: 800;
	text-decoration: none;
}

.site-footer__brand p {
	margin-block: 0.75rem 1rem;
	max-width: 34ch;
}

.site-footer h2 {
	margin-block-end: 0.9rem;
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--f-text);
}

.site-footer ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.site-footer li {
	margin-block-end: 0.45rem;
}

.site-footer .sub-menu {
	margin-block-start: 0.4rem;
	padding-inline-start: 0.85rem;
	border-inline-start: 1px solid var(--f-border);
}

.site-footer a {
	color: var(--f-muted);
	text-decoration: none;
}

.site-footer a:hover {
	color: #fff;
}

.social {
	display: flex;
	gap: 0.5rem;
}

.social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border: 1px solid var(--f-border);
	border-radius: 10px;
	transition: border-color 0.15s, color 0.15s;
}

.social a:hover {
	border-color: var(--f-muted);
}

.site-footer__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem 1.5rem;
	padding-block: 1.1rem;
	border-block-start: 1px solid var(--f-border);
	font-size: 0.85rem;
}

.footer-langs ul {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1rem;
}

.footer-langs li {
	margin: 0;
}

.footer-langs a[aria-current] {
	color: var(--f-text);
	font-weight: 600;
}

/* Pagination */
.pagination {
	margin-block-start: 2rem;
}

.pagination .nav-links {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.pagination .page-numbers {
	padding: 0.4rem 0.8rem;
	border: 1px solid var(--border);
	border-radius: 8px;
	text-decoration: none;
}

.pagination .current {
	background: var(--brand);
	border-color: var(--brand);
	color: var(--on-brand);
}

/* Homepage search and category chips */
.tool-search {
	margin-block-start: 1.5rem;
	max-width: 520px;
}

.tool-search input {
	width: 100%;
	padding: 0.9rem 1.1rem;
	border: 0;
	border-radius: var(--radius-sm);
	background: var(--surface);
	color: var(--text);
	font: inherit;
	font-size: 1.05rem;
	box-shadow: var(--shadow);
}

.chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-block-end: 1.5rem;
}

.chip {
	padding: 0.45rem 0.9rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	background: var(--surface);
	color: var(--muted);
	font: inherit;
	font-size: 0.9rem;
	font-weight: 600;
	cursor: pointer;
}

.chip[aria-pressed="true"] {
	background: var(--brand);
	border-color: var(--brand);
	color: var(--on-brand);
}

.tool-group + .tool-group {
	margin-block-start: 2rem;
}

.tool-group__title {
	color: var(--muted);
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}

.tool-search__empty {
	color: var(--muted);
}

[hidden] {
	display: none !important;
}

/* Table of contents on guides */
.toc {
	margin-block-end: 2rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius-sm);
}

.toc summary {
	padding: 0.85rem 1.1rem;
	font-weight: 700;
	cursor: pointer;
}

.toc ol {
	margin: 0;
	padding: 0 1.1rem 1rem 2.4rem;
	padding-inline: 2.4rem 1.1rem;
	font-size: 0.95rem;
}

.toc li {
	margin-block-end: 0.3rem;
}

.entry-content h2[id] {
	scroll-margin-top: 84px;
}

/* Homepage hero with image */
.hero__inner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	align-items: center;
}

.hero__media picture {
	display: contents;
}

.hero__media img {
	display: block;
	width: 100%;
	border-radius: var(--radius);
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.25);
}

.btn--hero {
	margin-block-start: 1rem;
	background: var(--accent);
	color: #1f1300;
}

@media (min-width: 900px) {
	.hero__inner:has(.hero__media) {
		grid-template-columns: 1.1fr 0.9fr;
	}
}

/* Homepage content blocks: <div class="features">, <div class="why">, <ol class="steps"> */
.entry-content--home {
	max-width: none;
}

.entry-content--home > h2 {
	margin-block-start: 0;
}

.entry-content--home > * + h2 {
	margin-block-start: 3rem;
}

.features,
.why {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 1rem;
	margin-block: 1.5rem;
}

.features > div,
.why > div {
	padding: 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.features h3,
.why h3 {
	margin-block-end: 0.35rem;
}

.features p,
.why p {
	margin: 0;
	color: var(--muted);
	font-size: 0.95rem;
}

.steps {
	counter-reset: step;
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
	gap: 1rem;
	margin: 1.5rem 0;
	padding: 0;
	list-style: none;
}

.steps li {
	counter-increment: step;
	position: relative;
	padding: 3.25rem 1.25rem 1.25rem;
	background: var(--surface);
	border: 1px solid var(--border);
	border-radius: var(--radius);
}

.steps li::before {
	content: counter(step);
	position: absolute;
	top: 1rem;
	inset-inline-start: 1.25rem;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--accent);
	color: #1f1300;
	font-weight: 800;
	font-size: 0.9rem;
}

/* Card images and language badge */
.card__link {
	display: flex;
	flex-direction: column;
	padding: 0;
	overflow: hidden;
}

.card__body {
	display: block;
	padding: 1.25rem;
}

.card__img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--radius) var(--radius) 0 0;
}

.card__lang {
	display: inline-block;
	margin-inline-start: 0.35rem;
	padding: 0.1rem 0.45rem;
	border: 1px solid var(--border);
	border-radius: 999px;
	color: var(--muted);
	font-size: 0.7rem;
	font-weight: 700;
}

.entry-image {
	margin: 0 0 2rem;
}

.entry-image img {
	display: block;
	width: 100%;
	border-radius: var(--radius);
}

/* Motion: press feedback and section reveal (see references/motion.md) */
.btn,
.chip,
.theme-switch button,
.nav-toggle {
	transition: transform 0.08s ease, background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:active,
.chip:active,
.theme-switch button:active,
.nav-toggle:active {
	transform: scale(0.96);
}

.js .reveal {
	opacity: 0;
	transform: translateY(16px);
	transition: opacity 0.5s ease, transform 0.5s ease;
}

.js .reveal.is-visible {
	opacity: 1;
	transform: none;
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}

	.js .reveal {
		opacity: 1;
		transform: none;
	}
}

@media (max-width: 900px) {
	.nav-toggle {
		display: inline-flex;
	}

	.main-nav {
		display: none;
		position: absolute;
		inset-inline: 0;
		top: 100%;
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 0.5rem 1rem 1rem;
		background: var(--surface);
		border-block-end: 1px solid var(--border);
		box-shadow: var(--shadow);
		max-height: calc(100vh - 64px);
		overflow-y: auto;
	}

	.nav-open .main-nav {
		display: flex;
	}

	.main-nav ul {
		flex-direction: column;
		gap: 0;
	}

	.main-nav a,
	.mega summary {
		display: flex;
		padding: 0.7rem 0;
	}

	.mega__panel {
		position: static;
		width: auto;
		max-height: none;
		box-shadow: none;
		border: 0;
		padding: 0 0 0.5rem;
		grid-template-columns: 1fr 1fr;
	}

	.site-footer__grid {
		grid-template-columns: 1fr 1fr;
	}

	.site-footer__brand {
		grid-column: 1 / -1;
	}
}

@media (max-width: 480px) {
	.site-header .container {
		gap: 0.5rem;
	}

	.site-brand span {
		font-size: 1.05rem;
	}

	.theme-switch button {
		width: 28px;
		height: 28px;
	}

	.lang-switch summary,
	.nav-toggle {
		min-width: 36px;
		height: 36px;
		padding-inline: 0.45rem;
	}

	.lang-switch summary .chevron {
		display: none;
	}

	.mega__panel {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 720px) {
	.section {
		padding-block: 40px;
	}

	.hero {
		padding-block: 44px;
	}

}

/* Tap targets: at least 40px on the header controls and chips (motion.md test matrix). */
.theme-switch button,
.nav-toggle,
.lang-switch > summary { min-height: 40px; min-width: 40px; }
.chip { min-height: 40px; }

/* Tool pages: the calculator keeps the full width; reading text stays near 75 characters a line. */
.entry--tool .entry-content > :not(.bbpo-tool) {
	max-width: 680px;
}

/* Phones: drop the outer card around tool pages so the calculator gets the width. */
@media (max-width: 600px) {
	article.entry--tool {
		padding: 0;
		background: none;
		border: 0;
		box-shadow: none;
	}
}

/* Phones: the hero image is decorative, so the search and tools come first. */
@media (max-width: 720px) {
	.hero__media {
		display: none;
	}
}
