/* home.css - styles for ivdasmachabevs.xyz home page */


/* Colours, by role. Every colour on screen comes from one of these; nothing
   below names a colour directly. They are repeated in home.css, page.css and
   post.css, because each page loads exactly one of the three, and verify.sh
   checks the three blocks are identical. The print styles at the end use
   plain black and white on purpose: paper has no theme.

     --bg           the page
     --ink          body text, the site title, the coin's hover ring
     --link         navigation and link text; the background of a hovered link
     --on-ink       text on an --ink or --link background (a hovered link)
     --muted        dates, the .xyz, secondary text
     --rule         dividing lines
     --rule-faint   the lighter lines between listing entries
     --tint         a hovered listing entry
     --tint-strong  the footnote just arrived at

   Two sets. The first is the light theme, on an off-white page (chosen
   2026-11-17). The second replaces it when the reader's system is set to
   dark: a dark grey page, not black, with off-white text. Neither needs
   JavaScript; the browser picks by the reader's own setting.

   The coin (assets/img/ivdas1.svg) colours itself the same way, from a
   style block inside the SVG, because an image cannot see these
   variables. Its two fills must equal --ink in each set; verify.sh checks.
*/
:root {
    color-scheme: light;
    --bg: #faf8f3;
    --ink: #000;
    --link: #555;
    --on-ink: #faf8f3;
    --muted: #777;
    --rule: #ddd;
    --rule-faint: #ebe8df;
    --tint: #f3f0e8;
    --tint-strong: #ece8de;
}

@media (prefers-color-scheme: dark) {
    :root {
        color-scheme: dark;
        --bg: #1c1c1c;
        --ink: #e8e6e1;
        --link: #b5b3ae;
        --on-ink: #1c1c1c;
        --muted: #8d8b86;
        --rule: #3a3a3a;
        --rule-faint: #2b2b2b;
        --tint: #242424;
        --tint-strong: #303030;
    }
}

/* TYPE SCALE
 *
 * Sizes are in rem, not pt. A pt in CSS is a fixed 1/72 inch -- it ignores the
 * reader's browser font-size setting entirely, so a reader who has set 20px
 * because they need 20px got 16px anyway. rem is relative to the root element,
 * which is exactly the setting they changed.
 *
 * Converted at the default root of 16px, so nothing moves for a reader who has
 * changed nothing. The old value is on the right where the two differ:
 *
 *   0.75rem   12px    was  9pt
 *   0.85rem   13.6px  was 10pt
 *   0.9rem    14.4px  was 11pt
 *   1rem      16px    was 12pt   (exact)
 *   1.1rem    17.6px  was 13pt
 *   1.15rem   18.4px  was 14pt
 *   1.25rem   20px    was 15pt   (exact)
 *   1.35rem   21.6px  was 16pt
 *   1.5rem    24px    was 18pt   (exact)
 *   1.6rem    25.6px  was 19.3pt
 *   1.65rem   26.4px  was 20pt
 *   1.85rem   29.6px  was 22pt
 *   2.35rem   37.6px  was 28pt
 *
 * Rounded to 0.05rem rather than carried to four decimals: no step moves by
 * more than 0.27px, which is less than a device pixel on every display this
 * site will meet, and the round numbers survive being edited by hand.
 *
 * Nothing here sets a font-size on html. That is deliberate -- setting one is
 * how a site takes the reader's setting away again.
 */


