@import '/css/fonts.css';

/* Large screen */
@media (min-width: 769px) {
  html {
    font-size: 20px;
    --menu-box-width: 20%;
    --logo-width: 80px;
  }
}

/* Tablet screen */
@media (max-width: 768px) {
  html {
    font-size: 18px;
    --pad: 20px;
    --menu-box-width: 100%;
    --logo-width: 60px;
  }
}

/* Mobile screen */
@media (max-width: 450px) {
  html {
    font-size: 18px;
    --menu-box-width: 100%;
    --logo-width: 50px;
  }
}

:root {
  /* Color: primary */
  --dark: #002d28;
  --light: #f2f2f2;
  --blue: #005f73;
  --light-blue: #c1e0de;

  --pad: 2rem;
  --edge-gap: clamp(16px, 3vw, 24px);
  --size-large: 1.85rem;
  --size-small: 1.2rem;

  --maxwidth-body: 1400px;
  --maxwidth-text: 750px;

  --web-name-size: 54px;
  --footer-sections: 5rem;
  --toggle-margin: calc(0.55 * var(--logo-width));

  --margin-left: calc((100vw - var(--maxwidth-text)) * 0.5);

  --flap-width: 350px;
  --width: 80%;

  --height-cover: 82.5vh;

  /* Fonts: primary */
  --serif: 'Gentium';
  --sans: 'ClashDisplay';
  --mono: 'SpaceMono';
}

@media (min-width: 1025px) {
  :root {
    --maxwidth-text: 50vw;
  }
}

@media (max-width: 1024px) {
  :root {
    --size-large: 1.6rem;
    --size-small: 1rem;
    --maxwidth-body: 100%;
    --maxwidth-text: 60%;
  }
}

@media (max-width: 820px) {
  :root {
    --maxwidth-text: 80%;
  }
}

@media (max-width: 640px) {
  :root {
    --pad: 20px;
    --size-large: 1.6rem;
    --maxwidth-text: none;
    --margin-left: 2rem;
    --height-cover: 500px;
    --footer-sections: 2rem;
  }
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

html {
  width: 100vw;
  min-height: 100vh;
  -webkit-text-size-adjust: none;
  scroll-behavior: smooth;
  display: block;
  overflow-x: hidden;
}


body {
  margin: 0;
  padding: 0;
  font-family: var(--serif);
  color: var(--dark);
  background-color: var(--light);
  display: block;
  overflow-x: hidden;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  padding: calc(0.1 * var(--pad)) var(--edge-gap) 1rem;
  z-index: 100;
  display: block;
  background-color: var(--light);
  transform: translateY(0);
  transition: transform 0.25s ease-in-out;
}

header.header-hidden {
  transform: translateY(-100%);
}

.top-nav {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.top-nav .nav-right {
  display: flex;
  gap: 0.75rem;
  align-items: baseline;
}

.home-btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 2rem;
  color: var(--blue);
  background: none;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  vertical-align: baseline;
}

.home-btn:hover {
  color: var(--blue);
}

.btn {
  display: inline-block;
  font-family: var(--mono);
  color: var(--blue);
  background: none;
  padding: 10px 14px;
  border-radius: 6px;
  text-decoration: none;
  vertical-align: baseline;
}

.btn:hover {
  color: var(--blue);
  text-decoration-line: underline;
  text-underline-offset: 0.2rem;
  text-decoration-color: var(--blue);
}

@media (max-width: 480px) {
  .home-btn {
    font-size: 1.35rem;
    padding: 8px 10px;
  }

  .top-nav .btn {
    font-size: 1rem;
    padding: 8px 10px;
  }

  .top-nav .nav-right {
    gap: 0.4rem;
  }

  main {
    margin-top: 5rem;
  }
}

@media (max-width: 335px) {
  .home-btn {
    font-size: 1.1rem;
  }

  .nav-right {
    font-size: 0.9rem;
  }
}

main {
  margin-top: 6rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

@media (max-width: 640px) {
  main {
    padding: var(--pad);
  }
}

section {
  padding: var(--pad) 0;
  display: block;
}

.opener {
  color: var(--blue);
  padding: 0;
  position: relative;
  max-width: calc(var(--maxwidth-text) * 1.1);
  margin-left: var(--margin-left);
}

@media (max-width: 1024px) {
  .opener {
    left: 0;
    max-width: var(--maxwidth-text);
  }
}

@media (max-width: 640px) {
  .opener {
    margin-left: auto;
  }
}

.about {
  padding-top: 1rem;
}

nav {
  display: block;
}

div {
  display: block;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--sans);
  font-weight: bold;
  color: var(--blue);
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 25px;
}

p {
  font-size: 1rem;
  font-weight: normal;
  z-index: 1;
}

.articles-list {
  position: relative;
  padding: 0 var(--pad) var(--pad) calc(var(--pad) * 3);
  max-width: calc(1.3 * var(--maxwidth-text));
  margin: auto;
}

@media (max-width: 1024px) {
  .articles-list {
    top: 0;
    padding-left: var(--pad);
  }
}

.web-sections ul,
.web-sections li,
.articles-list ul,
.articles-list li {
  list-style: none;
  padding: 0;
}

.articles-list li {
  padding: 1.5rem 0;
}

.articles-list a {
  text-decoration: none;
}

.article-date {
  font-family: var(--mono);
  font-size: 0.9rem;
  color: var(--blue);
  padding-bottom: 0.9rem;
}

.articles-list h1 {
  font-family: var(--sans);
  font-size: 1.5rem;
  line-height: 1.2;
  display: inline-block;
  max-width: 50rem;
  padding-bottom: 0.6rem;
}

.article-description {
  font-family: var(--serif);
  font-weight: normal;
  color: var(--blue);
}

main.archives-list .content h2,
main.archives-list .content h3,
main.archives-list .content h4,
main.archives-list .content p,
main.archives-list .content blockquote,
main.archives-list .content ol,
main.archives-list .content ul,
main.archives-list .content .code,
main.archives-list .content .line {
  width: var(--maxwidth-text);
  margin-left: auto;
  margin-right: auto;
}

.progress {
  background-color: var(--blue);
  position: fixed;
  --scrollAmount: 0%;
  top: 0;
  left: 0;
  width: 10px;
  height: var(--scrollAmount);
  z-index: 1000;
}

.web-name {
  text-align: center;
  font-family: var(--mono);
  font-size: var(--web-name-size);
  font-weight: normal;
  color: var(--blue);
  margin: auto;
  position: relative;
}

@media (max-width: 820px) {
  .web-name {
    visibility: hidden;
  }
}

img {
  overflow-clip-margin: content-box;
  overflow: clip;
}

#logo {
  position: fixed;
  width: var(--logo-width);
  margin-top: -10px;
  top: var(--pad);
  right: var(--pad);
  z-index: 300;
  transition-property: top, transform;
  transition-duration: 0.5s, 1s;
}

