/*
  GOTHIC ARCHIVE design by flosha 
  css by flosha, avallach & delvin
*/

/* Base */

*, ::before, ::after {
  box-sizing: border-box;
}

html {
  background-color: #000;
  color: #706961;
  font-size: 12px; 
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace;
  line-height: 1.4;
}

body {
  --logo-height: 332px;
  --header-padding-top: 28px;
  --header-padding-bottom: 16px;

  -webkit-tap-highlight-color: transparent; /* Disable blue highlight on chrome (mobile) */
	
  margin: 0;
  min-height: 100dvh;
  display: flex;
}

::selection {
  background: #3c1e26;
}

ul {
  list-style: none;
  padding-left: 1em;
}

img {
  max-width: 100%;
  display: block;
}

audio {
  margin: 1em auto 1em;
}

code {
  overflow-x: auto;
  display: block;
  border: 1px solid #252525;
  padding: 1em;
}

/* Base Links */

a {
  color: #ac876d;
  text-decoration: none;
  transition: all 0.3s ease-out;
}
a:hover { color: #e4d7cc; }


/* Base Image Hover */

a img {
  opacity: 1;
	transition: opacity .4s ease-in-out;
}
  a:hover img { opacity: 0.6; }

/* Base Scrollbar */

* {
  scrollbar-color: #424242 hsl(0, 0%, 3%);
}

/* UTILITY */

.hide-text {
  text-indent: 100%;
  white-space: nowrap;
  overflow: hidden;
}

.todo { color: #a9655c; }

/* Nav */

nav {
  position: sticky;
  top: 0;
  overflow: auto;
  flex-shrink: 0;
  height: 100dvh;
  min-width: 360px;
  padding-bottom: 25px;
}

.menu-bar, #menu-toggle  {
  display: none;
}

header {
  padding: var(--header-padding-top) 0 var(--header-padding-bottom);
  display: flex;
  justify-content: center;
}

header a:hover .logo {
  background-position-x: 326px;
}

.logo {
  height: var(--logo-height);
  width: 300px;
  margin: 0;
}

.anniversary {
  padding-left: 1em;
}

.anniversary a:link { color:#c1784a; }
.anniversary a:visited { color: #ac876d; }
.anniversary a:hover { color: #e4d7cc; }
.anniversary a:active { color: #505a53; }

/* Nav Tree View */

.tree {
  margin-left: 1em;
}

.tree,
.tree ul {
  padding: 0;
}

.tree ul {
  margin-left: 0.1em
}

.tree li:before {
  content: "";
  width: 0;
  position: absolute;
  top: 0px;
  height: 100%;
  left: 0;
  border-left: 1px solid;
}

.tree li:first-child:before {
  top: 8px;
  height: calc(100% - 8px);
}

.tree li:last-child:before {
  height: 8px
}

.tree li:only-child:before {
  display: none;
}

.tree li {
  margin: 0;
  padding: 0 1.5em;
  position: relative;
}

.tree li::after {
  content: "";
  width: 7px;
  height: 0;
  border-top: 1px solid;
  margin-top: -4px;
  position: absolute;
  top: 1em;
  left: 0;
}

.tree li:only-child::after {
  display: none;
}

.notree {
  margin-top: 1.5em;
}


/* Footer */

footer {
  margin-top: 5em;
  margin-bottom: 2.5em;
  text-align: center;

  /* Centers such elements as images */
  display: flex;
  flex-direction: column;
  align-items: center;
}

.actualversion {
  color: #c1784a;
}

.download {
  margin: 4em 2em;
}

.download-fieldset {
  padding: 0;
  border-color: #464646;
  width: fit-content;
}

.download-fieldset legend {
  line-height: 1;
  font-size: 11px;
  letter-spacing: 0.2em;
  padding: 0 10px;
  text-align: center;
  color: #baa898;
}

.download-fieldset a {
  display: block;
}

.bang {
  color: #a9655c;
}

.zip {
  text-align: center;
  padding: 1.6em 2.1em;
  margin: 0;
  transition: all 0.3s ease-out;
  font-size: 12px;
}

.zip:hover {
  color: #9c5a4b;
}

.cr {
  font-size: 10px;
}

.donate {
  margin-bottom: 3em;
  font-size: 14px;
  font-weight: 800;
}

.phoenix-tales-logo {
  aspect-ratio: 12/17;
  width: 200px;
  margin-left: -10px;
}


/* Page content */

main {
  overflow: hidden;
}

article {
  max-width: 650px;
  padding: clamp(10px, -20.3704px + 3.7037vw, 30px);  /* Calculated by utopia - https://utopia.fyi/clamp/calculator?a=820,1360,10—30 */
  font-family: Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6; 
  color: #ccb9a5;
}    

article h1, article h2, article h3, article h4 {
  font-family: "Gothic_alpha_font"; 
  font-weight: normal;
  letter-spacing: normal;
  color: rgb(186, 168, 152);	
}

article h2, article h3, article h4 {
  font-size: 16px;
}

article h3, article h4 {
  padding-top: 2em;
}

/* for the first h2 header in the docs, often containing the author etc. */
article h2:not(:first-of-type) {
  padding-top: 2em;
}
	
/*
article h1::before {
  content: "# ";
}

article h2::before {
  content: "## ";
}

article h3::before {
  content: "### ";
}
*/

article img {
  height: 100%;
}

article img + img {
  margin-top: 10px;
}

article ul {
  padding-left: 0;
}

article video {
  max-width: 100%;
  height: auto;
}

article figure {
  margin: 0;
  padding: 0;
}

article figcaption {
  font-size: 13px;
  font-family: monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  border: 1px solid #222222; 
  margin: 0.5em 2em 3em;
  padding: 0.5em;
}

.images-row {
  padding-block: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.images-row img {
  margin: 0;
}

.card-links {
  margin-top: 15px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 10px;
}


/*****************/
/* Mobile Layout */
/*****************/

@media only screen
and (max-width : 820px) {
  body {
    --header-padding-top: 96px;
    --header-padding-bottom: 28px;
    flex-direction: column;
  }

  body:has(#menu-toggle:checked) {
    overflow: hidden;
    /* Give an offset to the top to preserve the size of the page, for the scroll position to be correct once the menu is closed and the header is hidden. */
    padding-top: calc(var(--logo-height) + var(--header-padding-top) + var(--header-padding-bottom));
  }

  nav {
    position: initial;
    min-width: initial;
    height: initial;
    /* Having overflow set to "initial", makes it so the scroll position will be restored when the mobile navigation is opened again, otherwise it is reset each time the .main {
    overflow: hidden;}-nav is closed. (For some reason) */
    overflow: initial;
    width: 100%;
    z-index: 10;
    padding: 0;
  }

  body:has(#menu-toggle:checked) nav {
    top: 0;
    left: 0;
    height: 100dvh;
    overflow: auto;
    position: fixed;
    padding-bottom: 35px;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.9);
  }

  .menu-bar {
    display: flex;
    justify-content: space-between;
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    z-index: 10;
    padding: 10px;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(0, 0, 0, 0.8);
    box-shadow: 0 30px 40px rgba(0,0,0,.1);
  }

  body:has(#menu-toggle:checked) .menu-bar {
    position: sticky;
    background: rgba(0, 0, 0, 0.9);
  }

  
  label[for="menu-toggle"] {
    display: flex;
    align-items: baseline;
    gap: 0.6em;
    padding: 0.3em 1.5em 0.3em 1.2em;
    line-height: 1;
    border: 1px solid #706961;
    width: fit-content;
    user-select: none;
    cursor: pointer;  
    color: #ccb9a5; /* #c1784a; // old orange */
    background: #000000e0;
    font-family: "Gothic_alpha_font";
    font-size: 18px;
    transition: all 0.3s ease-out;
  }

  body:has(#menu-toggle:checked) label[for="menu-toggle"] {
    color: #9c5a4b;
  }

  @media (hover: hover) and (pointer: fine) {
    label[for="menu-toggle"]:hover {
      color: #9c5a4b;
    }
    
    body:has(#menu-toggle:checked) label[for="menu-toggle"]:hover {
      color: #9c5a4b;
    }
  }

  label[for="menu-toggle"]::selection {
    background-color: transparent;
    color: inherit;
    font-weight: 700;  
  }

  label[for="menu-toggle"] .menu-icon {
    font-size: 150%;
    position: relative;
    top: 3px;
  }

  .menu-bar-links {
    display: flex;
    align-items: center;
    gap: 0.5em;
  }

  .menu-bar-links a {
    border: 1px solid #706961;
    padding: 0.4em;
    flex-shrink: 0;
  }

  .menu-bar-links img {
    width: 16px;
    height: 16px;
  }

  body:has(#menu-toggle:checked) header {
    display: none;
  }

  .menu-index {
    display: none;
  }
  
  body:has(#menu-toggle:checked) .menu-index {
    display: block;
  }

  article {
    padding: 0 10px 10px;
    /* Center content, otherwise it will be aligned to left. */
    margin-right: auto;
    margin-left: auto;
  }
}
