/* CSS file used for the overall geometries and font styles.
Color palettes are specified in the "thematic" CSS files.
Standard color palette (home and meta pages, fallback): earthy tones. */

@import url('https://fonts.googleapis.com/css2?family=Comfortaa:wght@300..700&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Atkinson+Hyperlegible+Mono:ital,wght@0,200..800;1,200..800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=La+Belle+Aurore&display=swap');
@font-face {
  font-family: Junicode;
  src: url(/conlangs/asset/JunicodeVF-Roman.woff2);
}
@font-face {
  font-family: JunicodeItalic;
  src: url(/conlangs/asset/JunicodeVF-Italic.woff2);
}

:root {
    font-size: 18px;
    --color-bg: 251, 235, 230;
    --color-txt: 77, 37, 0;
    --color-glosstrans: 0, 96, 128;
    --color-headers: 102, 0, 0; /* h1 ecc. */
    --color-thickbdr: 102, 0, 0;
    --color-gradstart: 255, 240, 179;
    --color-gradend: 251, 235, 230;
    --color-shadow: 0, 0, 0;
    --color-fnotes-menu-bdr: 204, 82, 0;
    --color-fnotes-menu-fill: 255, 240, 179;
    --color-menuicon: 102, 0, 0;
    --color-listmarker: 77, 37, 0; /* numeri ol */
    --color-links: 204, 82, 0;
    --color-links-visited: 158, 91, 46;
    --color-linkhover: 0, 153, 204;
    --color-linkhover-bg: 179, 236, 255;
    --color-dropdown-links: 102, 0, 0;
    --color-dropdown-linkhover: 251, 235, 230;
    --color-dropdown-linkhover-bg: 204, 82, 0;
    --color-nav-hover-border: 102, 0, 0;
    --color-nav-hover-shadow: 255, 235, 153;
    --color-thbg: 255, 235, 153;
    --color-tableodd: 248, 220, 211;
}
*, *::before, *::after {
    box-sizing: border-box;
}
html {
    scroll-behavior: smooth;
}
@media screen and (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* general */
body {
    background-color: rgba(var(--color-bg), 0.65);
    line-height: 1.4;
    font-family: "Junicode", serif;
    font-weight: 400;
    color: rgb(var(--color-txt));
    margin-bottom: 0;
    padding-bottom: 0;
}
@media screen and (min-width: 768px) {
  body {
    margin-right: 4.5rem;
    margin-left: 4.5rem;
  }
}
@media (prefers-color-scheme: dark) {
  body {
    background-color: rgb(var(--color-bg));
  }
}
p {
    text-align: justify;
    padding-right: 1%;
    text-indent: 0.6667em;
    margin-left: 0.25rem;
}

/* title and subtitle */
h1 {
    text-align: center;
    color: rgb(var(--color-headers));
    letter-spacing: 0.1111em;
    word-spacing: 0.3056em;
    font-size: 2.2223em;
    font-family: "Comfortaa", sans-serif;
    font-weight: 800;
    font-style: normal;
}
.subtitle {
    text-align: center;
    color: rgb(var(--color-headers));
    font-family: "JunicodeItalic", serif;
    font-weight: normal;
    font-size: 1.3333em;
    margin-top: 1%;
    margin-bottom: 2%;
}

/* sections */
h2, h3, h4, caption {
    color: rgb(var(--color-headers));
    margin-left: 0.25rem;
    letter-spacing: 0.0555em;
    font-family: "Comfortaa", sans-serif;
    font-style: normal;
    font-weight: 700;
}
h2 {
    font-size: 1.5556em;
    word-spacing: 0.3056em;
}
h3 {
    font-size: 1.3333em;
    margin-bottom: 0;
    margin-top: 0.55rem;
}
h4, caption {
    font-size: 1.1111em;
    margin-bottom: 0.25rem;
    font-weight: 550;
}

/* gloss containers */
.gloss {
    border-left: 0.3rem solid rgb(var(--color-thickbdr));
    background: linear-gradient(to right, rgba(var(--color-gradstart), 0.7), rgba(var(--color-gradend), 0.5));
    padding: 0.75rem 1.7rem 0.75rem 1.1rem;
    margin-left: 1.6667rem;
    margin-bottom: 0.6rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.gloss b {
    font-size: 1.0556em;
    display: inline-block;
    font-weight: 600;
    margin-bottom: 0.2rem;
}
.gloss em {
    display: block;
    margin-top: 0.3rem;
    color: rgb(var(--color-glosstrans));
}
.gloss:hover {
    transform: translateX(0.2778rem);
    box-shadow: 0 0.25rem 0.9rem rgba(var(--color-shadow), 0.1);
}

/* IPA */
.ipa {
    font-size: 0.8889em;
    font-family: sans-serif;
}

/* notes and references container */
.footnotes {
  font-size: 0.8055em;
  margin: 0.2222em 0.5556em 1.3333em 0.5556em;
  border-radius: 6px;
  border: 2px solid;
  overflow: auto;
  border-color: rgb(var(--color-fnotes-menu-bdr));
}
.notes-head {
  border-bottom: 2px solid rgb(var(--color-fnotes-menu-bdr));
  border-bottom-left-radius: 6px;
  border-bottom-right-radius: 6px;
  background-color: rgb(var(--color-fnotes-menu-fill));
  text-align: center;
  font-family: "Comfortaa", sans-serif;
  font-weight: 700;
  font-style: normal;
  font-size: 1.2223em;
  color: rgb(var(--color-headers));
  padding: 0.6rem;
}

/* lists */
ul {
    border-left: 0.3rem solid rgb(var(--color-thickbdr));
    background: linear-gradient(to right, rgba(var(--color-gradstart), 0.7), rgba(var(--color-gradend), 0.5));
    padding: 0.75rem 1.7rem 0.75rem 1.1rem;
    list-style-type: none;
    margin-left: 1.6667rem;
    margin-bottom: 0.6rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}
ul.nest, ol.nest {
    border-left: none;
    background-image: none;
    list-style-type: none;
    padding: 0.2rem 0 0 0;
    margin-left: 1.1111rem;
}
ul.in-text {
    border-left: none;
    background-image: none;
    list-style-type: none;
    padding: 0;
    margin-left: 2%;
}
ul.in-text li, ol li {
    border-left: 0.3rem solid rgb(var(--color-thickbdr));
    background: linear-gradient(to right, rgba(var(--color-gradstart), 0.7), rgba(var(--color-gradend), 0.5));
    padding: 0.4rem 1.7rem 0.4rem 1.1rem;
    margin-left: 1%;
    margin-bottom: 0.6rem;
    border-radius: 8px;
}

/* ordered lists, overriding the above */
ol {
  line-height: 1.6;
  margin-left: -0.55rem;
}
::marker {
  color: rgb(var(--color-listmarker));
  font-family: "Comfortaa", sans-serif;
  font-size: 0.85em;
}
ol li {
    margin-left: 1.6667rem;
}
ol.nest {
    margin-left: 0.3333rem;
}
ol.nest li {
    border-left: none;
    background-image: none;
    margin-left: 0.1111rem;
    margin-bottom: 0.25rem;
}

/* unvisited and visited links */
a {
  text-decoration: none;
  border-bottom: 1px dashed transparent;
  color: rgb(var(--color-links));
}
a:not(.nav-link):not(.menulink):not(footer *):link {
  border-bottom-color: rgba(var(--color-links), 0.65);
}
a:not(.nav-link):not(.menulink):not(footer *):visited {
  color: rgb(var(--color-links-visited));
  border-bottom-color: rgb(var(--color-links-visited));
}
a.nav-link:link, a.nav-link:visited {
  color: rgb(var(--color-links));
}
/* mouse over and selected links */
a:hover:not(:has(> img)), a:active:not(:has(> img)) {
  color: rgb(var(--color-linkhover));
  background-color: rgba(var(--color-linkhover-bg), 0.7);
  border-radius: 4px;
}

/* images */
img {
  border-radius: 4px;
}

/* all tables */
table {
  line-height: 1.8;
  border-collapse: collapse;
  padding: 0.5rem;
}
tr:nth-child(odd) {
  background-color: rgb(var(--color-tableodd));
}
th {
    background-color: rgb(var(--color-thbg));
    padding: 0.2778rem 0.4444rem 0.2778rem 0.4444rem;
    border: 1px solid rgb(var(--color-thickbdr));
}
td {
    padding-left: 0.2778rem;
    padding-right: 0.2778rem;
    border: 1px solid rgb(var(--color-thbg));
}

/* inline tables */
.inlinetable {
  margin-bottom: 0.7778rem;
  max-width: 94vw;
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid rgb(var(--color-thickbdr));
  border-radius: 8px;
  box-shadow: 0.1rem 0.25rem 0.8rem rgba(172, 0, 230, 0.15);
  width: fit-content;
}
.inlinetable:not(:where(.inlinetable-wrapper .inlinetable)) {
  margin-left: auto;
  margin-right: auto;
}
.inlinetable-wrapper {
  display: flex;
  justify-content: space-evenly;
  align-items: center;
  flex-wrap: wrap;
}
.has-caption {
  padding-top: 0.5rem;
}

/* specific rules for inline tables next to each other */
.inlinetable-wrapper .inlinetable {
  text-align: center;
  vertical-align: top;
  margin-right: 2.4rem;
}
.dualtable {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
  overflow-x: auto;
  padding: 1rem 0;
  align-items: flex-start;
  width: 100%;
}
.dualtable > .inlinetable {
  flex: 1 1 40vw;
  max-width: 40vw;
  min-width: 280px;
  margin-right: 0;
  overflow-x: auto;
  box-sizing: border-box;
  display: block;
}
.dualtable > .inlinetable table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
.inlinetable-wrapper:not(.dualtable) .inlinetable {
  display: inline-block;
  vertical-align: top;
  margin-right: 2.4rem;
}
@media (max-width: 768px) {
  .dualtable > .inlinetable {
    flex-basis: 100%;
    max-width: 100%;
    margin-right: 0;
  }
}

/* introduction tables */
.info-introduction {
  float: right;
  margin: 0 0 1.1rem 1.1rem;
  border: 1px solid rgb(var(--color-thickbdr));
  border-radius: 8px;
  box-shadow: 0.1rem 0.25rem 0.8rem rgba(172, 0, 230, 0.15);
  width: fit-content;
}
.info-introduction th {
  text-align: left;
  font-size: 1.0556em;
}

/* footer */
.footer-cont {
    display: flex;
    flex-wrap: wrap-reverse;
    justify-content: space-between;
    padding-left: 3.2rem;
    padding-right: 3.2rem;
}
.footer-right {
    text-align: right;
}
.footer-right span {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}
footer .icons {
    display: inline-flex;
    align-items: center;
    gap: 0.875em;
    font-size: 1.25em;
}
footer {
    margin-top: 1.4rem;
    padding-top: 2.224rem;
    padding-bottom: 2.224rem;
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    padding-left: calc(50vw - 50%);
    padding-right: calc(50vw - 50%);
    background-color: rgb(var(--color-fnotes-menu-fill));
    color: rgb(var(--color-glosstrans));
    font-family: "Comfortaa", sans-serif;
    font-size: 0.8888em;
}
footer a:link, footer a:visited {
  color: rgb(var(--color-glosstrans));
  text-decoration: none;
}
footer a:hover:not(:has(> img)), footer a:active:not(:has(> img)) {
  color: rgb(var(--color-links));
  background-color: rgba(var(--color-bg), 0);
  border-radius: none;
}
@media (min-width: 768px) and (max-width: 1080px) {
  .footer-cont {
    justify-content: center;
    padding-left: 0.9em;
    padding-right: 0.9em;
    gap: 1.5rem;
  }
}
@media (max-width: 768px) {
  .footer-cont {
    justify-content: center;
    padding-left: 0.45em;
    padding-right: 0.45em;
  }
  .footer-right {
    font-size: 0.8em;
    padding-bottom: 1.2em;
  }
}

/* menu */
.dropdown {
  position: fixed;
  bottom: 0;
  right: 0;
  width: 2.6665rem;
  height: 2.6665rem;
  border: 3px solid rgba(var(--color-fnotes-menu-bdr), 0.9);
  border-radius: 10px;
  text-align: center;
  background-color: rgba(var(--color-fnotes-menu-fill), 0.9);
  margin: 0.7778rem 0.7778rem 0.7778rem 5.5555rem;
  z-index: 9999;
}
.menu-icon {
  margin: 0;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.7777rem;
  padding: 6px;
  text-indent: 0;
  text-align: center;
  color: rgb(var(--color-menuicon));
}
.menu-button {
  all: unset;
  position: relative;
  width: 100%;
  height: 100%;
  cursor: pointer;
  border-radius: 10px;
}
.menu-button:focus-visible {
  outline-style: solid;
  outline-color: rgba(var(--color-linkhover), 0.8);
  outline-offset: 2px;
}
.dropdown-content {
  position: absolute;
  background-color: rgba(var(--color-fnotes-menu-fill), 0.95);
  border: 1px solid rgba(var(--color-fnotes-menu-bdr), 0.95);
  width: max(40%, 250px);
  bottom: 110%;
  right: 0%;
  margin-bottom: 0.2222rem;
  border-radius: 17px 45px 5px 45px;
  z-index: 9998;
  overflow: hidden;
  font-family: "Comfortaa", sans-serif;
  font-weight: 350;
  font-size: 0.8889rem;
  max-height: 86vh; /* scrolling */
  overflow-y: auto;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.1s ease;
}
.dropdown-content[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* theme toggle */
.theme-toggle {
  font-size: 1.25rem;
  cursor: pointer;
  background-color: rgba(var(--color-fnotes-menu-fill), 0.9);
  border: 3px solid rgba(var(--color-fnotes-menu-bdr), 0.9);
  border-radius: 10px;
  text-align: center;
  transition: all 0.3s ease;
  color: rgb(var(--color-menuicon));
  z-index: 200;
  top: 0;
  right: 0;
  width: 2.2223rem;
  height: 2.2223rem;
  margin: 0.7778rem 0.7778rem 0.7778rem 0.7778rem;
  position: absolute;
}
.theme-toggle:hover {
  transform: translateY(0.1rem);
  box-shadow: 0 3px 6px rgba(var(--color-nav-hover-shadow), 0.7);
}

/* "Back to top" button */
#topButton {
  display: none;
  position: fixed;
  bottom: 5px;
  right: 65px;
  z-index: 2000;
  width: 2.2223rem;
  height: 2.2223rem;
  font-size: 1.25rem;
  padding: 6px;
  color: rgb(var(--color-menuicon));
  border: 3px solid rgba(var(--color-fnotes-menu-bdr), 0.9);
  border-radius: 30px;
  text-align: center;
  background-color: rgba(var(--color-fnotes-menu-fill), 0.9);
  margin: 0.7778rem 0.7778rem 0.7778rem 5.5555rem;
  cursor: pointer;
  transition: all 0.2s ease;
}
#topButton:hover {
  background-color: rgba(var(--color-dropdown-linkhover-bg), 0.9);
  color: rgb(var(--color-dropdown-linkhover));
}
@media (max-width: 768px) {
  #topButton {
    left: 0;
    margin: 14px 14px 14px 14px;
  }
}

