/* Additions to readtheorg.css for this site.
 *
 * readtheorg.css is copied verbatim from the theme doc.alsciokat.com is built
 * with, and is not edited here: it styles an Org export, and everything below is
 * for the parts of a hand-written page it has no opinion about — the editor
 * panel, the screenshot strip, the signup form. It borrows the theme's own
 * values rather than inventing any, so a page here and a page there are the
 * same site.
 */

:root {
    --accent: #2980b9;
    --accent-hover: #3091d1;
    --ink: #404040;
    --rule: #e1e4e5;
    --panel: #f3f6f6;
    --paper: #fcfcfc;
    --sidebar: #343131;
    --sidebar-deep: #1f1d1d;
    --dim: #999999;
    --green: #27ae60;
    --serif-head: "Roboto Slab", "ff-tisa-web-pro", Georgia, Arial, sans-serif;
    --mono: Consolas, "Andale Mono WT", "DejaVu Sans Mono", "Liberation Mono",
            Monaco, "Courier New", monospace;
}

/* --- Sidebar ------------------------------------------------------------- */
/* The nav is hand-written here rather than generated from an Org TOC, so the
   two link levels the theme styles (`ul.nav > li > a` and `li ul li a`) are
   used for site sections and page anchors respectively. */

#table-of-contents .nav-section {
    color: #808080;
    font-size: 75%;
    font-weight: bold;
    letter-spacing: .08em;
    text-transform: uppercase;
    padding: 1.618em 1.618em .4045em;
}

#table-of-contents .nav-note {
    color: #808080;
    font-size: 80%;
    line-height: 1.5;
    padding: .809em 1.618em 1.618em;
}

#table-of-contents .nav-note a { color: #b3b3b3; padding: 0; display: inline; }
#table-of-contents .nav-note a:hover { background: none; }

/* --- Page furniture ------------------------------------------------------ */

.lead {
    font-size: 19px !important;
    line-height: 30px;
    color: #555;
}

/* The one-line status the README leads with. Org's own TODO-keyword colours
   from the theme, not a new palette. */
.badge {
    display: inline-block;
    font-family: var(--mono);
    font-size: 11px;
    font-weight: bold;
    letter-spacing: .06em;
    text-transform: uppercase;
    padding: 3px 8px;
    border-radius: 3px;
    vertical-align: middle;
}