#logo:hover {
  transform: rotate(180deg);
  transition: 1s;
}

.about {
  padding-top: 1rem;
}

a {
  color: var(--dark);
  text-decoration-line: underline;
  text-underline-offset: 0.2rem;
  text-decoration-color: var(--dark);
}

a:hover {
  color: var(--dark);
  text-decoration: none;
}

.sup-footnote {
  font-family: var(--sans);
  font-size: 0.75rem;
  font-weight: bold;
  color: var(--blue);
  padding: 0.1rem;
  margin: 0.1rem;
  border-style: solid;
  border-width: thin;
  border-color: var(--blue);
  border-radius: 0.2rem;
  cursor: pointer;
}

.footnote {
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: normal;
  position: absolute;
  margin-left: -3rem;
  margin-top: 1.3rem;
  padding: 14px 20px;
  border-radius: 4px;
  border: 1px solid var(--blue);
  /* box-shadow: 5px 5px 8px var(--light); */
  background-color: var(--light);
  z-index: 100;
  visibility: hidden;
  cursor: auto;
}

.sup-footnote:hover span {
  visibility: visible;
}

.footnote.clicked {
  visibility: visible;
}

ol,
ul {
  padding: 1rem;
  padding-left: 1.5rem;
  padding-right: 0;
}

hr {
  border: 0.1px solid var(--dark);
}

blockquote {
  max-width: var(--maxwidth-text);
  margin: 1rem;
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  padding-left: 1rem;
  background: var(--light);
  border-left: 0.2rem solid var(--blue);
  color: var(--blue);
  box-sizing: border-box;
}

.blockquote-text {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
}

.logo-divider {
  width: 1.7rem;
  display: block;
  margin: 1.5rem auto 1rem;
  transition: transform 1s;
}

.logo-divider:hover {
  transform: rotate(180deg);
  transition: 1s;
}

.footer {
  padding: 0;
}

.footer-divider {
  padding-bottom: 1rem;
}

.sections {
  max-width: var(--maxwidth-text);
  margin-left: var(--footer-sections);
  margin-right: var(--footer-sections);
  margin-bottom: 0;
  padding: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: bold;
  color: var(--blue);
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: space-between;
  position: relative;
  z-index: 700;
}

.section {
  margin-left: 3rem;
  margin-right: 3rem;
}

a.section {
  color: var(--blue);
  text-decoration-line: none;
}

.comments {
  font-family: var(--mono);
  font-style: italic;
  text-align: center;
  color: var(--blue);
  margin-bottom: 2rem;
}

.comments>a {
  color: var(--blue);
  text-decoration-color: var(--blue);
}

.searchbar {
  position: relative;
  padding: 0 var(--pad) var(--pad) calc(var(--pad) * 3);
  max-width: calc(1.3 * var(--maxwidth-text));
  margin: auto;
}

@media (max-width: 1024px) {
  .searchbar {
    top: 0;
    padding-left: var(--pad);
  }
}

input[type=text] {
  font-family: var(--mono);
  font-size: 1rem;
  color: var(--blue);
  border: none;
  width: var(--maxwidth-text);
  height: 3rem;
  background-color: transparent;
  background-image: url(../logos/search-icon.png);
  background-size: 2rem 2rem;
  background-position: 0 0.5rem;
  background-repeat: no-repeat;
  padding-left: 3rem;
  -webkit-transition: width 0.15s ease-in-out;
  transition: width 0.15s ease-in-out;
  resize: none;
}

input[type=text]:focus {
  outline: none;
  width: var(--maxwidth-text);
}

.tags {
  display: none;
}