/*
This file is structured into three sections
1. FONTS        - loads the font face (was fonts.css)
2. STRUCTURE    - defining the layout and structure of the site (was structure.css)
3. STYLE        - defining the design of the site, such as colours, fonts and so on (was style.css)
                - overridden by the theme as needed

In addition the default.css theme is loaded as a separate file
*/

/* ###################################### */
/* ############ FONTS ################### */
/* ###################################### */  

@font-face {
    /* https://github.com/mona-sans */
    font-family: 'Mona Sans';
    src:
      url('/assets/fonts/Mona-Sans.woff2') format('woff2 supports variations'),
      url('/assets/fonts/Mona-Sans.woff2') format('woff2-variations');
    font-weight: 200 900;
    font-stretch: 75% 125%;
    font-display: optional;
}

@font-face {
  /* https://www.brailleinstitute.org/freefont/ */
  font-family: 'AH-Next';
  src:
    url('/assets/fonts/AtkinsonHyperlegibleNextVF-Variable.woff2') format(woff2) tech(variations),
    url('/assets/fonts/AtkinsonHyperlegibleNextVF-Variable.woff2') format('woff2 supports variations'),
    url('/assets/fonts/AtkinsonHyperlegibleNextVF-Variable.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-stretch: 75% 125%;
  font-display: optional;
}

/* ###################################### */
/* ############ STRUCTURE ############### */
/* ###################################### */  

html {
    /*See: https://www.sitepoint.com/understanding-and-using-rem-units-in-css/*/
    font-size: 62.5%;
}

body {
    margin: 0;
}

.skip-link {
    position: absolute;
    left: 3px;
    top: 7px;
    border: 0;
    font-size: x-large;
    font-weight: 600;
    line-height: normal;
    padding: 2px;
    background-color: yellow;
    color: #000000;
    margin: 0;
    transform: translateX(-200%);
    transition: transform 0.3s;
}

.skip-link a {
    text-decoration: none;
    padding:2px;
}
.skip-link:focus-within {
    transform: translateX(0%);
    transition: transform 0.3s;
}

.nodisplay {
    display: none;
}

p {
    margin-bottom: 0;
}

header.masthead {
    margin:0;
    padding:0;
}

header p#themeSwitch {
    width:100%;
    text-align: right;
    margin: 0 0 10px 0;
}

header p#themeSwitch form {
    display: inline;
}

header div.header-area {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    margin: 0;
    padding: 20px 20px 20px 20px;
}

header div.nav-area {
    display: flex;
    margin: 0;
}

header img.logo {
    max-width: 50px;
    max-height: 50px;
    border-radius: 50%;
    vertical-align: middle;
}

header .sitetitle, header .subtitle {
    display: inline;
}

header nav {
    display:inline-block;
    text-align: right;
}

header h2 {
    margin: 0;
    margin-top: 10px;
}

main article section {
    margin-top: 20px;
}

/*
nav ul {
    font-size: 1.7em;
    display: inline-flex;
    flex-wrap: wrap;
    margin: 10px 0 0 0;
    padding: 0;
}

nav.paging {
    text-align: right;
}

nav.paging ul {
    font-size: 1em;
    display: inline-flex;
    flex-wrap: wrap;
    margin: 10px 0 0 0;
    padding: 0;
}

nav ul li {
    list-style: none;
    padding: 0 16px 0 0;
}   

nav ul li:last-child {
    padding: 0;
}
*/

header .header-nav {
    text-align: right;
}

header ul, header li {
    display: inline;
    padding-inline-start: 0;
}


main {
    clear: both;
    line-height: 1.6;
    font-size: 1.8em;
}

article ul, ul.postlist {
    list-style-type:none;
    padding-left: 0;
}

.postlist li {
    padding-bottom: 0.2em;    
}

article ul li::before, ul.postlist li:before {
    content: '👉';
    font-size: 0.9em;
    vertical-align: top;
    padding-right: 0.5em;    
}

article ul.taglist li::before {
    content: none;
}

ul.taglist {
    list-style-type: none;
}

ul.taglist li {
    display: inline;
    padding: 0 10px 0 0;
}

main div.main-content {
    margin:auto;
    padding: 10px 20px 20px;
}


main article header {
    text-align: center;
    margin:auto;
    margin-bottom: 1em;
}

blockquote {
    margin-left: 0;
}

main article blockquote p:last-child {
    margin-bottom: 0;
}

pre {
    white-space:pre-wrap;
}

code {
    word-break:break-all;
}

