/* /formatting - Minecraft formatting codes tool + wiki. Scoped to .fm-* */

.fm-page { position: relative; }
.fm-grad { background: var(--sc-grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fm-muted { color: var(--sc-text-muted); font-size: 0.86em; }

/* ---------------------------------------------------------------- hero */
.fm-hero { position: relative; padding-block: clamp(36px, 5vw, 72px) clamp(24px, 3vw, 40px); isolation: isolate; }
.fm-hero__bg {
    position: absolute; inset: -120px 0 0; z-index: -1; pointer-events: none;
    background:
        radial-gradient(560px 300px at 15% 30%, rgba(139, 92, 246, 0.22), transparent 70%),
        radial-gradient(480px 280px at 88% 15%, rgba(56, 189, 248, 0.12), transparent 70%),
        linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 40px 40px,
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px) 0 0 / 40px 40px;
    -webkit-mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 40%, transparent 100%);
}
.fm-hero .sc-crumbs { margin-bottom: 20px; }
.fm-eyebrow {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; margin-bottom: 16px;
    font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--sc-violet-300); background: rgba(139, 92, 246, 0.1);
    border: 1px solid var(--sc-border-brand); border-radius: var(--sc-r-pill);
}
.fm-eyebrow i { color: var(--sc-bolt-400); }
.fm-hero__title {
    font-family: var(--sc-font-display); font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    font-weight: 800; line-height: 1.06; letter-spacing: -0.035em; text-wrap: balance;
}
.fm-hero__lead { max-width: 62ch; margin-top: 18px; font-size: clamp(1rem, 1.3vw, 1.1rem); line-height: 1.65; color: var(--sc-text-soft); }
.fm-hero__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

/* ---------------------------------------------------------------- wiki layout */
.fm-wiki { padding-bottom: clamp(56px, 7vw, 104px); scroll-margin-top: 90px; }
.fm-wiki__grid { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: clamp(24px, 4vw, 56px); align-items: start; }
.fm-toc { position: sticky; top: 96px; min-width: 0; }
.fm-toc__title { display: block; margin-bottom: 12px; font-size: 0.74rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--sc-text-muted); }
.fm-toc__list { display: flex; flex-direction: column; gap: 2px; padding-left: 12px; border-left: 1px solid var(--sc-border); }
.fm-toc__link {
    position: relative; padding: 7px 12px; font-size: 0.88rem; color: var(--sc-text-muted); text-decoration: none; border-radius: 8px;
    transition: color var(--sc-t-fast) var(--sc-ease), background var(--sc-t-fast) var(--sc-ease);
}
.fm-toc__link:hover { color: var(--sc-text); }
.fm-toc__link.is-active { color: #fff; background: rgba(139, 92, 246, 0.14); }
.fm-toc__link.is-active::before { content: ''; position: absolute; left: -13px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--sc-violet-400); }

.fm-article { min-width: 0; display: flex; flex-direction: column; gap: clamp(36px, 4vw, 56px); }
.fm-sec { scroll-margin-top: 96px; }
.fm-sec > h2, .fm-sec h2 {
    display: flex; align-items: center; gap: 12px; margin-bottom: 18px; scroll-margin-top: 96px;
    font-family: var(--sc-font-display); font-size: clamp(1.3rem, 2.2vw, 1.7rem); font-weight: 700; letter-spacing: -0.02em;
}
.fm-h2__icon {
    display: grid; place-items: center; width: 38px; height: 38px; flex-shrink: 0; font-size: 0.9rem;
    color: var(--sc-violet-300); background: rgba(139, 92, 246, 0.14); border: 1px solid rgba(139, 92, 246, 0.28); border-radius: 11px;
}
.fm-h3 { margin: 26px 0 8px; font-size: 1.02rem; font-weight: 600; }
.fm-sec p { margin: 0 0 14px; line-height: 1.7; color: var(--sc-text-soft); }
.fm-sec code, .fm-card code, .fm-list code {
    padding: 2px 7px; font-family: var(--sc-font-mono); font-size: 0.86em; color: var(--sc-violet-100);
    background: rgba(139, 92, 246, 0.14); border: 1px solid rgba(139, 92, 246, 0.22); border-radius: 6px;
}
.fm-sec b { color: var(--sc-text); font-weight: 600; }

