/* ============================== */
/*        RESET + BASICS         */
/* ============================== */

* {
  margin: 0;
  padding: 0;

}

html, body {
  min-height: 100%;
  height: auto;
  font-family: Georgia, serif;
  color: #333;
  background: #f4f4f4;
}

/* ============================== */
/*          BACKGROUND           */
/* ============================== */

#background {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: url('images/BG.webp') center center no-repeat;
  background-size: cover;
  z-index: -2;
}

#background-wrapper {
  width: 100vw;
  height: 100vh;
  position: fixed;
  z-index: -3;
  left: 0;
  top: 0;
}

/* ============================== */
/*        FOREGROUND (Main)      */
/* ============================== */

#foreground-container {
  min-height: 100vh;
  width: 100vw;
  background: url('images/article/Article_FG.webp') center top no-repeat;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 1;
  padding-top: 0;
}

/* Banner */
#banner {
  display: block;
  margin: 10px auto 0 auto;
  width: auto;
  max-width: 100%;
  height: auto;
  transform: scale(0.90);
  transform-origin: center;
}

/* ============================== */
/*          LAYOUT               */
/* ============================== */

#main-layout {
  display: flex;
  flex-direction: row;
  width: 100%;
  max-width: 1455px;
  margin: 0 auto;
  gap: 45px;
  align-items: flex-start;
  padding-top: 12px;
  box-sizing: border-box;
  flex: 1 0 auto;
}

/* ============================== */
/*         TopBar LINKS         */
/* ============================== */


#nav-links-bar {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
  margin-left: 10px;
  gap: 25px;
  background-color: rgba(255, 238, 200, 0.6);
  border-top: 2px solid #a67630;
  border-bottom: 2px solid #a67630;
  padding: 12px 20px;
  font-family: Georgia, serif;
  font-size: 1.05rem;
  z-index: 2;
 position: static !important;
  max-width: 1518px;
  width: 100%;
  box-sizing: border-box;
}

#nav-links-bar a {
  color: #5b320f;
  text-decoration: none;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  transition: background 0.2s, color 0.2s;
}

#nav-links-bar a:hover {
  background-color: rgba(255, 240, 200, 0.9);
  color: #8b5a20;
  text-decoration: underline;
}



/* ============================== */
/*         SIDEBAR LINKS         */
/* ============================== */

#sidebar-wrapper {
  flex: 12 0 220px;
  min-width: 220px;
  max-width: 230px;
  border-radius: 12px;

  margin-top: 10px;
  margin-bottom: 10px;
  padding-top: 30px;
  position: relative;
}

#sidebar-links {
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: Georgia, serif;
  font-size: 16px;
  width: 100%;
}

#sidebar-links a {
  color: #4a2a10;
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background 0.18s, color 0.18s;
  font-weight: bold;
  display: flex;
  align-items: center;
}

#sidebar-links a:hover {
  background: rgba(255, 255, 200, 0.4);
  color: #a06c24;
  text-decoration: underline;
}

/* ============================== */
/*         ARTICLE SECTION       */
/* ============================== */

#article-container {
  flex: 1 1 0;
  max-width: 1400px;
  min-width: 0;
  height: 130vh;
  background: rgba(252, 236, 211, 0.568);
  border: 4px solid #ca8d1c;
  border-radius: 14px;
  box-shadow: 0 2px 20px 0 rgba(80, 40, 10, 0.07);
  padding: 32px 36px 40px 36px;
  margin: 10px 0 30px 0;
  overflow-x: hidden;
  overflow-y: auto;
}

#content > *:first-child {
  margin-top: 0;
}

/* Article text styling */
#article-container h1,
#article-container h2,
#article-container h3 {
  color: #2e1703;
  margin-bottom: 12px;
  margin-top: 1px;
  font-family: Georgia, serif;
}

#article-container h1 { font-size: 2.1rem; }
#article-container h2 { font-size: 1.4rem; }
#article-container h3 { font-size: 1.15rem; }

#article-container p,
#article-container ul,
#article-container li {
  color: #4a2a10;
  font-size: 1.07rem;
  line-height: 1.7;
  text-align: justify;
}

#article-container ul, #article-container ol {
  margin-left: 1.6em;
  margin-bottom: 1em;
}