main > div.main-content, div.footer-area, header.masthead div.header-area {
    max-inline-size: 65rem;
    margin-inline: auto; 
}

main > article {
    padding-left: 15px;
    padding-right: 15px;
}

main article h1 {
    font-size: 1.5em;
    text-align: center;
    margin:auto;
}

table {
    border-collapse: collapse;
}

td, th {
    border: 1px solid #555555;
    padding: 5px 10px;
    text-align: left;
    vertical-align: top;
}

th {
    background-color: #ccc;
}

tr:nth-child(even) td {background: #fff}
tr:nth-child(odd) td {background: #eee}

ul p img, ul img {
    float: none;
    max-width: 100%;
    height: auto;
}

p img, figure img {
    display:block;
    margin-left: auto;
    margin-right: auto;
    padding-top: 8px;
    padding-right: 10px;
    max-width: 100%;
    height:auto;
    /*max-height: 600px;*/
    clear: both;
}

.badges p img {
    display:inline;
}

main article h1, main article h2, main article h3, main article h4, main figcaption {
    clear: both;
    margin-bottom: 5px;
}

main article p {
    margin-top: 0;
    margin-bottom: 20px;
    clear:both;
}

main ul, main ol {
    margin-top: 0;
}

div.tagged, div.prev-next {
    text-align: right;
}

.webmentions {
    margin-top: 50px;
}

.webmentions article {
    border: 0;
    padding-left: 0;
    margin:0;
    margin-bottom: 40px ;
}

.webmentions h3 {
    margin:0;
    font-size: 1em;
}

.webmentions footer {
    background-color: inherit;
    border: 0;
    padding:0;
    margin:0;
    font-size: 0.7em;
}

.webmentions footer p {
    margin: 0;
}

.webmentions footer cite {
    font-style: normal;
}

.webmentions footer a {
    text-decoration: underline;
    text-decoration-color: var(--main-highlight-color);
    text-decoration-thickness: 3px;
}

footer {
    /*margin-top: 10px;*/
    clear:both;
}

footer div, footer nav {
    display: block;
    padding-top: 5px;
    padding-bottom: 5px;
}

footer div.power {
    width:100%;
}
footer div.power img {
    vertical-align:text-bottom;
}

footer a.a11y-statement {
    display: inline-block;
    margin-bottom: 5px;
}

footer div.footer-area div {
    width:100%;
    display: inline-block;
}

footer div.euhosted {
    height: 1em;
}

footer div.euhosted img {
    height: 1.2em;
    vertical-align: middle;
}

footer .badges {
    padding-top: 5px;
}

footer .badges p {
  line-height: 200%;
}

footer .badges p a {
    display: inline-block;
    margin: 0 20px 0 0;
}

footer .copyright {
    padding-top: 15px;
}

footer div.footer-area {
    display: block;
}

footer div p,
footer div p img {
    border:0;
    padding: 0;
    margin: 0;
    vertical-align: text-bottom;
}

footer p img {
    display: inline;
}

main .barchart {
    width: 100%;
}

main .barchart .line {
    width: 100%;
    margin-top: 5px;
    margin-bottom: 0;
}

main .barchart a {
    width: 100%;
    display: inline-block;
}

main .barchart span {
    display: inline-block;
}

main .barchart a {
    text-decoration: none;
}

main .barchart a:active {
    text-decoration: none;
}

main .barchart .legend {
    /*border-right: #555555 solid 2px;*/
    width: 2.5em;
}
main .barchart .bar {
    width: calc(var(--p) / var(--max) * 60%);
    background-color: var(--header-bg-color);
}

main .barchart a:hover .bar {
    background-color: black;
}

main .main-content h2 a {
    /*text-decoration: none;*/
}

blockquote footer {
    all:unset;
}

/* =========
   MAX WIDTH
   =========  */
@media (max-width: 700px) { 
    header div.sitetitle {
        margin-right:40%;
    }
}

@media (max-width: 600px) { 
    header div.sitetitle {
        margin-right:20%;
    }
}

@media (max-width: 500px) { 
    header div.sitetitle {
        margin-right:10%;
    }
}

@media (max-width: 400px) { 
    header div.sitetitle {
        margin-right:5%;
    }
}


/* ###################################### */
/* ############ STYLE ################### */
/* ###################################### */  


body {
    font-family: 'Mona Sans', sans-serif, serif;
    background-color: var(--body-bg-color);
}

a, details summary {
    border:2px solid;
    border-color: rgba(0,0,0,0); /*use alpha = 0 to remove border color completely for all links*/
    color: var(--link-color);
    text-decoration-color: var(--main-highlight-color); /*rgb(248, 119, 175);*/
    text-decoration-thickness: 3px;
}

a:visited {
    color: var(--link-color);
}

a:focus, a:hover, button:focus, details summary:focus, details summary:hover  {
    background-color: var(--link-focus-bg-color)!important;
    color: var(--link-focus-color)!important;
    border:2px solid;
    border-color: var(--link-focus-color)!important;
    text-decoration: none!important;
}

button:disabled {
    color: #fff;
    background-color: #aaa;
}

header.masthead {
    background-color: var(--header-bg-color);
}

header.masthead p#themeSwitch select:focus {
  background-color: var(--link-focus-bg-color)!important;
}

header.masthead p#themeSwitch select:focus option {
    background-color: #fff !important;
  }
  
