/*
Theme Name: che-theme
Theme URI: https://che.lt
Description: Lightweight, trustworthy front-end for the che.lt multi-country finance directory. Pairs with the Che Core plugin (market subdomains, ranked offers, SEO). Clean "banking" aesthetic.
Author: che.lt
Version: 0.1.0
Requires at least: 6.4
Requires PHP: 8.0
Text Domain: che-theme
*/

/* ============================================================
   Design tokens
   ============================================================ */
:root {
	--ink: #0b1b33;
	--navy: #081a37;
	--navy-2: #0f2f63;
	--brand: #1657c4;
	--brand-700: #0f3e92;
	--go: #0ca66e;
	--go-700: #098757;
	--amber: #f6a609;
	--bg: #f4f7fb;
	--surface: #ffffff;
	--muted: #5a6b83;
	--muted-2: #93a2b8;
	--line: #e4eaf2;
	--line-2: #eef2f8;

	--font-display: "Bricolage Grotesque", "Hanken Grotesk", system-ui, sans-serif;
	--font-body: "Hanken Grotesk", system-ui, -apple-system, sans-serif;

	--r-sm: 8px;
	--r: 14px;
	--r-lg: 20px;
	--shadow-sm: 0 1px 2px rgba(11, 27, 51, .06), 0 1px 3px rgba(11, 27, 51, .05);
	--shadow: 0 6px 24px -8px rgba(11, 27, 51, .14), 0 2px 6px rgba(11, 27, 51, .06);
	--shadow-lg: 0 24px 60px -20px rgba(11, 27, 51, .28);
	--wrap: 1080px;
}

/* ============================================================
   Base
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.6;
	color: var(--ink);
	background: var(--bg);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-700); }
h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.1; letter-spacing: -.02em; color: var(--ink); margin: 0; }
img { max-width: 100%; height: auto; }

.che-wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 22px; }
.che-section { padding-block: 56px; }
.che-section__title { font-size: 1.7rem; margin-bottom: 22px; }
.che-empty { color: var(--muted); padding: 40px 0; }

/* ============================================================
   Top bar + header
   ============================================================ */
