/* SPDX-FileCopyrightText: 2026 Elias Bachaalany
   SPDX-License-Identifier: LicenseRef-Human-Origin-Source-1.0
   Site styles for sally-filemanager.app (Human-Origin Source License v1.0, see /license/). */

:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-2: #eef2f7;
  --text: #18202b;
  --muted: #556070;
  --line: #dde3ea;
  --accent: #1e6fd9;
  --accent-strong: #0b3d91;
  --accent-soft: #e3eefc;
  --accent-text: #ffffff;
  --ok: #1d7a46;
  --warn: #9a5b00;
  --code-bg: #f1f4f8;
  --shadow: 0 10px 30px rgba(16, 38, 74, 0.12);
  --radius: 12px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SF Mono", Menlo, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1218;
    --surface: #161c25;
    --surface-2: #1c2430;
    --text: #e7ecf3;
    --muted: #9aa6b5;
    --line: #263142;
    --accent: #5aa9ff;
    --accent-strong: #d9eeff;
    --accent-soft: #14273f;
    --accent-text: #08111f;
    --ok: #5cc98a;
    --warn: #f0b45a;
    --code-bg: #1a212c;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 80px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.6 var(--font); }
img { max-width: 100%; height: auto; }
a { color: var(--accent); text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3 { font-family: var(--font-display); line-height: 1.2; text-wrap: balance; }
h1 { font-size: clamp(1.9rem, 4.4vw, 2.6rem); letter-spacing: -0.02em; margin: 0 0 12px; }
h2 { font-size: clamp(1.35rem, 3vw, 1.75rem); letter-spacing: -0.01em; margin: 0 0 10px; }
h3 { font-size: 1.1rem; margin: 0 0 6px; }
code, kbd, pre { font-family: var(--mono); font-size: 0.9em; }
code { background: var(--code-bg); border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
pre { background: var(--code-bg); border: 1px solid var(--line); border-radius: 10px; padding: 14px 16px; overflow-x: auto; }
pre code { border: 0; padding: 0; background: none; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 1px 6px; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 6px;
  font-size: 0.82em; line-height: 1.5; color: var(--text);
}
.wrap { max-width: 1160px; margin: 0 auto; padding-inline: 20px; }
.narrow { max-width: 820px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 760px; margin: 0 0 22px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 8px 12px; border-radius: 8px; }

/* Header */
.site-header {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.bar { display: flex; align-items: center; gap: 22px; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-weight: 650; font-size: 1.08rem; }
.site-nav { display: flex; gap: 4px; flex: 1; }
.site-nav a { color: var(--muted); text-decoration: none; padding: 6px 10px; border-radius: 8px; font-size: 15px; }
.site-nav a:hover { color: var(--text); background: var(--surface-2); }
.site-nav a[aria-current] { color: var(--text); background: var(--surface-2); font-weight: 600; }
.site-nav .gh { margin-left: auto; }
.search-open {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  background: var(--surface); color: var(--muted); border: 1px solid var(--line); border-radius: 9px;
  padding: 5px 8px 5px 12px; font: inherit; font-size: 14px;
}
.search-open:hover { color: var(--text); }
.menu-toggle { display: none; }
@media (max-width: 860px) {
  .bar { flex-wrap: wrap; gap: 10px; padding-block: 8px; }
  .brand { margin-right: auto; }
  .menu-toggle {
    display: inline-block; order: 2; background: var(--surface); color: var(--text);
    border: 1px solid var(--line); border-radius: 9px; padding: 6px 12px; font: inherit; font-size: 14px;
  }
  .search-open { order: 1; }
  .search-open span { display: none; }
  .site-nav { order: 3; flex-basis: 100%; flex-direction: column; display: none; padding-bottom: 8px; }
  .site-nav.open { display: flex; }
  .site-nav .gh { margin-left: 0; }
}

/* Buttons */
.btn {
  display: inline-flex; flex-direction: column; align-items: center; justify-content: center;
  min-width: 170px; padding: 11px 20px; border-radius: 10px; text-decoration: none;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font-weight: 600;
}
.btn small { font-weight: 400; color: var(--muted); font-size: 13px; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.btn.primary small { color: var(--accent-text); opacity: 0.85; }
.btn:hover { filter: brightness(1.06); color: inherit; }
.btn.primary:hover { color: var(--accent-text); }
.buttons { display: flex; flex-wrap: wrap; gap: 12px; }
.buttons.center { justify-content: center; }

/* Home */
.hero { padding-block: 56px 18px; text-align: center; }
.hero h1 { font-size: clamp(2.1rem, 5.4vw, 3.4rem); margin-bottom: 16px; }
.hero .lede { margin-inline: auto; font-size: clamp(1.05rem, 2.2vw, 1.25rem); }
.release-line { margin-top: 14px; color: var(--muted); font-size: 14px; }
.keys { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 18px; margin: 26px 0 0; padding: 0; list-style: none; color: var(--muted); font-size: 14px; }
.keys kbd { margin-right: 6px; }
figure.shot { margin: 34px auto 0; }
figure.shot img, .shot-img { width: 100%; border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); display: block; }
figure figcaption { color: var(--muted); font-size: 14px; text-align: center; margin-top: 10px; }

section.band { padding-block: 52px; }
section.band.alt { background: var(--surface); border-block: 1px solid var(--line); }
.section-head { margin-bottom: 24px; }
.section-head p { color: var(--muted); max-width: 760px; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 16px; }
.grid.two-col { grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 22px; }
section.band.alt .card { background: var(--bg); }
.card p { margin: 0; color: var(--muted); font-size: 15px; }
.card p + p { margin-top: 8px; }
a.card { display: block; text-decoration: none; color: var(--text); transition: border-color .15s; }
a.card:hover { border-color: var(--accent); color: var(--text); }
a.card .go { display: inline-block; margin-top: 10px; color: var(--accent); font-size: 14px; font-weight: 600; }
.card .icon { width: 36px; height: 36px; border-radius: 9px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; margin-bottom: 12px; font-family: var(--mono); font-size: 14px; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; align-items: center; }
.split.wide-media { grid-template-columns: 2fr 3fr; }
@media (max-width: 820px) { .split, .split.wide-media { grid-template-columns: 1fr; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 0; padding: 0; list-style: none; }
.chips li { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: 14px; }
section.band.alt .chips li { background: var(--bg); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin: 0; }
.stats div { border-left: 3px solid var(--accent); padding: 2px 0 2px 14px; }
.stats dt { font-size: 1.6rem; font-weight: 700; font-variant-numeric: tabular-nums; font-family: var(--font-display); }
.stats dd { margin: 0; color: var(--muted); font-size: 14px; }

/* Content pages */
.page-head { padding-block: 44px 8px; }
.page-head .eyebrow { text-transform: uppercase; letter-spacing: 0.08em; font-size: 12px; font-weight: 700; color: var(--accent); margin: 0 0 8px; }
.prose { max-width: 780px; }
.prose h2 { margin-top: 38px; }
.prose h3 { margin-top: 26px; }
.prose li + li { margin-top: 4px; }
.prose table, .manual table { border-collapse: collapse; width: 100%; margin: 14px 0 20px; font-size: 15px; }
.table-wrap { overflow-x: auto; }
th, td { text-align: left; vertical-align: top; padding: 8px 12px; border-bottom: 1px solid var(--line); }
th { font-weight: 600; background: var(--surface-2); }
a.card.donate { border-color: var(--accent); }
a.card.donate h3 { color: var(--accent); }
.fine { color: var(--muted); font-size: 14px; max-width: 760px; margin: 16px 0 0; }
.callout { border: 1px solid var(--line); border-left: 4px solid var(--accent); background: var(--surface); border-radius: 10px; padding: 12px 16px; margin: 16px 0; }
.callout p { margin: 0; }
.callout.warning, .callout.caution { border-left-color: var(--warn); }
.callout.tip { border-left-color: var(--ok); }

.feature-detail { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 40px; padding-bottom: 50px; }
.feature-detail aside { position: sticky; top: 84px; align-self: start; }
.feature-detail aside h2 { font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.feature-detail aside ul { list-style: none; padding: 0; margin: 0 0 22px; }
.feature-detail aside li { margin: 0 0 6px; }
@media (max-width: 900px) { .feature-detail { grid-template-columns: 1fr; } .feature-detail aside { position: static; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 22px; }
.gallery figure { margin: 0; }
.gallery img { border-radius: 10px; border: 1px solid var(--line); box-shadow: var(--shadow); display: block; width: 100%; }

.faq details { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; }
.faq details p { margin: 10px 0 0; color: var(--muted); }

.steps { counter-reset: step; list-style: none; padding: 0; }
.steps > li { counter-increment: step; position: relative; padding-left: 44px; margin-bottom: 18px; }
.steps > li::before {
  content: counter(step); position: absolute; left: 0; top: 0; width: 30px; height: 30px; border-radius: 50%;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-weight: 700; font-size: 14px;
}

/* Changelog */
.changelog { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 40px; padding-bottom: 60px; }
.release-index { list-style: none; padding: 0; margin: 0; position: sticky; top: 84px; max-height: calc(100vh - 110px); overflow-y: auto; font-size: 14px; }
.release-index li { display: flex; justify-content: space-between; gap: 8px; padding: 3px 0; }
.release-index span { color: var(--muted); font-variant-numeric: tabular-nums; }
.release { border-bottom: 1px solid var(--line); padding-bottom: 26px; margin-bottom: 26px; max-width: 800px; }
.release h2 a { color: inherit; text-decoration: none; }
.release .meta { color: var(--muted); font-size: 14px; margin: 0 0 12px; }
.release h4, .release h5 { margin: 18px 0 6px; font-size: 1rem; }
@media (max-width: 760px) { .changelog { grid-template-columns: 1fr; } .release-index { position: static; display: flex; flex-wrap: wrap; gap: 4px 14px; max-height: none; } }

/* Manual */
.docs { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; padding-block: 26px 60px; }
.toc { position: sticky; top: 76px; align-self: start; max-height: calc(100vh - 96px); overflow-y: auto; font-size: 14px; padding-right: 6px; }
.toc .toc-back { display: flex; flex-wrap: wrap; gap: 4px 14px; margin: 0 0 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.toc .toc-back a { display: inline; padding: 0; color: var(--accent); font-weight: 600; }
.toc .toc-back a:hover { background: none; text-decoration: underline; }
.toc .toc-title { font-weight: 700; margin: 0 0 10px; }
.toc .toc-title a { color: var(--text); text-decoration: none; }
.toc ul { list-style: none; margin: 0; padding: 0; }
.toc ul ul { padding-left: 14px; border-left: 1px solid var(--line); margin-left: 6px; }
.toc li { margin: 1px 0; }
.toc a { display: block; padding: 3px 8px; border-radius: 6px; color: var(--muted); text-decoration: none; }
.toc a:hover { color: var(--text); background: var(--surface-2); }
.toc a[aria-current] { color: var(--accent); background: var(--accent-soft); font-weight: 600; }
.toc summary { cursor: pointer; list-style: none; color: var(--text); font-weight: 600; padding: 3px 0; }
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before { content: "▸"; display: inline-block; width: 14px; color: var(--muted); transition: transform .15s; }
.toc details[open] > summary::before { transform: rotate(90deg); }
.toc summary a { display: inline; padding: 0; color: inherit; background: none; }
.manual { min-width: 0; max-width: 860px; }
.manual h1 { margin-top: 10px; }
.manual h2 { margin-top: 30px; font-size: 1.3rem; }
.manual h3 { margin-top: 24px; font-size: 1.08rem; }
.manual tr.gap td { padding: 6px 0; border-bottom: 0; background: none; }
.manual td.hdr { white-space: nowrap; color: var(--muted); width: 1%; }
.manual img { border-radius: 6px; }
.manual .glossary { font-style: normal; border-bottom: 1px dotted var(--muted); text-decoration: none; color: inherit; }
.manual .nowrap, .manual .nobr { white-space: nowrap; }
.manual .indent { margin-left: 2em; }
.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.pager { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 44px; }
.pager a { border: 1px solid var(--line); border-radius: 10px; padding: 10px 14px; text-decoration: none; background: var(--surface); }
.pager a:hover { border-color: var(--accent); }
.pager small { display: block; color: var(--muted); font-size: 12px; }
.pager .next { text-align: right; }
.page-source { margin-top: 26px; font-size: 13px; color: var(--muted); }
.manual-section h2 { font-size: 1.1rem; }
.manual-section h2 a { color: var(--text); text-decoration: none; }
.manual-section ul { margin: 0; padding-left: 18px; font-size: 15px; }
.manual-section .more { margin: 8px 0 0; font-size: 14px; }
.plugin-list { columns: 3 220px; padding-left: 18px; }
.toc-list { padding-left: 18px; }
@media (max-width: 900px) {
  .docs { grid-template-columns: 1fr; gap: 10px; }
  .toc { position: static; max-height: 260px; border: 1px solid var(--line); border-radius: 10px; padding: 10px; background: var(--surface); }
}

/* Search */
.search { position: fixed; inset: 0; z-index: 40; background: rgba(8, 14, 24, 0.45); display: flex; justify-content: center; align-items: flex-start; padding: 10vh 16px 16px; }
.search-panel { width: min(720px, 100%); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); overflow: hidden; }
.search-row { display: flex; gap: 8px; padding: 12px; border-bottom: 1px solid var(--line); }
.search-row input { flex: 1; font: inherit; font-size: 17px; padding: 8px 12px; border-radius: 9px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.search-close { font: inherit; font-size: 13px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); border-radius: 8px; padding: 0 10px; cursor: pointer; }
.search-results { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.search-results a { display: block; padding: 10px 12px; border-radius: 9px; text-decoration: none; color: var(--text); }
.search-results a:hover, .search-results a.active { background: var(--accent-soft); }
.search-results .where { font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.search-results .snip { display: block; font-size: 14px; color: var(--muted); }
.search-results mark { background: none; color: var(--accent); font-weight: 600; }
.search-results .empty { padding: 14px; color: var(--muted); }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: var(--surface); margin-top: 20px; font-size: 14px; color: var(--muted); }
.site-footer .cols { display: grid; grid-template-columns: 2fr repeat(3, 1fr); gap: 26px; padding-block: 34px 18px; }
.site-footer .cols > div > a:not(.brand) { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.site-footer .cols > div > a:hover { color: var(--text); }
.site-footer h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 0.07em; margin: 4px 0 8px; color: var(--text); }
.site-footer p { max-width: 340px; }
.site-footer .legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; border-top: 1px solid var(--line); padding-block: 16px 22px; }
.site-footer .legal a { color: var(--muted); }
@media (max-width: 760px) { .site-footer .cols { grid-template-columns: 1fr 1fr; } .site-footer .cols > div:first-child { grid-column: 1 / -1; } }
@media (max-width: 600px) { .btn { min-width: 0; flex: 1 1 140px; } }
