/* fonts */

@font-face {
  font-family: 'Libre Franklin';
  font-weight: 100 900;
  font-display: swap;
  src: 
    url('/styles/fonts/librefranklin/LibreFranklin-VariableFont_wght.woff2') format('woff2'),
    url('/styles/fonts/librefranklin/LibreFranklin-VariableFont_wght.ttf') format('truetype');
}
@font-face {
  font-family: 'Libre Franklin';
  font-style: italic;
  font-weight: 100 900;
  font-display: swap;
  src: 
    url('/styles/fonts/librefranklin/LibreFranklin-Italic-VariableFont_wght.woff2') format('woff2'),
    url('/styles/fonts/librefranklin/LibreFranklin-Italic-VariableFont_wght.ttf') format('truetype');
}

:root {
    /* color variables */
    --bg-dark: hsl(227, 30%, 11%);
    /* maybe switch around med-dark/accent names? 
    I use med-dark for code highlights, and accent for <aside>, so far */
    --bg-med-dark: hsl(227, 12%, 17%);
    --bg-accent: hsl(227, 22%, 15%);
    --ui-line-dark: hsl(226, 24%, 29%);
    --fg-light: hsl(227, 87%, 95%);
    --fg-med-light: hsl(227, 45%, 75%);
    --link-color: hsl(227, 100%, 75%);

    --accent-light: hsl(327, 100%, 92%);
    --accent-med-light: hsl(327, 65%, 80%);
    /* --accent-med: hsl(327, 25%, 53%); */
    --accent-dark: hsl(327, 45%, 37%);

    /* size variables */
    --global-margin: 16px;
    --main-width: 50rem;
    --article-width: 45rem;
    --p-line-height: 1.75;
    --section-header-padding: 6px;

    /* lines, margins, borders */
    --header-footer-border-thickness: 3px;
    --border-radius-small: 2px;
    --border-radius-large: 8px;

    /* font variables */
    --body-font: "Libre Franklin", sans-serif;
    --body-font-weight: 400;
    --heading-font: "Libre Franklin", sans-serif;
    --heading-font-weight: 700;
    --heading-font-size: 1.2rem;

    font-family: var(--body-font);
    font-weight: var(--body-font-weight);
    /* canceled out for elements with display font */
    /* text-underline-offset: 0.2em; */
}

@media screen and (min-width: 768px) {
    :root { --global-margin: 4%; }

    header { margin-top: 32px; }
}

@media screen and (min-width: 940px) {
    :root { --global-margin: 5%; }

    header { margin-top: 32px; }
}
@media screen and (min-width: 1325px) {
    :root { --global-margin: 10%; }
}

/* header,
*/
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--heading-font);
    /* text-underline-offset: auto; */
    font-weight: var(--heading-font-weight) !important;
}
header, header * {
    font-family: var(--heading-font);
    /* text-underline-offset: auto; */
    font-weight: var(--heading-font-weight);
    font-size: var(--heading-font-size);
    
    & .dropdown-content { font-size: 0.95em; }
}
h1 { 
    font-size: 1.5em; 
    margin: 24px 0;
}
h2 { 
    font-size: 1.2em; 
    margin: 40px 0 8px;
}
/* make post title links/video links slightly smaller */
h2:is(.post-link), h2:is(.video-link) { font-size: 1.15em; }
h3 { 
    font-size: 1.1em;
    margin: 40px 0 8px !important;
}

/* ######## sticky footer ######## */
/* https://developer.mozilla.org/en-US/docs/Web/CSS/Layout_cookbook/Sticky_footers#alternate_method */
/* alt: https://css-tricks.com/couple-takes-sticky-footer/#aa-there-is-flexbox */
/* this worked: https://matthewjamestaylor.com/bottom-footer */
html,
body {
    min-height: 100%;
    padding: 0;
    margin: 0;
}
.wrapper {
    display: grid;
    grid-template-rows: auto 1fr auto;
    grid-template-columns: 100%;

    /* fallback height */
    min-height:100vh;

    /* new small viewport height for modern browsers */
    min-height:100svh;
}

