/* ==========================================================================
   Glyphhouse — public site styles
   Colours come from the theme chosen in Admin → Site settings → Branding.
   Change the width of the site with --container.
   ========================================================================== */

/* ---------- Theme tokens ---------- */
:root,
html[data-theme="studio"] {
  /* Studio — clean white + indigo (default) */
  --ground: #F6F7FB;
  --surface: #FFFFFF;
  --surface-alt: #F9FAFC;
  --ink: #111827;
  --ink-soft: #374151;
  --muted: #5B6474;
  --line: #E4E7EF;
  --line-soft: #EEF0F5;
  --chip: #EEF0F6;
  --field-bg: #FFFFFF;
  --field-line: #CDD2DE;
  --accent: #4F46E5;
  --accent-2: #EC4899;
  --link: var(--accent);
  --hero-bg: radial-gradient(1200px 400px at 85% -10%, rgba(236, 72, 153, .35), transparent 60%), linear-gradient(135deg, #1E1B4B 0%, #312E81 55%, #4338CA 100%);
  --hero-ink: #FFFFFF;
  --hero-muted: #C7CBF5;
  --footer-bg: #0F1022;
  --footer-ink: #FFFFFF;
  --footer-muted: #A5A9C8;
  --footer-line: #25274A;
  --display: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --body: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 800;
  --display-tracking: -0.03em;
}

html[data-theme="classic"] {
  /* Classic — red + navy, the familiar font-site look */
  --ground: #F5F6F8;
  --surface: #FFFFFF;
  --surface-alt: #FAFAFB;
  --ink: #1B1B2F;
  --ink-soft: #33344A;
  --muted: #5C5F6E;
  --line: #E3E4EA;
  --line-soft: #EFF0F3;
  --chip: #EEEFF3;
  --field-line: #CFD1DA;
  --accent: #D32F2F;
  --accent-2: #F59E0B;
  --hero-bg: linear-gradient(135deg, #1B1B2F 0%, #2A2A48 100%);
  --hero-muted: #C4C6D6;
  --footer-bg: #14142A;
  --footer-muted: #A9ABC0;
  --footer-line: #2A2A48;
}

html[data-theme="emerald"] {
  /* Emerald — calm teal + amber */
  --ground: #F4F8F7;
  --surface: #FFFFFF;
  --surface-alt: #F8FBFA;
  --ink: #0F1F1C;
  --ink-soft: #243733;
  --muted: #52625E;
  --line: #DCE6E3;
  --line-soft: #EAF1EF;
  --chip: #E7F0ED;
  --field-line: #C6D4D0;
  --accent: #0F766E;
  --accent-2: #F59E0B;
  --hero-bg: radial-gradient(900px 380px at 90% 0%, rgba(245, 158, 11, .28), transparent 60%), linear-gradient(135deg, #062925 0%, #0B3F39 55%, #0F766E 100%);
  --hero-muted: #BFDCD6;
  --footer-bg: #07201D;
  --footer-muted: #9DBDB6;
  --footer-line: #15403A;
}

html[data-theme="midnight"] {
  /* Midnight — dark mode with violet + cyan */
  --ground: #0D0E13;
  --surface: #16181F;
  --surface-alt: #1B1E27;
  --ink: #ECEEF4;
  --ink-soft: #CDD1DC;
  --muted: #9AA1B2;
  --line: #2A2E3A;
  --line-soft: #222530;
  --chip: #232633;
  --field-bg: #11131A;
  --field-line: #343947;
  --accent: #7C3AED;
  --accent-2: #22D3EE;
  --link: #C4B5FD;
  --hero-bg: radial-gradient(900px 420px at 80% -20%, rgba(124, 58, 237, .55), transparent 60%), radial-gradient(700px 300px at 0% 120%, rgba(34, 211, 238, .25), transparent 60%), #0D0E13;
  --hero-muted: #B5BACB;
  --footer-bg: #08090D;
  --footer-muted: #8E95A7;
  --footer-line: #1F222C;
  color-scheme: dark;
}
html[data-theme="midnight"] .fav[aria-pressed="true"] { border-color: #6B2139; background: #2A1520; }

html[data-theme="paper"] {
  /* Paper — the original warm, editorial look */
  --ground: #F5F1E8;
  --surface: #FFFDF8;
  --surface-alt: #FAF7F0;
  --ink: #1C1B18;
  --ink-soft: #3D3A34;
  --muted: #5E5A52;
  --line: #E2DCCD;
  --line-soft: #EFE9DC;
  --chip: #F1ECE0;
  --field-line: #CFC7B6;
  --accent: #C2410C;
  --accent-2: #E8692E;
  --hero-bg: #1C1B18;
  --hero-muted: #D6D0C2;
  --footer-bg: #1C1B18;
  --footer-muted: #D6D0C2;
  --footer-line: #3A3833;
  --display: Fraunces, Georgia, serif;
  --body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display-weight: 600;
  --display-tracking: -0.02em;
}

/* ---------- Shared tokens (work with every theme) ---------- */
:root {
  --on-accent: #FFFFFF;
  /* Fallbacks for older phones (iOS 15, older Android) that can't mix colours. */
  --accent-dark: var(--accent);
  --accent-soft: var(--chip);
  --accent-line: var(--line);
  --ok-bg: #E7F6EC;
  --ok-ink: #166534;
  --ok-line: #BBE5C8;
  --warn-bg: #FEF3C7;
  --warn-ink: #92400E;
  --danger: #DC2626;
  --danger-bg: #FDECEC;
  --danger-ink: #991B1B;
  --danger-line: #F5C2C2;
  --header-bg: var(--surface);
  --shadow-sm: 0 1px 2px rgba(15, 17, 34, .06);
  --shadow-md: 0 10px 28px -12px rgba(15, 17, 34, .22);
  --shadow-lg: 0 24px 60px -20px rgba(15, 17, 34, .35);
  --radius: 14px;
  --radius-sm: 10px;
  --preview-size: 60px;
  --container: 1240px;
  /* Side padding that keeps content inside a centred --container while backgrounds stay full-width.
     The % is measured against each element's parent, so nested boxes fall back to 20px. */
  --pad: max(20px, calc((100% - var(--container)) / 2));
}

/* Modern browsers: shades calculated from the theme / custom accent colour. */
@supports (color: color-mix(in srgb, red 50%, blue)) {
  :root {
    --accent-dark: color-mix(in srgb, var(--accent) 80%, #000);
    --accent-soft: color-mix(in srgb, var(--accent) 10%, var(--surface));
    --accent-line: color-mix(in srgb, var(--accent) 35%, var(--surface));
    --ok-bg: color-mix(in srgb, #16A34A 12%, var(--surface));
    --ok-ink: color-mix(in srgb, #15803D 85%, var(--ink));
    --ok-line: color-mix(in srgb, #16A34A 30%, var(--surface));
    --warn-bg: color-mix(in srgb, #F59E0B 16%, var(--surface));
    --warn-ink: color-mix(in srgb, #92400E 85%, var(--ink));
    --danger-bg: color-mix(in srgb, #DC2626 10%, var(--surface));
    --danger-ink: color-mix(in srgb, #991B1B 85%, var(--ink));
    --danger-line: color-mix(in srgb, #DC2626 30%, var(--surface));
    --header-bg: color-mix(in srgb, var(--surface) 88%, transparent);
  }
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--body); font-size: 16px; line-height: 1.55; background: var(--ground); color: var(--ink); -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--link); }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { margin: 0; line-height: 1.2; }
img { max-width: 100%; height: auto; }
code { font-size: .9em; }
.muted { color: var(--muted); font-size: 14px; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 16px; top: 16px; z-index: 100; background: var(--surface); padding: 8px 12px; border-radius: 8px; }
.accent-link, .rich-text a, .auth__switch a, .form__inline a, .checkbox a { color: var(--link); }
.accent-link:hover { text-decoration: underline; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border-radius: var(--radius-sm); border: 1px solid transparent; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; background: none; color: inherit; text-align: center; transition: background-color .15s, border-color .15s, color .15s, transform .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
.btn--small { min-height: 36px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn--large { min-height: 54px; font-size: 17px; border-radius: 12px; }
.btn--block { display: flex; width: 100%; }
.btn--accent { background: var(--accent); color: var(--on-accent); box-shadow: 0 6px 16px -8px var(--accent); }
.btn--accent:hover { background: var(--accent-dark); color: var(--on-accent); }
.btn--dark { background: var(--ink); color: var(--surface); }
.btn--dark:hover { background: var(--ink-soft); color: var(--surface); }
.btn--outline { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn--outline:hover { border-color: var(--accent); color: var(--link); }
.btn--ghost { border-color: var(--line); background: var(--surface); color: var(--ink); }
.btn--ghost:hover { border-color: var(--accent-line); color: var(--link); }
.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: #B91C1C; color: #fff; }
.btn--center { display: flex; width: fit-content; margin: 8px auto 0; }
.btn.is-disabled, .btn:disabled { opacity: .5; pointer-events: none; }

/* ---------- Announcement + header ---------- */
.announcement { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; text-align: center; font-size: 14px; font-weight: 600; padding: 9px var(--pad); }
.announcement a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.announcement a:hover { color: #fff; }

.site-header { position: sticky; top: 0; z-index: 50; background: var(--header-bg); backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px); border-bottom: 1px solid var(--line); }
.site-header__inner { min-height: 70px; padding: 10px var(--pad); display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.brand__mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: 16px; }
.brand__name { font-family: var(--display); font-weight: var(--display-weight); font-size: 22px; letter-spacing: var(--display-tracking); color: var(--ink); }
.brand__logo { display: block; height: 38px; width: auto; max-width: 220px; object-fit: contain; }
.search { flex: 1 1 280px; max-width: 460px; height: 44px; display: flex; align-items: center; gap: 10px; padding: 0 16px; background: var(--surface-alt); border: 1px solid var(--line); border-radius: 999px; color: var(--muted); transition: border-color .15s, box-shadow .15s; }
.search:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search input { flex: 1; min-width: 0; border: 0; background: transparent; font: inherit; font-size: 15px; color: var(--ink); outline: none; }
.main-nav { display: flex; align-items: center; gap: 22px; font-size: 15px; font-weight: 600; margin-left: auto; }
.main-nav a { color: var(--ink-soft); }
.main-nav a:hover, .main-nav a.is-active { color: var(--link); }
.main-nav .header-button { color: var(--on-accent); min-height: 42px; border-radius: 999px; padding: 0 18px; }
.main-nav .header-button:hover { color: var(--on-accent); }
.header-actions { display: none; }
.icon-button { width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent; }
.icon-button:active { background: var(--chip); }
.icon-button:hover { border-color: var(--accent-line); color: var(--link); }
/* "How to install this font" helper */
.install-help { margin-top: 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.install-help > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 8px; padding: 12px 14px; font-size: 14px; font-weight: 700; color: var(--ink); }
.install-help > summary::-webkit-details-marker { display: none; }
.install-help > summary::after { content: "+"; margin-left: auto; font-size: 18px; color: var(--muted); font-weight: 600; }
.install-help[open] > summary::after { content: "\2212"; }
.install-help > summary:hover { color: var(--link); }
.install-help__body { padding: 2px 14px 14px; display: flex; flex-direction: column; gap: 12px; }
.install-help__step strong { display: block; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.install-help__step p { margin: 0; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); }

/* Cookie-consent banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; padding: 0 var(--pad) max(14px, env(safe-area-inset-bottom)); pointer-events: none; }
.cookie-banner__inner {
    pointer-events: auto; max-width: var(--container); margin: 0 auto;
    background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 16px 18px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
    transform: translateY(16px); opacity: 0; transition: transform .25s ease, opacity .25s ease;
}
.cookie-banner.is-visible .cookie-banner__inner { transform: translateY(0); opacity: 1; }
.cookie-banner__text { flex: 1 1 320px; min-width: 0; }
.cookie-banner__text strong { display: block; font-size: 14px; color: var(--ink); margin-bottom: 3px; }
.cookie-banner__text p { margin: 0; font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.cookie-banner__text a { color: var(--link); text-decoration: underline; text-underline-offset: 2px; }
.cookie-banner__actions { display: flex; gap: 10px; flex: 0 0 auto; }
.cookie-banner__actions .btn { white-space: nowrap; }
@media (max-width: 560px) {
    .cookie-banner { padding-left: 12px; padding-right: 12px; }
    .cookie-banner__inner { padding: 14px; gap: 12px; }
    .cookie-banner__actions { width: 100%; }
    .cookie-banner__actions .btn { flex: 1 1 auto; }
}
/* Dark-mode toggle: show moon in light mode, sun in dark mode */
.theme-toggle__sun { display: none; }
html.is-dark .theme-toggle__sun { display: block; }
html.is-dark .theme-toggle__moon { display: none; }
.burger { position: relative; width: 20px; height: 14px; display: block; }
.burger span { position: absolute; left: 0; width: 100%; height: 2px; border-radius: 2px; background: currentColor; transition: transform .2s ease, opacity .2s ease, top .2s ease; }
.burger span:nth-child(1) { top: 0; }
.burger span:nth-child(2) { top: 6px; }
.burger span:nth-child(3) { top: 12px; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(1) { top: 6px; transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(2) { opacity: 0; }
.menu-toggle[aria-expanded="true"] .burger span:nth-child(3) { top: 6px; transform: rotate(-45deg); }

/* ---------- Hero ---------- */
.hero { background: var(--hero-bg); color: var(--hero-ink, #fff); padding: 64px var(--pad) 56px; }
.hero__inner { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 48px; align-items: end; }
.hero h1 { font-family: var(--display); font-weight: var(--display-weight); font-size: clamp(36px, 5vw, 60px); line-height: 1.04; letter-spacing: var(--display-tracking); color: #fff; }
.hero p { margin: 16px 0 0; font-size: 18px; color: var(--hero-muted); max-width: 620px; }
.hero__search { margin-top: 28px; display: flex; gap: 8px; background: #fff; border-radius: 999px; padding: 6px; max-width: 620px; box-shadow: var(--shadow-lg); }
.hero__search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 18px; font: inherit; font-size: 17px; color: #111827; outline: none; -webkit-appearance: none; appearance: none; box-sizing: border-box; }
.hero__search input::-webkit-search-decoration, .hero__search input::-webkit-search-cancel-button, .hero__search input::-webkit-search-results-button { -webkit-appearance: none; appearance: none; }
.hero__search .btn { border-radius: 999px; min-height: 48px; padding: 0 24px; }
.hero__chips { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 14px; color: var(--hero-muted); }
.hero__chips a { padding: 6px 12px; border-radius: 999px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18); color: #fff; font-weight: 500; }
.hero__chips a:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.hero__stats { margin: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.hero__stats div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column-reverse; gap: 2px; }
.hero__stats dt { font-size: 13px; color: var(--hero-muted); }
.hero__stats dd { margin: 0; font-family: var(--display); font-weight: var(--display-weight); font-size: 28px; color: #fff; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

/* ---------- Preview toolbar (lists) ---------- */
.preview-controls { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow-sm); }
.preview-controls label { display: block; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 6px; }
.preview-controls__text { flex: 1 1 280px; }
.preview-controls__text input { width: 100%; height: 46px; padding: 0 14px; border-radius: var(--radius-sm); border: 1px solid var(--field-line); background: var(--field-bg, #fff); font: inherit; font-size: 17px; color: var(--ink); }
.preview-controls__text input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.preview-controls__size { flex: 0 1 240px; }
.preview-controls__size input { width: 100%; height: 46px; accent-color: var(--accent); }
.preview-controls .btn { height: 46px; }

/* ---------- Layout ---------- */
.with-sidebar { display: flex; gap: 36px; padding: 36px var(--pad); align-items: flex-start; }
.content { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 22px; }
.page-wrap { padding: 40px var(--pad); display: flex; flex-direction: column; gap: 24px; }
.page-wrap--narrow { max-width: 860px; margin: 0 auto; box-sizing: content-box; padding-left: 20px; padding-right: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.section-head h2, .page-head h1, .section-title { font-family: var(--display); font-size: clamp(26px, 3vw, 32px); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }
.section-head__link { font-weight: 600; font-size: 15px; color: var(--link); }
.section-head__link:hover { text-decoration: underline; }
.page-head { display: flex; flex-direction: column; gap: 8px; }
.page-head p { margin: 0; max-width: 720px; color: var(--muted); }
.page-head__row { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.sort { display: flex; gap: 4px; padding: 4px; background: var(--chip); border-radius: 999px; font-size: 14px; font-weight: 600; }
.sort a { padding: 7px 14px; border-radius: 999px; color: var(--muted); }
.sort a.is-active { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-sm); }
.sort__clear { align-self: center; font-size: 13px; font-weight: 600; color: var(--accent); text-decoration: underline; padding: 0 6px; }
.empty { padding: 40px; text-align: center; background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted); }
.empty a { color: var(--link); text-decoration: underline; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: var(--shadow-sm); }
.panel h2 { font-family: var(--display); font-size: 21px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }

/* Browse by category (homepage) */
.cat-browse { padding: 20px var(--pad) 0; }
.cat-browse__inner { max-width: var(--container); margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 28px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: 20px; }
.cat-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.cat-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding: 22px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); color: var(--ink); transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease; }
.cat-card:hover { transform: translateY(-3px); border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.cat-card__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.cat-card:hover .cat-card__icon { background: var(--accent); color: var(--on-accent); }
.cat-card__name { font-family: var(--display); font-weight: 800; font-size: 15px; line-height: 1.2; letter-spacing: -0.01em; }
.cat-card__count { font-size: 12.5px; color: var(--muted); }
@media (max-width: 1080px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 720px)  { .cat-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .cat-browse__inner { padding: 20px; } }
@media (max-width: 460px)  { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Sidebar ---------- */
.sidebar { width: 250px; flex-shrink: 0; display: flex; flex-direction: column; gap: 14px; }
.sidebar__title { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .09em; color: var(--muted); margin-top: 6px; }
.sidebar__list { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px; max-height: 440px; overflow-y: auto; scrollbar-width: thin; }
.sidebar__list a { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; font-size: 15px; color: var(--ink-soft); }
.sidebar__list a:hover { background: var(--surface-alt); color: var(--link); }
.sidebar__list a.is-active { background: var(--accent-soft); color: var(--link); font-weight: 600; }
.sidebar__list .count { font-size: 12px; font-weight: 600; color: var(--muted); background: var(--chip); border-radius: 999px; padding: 2px 8px; font-variant-numeric: tabular-nums; }
.sidebar__cta { display: block; text-align: center; padding: 11px; border: 1.5px solid var(--accent); color: var(--link); border-radius: var(--radius-sm); font-weight: 800; font-size: 13px; text-transform: uppercase; letter-spacing: .08em; background: var(--surface); }
.sidebar__cta:hover { background: var(--accent); color: var(--on-accent); }
.sidebar__links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.sidebar__links a { display: block; padding: 6px 2px; font-size: 15px; line-height: 1.35; color: var(--ink-soft); }
.sidebar__links a:hover { color: var(--link); }

/* Quick links: icon list card */
.sidebar__quick { list-style: none; margin: 0; padding: 6px; display: flex; flex-direction: column; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.sidebar__quick a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink-soft); transition: background .14s ease, color .14s ease; }
.sidebar__quick a:hover { background: var(--accent-soft); color: var(--link); }
.sidebar__quick-ic { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--chip); color: var(--ink-soft); transition: background .14s ease, color .14s ease; }
.sidebar__quick a:hover .sidebar__quick-ic { background: var(--accent); color: var(--on-accent); }
.letters { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; }
.letters a { height: 36px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 8px; font-weight: 700; font-size: 14px; background: var(--surface); color: var(--ink-soft); }
.letters a:hover { border-color: var(--accent); color: var(--link); }

/* ---------- Font cards ---------- */
.font-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.font-grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.font-card { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; display: flex; flex-direction: column; overflow: hidden; transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease; }
@media (hover: hover) {
  .font-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--accent-line); }
    }
.font-card__head { padding: 14px 14px 0 18px; display: flex; justify-content: space-between; align-items: center; gap: 8px; min-width: 0; }
.font-card__title { min-width: 0; display: flex; flex-direction: column; }
.font-card__head h3 { min-width: 0; font-family: var(--body); font-size: 15px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.font-card__sub { font-size: 12px; color: var(--muted); }
.font-card__tools { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.font-card__preview { height: 124px; padding: 0 18px; display: flex; align-items: center; overflow: hidden; white-space: nowrap; font-size: var(--preview-size); line-height: 1.2; color: var(--ink); -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
.font-card__preview:hover { color: var(--ink); }
.font-card__foot { margin-top: auto; padding: 12px 14px; border-top: 1px solid var(--line-soft); display: flex; flex-direction: column; align-items: stretch; gap: 10px; background: var(--surface-alt); }
.font-card__meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; min-width: 0; font-size: 13px; color: var(--muted); }
.font-card__foot .btn { width: 100%; }
.chip { display: inline-block; font-size: 12px; font-weight: 600; padding: 4px 9px; border-radius: 999px; background: var(--chip); color: var(--ink-soft); white-space: nowrap; }
.chip--ok { background: var(--ok-bg); color: var(--ok-ink); }
.chip--warn { background: var(--warn-bg); color: var(--warn-ink); }
.chip--free { background: #16A34A; color: #fff; display: inline-flex; align-items: center; gap: 5px; }
.chip--free::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: #fff; opacity: .9; }
a.chip:hover { color: var(--link); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chips .chip { font-size: 13px; padding: 6px 11px; }

.trending { list-style: none; margin: 0; padding: 0; counter-reset: trend; }
.trending li { border-bottom: 1px solid var(--line-soft); }
.trending li:last-child { border-bottom: 0; }
.trending a { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
.trending a::before { counter-increment: trend; content: counter(trend, decimal-leading-zero); font-size: 13px; font-weight: 700; color: var(--muted); width: 24px; flex-shrink: 0; }
.trending__name { flex: 1; min-width: 0; font-size: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pagination { display: flex; align-items: center; justify-content: center; gap: 16px; margin-top: 8px; }

/* ---------- Favorites ---------- */
.fav-form { margin: 0; display: inline-flex; }
.fav { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 34px; height: 34px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; font: inherit; font-size: 15px; font-weight: 600; padding: 0; transition: color .15s, border-color .15s, background-color .15s; }
.fav svg { fill: none; transition: transform .15s ease; }
.fav:hover { color: var(--accent); border-color: var(--accent-line); }
.fav[aria-pressed="true"] { color: #E11D48; border-color: #FBCFE8; background: #FFF1F2; }
.fav[aria-pressed="true"] svg { fill: currentColor; }
.fav--large { width: 100%; height: 46px; border-radius: 12px; color: var(--ink); }
.fav.is-busy svg { transform: scale(.8); }

/* ---------- Breadcrumb + font page ---------- */
.breadcrumb { padding: 28px var(--pad) 0; font-size: 14px; color: var(--muted); }
.breadcrumb--flush { padding: 0; }
.breadcrumb span { color: var(--ink); }
.font-main { gap: 16px; }
.font-heading { font-family: var(--display); font-size: clamp(28px, 3.4vw, 42px); font-weight: var(--display-weight); line-height: 1.12; letter-spacing: var(--display-tracking); overflow-wrap: anywhere; }
.badges { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.badges li { font-size: 13px; font-weight: 600; padding: 6px 12px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); color: var(--ink-soft); }
.badges li a { color: inherit; }
.badges li a:hover { color: var(--link); }
.badges .badge--ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok-ink); }
.badges .badge--warn { background: var(--warn-bg); border-color: transparent; color: var(--warn-ink); }

.font-columns { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
.font-columns__main { min-width: 0; display: flex; flex-direction: column; gap: 16px; }

.tester2 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; box-shadow: var(--shadow-sm); }
.tester2__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.tester2__label { font-size: 12px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); min-width: 52px; }
.tester2__text { flex: 1 1 200px; min-width: 0; height: 40px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--field-line); background: var(--field-bg, #fff); color: var(--ink); font: inherit; font-size: 15px; }
.tester2__text:focus, .tester2 select:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.tester2__range { flex: 1 1 180px; accent-color: var(--accent); }
.tester2__value { font-size: 13px; font-weight: 700; min-width: 50px; font-variant-numeric: tabular-nums; }
.tester2 select { height: 36px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--field-line); background: var(--field-bg, #fff); color: var(--ink); font: inherit; font-size: 14px; }
.tester2__actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 12px; }
.tester2__status { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--ok-ink); }
.seg { display: inline-flex; flex-wrap: wrap; gap: 4px; }
.seg button { height: 32px; padding: 0 10px; border-radius: 7px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.seg button:hover, .seg button.is-on { border-color: var(--accent); color: var(--link); background: var(--accent-soft); }
.swatch { display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 6px 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); font-size: 13px; font-weight: 700; color: var(--muted); cursor: pointer; }
.swatch input { width: 26px; height: 22px; padding: 0; border: 1px solid var(--line); border-radius: 4px; background: none; cursor: pointer; }
.icon-toggle { width: 36px; height: 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; border-radius: 8px; border: 1px solid var(--ink); background: var(--ink); color: var(--surface); cursor: pointer; }
.check { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

.tabs2 { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-sm); }
.tabs2__list { display: flex; overflow-x: auto; border-bottom: 1px solid var(--line); background: var(--surface-alt); scrollbar-width: thin; }
.tabs2__list [role="tab"] { flex-shrink: 0; padding: 13px 14px; border: 0; border-bottom: 2px solid transparent; background: none; font: inherit; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tabs2__list [role="tab"]:hover { color: var(--ink); }
.tabs2__list [role="tab"][aria-selected="true"] { color: var(--link); border-bottom-color: var(--accent); background: var(--surface); }
.tabs2__panel { padding: 18px; }

.stage { min-height: 280px; border-radius: 10px; display: flex; align-items: center; justify-content: center; padding: 28px; overflow: hidden; transition: background-color .15s; border: 1px solid var(--line-soft); }
.stage__text { max-width: 100%; text-align: center; line-height: 1.2; overflow-wrap: anywhere; }
.stage--transparent { background-color: #fff; background-image: linear-gradient(45deg, #EEE 25%, transparent 25%), linear-gradient(-45deg, #EEE 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #EEE 75%), linear-gradient(-45deg, transparent 75%, #EEE 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }

.style-row { padding: 12px 0; border-bottom: 1px solid var(--line-soft); }
.style-row:last-child { border-bottom: 0; }
.style-row__sample { font-size: 34px; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.glyphs { display: grid; grid-template-columns: repeat(auto-fill, minmax(54px, 1fr)); gap: 6px; }
.glyphs span { aspect-ratio: 1; display: grid; place-items: center; border: 1px solid var(--line-soft); border-radius: 8px; font-size: 26px; background: var(--surface-alt); transition: transform .12s, border-color .12s; }
.glyphs span:hover { transform: scale(1.12); border-color: var(--accent); background: var(--surface); }
.waterfall-row { display: flex; align-items: baseline; gap: 16px; padding: 6px 0; border-bottom: 1px solid var(--line-soft); overflow: hidden; }
.waterfall-row__size { flex-shrink: 0; width: 44px; font-size: 12px; font-weight: 600; color: var(--muted); font-variant-numeric: tabular-nums; }
.waterfall-row__text { white-space: nowrap; line-height: 1.2; }

.mockups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mockup { margin: 0; border-radius: 12px; min-height: 180px; padding: 22px 20px 30px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; position: relative; overflow: hidden; }
.mockup > div { font-size: 32px; line-height: 1.15; overflow-wrap: anywhere; max-width: 100%; }
.mockup figcaption { position: absolute; left: 12px; bottom: 8px; font-family: var(--body); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .6; }
.mockup small { font-family: var(--body); font-size: 12px; opacity: .7; }
.mockup--poster { background: #111827; color: #F9FAFB; }
.mockup--poster > div { font-size: 40px; }
.mockup--card { background: #fff; color: #111827; border: 1px solid var(--line); box-shadow: var(--shadow-md); }
.mockup--label { background: #F4E3C3; color: #6B3A10; }
.mockup--label > div { border: 2px solid currentColor; border-radius: 999px; padding: 10px 26px; font-size: 26px; }
.mockup--social { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }

.similar-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.similar-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; flex-direction: column; gap: 6px; background: var(--surface); transition: border-color .15s, box-shadow .15s; }
.similar-card:hover { border-color: var(--accent-line); box-shadow: var(--shadow-md); }
.similar-card__sample { font-size: 30px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--ink); }
.similar-card__name { font-size: 13px; font-weight: 600; color: var(--muted); }
.similar-card:hover .similar-card__name { color: var(--link); }

.font-info { display: flex; flex-direction: column; gap: 14px; position: sticky; top: 90px; }
.font-info__card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow-sm); }
.font-info__list { margin: 0 0 6px; }
.font-info__list div { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 8px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.font-info__list dt { color: var(--muted); }
.font-info__list dd { margin: 0; overflow-wrap: anywhere; }
.pill { display: inline-block; font-size: 12px; font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.pill--ok { background: #16A34A; color: #fff; }
.pill--no { background: var(--chip); color: var(--muted); }
.report-link { font-size: 13px; color: var(--muted); text-decoration: underline; align-self: flex-start; }

.dialog { border: 0; border-radius: 16px; padding: 22px; width: min(640px, calc(100vw - 32px)); background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgba(10, 12, 20, .6); }
.dialog__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.dialog__head h2 { font-family: var(--display); font-size: 21px; font-weight: var(--display-weight); }
.dialog__close { width: 36px; height: 36px; border-radius: 8px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); font-size: 22px; line-height: 1; cursor: pointer; }
.dialog pre { background: #0F1022; color: #E5E7F0; padding: 14px; border-radius: 10px; font-size: 12.5px; overflow-x: auto; max-height: 50vh; }

.dialog--wide { width: min(720px, calc(100vw - 32px)); }
.dialog h3 { font-size: 16px; font-weight: 700; margin: 0 0 4px; }
.dialog .muted { margin: 4px 0 8px; }
.webfont-option { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; border-top: 1px solid var(--line-soft); }
.webfont-option:first-of-type { margin-top: 12px; }
.webfont-option .btn { flex-shrink: 0; }
.webfont-option--stack { display: block; }
.code-box { position: relative; margin-bottom: 8px; }
.code-box pre { margin: 0; padding-right: 84px; max-height: 260px; }
.code-box .btn { position: absolute; top: 8px; right: 8px; min-height: 30px; padding: 0 10px; font-size: 13px; }
.webfont-details summary { cursor: pointer; font-size: 14px; font-weight: 600; color: var(--link); margin: 8px 0; }
.notice--warn { background: var(--warn-bg); color: var(--warn-ink); border: 0; font-size: 14px; margin: 8px 0 0; }
.use-list { display: flex; flex-wrap: wrap; gap: 6px; }
.use { font-size: 12px; font-weight: 700; padding: 2px 8px; border-radius: 999px; background: var(--chip); color: var(--muted); }
.use--yes { background: var(--ok-bg); color: var(--ok-ink); }
.page-head__filters { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Blog, pages, articles ---------- */
.pill-nav { display: flex; gap: 8px; flex-wrap: wrap; }
.pill-nav a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 600; color: var(--ink-soft); }
.pill-nav a:hover { border-color: var(--accent-line); color: var(--link); }
.pill-nav a.is-active { background: var(--ink); color: var(--surface); border-color: var(--ink); }

.post-featured { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-sm); }
.post-featured img { width: 100%; height: 100%; max-height: 380px; object-fit: cover; display: block; }
.post-featured > div { padding: 28px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.post-featured h2 { font-family: var(--display); font-size: clamp(24px, 3vw, 34px); font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.15; }
.post-featured p { margin: 0; color: var(--muted); }
.post-featured:hover h2 { color: var(--link); }
.post-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 22px; }
.post-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s; }
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.post-card__image { aspect-ratio: 1200 / 630; background: linear-gradient(135deg, var(--accent-soft), var(--chip)); display: grid; place-items: center; overflow: hidden; }
.post-card__image img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post-card__image span { font-family: var(--display); font-size: 44px; font-weight: 800; color: var(--accent-line); }
.post-card__body { padding: 18px; display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.post-card__body h2, .post-card__body h3 { font-family: var(--display); font-size: 20px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.25; }
.post-card__body p { margin: 0; color: var(--muted); font-size: 15px; }

.article { max-width: 780px; margin: 0 auto; padding: 40px 20px 8px; box-sizing: content-box; }

/* Blog post: article + right sidebar (flexbox — robust, never collapses) */
.article-layout { padding: 40px var(--pad) 8px; display: flex; align-items: flex-start; gap: 44px; }
.article-main { flex: 1 1 auto; min-width: 0; width: 100%; }
.article-aside { flex: 0 0 320px; width: 320px; position: sticky; top: 88px; display: flex; flex-direction: column; gap: 20px; }
.article-layout--full { display: block; }
.article-layout--full .article-main { max-width: 780px; margin: 0 auto; }
@media (max-width: 980px) {
    .article-layout { flex-direction: column; gap: 32px; }
    .article-main, .article-aside { flex: 1 1 auto; width: 100%; }
    .article-aside { position: static; }
}

.article__cat { align-self: flex-start; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--link); background: var(--accent-soft); padding: 4px 11px; border-radius: 999px; }
.article__byline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-size: 14px; }
.article__author { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; color: var(--ink); }
.article__avatar { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; font-size: 12px; font-weight: 800; }

.article__share { display: flex; align-items: center; gap: 10px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.article__share-label { font-size: 13px; font-weight: 700; color: var(--muted); margin-right: 2px; }
.share-btn { width: 38px; height: 38px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); background: var(--surface); color: var(--ink-soft); cursor: pointer; transition: transform .15s, border-color .15s, color .15s, background .15s; position: relative; }
.share-btn:hover { transform: translateY(-2px); border-color: var(--accent-line); color: var(--link); }
.share-btn--x:hover { background: #0f0f0f; color: #fff; border-color: #0f0f0f; }
.share-btn--fb:hover { background: #1877F2; color: #fff; border-color: #1877F2; }
.share-btn--in:hover { background: #0A66C2; color: #fff; border-color: #0A66C2; }
.share-btn--copy.is-copied { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.share-btn--copy.is-copied::after { content: "✓"; font-size: 16px; font-weight: 800; line-height: 1; }
.share-btn--copy.is-copied svg { display: none; }

.aside-card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 18px; }
.aside-card__title { font-family: var(--body); font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--ink); margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.aside-posts { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.aside-post { display: flex; gap: 12px; align-items: center; }
.aside-post__thumb { flex: 0 0 auto; width: 60px; height: 46px; border-radius: 9px; overflow: hidden; background: linear-gradient(135deg, var(--accent-soft), var(--chip)); display: grid; place-items: center; }
.aside-post__thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aside-post__thumb span { font-family: var(--display); font-weight: 800; color: var(--accent-line); font-size: 18px; }
.aside-post__meta { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.aside-post__title { font-size: 14px; font-weight: 600; line-height: 1.3; color: var(--ink); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.aside-post:hover .aside-post__title { color: var(--link); }
.aside-post__meta .muted { font-size: 12px; }
.aside-card__html { font-size: 14px; }
.article-aside .ad-slot { margin: 0; }
[dir="rtl"] .article-layout { direction: rtl; }

.article__head { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.article__head h1 { font-family: var(--display); font-size: clamp(32px, 5vw, 48px); font-weight: var(--display-weight); line-height: 1.1; letter-spacing: var(--display-tracking); }
.article__cover { width: 100%; border-radius: 16px; margin-bottom: 28px; display: block; }
/* Article body typography — consistent vertical rhythm.
   Blocks carry a single bottom gap; headings add space ABOVE and hug the text BELOW. */
.rich-text { font-size: 17px; line-height: 1.7; color: var(--ink-soft); overflow-wrap: break-word; }
.rich-text > :first-child { margin-top: 0 !important; }
.rich-text > :last-child { margin-bottom: 0 !important; }

/* One uniform gap under every text block (no top margins, so spacing never doubles up) */
.rich-text p,
.rich-text ul,
.rich-text ol,
.rich-text blockquote,
.rich-text figure,
.rich-text pre,
.rich-text table,
.rich-text hr { margin: 0 0 1.15em; }

/* Headings: clear separation above, tight to the content that follows */
.rich-text h2 { font-family: var(--display); font-size: 25px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); line-height: 1.25; color: var(--ink); margin: 2em 0 .6em; }
.rich-text h3 { font-size: 20px; font-weight: 800; line-height: 1.3; color: var(--ink); margin: 1.7em 0 .5em; }
.rich-text h4 { font-size: 17px; font-weight: 700; line-height: 1.35; color: var(--ink); margin: 1.5em 0 .4em; }

/* A heading right after an image or right at the top needs less space above */
.rich-text img + h2, .rich-text figure + h2 { margin-top: 1em; }
.rich-text img + h3, .rich-text figure + h3 { margin-top: .9em; }

.rich-text a { text-decoration: underline; text-underline-offset: 3px; }
.rich-text strong { color: var(--ink); font-weight: 700; }
.rich-text img { max-width: 100%; height: auto; border-radius: 12px; }
.rich-text > img:first-child, .rich-text > figure:first-child { margin-bottom: .4em; }

/* Lists */
.rich-text ul, .rich-text ol { padding-left: 1.35em; }
.rich-text li { margin: .4em 0; padding-left: .2em; }
.rich-text li::marker { color: var(--accent); }
.rich-text ol li::marker { color: var(--muted); font-weight: 600; }
.rich-text li > ul, .rich-text li > ol { margin: .4em 0 0; }

.rich-text blockquote { padding: 6px 0 6px 20px; border-left: 4px solid var(--accent); font-style: italic; color: var(--muted); }
.rich-text pre { background: #0F1022; color: #E5E7F0; padding: 16px; border-radius: 10px; overflow-x: auto; font-size: 14px; }
.rich-text code { background: var(--chip); padding: 2px 5px; border-radius: 4px; font-size: .92em; }
.rich-text pre code { background: none; padding: 0; }
.rich-text table { width: 100%; border-collapse: collapse; font-size: 16px; display: block; overflow-x: auto; }
.rich-text th, .rich-text td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.rich-text hr { border: 0; border-top: 1px solid var(--line); }
.rich-text--small { font-size: 16px; }
.rich-text--small h2 { font-size: 22px; margin-top: 0; }
.rich-text__note { font-size: 13px; color: var(--ink-soft); opacity: .75; margin-top: .6em; font-style: italic; }

/* ---------- Forms ---------- */
.form { display: flex; flex-direction: column; gap: 20px; }
.form__about { margin: 0; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form__field { display: flex; flex-direction: column; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.form__field legend { font-weight: 700; margin-bottom: 8px; }
.form__field > label { font-weight: 600; font-size: 15px; }
.form input[type="text"], .form input[type="email"], .form input[type="url"], .form input[type="password"], .form textarea {
  width: 100%; min-height: 46px; padding: 10px 14px; border-radius: var(--radius-sm); border: 1px solid var(--field-line); background: var(--field-bg, #fff); font: inherit; font-size: 16px; color: var(--ink);
}
.form textarea { resize: vertical; }
.form input:focus, .form textarea:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 4px var(--accent-soft); }
.form__hint { margin: 0; font-size: 14px; color: var(--muted); }
.form__error { margin: 0; font-size: 14px; color: var(--danger); font-weight: 600; }
.form__inline { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.radio, .checkbox { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; padding: 6px 0; cursor: pointer; }
.radio input, .checkbox input { margin-top: 4px; accent-color: var(--accent); width: 18px; height: 18px; flex-shrink: 0; }
.checkbox { background: var(--surface-alt); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 14px; line-height: 1.5; }
.checkbox--plain { background: none; border: 0; padding: 0; }
.form .btn { align-self: flex-start; }
.form .btn--block { align-self: stretch; }
.file-input { padding: 14px; border: 2px dashed var(--accent-line); border-radius: 12px; background: var(--accent-soft); color: var(--ink); font: inherit; font-size: 15px; width: 100%; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.notice { padding: 14px 16px; border-radius: 12px; line-height: 1.5; }
.notice--ok { background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-ink); }
.notice--error { background: var(--danger-bg); border: 1px solid var(--danger-line); color: var(--danger-ink); }

/* ---------- Auth + account ---------- */
.auth { padding: 48px var(--pad) 24px; display: flex; justify-content: center; }
.auth__card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-md); }
.auth__card h1 { font-family: var(--display); font-size: 30px; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }
.auth__card .muted { margin: -8px 0 0; font-size: 15px; }
.auth__switch { margin: 4px 0 0; text-align: center; font-size: 15px; }
.auth__switch a, .form__inline a, .checkbox a { text-decoration: underline; text-underline-offset: 3px; }
.account-nav { align-items: center; }
.inline-form { display: inline; margin: 0; }
.inline-form button { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--line); background: transparent; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted); }
.inline-form button:hover { color: var(--link); }
.danger-zone summary { cursor: pointer; font-weight: 700; color: var(--danger-ink); }
.danger-zone[open] summary { margin-bottom: 4px; }
.submission-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.submission-list .panel { gap: 8px; }
.submission-list__head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.submission-list .muted { margin: 0; }
.submission-list__message { margin: 0; padding: 12px 14px; background: var(--surface-alt); border-radius: 10px; font-size: 15px; }
.submission-list .btn { align-self: flex-start; }
.status { font-size: 13px; font-weight: 700; padding: 5px 10px; border-radius: 999px; white-space: nowrap; }
.status--pending { background: var(--warn-bg); color: var(--warn-ink); }
.status--approved { background: var(--ok-bg); color: var(--ok-ink); }
.status--rejected { background: var(--danger-bg); color: var(--danger-ink); }

/* ---------- Ads ---------- */
.ad-slot { margin: 16px auto; padding: 8px 0; text-align: center; max-width: 100%; overflow: hidden; }
.ad-slot--wide { grid-column: 1 / -1; margin: 0; }
.ad-slot__label { display: block; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
body > .ad-slot { padding: 12px var(--pad); }

/* ---------- Footer ---------- */
.site-footer { background: var(--footer-bg); color: var(--footer-muted); margin-top: 56px; position: relative; }
.site-footer::before { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 3px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.site-footer__inner { padding: 52px var(--pad) 36px; display: flex; gap: 56px; flex-wrap: wrap; }
.site-footer__inner > div { display: flex; flex-direction: column; gap: 10px; font-size: 14px; min-width: 150px; }
.site-footer__about { max-width: 320px; }
.site-footer__about .brand__name { color: var(--footer-ink, #fff); }
.site-footer__about p { margin: 0; line-height: 1.6; }
.site-footer .brand__logo { height: 34px; margin-bottom: 4px; }
.site-footer h2 { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--footer-ink, #fff); margin-bottom: 4px; }
.site-footer a:hover { color: var(--footer-ink, #fff); }
.site-footer__bottom { padding: 20px var(--pad); border-top: 1px solid var(--footer-line); font-size: 13px; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer__copy { min-width: 0; }

/* Language chooser: compact drop-up */
.lang-dropup { position: relative; flex-shrink: 0; }
.lang-dropup__toggle {
    list-style: none; cursor: pointer;
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--footer-line);
    background: color-mix(in srgb, var(--footer-ink, #fff) 6%, transparent);
    color: var(--footer-ink, #fff); font-size: 13px; font-weight: 600;
    transition: border-color .15s, background .15s;
    user-select: none;
}
.lang-dropup__toggle::-webkit-details-marker { display: none; }
.lang-dropup__toggle:hover { border-color: color-mix(in srgb, var(--accent) 55%, var(--footer-line)); background: color-mix(in srgb, var(--footer-ink, #fff) 11%, transparent); }
.lang-dropup__globe { font-size: 15px; line-height: 1; }
.lang-dropup__toggle-flag { width: 22px; height: 16px; border-radius: 3px; object-fit: cover; box-shadow: 0 0 0 1px rgba(0,0,0,.12); display: block; }
.lang-dropup__cur-code { font-size: 10px; font-weight: 800; letter-spacing: .06em; padding: 2px 6px; border-radius: 6px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.lang-dropup__cur-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lang-dropup__chev { display: inline-flex; color: var(--footer-muted); transition: transform .2s ease; }
.lang-dropup[open] .lang-dropup__chev { transform: rotate(180deg); }

.lang-dropup__panel {
    position: absolute; bottom: calc(100% + 10px); right: 0; z-index: 60;
    width: min(340px, 78vw);
    background: var(--surface); color: var(--ink);
    border: 1px solid var(--line); border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 12px;
    animation: langUp .16s ease;
}
@keyframes langUp { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.lang-dropup__search { position: relative; margin-bottom: 10px; }
.lang-dropup__search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.lang-dropup__search input {
    width: 100%; box-sizing: border-box;
    padding: 10px 12px 10px 36px; border-radius: 10px;
    border: 1px solid var(--field-line); background: var(--field-bg); color: var(--ink);
    font-size: 14px;
}
.lang-dropup__search input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.lang-dropup__grid { list-style: none; margin: 0; padding: 4px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; max-height: 320px; overflow-y: auto; }
.lang-dropup__grid a {
    display: flex; flex-direction: column; align-items: center; gap: 5px; text-align: center;
    padding: 12px 6px; border-radius: 12px;
    border: 1px solid transparent;
    color: var(--ink-soft); text-decoration: none;
    transition: background .12s, border-color .12s, color .12s;
}
.lang-dropup__grid a:hover { background: var(--chip); color: var(--ink); }
.lang-dropup__grid a.is-active { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #fff; }
.lang-dropup__flag { width: 30px; height: 22px; border-radius: 4px; object-fit: cover; box-shadow: 0 1px 3px rgba(0,0,0,.18), 0 0 0 1px rgba(0,0,0,.08); display: block; }
.lang-dropup__code { font-size: 11px; font-weight: 800; letter-spacing: .06em; padding: 3px 8px; border-radius: 7px; background: var(--chip); color: var(--ink-soft); }
.lang-dropup__grid a:hover .lang-dropup__code { background: var(--surface); }
.lang-dropup__grid a.is-active .lang-dropup__code { background: rgba(255,255,255,.24); color: #fff; }
.lang-dropup__name { font-size: 12px; font-weight: 600; line-height: 1.2; overflow: hidden; text-overflow: ellipsis; width: 100%; white-space: nowrap; }
.lang-dropup__empty { text-align: center; color: var(--muted); font-size: 13px; padding: 18px 0 8px; margin: 0; }
[dir="rtl"] .lang-dropup__panel { right: auto; left: 0; }
@media (max-width: 560px) {
    .lang-dropup { position: static; }
    .lang-dropup__panel { right: auto; left: var(--pad); width: calc(100vw - var(--pad) * 2); }
    .lang-dropup__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    [dir="rtl"] .lang-dropup__panel { left: auto; right: var(--pad); }
}

.social { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.social a { display: inline-block; padding: 5px 11px; border: 1px solid var(--footer-line); border-radius: 999px; font-size: 13px; }
.social a:hover { border-color: var(--footer-muted); }

/* ---------- Back to top ---------- */
.to-top { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 40; width: 44px; height: 44px; border-radius: 999px; border: 0; background: var(--ink); color: var(--surface); font-size: 20px; cursor: pointer; box-shadow: var(--shadow-md); opacity: 0; transform: translateY(12px); pointer-events: none; transition: opacity .2s, transform .2s; }
.to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .font-grid, .font-grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero__inner { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 1100px) {
  .font-columns { grid-template-columns: minmax(0, 1fr); }
  .font-info { position: static; }
}
@media (max-width: 1000px) {
  .post-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .post-featured { grid-template-columns: 1fr; }
}
/* Download bar pinned to the bottom of the font page on phones and tablets */
.mobile-dl { display: none; }

/* ---------- Tablet and phone ---------- */
@media (max-width: 900px) {
  /* Header: logo + search button + hamburger; menu slides down as a panel */
  .site-header { position: sticky; }
  .site-header__inner { min-height: 60px; padding: 8px 16px; gap: 10px; flex-wrap: wrap; position: relative; }
  .brand__logo { height: 32px; max-width: 170px; }
  .brand__name { font-size: 20px; }
  .brand__mark { width: 34px; height: 34px; }
  .header-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
  .search { display: none; order: 5; flex: 1 1 100%; max-width: none; height: 46px; margin-bottom: 4px; }
  .site-header.search-open .search { display: flex; }
  .search input { font-size: 16px; } /* 16px stops iPhones zooming in when typing */

  .main-nav { display: none; position: absolute; top: 100%; left: 0; right: 0; margin: 0; padding: 8px 16px 18px; flex-direction: column; align-items: stretch; gap: 0; background: var(--surface); border-bottom: 1px solid var(--line); box-shadow: var(--shadow-lg); max-height: calc(100vh - 70px); overflow-y: auto; }
  .main-nav.is-open { display: flex; }
  /* Dim the page behind the open menu */
  .site-header.menu-open { background: var(--surface); }
  body.menu-is-open::after { content: ""; position: fixed; inset: 0; z-index: 40; background: rgba(10, 12, 20, .35); }
  .main-nav a { padding: 14px 4px; font-size: 17px; border-bottom: 1px solid var(--line-soft); color: var(--ink); }
  .main-nav a.is-active { color: var(--link); }
  .main-nav .header-button { margin-top: 14px; border-bottom: 0; border-radius: 12px; min-height: 50px; justify-content: center; color: var(--on-accent); }

  /* Page layout: content first, then the sidebar */
  .with-sidebar { flex-direction: column; align-items: stretch; gap: 28px; padding-top: 24px; padding-bottom: 24px; }
  .with-sidebar > .sidebar { order: 2; width: 100%; }
  .sidebar__list { max-height: 330px; }
  .letters { grid-template-columns: repeat(9, minmax(0, 1fr)); }
  .page-wrap { padding-top: 24px; padding-bottom: 24px; }
  .breadcrumb { padding-top: 18px; }

  /* Inputs at 16px so iPhones don't zoom the page */
  .tester2__text, .tester2 select, .preview-controls__text input, .form input, .form textarea { font-size: 16px; }

  .mobile-dl { display: flex; gap: 10px; align-items: center; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -8px 24px -12px rgba(15, 17, 34, .25); }
  .mobile-dl .btn { flex: 1; min-height: 50px; border-radius: 12px; }
  .mobile-dl__name { flex: 0 1 40%; min-width: 0; font-size: 14px; font-weight: 700; line-height: 1.25; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  body.has-mobile-dl { padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)); }
  body.has-mobile-dl .to-top { bottom: calc(84px + env(safe-area-inset-bottom, 0px)); }

  .site-footer { margin-top: 40px; }
  .site-footer__inner { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; padding-top: 40px; padding-bottom: 28px; }
  .site-footer__about { grid-column: 1 / -1; max-width: none; }
  .site-footer__inner > div { min-width: 0; }
}

@media (max-width: 600px) {
  .font-grid, .font-grid--4, .post-grid, .form__row, .mockups, .similar-grid { grid-template-columns: 1fr; }

  /* Hero */
  .hero { padding-top: 32px; padding-bottom: 30px; }
  .hero h1 { font-size: 32px; }
  .hero p { font-size: 15px; margin-top: 12px; }
  /* Search: a normal field on top of a full-width button — no chunky white wrapper */
  /* Search: one clean row — input grows, button sits beside it */
  .hero__search { margin-top: 22px; flex-direction: row; align-items: stretch; background: #fff; border-radius: 14px; padding: 5px; gap: 5px; box-shadow: var(--shadow-lg); }
  .hero__search input { flex: 1; min-width: 0; height: 46px; line-height: normal; font-size: 16px; padding: 0 14px; background: transparent; border: 0; border-radius: 10px; box-shadow: none; text-overflow: ellipsis; }
  .hero__search input::placeholder { color: #6b7280; }
  .hero__search .btn { flex-shrink: 0; width: auto; min-height: 46px; padding: 0 20px; border-radius: 10px; font-size: 16px; }
  /* Chips wrap onto multiple lines instead of running off the screen edge */
  .hero__chips { margin-top: 20px; flex-wrap: wrap; overflow: visible; margin-right: 0; padding-right: 0; row-gap: 10px; }
  .hero__chips > span { flex-basis: 100%; margin-bottom: 2px; }
  .hero__chips a { padding: 8px 14px; }
  /* Stats: two per row so the numbers have room to breathe */
  .hero__stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .hero__stats div:last-child { grid-column: 1 / -1; }
  .hero__stats div { padding: 14px 16px; }
  .hero__stats dd { font-size: 24px; }

  /* Headings + list toolbar */
  .section-head h2, .page-head h1, .section-title { font-size: 26px; }
  .preview-controls { gap: 10px; padding: 12px; }
  .preview-controls__text { flex-basis: 100%; }
  .preview-controls__size { flex: 1 1 0; min-width: 0; }
  .preview-controls .btn { flex-shrink: 0; }
  .font-card__preview { height: 104px; }
  .page-head__row { align-items: flex-start; }
  .sort { width: 100%; }
  .sort a { flex: 1; text-align: center; padding: 8px 6px; }
  .page-head__filters { width: 100%; }
  .webfont-option { flex-direction: column; align-items: stretch; }

  /* Font page */
  .font-heading { font-size: 28px; }
  .badges { min-width: 0; flex-wrap: nowrap; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
  .badges::-webkit-scrollbar { display: none; }
  .badges li { flex-shrink: 0; }
  .tester2 { padding: 12px; gap: 10px; }
  .tester2__row { gap: 8px; }
  .tester2__label { min-width: 0; width: 100%; margin-bottom: -2px; }
  .tester2__text { flex-basis: 100%; height: 44px; }
  .seg { flex-wrap: nowrap; overflow-x: auto; width: 100%; scrollbar-width: none; }
  .seg::-webkit-scrollbar { display: none; }
  .seg button { flex: 1 0 auto; height: 36px; }
  .tester2__range { flex: 1 1 calc(100% - 70px); min-width: 0; }
  .tester2 select { flex: 1 1 40%; height: 40px; }
  .swatch { height: 40px; }
  .icon-toggle { width: 40px; height: 40px; }
  .tester2__actions { display: grid; grid-template-columns: 1fr 1fr; }
  .tester2__actions .btn { min-height: 42px; }
  .tester2__status { grid-column: 1 / -1; margin: 0; }
  .tester2__status:empty { display: none; }
  .tabs2__panel { padding: 14px; }
  .stage { min-height: 190px; padding: 18px; }
  .style-row__sample { font-size: 26px; }
  .glyphs { grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); }
  .glyphs span { font-size: 22px; }
  .font-info__card { padding: 16px; }
  .font-info__list div { grid-template-columns: 96px minmax(0, 1fr); }

  /* Blog, forms, account */
  .rich-text { font-size: 16.5px; }
  .post-featured > div { padding: 20px; }
  .article { padding-top: 24px; }
  .article__head { gap: 8px; margin-bottom: 18px; }
  .article__cover { margin-bottom: 20px; border-radius: 12px; }
  .rich-text h2 { font-size: 22px; margin-top: 1.7em; }
  .rich-text h3 { font-size: 19px; margin-top: 1.5em; }
  .auth { padding-top: 24px; }
  .auth__card { padding: 22px; }
  .panel { padding: 18px; }
  .account-nav { min-width: 0; flex-wrap: nowrap; overflow-x: auto; margin-right: -20px; padding-right: 20px; scrollbar-width: none; }
  .account-nav::-webkit-scrollbar { display: none; }
  .account-nav > * { flex-shrink: 0; }
  .dialog { padding: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* Standalone reviews section below the preview box */
.reviews-box { margin-top: 20px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.reviews-box__title { margin: 0 0 14px; font-size: 20px; }

/* ---- Reviews ---- */
.reviews__summary { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.reviews__avg { font-size: 30px; font-weight: 800; line-height: 1; }
.reviews__stars { color: #f5a623; letter-spacing: 2px; font-size: 18px; }
.reviews__count { color: var(--ink-soft); font-size: 14px; }
.reviews__flash { background: rgba(46,160,67,.12); border: 1px solid rgba(46,160,67,.35); color: #1a7f37; padding: 8px 12px; border-radius: 8px; margin: 10px 0; font-size: 14px; }
.review-form { margin: 16px 0 8px; padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
.review-form h3 { margin: 0 0 10px; font-size: 16px; }
.review-form textarea { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; margin-top: 8px; background: var(--ground); color: var(--ink); }
.review-form__actions { margin-top: 10px; }
.review-form__remove { margin-top: 6px; }
.btn--small { padding: 6px 12px; font-size: 13px; }
/* Interactive star rating: reverse-ordered radios so hover/checked fills left-to-right */
.review-form__stars { display: inline-flex; flex-direction: row-reverse; justify-content: flex-end; gap: 2px; }
.review-form__stars input { position: absolute; opacity: 0; width: 0; height: 0; }
.review-form__stars label { font-size: 28px; color: var(--line); cursor: pointer; line-height: 1; transition: color .1s; }
.review-form__stars label:hover, .review-form__stars label:hover ~ label,
.review-form__stars input:checked ~ label { color: #f5a623; }
.review-form__stars input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.review-list { list-style: none; margin: 18px 0 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.review-item { border-top: 1px solid var(--line); padding-top: 14px; }
.review-item__head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.review-item__stars { color: #f5a623; letter-spacing: 1px; }
.review-item__name { font-weight: 600; }
.review-item__date { font-size: 13px; }
.review-item__body { margin: 6px 0 0; color: var(--ink-soft); }

/* ---- Font pairings ---- */
.pairings { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-top: 10px; }
.pairing-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 14px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.pairing-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.pairing-card__sample { font-size: 34px; line-height: 1; }
.pairing-card__name { font-size: 13px; color: var(--ink-soft); text-align: center; }

/* ---- Collections ---- */
.collection-create { border: 1px solid var(--line); border-radius: 12px; padding: 16px; margin: 12px 0 18px; background: var(--card); display: flex; flex-direction: column; gap: 10px; }
.collection-create h2 { margin: 0; font-size: 16px; }
.collection-create input[type="text"] { width: 100%; box-sizing: border-box; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; background: var(--ground); color: var(--ink); }
.collection-create__row { display: flex; gap: 8px; }
.collection-create__row input { flex: 1; }
.collection-list { display: flex; flex-direction: column; gap: 8px; }
.collection-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); text-decoration: none; color: inherit; }
.collection-row:hover { border-color: var(--accent); }
.collection-row__name { font-weight: 600; }
.collection-row__meta { font-size: 13px; }
.collection-edit { margin: 12px 0 18px; }
.collection-edit summary { cursor: pointer; color: var(--accent); font-weight: 600; font-size: 14px; }
.collection-edit .collection-create { margin-top: 10px; }
.collection-edit__actions { margin-top: 4px; }
.share-line { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; color: var(--ink-soft); }
.share-input { flex: 1; min-width: 220px; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; background: var(--ground); color: var(--ink); }
.field-error { color: var(--accent); font-size: 13px; margin: 0; }
/* Add-to-collection dropdown on the font page */
.add-collection { margin-top: 8px; position: relative; }
.add-collection summary { list-style: none; }
.add-collection summary::-webkit-details-marker { display: none; }
.add-collection__menu { margin-top: 8px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); padding: 8px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow-lg); }
.add-collection__item { width: 100%; text-align: left; background: none; border: 0; padding: 8px 10px; border-radius: 8px; cursor: pointer; font: inherit; font-size: 14px; color: var(--ink); }
.add-collection__item:hover { background: var(--chip); }
.add-collection__item.is-in { color: var(--accent); font-weight: 600; }
.add-collection__empty { padding: 4px 10px; font-size: 13px; }
.add-collection__new { display: flex; gap: 6px; border-top: 1px solid var(--line); margin-top: 4px; padding-top: 8px; }
.add-collection__new input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: 8px; padding: 8px 10px; font: inherit; font-size: 13px; background: var(--ground); color: var(--ink); }

/* ---- Answer block + FAQ (GEO) ---- */
.font-answer { font-size: 16px; line-height: 1.6; color: var(--ink-soft); background: var(--surface); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; padding: 12px 16px; margin: 4px 0 18px; }
.faq-list { display: flex; flex-direction: column; gap: 8px; }
.faq-item { border: 1px solid var(--line); border-radius: 10px; background: var(--card); padding: 0; }
.faq-item summary { cursor: pointer; font-weight: 600; padding: 14px 16px; list-style: none; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: '+'; float: right; color: var(--muted); font-weight: 400; }
.faq-item[open] summary::after { content: '−'; }
.faq-item p { margin: 0; padding: 0 16px 14px; color: var(--ink-soft); line-height: 1.6; }
.faq-updated { font-size: 13px; margin-top: 12px; }

/* ---- Tools ---- */
.tools-intro { color: var(--ink-soft); font-size: 17px; max-width: 60ch; margin: -4px 0 20px; }
.tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tool-card { display: flex; flex-direction: column; gap: 8px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); text-decoration: none; color: inherit; transition: border-color .15s, transform .15s; }
.tool-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.tool-card__title { margin: 0; font-size: 17px; }
.tool-card__desc { margin: 0; font-size: 14px; color: var(--ink-soft); line-height: 1.5; }
.tool-card__go { margin-top: auto; color: var(--accent); font-weight: 600; font-size: 14px; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.crumbs a { color: var(--accent); }
.tool-form { display: flex; flex-direction: column; gap: 14px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin: 8px 0 24px; }
.tool-form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: 14px; }
.tool-form input[type="text"], .tool-form select, .tool-form textarea { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font: inherit; font-size: 15px; font-weight: 400; background: var(--ground); color: var(--ink); }
.tool-form__row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-form__formats { border: 1px solid var(--line); border-radius: 8px; padding: 12px; display: flex; gap: 16px; flex-wrap: wrap; }
.tool-form__formats legend { font-size: 13px; font-weight: 600; padding: 0 6px; }
.tool-form__note { font-size: 13px; }
.filedrop { position: relative; border: 2px dashed var(--line); border-radius: 12px; padding: 24px; text-align: center; cursor: pointer; align-items: center; }
.filedrop:hover { border-color: var(--accent); }
.filedrop input[type="file"] { width: 100%; }
.filedrop span { color: var(--ink-soft); font-weight: 400; font-size: 14px; }
.code-block { position: relative; margin: 8px 0 20px; }
.code-block pre { background: #1e2130; color: #e6e8ef; border-radius: 10px; padding: 16px; overflow-x: auto; font-size: 13px; line-height: 1.55; }
.code-copy { position: absolute; top: 10px; right: 10px; background: rgba(255,255,255,.14); color: #fff; border: 0; border-radius: 6px; padding: 5px 10px; font-size: 12px; font-weight: 600; cursor: pointer; }
.code-copy:hover { background: rgba(255,255,255,.28); }
.inspect-list { display: grid; gap: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.inspect-list > div { display: grid; grid-template-columns: 160px 1fr; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.inspect-list > div:last-child { border-bottom: 0; }
.inspect-list dt { font-weight: 600; color: var(--ink-soft); margin: 0; }
.inspect-list dd { margin: 0; word-break: break-word; }
.tool-about { border-top: 1px solid var(--line); padding-top: 18px; margin-top: 8px; }
.tool-about h2 { font-size: 17px; }
.tool-about p { color: var(--ink-soft); line-height: 1.65; }
@media (max-width: 600px) { .tool-form__row { grid-template-columns: 1fr; } .inspect-list > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---- Language switcher ---- */
.lang-switch { position: relative; }
.lang-switch > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; font-weight: 600; font-size: 14px; color: var(--ink-soft); }
.lang-switch > summary::-webkit-details-marker { display: none; }
.lang-switch > summary:hover { background: var(--chip); }
.lang-switch__globe { font-size: 15px; }
.lang-switch__menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 50; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; max-height: 60vh; overflow-y: auto; min-width: 200px; }
.lang-switch__menu a { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 8px; color: var(--ink); text-decoration: none; font-size: 14px; white-space: nowrap; }
.lang-switch__menu a:hover { background: var(--chip); }
.lang-switch__menu a.is-active { color: var(--accent); font-weight: 700; }
.lang-switch__label { font-size: 11px; font-weight: 700; color: var(--muted); width: 26px; }
.lang-switch__menu a.is-active .lang-switch__label { color: var(--accent); }
@media (max-width: 900px) { .lang-switch__menu { right: auto; left: 0; } }

/* ---- RTL (Arabic, Urdu) ---- */
[dir="rtl"] body { text-align: right; }
[dir="rtl"] .lang-switch__menu { right: auto; left: 0; }
[dir="rtl"] .lang-switch__label { width: 26px; }
[dir="rtl"] .font-answer { border-left: 0; border-right: 3px solid var(--accent); border-radius: 8px 0 0 8px; }
[dir="rtl"] .crumbs, [dir="rtl"] .faq-item summary::after { text-align: right; }
[dir="rtl"] .faq-item summary::after { float: left; }
[dir="rtl"] .inspect-list > div { grid-template-columns: 1fr 160px; }
[dir="rtl"] .code-copy { right: auto; left: 10px; }
[dir="rtl"] .review-form__stars { flex-direction: row; }
/* Let flex/grid rows follow the writing direction automatically */
[dir="rtl"] .sort, [dir="rtl"] .page-head__filters, [dir="rtl"] .badges, [dir="rtl"] .hero__chips { direction: rtl; }
