/*
see https://www.joshwcomeau.com/css/custom-css-reset/
*/

/* 1. Box-sizing model */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    /* 3. Enable keyword animations */
    interpolate-size: allow-keywords;
}


* {
    /* 2. Remove default margin */
    margin: 0;

    /*
        3. Add accessible line-height 
        see https://kittygiraudel.com/2020/05/18/using-calc-to-figure-out-optimal-line-height/
    */
    line-height: calc(2px + 2ex + 2px);
}

body {
    /* 4. Improve text rendering */
    -webkit-font-smoothing: antialiased;
}

/* 5. Improve media defaults */
img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
}

/* 6. Inherit fonts for form controls */
input, button, textarea, select {
    font: inherit;
}

/* 7. Avoid text overflows */
p {
    text-wrap: pretty;
    overflow-wrap: break-word;
    hyphens: auto;
}

/* 8. Improve line wrapping */
h1, h2, h3, h4, h5, h6 {
    text-wrap: balance;
    overflow-wrap: break-word;
}


/*
  9. Create a root stacking context

  __OPTIONAL__

  see https://www.joshwcomeau.com/css/custom-css-reset/#nine-root-stacking-context-10
  see https://www.joshwcomeau.com/css/stacking-contexts/
*/
#root {
    isolation: isolate;
}

/* see https://gomakethings.com/how-to-animate-scrolling-to-anchor-links-with-one-line-of-css/#accessibility-concerns */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}
body {
    font-family: 'Gill Sans', 'Gill Sans MT', Calibri, 'Trebuchet MS', sans-serif;
    margin: 8px;
}

hr {
    margin: 1rem 0;
}

button {
    padding: 0.5rem 1rem;
    cursor: pointer;
}

p {
    margin-bottom: 1rem;
}

h1 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid;
}

h2 {
    margin-top: 0;
    margin-bottom: 2rem;
    font-size: 1.2rem;
    border-bottom: 2px solid;
}

h2:not(:first-child) {
        margin-top: 2rem;
        margin-bottom: 1rem;
    }

input {
    font-size: 1rem;
    border: 1px solid;
    padding: 0.4rem;
}

.value {
    margin-right: 1rem;
}

details {
    display: inline-block;
}

.id {
    border: 1px solid;
    padding: 1rem;
    overflow: scroll;
}

pre.key {
    display: inline-block;
    margin-bottom: 1rem;
}

ul {
    padding: 0;
    list-style: none;
}

ul li {
        margin-bottom: 1rem;
    }

:is(ul li) div {
            margin-top: 1rem;
        }

.encrypted-text, .decrypted-text {
    border: 1px solid;
    padding: 1rem;
    line-break: anywhere;
    margin: 1rem auto;
}

.decrypted-text {
    line-break: normal;
}

.main {
    display: flex;
    justify-content: space-between;
    flex-direction: row;
    gap: 1rem;
}

:is(.main .action) label {
            display: block;
        }

:is(.main .action) textarea {
            width: 100%;
            min-height: 6rem;
        }

.main .action,.main .right {
        width: calc(50% - 1rem);  /* Eliminate jank with details */
    }

.keys pre {
        border: 1px solid;
        padding: 1rem;
        overflow: scroll;
    }

form input {
        width: 100%;
    }

form div {
        margin-bottom: 1rem;
    }
