/*
 *  Blog styles: the archive listing and the reading view.
 *  Loaded on top of styles.css, which supplies the palette and the light-mode
 *  rules everything here inherits.
 */

.prose {
    max-width: 42em;
    margin: 0 auto;
    padding: 3em 1.5em 2em;
    line-height: 1.6;
}

/* ---- nav ------------------------------------------------------------- */
.prose-nav {
    font-size: 12px;
    margin-bottom: 3em;
}
.theme-toggle {
    float: right;
    user-select: none;
    /* Has no href (it's a button in disguise), so it needs rescuing from the
       site-wide `a:not([href])` dimming. */
    opacity: 1;
    color: rgb(229,178,93);
}
.theme-toggle.light {
    color: rgb(138,101,82);
}

/* ---- headings and body ----------------------------------------------- */
.post-h1 {
    text-align: left;
    font-size: 22px;
    margin-bottom: 0.2em;
    line-height: 1.3;
}
.post-meta,
.prose-sub {
    color: rgb(115,108,96);
    font-size: 12px;
    margin-bottom: 2.5em;
}
.post-tags a {
    margin-left: 0.4em;
}
.prose h2,
.prose h3,
.prose h4 {
    color: rgb(229,178,93);
    text-align: left;
    margin: 2em 0 0.6em;
    line-height: 1.3;
}
.prose h2 { font-size: 17px; }
.prose h3 { font-size: 15px; }
.prose h4 { font-size: 14px; }
.prose h2.light,
.prose h3.light,
.prose h4.light {
    color: rgb(138,101,82);
}
.prose p {
    margin: 0 0 1.2em;
}
.prose a {
    text-decoration: underline;
}
.prose ul,
.prose ol {
    margin: 0 0 1.2em;
    padding-left: 1.4em;
}
.prose li {
    margin-bottom: 0.4em;
}
.prose img {
    max-width: 100%;
    display: block;
    margin: 1.5em 0;
}
.prose blockquote {
    margin: 1.5em 0;
    padding-left: 1em;
    border-left: 2px solid rgb(115,108,96);
    color: rgb(115,108,96);
}
.prose hr {
    border: none;
    border-top: 1px solid rgb(115,108,96);
    margin: 2.5em 0;
    opacity: 0.4;
}

/* ---- tables ---------------------------------------------------------- */
.prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5em 0;
    font-size: 13px;
}
.prose th,
.prose td {
    text-align: left;
    padding: 0.4em 0.6em;
    border-bottom: 1px solid rgb(115,108,96);
}
.prose th {
    color: rgb(229,178,93);
}
.prose th.light {
    color: rgb(138,101,82);
}

/* ---- code ------------------------------------------------------------ */
/* Colours come from the generated code.css; layout stays here. */
.prose code {
    font-family: Courier New, ui-monospace;
    font-size: 13px;
    background-color: rgb(24, 21, 18);
    padding: 0.1em 0.35em;
}
.prose code.light {
    background-color: rgb(255, 242, 224);
}
.prose pre {
    margin: 1.5em 0;
    padding: 1em;
    overflow-x: auto;      /* long lines scroll instead of breaking layout */
    background-color: rgb(24, 21, 18);
}
.prose pre.light {
    background-color: rgb(255, 242, 224);
}
.prose pre code {
    padding: 0;
    background: none;
    line-height: 1.45;
}
.codehilite {
    background: none;
}

/* ---- archive listing -------------------------------------------------- */
.archive {
    margin-bottom: 2.5em;
}
/* The whole row is one link, so the blanket `.prose a` underline has to be
   turned off here -- otherwise the date and summary get underlined too. */
.prose a.archive-row,
.prose a.archive-row:hover {
    text-decoration: none;
}
.archive-row {
    display: flex;
    gap: 1.2em;
    padding: 0.9em 0;
    color: inherit;
    border-bottom: 1px solid rgba(115,108,96,0.25);
}
.archive-row:hover .archive-title {
    text-decoration: underline;
}
.archive-date {
    flex: none;
    color: rgb(115,108,96);
    padding-top: 0.15em;
}
.archive-text {
    display: block;
}
.archive-title {
    display: block;
    color: rgb(229,178,93);
}
.archive-title.light {
    color: rgb(138,101,82);
}
.archive-summary {
    display: block;
    font-size: 12px;
    color: rgb(115,108,96);
    margin-top: 0.2em;
}
.archive-summary.light,
.archive-date.light {
    color: rgb(122,96,74);   /* the grey is too pale on the cream background */
}
.archive-empty {
    color: rgb(115,108,96);
    font-size: 13px;
}

/* ---- tags ------------------------------------------------------------ */
.tagcloud {
    font-size: 12px;
    margin-bottom: 2em;
}
.tagcloud a {
    margin-right: 0.6em;
}
.prose-foot {
    font-size: 12px;
    margin-top: 3em;
}

/* ---- small screens --------------------------------------------------- */
@media (max-width: 480px) {
    .prose {
        padding: 2em 1em 1em;
    }
    /* Stack the date above the title instead of squeezing two columns. */
    .archive-row {
        flex-direction: column;
        gap: 0.25em;
    }
}
