/* Artolabs Font Preview: front end. Inherits the theme's colours and fonts. */
.afp {
	--afp-line: rgba(0, 0, 0, .14);
	/* Chosen items stay black. Hover, focus, sliders and the loading bar follow the Accent
	   colour of the Kadence theme (Customize > Global > Colors); black if the theme has none. */
	--afp-ink: #111;
	--afp-accent: var(--global-palette1, #111);
	clear: both;
	margin: 2.5em 0;
	font-size: 15px;
	line-height: 1.4;
}
.afp *, .afp *::before, .afp *::after { box-sizing: border-box; }

/* Many themes (Kadence, Astra, ...) force buttons to UPPERCASE with wide letter spacing.
   That would turn the Aa / AA / aa case buttons into "AA AA AA", so the plugin's own
   buttons always keep the text exactly as written. */
.afp button,
.afp .afp-case,
.afp .afp-align,
.afp .afp-style,
.afp .afp-preset,
.afp .afp-pill,
.afp .afp-reset {
	text-transform: none !important;
	letter-spacing: normal !important;
}

.afp .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* Style tabs */
.afp-styles { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1em; }
.afp-style, .afp-preset, .afp-reset, .afp-seg button {
	appearance: none; background: transparent; color: inherit; cursor: pointer;
	border: 1px solid var(--afp-line); border-radius: 0; padding: .45em .9em;
	font: inherit; font-size: .9em; line-height: 1.2;
	transition: background-color .15s, color .15s, border-color .15s;
}
.afp-style:hover, .afp-preset:hover, .afp-reset:hover, .afp-seg button:hover { background: transparent; color: inherit; border-color: var(--afp-accent); }
.afp-style.is-active, .afp-seg button.is-active { background: var(--afp-ink); border-color: var(--afp-ink); color: #fff; }
.afp button:focus-visible, .afp input:focus-visible, .afp textarea:focus-visible { outline: 2px solid var(--afp-accent); outline-offset: 2px; }

/* Specimen */
.afp-specimen { border: 1px solid var(--afp-line); margin: 0 0 1.5em; }
.afp-specimen img { display: block; width: 100%; height: auto; }
.afp-specimen--below { margin: 1.5em 0 0; }
.afp-spec { min-height: 40px; background: rgba(0, 0, 0, .03); }
.afp-spec[src] { background: none; }

/* Tester */
.afp-heading { margin: 0 0 .6em; font-size: 1.15em; letter-spacing: .02em; }
.afp-text {
	display: block; width: 100%; resize: vertical; min-height: 4.2em; padding: .7em .8em;
	border: 1px solid var(--afp-line); border-radius: 0; background: transparent; color: inherit; font: inherit;
}
.afp-presets { display: flex; flex-wrap: wrap; gap: 6px; margin: .7em 0 0; }
.afp-preset { font-size: .8em; padding: .35em .7em; }

.afp-controls {
	display: flex; flex-wrap: wrap; align-items: flex-end; gap: 14px 22px; margin: 1.2em 0;
}
.afp-ctl { display: flex; flex-direction: column; gap: 5px; font-size: .85em; min-width: 130px; }
.afp-ctl > span { opacity: .75; }
.afp-ctl output { font-variant-numeric: tabular-nums; opacity: .75; }
.afp-ctl input[type=range] { width: 100%; accent-color: var(--afp-accent); }
.afp-color { min-width: 0; }
.afp-color input[type=color] {
	width: 44px; height: 32px; padding: 2px; border: 1px solid var(--afp-line); background: transparent; cursor: pointer;
}
.afp-seg { flex-direction: row; min-width: 0; gap: 0; }
.afp-seg button { padding: .45em .75em; }
.afp-seg button + button { border-left-width: 0; }

/* Output image */
.afp-stage { position: relative; border: 1px solid var(--afp-line); min-height: 90px; overflow: hidden; }
.afp-out { display: block; width: 100%; height: auto; transition: opacity .15s; }
.afp-out:not([src]) { visibility: hidden; height: 90px; }
.afp-stage.is-loading .afp-out { opacity: .55; }
.afp-stage.is-loading::after {
	content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 40%; background: var(--afp-accent);
	animation: afp-bar 1s ease-in-out infinite;
}
@keyframes afp-bar { 0% { left: -40%; } 100% { left: 100%; } }
.afp-msg { margin: 0; padding: .8em 1em; font-size: .9em; }

@media (max-width: 600px) {
	.afp-ctl { min-width: 100%; }
	.afp-color { min-width: 0; }
	.afp-seg { min-width: 0; }
}
@media (prefers-reduced-motion: reduce) {
	.afp-stage.is-loading::after { animation: none; width: 100%; opacity: .4; }
	.afp-out, .afp-style, .afp-preset { transition: none; }
}

/* Character table */
.afp-chars { border-top: 1px solid var(--afp-line); padding: 1em 1em 1.1em; }
.afp-chars-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 .7em; }
.afp-chars-head .afp-heading { margin: 0; }
.afp-chars-count { font-size: .85em; opacity: .65; }

.afp-pills { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1em; }
.afp-pill {
	appearance: none; background: transparent; color: inherit; cursor: pointer;
	border: 1px solid var(--afp-line); border-radius: 999px; padding: .35em .85em;
	font: inherit; font-size: .85em; line-height: 1.2;
	transition: background-color .15s, color .15s, border-color .15s;
}
.afp-pill:hover { background: transparent; color: inherit; border-color: var(--afp-accent); }
.afp-pill.is-active { background: var(--afp-ink); border-color: var(--afp-ink); color: #fff; }
.afp-pill-n { opacity: .6; font-variant-numeric: tabular-nums; margin-left: .25em; }
.afp-pill.is-active .afp-pill-n { opacity: .75; }

.afp-chars-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; gap: 18px; align-items: start; }
.afp-grid { min-width: 0; }
.afp-page { position: relative; } /* each image already draws its own outer border */
.afp-page + .afp-page { margin-top: -1px; }
.afp-gridimg { display: block; width: 100%; height: auto; cursor: pointer; background: rgba(0, 0, 0, .03); }
.afp-gridimg[src] { background: none; }
.afp-sel { position: absolute; pointer-events: none; border: 2px solid var(--afp-ink); box-shadow: 0 0 0 1px #fff inset; }
.afp-more { margin: .7em 0 0; font-size: .85em; opacity: .65; }

.afp-inspect { position: sticky; top: 16px; border: 1px solid var(--afp-line); padding: 12px; }
.afp-glyphbox { display: flex; align-items: center; justify-content: center; min-height: 120px; }
.afp-glyph { display: block; max-width: 100%; height: auto; }
.afp-ginfo { margin-top: 10px; text-align: center; }
.afp-ginfo p { margin: 0; }
.afp-gcode { font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: .03em; }
.afp-gname { font-size: .75em; opacity: .65; margin-top: 2px !important; word-break: break-word; }
.afp-ghint { font-size: .85em; opacity: .6; padding: 2.5em .5em; }
.afp-ghint[hidden], .afp-glyph[hidden], .afp-chars[hidden] { display: none !important; }

@media (max-width: 720px) {
	.afp-chars { padding: .8em; }
	.afp-chars-body { grid-template-columns: 1fr; }
	.afp-inspect { position: static; order: -1; display: flex; align-items: center; gap: 14px; padding: 8px; }
	.afp-glyphbox { min-height: 0; width: 96px; flex: none; }
	.afp-ginfo { margin: 0; text-align: left; }
	.afp-ghint { padding: .6em 0; }
}
