/* tested */
main.main-content {
    padding-inline: 3%;
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    grid-template-rows: 1fr;
    min-height: 100vh;
    transition: all 0.3s ease;             
}

.mobile-toc-site-button,
.mobile-toc-page-button {
    display: none;
}
nav.toc-sidebar-site,
nav.toc-sidebar-page {
    background: #f8f9fa;
    border-right: 1px solid #e9ecef;
    padding: 1.5rem;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;

}

nav.toc-sidebar-site {
    grid-column: 1;
    grid-row: 1;
}

article {
    grid-column: 2;
    grid-row: 1;
    padding: 2rem;
    overflow-x: hidden;
    max-width: 100%;
}
article header div.article-container {
    display: grid;
    grid-template-columns: 1fr 3fr 1fr;
    grid-template-rows: 1fr;
    transition: all 0.3s ease;             
}
article header div.article-container button.mobile-toc-site-button {
    grid-column: 1;
    grid-row: 1;
}
article header div.article-container div.header-actions {
    grid-column: 2;
    grid-row: 1;
}
article header div.article-container button.mobile-toc-site-button {
    grid-column: 3;
    grid-row: 1;
}

article header input[type="search"] {
    width: -webkit-fill-available;
    margin-left: 1em;
    margin-right: 1em; 
}
article header {
    margin-bottom: 4em;
}
article footer {
    margin-top: 4em;
}


nav.toc-sidebar-page {
    grid-column: 3;
    grid-row: 1;
}

article header div.meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

article header div.meta button,
article header div.meta a {
    align-items: center;
    display: inline-flex;
    padding: 10px 20px;
    text-decoration: none;
    box-sizing: border-box; 
}

article header div.meta button span.last-modified,
article header div.meta button span.created,
article header div.meta a.v-chip {
    white-space: nowrap;
}

article header div.meta a {
    color: #fff;    
}


button span.last-modified, button span.created {
    background: #f5f5f5;
}

@media screen and (min-width: 2048px) {
    button span.last-modified,
    button span.created,
    body {
        font-size: 1.6rem;
    }
    
}


@media print {
    nav.toc-sidebar-site,
    nav.toc-sidebar-page,
    .mobile-toc-site-button,
    .mobile-toc-page-button,
    .toc-toggle-button {
        display: none !important;
    }

    .main-content {
        display: block;
        min-height: auto;
    }

    article {
        width: 100%;
        padding: 0;
    }
}



/* figure */
figure {
    max-width: 95%;
    padding: 1em;
}
figure img {
    max-width: 100%;
    display:block;
    margin:auto;
}
figure figcaption {
    text-align: center;
}

/* table */
table {
    margin-left: auto;
    margin-right: auto;
    margin-top: 2em;
    margin-bottom: 2em;
    white-space: nowrap;
}