/* fonts */
@font-face {
    font-family: 'Aesthetic';
    src: url('../fonts/aesthetic-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Belgiano';
    src: url('../fonts/belgiano-serif.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'FiraSans';
    src: url('../fonts/fira-sans-regular.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* basic layout */
/* 12pt, matching page.css and post.css. This is not cosmetic: every shared
   measure on this page is stated in em, and em resolves against the element's
   own font size. With `small` here (13px) an identical `34em` rule produced a
   442px column on home and a 544px column on a post page. The two sheets have
   to share a basis or they cannot share a measure. */
body {
    background-color: var(--bg);
    margin: 0;
    padding: 0;
    font-family: 'FiraSans', sans-serif;
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ink);
}

.sideleft {
    /* The column is a 39rem (624px) box centred in the viewport, so its left
       edge sits at 50% - 312px. The sidebar hangs in the margin to the left
       of that: 280px wide with a 20px gutter puts its left edge at
       50% - 612px. Anchoring with left: 50% plus a negative margin is what
       makes it track the centring -- a fixed `left` value would drift out of
       alignment the moment the viewport changed width.

       labyrinth.html repeats this same offset so the coin does not move when
       you click through to it. If this number changes, that one does too.

       No top offset: a fixed element with top: auto sits at its static
       position, which is directly beneath the header. Source order is
       load-bearing here -- moving the header after this div would put the
       sidebar back at the top of the viewport, under the masthead. */
    position: fixed;
    left: 50%;
    margin-left: -612px;
    margin-top: 10px;
    background-color: var(--bg);
    margin-bottom: 10px;
    padding: 0;
    width: 280px;
}

.sideright {
    background-color: var(--bg);
    padding: 20px;
}

/* image */
.imageside {
    width: 280px;
    height: 280px;
    display: block;
    border-radius: 50%;
    margin-bottom: 15px;
    object-fit: cover;
    transition: box-shadow 0.3s ease;
}

.imageside:hover,
.sideleft a:focus-visible .imageside {
    box-shadow: 0 0 0 2px var(--ink);
    opacity: 0.9;
}

/* menu */
#menu {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* masthead

   The wordmark used to sit at the top of the sidebar menu. It now lives in a
   full-width header, matching post and category pages, so a reader arriving
   on any page of the site meets the same masthead in the same place.

   The nav rule is character-for-character the one in page.css and post.css.
   That is the point: the masthead and the reading text share a left edge on
   every page of the site because they are laid out by the same box. Change
   the measure in one place and it has to change in all three, which is the
   cost of the duplication P11 accepted. */
header {
    padding: 30px 0 15px 0;
    border-bottom: 1px solid var(--rule);
}

header nav {
    max-width: 34rem;
    margin: 0 auto;
    padding: 0 40px;
}

header nav a {
    font-family: 'Belgiano', serif;
    font-size: 1rem;
    text-decoration: none;
    color: var(--link);
}

header nav a:hover,
header nav a:focus-visible {
    color: var(--on-ink);
    background-color: var(--link);
}

header nav .nav-title {
    font-family: 'Aesthetic', serif;
    font-size: 1.35rem;
    text-decoration: none;
    color: var(--ink);
}

header nav .nav-title:hover,
header nav .nav-title:focus-visible {
    color: var(--on-ink);
    background-color: var(--ink);
}

header nav .nav-title:hover .tld,
header nav .nav-title:focus-visible .tld {
    color: var(--on-ink);
}

/* Sidebar wordmark. This repeats the masthead deliberately: the masthead is
   the site-wide header every page carries, and this is part of the sidebar
   block that sits under the coin. Two different treatments of the same
   words, at two sizes, doing two jobs. */
.site-title {
    display: block;
    text-align: right;
    font-family: 'Aesthetic', serif;
    font-size: 1.6rem;
    text-decoration: none;
    color: var(--ink);
    padding-top: 8px;
}

.site-title:hover,
.site-title:focus-visible {
    color: var(--on-ink);
    background-color: var(--ink);
}

.tld {
    color: var(--muted);
}

.site-title:hover .tld,
.site-title:focus-visible .tld {
    color: var(--on-ink);
}

/* dropdown */
.menu-item {
    width: 100%;
    text-align: right;
}

.menulabel {
    display: block;
    text-align: right;
    font-family: 'Belgiano', serif;
    font-size: 1.5rem;
    text-decoration: none;
    color: var(--link);
    padding: 0;
}

.menulabel:hover,
.menulabel:focus-visible {
    color: var(--on-ink);
    background-color: var(--link);
}

.dropdown {
    max-height: 0;
    overflow: hidden;
    /* visibility, not max-height alone. A zero-height overflow-hidden box
       still contains focusable links, so tabbing off the wordmark walked
       through all six collapsed dropdowns before reaching the first visible
       label -- invisibly, with no indication of where focus had gone.
       visibility: hidden takes them out of the tab order; overflow: hidden
       never did.

       The flip is instantaneous but delayed to the far end of the collapse,
       so closing animates the links out rather than blinking them away and
       then animating an empty box. */
    visibility: hidden;
    background-color: var(--bg);
    transition: max-height 0.2s ease-out, visibility 0s linear 0.2s;
}

.dropdown a {
    display: block;
    padding: 2px 0;
    text-decoration: none;
    color: var(--link);
    font-family: 'FiraSans', sans-serif;
    font-size: 0.85rem;
    text-align: right;
}

/* Was a style attribute on the <img> itself until the CSP made inline CSS
   worth counting. Sized to sit on the 10pt dropdown baseline. */
.dropdown-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.dropdown a:hover,
.dropdown a:focus-visible {
    color: var(--on-ink);
    background-color: var(--link);
}

/* Pointer: a 0.3s intent delay, so a pointer crossing the menu on its way
   somewhere else does not open every label it passes. */
/* 200px fitted three post links. The rss dropdown lists all ten feeds, per
   the site's own description of it, and ten entries at 0.75rem plus 2px
   padding each is about 170px before the reader enlarges anything. max-height
   is a transition target, not a layout box -- overshooting it costs nothing
   but a fractionally faster open, while undershooting silently clips the last
   entries with overflow: hidden. 400px leaves room for a reader at 24px. */
.menu-item:hover .dropdown {
    max-height: 400px;
    visibility: visible;
    transition: max-height 0.2s ease-out 0.3s, visibility 0s linear 0.3s;
}

/* Keyboard: immediate. The delay above guesses at pointer intent; a Tab
   keypress has no intent to guess at, and a third of a second of nothing
   after pressing it reads as a broken menu.

   Declared after the hover rule on purpose. The two have equal specificity,
   so when an item is both hovered and focused the later one wins, and the
   one that should win is the one that responds now. */
.menu-item:focus-within .dropdown {
    max-height: 200px;
    visibility: visible;
    transition: none;
}

/* sideright functionality */
/* 39rem with border-box is 624px, which is what page.css and post.css come
   to once 34em of content and their 40px padding are added up. The link
   carries 20px and .sideright carries the other 20px, so the text lands on
   exactly the same left edge as an article on its own page, and the hover
   frame sits in the 20px between. */
.sideright-link {
    text-decoration: none;
    color: inherit;
    display: block;
    box-sizing: border-box;
    max-width: 39rem;
    margin: 10px auto 10px auto;
    padding: 0 20px;
}

.sideright {
    background-color: var(--bg);
    padding: 20px;
    transition: box-shadow 0.3s ease, opacity 0.3s ease;
}

.sideright-link:hover .sideright,
.sideright-link:focus-visible .sideright {
    box-shadow: 0 0 0 2px var(--ink);
    opacity: 0.9;
}

/* skip link: the first thing in the tab order, off-screen until it has focus.
   On this page it jumps past the menu to the featured article. The same rule
   is in page.css and post.css. */
.skip-link {
    position: absolute;
    left: -100rem;
    top: 0;
    z-index: 10;
    padding: 0.4em 0.8em;
    font-family: 'Belgiano', serif;
    font-size: 1rem;
    text-decoration: none;
    color: var(--on-ink);
    background-color: var(--ink);
}

.skip-link:focus {
    left: 0;
}

/* article styles for sideright */

/* Base size on the article, not only on its paragraphs, so that text which is
   not in a <p> (a table cell, most of all) is the same size as the text
   around it. post.css explains this at length; the two must agree, since this
   is the same article shown in a different place. */
.sideright article.post {
    font-family: 'FiraSans', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
}

.sideright article.post h1 {
    font-family: 'Belgiano', serif;
    font-size: 2.35rem;
    line-height: 1.15;
    margin: 0 0 0.15em 0;
}

.sideright article.post h1 + .post-meta,
.sideright article.post .post-meta {
    font-family: 'Belgiano', serif;
    color: var(--muted);
    font-size: 1.15rem;
    margin: 0 0 1.4em 0;
}

.sideright article.post h2 {
    font-family: 'FiraSans', sans-serif;
    font-size: 1.5rem;
    line-height: 1.6;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.sideright article.post h3 {
    font-family: 'FiraSans', sans-serif;
    font-size: 1.25rem;
    line-height: 1.6;
    margin-top: 1.3em;
    margin-bottom: 0.4em;
}

.sideright article.post h4 {
    font-family: 'FiraSans', sans-serif;
    font-size: 1.1rem;
    line-height: 1.6;
    margin-top: 1.2em;
    margin-bottom: 0.3em;
}

.sideright article.post p {
    font-family: 'FiraSans', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    margin-bottom: 1.2em;
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.sideright article.post ol,
.sideright article.post ul {
    font-family: 'FiraSans', sans-serif;
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 0 0 1.2em 0;
}

/* Quotations and tables, as in post.css. */
.sideright article.post blockquote {
    margin: 0 0 1.2em 1.5em;
}

.sideright article.post table {
    border-collapse: collapse;
    margin: 0 0 1.2em 0;
}

.sideright article.post th,
.sideright article.post td {
    padding: 0.15em 1.5em 0.15em 0;
    text-align: left;
    vertical-align: top;
}

.sideright article.post th:last-child,
.sideright article.post td:last-child {
    padding-right: 0;
}

.sideright article.post .org-right {
    text-align: right;
}

.sideright article.post .org-center {
    text-align: center;
}

.sideright article.post sup {
    font-family: 'FiraSans', sans-serif;
    font-size: 0.75rem;
    line-height: 1;
}

/* Images, as in post.css: never wider than the column, and scaled in
   proportion to the width/height the build writes on them. */
.sideright article.post img {
    max-width: 100%;
    height: auto;
}

.sideright article.post #footnotes h2.footnotes {
    font-family: 'FiraSans', sans-serif;
    font-size: 1.15rem;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.sideright article.post #footnotes .footdef sup {
    font-family: 'FiraSans', sans-serif;
    font-size: 0.85rem;
    font-weight: bold;
    margin-right: 0.3em;
}

.sideright article.post .footnotes {
    font-family: 'FiraSans', sans-serif;
    font-size: 0.9rem;
}

.sideright article.post .footdef {
    font-family: 'FiraSans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
}

.sideright article.post .footpara {
    font-family: 'FiraSans', sans-serif;
    font-size: 0.9rem;
    display: inline;
}

/* Quoted blocks inside footnotes inherit footnote sizing rather than
   the 13pt article.post p rule. Org wraps #+begin_quote in a plain
   <blockquote> with no class, so we target it via #footnotes. */
.sideright article.post #footnotes blockquote,
.sideright article.post #footnotes blockquote p {
    font-family: 'FiraSans', sans-serif;
    font-size: 0.9rem;
    line-height: 1.5;
    text-align: justify;
    -webkit-hyphens: auto;
    hyphens: auto;
    margin-bottom: 0.8em;
}

.sideright article.post #footnotes blockquote {
    margin-left: 1.5em;
    margin-right: 0;
}

/* Narrow desktop -- two columns, pinned left.

   Above 1264px the column is centred in the viewport, which is what puts it
   in the same place as an article on its own page. Below that the centred
   column stops leaving room for the coin, and the old behaviour was to stack
   immediately. That threw away 280px of usable width: at 1100px there is
   plenty of room for both columns, just not with the space split evenly.

   So here the pair is pinned to the left at a fixed 320px offset -- 20px
   edge margin, 280px coin, 20px gutter -- and the right margin absorbs
   whatever is left. The switch is seamless because 1264px is precisely the
   width at which the centred column's left edge already sits at 320px:
   (1264 - 624) / 2 = 320. Nothing moves as you cross it; the right margin
   simply stops shrinking in step with the left one.

   What this gives up is the cross-page alignment. In this band home's column
   sits at 320px while a post page's stays centred, so the two no longer
   match at the same window width. That trade only applies here -- above
   1264px they still line up exactly -- and it buys two columns down to
   981px instead of 1265px.

   Below 981px even the pinned pair does not fit (320 + 624 + 20 = 964), and
   the layout stacks. */
@media (max-width: 1264px) and (min-width: 981px) {
    .sideleft {
        left: 20px;
        margin-left: 0;
    }

    header nav {
        margin: 0 20px 0 320px;
    }

    .sideright-link {
        margin: 10px 20px 10px 320px;
    }
}

/* Stacked -- below the width where two columns fit at all.

   The pinned pair above needs 320 + 624 + 20 = 964px. 981px is the floor
   with a little slack; under it a fixed sidebar does not reflow, it
   overlaps, so the layout has to stack.

   The alignment flips with the layout, not at a separate width. Beside the
   column the sidebar box is exactly coin-width, so the coin's right edge and
   the menu's right edge are already the same line and right is the only
   sensible reading. Above the column the box is the column's own 39rem, and
   the thing to line up with is the reading text -- which starts at the left.
   One rule, tied to the one structural change, rather than a third zone
   between them.

   labyrinth.html mirrors this breakpoint and this centring. */
@media (max-width: 980px) {
    .sideleft {
        position: static;
        left: auto;
        box-sizing: border-box;
        max-width: 39rem;
        width: 100%;
        margin: 10px auto 0 auto;
        padding: 0 40px;
    }

    .imageside {
        margin-left: 0;
        margin-right: auto;
    }

    #menu {
        align-items: flex-start;
    }

    .site-title,
    .menu-item,
    .menulabel,
    .dropdown a {
        text-align: left;
    }

    .sideright-link {
        margin-top: 20px;
    }
}

/* mobile */
@media (max-width: 600px) {
    header nav {
        padding: 0 20px;
    }

    /* Everything on a phone sits at a single 20px inset -- masthead,
       sidebar and article text alike, and the same 20px post.css and
       page.css use at this width. The preview link drops its side margins
       so .sideright's own 20px padding is the whole inset; without that the
       article text would land at 40px and the sidebar would have to chase
       it, putting home's masthead out of step with every other page. */
    .sideleft {
        padding: 0 20px;
    }

    /* The coin is wider than a phone's content box once the padding is taken
       out, so it has to shrink rather than overflow. Alignment is not set
       here -- the 1264px block already left-aligns everything the moment the
       sidebar stacks, and a phone is simply further into that same case. */
    .imageside {
        width: 100%;
        max-width: 280px;
        height: auto;
        aspect-ratio: 1;
    }

    .sideright-link {
        padding: 0;
        margin: 20px 0;
    }
}