.badge-alpha { background: #f29f97; color: #fff; }
.badge-live  { background: var(--green); color: #fff; }

.subhead {
    color: var(--dim);
    font-family: var(--mono);
    font-size: 13px;
    margin: -0.4em 0 24px;
}

.title a { color: var(--dim); text-decoration: underline; }
.title a:hover { color: var(--accent); }

/* The identity links under the title. They belong to the same block as the
   subhead, so the gap between the two is tighter than the page's 24px rhythm —
   the negative top margin collapses against the subhead's 24px to leave 10. */
.profile-links {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: -14px 0 26px;
}

/* The theme paints every visited link purple, which on a mark rather than a
   phrase reads as a rendering fault; these stay in the muted ink either way and
   take the accent on hover, like the rest of the page's links. */
.profile-links a,
.profile-links a:visited {
    display: inline-flex;
    color: #8f8f8f;
    transition: color .15s ease;
}

.profile-links a:hover,
.profile-links a:visited:hover { color: var(--accent); }

.profile-links svg {
    display: block;
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* --- Featured articles ---------------------------------------------------- */
/* The front page is a list of articles, each a piece of work written up at
   length rather than linked to. One entry is one `<article class="article">`;
   what divides two of them is an `<hr class="article-sep">` between them in the
   markup. Adding the next piece of work is copying that pair. */

.section-label {
    display: flex;
    align-items: center;
    gap: 14px;
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #8a8a8a;
    margin: 40px 0 28px;
}

/* The rule runs from the label to the measure's edge, so the label reads as the
   opening of a block rather than as another heading in the flow. */
.section-label::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--rule);
}

/* The line above an article's title: what kind of thing it is, in the same
   quiet mono the page's own subhead uses. */
.article .kicker {
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: .02em;
    color: var(--dim);
    margin: 0 0 8px;
}

.article > h2 {
    margin-bottom: .45em;
}

/* An asterism, not a bare rule: two articles on one page need an ending as much
   as a division, and a rule alone reads as "and now something else on the same
   subject". The glyph sits in a gap punched out of the rule in the content's own
   background colour. */
.article-sep {
    position: relative;
    overflow: visible;
    height: 0;
    border: 0;
    border-top: 1px solid var(--rule);
    margin: 48px 0;
}

.article-sep::after {
    content: "\2042";
    position: absolute;
    left: 50%;
    top: 50%;
    /* Centred on the rule itself rather than nudged off it by an em offset,
       which lands differently in every font the page might fall back to. */
    transform: translate(-50%, -50%);
    padding: 0 .8em;
    background: var(--paper);
    color: #a9a9a9;
    font-size: 18px;
    line-height: 1;
}

/* --- Buttons ------------------------------------------------------------- */

.btn {
    display: inline-block;
    font-family: "Lato", "Helvetica Neue", Arial, sans-serif;
    font-size: 15px;
    font-weight: bold;
    line-height: 1;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 3px;
    cursor: pointer;
    text-decoration: none;
    transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}

.btn + .btn { margin-left: 8px; }

.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover,
.btn-primary:visited:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: #fff; }
.btn-primary:visited { color: #fff; }

.btn-ghost { background: transparent; border-color: #c9c9c9; color: var(--ink); }
.btn-ghost:hover, .btn-ghost:visited:hover { border-color: var(--accent); color: var(--accent); }
.btn-ghost:visited { color: var(--ink); }

.btn[disabled] { opacity: .55; cursor: default; pointer-events: none; }

.btn-row { margin-bottom: 24px; }

/* --- The embedded editor ------------------------------------------------- */
/* The panel is the app's own document view, so it is framed like a figure
   rather than blended into the page: the theme inside the iframe is the user's
   to choose and may be black, white or navy, and the page must read the same
   whichever it is. */

.editor-embed {
    border: 1px solid var(--rule);
    border-radius: 3px;
    margin: 0 0 12px;
    overflow: hidden;
    background: var(--panel);
}

.editor-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: var(--panel);
    border-bottom: 1px solid var(--rule);
    font-size: 13px;
}

.editor-bar label {
    color: #666;
    font-size: 12px;
    font-weight: bold;
    letter-spacing: .04em;
    text-transform: uppercase;
    margin: 0;
    display: inline;
}

.editor-bar select {
    font-family: inherit;
    font-size: 13px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 3px;
    padding: 5px 8px;
    cursor: pointer;
}

.editor-bar select:focus { outline: none; border-color: var(--accent); }

.editor-bar .spacer { flex: 1; }

.editor-bar .hint {
    color: var(--dim);
    font-size: 12px;
}

/* Reset is a text button: it undoes an experiment, it does not start one. */
.editor-bar .reset {
    background: none;
    border: none;
    padding: 0;
    font: inherit;
    font-size: 12px;
    color: var(--accent);
    cursor: pointer;
}

.editor-bar .reset:hover { color: var(--accent-hover); text-decoration: underline; }

/* The iframe cannot size to its content — the engine pins itself to the
   viewport height, which in here is this box. */
.editor-frame {
    display: block;
    width: 100%;
    height: 520px;
    border: 0;
    background: #16161a; /* the editor page's own default, so no white flash */
}

/* --- Screenshots --------------------------------------------------------- */

.shots {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 12px;
    margin-bottom: 24px;
    scrollbar-width: thin;
    scrollbar-color: #c9c9c9 transparent;
}

.shots figure { margin: 0; flex: 0 0 auto; width: 190px; }

.shots img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--rule);
    border-radius: 3px;
    background: #fff;
}

.shots figcaption {
    color: var(--dim);
    font: italic 85%/1.4 "Lato", Arial, sans-serif;
    padding-top: 8px;
}

/* --- Feature list -------------------------------------------------------- */
/* Each feature is a heading plus prose plus, sometimes, one phone shot beside
   it. Below 900px of content the shot goes back into the flow. */