.table-container {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* three columns in page-navigation, prev -> parrent -> next */
nav.page-navigation {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;    
}
a.prev {
    text-align: left;
    grid-column: 1;
}
a.parent {
    text_align: center;
    grid-column: 2;
}
a.next {
    text-align: right;
    grid-column: 3;
}


blockquote {
    background-color: #F0F0F0;
    border-left: 5px solid #CCCCCC;
    font-style: italic;
    /* line-height: 24px; */
    margin: 0px 0px 24px 0px;
    /* margin-left: 24px; */
    padding: 6px 20px;
}

.admonition-title.note {
    line-height: 1;
    background: #6ab0de;

    color: #fff;
    font-weight: bold;
    display: block;
    padding: 6px 12px;
    margin-bottom: 0px;    
}

.admonition-title.note:before {
    margin-right: 4px;
    font-family: FontAwesome;
    content: "";
}

div.note {
    background: #e7f2fa;    
}

.admonition-title + div > p {
    margin: 0
}
.admonition-title + div {
    padding: 12px;
    margin-bottom: 24px;
}


/* table */
table thead th {
    font-weight: bold;
    border-top: 3px solid #e1e4e5;
    border-bottom: 1px solid #e1e4e5;
}
table td, table th {
    font-size: 90%;
    margin: 0;
    overflow: visible;
    padding: 8px 16px;
    background-color: white;
    border: 1px solid #e1e4e5;
}
table tr:nth-child(2n-1) td{
    background-color:#f3f6f6;
}
table tr:nth-child(2n) td{
    background-color:white;
}
table {
    border-left-style: hidden;
    border-right-style: hidden;
    border-bottom-style: hidden;
}

h2 {
    border-bottom: 1px solid #ddd;    
}

.MathJax, .mjx-chtml {
    user-select: none;
    pointer-events: auto;
}

code.inline {
    background: #fff;
    border: solid 1px lightblue;
    font-family: Consolas,"Andale Mono WT","Andale Mono","Lucida Console","Lucida Sans Typewriter","DejaVu Sans Mono","Bitstream Vera Sans Mono","Liberation Mono","Nimbus Mono L",Monaco,"Courier New",Courier,monospace;
    max-width: 100%;
    overflow-x: auto;
    padding: 0 5px;
    white-space: nowrap;
    color:darkred;
}

div.copyright p {
    text-align: center;
    color: #bbb;
}

a.beian {
    color: #bbb;
}

/* todo */
/* #content { max-width: 60em; margin: auto; } */

.title  { text-align: center;
          margin-bottom: .2em; }
.subtitle { text-align: center;
            font-size: medium;
            font-weight: bold;
            margin-top:0; }
.todo   { font-family: monospace; color: red; }
.done   { font-family: monospace; color: green; }
.priority { font-family: monospace; color: orange; }
.tag    { background-color: #eee; font-family: monospace;
          padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.org-right  { margin-left: auto; margin-right: 0px;  text-align: right; }
.org-left   { margin-left: 0px;  margin-right: auto; text-align: left; }
.org-center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
    border: 1px solid #e6e6e6;
    border-radius: 3px;
    background-color: #f2f2f2;
    padding: 8pt;
    font-family: monospace;
    overflow: auto;
    margin: 1.2em;
}
pre.src {
    position: relative;
    overflow: auto;
}
pre.src:before {
    display: none;
    position: absolute;
    top: -8px;
    right: 12px;
    padding: 3px;
    color: #555;
    background-color: #f2f2f299;
}
pre.src:hover:before { display: inline; margin-top: 14px;}
/* Languages per Org manual */
pre.src-asymptote:before { content: 'Asymptote'; }
pre.src-awk:before { content: 'Awk'; }
pre.src-authinfo::before { content: 'Authinfo'; }
pre.src-C:before { content: 'C'; }
/* pre.src-C++ doesn't work in CSS */
pre.src-clojure:before { content: 'Clojure'; }
pre.src-css:before { content: 'CSS'; }
pre.src-D:before { content: 'D'; }
pre.src-ditaa:before { content: 'ditaa'; }
pre.src-dot:before { content: 'Graphviz'; }
pre.src-calc:before { content: 'Emacs Calc'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-fortran:before { content: 'Fortran'; }
pre.src-gnuplot:before { content: 'gnuplot'; }
pre.src-haskell:before { content: 'Haskell'; }
pre.src-hledger:before { content: 'hledger'; }
pre.src-java:before { content: 'Java'; }
pre.src-js:before { content: 'Javascript'; }
pre.src-latex:before { content: 'LaTeX'; }
pre.src-ledger:before { content: 'Ledger'; }
pre.src-lisp:before { content: 'Lisp'; }
pre.src-lilypond:before { content: 'Lilypond'; }
pre.src-lua:before { content: 'Lua'; }
pre.src-matlab:before { content: 'MATLAB'; }
pre.src-mscgen:before { content: 'Mscgen'; }
pre.src-ocaml:before { content: 'Objective Caml'; }
pre.src-octave:before { content: 'Octave'; }
pre.src-org:before { content: 'Org mode'; }
pre.src-oz:before { content: 'OZ'; }
pre.src-plantuml:before { content: 'Plantuml'; }
pre.src-processing:before { content: 'Processing.js'; }
pre.src-python:before { content: 'Python'; }
pre.src-R:before { content: 'R'; }
pre.src-ruby:before { content: 'Ruby'; }
pre.src-sass:before { content: 'Sass'; }
pre.src-scheme:before { content: 'Scheme'; }
pre.src-screen:before { content: 'Gnu Screen'; }
pre.src-sed:before { content: 'Sed'; }
pre.src-sh:before { content: 'shell'; }
pre.src-sql:before { content: 'SQL'; }
pre.src-sqlite:before { content: 'SQLite'; }
/* additional languages in org.el's org-babel-load-languages alist */
pre.src-forth:before { content: 'Forth'; }
pre.src-io:before { content: 'IO'; }
pre.src-J:before { content: 'J'; }
pre.src-makefile:before { content: 'Makefile'; }
pre.src-maxima:before { content: 'Maxima'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-picolisp:before { content: 'Pico Lisp'; }
pre.src-scala:before { content: 'Scala'; }
pre.src-shell:before { content: 'Shell Script'; }
pre.src-ebnf2ps:before { content: 'ebfn2ps'; }
/* additional language identifiers per "defun org-babel-execute"
       in ob-*.el */
pre.src-cpp:before  { content: 'C++'; }
pre.src-abc:before  { content: 'ABC'; }
pre.src-coq:before  { content: 'Coq'; }
pre.src-groovy:before  { content: 'Groovy'; }
/* additional language identifiers from org-babel-shell-names in
     ob-shell.el: ob-shell is the only babel language using a lambda to put
     the execution function name together. */
pre.src-bash:before  { content: 'bash'; }
pre.src-csh:before  { content: 'csh'; }
pre.src-ash:before  { content: 'ash'; }
pre.src-dash:before  { content: 'dash'; }
pre.src-ksh:before  { content: 'ksh'; }
pre.src-mksh:before  { content: 'mksh'; }
pre.src-posh:before  { content: 'posh'; }
/* Additional Emacs modes also supported by the LaTeX listings package */
pre.src-ada:before { content: 'Ada'; }
pre.src-asm:before { content: 'Assembler'; }
pre.src-caml:before { content: 'Caml'; }
pre.src-delphi:before { content: 'Delphi'; }
pre.src-html:before { content: 'HTML'; }
pre.src-idl:before { content: 'IDL'; }
pre.src-mercury:before { content: 'Mercury'; }
pre.src-metapost:before { content: 'MetaPost'; }
pre.src-modula-2:before { content: 'Modula-2'; }
pre.src-pascal:before { content: 'Pascal'; }
pre.src-ps:before { content: 'PostScript'; }
pre.src-prolog:before { content: 'Prolog'; }
pre.src-simula:before { content: 'Simula'; }
pre.src-tcl:before { content: 'tcl'; }
pre.src-tex:before { content: 'TeX'; }
pre.src-plain-tex:before { content: 'Plain TeX'; }
pre.src-verilog:before { content: 'Verilog'; }
pre.src-vhdl:before { content: 'VHDL'; }
pre.src-xml:before { content: 'XML'; }
pre.src-nxml:before { content: 'XML'; }
/* add a generic configuration mode; LaTeX export needs an additional
     (add-to-list 'org-latex-listings-langs '(conf " ")) in .emacs */
pre.src-conf:before { content: 'Configuration File'; }

table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top;  }
th.org-right  { text-align: center;  }
th.org-left   { text-align: center;   }
th.org-center { text-align: center; }
td.org-right  { text-align: right;  }
td.org-left   { text-align: left;   }
td.org-center { text-align: center; }
dt { font-weight: bold; }
.footpara { display: inline; }
.footdef  { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.equation-container {
    display: table;
    text-align: center;
    width: 100%;
}
.equation {
    vertical-align: middle;
}
.equation-label {
    display: table-cell;
    text-align: right;
    vertical-align: middle;
}
.inlinetask {
    padding: 10px;
    border: 2px solid gray;
    margin: 10px;
    background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
.org-svg { }

div.code pre.src code {
    white-space: pre;
}


/* phone (<768px) */
@media screen and (max-width: 768px) {
    main.main-content {
        grid-template-columns: 1fr;
        grid-template-rows: 1fr;
        padding-inline: 1%;
        gap: 0;
    }

    table td, table th {
        font-size: 90%;
        margin: 0;
        overflow: visible;
        padding: 2px 4px;
        background-color: white;
        border: 1px solid #e1e4e5;
    }
    
    
    nav.toc-sidebar-site,
    nav.toc-sidebar-page {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100vh;
        z-index: 1000;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 2px 0 10px rgba(0,0,0,0.1);
    }
    
    nav.toc-sidebar-site.active,
    nav.toc-sidebar-page.active {
        display: grid;
        transform: translateX(0);
    }
    
    article {
        grid-column: 1;
        grid-row: 1;
        padding: 1.25rem;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0,0,0,0.5);
        z-index: 999;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    .mobile-toc-site-button {
        display: flex;
        position: fixed;
        top: 15px;
        left: 15px;
        z-index: 1001;
        background: #6c757d;

        color: white;
        border: none;
        border-radius: 4px;
        padding: 8px 12px;
        font-size: 14px;
        cursor: pointer;
    }
    
    .mobile-toc-page-button {
        display: flex;
        position: fixed;
        top: 15px;
        right: 15px;
        z-index: 1001;
        background: #6c757d;
        
        color: white;
        border: none;
        border-radius: 4px;
        padding: 8px 12px;
        font-size: 14px;
        cursor: pointer;
    }
}

