/* This is an arbitrary CSS string added to the bundle */
/* Font imports */
/* NOTE: prepend with "../" if using subdomain deployment */
@font-face {
    font-family: Alice;
    src: url("../_fonts/Alice-Regular.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: Mulish;
    src: url("../_fonts/Mulish-Regular.woff2") format("woff2");
    font-display: swap;
}

@font-face {
    font-family: Inconsolata;
    src: url("../_fonts/Inconsolata-Regular.woff2") format("woff2");
    font-display: swap;
}

/* Defaults */
:root {
    --font-family: -apple-system, system-ui, sans-serif;
    --font-family-monospace:
        Inconsolata, Consolas, Menlo, Monaco, Andale Mono WT, Andale Mono,
        Lucida Console, Lucida Sans Typewriter, DejaVu Sans Mono,
        Bitstream Vera Sans Mono, Liberation Mono, Nimbus Mono L, Courier New,
        Courier, monospace;
}

/*
 * System/light/dark theme reference: implementation by Kevin Powell
 * https://www.youtube.com/watch?v=zFFuV_vXNhY
 * https://codepen.io/kevinpowell/pen/KKEevOp
 * Search bar and results styling: https://pagefind.app/docs/ui-usage/#customising-the-styles
 */
:root {
    /* SYSTEM LIGHT */
    --color-gray-20: #e0e0e0;
    --color-gray-35: #a3a3a3;
    --color-gray-50: #444;
    --color-gray-90: #333;

    --background-color: #fff;

    --text-color: var(--color-gray-90);
    --text-color-link: #082840;
    --text-color-link-active: #5f2b48;
    --text-color-link-hover: #823a61;
    --text-color-link-visited: #17050f;

    --bar-color-workshop: #f59e0b;
    --bar-color-research: #10b981;
    --bar-color-software: #3b82f6;
    --bar-color-leadership: #af3c3c;

    --syntax-tab-size: 2;

    --pagefind-ui-background: var(--background-color) !important;
    --pagefind-ui-text: var(--text-color) !important;
}

@media (prefers-color-scheme: dark) {
    :root {
        /* SYSTEM DARK */
        --color-gray-20: #e0e0e0;
        --color-gray-35: #a2a2a2;
        --color-gray-50: #c0c0c0;
        --color-gray-90: #dad8d8;

        --text-color-link: #1493fb;
        --text-color-link-active: #6969f7;
        --text-color-link-hover: #a1a1fc;
        --text-color-link-visited: #a6a6f8;

        --bar-color-workshop: #f59e0b;
        --bar-color-research: #10b981;
        --bar-color-software: #3b82f6;
        --bar-color-leadership: #af3c3c;

        --background-color: #1e1c23;

        --pagefind-ui-background: #5b5b5b !important;
        --pagefind-ui-text: #d0d0d0 !important;
    }
}

html {
    color-scheme: dark light;
}

#theme-toggle {
  font-size: 1rem;
  background: none;
  border: none;
  cursor: pointer;
  transition: transform 0.1s;
}

#theme-toggle:hover {
  transform: scale(1.2);
}

[data-theme="light"] {
    /* SITE LIGHT */
    color-scheme: light;
    --color-gray-20: #e0e0e0;
    --color-gray-35: #a3a3a3;
    --color-gray-50: #444;
    --color-gray-90: #333;

    --background-color: #fff;

    --text-color: var(--color-gray-90);
    --text-color-link: #082840;
    --text-color-link-active: #5f2b48;
    --text-color-link-hover: #823a61;
    --text-color-link-visited: #17050f;

    --bar-color-workshop: #f59e0b;
    --bar-color-research: #10b981;
    --bar-color-software: #3b82f6;
    --bar-color-leadership: #af3c3c;

    --syntax-tab-size: 2;
 
    --pagefind-ui-background: var(--background-color) !important;
    --pagefind-ui-text: var(--text-color) !important;
}

