@import url('https://fonts.googleapis.com/css2?family=Karla:ital,wght@0,200..800;1,200..800&display=swap');

/* Thanks to VilleR https://int10h.org/oldschool-pc-fonts/ */
@font-face {
    font-family: 'IBM PS/55 re.';
    src: url(/font/Web437_IBM_PS-55_re.woff) format(woff2);
}

/* basic reset to replace Bootstrap's normalization */
html { box-sizing: border-box; }
*, *::before, *::after { box-sizing: inherit; }

/* Bootstrap-like heading spacing: no top margin, modest bottom spacing */
h1, h2, h3, h4, h5, h6 {
    margin-top: 0;
    margin-bottom: 0.5rem; /*similar to Bootstrap's default spacing*/
    line-height: 1.2;
    font-weight: 500;
}

body {
    font-family: "Calibri", monospace !important;
    font-size: 18px;
    color: #0d7680;
    padding: 10px;
    overflow: auto;
    background-color: #f2dfce;
    margin: 0; /*remove browser default*/
}

/* For landing page*/
/* .info-box {
    justify-content: center;
    background-color:  #fff1e0;
    padding: 15px;
    margin-top: 20%;
    margin-left: 20%;
    margin-right: 20%;
    margin: 0;
    width: 50%;
    text-align: center;

    position: absolute;
    top:0;
    bottom: 0;
    left: 0;
    right: 0;
    
    margin: auto;
} */

.info-box {
    /* Centre on page */
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    /* min-height: 100vh; */
    /* flex-direction defaults to "row" */
    flex-direction: column;

    font-family: 'IBM PS/55 re.';
    background-color: rgba(255, 241, 224, 0.85); /* increase opacity for visibility */
    padding: 20px;
    max-width: 90vw;
    width: max-content;
    min-width: 0;
    margin: 10px auto 0 auto;
    box-sizing: border-box;
    border: 1px solid #0d7680;
    z-index: 2; /* ensure above #life-bg */
    position: relative;
}

/*For holding main page content*/
.main-grid-container {
    display: grid;
    grid-template-areas:
        "logo header header header header header"
        "nav main main main main main"
        "toc main main main main main"
        "footer footer footer footer footer footer";
    grid-template-columns: 200px 1fr 1fr 1fr 1fr 1fr;
    grid-template-rows: auto auto 1fr auto;
    gap: 5px;
    padding-top: 5%;
    padding-left: 10%;
    padding-right: 10%;
    column-gap: 15px;
    row-gap: 15px;
}

/*I think this just applies to all divs within the grid?*/
/* 20251105 I commented this out and applied padding to only .main */
/* .main-grid-container>div {
    padding: 15px;
} */

.logo {
    grid-area: logo;
}

/* ensure logo image doesn't force odd row height */
.logo img {
    max-width: 100%;
    height: auto;
    display: block;
}

.header {
    grid-area: header;
    font-family: 'IBM PS/55 re.';
    display: flex;
    justify-content: flex-end;
    flex-direction: column;
    /*can override with !important, but... hm, good idea/practice?*/
    font-size: 30px;
    text-align: left;
    /* background-color: transparent !important; */
    /* border: none !important; */
}

/* links */
a {
    color: #0d7680;
    text-decoration: none;                   /* remove default underline */
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    text-decoration-skip-ink: auto;
    transition: color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
    cursor: pointer;
}

/* a:visited {
    color: #165e6a;
} */

a:hover,
a:focus {
    color: #074e4e;
    text-decoration: underline;
    background-color: rgba(13,118,128,0.04); /* subtle hover highlight */
    border-radius: 4px;
    outline: none;
}

a:focus-visible {
    box-shadow: 0 0 0 3px rgba(13,118,128,0.18);
    border-radius: 4px;
}

/* make it clear when content contains a link */
.main a {
    background-color: rgba(13,118,128,0.06);  /* light permanent background */
    padding: 0.1em 0.3em;                     /* tiny padding to separate bg from text */
    border-radius: 3px;
    text-decoration: underline;               /* always show underline for content links */
}

.nav {
    grid-area: nav;
    font-family: 'IBM PS/55 re.';
    border: 1px solid #000;
    background-color: #fff1e0;
    text-align: left;
    /* Fix height to fit content */
    height: auto;
    align-self: start;
    padding: 15px;
    margin-top: 0px;
}

/* Emulating bootstrap stuff */
.nav ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.nav ul ul {
    margin-left: 10px;
}

/* tighten vertical spacing for list items */
/* Tree style indents from https://gist.github.com/dylancwood/7368914 */
.nav li {
     margin: 0;
     padding: 0 7px;
     line-height: 20px;
     color: inherit;
     font-weight: normal;
     border-left:1px solid rgb(100,100,100);
}

.nav ul li:last-child {
    border-left: none;
}

.nav ul li:before {
      position:relative;
      top:-0.3em;
      height:1em;
      width:12px;
      color:white;
      border-bottom:1px solid rgb(100,100,100);
      content:"";
      display:inline-block;
      left:-7px;
}

.nav ul li:last-child:before {
    border-left:1px solid rgb(100,100,100);   
}

/* tighten up list appearance and link color */
.nav a {
    color: inherit;
    /* this misaligned linked/unlinked list items, and does not seem necessary? */
    /* padding: 2px 6px; */
    font-weight: 600;
    line-height: 1.2;
}

.nav li:not(:has(a)) {
    color: #5a5a5a;
    font-weight: 500;
}

.main {
    grid-area: main;
    border: 1px solid #000;
    background-color: #fff1e0;
    text-align: left;
    /* only works with !important blehh */
    padding-left: 20px !important;
    padding-right: 20px !important;
    font-family: 'Karla', sans-serif;
    padding-top: 15px;
    padding-bottom: 15px;
}

