/* imports */

@import url(normalize.css);
@import url(prism.css);
@import url(material.css);
@import url(chango.css);
@import url(franklin.css);
@import url(caslon.css);

/* custom properties */

:root {
    --header-bg-color: #222;
    --header-fg-color: #fff;
    --main-bg-color: #333;
    --main-fg-color: #fff;
    --footer-bg-color: #444;
    --footer-fg-color: #fff;
    --accent-color: #cea6ba;
}

/* general */

html, body { 
    height: 100%;
    font-size: 24px; /* this is the absolute size of 1rem */
    line-height: 1.5rem; /* 36 / 24 = 1.5rem */
}

body {
    font-family: "Libre Caslon Text", serif;
    background-color: var(--main-bg-color);
    color: var(--main-fg-color);
}

header, main, footer {
    padding: 2rem 4rem 2rem 4rem;
}

a, a:visited {
    color: var(--accent-color);
}

/* header */

header {
    font-family: "Libre Franklin";
    display: flex;
    flex-direction: row;
    align-items: center;
    height: 8rem;
    background-color: var(--header-bg-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
}

header a, header a:visited {
    text-decoration: none;
    color: var(--header-fg-color);
}

header a > img {
    display: block;
    margin-right: 1rem;
}

header h1 > a {
    font-family: "Chango";
    margin: 0;
}

/* main */

main {
    display: flex;
    flex-direction: column;
    margin: 0;
}

main h2, main h3, main h4, main h5, main h6 {
    font-family: "Libre Franklin";
}

main h2 > a, main h2 > a:visited {
    text-decoration: none;
    color: var(--main-fg-color)
}

main h2 ~ h2 {
    margin-top: 2rem;
}

main h3 {
    font-size: 1.3;
}

main h4 {
    font-size: 1.1rem;
}

main h5, main h6 {
    font-size: 1rem;
}

main > article {
    width: calc(960rem / 24);
}

/* footer */

body > footer {
    font-family: "Libre Franklin";
    display: flex;
    flex-direction: column;
    align-items: center;
    background-color: var(--footer-bg-color);
    color: var(--footer-fg-color);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12), 0 1px 2px rgba(0, 0, 0, 0.24);
    margin: 0;
    position: sticky;
    top: 100vh;
}

/* nav */

header nav, main nav {
    font-family: "Libre Franklin";
    width: 100%;
}

header nav ul, main nav ol {
    display: flex;
    justify-content: flex-end;
    padding: 0;
}

header nav li {
    display: block;
    list-style: none;
    text-align: center;
    font-weight: 700;
    margin-left: 1rem;
}

main nav li {
    display: block;
    list-style: none;
    border: 1px solid white;
    text-align: center;
}

nav li a, nav li a:visited {
    display: block;
    color: var(--main-fg-color);
    text-decoration: none;
    min-width: 2rem;
    height: 2rem;
}

nav li a:hover {
    color: var(--accent-color);
}

/* cards */

section.cards {
    max-width: 47rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    align-items: flex-start;
    align-content: space-between;
    gap: 1rem;
}

.card {
    border-radius: 4px;
    width: 15rem;
    height: 13rem;
}

.card img {
    display: block;
    width: 100%;
}

.card .title {
    display: block;
    font-family: "Libre Franklin";
    font-weight: 700;
    text-decoration: none;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    margin: 1rem 1rem 0 1rem;
}

.card time {
    display: block;
    margin: 0 1rem 1rem 1rem;
    font-size: 0.75rem;
    color: #ddd;
}

.more {
    width: 15rem;
    height: 13rem;   
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.more img {
    width: 3rem;
    display: block;
    margin: 1rem;
}

.more a {
    font-family: "Libre Franklin";
    text-decoration: none;
    /* text-transform: uppercase; */
    font-weight: 700;
}

/* 404 */

.page-404 main {
    justify-content: space-around;
    align-items: center;
    height: 20rem;
}

.page-404 .emoticon {
    font-size: 500%;
}

/* preview */

.preview body {
    background-color: #444;
    background-image: radial-gradient(circle, rgba(34, 34, 34, 0) 0%, rgba(34, 34, 34, 1) 100%);
    background-size: cover;
    background-position: center center;
    color: #fff;
    font-family: "Libre Franklin";
    font-size: 24px;
    font-weight: 900;
    line-height: 1.5;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 1rem 2rem 1rem 2rem;
    max-height: calc(630px - 2rem);
    max-width: calc(1200px - 4rem);
}

.preview header {
    display: flex;
    flex-direction: column;
    background-color: transparent;
    box-shadow: none;
}

.preview header > h1 {
    color: var(--accent-color);
    font-size: 3rem;
    text-transform: uppercase;
    margin: 0;
}

.preview header > p {
    color: var(--header-fg-color);
    font-size: 3rem;
    margin: 0;
}

.preview header > time {
    font-size: 1.5rem;
}

.preview footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-end;
    background-color: transparent;
    box-shadow: none;
}

.preview footer > img {
    display: block;
    width: 180px;
}

.preview footer > div {
    font-size: 1.5rem;
}

.preview .badges img {
    width: 5rem;
    height: 5rem;
}
