/* fonts */
:root {
    --purple: #e3d7ff;
    --green: #68ffab;
    --black: black;
    --white: white;
}
@font-face {
    font-family: 'sligoil-micro';
    src: url('/fonts/sligoil/Sligoil-Micro.otf');
    src:  url('/fonts/sligoil/Sligoil-Micro.woff2') format('woff2'),
    url('/fonts/sligoil/Sligoil-Micro.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'avara-black';
    src: url('/fonts/Avara-Black/Avara-Black.otf');
    src:  url('/fonts/Avara-Black/Avara-Black.woff2') format('woff2'),
    url('/fonts/Avara-Black/Avara-Black.woff') format('woff');
    font-weight: normal;
    font-style: normal;
}

p, div, span, li, dd, dt {
    font-family: sligoil-micro;
    line-height: 1.7;
}

blockquote {
    margin: 0;
    padding: 1rem;
    background: var(--purple);
}
pre:has(code) {
    background: var(--purple);
    padding: 1.5rem;
    font-size: 9pt;
    white-space: pre-line;
}

table {
    margin-top: 1rem;
    margin-bottom: 1rem;
}

/* used for very large tables, like the protocol-comparison */
div.table-container {
    overflow-x: scroll;
}

td, th {
    padding: 0.5rem;
    border: 1px var(--purple) solid;
}

th {
    background: var(--purple);
    font-family: avara-black;
    font-size: 9pt;
}

h1, h2, h3, h4, h5, h6, ul[role="list"]{
    font-family: avara-black;
}

h2 {
    font-size: 20pt;
    margin: 0;
}

h3 {
    margin-top: 2.5rem;
}

/* reset */
main, body { margin: 0; padding: 0; }
/* reset end */

/* top bar / nav settings */
header {
    height: 100%;
    width: 100%;
    background: url("/svg-elements/HEADER_DESKTOP_GRID.svg");
    background-attachment: fixed;
    background-size: contain;
}

header nav.desktop {
    display: flex;
    height: 100%;
    justify-content: space-between;
    align-items: center;
}
ul[role="list"] { list-style: none; }

nav { padding-right: 2.25rem;}
nav .active {
    background: var(--white);
    color: var(--black);
    border: 1px gray solid;
}
nav li {
    margin-left: 0.75rem;
}

.button { 
    display: inline-grid;
    box-sizing: border-box;
    text-decoration: none;
    font-family: avara-black;
    color: var(--white);
    background: var(--black);
    padding: 0.45rem;
    width: 7rem;
    border-radius: 0.5rem;
    align-content: center;
    justify-content: center;
    font-size: .65rem;

    border: 1px transparent solid;
    box-shadow: -2px 2px transparent; /* to prevent jitter on hover */
}
.button:hover {
    cursor: pointer;
    background: var(--white);
    color: var(--black);
    border: 1px transparent solid;
    box-shadow: -2px 2px var(--black);
}
.button:active {
    background: var(--purple);
    color: var(--black);
    box-shadow: none;
    border: 1px transparent solid;
    box-shadow: -2px 2px transparent; /* to prevent jitter on hover */
}
.button:focus {
    background: var(--white);
    color: var(--black);
    box-shadow: -2px 2px transparent; /* to prevent jitter on hover */
    border: 1px gray solid;
}

nav ul a {
    text-decoration: none;
}

ol li {
    padding: 0 0.5rem;
}

.logo {
    height: 1.5rem;
    cursor: pointer;
}

header .logo {
    padding-left: 2.25rem;
    margin-top: 0.5rem;
}
h1 {
    font-size: 3rem;
    line-height: 4rem;
}
.two-pane { 
    display: grid;
    grid-template-columns: min-content 1fr;
}
.two-pane > article {
    min-width: 40ch;
    padding: 1rem 3rem;
    display: flex;
    flex-direction: column;
}
.background-img {
    background: url("/images/fika.gif");
    background-position: 25% 45%;
    background-repeat: no-repeat;
    background-size: cover;
    height: calc(100vh + 3rem);
    margin-bottom: -3rem;
}

.sticky-footer {
    position: sticky;
    bottom: 0;
    left: 0;
    margin-bottom: -3rem;
}

/* newsbar */

details.newsbar-expand-details {
    position: absolute;
    bottom: 3rem;
    right: 0;
}
details.newsbar-expand-details > summary {
    display: block;
    cursor: pointer;
    width: 3rem;
    height: 3rem;
    position: absolute;
    bottom: 0;
    right: 0;
}

details[open].newsbar-expand-details > summary {
    right: 27rem;
}

.newsbar-details summary {
    display: block;
}

.newsbar-details > summary > div > span:first-of-type {
    font-family: avara-black;
}

details.newsbar-details > summary > div {
  display: flex;
  justify-content: space-between;
  box-sizing: border-box;
  padding: 1rem;
  width: 27rem;
  height: 3rem;
}
details.newsbar-details > summary > div:after {
    color: var(--purple);
    background: black;
    content: "read more";
    cursor: pointer;
}

details[open].newsbar-details { 
    position: fixed;
    bottom: 3rem;
    right: 0;
    max-height: 65vh;
    overflow-y: scroll;
}
details[open].newsbar-details > div {
    width: 27rem;
}
details.newsbar-details p {
    color: var(--white);
    padding: 1rem;
    margin: 0;
}
details.newsbar-details p a {
    color: var(--purple);
    text-decoration: none;
}
details[open].newsbar-details > summary { 
    margin-bottom: 2rem;
}
details[open].newsbar-details > summary > div {
    position: fixed;
}
details[open].newsbar-details > summary > div:after {
    content: "collapse";
    cursor: pointer;
}

.newsbar {
  display: grid;
  grid-template-columns: 3rem 27rem;
  grid-template-rows: 3rem;
  font-size: 0.75rem;
  justify-content: end;
}

.newsbar > div:nth-of-type(2) {
    height: 2rem;
    display: grid;
    grid-template-columns: 1fr 12ch 10ch;
    grid-column-gap: 1rem;
    align-items: center;
    padding: 0.5rem;
}

.newsbar > div:nth-of-type(2) > span:first-of-type {
    font-weight: bold;
}

details.keybar-details summary {
    left: unset;
    right: 0;
}
details[open].keybar-details summary {
    right: unset;
    left: 0;
}
.keybar-details summary {
    cursor: pointer;
    display: block;
    height: 3rem;
    width: 3rem;
    position: absolute;
    bottom: 0;
    left: 0;
}
.keybar-details summary > div > span {
    background: url("/svg-elements/CHAT_ICON_BLACK.svg");
}

.keybar {
    display: grid;
    grid-template-columns: 3rem 2fr 30rem;
    grid-template-rows: 3rem;
    font-size: 0.75rem;
}

details[open].keybar-details summary > div > span {
    background: url("/svg-elements/X_ICON_BLACK.svg");
}

.keybar-details summary > div:first-of-type, 
.newsbar-expand-details > summary > div:first-of-type, 
.keybar > div:first-of-type, 
.newsbar > div:first-of-type {
    width: 100%;
    height: 100%;
    display: inline-grid;
    align-items: center;
    justify-items: center;
}

.keybar > .key-container {
    width: 100%;
    display: grid;
    grid-template-columns: max-content 1fr;
    grid-column-gap: 1rem;
    align-items: center;
    justify-content: center;
}

.keybar > div:nth-of-type(3) {
    display: grid;
    align-content: center;
    justify-content: center;
    padding: 0.5rem;
}

.key-container > div {
    padding-left: 1rem;
}
.key-container > .key {
    margin-right: 1rem;
}

.key {
    user-select: all;
    padding: 0.5rem;
    border-radius: 0.5rem;
    background: var(--white);
    overflow-x: hidden;
    text-overflow: ellipsis;
}

.close-btn {
    height: 1rem;
    width: 1rem;
}
.bg-purple {
    background: var(--purple);
}
.bg-green {
    background: var(--green);
}
.bg-black {
    background: var(--black);
}
.text-black {
    color: var(--black);
}
.text-white {
    color: var(--white);
}
.text-green {
    color: var(--green);
}
.text-purple {
    color: var(--purple);
}

figure {
    margin: 0;
    padding: 0;
}

figcaption {
    font-style: italic;
    text-align: center;
}

a {
    color: var(--black);
    border-bottom: 1px solid var(--green);
}

/* mark external links */
dd a[href^="http"]::after, 
li a[href^="http"]::after, 
p a[href^="http"]::after{
	content: "*";
}

a:has(.logo), a:has(li.button) {
     border-bottom: unset;
 }

/* about styling */
.contribute ol strong, .about ol strong, ol li::marker {
    font-size: 16pt;
    font-family: avara-black;
    font-weight: bold;
    display: block;
    margin-bottom: 1rem;
}

.simple-layout ol li::marker {
    font-size: 11pt;
}

main.about {
    display: grid;
    grid-template-columns: 1fr;
    max-width: 60rem;
    justify-items: center;
    margin-left: auto;
    margin-right: auto;
    padding-top: 2rem;
}
.about article {
    max-width: 40rem;
    margin: 5rem 0;
    padding: 0 0.5rem 0 0.5rem;
}

.about img {
    max-width: 100%;
}

.chunky-footer {
  display: grid;
  grid-template-columns: 1fr 10rem 1fr;
  grid-column-gap: 2rem;
  padding: 2rem;
  height: 100%;
  width: 100%;
  background: url("/svg-elements/HEADER_DESKTOP_GRID.svg");
  background-attachment: fixed;
  background-size: contain;
  /* make adjustment for sticky footer */
  margin-bottom: -3rem;
  padding-bottom: 7rem;
  box-sizing: border-box;
  justify-items: center;
}

dl {
    display: grid;
    grid-template-columns: min-content 1fr;
    margin: 0;
}
dt {
    font-weight: bold;
}
dd {
    margin-left: 0.5rem;
}
dd, dt {
    display: inline;
}

.chunky-footer > section:first-of-type > * {
    display: block;
    max-width: 50ch;
}

.chunky-footer > section:nth-of-type(2) {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 9.75rem;
  margin-bottom: 0.25rem;
}
.chunky-footer > section:nth-of-type(2) > div:first-of-type {
    display: flex;
    justify-content: center;
    column-gap: 1rem;
}

.chunky-footer > section:nth-of-type(3) {
    display: flex;
}

body.about {
    height: calc(100vh - 3rem - 6rem);
}

/* contribute styling */
.contribute article {
    margin: 6rem auto;
    max-width: 40rem;
    padding: 0 0.5rem;
}
.two-column {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    grid-column-gap: 2rem;
}

.two-column div {
    text-align: center;
}
.two-column p {
    min-height: 12rem;
}

.contribute ol li::marker {
    color: var(--green);
}

.purple-banner {
    background: var(--purple);
    padding: 1.5rem 5rem;
    text-align: center;
}

.contribute .purple-banner > article {
    margin: 1rem auto;
}

.guiding-principles {
  background: var(--black);
  color: var(--white);
  width: 100%;
  padding: 3rem 0 5rem 0;
}

/* style h2 when it is the first sibling of a .two-column :) */
.contribute h2:has(+ .two-column) {
    text-align: center;
    margin-top: 5rem;
}

/* help section styling */
main.help {
    padding-top: 2rem;
}
main.help article {
    margin: 5rem auto;
    max-width: 40rem;
    padding: 0 0.5rem;
}

.instructions {
    background: var(--purple);
    padding: 2rem 0;
}

.instructions h3 {
    text-transform: uppercase;
}

/* simply layout */
main.simple-layout {
    margin: 5rem auto;
    max-width: 40rem;
    padding: 0 0.5rem;
    padding-top: 2rem;
}

/* for mobile: ed25519 keys (e.g. moderation spec) should wrap */
.simple-layout code {
    word-break: break-all;
}

.simple-layout p code {
    background: var(--purple);
    border-radius: 0.25rem;
    padding: 0.1rem 0.25rem;
}
.simple-layout pre code {
    word-break: keep-all;
}

main.simple-layout h2 {
    margin-top: 5rem;
}

main.simple-layout h2:first-of-type {
    margin-top: 0;
}

/* mobile adaptations */
header .mobile {
    display: none;
}

header .mobile ul {
    display: flex;
    flex-direction: column;
    row-gap: 1rem;
    width: 80vw;
    height: 100vh;
    margin: auto;
    padding: 0;
    padding-top: 3rem;
}

.mobile-logo-link {
    position: absolute;
    height: 3rem;
    display: none;
    place-content: center;
    margin: 0;
}
.mobile-logo-link .logo {
    margin: 0;
}

header .mobile summary {
    display: flex;
    justify-content: end;
    align-items: center;
    background: url("/svg-elements/HEADER_DESKTOP_GRID.svg");
    background-attachment: scroll;
    background-size: auto;
    background-attachment: fixed;
    background-size: contain;
    background-position-x: -1rem; /* hack: fix background not covering 100% */

    pointer-events: none;
}

header .mobile .menu-toggle {
    cursor: pointer;
    pointer-events: all;
}
header .mobile summary div {
    background: var(--purple);
    width: 3rem;
    height: 3rem;
}
header .mobile .x-icon {
    display: none;
    padding: 1rem;
}
details[open].mobile .menu-icon {
    display: none;
}
details[open].mobile .x-icon {
    display: block;
}

/* hide details marker on safari */
details summary::-webkit-details-marker {
    display: none;
}
@media screen and (max-width: 768px) {
    .mobile-logo-link {
        display: grid;
    }
    header .mobile {
        display: block;
        width: 100vw;
        background: var(--purple);
    }
    header .mobile li {
        width: 100%;
    }
    header nav.desktop {
        display: none;
    }
    header .logo {
        padding-left: 1.25rem;
    }

    header nav .button {
        padding: 1rem;
        font-size: 1rem;
    }
    .two-pane {
        grid-template-columns: 1fr;
        grid-template-rows: min-content 1fr;
    }
    .two-pane article {
        min-width: unset;
        padding: 1rem;
        margin: auto;
    }
    .two-pane .background-img {
        max-width: 100%;
        width: 100vw;
        height: 28rem;
        margin:0;
    }
    .chunky-footer {
        grid-template-columns: 1fr 7rem;
        justify-items: start;
    }
    .sticky-footer {
        display: none;
    }
    .chunky-footer > section:nth-of-type(3) {
        grid-column-end: 3;
        grid-column-start: 1;
        justify-self: start;
    }
    pre:has(code) {
        font-size: 7pt;
    }
    .purple-banner {
        padding: 1rem;
    }
    .two-column {
        grid-template-columns: 1fr;
    }

    .two-column p {
        min-height: unset;
    }

    .two-column .button {
        margin-top: 1rem;
        margin-bottom: 3rem;
    }
    .contribute article {
        margin: 2rem auto;
    }

    dd, dt {
        font-size: 0.75rem;
    }

    /* adjust top padding on mobile */
    main.help, main.about, main.simple-layout{ 
        padding-top: 0;
    }
    
    /* hide the embedded zine in mobile cause it doesn't work as of 2025-10-05 */
    /* main.help iframe, main.help a[href^="/download"]:first-of-type { */
    /*     display: none; */
    /* } */
    main iframe {
        width: calc(100vw - 1rem);
    }
}