.feature { overflow: hidden; margin-bottom: 24px; }

.feature .shot {
    float: right;
    width: 170px;
    margin: 0 0 12px 24px;
}

.feature .shot img {
    display: block;
    width: 100%;
    height: auto;
    border: 1px solid var(--rule);
    border-radius: 3px;
}

@media screen and (max-width: 640px) {
    .feature .shot { float: none; margin: 0 0 12px; width: 60%; }
}

/* --- Definition-style meta rows ------------------------------------------ */

.kv { margin-bottom: 24px; }
.kv div { display: flex; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.kv dt, .kv .k { flex: 0 0 130px; color: #666; font-weight: bold; }
.kv dd, .kv .v { margin: 0; }

/* --- The signup form ----------------------------------------------------- */

.signup {
    background: var(--panel);
    border: 1px solid var(--rule);
    border-radius: 3px;
    padding: 24px;
    margin-bottom: 24px;
}

.field { margin-bottom: 20px; }

.field label {
    display: block;
    color: var(--ink);
    font-size: 14px;
    font-weight: bold;
    margin-bottom: 6px;
}

.field .help {
    color: #777;
    font-size: 13px;
    line-height: 1.5;
    margin: 0 0 8px;
}

.field input[type="email"],
.field input[type="text"] {
    display: block;
    width: 100%;
    font-family: inherit;
    font-size: 15px;
    color: var(--ink);
    background: #fff;
    border: 1px solid #c9c9c9;
    border-radius: 3px;
    padding: 10px 12px;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.field input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(41, 128, 185, .15);
}

.field input[aria-invalid="true"] { border-color: #d0403a; }

.field .error {
    color: #c0392b;
    font-size: 13px;
    margin: 6px 0 0;
    min-height: 1px;
}

/* The consent line is a claim about what happens to the address, so it reads at
   full contrast rather than as fine print. */
.consent {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    font-size: 14px;
    line-height: 1.5;
    margin-bottom: 20px;
}

.consent input { margin-top: 3px; flex: 0 0 auto; }
.consent label { display: inline; font-weight: normal; margin: 0; color: var(--ink); font-size: 14px; }

/* Sent / failed, in the theme's own admonition colours. */
.form-status {
    display: none;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px 16px;
    border-radius: 3px;
    margin: 0 0 20px;
}

.form-status.is-shown { display: block; }
.form-status.ok   { background: #dbfaf4; border-left: 5px solid #1abc9c; }
.form-status.fail { background: #fdeceb; border-left: 5px solid #f29f97; }
.form-status p:last-child { margin-bottom: 0; }

.form-status code {
    white-space: normal;
    word-break: break-all;
}

/* --- Postamble ----------------------------------------------------------- */
/* The theme fixes this to the foot of the 300px sidebar; it holds the author
   line on doc.alsciokat.com and does the same here. */

#postamble p { margin-bottom: 0; }
#postamble a { color: var(--accent); }
#postamble a:hover { color: var(--accent-hover); }
#postamble .date { color: var(--green); }

/* The sidebar is hidden below 768px and so is everything fixed to it; the
   footer has to come back into the page instead. */
.page-footer {
    display: none;
    border-top: 1px solid var(--rule);
    margin-top: 36px;
    padding-top: 24px;
    color: var(--dim);
    font-size: 14px;
}

@media screen and (max-width: 768px) {
    .page-footer { display: block; }
    /* Room for the fixed sidebar toggle, which sits top-right. */
    #content > h1:first-of-type { padding-right: 3em; }
}

/* The theme hides `.close-sidebar` in a base rule and, in its mobile query,
   gives it a position, a colour and a hit area — but never puts `display` back,
   so the Close link it styles is never actually drawn. Restored here rather
   than in readtheorg.css, which is kept verbatim. */
@media screen and (max-width: 768px) {
    #table-of-contents .close-sidebar { display: block; }
}

/* The signup form's honeypot (testing.html). Taken out of the layout without
   `display:none` or `visibility:hidden`, which the bots this catches know to
   skip — it has to look like an ordinary field to anything reading the DOM. */
.honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