#article-container img {
  display: block;
  margin: 24px auto;
  max-width: 95%;
  height: auto;
  border-radius: 10px;
  box-shadow: 0 2px 12px 0 rgba(60,30,7,0.07);
}

/* ============================== */
/*    ARTICLE FORMATTING (Boxes) */
/* ============================== */

/* This class should wrap your text blocks for yellow boxes */
.Article-Text {
  background: rgba(255, 226, 102, 0.18);
  border: 2px solid #ca8d1c;
  border-radius: 8px;
  padding: 24px 24px 20px 24px;
  margin-bottom: 28px;
}


.Article-Text-left {
  background: rgba(255, 226, 102, 0.18);
  border: 2px solid #ca8d1c;
  border-radius: 8px;
  padding: 24px 24px 20px 24px;
  margin-bottom: 28px;
  max-width: 70%; 
  flex-grow: 1;
}

.Article-Image-right {
  display: flex;
  justify-content: flex-end;
  align-items: flex-start;
  margin: 12px 0 24px 0;
}

.Article-Image-right img {
  max-width: 260px;
  min-width: 120px;
  border: 2px solid #ca8d1c;
  border-radius: 8px;
  box-shadow: 0 1px 7px 0 rgba(70, 80, 8, 0.13);
}

/* Optionally, add more layout utilities if you want text and image side by side */
.{
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  gap: 15px;
  margin: 0 auto 24px auto;
  width: 100%;
  flex-wrap: wrap;
}

/* For small image+text blocks */
.Article-Image-Small {
  display: block;
  margin: 0 18px 8px 0;
  float: left;
  max-width: 150px;
  border: 2px solid #b2cc42;
  border-radius: 8px;
}

.clearfix::after {
  content: "";
  display: table;
  clear: both;
}



.Article-container-Left {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 15px;
  margin: 0 auto 24px auto;
  width: 100%;
  flex-wrap: wrap;
  flex-direction: row-reverse;
}

.Article-Image-left {
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
}

.Article-Image-left img {
  max-width: 260px;
  min-width: 120px;
  border: 2px solid #ca8d1c;
  border-radius: 8px;
  margin-right: 24px;
  margin-top: 0;
  box-shadow: 0 1px 7px 0 rgba(70, 80, 8, 0.13);
}

.Article-Text-right {
  background: rgba(255, 226, 102, 0.18);
  border: 2px solid #ca8d1c;
  border-radius: 8px;
  padding: 24px 24px 20px 24px;
  margin-bottom: 28px;
  max-width: 70%; 
}



/* ============================== */
/*           Image ZOOM           */
/* ============================== */

#image-zoom-overlay {
  display: none;
  position: fixed;
  z-index: 9999;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.8);
  justify-content: center;
  align-items: center;
}

#image-zoom-overlay.active {
  display: flex;
}

#zoom-image-wrapper {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.9);
  opacity: 0;
  transition: transform 0.3s ease-out, opacity 0.3s ease-out;
}

#image-zoom-overlay.active #zoom-image-wrapper {
  transform: scale(1);
  opacity: 1;
}

#zoomed-img {
  max-width: 80vw;
  max-height: 80vh;
  border-radius: 8px;
  box-shadow: 0 0 20px black;
}

#zoom-close-button {
  position: absolute;
  top: -30px;
  right: -30px;
  background-color: #fff1cc;
  border: 2px solid #ca8d1c;
  color: #4a2a10;
  font-size: 28px;
  font-weight: bold;
  border-radius: 8px;
  cursor: pointer;
  padding: 5px 12px;
}
/* ============================== */
/*     Website Popout UI          */
/* ============================== */

  .iframe-overlay {
      display: none;
      position: fixed;
      top: 7.5%;
      left: 7.5%;
      width: 85%;
      height: 85%;
      background: white;
      border: 3px solid black;
      z-index: 9999;
      box-shadow: 0 0 20px rgba(0,0,0,0.6);
    }

    .iframe-overlay iframe {
      width: 100%;
      height: 100%;
      border: none;
    }

    /* Background dim */
    .overlay-bg {
      display: none;
      position: fixed;
      top: 0;
      left: 0;
      width: 100vw;
      height: 100vh;
      background: rgba(0,0,0,0.7);
      z-index: 9999;
    }

    /* Close button */
    .close-btn {
      position: absolute;
      top: 5px;
      right: 10px;
      font-size: 20px;
      background: red;
      color: white;
      border: none;
      padding: 5px 10px;
      cursor: pointer;
      z-index: 1001;
    }