header #themeSwitch span {
    color: var(--header-title-color);
    font-size: 1.2rem;
    font-weight: bold;
    padding-right: 0.3rem;
}

header .sitetitle {
    margin: 0;
    margin-right:0;
/*    margin-left:15px; */
    color: var(--header-title-color);
    font-weight: bold;
    font-size: 4em;
    font-style: normal;
}

header .subtitle {
    margin:0;
    font-size: 1.6em;
    color: var(--header-subtitle-color);
    font-weight: normal;
    padding-top: 5px;
    font-style: normal;
    vertical-align:baseline;
    line-height: 2;
/*    letter-spacing: 0.035em; */
}

header .sitetitle a:visited, header .sitetitle a {
    color: var(--header-title-color);
}


header.masthead nav a {
    text-decoration: underline;
    text-decoration-thickness: 3px;
}

header nav.subtitle a.current {
    border:0;
    background-color: var(--header-title-color);
    color: var(--header-bg-color);
    text-decoration: none;
    padding: 0 2px 2px;
}

header nav.subtitle a.current:before {
    content: '»';
    padding-right: 2px;
}


header.masthead a {
    text-decoration: none;
}

nav a, nav a:visited, div.access a, div.access a:visited {
    color: var(--header-navtext-color);
    font-weight: bold;
    /*padding:0 2px;*/
}   

article nav a, article nav a:visited {
    color: var(--main-text-color);
    font-weight: normal;
    /*padding:0 2px;*/
}   

details summary {
    text-decoration: underline;
    inline-size: max-content;
}

details summary:hover {
    cursor: pointer;
}

div.posts-list nav a {
    color: var(--postlist-navtext-color);
}   

main {
    /*font-family: sans-serif, serif;*/
    color: var(--main-text-color); 
    background-color: var(--main-bg-color);
}

main h1, main h2, main h3 {
    color: var(--main-text-color); 
}

main article.welcome {
    text-align: center;
}

main article.welcome p {
    margin-bottom: 0;
}

header time {
    font-size: 0.75em;
}

.postlist time {
    font-size: 0.85em;
}

ul.taglist a.font-scale-2 {
    font-size: 1.5em;
}
ul.taglist a.font-scale-3 {
    font-size: 2em;
}
ul.taglist a.font-scale-4 {
    font-size: 2.5em;
}
ul.taglist a.font-scale-5 {
    font-size: 3em;
}

blockquote {
    border-left: 5px solid var(--main-highlight-color);
    padding: 10px 0 10px 20px;
}

div.posts-list hr {
    margin-top: 1em;
    margin-bottom: 2em;
    border-top: #dddddd solid 1px;
}


article header time, h2 time {
    font-weight: bold;
    font-size: 1em;
    /*float:left;*/
}

main.tmpl-post article header h1,
main.tmpl-page article header h1,
main.tmpl-home article header h2 {
    font-size: 2em;
}

main.tmpl-home article header time {
    font-size: 1.3em;
}

main article h2 {
    font-size: 1.5em;
}

h2.all-posts-list {
    border-top:2px solid #aaa;
    border-bottom:2px solid #aaa;
}

h2.all-posts-list span {
    font-size: 0.8em;
    font-weight: normal;
}

main article h3 {
    font-size: 1.2em;
}

div.see-all-posts {
    font-weight: bold;
    font-size: 1.5em;
    text-align: center;
}

div.see-all-posts::before {
    content: "👉";
}

div.see-all-posts::after {
    content: "👈";
}

main article pre, main p code {
    padding: 10px;
    border-radius: 15px;
    background-color: #eeeeee;
}

