/* AutoTerm plugin — styling mirrors AutoTerm.aspx so the browser looks the same
   whether reached via ttn.ch or termboy.com. Scoped under .at-page. */

.at-page {
	--at-src: #1f3a5f;   /* source-language term colour (navy) */
	--at-trg: #c83a2a;   /* target-language term colour (terracotta) */
	--at-border: #e5e7eb;
	--at-muted: #6b7280;
	--at-bg-soft: #fafafa;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	color: #1f2937;
	max-width: 1200px;
	margin: 0 auto;
}

/* ── Brand bar ─────────────────────────────────────────────────────────── */
.at-brandbar { display: flex; align-items: center; padding: 12px 4px 18px; }
.at-brand { display: flex; flex-direction: column; }
.at-brand-name { font-size: 26px; font-weight: 700; color: var(--at-src); letter-spacing: -.01em; }
.at-brand-name::after { content: ""; }
.at-brand-tag { font-size: 13px; color: var(--at-muted); }

/* ── Search bar ────────────────────────────────────────────────────────── */
.at-searchbar {
	display: flex; align-items: center; gap: 10px;
	border: 1px solid var(--at-border); border-radius: 10px;
	padding: 10px 12px; background: #fff;
}
.at-search-input {
	flex: 1 1 auto; border: 0; outline: 0; font-size: 15px; padding: 8px 6px;
	background: transparent; color: inherit;
}
.at-search-btn {
	flex: 0 0 auto; border: 0; border-radius: 8px; cursor: pointer;
	background: var(--at-src); color: #fff; font-size: 14px; font-weight: 600;
	padding: 9px 20px;
}
.at-search-btn:hover { background: #16304f; }
.at-count { flex: 0 0 auto; color: var(--at-muted); font-size: 13px; min-width: 60px; text-align: right; }

/* ── Language chips ────────────────────────────────────────────────────── */
.at-langrow {
	display: flex; align-items: center; flex-wrap: wrap; gap: 8px;
	margin: 14px 0; padding: 10px 12px;
	border: 1px solid var(--at-border); border-radius: 10px; background: var(--at-bg-soft);
}
.at-langrow-label { font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--at-muted); }
.at-langrow-arrow { color: var(--at-muted); margin: 0 4px; }
.at-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.at-chip {
	border: 1px solid var(--at-border); border-radius: 999px; cursor: pointer;
	background: #fff; color: #374151; font-size: 13px; padding: 6px 14px;
}
.at-chip:hover { border-color: #cbd5e1; }
.at-chip.on-src { background: var(--at-src); border-color: var(--at-src); color: #fff; }
.at-chip.on-trg { background: var(--at-trg); border-color: var(--at-trg); color: #fff; }

/* ── Two-column layout ─────────────────────────────────────────────────── */
.at-twocol { display: flex; gap: 0; align-items: stretch; margin-top: 8px; }
.at-hitlist {
	flex: 0 0 260px; width: 260px; border: 1px solid var(--at-border);
	border-radius: 10px 0 0 10px; background: #fff; overflow-y: auto; max-height: 70vh;
}
.at-hitlist-head {
	font-size: 11px; letter-spacing: .06em; text-transform: uppercase; color: var(--at-muted);
	padding: 12px 14px; border-bottom: 1px solid var(--at-border);
}
.at-hl-item {
	display: block; width: 100%; text-align: left; border: 0; background: transparent;
	cursor: pointer; padding: 10px 14px; font-size: 14px; color: #1f2937;
	border-bottom: 1px solid #f3f4f6;
}
.at-hl-item:hover { background: #f9fafb; }
.at-hl-item.on { background: var(--at-src); color: #fff; }

.at-main {
	flex: 1 1 auto; border: 1px solid var(--at-border); border-left: 0;
	border-radius: 0 10px 10px 0; background: #fff; padding: 20px 24px; min-width: 0;
}

/* ── Entry ─────────────────────────────────────────────────────────────── */
.at-entry { }
.at-entry + .at-entry { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--at-border); }

.at-imgrow { margin-bottom: 18px; }
.at-imggrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.at-imgcell { margin: 0; border: 1px solid var(--at-border); border-radius: 6px; overflow: hidden; background: var(--at-bg-soft); }
.at-imgcell img { width: 100%; height: 150px; object-fit: cover; display: block; background: #f3f4f6; }
.at-imgcaption { font-size: 12px; color: var(--at-muted); padding: 6px 8px; }

.at-langlabel { font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--at-muted); margin: 0 0 8px; }

/* Grid mode: side-by-side (two columns) vs sequential (stacked). */
.at-langgrid.at-mode-sbs { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
.at-langgrid.at-mode-seq { display: block; }

.at-lang { min-width: 0; }
.at-mode-seq .at-lang + .at-lang { margin-top: 4px; }

/* Language separator (sequential mode) */
.at-langsep { display: flex; align-items: center; gap: 12px; margin: 26px 0 14px; }
.at-langsep-line { flex: 1 1 auto; height: 1px; background: var(--at-border); }
.at-langsep-name { flex: 0 0 auto; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; color: var(--at-muted); }

/* Term head */
.at-termhead { margin: 0 0 6px; font-weight: normal; }
.at-term { font-size: 30px; font-weight: 700; letter-spacing: -.01em; }
.at-lang.at-src .at-term { color: var(--at-src); }
.at-lang.at-trg .at-term { color: var(--at-trg); }
.at-grammar { font-size: 15px; font-style: italic; color: var(--at-muted); margin-left: 4px; }
.at-pron { font-size: 14px; color: var(--at-muted); margin-left: 4px; }
.at-validation { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-left: 6px; vertical-align: middle; }
.at-validation.v-approved { background: #dcfce7; color: #15803d; }
.at-validation.v-rejected { background: #fef3c7; color: #92400e; }
.at-validation.v-proposed { background: #e0e7ff; color: #3730a3; }

.at-breadcrumb { font-size: 11px; letter-spacing: .04em; text-transform: uppercase; color: var(--at-muted); margin-bottom: 14px; }
.at-breadcrumb .sep { margin: 0 2px; }

/* Sections */
.at-section { margin-top: 16px; }
.at-section h4 { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; color: var(--at-muted); margin: 0 0 4px; }
.at-section p { margin: 0; font-size: 14px; line-height: 1.55; }

.at-quote { margin: 0; padding: 8px 14px; border-left: 3px solid #fbbf24; background: #fffbeb; font-style: italic; font-size: 14px; color: #3f3f46; }
.at-quote-src { display: block; font-size: 11px; color: #a16207; font-style: normal; margin-top: 4px; }
.at-quote-src cite { font-style: normal; }

.at-badges { display: flex; gap: 6px; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; }
.at-badge { font-size: 13px; padding: 4px 10px; border-radius: 6px; background: #eef2ff; color: #3730a3; }
.at-badge.at-norm { background: #f1f5f9; color: #334155; }

.at-link { display: block; font-size: 13px; color: var(--at-src); word-break: break-all; }

/* Splash */
.at-splash { text-align: center; padding: 40px 20px; }
.at-splash h2 { font-size: 22px; font-weight: 700; color: #1f2937; max-width: 640px; margin: 0 auto 12px; line-height: 1.35; }
.at-splash-hint { color: var(--at-muted); font-size: 14px; }

/* States */
.at-loading, .at-empty, .at-error { padding: 40px 20px; text-align: center; color: var(--at-muted); }
.at-error { color: #b91c1c; }

/* Accessibility helper (WP standard) */
.screen-reader-text {
	position: absolute; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ── Responsive ────────────────────────────────────────────────────────── */
@media (max-width: 860px) {
	.at-twocol { flex-direction: column; }
	.at-hitlist { flex-basis: auto; width: 100%; max-height: 220px; border-radius: 10px; }
	.at-main { border-left: 1px solid var(--at-border); border-radius: 10px; margin-top: 10px; }
	.at-langgrid.at-mode-sbs { grid-template-columns: 1fr; gap: 20px; }
	.at-imggrid { grid-template-columns: repeat(2, 1fr); }
}