[data-theme="dark"] {
    /* SITE DARK */
    color-scheme: dark;
    --color-gray-20: #e0e0e0;
    --color-gray-35: #a2a2a2;
    --color-gray-50: #c0c0c0;
    --color-gray-90: #dad8d8;

    --text-color-link: #1493fb;
    --text-color-link-active: #6969f7;
    --text-color-link-hover: #a1a1fc;
    --text-color-link-visited: #a6a6f8;

    --bar-color-workshop: #f59e0b;
    --bar-color-research: #10b981;
    --bar-color-software: #3b82f6;
    --bar-color-leadership: #af3c3c;

    --background-color: #1e1c23;

    --pagefind-ui-background: #5b5b5b !important;
    --pagefind-ui-text: #d0d0d0 !important;
}

/* Global stylesheet */
* {
    box-sizing: border-box;
}

@view-transition {
    navigation: auto;
}

/* Header fonts */
h1,
h2,
h3,
h4,
h5 {
    font-family: "Alice";
}

html,
body {
    height: 100%;
    box-sizing: border-box;
    padding: 0;
    margin: 0 auto;
    font-family: "Mulish"; /* Body text font */
    color: var(--text-color);
    background-color: var(--background-color);
}
html {
    overflow-y: scroll;
}
body {
    max-width: 52em;
}

/* https://www.a11yproject.com/posts/how-to-hide-content/ */
.visually-hidden:not(:focus):not(:active) {
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

/* Fluid images via https://www.zachleat.com/web/fluid-images/ */
img {
    max-width: 100%;
}
img[width][height] {
    height: auto;
}
img[src$=".svg"] {
    width: 100%;
    height: auto;
    max-width: none;
}
video,
iframe {
    width: 100%;
    height: auto;
}
iframe {
    aspect-ratio: 16/9;
}

p:last-child {
    margin-bottom: 0;
}
p {
    line-height: 1.5;
}

li {
    line-height: 1.5;
}

a[href] {
    color: var(--text-color-link);
}
a[href]:visited {
    color: var(--text-color-link-visited);
}
a[href]:hover{
    color: var(--text-color-link-hover);
    text-decoration: none;
}
a[href]:active {
    color: var(--text-color-link-active);
    text-decoration: none;
}

main,
footer {
    padding: 1rem;
}
main :first-child {
    margin-top: 0;
}

header {
    border-bottom: 2px dashed var(--color-gray-20);
}

table {
    margin: 1em 0;
}
table td,
table th {
    padding-right: 1em;
}

pre,
code {
    font-family: "Inconsolata" !important; /* Code font */
    font-size: 1.05em !important;
}
pre:not([class*="language-"]) {
    margin: 0.5em 0;
    line-height: 1.375; /* 22px /16 */
    -moz-tab-size: var(--syntax-tab-size);
    -o-tab-size: var(--syntax-tab-size);
    tab-size: var(--syntax-tab-size);
    -webkit-hyphens: none;
    -ms-hyphens: none;
    hyphens: none;
    direction: ltr;
    text-align: left;
    white-space: pre;
    word-spacing: normal;
    word-break: normal;
    overflow-x: auto;
}
code {
    word-break: break-all;
}

/* Header */
header {
    display: flex;
    gap: 1em;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    padding: 1em;
}
.home-link {
    flex: 1;
    font-size: 1em; /* 16px /16 */
    font-weight: 700;
    font-family: "Mulish"; /* Website title font */
}
.home-link:link:not(:hover) {
    text-decoration: none;
}

/* Nav */
.nav {
    display: flex;
    gap: 0.5em 1em;
    padding: 0;
    margin: 0;
    list-style: none;
}
.nav-item {
    display: inline-block;
}
.nav-item a[href]:not(:hover) {
    text-decoration: none;
    color: var(--text-color);
}
.nav a[href][aria-current="page"] {
    font-weight: bolder;
    color: var(--text-color-link-active);
}

/* Masonry container */
.postlist {
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 1200px;
    margin: 0 auto;
    column-count: 3;
    column-fill: balance;
    column-gap: 1.5rem;
    padding: 1rem;
}
@media (max-width: 768px) {
    .postlist {
        column-count: 2;
    }
}
@media (max-width: 500px) {
    .postlist {
        column-count: 1;
    }
}

.postlist-item {
    break-inside: avoid;
    display: inline-block;
    width: 100%;
    border-style: solid;
    border-color: var(--color-gray-35);
    border-width: 2px;
    border-radius: 8px;
    list-style: none;
    margin-bottom: 1.5rem; /* gap between cards vertically */
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative; /* enables absolute positioning of the favorite star */
}

.postlist-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 0 5px var(--color-gray-20);
}