/* ============================== */
/*           TABS UI             */
/* ============================== */

#glossary-tabs {
  margin: 18px 0 20px 0;
  text-align: center;
}

#glossary-tabs button {
  margin-right: 5px;
  padding: 8px 14px;
  background-color: #f0e6d2;
  border: 1px solid #b09361;
  border-radius: 6px;
  cursor: pointer;
  font-family: Georgia, serif;
  font-weight: bold;
  transition: background 0.18s, border 0.18s;
  font-size: 1rem;
}

#glossary-tabs button:hover {
  background-color: #e2d2b2;
  border-color: #a68648;
}

/* ============================== */
/*        TABLES                 */
/* ============================== */

#article-container table {
  width: 100%;
  border-collapse: collapse;
  margin: 22px 0;
  background-color: #fff;
  color: #333;
  border-radius: 10px;
  overflow: hidden;
  font-size: 1.03em;
}

#article-container th {
  background-color: #eaeaea;
  font-weight: bold;
}

#article-container th,
#article-container td {
  border: 1px solid #c9a871;
  padding: 11px 13px;
  text-align: left;
}

#article-container tr:nth-child(even) {
  background-color: #f8f3e8;
}

/* ============================== */
/*        FADE IN                */
/* ============================== */

.fade-in {
  opacity: 0;
  animation: fadeIn 0.5s ease forwards;
}

.fade-in * {
  animation: fadeIn 0.5s ease forwards;
  animation-delay: 0.2s;
}

@keyframes fadeIn {
  to { opacity: 1; }
}


/* ============================== */
/*        Jinx Testing            */
/* ============================== */



.Article-Image-Text-section {
  display: flex;
  align-items: center;
  gap: 10px;
}

.Article-image-Left-container {
  flex-shrink: 0;
}

.Article-image-Left-container img {
  height: 200px;
  object-fit: contain;
  display: block;
}

.Article-text-right-container {
  flex-grow: 1;
  background: rgba(255, 226, 102, 0.18);
  border: 2px solid #ca8d1c;
  border-radius: 8px;
  padding: 24px 24px 20px 24px;

}


/* ============================== */
/*        MOBILE RESPONSIVE      */
/* ============================== */

#mobile-toggle-btn {
  display: none;
  margin: 12px auto 0 auto;
  padding: 8px 20px;
  font-size: 22px;
  background-color: #f0e6d2;
  border: 2px solid #4a2a10;
  color: #4a2a10;
  font-family: Georgia, serif;
  border-radius: 10px;
  cursor: pointer;
}

#mobile-sidebar-links {
  display: none;
  flex-direction: column;
  gap: 13px;
  padding: 16px 20px;
  background-color: rgba(90, 70, 24, 0.85);
  border-radius: 10px;
  width: 95vw;
  max-width: 380px;
  position: absolute;
  top: 72px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 99;
}

#mobile-sidebar-links.show {
  display: flex;
}

#mobile-sidebar-links a {
  color: #fff6e0;
  text-decoration: none;
  font-size: 1.1em;
  padding: 7px 0;
  border-bottom: 1px solid #e2d2b2;
}

#mobile-sidebar-links a:last-child {
  border-bottom: none;
}

#mobile-sidebar-links a:hover {
  text-decoration: underline;
  color: #ffe28b;
}


/* Hide desktop sidebar and show mobile menu on small screens */
@media (max-width: 1024px) {
  #background { display: none; }
  #foreground-container {
    background-image: url('images/FP_FG_Mobile.webp');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover;
    min-height: 150vh;
    overflow: visible;  
  }
  #main-layout {
    flex-direction: column;
    gap: 0;
    max-width: 100vw;
    padding: 0 0 0 0;
  }
  #sidebar-wrapper { display: none; }
  #article-container {
    max-width: 100vw;
    padding: 12px 8vw 24px 8vw;
    margin: 0;
    min-width: 0;
  }
  #banner {
    transform: scale(0.40);
    margin-top: 4px;
  }
  #mobile-toggle-btn {
    display: block;
  }
}

@media (max-width: 600px) {
  #article-container {
    padding: 10px 1vw 22px 1vw;
  }
  #mobile-sidebar-links {
    max-width: 99vw;
    font-size: 1em;
  }
}