footer {
    border-top: var(--header-bg-color) solid 10px;
    background-color: var(--footer-bg-color);
    padding: 10px 20px;
    font-style: normal;
    font-size: 1.5em;
}

article footer {
    border-top: var(--header-bg-color) solid 3px;
    background-color: var(--body-bg-color);
    padding: 10px 0;
    font-style: normal;
    font-size: 0.9em;
}

footer div {
    color: var(--footer-text-color);
}

footer a {
    text-decoration: none;
}

footer div.footer-area nav {
    font-size: 1em;
}

footer div.footer-area nav a, footer div.footer-area nav a:visited {
    text-decoration: underline;
    /*text-decoration-color: rgb(248, 119, 175);*/
    text-decoration-thickness: 3px;
    font-weight: bold;
    color: var(--footer-navtext-color);
}

footer div.footer-area div, footer div.footer-area nav.webrings {
    font-size: 0.8em;
}

footer div.footer-area div a, footer div.footer-area div a:visited, footer div.footer-area nav.webrings a, footer div.footer-area nav.webrings a:visited
{
    text-decoration: underline;
    text-decoration-thickness: initial;
    font-weight: normal;
    color: var(--footer-navtext-color);
}

footer span.emojis {
    display: inline-block;
    font-style: normal;
    /*padding-top: 5px;*/
}

footer span.emojis a {
    text-decoration: none;
}

footer .emojis a:hover #git-icon,
footer .emojis a:focus #git-icon {
    content: url(/assets/images/codeberg-icon-blue.png);
}

footer .emojis a:hover,
footer .emojis a:focus {
    background-color: initial!important;
    border: none!important;
    text-decoration: none!important;
}
/* 
    Custom post styling postlists goes here
    at the end of the file to ensure it overrides the rest
*/
main div article.custom-rip {
    background-color: #aaa;
}

main div article.custom-rip a {
    text-decoration-color: #000;
}

main ul.postlist li.custom-rip a {
    text-decoration-color: #000;
}

main div article.custom-running table tr  {
    white-space: nowrap;
}

main div article.custom-running table tr td:last-child {
    white-space: wrap;
}


/* =========
   MIN WIDTH
   =========  */
@media (min-width: 375px) { 
    header div.sitetitle {
    font-size: 4em;
}
}

@media (min-width: 700px) { 
    main {
        font-size: 1.6em;
    }

    header div.sitetitle {
        font-size: 4em;
    }
}

@media (min-width: 900px) { 
    main div.main-content {
        border-left: #eeeeee solid 2px;
        border-right: #eeeeee solid 2px;
    }
}

/* ###################################### */
/* ############ DEFAULT ################# */
/* ###################################### */  

/*=========
  DARK MODE
  =========*/
  @media (prefers-color-scheme: dark) {
    :root {
        --body-bg-color: #333;
        --header-bg-color: #264d73;
        --header-title-color: #ddd;
        --header-title-focus-color: #B85F01;
        --header-subtitle-color: #fff;
        --header-navtext-color: #ffffff;
        --main-highlight-color: #009cd7;
        --main-bg-color: #333;
        --main-text-color: var(--header-title-color);
        --main-font-family: "'Lucia Grande', Verdana, Helvetica, Arial, sans-serif, serif";
        --postlist-navtext-color: #000000;
        --footer-bg-color: #aaa;
        --footer-text-color: #000;
        --footer-navtext-color: #000;
        --link-color: var(--header-title-color);
        --link-focus-color: #000;
        --link-focus-bg-color: #ffff00;
        --date-bg-color: var(--header-bg-color);
        --date-text-color: var(--header-title-color);        
    }
}

/*==========
  LIGHT MODE
  ==========*/
  @media (prefers-color-scheme: light) {
    :root {
        --header-bg-color: #007FAD;
        --header-title-color: #fff;
        --header-title-focus-color: #B85F01;
        --header-subtitle-color: #fff;
        --header-navtext-color: #ffffff;
        --main-highlight-color: #009cd7;
        --main-bg-color: #ffffff;
        --main-font-family: "'Lucia Grande', Verdana, Helvetica, Arial, sans-serif, serif";
        --postlist-navtext-color: #000000;
        --footer-bg-color: #eeeeee;
        --footer-text-color: #005c5c;
        --footer-navtext-color: #005c5c;
        --link-color: #000000;
        --link-focus-color: var(--link-color);
        --link-focus-bg-color: #ffff00;
        --date-bg-color: var(--header-bg-color);
    }
}