/* Favorite item visual indicator using ::after */
.postlist-item[data-favorite]::after {
    content: "★";
    position: absolute;
    top: 0.25rem;
    right: 0.75rem;
    font-size: 1.25em;
    color: var(--text-color-link-hover);
    pointer-events: none;
}

.postlist-card {
    display: flex;
    flex-direction: column;
    color: inherit;
    text-decoration: none;
    padding: 1.25rem;
    border-radius: inherit;
}

.postlist-title {
    font-size: 1.1875em;
    font-weight: 700;
    margin-bottom: 0.5em;
    color: var(--text-color);
    letter-spacing: -0.01em;
}

/* Colored bar separator using ::before */
.postlist-title::before {
    content: "";
    display: block;
    width: 3.5rem;
    height: 2px;
    border-radius: 3px;
    margin: 0 auto 0.5rem auto;
    background-color: var(--color-gray-20); /* default / no type */
    transition: transform 0.2s ease;
    transform-origin: center;
    transform: scaleX(1);
}

.postlist-card:hover .postlist-title::before {
    transform: scaleX(1.1);
}

.postlist-item.type-software .postlist-title::before {
    background-color: var(--bar-color-software);
}

.postlist-item.type-research .postlist-title::before {
    background-color: var(--bar-color-research);
}

.postlist-item.type-workshop .postlist-title::before {
    background-color: var(--bar-color-workshop);
}

.postlist-item.type-leadership .postlist-title::before {
    background-color: var(--bar-color-leadership);
}

.postlist-description {
    line-height: 1.5;
    color: var(--color-gray-50);
    margin: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
    hyphens: auto;
}

.post-separator {
    border: none;
    border-top: 1px solid var(--color-gray-20, #e0e0e0);
    margin: 1.5rem 0;
}

.post-metadata {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    list-style: none;
    margin-top: 1rem;
    margin-bottom: 1rem;
    padding: 0;
}

.post-metadata-row {
    font-size: 0.9rem;
    line-height: 1.5;
}

.post-metadata-emoji {
    flex-shrink: 0;
    font-size: 1rem;
    line-height: 1;
    margin-right: 0.5rem;
}

.comma-wrapper:not(:last-child)::after {
  content: ", ";
}

.post-metadata-date time {
    font-variant-numeric: tabular-nums;
}

.post-description {
    font-size: 1.1rem;
    margin: 0.25rem 0 0;
}

.toc-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 100%;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem 0;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-color);
    text-align: left;
}

.toc-chevron {
    transition: transform 0.2s ease;
}

.toc-wrapper.collapsed .toc-chevron {
    transform: rotate(-90deg);
}

.toc {
    border: 1px solid var(--color-gray-20);
    border-radius: 8px;
    overflow: hidden;
    display: grid;
    padding: 0.75rem 1rem;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease, opacity 0.2s ease;
    opacity: 1;
}

.toc > * {
    min-height: 0; /* Required for 0fr to work properly */
}

.toc-wrapper.collapsed .toc {
    grid-template-rows: 0fr;
    opacity: 0;
    border: none;
}

.toc ol {
    list-style: none;
    padding-left: 1rem;
    margin: 0;
}

.toc > ol {
    padding-left: 0;
}

.toc a {
    font-size: 0.9rem;
    display: block;
    padding: 0.2rem 0;
}

.toc ol ol {
    margin-top: 0.15rem;
}

picture {
    display: grid;
    place-items: center;
}

picture img {
    border: 2px transparent;
    border-radius: 8px;
}

.wrapper {
    min-height: 100%;
    display: grid;
    grid-template-rows: auto 1fr auto;
}

.icon-svg {
    display: inline-block;
    width: 1em;
    height: 1em;
    vertical-align: -0.125em;
    overflow: visible;
}

.inner-footer {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 1em;
}

.inner-footer p {
    font-size: 0.9rem;
}