/* ######## colors, sizes ######## */
body {
    background-color: var(--bg-dark);
    color: var(--fg-light);
    /* & a { color: inherit; } */
}
/* ######## cleanup ######## */
a,
a:hover,
a:focus,
a:active { 
    color: inherit !important; 
    /* & :not(header *):not(h1 *):not(h2 *):not(h3 *):not(h4 *) {
        color: var(--link-color) !important;
    } */
}

header {
    background-color: var(--bg-dark);
    margin-top: 16px;
    margin-left: var(--global-margin);
    margin-right: var(--global-margin);
    padding-bottom: 8px;
    border-bottom: var(--header-footer-border-thickness) solid var(--accent-med-light);
}

main {
    margin-top: 32px;
    margin-bottom: 32px;
    margin-left: var(--global-margin);
    margin-right: var(--global-margin);
    & hr {
        border: none;
        border-bottom: 1px solid var(--accent-med-light);
    }
}
@media screen and (min-width: 660px) {
    main { margin-top: 64px; }
}

footer {
    background-color: var(--bg-dark);
    color: var(--fg-light);
    border-top: var(--header-footer-border-thickness) solid var(--accent-med-light);
    margin-left: var(--global-margin);
    margin-right: var(--global-margin);
    margin-bottom: 8px;
    padding: 0;
    & #social-icons { margin-top: 16px; }
    & #social-icons, 
    #webring-links, 
    #footer-link-list {
        margin-bottom: 24px;
    }
    & #social-icons a:not(:last-child) { 
        padding-right: 12px;
        display: inline-flex;
        flex-flow: row wrap;
    }
    & #webring-links:not(:last-child) * {
        padding-right: 6px;
    }
    & #footer-link-list a {
        &:not(:last-child) { 
            padding-right: 16px;
            @media screen and (min-width: 480px) { padding-right: 18px; }
        }
        display: inline-flex;
        flex-flow: row wrap;
        line-height: 36px;
    }
}



/* ######## Header and Nav ########*/
header { padding-bottom: 4px; }
#cardImg {
    display: inline-flex;
    flex-flow: row wrap;
    & a {
        text-decoration: none !important;
        border-bottom-style: none !important;
    }
    & a img:not(:last-child) { padding-right: 22px; }
}
#floppy-disk { vertical-align: 1px; }

nav {
    margin: 16px 0 16px;
    /* padding-bottom: 0; */
    position: relative;
    display: grid;
    /* grid-template: 1em / auto auto; */

    > * {
        grid-column-start: 1;
        grid-row-start: 1;
    }

    & .name-heading {
        /* z-index needed because .hamburger-contents overlaps */
        z-index: 1;
        width: fit-content;
        height: fit-content; /* necessary so it doesn't overlap hamburger content, prevent clicking */
    }

    & .hamburger-contents {
        /* top: -1em; */
        /* grid-column-start: 1; */
        position: relative;
        display: grid;
        grid-template-rows: 1em auto;
        width: 100%;

        @media screen and (max-width: 59.9999em) {
            & #menuLinks {
                grid-column-start: 1;
                grid-row-start: 2;
                margin-right: auto;
            }
        }

        @media screen and (min-width: 60em) {
            & #menuLinks {
                grid-row-start: 1;
                margin-left: auto;
            }
        }

        /* want to move this up */
        /* & .hamburger-svg {
            top: -2px;
        } */
    }

    & a { display: block; }

    & #menuLinks {  margin: 8px 0; }

    & .navElement { padding-bottom: 8px; }

    & .dropdown-content a {
        padding: 6px 8px;
        display: block;
        width: max-content;
    }

    & .active {
        margin-right: auto;
        /* sets highlight size in dropdown layout */
        width: max-content;
    }

    & .dropdown {
        text-decoration: underline;
        position: relative;
        display: inline-block;
    }

    & .dropdown-content {
        background-color: var(--bg-dark);
        /* adds margins when in hamburger mode */
        margin: 8px 0;
        display: none;
    }

    & .dropbtn {
        color: inherit !important;
        font-family: inherit !important;
        font-size: inherit !important;
        text-decoration: underline !important;
        background-color: transparent !important;
        border: none !important;
        cursor: pointer !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    & .navIcon, .hamburger-contents {
        /* keeps on right side of screen */
        margin-left: auto !important;
    }

    & .dropbtn > img {
        fill: var(--fg-light) !important;
        /* color: var(--fg-light); */
        pointer-events: none;
        margin-left: 6px;
    }
}