.fm-callout {
    display: flex; gap: 14px; padding: 16px 18px; margin-top: 18px;
    border: 1px solid rgba(251, 191, 36, 0.28); border-radius: var(--sc-r-md); background: rgba(251, 191, 36, 0.06);
}
.fm-callout > i { margin-top: 3px; color: var(--sc-warning); }
.fm-callout p { margin: 0; font-size: 0.92rem; }
.fm-callout--info { border-color: rgba(56, 189, 248, 0.28); background: rgba(56, 189, 248, 0.06); }
.fm-callout--info > i { color: var(--sc-bolt-400); }

.fm-twocol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.fm-card { padding: 20px; border: 1px solid var(--sc-border); border-radius: var(--sc-r-lg); background: var(--sc-surface-1); }
.fm-card h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; font-size: 1.02rem; }
.fm-card h3 i { color: var(--sc-violet-300); }
.fm-card ul, .fm-list { display: flex; flex-direction: column; gap: 10px; margin: 0; padding-left: 18px; font-size: 0.92rem; line-height: 1.6; color: var(--sc-text-soft); }
.fm-list { font-size: 0.95rem; }

/* tables */
.fm-tablewrap { overflow-x: auto; border: 1px solid var(--sc-border); border-radius: var(--sc-r-md); background: var(--sc-surface-1); }
.fm-tablewrap--narrow { max-width: 640px; }
.fm-table { width: 100%; border-collapse: collapse; font-size: 0.88rem; }
.fm-table th {
    padding: 11px 14px; text-align: left; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase;
    color: var(--sc-text-muted); background: rgba(255, 255, 255, 0.03); white-space: nowrap;
}
.fm-table td { padding: 10px 14px; vertical-align: middle; border-top: 1px solid rgba(255, 255, 255, 0.06); }
.fm-table tbody tr:hover { background: rgba(255, 255, 255, 0.025); }
.fm-hex { white-space: nowrap; }
.fm-hex code { margin-left: 8px; }
.fm-name { font-weight: 600; font-family: var(--sc-font-mono); font-size: 0.84rem; }
.fm-note { color: var(--sc-text-muted); min-width: 220px; line-height: 1.5; }
.fm-sw { display: inline-block; vertical-align: middle; width: 18px; height: 18px; border-radius: 5px; background: var(--c); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.25); }
.fm-sw--sm { width: 12px; height: 12px; border-radius: 4px; }
.fm-sw--bg { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18); }
.fm-code {
    display: inline-flex; align-items: center; gap: 1px; height: 30px; padding: 0 11px;
    font-family: var(--sc-font-mono); font-size: 0.86rem; font-weight: 700; color: #fff;
    background: rgba(139, 92, 246, 0.16); border: 1px solid rgba(139, 92, 246, 0.35); border-radius: 8px; cursor: pointer;
    transition: background var(--sc-t-fast) var(--sc-ease), transform var(--sc-t-fast) var(--sc-ease);
}
.fm-code:hover, .fm-code:focus-visible { background: rgba(139, 92, 246, 0.32); transform: translateY(-1px); outline: none; }
.fm-code .fm-ss { color: var(--sc-violet-300); }
.fm-pill { display: inline-flex; height: 22px; align-items: center; padding: 0 10px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; color: var(--sc-text-soft); border: 1px solid var(--sc-border-strong); border-radius: var(--sc-r-pill); }
.fm-demo-k { font-family: 'VT323', var(--sc-font-mono); font-size: 1.2em; letter-spacing: 0.05em; }
.fm-demo-l { font-weight: 800; }
.fm-demo-m { text-decoration: line-through; }
.fm-demo-n { text-decoration: underline; }
.fm-demo-o { font-style: italic; }
.fm-yes, .fm-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.72rem; }
.fm-yes { color: var(--sc-success); background: var(--sc-success-dim); }
.fm-no { color: var(--sc-text-faint); background: rgba(255, 255, 255, 0.04); }
.fm-table--where td:nth-child(n+2), .fm-table--where th:nth-child(n+2) { text-align: center; width: 90px; }

