/* style.css — Rabbit · Social Font Converter */
:root {
  --bg: #fffdf9;
  --surface: #ffffff;
  --surface-2: #fbf5ec;
  --border: #efe6d8;
  --ink: #2b2118;          /* marrone scuro del logo */
  --text: #2b2118;
  --muted: #8a7d6c;
  --brand: #ff8002;        /* arancione dominante */
  --brand-dark: #e46f00;
  --brand-soft: #fff1e0;
  --yellow: #ffc23d;
  --yellow-soft: #fff6e2;
  --ok: #1f9d55;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(43, 33, 24, 0.05), 0 12px 30px rgba(43, 33, 24, 0.08);
  --shadow-sm: 0 1px 2px rgba(43, 33, 24, 0.06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Solo tema CHIARO. Il brand è bianco + arancione e il logo ha tratti scuri
   che funzionano solo su sfondo chiaro: ignoriamo la preferenza "dark" del
   sistema per non rendere il logo invisibile. */
:root { color-scheme: light; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { width: 100%; max-width: 940px; margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  display: flex; align-items: center; gap: 14px 20px;
  flex-wrap: wrap; padding: 12px 0;
}
.brand { display: inline-flex; align-items: center; text-decoration: none; }
.brand-logo { height: 50px; width: auto; display: block; }

/* Selettore lingua */
.lang-switcher {
  display: flex; gap: 4px; margin-left: auto;
  max-width: 100%; overflow-x: auto; scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.lang-switcher::-webkit-scrollbar { display: none; }
.lang-switcher a {
  color: var(--muted); text-decoration: none; font-size: 0.82rem; font-weight: 700;
  padding: 6px 11px; border-radius: 9px; border: 1px solid transparent; white-space: nowrap;
  transition: all .15s;
}
.lang-switcher a:hover { color: var(--ink); background: var(--surface-2); }
.lang-switcher a[aria-current="true"] { color: #fff; background: var(--brand); }

/* ---------- Hero ---------- */
.hero { padding: 52px 20px 8px; text-align: center; }
.hero h1 {
  margin: 0 auto 16px; max-width: 780px;
  font-size: clamp(1.8rem, 5vw, 2.9rem);
  line-height: 1.12; letter-spacing: -0.03em; font-weight: 900;
}
.lead { margin: 0 auto; max-width: 660px; color: var(--muted); font-size: clamp(1rem, 2.4vw, 1.12rem); }
.lead b { color: var(--ink); font-weight: 700; }
.lead strong { color: var(--brand-dark); }

/* ---------- Tool ---------- */
.tool { padding: 30px 20px 10px; }
.editor-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.input-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.input-head label { font-weight: 800; font-size: 0.98rem; }
.charcount { color: var(--muted); font-size: 0.82rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.btn-ghost {
  border: 1px solid var(--border); background: var(--surface-2);
  color: var(--muted); border-radius: 10px; padding: 9px 18px;
  font-size: 0.88rem; font-weight: 700; cursor: pointer; transition: all .15s;
}
.btn-ghost:hover { color: var(--ink); border-color: var(--brand); }

.toolbar-hint { margin: 0 0 6px; color: var(--muted); font-size: 0.84rem; }
.paste-hint {
  margin: 0 0 14px; padding: 10px 14px; font-size: 0.84rem; line-height: 1.45;
  color: var(--ink); background: var(--yellow-soft);
  border: 1px solid color-mix(in srgb, var(--yellow) 45%, var(--border));
  border-left: 4px solid var(--yellow); border-radius: 10px;
}

.toolbar {
  display: flex; flex-wrap: wrap; gap: 8px;
  padding-bottom: 16px; margin-bottom: 16px;
  border-bottom: 1px solid var(--border);
}
.tool-btn {
  border: 1px solid var(--border); background: var(--surface-2); color: var(--ink);
  border-radius: 10px; padding: 8px 14px; font-size: 1.02rem; line-height: 1.1;
  cursor: pointer; transition: all .15s; white-space: nowrap;
}
.tool-btn:hover { background: var(--brand-soft); border-color: var(--brand); }
.tool-btn:active { transform: translateY(1px); }
.tool-btn:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }

.editor {
  min-height: 160px; outline: none;
  font-size: clamp(1.1rem, 3vw, 1.32rem); line-height: 1.6; color: var(--text);
  word-break: break-word; overflow-wrap: anywhere;
  padding: 6px 2px; cursor: text;
}
.editor:focus-visible { outline: none; }
.editor.is-empty::before {
  content: attr(data-placeholder);
  color: var(--muted); opacity: .7; pointer-events: none;
}

.editor-actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
.btn-primary {
  border: 1px solid var(--brand); background: var(--brand); color: #fff;
  border-radius: 12px; padding: 12px 28px; font-size: 0.98rem; font-weight: 800;
  cursor: pointer; transition: all .15s; box-shadow: 0 6px 16px rgba(255,128,2,.28);
}
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary.copied { background: var(--ok); border-color: var(--ok); box-shadow: none; }

/* ---------- Contenuto / SEO ---------- */
.content { padding: 48px 20px 10px; }
.content h2 { font-size: clamp(1.35rem, 3.5vw, 1.7rem); letter-spacing: -0.02em; margin: 38px 0 14px; font-weight: 900; }
.content > p { color: var(--muted); max-width: 720px; }
.content p strong, .content li strong { color: var(--ink); }
.steps { color: var(--muted); padding-left: 22px; max-width: 720px; }
.steps li { margin-bottom: 8px; }

/* Breadcrumb (pagine-stile) */
.crumbs { color: var(--muted); font-size: 0.85rem; margin: 0 0 14px; }
.crumbs a { color: var(--brand-dark); text-decoration: none; font-weight: 700; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span { opacity: 0.5; margin: 0 6px; }

/* Alfabeto reso nello stile */
.alpha { display: grid; gap: 10px; margin: 6px 0 4px; }
.alpha-row {
  background: var(--surface); border: 1px solid var(--border); border-radius: 12px;
  padding: 14px 16px; font-size: 1.3rem; line-height: 1.7;
  word-break: break-word; overflow-wrap: anywhere;
}

/* Hub di stili (interlinking interno) */
.style-hub {
  list-style: none; padding: 0; margin: 6px 0 4px;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px;
}
.style-hub a {
  display: block; padding: 11px 14px; border: 1px solid var(--border); border-radius: 11px;
  background: var(--surface); color: var(--ink); text-decoration: none; font-weight: 700;
  font-size: 0.92rem; transition: all 0.15s;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.style-hub a:hover { border-color: var(--brand); background: var(--brand-soft); }

.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: 12px; padding: 2px 18px; transition: border-color .15s;
}
.faq details[open] { border-color: color-mix(in srgb, var(--brand) 45%, var(--border)); }
.faq summary {
  cursor: pointer; font-weight: 800; padding: 15px 28px 15px 0; list-style: none;
  position: relative; color: var(--ink);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; position: absolute; right: 0; top: 12px;
  color: var(--brand); font-weight: 800; font-size: 1.4rem; line-height: 1;
}
.faq details[open] summary::after { content: "\2013"; }
.faq details p { margin: 0 0 16px; color: var(--muted); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 48px; padding: 30px 0; }
.site-footer .wrap { text-align: center; }
.footer-brand { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.footer-brand img { width: 30px; height: 30px; }
.footer-brand strong { font-size: 1.1rem; font-weight: 900; color: var(--ink); }
.site-footer p { margin: 0 auto 14px; color: var(--muted); font-size: 0.86rem; max-width: 560px; }
.site-footer .lang-switcher { justify-content: center; margin: 0 auto; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 20px);
  background: var(--ink); color: var(--bg);
  padding: 12px 22px; border-radius: 12px; font-size: 0.92rem; font-weight: 700;
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 50;
  box-shadow: var(--shadow);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .hero { padding-top: 40px; }
  .header-inner { padding: 10px 0; }
}
@media (max-width: 560px) {
  .brand-logo { height: 40px; }
  .lang-switcher { width: 100%; margin-left: 0; padding-bottom: 2px; }
  .editor-actions .btn-primary,
  .editor-actions .btn-ghost { flex: 1 1 auto; text-align: center; }
  .editor-card { padding: 15px; }
}
@media (min-width: 900px) {
  .faq { grid-template-columns: 1fr 1fr; align-items: start; }
  .content .faq { max-width: none; }
}