.dropdown {
    &:focus,
    &:focus-within {
        .dropdown-content { display: block !important; }
    }
}

/* only when JS disabled */
/* @media (scripting: none) { */
/* when clicked, switches to pointer and allows closing */
.dropbtn.navIcon:focus { pointer-events: none; }
/* if I do this in hamburger, *whole thing* closes */
@media screen and (min-width: 60em) {
    .dropdown .dropbtn:focus { pointer-events: none; }
}
/* } */

/* toggles hamburger menu on/off */
/* only apply toggle logic if screen is right size */
@media screen and (max-width: 59.9999em) {
    #menuLinks {
        /* requires !important because defaults to display: none;? */
        margin-top: 12px !important;
    }
    /* hamburger menu contents hidden if box not checked */
    #menuLinks { display: none; }
    .dropdown-content { position: static; }
    .hamburger-contents {
        &:focus,
        &:focus-within {
            #menuLinks { display: block; }
        }
    }
}

/* Handles switching between hamburger menu and regular */
@media screen and (min-width: 60em) {
    nav {
        & .navIcon { display: none; }

        & .navElement { margin-left: 36px; }

        & #menuLinks {
            margin: 0;
            display: flex;
            flex-flow: row wrap;
            justify-content: right;
        }

        & .dropdown-content {
            position: absolute; /* ensures dropdown content doesn't shift other elements; was originally position: static; */
            padding: 12px 12px;
            border: 1px solid var(--accent-med-light);
            border-radius: var(--border-radius-small);
            box-shadow: 1px 1px 1px 1px var(--bg-dark);
        }
    }
}

/* ######## types of content ######## */
blockquote {
    /* allows positioning of :before relative to <blockquote> */
    /* position: relative; */
    /* was 0 */
    /* margin-left: 16px; */
    /* color: var(--fg-light); */
    /* color: var(--accent-med-light); */
    /* border-left: 1px solid var(--accent-med-light); */
    /* padding-left: 12px; */
    /* display: flex; */
    /* align & justify were recommended to me on fedi, but seem unnecessary */
    /* align-items: start; */
    /* justify-content: center; */
    color: var(--accent-light);
    margin-left: 0;
    /* grid stuff */
    display: grid;
	grid-template-columns: min-content 1fr;
	gap: 0.7ch;
    &:before {
        /* float: left;
        margin: -14px 18px auto 0; */
        /* position: absolute;
        top: -14px;
        left: -18px; 
        display: inline; */
        /* content: "“"; */
        content: url(/media/ui/blockquote-mark.svg);
        color: var(--accent-dark);
        /* font-weight: 900;
        font-size: 2.75rem;
        margin: -16px 0 0 0; */
    }
    /* everything but :before is in grid column 2 - lets you do multiple children to <blockquote> */
    * {
        grid-column: 2;
    }
    & ul, ol {
        padding-left: 32px;
    }
    & p {
        /* because 11ty inserts child <p> */
        margin: 0;
        padding: 0;
    }
}
/* @media screen and (min-width: 768px) {
    blockquote {
        gap: 0.75ch;
        &:before {
            margin-top: -18px;
            font-size: 3rem;
        }
    }
} */
/* @media screen and (min-width: 1325px) {
    blockquote {
        margin-left: 12px;
    }
} */

article,
section { margin: 0 0 48px; }
.sectionDescription { margin-bottom: 48px; }

@media screen and (min-width: 660px) {
    article,
    section { margin: 0 0 64px; }
    /* .sectionDescription {
        margin-bottom: 64px;
    } */
}

/* article,
section {
    & p,
    ul li,
    ol li {
        line-height: var(--p-line-height);
    }
} */
main, footer {
    & p,
    blockquote,
    ul li,
    ol li,
    .webmention-comment,
    .fedi-interactions,
    .fedi-syndication-links { line-height: var(--p-line-height); }
}