/* compare + examples */
.fm-compare { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 14px; }
.fm-compare__item { display: inline-flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.fm-compare__tag { font-size: 0.7rem; font-weight: 700; padding: 3px 9px; border-radius: var(--sc-r-pill); color: var(--sc-violet-100); background: rgba(139, 92, 246, 0.2); }
.fm-examples { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.fm-ex {
    display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 14px 16px; text-align: left; cursor: pointer;
    font: inherit; color: var(--sc-text); background: var(--sc-surface-1); border: 1px solid var(--sc-border); border-radius: var(--sc-r-md);
    transition: border-color var(--sc-t-fast) var(--sc-ease), background var(--sc-t-fast) var(--sc-ease), transform var(--sc-t-fast) var(--sc-ease);
}
.fm-ex:hover, .fm-ex:focus-visible { border-color: var(--sc-border-brand); background: rgba(139, 92, 246, 0.08); transform: translateY(-2px); outline: none; }
.fm-ex__label { font-size: 0.78rem; color: var(--sc-text-muted); }
.fm-ex code { font-family: var(--sc-font-mono); font-size: 0.82rem; color: var(--sc-violet-100); word-break: break-all; }
.fm-compare .fm-ex { flex-direction: row; padding: 8px 12px; border-radius: 10px; }

/* keys + timeline */
.fm-keys { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 16px; }
.fm-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; padding: 14px 16px; border: 1px solid var(--sc-border); border-radius: var(--sc-r-md); background: var(--sc-surface-1); }
.fm-key__os { flex-basis: 100%; display: inline-flex; align-items: center; gap: 8px; font-size: 0.8rem; font-weight: 600; color: var(--sc-text-muted); }
kbd {
    display: inline-grid; place-items: center; min-width: 28px; height: 28px; padding: 0 8px; font-family: var(--sc-font-mono); font-size: 0.8rem; color: var(--sc-text);
    background: rgba(255, 255, 255, 0.06); border: 1px solid var(--sc-border-strong); border-bottom-width: 2px; border-radius: 7px;
}
.fm-tl { position: relative; display: flex; flex-direction: column; gap: 0; margin: 0 0 18px; padding: 0 0 0 22px; list-style: none; border-left: 1px solid var(--sc-border-strong); }
.fm-tl li { position: relative; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; padding: 10px 0; font-size: 0.9rem; }
.fm-tl li::before { content: ''; position: absolute; left: -28px; top: 17px; width: 11px; height: 11px; border-radius: 50%; background: var(--sc-bg); border: 2px solid var(--sc-violet-400); }
.fm-tl__ver { font-family: var(--sc-font-mono); font-size: 0.82rem; font-weight: 600; color: var(--sc-violet-300); }
.fm-tl__txt { color: var(--sc-text-soft); line-height: 1.55; }
.fm-trivia { display: flex; align-items: center; gap: 10px; font-size: 0.9rem; }
.fm-trivia i { color: var(--sc-warning); }
.fm-source { display: flex; gap: 14px; padding: 18px 20px; border: 1px solid var(--sc-border); border-radius: var(--sc-r-md); background: var(--sc-surface-1); }
.fm-source > i { margin-top: 3px; color: var(--sc-text-muted); }
.fm-source p { margin: 0; font-size: 0.84rem; line-height: 1.6; color: var(--sc-text-muted); }
.fm-source a { color: var(--sc-violet-300); }

/* ---------------------------------------------------------------- responsive */
@media (max-width: 1020px) {
    .fm-wiki__grid { grid-template-columns: minmax(0, 1fr); }
    .fm-toc { position: sticky; top: 76px; z-index: 15; margin-inline: calc(var(--sc-gutter) * -1); padding: 10px var(--sc-gutter); background: rgba(10, 10, 16, 0.85); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--sc-border); }
    .fm-toc__title { display: none; }
    .fm-toc__list { flex-direction: row; gap: 6px; padding: 0; border: 0; overflow-x: auto; scrollbar-width: none; }
    .fm-toc__list::-webkit-scrollbar { display: none; }
    .fm-toc__link { white-space: nowrap; border: 1px solid var(--sc-border); border-radius: var(--sc-r-pill); }
    .fm-toc__link.is-active::before { display: none; }
}
@media (max-width: 720px) {
    .fm-twocol { grid-template-columns: minmax(0, 1fr); }
    .fm-tl li { grid-template-columns: 1fr; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
    .fm-code { transition: none; }
}

/* ---------------------------------------------------------------- info page additions */
.fm-hero--info { padding-bottom: clamp(20px, 3vw, 36px); }
.fm-wiki--info { padding-top: 8px; }
span.fm-code { cursor: default; }
span.fm-code:hover { transform: none; background: rgba(139, 92, 246, 0.16); }
.fm-code--amp { background: rgba(56, 189, 248, 0.1); border-color: rgba(56, 189, 248, 0.3); color: var(--sc-bolt-300); }
.fm-list--spaced { margin-top: 16px; }
.fm-sec p.fm-muted { margin-top: 12px; }

.fm-pre {
    margin: 12px 0 0; padding: 12px 14px; overflow-x: auto; font-family: var(--sc-font-mono); font-size: 0.82rem; line-height: 1.55;
    color: var(--sc-violet-100); background: rgba(0, 0, 0, 0.35); border: 1px solid var(--sc-border); border-radius: 10px;
}
.fm-pre code { padding: 0; background: none; border: 0; color: inherit; font-size: inherit; white-space: pre; }
.fm-systems { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 16px; }
.fm-systems .fm-card { display: flex; flex-direction: column; min-width: 0; }
.fm-systems .fm-card p { margin: 0 0 4px; font-size: 0.9rem; }
.fm-systems .fm-card .fm-pre { margin-top: auto; }
.fm-card--accent { border-color: rgba(139, 92, 246, 0.45); background: linear-gradient(160deg, rgba(139, 92, 246, 0.12), rgba(139, 92, 246, 0.02)); }

.fm-demo-hex { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 16px 0 0; padding: 14px 18px; font-family: 'VT323', var(--sc-font-mono); font-size: 1.5rem; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--sc-border); border-radius: 12px; }
.fm-table--mm td:first-child { white-space: nowrap; }
.fm-table--mm td:first-child code { color: var(--sc-bolt-300); background: rgba(56, 189, 248, 0.08); border-color: rgba(56, 189, 248, 0.25); }
.fm-mm-examples { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 14px; margin-bottom: 14px; }
.fm-mm-ex { min-width: 0; padding: 14px; border: 1px solid var(--sc-border); border-radius: var(--sc-r-md); background: var(--sc-surface-1); }
.fm-mm-ex__out { display: block; padding: 10px 14px; font-family: 'VT323', var(--sc-font-mono); font-size: 1.5rem; line-height: 1.2; background: rgba(0, 0, 0, 0.4); border-radius: 8px; }
.fm-grad-demo { background: linear-gradient(90deg, #8B5CF6, #38BDF8); -webkit-background-clip: text; background-clip: text; color: transparent; }
.fm-rainbow-demo { background: linear-gradient(90deg, #ff5555, #ffaa00, #ffff55, #55ff55, #55ffff, #5555ff, #ff55ff); -webkit-background-clip: text; background-clip: text; color: transparent; }