.footer {
    font-family: 'IBM PS/55 re.';
    grid-area: footer;
    text-align: right;
}

/*
Callout styles for 11ty markdown-it-obsidian-callouts
https://github.com/ebullient/markdown-it-obsidian-callouts/blob/main/style/index.css
*/
:root {
    --line-height-tight: 1.3;
    --callout-border-width: 2px;
    --callout-border-opacity: 0.25;
    --callout-padding: 6px 6px 6px 12px;
    --callout-radius: 4px;
    --callout-title-color: inherit;
    --callout-title-padding: 0;
    --callout-title-size: inherit;
    --callout-title-weight: 600;
    --callout-content-padding: 0;
    --callout-content-background: transparent;
    --callout-blend-mode: var(darken);
    --callout-info: 8, 109, 221;
    --callout-todo: 8, 109, 221;
    --callout-default: 8, 109, 221;
    --callout-bug: 233, 49, 71;
    --callout-error: 233, 49, 71;
    --callout-fail: 233, 49, 71;
    --callout-success: 8, 185, 78;
    --callout-example: 120, 82, 238;
    --callout-important: 0, 191, 188;
    --callout-summary: 0, 191, 188;
    --callout-tip: 0, 191, 188;
    --callout-question: 236, 117, 0;
    --callout-warning: 236, 117, 0;
    --callout-quote: 158, 158, 158;
}

.callout {
    overflow: hidden;
    border-style: solid;
    border-color: var(--callout-color);
    border-width: var(--callout-border-width);
    border-radius: var(--callout-radius);
    margin: 1em 0;
    mix-blend-mode: var(--callout-blend-mode);
    background-color: rgba(var(--callout-color), 0.1);
    padding: var(--callout-padding);
    --callout-color: rgba(var(--callout-default), 0.1);
    --callout-icon: lucide-pencil;
}

.callout .callout-title {
    padding: var(--callout-title-padding);
    display: flex;
    gap: 4px;
    font-size: var(--callout-title-size);
    color: rgba(var(--callout-color), 1);
    line-height: var(--line-height-tight);
    align-items: flex-start;
}

.callout .callout-title .callout-icon {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
}

.callout .callout-title .callout-title-inner {
    --font-weight: var(--callout-title-weight);
    font-weight: var(--font-weight);
    color: var(--callout-title-color);
}

.callout .callout-content {
    overflow-x: auto;
    padding: var(--callout-content-padding);
    background-color: var(--callout-content-background);
}
/* Override margins for callout paragraphs */
.callout .callout-content p {
    margin-top: 0px;
    margin-bottom: 6px;
}

.callout[data-callout="info"]{
    --callout-color: var(--callout-info)
    /* The default icon is fine */
}

.callout[data-callout="todo"] {
    --callout-color: var(--callout-todo);
    --callout-icon: lucide-check-circle-2;
}

.callout[data-callout="success"],
.callout[data-callout="check"],
.callout[data-callout="done"] {
    --callout-color: var(--callout-success);
    --callout-icon: lucide-check;
}

.callout[data-callout="warning"],
.callout[data-callout="caution"],
.callout[data-callout="attention"] {
    --callout-color: var(--callout-warning);
    --callout-icon: lucide-alert-triangle;
}

.callout[data-callout="danger"],
.callout[data-callout="error"] {
    --callout-color: var(--callout-error);
    --callout-icon: lucide-zap;
}

.callout[data-callout="tip"],
.callout[data-callout="hint"] {
    --callout-color: var(--callout-tip);
    --callout-icon: lucide-flame;
}

.callout[data-callout="example"] {
    --callout-color: var(--callout-example);
    --callout-icon: lucide-list;
}

.callout[data-callout="abstract"],
.callout[data-callout="summary"],
.callout[data-callout="tldr"] {
    --callout-color: var(--callout-summary);
    --callout-icon: lucide-clipboard-list;
}

.callout[data-callout="quote"],
.callout[data-callout="cite"] {
    --callout-color: var(--callout-quote);
    --callout-icon: quote-glyph;
}

/* Background for the index page life simulation */
#life-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1; /* ensure below .info-box */
    pointer-events: none;
    display: block;
}

.no-bg {
    background: transparent !important;
}

.toc-sidebar {
    grid-area: toc;
    align-self: start;
    position: sticky;
    top: 15px;
    background: rgba(255,241,224,0.95);
    border: 1px solid #0d7680;
    border-radius: 5px;
    padding: 5px;
    font-family: 'IBM PS/55 re.';
    font-size: 14px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.07);
    margin-top: 15px; /* Match this to top value for spacing below nav */
    margin-bottom: 0;
    margin-left: 0;
    margin-right: 0;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 2;
}

.toc-sidebar ol {
    padding-left: 1.2em;
    margin: 0.3rem 0;
}

.toc-sidebar ol ol {
    padding-left: 1.2rem;
}

.toc-sidebar ol ol li {
    font-weight: 400;
    opacity: 0.7;  /* Visually de-emphasize nested items */
}

/* Responsive images in main content and info-box */
.main img,
.info-box img {
    max-width: 95%;
    height: auto;
    display: block;
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

/*Style for blockquotes (Markdown ">") in .main and .info-box*/
.main blockquote,
.info-box blockquote {
    border-left: 4px solid #0d7680;
    background: rgba(13, 118, 128, 0.07);
    margin: 1em 0;
    padding: 0.75em 1em;
    font-style: italic;
    color: #2c3e50;
}

/* TODO Will this cause problems with multiple paragraphs in a blockquote? */
.main blockquote p,
.info-box blockquote p {
    margin-top: 0;
    margin-bottom: 0;
}