section {
    margin-top: 48px;
    margin-bottom: 48px;
}

img {
    max-width: 100%;
    height: auto; /* allows specifying explicit height/width, while still shrinking with page */
}

pre,
code {
    white-space: pre-wrap;
    word-wrap: break-word;
}
/* the :not() keeps the padding from affecting the source code blocks */
code:not(code[class*="language-"]) {
    background-color: var(--bg-med-dark);
    padding: 3px 5px;
    border-radius: var(--border-radius-small);
}
.bare-link-wrap { word-wrap: break-word; }
lite-youtube {
    max-width: 560px; /* also in videogrid.css on container */
    max-height: auto;
    aspect-ratio: 16/9 auto;
}
figure {
    font-size: 0.9em;
    line-height: 1.25;
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 2em;
}
figcaption { margin-top: 16px; }
@media screen and (min-width: 480px) {
    figure { margin-left: 1em; }
}

/* ######## Decorations ######## */
.sectionHeader {
    width: fit-content;
    padding-bottom: var(--section-header-padding);
    border-bottom: 1px solid var(--accent-med-light);
}

.dinkus {
    display: flex;
    justify-content: center;
    letter-spacing: 4px;
}

/* external links - borrowed from Wikipedia; footer > * doesn't work, but footer * does: https://stackoverflow.com/a/68211003 */
/* mask: url("data:image/svg+xml,%3C%3Fxml version='1.0' encoding='UTF-8'%3F%3E%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Ctitle%3E external link %3C/title%3E%3Cpath fill='currentColor' d='M6 1h5v5L8.86 3.85 4.7 8 4 7.3l4.15-4.16zM2 3h2v1H2v6h6V8h1v2a1 1 0 0 1-1 1H2a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1'/%3E%3C/svg%3E");
    background: currentColor;
    mask-size: cover; */
/* a[href*="//"]:not([href*="https://reillyspitzfaden.com"]):not(footer *):not(.u-syndication):not(.rss-link):not(lite-youtube *) {
    background-image: url(/media/external-link-paleblue.svg);
    background-position-x: right;
    background-position-y: center;
    background-repeat: no-repeat;
    background-size: 0.857em;
    padding-right: 1.15em; 
} */


.octothorpes-badge { width: fit-content; }

/* post info, statuslog info */
.meta-icon,
.loc-icon {
    position: relative;
    top: 2px;
}

.meta-text { margin-left: 3px; }
.loc-text { margin-left: 2px; }

.post-meta,
.post-loc { margin-bottom: 16px; }

/* moved .post-series style from blogposts.css to have consistent styling with interactions */
.post-series, .interaction {
    /* font-style: italic; */
    border-left: 1px solid var(--accent-med-light);
    padding-left: 12px;
    margin-top: 40px;
}
.skip-link { display: none; }

.bibliography { margin-bottom: 32px; }

.code-file {
    color: var(--fg-med-light);
    font-size: 0.95em;
    /* margin-left: 14px; */
}

.table-of-contents {
    background-color: var(--bg-accent);
    padding: 16px;
    border-radius: var(--border-radius-large);
    margin-top: 40px;
    margin-bottom: 40px;
    & ul {
        list-style: none;
        margin-block-start: 1.25em;
        margin-block-end: 1em;
        padding-inline-start: 32px;
    }
    & ul li { margin: 16px 0; }
}

aside {
    background-color: var(--bg-accent);
    padding: 2px 20px;
    border-radius: var(--border-radius-large);
    margin: 28px 0 32px 0;
    @media screen and (min-width: 480px) {
        &:is(.post-body-aside) {
            /* add left margin on wider screens */
            margin: 28px 0 32px 16px;
        }
    }
}

.digital-garden-preface {
    border-left: 1px solid var(--accent-med-light);
    padding-left: 12px;
}

.small-caps {
    font-variant: small-caps;
}

.centered {
  max-width: fit-content;
  margin-left: auto;
  margin-right: auto;
}
