/*
Theme Name: Pixwords Atsakymai
Description: Daugiakalbė Pixwords atsakymų svetainės tema. Veikia kartu su įskiepiu „Pixwords Answers“.
Version: 1.0.0
Text Domain: pixwords-theme
*/

:root {
	--bg: #f4f6fc;
	--ink: #1b2240;
	--muted: #6b7394;
	--brand: #6c5ce7;
	--brand-2: #00b8d9;
	--card: #ffffff;
	--line: #e3e7f4;
	--radius: 16px;
	--shadow: 0 6px 24px rgba(40, 50, 110, .08);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", Arial, sans-serif;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; height: auto; }
.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* Header */
.site-header {
	background: linear-gradient(120deg, #1b2240 0%, #3a2f8f 55%, #6c5ce7 100%);
	color: #fff;
	position: sticky;
	top: 0;
	z-index: 50;
	box-shadow: 0 4px 18px rgba(20, 20, 60, .25);
}
.hd { display: flex; align-items: center; gap: 14px; padding: 12px 0; flex-wrap: wrap; }
.logo { font-weight: 800; font-size: 1.35rem; color: #fff; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo b { color: #7ef0ff; }
.hd form { margin-inline-start: auto; display: flex; flex: 1 1 260px; max-width: 420px; }
.hd input[type=search] {
	flex: 1; min-width: 0; border: 0; border-radius: 999px 0 0 999px;
	padding: 10px 16px; font: inherit; background: rgba(255,255,255,.95); color: var(--ink);
}
[dir=rtl] .hd input[type=search] { border-radius: 0 999px 999px 0; }
.hd form button {
	border: 0; padding: 0 16px; cursor: pointer; font-size: 1rem;
	background: var(--brand-2); color: #04212a; border-radius: 0 999px 999px 0;
}
[dir=rtl] .hd form button { border-radius: 999px 0 0 999px; }

/* Language dropdown */
.lang { position: relative; }
.lang summary {
	list-style: none; cursor: pointer; user-select: none;
	background: rgba(255,255,255,.14); padding: 9px 14px; border-radius: 999px; white-space: nowrap;
}
.lang summary::-webkit-details-marker { display: none; }
.lang summary::after { content: " ▾"; opacity: .7; }
.lang-list {
	position: absolute; inset-inline-end: 0; top: calc(100% + 8px);
	width: min(560px, 92vw); max-height: 70vh; overflow: auto;
	background: var(--card); color: var(--ink); border-radius: var(--radius); box-shadow: 0 20px 50px rgba(20,20,60,.3);
	padding: 10px; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px;
}
.lang-list a { color: var(--ink); padding: 8px 10px; border-radius: 10px; display: block; }
.lang-list a:hover, .lang-list a.cur { background: #eceafe; text-decoration: none; }

/* Hero */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 { font-size: clamp(1.8rem, 4.5vw, 3rem); line-height: 1.15; margin: 0 0 10px; letter-spacing: -.02em; }
.hero p { color: var(--muted); margin: 0 auto; max-width: 640px; }

/* Language cards */
.lang-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); padding: 16px 0 48px; }
.lang-card {
	display: flex; align-items: center; gap: 12px; padding: 14px 16px;
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
	color: var(--ink); box-shadow: var(--shadow); transition: transform .15s, border-color .15s;
}
a.lang-card:hover { transform: translateY(-2px); border-color: var(--brand); text-decoration: none; }
.lang-card.off { opacity: .45; box-shadow: none; }
.lang-card .fl { font-size: 1.9rem; line-height: 1; }
.lang-card strong { display: block; line-height: 1.2; }
.lang-card small { color: var(--muted); }

/* Page heads */
.page-head { padding: 28px 0 8px; }
.page-head h1 { margin: 0 0 6px; font-size: clamp(1.5rem, 3.5vw, 2.2rem); letter-spacing: -.01em; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.crumbs span { margin: 0 6px; }

/* Level cards */
.level-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); padding: 14px 0 20px; }
.level-card {
	background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
	display: flex; flex-direction: column; color: var(--ink); box-shadow: var(--shadow); transition: transform .15s;
}
.level-card:hover { transform: translateY(-3px); text-decoration: none; }
.level-card .th { aspect-ratio: 4/3; background: linear-gradient(135deg, #e9e6ff, #d8f6fc); display: grid; place-items: center; overflow: hidden; }
.level-card .th img { width: 100%; height: 100%; object-fit: cover; }
.level-card .num { font-size: 2.2rem; font-weight: 800; color: var(--brand); }
.level-card .meta { padding: 10px 14px 14px; }
.level-card .meta b { display: block; }
.level-card .meta small { color: var(--muted); }

/* Single level */
.level-wrap { display: grid; gap: 24px; padding: 8px 0 32px; }
.level-img { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 520px; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.btn {
	border: 0; cursor: pointer; font: inherit; font-weight: 600; padding: 9px 18px; border-radius: 999px;
	background: var(--brand); color: #fff;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn.alt { background: #eceafe; color: var(--brand); }

.words { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.word { display: grid; grid-template-columns: 38px 1fr auto; gap: 10px; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.word:last-child { border-bottom: 0; }
.word .i { color: var(--muted); font-size: .85rem; }
.word .hint { color: var(--muted); font-size: .9rem; display: block; }
.boxes { display: inline-flex; gap: 3px; flex-wrap: wrap; margin-top: 4px; }
.boxes i { width: 18px; height: 22px; border: 2px solid var(--line); border-radius: 5px; background: #fafbff; }
.ans { font-weight: 700; font-size: 1.1rem; letter-spacing: .04em; filter: blur(7px); transition: filter .2s; cursor: pointer; user-select: none; }
.ans.on { filter: none; user-select: text; }
.word .cnt { font-size: .8rem; color: var(--muted); display: block; text-align: end; }
noscript + * .ans, .no-js .ans { filter: none; }

.pager { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 6px 0 36px; }
.nav-links { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; padding: 8px 0 40px; }
.nav-links .page-numbers { background: var(--card); border: 1px solid var(--line); padding: 7px 14px; border-radius: 10px; color: var(--ink); }
.nav-links .current { background: var(--brand); color: #fff; border-color: var(--brand); }

.pw-ad { margin: 18px 0; text-align: center; min-height: 10px; }

.empty { text-align: center; color: var(--muted); padding: 50px 0; }
.search-hit { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 18px; margin-bottom: 12px; box-shadow: var(--shadow); }
.search-hit h2 { margin: 0 0 6px; font-size: 1.1rem; }
.search-hit .tags span { display: inline-block; background: #eceafe; color: var(--brand); border-radius: 999px; padding: 2px 12px; margin: 2px 4px 2px 0; font-weight: 600; }

/* Footer */
.site-footer { background: #1b2240; color: #b7bddc; padding: 30px 0; margin-top: 30px; font-size: .9rem; }
.site-footer a { color: #fff; }
.site-footer .disc { opacity: .75; margin-top: 8px; }

.entry { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; margin: 24px 0; }

@media (min-width: 900px) {
	.level-wrap.has-img { grid-template-columns: 340px 1fr; align-items: start; }
}
@media (max-width: 520px) {
	.word { grid-template-columns: 30px 1fr; }
	.word .ans-col { grid-column: 2; }
	.word .cnt { text-align: start; }
}
