/*
 * Pickafont: styles for the new parts only (live preview, characters, languages, backgrounds).
 * Everything else still comes from the old newstyle.css, unchanged.
 */

:root { --pf-blue: #428bfb; --pf-blue-dk: #2573DA; --pf-orange: #f25e07; --pf-ink: #241a3a; }

/* The middle column keeps its width: long preview text is cut off or wrapped inside it,
   instead of pushing the column (and the whole page) wider. */
.main-content { min-width: 0; }
.live, .stage { overflow: hidden; }

/* ---------- "Preview your own text" bar under the blue bar (list pages and home) ---------- */

.pf-try { background: var(--pf-blue-dk); color: #fff; padding: 6px 10px; margin: -7px 0 7px; position: sticky; top: 0; z-index: 20; }
.pf-try-row { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 8px; }
.pf-try-label { font-weight: 700; white-space: nowrap; font-size: .95em; }
.pf-try input[type=text], .pf-tester-bar input[type=text] {
  flex: 1; min-width: 0; padding: 6px 10px; border: 1px solid #ccc; border-radius: 4px; font: inherit; font-size: 14px; color: #333; background: #fff;
}
.pf-try input[type=color], .pf-tester-bar input[type=color] {
  width: 34px; height: 30px; padding: 2px; border: 1px solid #ccc; border-radius: 4px; background: #fff; cursor: pointer; flex: 0 0 auto;
}
.pf-btn, .bgpick-btn {
  background: #2c2c2c; color: #fff; border: 0; border-radius: 4px; padding: 6px 12px; font: inherit; font-size: 14px;
  font-weight: 700; cursor: pointer; flex: 0 0 auto; box-shadow: 0 2px 5px rgba(0, 0, 0, .2);
}
.pf-btn:hover, .bgpick-btn:hover { background: #1a1a1a; }

/* ---------- Font page: the real download button, in pickafont's orange ---------- */

.download-btn.pf-dl { background-color: var(--pf-orange); font-size: 18px; padding: 14px 26px; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.download-btn.pf-dl:hover { background-color: #c4500e; color: #fff; }
.pf-dl-top { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; margin-top: 10px; }
.pf-dl-top .download-btn { margin: 0; }
.pf-dl-note { color: #666; font-size: 13px; }

/* ---------- Font page: live preview ---------- */

.pf-tester-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin: 6px 0 10px; font-weight: 600; }
.pf-tester-bar input[type=text] { flex: 1 1 200px; }
.pf-tester-bar input[type=range] { flex: 0 1 160px; min-width: 90px; accent-color: var(--pf-orange); }
.size-out { flex: 0 0 3.4em; color: #666; font-variant-numeric: tabular-nums; font-weight: 400; }

.sample { font-family: "AFFSample", sans-serif; font-weight: normal; font-style: normal; }
.live, .needs-font { display: none; }
.font-ready .live, .font-ready .needs-font { display: block; }
.font-ready .stage { display: none; }
.stage { padding: 4px 0; }

.tester { font-size: 56px; line-height: 1.2; color: var(--pf-ink); padding: 4px 0 10px; overflow: hidden; overflow-wrap: anywhere; min-height: 1.2em; }
.wf-row { display: flex; align-items: baseline; gap: 10px; padding: 3px 0; border-top: 1px dotted #ccc; }
.wf-size { flex: 0 0 22px; font-size: 11px; color: #888; text-align: right; }
.wf-row .sample { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; line-height: 1.3; color: var(--pf-ink); }
.s48 { font-size: 48px; } .s32 { font-size: 32px; } .s24 { font-size: 24px; } .s16 { font-size: 16px; } .s12 { font-size: 12px; }

/* ---------- Font page: languages and all characters ---------- */

.pf-langs { margin: 12px 0 6px; }
.pf-langs p { margin: 4px 0; }
.pf-langlist { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 6px; }
.pf-langlist li { background: #e6f0ff; border: 1px solid #c5dbfb; border-radius: 4px; padding: 1px 8px; font-weight: 600; font-size: 13px; }
.pf-note { color: #666; font-size: 13px; }
.pf-allchars { margin: 14px 0 6px; }

.glyphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 3px; }
.glyphs button {
  display: grid; place-items: center; height: 44px; padding: 0; font-family: inherit; font-size: 22px; line-height: 1; overflow: hidden; color: #222;
  background: #f0f0f0; border: 1px solid #ddd; border-radius: 4px; cursor: copy;
}
.glyphs button:hover { background: #ffe2cf; border-color: var(--pf-orange); }
.glyphs button.copied { background: var(--pf-orange); border-color: var(--pf-orange); color: #fff; }
.pf-blk { grid-column: 1 / -1; font: 700 11px/1.2 'Segoe UI', Tahoma, sans-serif; color: #666; text-transform: uppercase; letter-spacing: .08em; margin: 8px 0 1px; }
.pf-blk:first-child { margin-top: 0; }
.copy-toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 12px); z-index: 60;
  background: #333; color: #fff; font: 700 14px 'Segoe UI', Tahoma, sans-serif; padding: 8px 16px; border-radius: 6px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, .25); opacity: 0; pointer-events: none; transition: opacity .15s, transform .15s;
}
.copy-toast.on { opacity: 1; transform: translate(-50%, 0); }
.copy-toast b { font-family: AFFSample, 'Segoe UI', sans-serif; font-size: 1.25em; margin: 0 2px; }

/* ---------- Background picker ---------- */

.bgpick { position: relative; flex: 0 0 auto; }
.bgpick-btn { display: inline-flex; align-items: center; gap: 6px; }
.sw { display: inline-block; flex: 0 0 auto; width: 26px; height: 18px; border-radius: 3px; border: 1px solid rgba(0, 0, 0, .3); background: #fff center / cover no-repeat; }
.bgpick-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 30; width: 290px; max-width: calc(100vw - 24px);
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px; color: #333;
  background: #fff; border: 1px solid #ccc; border-radius: 6px; box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
}
.pf-tester-bar .bgpick-panel { right: auto; left: 0; }
.bgpick-panel[hidden] { display: none; }
.bgopt { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border: 1px solid transparent; border-radius: 4px; background: none; text-align: left; font: 600 13px 'Segoe UI', Tahoma, sans-serif; color: #333; cursor: pointer; }
.bgopt:hover { background: #eef4ff; }
.bgopt[aria-pressed=true] { border-color: var(--pf-orange); background: #fff4ec; }
.bgopt .sw { width: 34px; height: 22px; }
.sw-plain { background: linear-gradient(135deg, #fff 46%, var(--pf-orange) 46% 54%, #fff 54%); }

[data-bg=notebook]  { --theme-img: url(bg/notebook.jpg);  --theme-bg: #fbf9f1; }
[data-bg=kraft]     { --theme-img: url(bg/kraft.jpg);     --theme-bg: #bc925f; }
[data-bg=sunset]    { --theme-img: url(bg/sunset.jpg);    --theme-bg: #ffb28e; }
[data-bg=wood]      { --theme-img: url(bg/wood.jpg);      --theme-bg: #4a2e1c; --theme-ink: #fff3dc; }
[data-bg=chalk]     { --theme-img: url(bg/chalk.jpg);     --theme-bg: #24302a; --theme-ink: #f4f4ee; }
[data-bg=blueprint] { --theme-img: url(bg/blueprint.jpg); --theme-bg: #1f4e8c; --theme-ink: #ffffff; }
[data-bg=neon]      { --theme-img: url(bg/neon.jpg);      --theme-bg: #1c1424; --theme-ink: #fff4fb; }
[data-bg=parchment] { --theme-img: url(bg/parchment.jpg); --theme-bg: #e9dcb8; }
[data-bg=marble]    { --theme-img: url(bg/marble.jpg);    --theme-bg: #f1f1f2; }
[data-bg=concrete]  { --theme-img: url(bg/concrete.jpg);  --theme-bg: #b8b7b2; }
[data-bg=denim]     { --theme-img: url(bg/denim.jpg);     --theme-bg: #253f70; --theme-ink: #f2f0e6; }
[data-bg=stars]     { --theme-img: url(bg/stars.jpg);     --theme-bg: #0e1330; --theme-ink: #ffffff; }
.sw-notebook, [data-bg=notebook] .bgpick-btn .sw   { background-image: url(bg/notebook-thumb.jpg); }
.sw-kraft, [data-bg=kraft] .bgpick-btn .sw         { background-image: url(bg/kraft-thumb.jpg); }
.sw-sunset, [data-bg=sunset] .bgpick-btn .sw       { background-image: url(bg/sunset-thumb.jpg); }
.sw-wood, [data-bg=wood] .bgpick-btn .sw           { background-image: url(bg/wood-thumb.jpg); }
.sw-chalk, [data-bg=chalk] .bgpick-btn .sw         { background-image: url(bg/chalk-thumb.jpg); }
.sw-blueprint, [data-bg=blueprint] .bgpick-btn .sw { background-image: url(bg/blueprint-thumb.jpg); }
.sw-neon, [data-bg=neon] .bgpick-btn .sw           { background-image: url(bg/neon-thumb.jpg); }
.sw-parchment, [data-bg=parchment] .bgpick-btn .sw { background-image: url(bg/parchment-thumb.jpg); }
.sw-marble, [data-bg=marble] .bgpick-btn .sw       { background-image: url(bg/marble-thumb.jpg); }
.sw-concrete, [data-bg=concrete] .bgpick-btn .sw   { background-image: url(bg/concrete-thumb.jpg); }
.sw-denim, [data-bg=denim] .bgpick-btn .sw         { background-image: url(bg/denim-thumb.jpg); }
.sw-stars, [data-bg=stars] .bgpick-btn .sw         { background-image: url(bg/stars-thumb.jpg); }

/* Where it shows: the card pictures, the live samples and the fallback picture */
[data-bg] .pf-pv, [data-bg] .live, [data-bg] .stage {
  background-color: var(--theme-bg); background-image: var(--theme-img); background-position: center; background-size: cover;
  border-radius: 6px; isolation: isolate;
}
[data-bg] .pf-pv { display: block; flex: 1; min-width: 0; padding: 4px 8px; margin-right: 6px; }
[data-bg] .live, [data-bg] .stage { padding: 12px 16px; }
[data-bg] .live .sample { color: var(--theme-ink, var(--pf-ink)); }
[data-bg] .wf-row { border-top-color: rgba(127, 127, 127, .35); }
[data-bg-mode=dark] .wf-size { color: var(--theme-ink); opacity: .7; }
[data-bg=neon] .live .sample { text-shadow: 0 0 6px #ff4fd8, 0 0 20px rgba(255, 79, 216, .55); }

/* Stored pictures (dark ink on white or transparent) adapt without being redrawn. */
[data-bg-mode=light] .pf-pv img, [data-bg-mode=light] .stage img { mix-blend-mode: multiply; }
[data-bg-mode=dark] .pf-pv img, [data-bg-mode=dark] .stage img { filter: grayscale(1) invert(1) brightness(1.2); mix-blend-mode: screen; }
.ink-custom[data-bg-mode=dark] .pf-pv img, .ink-custom[data-bg-mode=dark] .stage img { filter: none; mix-blend-mode: normal; }

/* ---------- Small screens ---------- */

@media (max-width: 700px) {
  .pf-try { position: static; }
  .pf-try-label, .pf-try .bgpick-label, .pf-try #pv-clear { display: none; }
  .pf-try-row { position: relative; }
  .pf-try .bgpick { position: static; }
  .pf-try .bgpick-panel { left: 0; right: 0; width: auto; max-width: none; }
  .tester { font-size: 44px; }
  .s48 { font-size: 34px; } .s32 { font-size: 26px; }
}

/* ---------- Text effects for the live preview (Effects button; classes set by app.js on .live) ---------- */

.fxpick { position: relative; flex: 0 0 auto; }
.pf-tester-bar, .tryrow { position: relative; }   /* anchor for the panels on phones */
.fxpick-btn.fx-on { outline: 2px solid #f25e07; outline-offset: 1px; }
.fontpage:not(.font-ready) .fxpick { display: none !important; }   /* effects need the real font */
.fx-icon { font-weight: 800; text-shadow: 1px 1px 0 rgba(0, 0, 0, .45), 0 0 4px rgba(255, 255, 255, .6); letter-spacing: -.02em; }
.fxpick-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 31; width: 360px; max-width: calc(100vw - 24px);
  display: grid; gap: 6px; padding: 10px; color: #333; font: 13px/1.3 system-ui, "Segoe UI", sans-serif;
  background: #fff; border: 1px solid #ccc; border-radius: 8px; box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
}
.fxpick-panel[hidden] { display: none; }
.fx-row { display: grid; grid-template-columns: 92px 1fr auto; align-items: center; gap: 6px; }
.fx-sub { margin-top: -2px; }
.fx-h { font-weight: 700; color: #555; }
.fx-opts { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 3px; }
.fx-opts button {
  border: 1px solid #ccc; background: #f6f6f6; color: #333; border-radius: 4px; padding: 3px 7px;
  font: 600 12px system-ui, "Segoe UI", sans-serif; cursor: pointer;
}
.fx-opts button:hover { background: #fff; border-color: #888; }
.fx-opts button[aria-pressed=true] { background: #333; border-color: #333; color: #fff; }
.fx-row input[type=range] { width: 100%; min-width: 0; }
.fx-row input[type=color] { width: 30px; height: 24px; padding: 1px; border: 1px solid #ccc; border-radius: 4px; background: #fff; }
.fx-val { min-width: 4.2em; text-align: right; color: #777; font-variant-numeric: tabular-nums; }
.fx-reset { justify-self: start; border: 0; background: none; color: #b33; font: 600 12px system-ui, sans-serif; cursor: pointer; padding: 2px 0; text-decoration: underline; }

/* Filters (light effects and blur) combine; drop-shadow also works with gradient fills. */
.live .sample { filter: var(--fxl,) var(--fxb,); }
.live[class*="fx-light-"] .sample { text-shadow: none; }
.fx-light-soft   { --fxl: drop-shadow(.04em .06em .05em rgba(0, 0, 0, .45)); }
.fx-light-hard   { --fxl: drop-shadow(.06em .06em 0 rgba(0, 0, 0, .55)); }
.fx-light-glow   { --fxl: drop-shadow(0 0 .04em var(--fx-ink)) drop-shadow(0 0 .12em var(--fx-ink)) drop-shadow(0 0 .25em var(--fx-ink)); }
.fx-light-3d     { --fxd: color-mix(in srgb, var(--fx-ink) 40%, #000);
                   --fxl: drop-shadow(.012em .012em 0 var(--fxd)) drop-shadow(.012em .012em 0 var(--fxd)) drop-shadow(.012em .012em 0 var(--fxd))
                          drop-shadow(.012em .012em 0 var(--fxd)) drop-shadow(.03em .04em .03em rgba(0, 0, 0, .35)); }
.fx-light-emboss { --fxl: drop-shadow(-.015em -.015em 0 rgba(255, 255, 255, .8)) drop-shadow(.02em .02em 0 rgba(0, 0, 0, .35)); }
.fx-blur         { --fxb: blur(var(--fx-blur, 0px)); }

.fx-outline-line .sample { -webkit-text-stroke: var(--fx-stroke, .03em) var(--fx-stroke-c, #000); -webkit-text-fill-color: transparent; }
.fx-outline-fill .sample { -webkit-text-stroke: var(--fx-stroke, .03em) var(--fx-stroke-c, #000); paint-order: stroke fill; }

.live[class*="fx-fill-"] .sample { -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.fx-fill-gold .sample    { background-image: linear-gradient(180deg, #fff6c9 0%, #f5c542 35%, #b8860b 55%, #ffe58a 75%, #a8740a 100%); }
.fx-fill-chrome .sample  { background-image: linear-gradient(180deg, #ffffff 0%, #b9c0c8 45%, #4f5862 50%, #dde2e7 75%, #7d858d 100%); }
.fx-fill-sunset .sample  { background-image: linear-gradient(90deg, #ff7a18, #ff3d77 50%, #7a2ff7); }
.fx-fill-rainbow .sample { background-image: linear-gradient(90deg, #e81416, #ffa500, #faeb36, #79c314, #487de7, #4b369d, #70369d); }

.fx-ls .sample   { letter-spacing: var(--fx-ls, normal); }
.fx-lh .tester   { line-height: var(--fx-lh, 1.2); }
.fx-case-upper .sample { text-transform: uppercase; }
.fx-case-lower .sample { text-transform: lowercase; }
.fx-case-title .sample { text-transform: capitalize; }
.fx-case-small .sample { font-variant-caps: small-caps; }
.fx-align-center .tester { text-align: center; }
.fx-align-right .tester  { text-align: right; }

@media (max-width: 700px) {
  .fxpick { position: static; }
  .fxpick-panel { left: 0; right: 0; width: auto; }
  .fx-row { grid-template-columns: 80px 1fr auto; }
}
/* ---------- Font page: small layout touches ---------- */

/* The second download button (under the details) is quieter than the main one at the top. */
.download-btn.pf-dl-low { background: #fff; color: var(--pf-orange); border: 2px solid var(--pf-orange); font-size: 15px; padding: 8px 18px; text-shadow: none; box-shadow: none; }
.download-btn.pf-dl-low:hover { background: var(--pf-orange); color: #fff; }

/* Details: labels in one column, values next to them using the free width; a little more air. */
.fontpage .font-specs { grid-template-columns: 160px minmax(0, 1fr); gap: 6px 10px; line-height: 1.45; }
.fontpage .font-specs dt, .fontpage .font-specs dd { width: auto; }
.fontpage .font-specs dt { color: #555; }

/* Orange headings a bit apart from what follows. */
.fontpage .section-box > h1, .fontpage .section-box > h2 { margin-bottom: 10px; }

/* The Unicode block list in two columns on wide screens (it was one long column). */
@media (min-width: 900px) {
  .fontpage .supported-characters ul { columns: 2; column-gap: 24px; }
  .fontpage .supported-characters li { break-inside: avoid; }
}

/* An advertisement slot that Google leaves empty takes no room (and shows no blank white card). */
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }
aside .section-box:has(> ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }

/* Narrow screens: the advertisement takes its own row instead of squeezing the details beside it. */
@media (max-width: 700px) {
  .fontpage .floatright { float: none; margin: 8px 0; text-align: center; }
  .fontpage .floatright ins.adsbygoogle { max-width: 100%; }
}

/* ---------- Header on phones: logo and language buttons fit the screen ---------- */

@media (max-width: 700px) {
  .header-top { justify-content: center; }
  .header-top > a { max-width: 100%; }
  .header-top img { max-width: calc(100vw - 16px); height: auto; }
  .languages { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px; max-width: 100%; padding: 0 4px 4px; }
  .languages a { margin: 0; padding: 5px 8px; font-size: .9em; }
}

/* Test page /font/all: the status of each font (Y, C, N, X = waiting to be published) and its id. */
.pf-status { display: inline-block; margin-left: 8px; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 700; color: #fff; background: #777; }
.pf-status-y { background: #2e8b3a; } .pf-status-c { background: #8a8a8a; } .pf-status-n { background: #2573DA; } .pf-status-x { background: #c0392b; }

/* ---------- FAQ pages: full width ---------- */
/* newstyle.css gives every dt/dd a fixed width (150/200 px) and bold dd, meant for the old
   font details list; on the FAQ that squeezed every answer into a 200 px bold column. */
.faq dt, .faq dd { width: auto; }
.faq dd { font-weight: 400; line-height: 1.55; }
.faq dt { border-radius: 4px; }