.che-topbar {
	background: var(--navy);
	color: #cdd9ec;
	font-size: .82rem;
	letter-spacing: .01em;
}
.che-topbar__inner { display: flex; align-items: center; gap: 10px; padding-block: 7px; }
.che-topbar__dot { color: #41597f; }
.che-topbar__item--muted { color: #8aa0c2; margin-left: auto; }

.che-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 40; }
.che-header__inner { display: flex; align-items: center; justify-content: space-between; height: 70px; }

.che-brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); }
.che-brand:hover { color: var(--ink); }
.che-brand__mark {
	display: grid; place-items: center;
	width: 40px; height: 40px; border-radius: 11px;
	background: linear-gradient(150deg, var(--brand), var(--brand-700));
	color: #fff; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem;
	box-shadow: 0 6px 16px -6px rgba(22, 87, 196, .6);
}
.che-brand__name { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.03em; }
.che-brand__tld { color: var(--brand); }
.che-brand__name--light { color: #fff; }
.che-brand__name--light .che-brand__tld { color: #5b9bff; }

/* Switcher */
.che-switcher { position: relative; }
.che-switcher__btn {
	display: inline-flex; align-items: center; gap: 9px;
	background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
	padding: 7px 14px 7px 8px; cursor: pointer; font-family: var(--font-body);
	font-weight: 600; font-size: .95rem; color: var(--ink);
}
.che-switcher__btn:hover { border-color: var(--brand); }
.che-switcher__chev { color: var(--muted); }
.che-switcher__menu {
	position: absolute; right: 0; top: calc(100% + 8px);
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
	box-shadow: var(--shadow-lg); padding: 8px; min-width: 250px;
	max-height: 60vh; overflow: auto; z-index: 50;
	display: grid; gap: 2px;
}
.che-switcher__menu[hidden] { display: none; } /* attribute must win over display:grid */
.che-switcher__opt { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; color: var(--ink); font-weight: 500; }
.che-switcher__opt:hover { background: var(--bg); color: var(--ink); }
.che-switcher__opt.is-current { background: #eaf1fd; color: var(--brand-700); }
.che-switcher__count { margin-left: auto; color: var(--muted-2); font-size: .82rem; font-weight: 600; }

/* Flag chip (country code) */
.che-flag {
	display: inline-grid; place-items: center; min-width: 30px; height: 22px; padding: 0 6px;
	background: #eaf1fd; color: var(--brand-700); border-radius: 6px;
	font-weight: 700; font-size: .72rem; letter-spacing: .04em;
}
.che-flag--lg { min-width: 46px; height: 34px; font-size: .95rem; border-radius: 9px; }

/* ============================================================
   Hero
   ============================================================ */
.che-hero {
	position: relative; overflow: hidden;
	background:
		radial-gradient(900px 400px at 88% -10%, rgba(91, 155, 255, .35), transparent 60%),
		radial-gradient(700px 360px at 5% 120%, rgba(12, 166, 110, .22), transparent 55%),
		linear-gradient(160deg, #0c2050, #081a37 70%);
	color: #eaf1fb;
}
.che-hero::after {
	content: ""; position: absolute; inset: 0;
	background-image: radial-gradient(rgba(255,255,255,.07) 1px, transparent 1px);
	background-size: 22px 22px; mask-image: linear-gradient(180deg, #000, transparent 80%);
	pointer-events: none;
}
.che-hero__inner { position: relative; z-index: 1; padding-block: 64px 60px; max-width: 760px; }
.che-hero--hub .che-hero__inner { padding-block: 84px 72px; }
.che-hero--slim .che-hero__inner { padding-block: 44px 40px; }
.che-eyebrow {
	display: inline-flex; align-items: center; gap: 8px;
	text-transform: uppercase; letter-spacing: .14em; font-size: .76rem; font-weight: 700;
	color: #9dc0ff; margin: 0 0 16px;
}
.che-hero__title { font-size: clamp(2.1rem, 5vw, 3.4rem); color: #fff; }
.che-hero__title--sm { font-size: clamp(1.8rem, 4vw, 2.6rem); }
.che-hero__lead { font-size: 1.16rem; color: #c4d4ec; margin: 18px 0 0; max-width: 60ch; }

.che-hero__stats { display: flex; gap: 38px; margin-top: 34px; }
.che-stat__num { display: block; font-family: var(--font-display); font-weight: 800; font-size: 2.2rem; color: #fff; line-height: 1; }
.che-stat__lbl { font-size: .82rem; text-transform: uppercase; letter-spacing: .1em; color: #8aa6cf; }

/* ============================================================
   Markets grid (hub)
   ============================================================ */
.che-markets { display: grid; grid-template-columns: repeat(auto-fill, minmax(212px, 1fr)); gap: 14px; }
.che-market {
	display: flex; flex-direction: column; gap: 8px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
	padding: 18px; color: var(--ink); box-shadow: var(--shadow-sm);
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
	animation: che-rise .5s both; animation-delay: calc(var(--i, 0) * 30ms);
}
.che-market:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: #c9d8ee; color: var(--ink); }
.che-market__name { font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; }
.che-market__count { color: var(--muted); font-size: .88rem; }

/* ============================================================
   Offer list + cards
   ============================================================ */
.che-list { display: grid; gap: 14px; }
.che-card {
	display: grid; grid-template-columns: 64px 1fr 220px; align-items: stretch;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
	box-shadow: var(--shadow-sm); overflow: hidden;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
	animation: che-rise .5s both; animation-delay: calc(var(--i, 0) * 45ms);
}
.che-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: #c9d8ee; }

.che-card__rank {
	display: grid; place-items: center; font-family: var(--font-display); font-weight: 800;
	font-size: 1.5rem; color: var(--brand); background: linear-gradient(180deg, #f1f6fe, #e9f1fd);
	border-right: 1px solid var(--line-2);
}
.che-card__rank-hash { font-size: .9rem; color: var(--muted-2); margin-right: 1px; vertical-align: .2em; }

.che-card__main { padding: 18px 20px; min-width: 0; }
.che-card__head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.che-card__title { font-size: 1.3rem; }
.che-card__title a { color: var(--ink); }
.che-card__title a:hover { color: var(--brand); }
.che-card__desc { color: var(--muted); font-size: .96rem; margin: 12px 0 0; }
.che-card__desc strong { color: var(--ink); font-weight: 700; }

.che-card__aside {
	display: flex; flex-direction: column; align-items: stretch; justify-content: center; gap: 8px;
	padding: 18px; background: #fbfcfe; border-left: 1px solid var(--line-2);
}
.che-card__score-line { text-align: center; }
.che-card__score-label { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); font-weight: 700; }
.che-card__more { text-align: center; font-size: .86rem; color: var(--muted); font-weight: 600; }
.che-card__more:hover { color: var(--brand); }

/* Chips */
.che-chips { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 12px 0 0; padding: 0; }
.che-chip {
	font-size: .76rem; font-weight: 600; color: var(--navy-2);
	background: #eef3fb; border: 1px solid #e0e9f6; border-radius: 999px; padding: 3px 11px;
}
.che-chip a { color: inherit; }

/* Score badge */
.che-score {
	display: inline-flex; align-items: baseline; gap: 1px;
	font-family: var(--font-display); font-weight: 800; line-height: 1;
	border-radius: 11px; padding: 9px 11px; color: #fff;
	background: linear-gradient(160deg, var(--brand), var(--brand-700));
}
.che-score__num { font-size: 1.3rem; }
.che-score__max { font-size: .72rem; opacity: .8; font-weight: 700; }
.che-score--top { background: linear-gradient(160deg, #14b87a, var(--go-700)); }
.che-score--high { background: linear-gradient(160deg, var(--brand), var(--brand-700)); }
.che-score--mid { background: linear-gradient(160deg, #e89a16, #c97d04); }
.che-score--low { background: linear-gradient(160deg, #8aa0bd, #647794); }
.che-score--lg { padding: 14px 18px; border-radius: 15px; }
.che-score--lg .che-score__num { font-size: 2.1rem; }
.che-score--sm { padding: 6px 8px; border-radius: 8px; }
.che-score--sm .che-score__num { font-size: 1rem; }

/* ============================================================
   Buttons
   ============================================================ */
.che-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	font-family: var(--font-body); font-weight: 700; font-size: .98rem;
	padding: 12px 18px; border-radius: 11px; border: 0; cursor: pointer;
	transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.che-btn svg { transition: transform .15s ease; }
.che-btn:hover svg { transform: translateX(3px); }
.che-btn--go { background: linear-gradient(160deg, var(--go), var(--go-700)); color: #fff; box-shadow: 0 8px 18px -8px rgba(12, 166, 110, .7); }
.che-btn--go:hover { color: #fff; transform: translateY(-1px); box-shadow: 0 12px 24px -10px rgba(12, 166, 110, .8); }
.che-btn--block { width: 100%; }

/* ============================================================
   Single offer
   ============================================================ */
.che-breadcrumb { display: flex; gap: 10px; align-items: center; color: var(--muted); font-size: .9rem; padding-top: 22px; }
.che-breadcrumb span[aria-hidden] { color: var(--muted-2); }
.che-offer { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: start; padding-block: 26px 64px; }
.che-offer__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); margin-bottom: 22px; }
.che-offer__title { font-size: clamp(1.9rem, 4vw, 2.7rem); }
.che-offer__score { display: flex; flex-direction: column; align-items: center; gap: 6px; flex-shrink: 0; }
.che-offer__score-label { font-size: .8rem; font-weight: 700; color: var(--muted); }
.che-offer__body { font-size: 1.05rem; color: #28384f; }
.che-offer__body p { margin: 0 0 16px; }

.che-note { background: #f1f6fe; border: 1px solid #e0e9f6; border-radius: var(--r); padding: 20px 22px; margin-top: 26px; }
.che-note__title { font-size: 1.1rem; margin-bottom: 8px; }
.che-note p { margin: 0; color: var(--muted); font-size: .96rem; }

.che-offer__cta-box { position: sticky; top: 90px; }
.che-cta-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow); padding: 24px; text-align: center; }
.che-cta-box .che-score { margin-bottom: 14px; }
.che-cta-box__market { color: var(--muted); font-weight: 600; margin: 0 0 16px; display: flex; align-items: center; justify-content: center; gap: 8px; }
.che-cta-box__fine { font-size: .78rem; color: var(--muted-2); margin: 12px 0 0; line-height: 1.4; }

/* ============================================================
   Pagination
   ============================================================ */
.che-pagination { margin-top: 30px; }
.che-pagination .page-numbers { display: inline-grid; place-items: center; min-width: 40px; height: 40px; padding: 0 10px; border: 1px solid var(--line); border-radius: 10px; margin-right: 6px; background: var(--surface); color: var(--ink); font-weight: 600; }
.che-pagination .page-numbers.current { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ============================================================
   Footer
   ============================================================ */
.che-footer { background: var(--navy); color: #b9c8df; margin-top: 40px; }
.che-footer .che-wrap { padding-block: 48px 28px; }
.che-footer__top { display: flex; justify-content: space-between; gap: 30px; flex-wrap: wrap; }
.che-footer__tag { max-width: 44ch; color: #93a8c8; margin: 10px 0 0; font-size: .95rem; }
.che-footer__menu { list-style: none; display: flex; gap: 20px; flex-wrap: wrap; padding: 0; margin: 0; }
.che-footer__menu a { color: #c3d2e8; }
.che-disclosure { background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: var(--r); padding: 16px 20px; margin: 28px 0 22px; font-size: .85rem; color: #8fa4c4; line-height: 1.55; }
.che-disclosure strong { color: #d7e2f3; }
.che-footer__bottom { font-size: .85rem; color: #6f86a8; border-top: 1px solid rgba(255,255,255,.07); padding-top: 18px; }

/* Prose / generic pages */
.che-page__title { font-size: 2.2rem; margin-bottom: 18px; }
.che-prose { max-width: 70ch; color: #28384f; }

/* ============================================================
   Motion
   ============================================================ */
@keyframes che-rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 860px) {
	.che-offer { grid-template-columns: 1fr; }
	.che-offer__cta-box { position: static; order: -1; }
}
@media (max-width: 680px) {
	body { font-size: 16px; }
	.che-card { grid-template-columns: 48px 1fr; }
	.che-card__aside { grid-column: 1 / -1; border-left: 0; border-top: 1px solid var(--line-2); flex-direction: row; align-items: center; justify-content: space-between; }
	.che-card__aside .che-btn--go { flex: 1; max-width: 200px; }
	.che-card__score-line { display: none; }
	.che-hero__stats { gap: 24px; }
	.che-header__inner { height: 60px; }
}