/* Links inside the menu */
.dropdown-content a {
  color: rgb(var(--color-dropdown-links));
  padding: 0.3333rem 0.5556rem;
  text-decoration: none;
  display: block;
  transition: all 0.2s ease;
}
/* Change color of dropdown links on hover */
.dropdown-content a:hover {
  background-color: rgba(var(--color-dropdown-linkhover-bg), 0.9);
  color: rgb(var(--color-dropdown-linkhover));
  font-weight: bold;
}

/* Section navigation */
.auto-nav {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1rem;
    align-items: start;
    margin: 1rem 0;
    padding: 0.5rem 0;
}
.auto-nav h3 {
    margin: 0;
    grid-column: 1;
}
.nav-links {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    justify-content: center;
}
.nav-link {
    display: inline-block;
    padding: 6px 12px;
    border: 1px solid rgba(var(--color-fnotes-menu-bdr), 0.9);
    background-color: rgba(var(--color-fnotes-menu-fill), 0.3);
    border-radius: 12px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: inherit;
    font-family: "Comfortaa", sans-serif;
}
.nav-link:hover {
    border: 1px solid rgb(var(--color-nav-hover-border));
    background-color: rgba(var(--color-dropdown-linkhover-bg), 0.9);
    color: rgb(var(--color-dropdown-linkhover));
    box-shadow: 0 3px 6px rgb(var(--color-nav-hover-shadow));
    border-radius: 12px;
}
.back-link {
    grid-column: 2;
    font-size: 0.85em;
    justify-self: end;
    align-self: center;
    margin-right: 0.8rem;
}
@media (max-width: 768px) {
    .auto-nav {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    .back-link {
        grid-column: 1;
        justify-self: start;
        order: -1;
        margin-bottom: 0.5rem;
    }
    .nav-links {
        grid-column: 1;
        justify-content: center;
    }
}

/* tooltips */
.tooltip {
  position: relative;
  display: inline;
  border-bottom: 1px dotted rgb(var(--color-dropdown-linkhover-bg));
  font-size: 1rem;
}
.tooltip .tooltiptext {
  visibility: hidden;
  width: 160px;
  bottom: 100%;
  left: 50%;
  margin-left: -80px;
  background-color: rgba(var(--color-dropdown-linkhover-bg), 0.9);
  color: rgb(var(--color-dropdown-linkhover));
  text-align: center;
  padding: 4px 6px;
  border-radius: 6px;
  position: absolute;
  z-index: 1;
  transition: all 0.2s ease;
}
.tooltip:hover .tooltiptext {
  visibility: visible;
}
.tooltip .tooltiptext::after {
  content: "";
  position: absolute;
  top: 100%;
  left: 50%;
  margin-left: -5px;
  border-width: 5px;
  border-style: solid;
  border-color: rgba(var(--color-dropdown-linkhover-bg), 0.9) transparent transparent transparent;
}

/* color csv */
.colors {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5556em;
  justify-content: center;
}

.color-item {
  display: flex;
  align-items: center;
  margin-left: 0.5556rem;
}

/* some specific CSS for the Epistolarium */
.comm-title {
  color: rgb(var(--color-headers));
  margin-left: 0.25rem;
  margin-bottom: 0.7778rem;
  margin-top: 0.7778rem;
  letter-spacing: 0.05em;
  font-family: "Comfortaa", sans-serif;
  font-weight: 450;
  font-style: normal;
}
.comm-date {
  font-size: 0.7778em;
  color: rgb(var(--color-glosstrans));
  margin-left: 0.25rem;
  margin-bottom: 0.7778rem;
  letter-spacing: 0.05em;
  font-family: "Comfortaa", sans-serif;
  font-weight: 350;
  font-style: italic;
}
.auth {
  font-style: italic;
  color: rgb(var(--color-glosstrans));
}
.context {
  font-size: 0.8055em;
  text-align: justify;
  padding-right: 1%;
  text-indent: 0.6666rem;
  margin-left: 0.25rem;
}

/* specific for the glosses in the Conlang Test Cases */
.numbered-example {
  display: flex;
  align-items: flex-start;
  margin-bottom: 6px;
}
.numbered-example .number {
  width: 30px;
  margin-right: 0;
  color: rgb(var(--color-listmarker));
  font-size: 1.3rem;
  font-style: italic;
  flex-shrink: 0;
  text-align: right;
}

/* card grids */
.card-grid {
  display: grid;
  justify-content: space-evenly;
  gap: 0.7rem;
  margin-left: 1.6666rem;
  margin-right: 1.6666rem;
  grid-template-columns: 1fr 1fr 1fr;
}
@media (max-width: 768px) {
  .card-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem;
  }
}
.card-flex {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-evenly;
  gap: 0.7rem;
  margin-left: 1.6666rem;
  margin-right: 1.6666rem;
}
.card {
    border-top: 0.3rem solid rgb(var(--color-thickbdr));
    border-left: 0.1rem solid rgb(var(--color-thickbdr));
    border-right: 0.1rem solid rgb(var(--color-thickbdr));
    border-bottom: 0.1rem solid rgb(var(--color-thickbdr));
    background: rgb(var(--color-gradstart));
    padding: 0.75rem 1.7rem 0.75rem 1.1rem;
    margin-bottom: 0.6rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1.0556em;
}
