@import url("../vendor/fontawesome/css/all.css");
@import url("../fonts/lato.css");

/**********************/
/* Variables
/**********************/

html {
  --details-background-color: rgba(0, 0, 0, 0.03);
  --summary-background-color: rgba(0, 0, 0, 0.05);
  --summary-hover-color: rgba(0, 0, 0, 0.4);
}

html.dark {
  --details-background-color: rgba(255, 255, 255, 0.03);
  --summary-background-color: rgba(255, 255, 255, 0.05);
  --summary-hover-color: rgba(255, 255, 255, 0.4);
}

/**********************/
/* HEADER
/**********************/

header {
  margin: 0 0 2rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  background: var(--primary-color);
  padding: 2rem 0;
  width: 100%;
}

header > h1,
header > h2 {
  color: white;
  line-height: 1.5;
  margin: auto;
  border: none;
}

header > h1 {
  font-size: 3rem;
  margin: 0 auto;
  padding: 0;
}

header > h2 {
  font-size: 2rem;
  margin: 0 auto;
  padding: 0;
  font-family: monospace;
  font-weight: normal;
}

header nav {
  margin-bottom: 0.5rem;
}

/**********************/
/* H1/H2 in non-header
/**********************/

h1 {
  font-size: 1.5rem;
  margin-top: 2em;
}

h2 {
  font-size: 1.25rem;
  margin-top: 1em;
  font-family: monospace;
}

hr {
  margin-top: 2rem;
}

details input {
  box-sizing: border-box;
  width: 100%;
}

/********************************/
/*       Actual content         */
/********************************/

html {
  width: 100%;
  height: 100vh;
  font-family: "Lato";
  position: relative;
}

body {
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  background: var(--background-color);
  color: var(--foreground-color);
  text-align: justify;
  margin: auto;
  width: 100%;
  height: 100%;
  line-height: 1.3; /* It is said 1.5 improves readability */
}

body.page {
  max-width: 100%;
}

main {
  flex-grow: 1;
  padding-top: 1rem;
  width: 50rem;
  max-width: 50rem;
  margin: auto;
}

footer {
  inset: 0;
  border-top: 1px solid var(--shade4);
  font-style: italic;
  font-size: 1rem;
  margin: 2rem 0 0 0;
}

footer p {
  padding: 0.5em;
  margin: 0;
  line-height: 2em;
}

@media only screen and (max-width: 600px) {
  main {
    width: 100%;
    box-sizing: border-box;
    padding: 1rem;
  }
}

a {
  color: var(--accent5-fg);
  text-decoration: none;
}

a:hover {
  text-shadow: none;
  text-decoration: underline;
  border: none;
}

/*********************************************
 * Detail boxes
 *********************************************/

div.media > figure {
  box-sizing: border-box;
  margin: auto;
  width: 100%;
}

details {
  box-sizing: border-box;
  margin-top: 20px;
  padding: 1em;
  padding-bottom: 0;
  border-radius: 10px;
  background: var(--details-background-color);
}
details[open] {
  padding-bottom: 1em;
}

details summary {
  box-sizing: border-box;
  width: auto;
  margin-left: -1em;
  margin-right: -1em;
  margin-top: -1em;
  margin-bottom: 0em;
  padding: 4px;
  padding-left: 0.5rem;
  border-radius: 8px;
  background: var(--summary-background-color);
  border: none;
  outline: none;
  cursor: pointer;
  font-weight: normal;
  font-size: 1em;
}

details[open] > summary {
  margin-bottom: 1em;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

details summary:hover {
  background-color: var(--summary-hover-color);
  color: var(--background-color);
}

details input {
  box-sizing: border-box;
  font-size: 1.25em;
  width: 100%;
}

/*********************************************
 * TABLES
 *********************************************/

table {
  display: table;
  /* width: fit-content; */
  width: 100%;
  margin: auto;
  border-collapse: collapse;
  border-spacing: 2px;
  border-top: 2px solid var(--foreground-color);
  border-bottom: 2px solid var(--foreground-color);
  text-align: center;
  margin-bottom: 1em;
  line-height: 1.5em;
}

table caption {
  margin: 10px 0px 0px 0px;
  line-height: 1.2;
  font-style: italic;
  font-size: 0.8em;
  text-align: center;
  caption-side: bottom;
}

table th {
  font-weight: bold;
}

table th {
  border-bottom: 1px solid;
}

table th,
table td {
  text-align: left;
  padding: 0.2em 1em 0.2em 1em;
}

table th[align="center"],
table td[align="center"] {
  text-align: center;
}

table th[align="right"],
table td[align="right"] {
  text-align: right;
}

table tbody tr:last-child th,
table tbody tr:last-child td {
  border-bottom: none;
}

td[align="center"] {
  text-align: center;
}

td[align="right"] {
  text-align: right;
}

td[align="left"] {
  text-align: left;
}

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

progress {
  accent-color: initial;
  margin: auto 0.5em;
  width: 3em;
}
