@import "common.css";

ol.code {
    counter-reset: code;
    padding-left: 3em;
    line-height: 1.5;
    font-family: monospace;
}

ol.code li {
    counter-increment: code;
    position: relative;
    list-style-type: none;
    white-space: pre-wrap;
}

ol.code li.comment, span.comment {
    color: hsla(0, 0%, 0%, 0.5);
}

ol.code li::before {
    content: counter(code);
    position: absolute;
    right: 100%;
    height: 100%;
    margin-right: 1em;
    padding-right: 1em;
    border-right: 2px solid hsla(0, 0%, 0%, 0.5);
    color: hsla(0, 0%, 0%, 0.5);
}

ol.code li::after {
    /* Ensure "strut". */
    content: " ";
}

ol.code.long {
    font-size: 1.75rem;
}

ol.code.longer {
    font-size: 1.5rem;
}

@media print {
    @page {
        size: landscape;
        margin: 0;
    }
}

html, body {
    height: 100%;
}

@media not print {
    [hidden] {
        display: none;
    }
}

section {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    padding: 3rem;
}

section > :not(:last-child) {
    margin-bottom: 1rem;
}

h1 {
    text-align: center;
    font-size: 3rem;
}

.title p, .subtitle {
    font-size: 1.5rem;
}

section.figure figure {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1;
}

section.figure img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

figure.cover {
    margin-left: -3rem;
    margin-right: -3rem;
    margin-bottom: -3rem;
}

figure.cover img {
    object-fit: cover;
}

figure.no-padding {
    margin-left: -3rem;
    margin-right: -3rem;
    margin-top: -3rem;
    margin-bottom: -3rem;
}

ul, ol:not(.code) {
    padding-left: 3rem;
    font-size: 2rem;
    line-height: 1.5;
}

ul li:not(:last-child),
ol:not(.code) li:not(:last-child) {
    margin-bottom: 0.5rem;
}

ul ul, ol:not(.code) ul, ul ol:not(.code), ol:not(.code) ol:not(.code) {
    margin-top: 0.5rem;
}

ol.code {
    font-size: 2rem;
}

blockquote {
    font-size: 2rem;
    line-height: 1.5;
}

blockquote cite {
    display: block;
    margin-top: 1rem;
    text-align: right;
}

blockquote cite::before {
    content: "– ";
}

.quotes {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.quotes > :not(:last-child) {
    margin-bottom: 3rem;
}

section.title {
    justify-content: center;
    text-align: center;
}

table {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    font-size: 0.875rem;
}

td, th {
    padding: 0.75em;
    border: 1px solid hsl(0, 0%, 50%);
    line-height: 1;
}

th {
    font-family: "Lato Black", sans-serif;
}

tbody th {
    text-align: left;
}

tbody th small {
    font-size: 0.675rem;
    vertical-align: middle;
    font-family: "Lato", sans-serif;
}

tbody th small::before {
    content: "\2003(";
}

tbody th small::after {
    content: ")";
}

.left { text-align: left }
.center { text-align: center }
.right { text-align: right }

#pyramid {
    position: relative;
}

#pyramid svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#pyramid > div {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

#pyramid > div > div {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Lato Black", sans-serif;
    font-size: 3rem;
    line-height: 1;
}

#data-computation-duality {
    position: relative;
}

#data-computation-duality svg {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

#data-computation-duality > div {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
}

#data-computation-duality > div > div {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    font-family: "Lato Black", sans-serif;
    font-size: 3rem;
    line-height: 1;
}

#program {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

#program .box {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 10rem;
    padding: 2rem;
    font-family: "Lato Black", sans-serif;
    font-size: 2.5rem;
    line-height: 1;
    background-color: hsl(0, 0%, 75%);
}

#program-input,
#program-logic,
#program-output {
    flex: 1;
}

#program-input-arrow,
#program-output-arrow {
    flex-basis: 12.5%;
    flex-grow: 0;
    flex-shrink: 0;
}

#program .arrow-right {
    position: relative;
}

#program .arrow-right::before {
    content: "";
    position: absolute;
    left: 1.5rem;
    right: 3.5rem;
    top: 50%;
    transform: translateY(-50%);
    height: 1rem;
    background-color: hsl(0, 0%, 25%);
}

#program .arrow-right::after {
    content: "";
    position: absolute;
    right: 1.5rem;
    top: 50%;
    transform: translate(-1px, -50%);
    border-left: 2rem solid hsl(0, 0%, 25%);
    border-top: 1rem solid transparent;
    border-bottom: 1rem solid transparent;
}

.tables {
    display: flex;
    flex-direction: row;
    justify-content: center;
    flex-wrap: wrap;
}

.tables > * {
    margin: 1rem;
}

.tables table, table.data {
    position: static;
    width: auto;
    height: auto;
    font-size: 1.5rem;
}

.tables table td, table.data td {
    padding: 1rem;
}

.tables table th[colspan], table.data th[colspan] {
    text-align: center;
}

p {
    font-size: 2rem;
}

ul.tree, ul.tree ul {
    position: relative;
    display: flex;
    flex-direction: row;
    justify-content: center;
    text-align: center;
    margin-top: 0;
    padding: 0;
}

ul.tree ul::before {
    content: "";
    position: absolute;
    display: block;
    left: 1rem;
    right: 1rem;
    top: 0;
    height: 0.125rem;
    background-color: black;
}

ul.tree li {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
}

ul.tree li:first-child::before,
ul.tree li:last-child::before {
    content: "";
    position: absolute;
    display: block;
    top: 0;
    width: 50%;
    height: 100%;
    background-color: white;
}

ul.tree li:first-child::before {
    left: 0;
}

ul.tree li:last-child::before {
    right: 0;
}

ul.tree li:first-child:last-child::before {
    width: 100%;
}

ul.tree span {
    position: relative;
    display: block;
    border: 0.125rem solid black;
    margin: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    padding: 1rem;
}

ul.tree span:not(:last-child)::after {
    content: "";
    position: absolute;
    display: block;
    left: 50%;
    top: 100%;
    width: 0.125rem;
    height: 2rem;
    transform: translateX(-50%);
    border-top: 0.125rem solid black;
    background-color: black;
}

ul.tree ul span::before {
    content: "";
    position: absolute;
    display: block;
    left: 50%;
    bottom: 100%;
    width: 0.125rem;
    height: 2rem;
    transform: translateX(-50%);
    border-top: 0.125rem solid black;
    background-color: black;
}

ul.tree span.text {
    border-color: transparent;
}

ul.tree span.attribute {
    border-style: dashed;
}
