/* FONT DEFINITIONS */
@font-face {
  font-family: 'Equateur';
  src: url('../fonts/Equateur-Regular.woff2');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'OrticaB';
  src: url('../fonts/OrticaLinear-Bold.woff2');
  font-weight: bold;
  font-style: bold;
  font-display: block;
}

@font-face {
  font-family: 'OrticaR';
  src: url('../fonts/OrticaLinear-Regular.woff2');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

@font-face {
  font-family: 'OrticaL';
  src: url('../fonts/OrticaLinear-Light.woff2');
  font-weight: normal;
  font-style: normal;
  font-display: block;
}

/* VARIABLES */
:root {
  --color-background: #333333;
  --color-text: #f8f8f8;
  --color-text-link: rgba(170, 255, 0, 0.8);
  --color-text-link-hover: rgba(170, 255, 0, 0.5);
  --neon-green: rgb(170, 255, 0);
  --blue: rgb(44, 47, 210);
  --grey: rgba(60, 60, 60, 0.8);
  --light-grey: rgba(190, 190, 189, 0.8);
  /* --neon-box-shadow: 0 0 10px rgba(170, 255, 0, 0.5); */
  --neon-box-shadow: 1rem 1rem 2rem rgba(170, 255, 0);

  --font-text: 'OrticaR', 'Georgia', serif;
  --font-heading: 'Equateur', serif;
  --font-size: 18px;
  
  --content-width: 50%;
  --content-padding: 2rem;
  --image-zone-width: 45%;
}

/* BASE STYLES */
html {
  font: var(--font-size) var(--font-text);
  color: var(--color-text);
  background-color: var(--color-background);
  overflow-x: hidden;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-behavior: smooth;
}

html::-webkit-scrollbar {
  display: none;
}

body {
  position: relative;
  margin: 0;
  padding: 0;
  background-color: var(--color-background);
  color: var(--color-text);
  font-family: var(--font-text);
  line-height: 1.6;
  width: 100%;
  min-height: 100vh;
  hyphens: auto;
}

/* LAYOUT STRUCTURE */
.page-wrapper {
  display: grid;
  grid-template-columns: var(--content-width) 1fr;
  grid-template-areas: 
    "header header"
    "main image-zone"
    "footer footer";
  min-height: 100vh;
  padding-top: 60px; /* Space for fixed nav */
  box-sizing: border-box;
}

/* HEADER STYLES */
header.block-title {
  grid-area: header;
  width: 100%;
  /* background-color: var(--blue); */
  padding: 2rem 0;
  text-align: center;
}

header h1 {
  margin: 0;
  padding: 2rem;
  font-size: 3.5rem;
  color: var(--neon-green);
  font-family: var(--font-heading);
  line-height: 1.2;
}

header h1 span {
  white-space: nowrap;
  display: inline-block;
}

header * img {
  width: 3.5rem;
  height: 3.5rem;
  vertical-align: middle;
  margin-right: 0.5rem;
}

/* NAVIGATION */
header nav {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background-color: var(--grey);
  z-index: 100;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

header nav ul {
  display: flex;
  justify-content: space-around;
  margin: 0;
  padding: 0;
  list-style: none;
}

header nav ul li {
  padding: 1rem 0;
}

header nav ul li a {
  color: var(--neon-green);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.3s, text-shadow 0.3s;
  padding: 0.5rem;
}

header nav ul li a:hover {
  color: white;
  text-shadow: 0 0 5px var(--neon-green);
}

/* MAIN CONTENT */
main {
  grid-area: main;
  padding: var(--content-padding);
  max-width: 100%;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

/* IMAGE ZONE - For displaying hover/click images */
.image-zone {
  grid-area: image-zone;
  position: sticky;
  top: 60px; /* Match navbar height */
  height: calc(100vh - 60px);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 2rem;
  box-sizing: border-box;
}

.image-container {
  width: 100%;
  height: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  transition: opacity 0.5s ease;
}

.image-container.active {
  opacity: 1;
}

.image-container img {
  max-width: 100%;
  max-height: 90%;
  object-fit: contain;
  border: 2px solid var(--neon-green);
  box-shadow: var(--neon-box-shadow);
}

.image-caption {
  position: absolute;
  bottom: 2rem;
  background-color: rgba(0, 0, 0, 0.7);
  color: var(--neon-green);
  padding: 0.5rem 1rem;
  border-radius: 4px;
  text-align: center;
  max-width: 90%;
}

/* TYPOGRAPHY */
h2 {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  color: var(--neon-green);
  margin-top: 4rem;
  margin-bottom: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

h3 {
  font-size: 1.8rem;
  color: var(--blue);
  margin-top: 2rem;
}

h4 {
  font-size: 1.4rem;
  color: var(--blue);
}

p {
  /* box-shadow: 1rem 1rem 2rem rgba(170, 255, 0); */
  margin-bottom: 1.4rem;
  text-align: justify;
  text-indent: 1.5rem;
}

/* CHAPTERS */
.title-and-first-paragraph {
  margin-top: 25vh;
  /* background-color: red; */
}

.title-and-first-paragraph h2 {
  text-align: center;
  text-shadow: 0 0 5px var(--neon-green);
}

.chapter-ornament-top{
  width: 25%;
  display: block;
  margin: 0 auto;
  text-align: center;
}

.chapter-ornament-bot{

}

/* FIGURE REFERENCES */
.marker {
  display: inline-block;
  background-color: var(--neon-green);
  color: var(--color-background);
  padding: 0.1rem 0.4rem;
  margin: 0 0.3rem;
  border-radius: 3px;
  cursor: pointer;
  font-weight: bold;
  transition: background-color 0.3s, transform 0.2s;
}

.marker:hover, .marker.active {
  background-color: var(--blue);
  transform: scale(1.1);
}

/* Media figure display system */
input[type=checkbox]{
  /* hide checkbox itself */
  display: none;
}

.media-figure {
  display: inline;
}

.media-figure .image {
  overflow: hidden;
  transition: max-height 0.5s ease-in-out;
  max-height: 0;
  background-color: var(--neon-green);
  color: var(--color-background);
  font-size: 0.9rem;
  border-radius: 1rem;
}

.media-figure .image:not(.hidden) {
  max-height: 1000px;
}

.media-figure .image img {
  max-width: 100%;
  width: 100%;
  height: auto;
  display: block;
}

.media-figure .image span {
  padding: 0.5rem;
  display: block;
}

/* Desktop view for images */
@media (min-width: 961px) {
  .media-figure .image {
    position: absolute;
    right: 2rem;
    translate: 0 -50%;
    width: max(50% - 16rem, 50% - 16vw);
    display: none;
  }

  .media-figure:has(.marker:hover) .image,
  .media-figure:has(.marker:active) .image {
    display: block;
  }

  .hidden {
    display: block !important;
    width: 0;
    height: 0;
  }
}

/* Mobile view for images */
@media (max-width: 960px) {
  .media-figure .image {
    display: block;
    position: static;
    width: 100%;
    margin-block: 0.5rem;
    translate: none;
  }
  .hidden {
    display: none !important;
    width: 0;
    height: 0;
  }

  /* Hide image when marker is clicked */
  .media-figure:has(.marker:active) .image {
    display: none;
  }

  /* Show image when marker is clicked again */
  .media-figure:has(.marker:active) .marker:active~.image {
    display: block;
  }
}



/* TEXT BLOCKS */
[class^="block-"] {
  margin-bottom: 3rem;
}

[class^="block-"] p {
  background-color: var(--grey);
  padding: 1.5rem;
  border-radius: 0.5rem;
  box-shadow: var(--neon-box-shadow);
  transition: background-color 0.3s;
}

[class^="block-"] p:hover {
  background-color: rgba(70, 70, 70, 0.8);
}

/* FOOTNOTES */
.footnote-wrapper {
  position: relative;
  display: inline;
}

.footnote-ref {
  color: var(--neon-green);
  background-color: var(--blue);
  text-decoration: none;
  padding: 0.1rem 0.3rem;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.85em;
  vertical-align: super;
}

.footnote-content {
  position: static;
  left: 0;
  /* transform: translateY(-100%); */
  background-color: var(--grey);
  color: var(--color-text);
  border: 1px solid var(--neon-green);
  padding: 1rem;
  box-shadow: var(--neon-box-shadow);
  width: auto;
  max-width: calc(100vw - 4rem);
  z-index: 10;
  display: none;
  font-size: 0.9rem;
  backdrop-filter: blur(4rem);
  -webkit-backdrop-filter: blur(4px);
  border-radius: 0.5rem;
  margin-block: 0;
}

.footnote-wrapper:hover .footnote-content {
  display: block;
  margin-block: 0.5rem;
}

/* FOOTER */
footer {
  grid-area: footer;
  width: 100%;
  background-color: var(--grey);
  padding: 1rem 0;
  margin-top: 3rem;
}

footer ul {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  margin: 0;
  padding: 0;
  list-style: none;
}

footer ul li {
  padding: 0.5rem 1rem;
  color: var(--color-text);
}

/* UTILITY CLASSES */
.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}



/* LINKS */
a {
  color: var(--color-text-link);
  text-decoration: none;
  transition: color 0.3s;
}

a:hover {
  color: var(--color-text-link-hover);
}

a:visited {
  color: var(--color-text-link);
}

.bibliolioliography{
  border-radius: 1rem;
  box-shadow:  1rem 1rem 2rem rgba(170, 255, 0);
}

.bibliolioliography p{
  margin: 0;
  box-shadow: none;
}

.bibliography-link {
  font-family: "scotch-display-dingbats", sans-serif;      
  color: var(--neon-green);
  font-weight: bold;
}

/* MOBILE MENU */
.mobile-menu-btn {
  display: none;
  background: transparent;
  border: none;
  position: fixed !important;
  top: 1rem;
  right: 1rem;
  z-index: 110;
  cursor: pointer;
  z-index: 1000;
}

.mobile-menu-btn img {
  width: 32px;
  height: 32px;
  
}

/* RESPONSIVE STYLES */
@media (max-width: 1024px) {
  :root {
    --content-width: 60%;
    --image-zone-width: 35%;
    --content-padding: 1.5rem;
  }
}

@media (max-width: 900px) {
  .page-wrapper {
    grid-template-columns: 100%;
    grid-template-areas: 
      "header"
      "main"
      "footer";
  }
  
  :root {
    --content-width: 100%;
    --content-padding: 1rem;
  }
  
  .image-zone {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    z-index: 200;
    display: none;
  }
  
  .image-zone.active {
    display: flex;
  }
  
  .close-image-btn {
    /* is it non existent? */
    /* position: absolute;
    top: 1rem;
    right: 1rem;
    background: transparent;
    border: none;
    color: white;
    font-size: 2rem; */
    cursor: pointer;
    z-index: 1000;
    display: block;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 110;
  }
  
  header nav {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }
  
  header nav.active {
    max-height: 300px;
  }
  
  header nav ul {
    flex-direction: column;
  }
  
  .mobile-menu-btn {
    display: block;
    
  }
  
  .desktop-only {
    display: none;
  }
  
  .mobile-only {
    display: block;
  }
  
  header h1 {
    font-size: 2.5rem;
    padding: 1rem;
  }
  
  header * img {
    width: 2.5rem;
    height: 2.5rem;
  }
  
  h2 {
    text-align: center;
    font-size: 2rem;
  }
}

/* Additional media queries for font sizes */
@media (max-width: 480px) {
  :root {
    --font-size: 16px;
  }
  
  h2 {
    font-size: 2.5rem;
  }
  
  header h1 {
    font-size: 2rem;
  }
}

/* Print styles */
@media print {
  .page-wrapper {
    display: block;
  }
  
  header nav, .mobile-menu-btn, .image-zone {
    display: none;
  }
  
  body {
    color: black;
    background-color: white;
  }
  
  [class^="block-"] p {
    background-color: white;
    color: black;
    box-shadow: none;
  }
}
