* {
  /* font-family: 'Noto Sans JP', sans-serif; */
  font-family: "Noto Serif JP", serif;
  font-size: 1em;
}

:root {
  --primary-color: #F8DCE5;
  --secondary-color: #311d3f;
}

body {
  background: var(--primary-color);
  color: var(--secondary-color);
  margin: 12px;
}

h1,
h2,
h3,
h4,
h5,
h6,
button {
  font-family: "DotGothic16", sans-serif;
}

h1 {
  font-size: 3.25em;
  text-align: center;
}

h2 {
  text-align: center;
  font-size: 1.75em;
}

p {
  font-size: 1.25em;
  text-align: center;
}

main {
  margin-bottom: 50px;
}

button {
  background-color: var(--secondary-color);
  color: var(--primary-color);
  font-size: 1em;
  border-radius: 12px;
  cursor: pointer;
}

/* Nav styles */
nav {
  display: flex;
  justify-content: space-between;
}

.empty {
  display: none;
  flex-grow: 1;
}

.hamburger {
  display: none;
  cursor: pointer;
}

.hamburger div {
  width: 25px;
  height: 3px;
  margin: 5px;
  background-color: var(--secondary-color);
  transition: all 0.3s ease;
}

.mobile-only {
  display: none;
}

.cross {
  display: none;
  cursor: pointer;
  /* padding-right: 10px; */
}

.cross div {
  width: 25px;
  height: 3px;
  margin: 5px;
  background-color: var(--secondary-color);
}

ul {
  list-style-type: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

.nav-div {
  display: flex;
  justify-content: center;
  gap: 20px;
  border-style: dotted;
  border-radius: 45px;
}

.container.no-wrap {
  display: none;
  justify-content: space-between;
  width: 100%;
  align-items: center;
}

.icon {
  width: 40px;
  height: auto;
  background-image: url(images/sakura.png);
  background-repeat: no-repeat;
  background-size: cover;
}

/* Flips an image horizontally */
.flipped {
  transform: scaleX(-1);
}

.banner {
  background-image: url(images/mona-loader.gif);
  background-size: 100%;
  background-repeat: no-repeat;
  width: 70px;
}

/* Used as a test */
/* .banner-text {
    font-family: 'DotGothic16', sans-serif;
    font-size: 12px;
} */

.nav-link-text {
  display: block;
  color: var(--secondary-color);
  text-align: center;
  padding: 8px 16px;
  text-decoration: none;
  font-family: "DotGothic16", sans-serif;
}

/* .nav-link, .nav-link:visited {
    text-decoration: none;
    color: #AC7CB4;
    position: relative;
} */

.nav-link a:hover {
  transform: scale(1.25);
  cursor: pointer;
}

.nav-link a {
  transition: transform 0.2s;
}

/* Header logo styles */
.logo {
  padding: 50px;
  /* Credit: https://life-style-s.blogspot.com/2018/11/pixel-art-background-gif.html */
  background-image: linear-gradient(
      rgba(255, 255, 255, 0.2),
      rgba(255, 255, 255, 0.7)
    ),
    url("/video/mona-banner-day.gif");
  background-repeat: no-repeat;
  background-size: cover;
  border-style: dotted;
  border-radius: 45px;
}

.logo-text {
  font-family: "DotGothic16", sans-serif;
  font-size: 1em;
  font-weight: 100;
}

.container {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}

/* Main div styles */
.article {
  flex-direction: column;
  justify-content: center;
  width: 400px;
}

.article h2 {
  transition: 0.25s ease-in-out;
}

/* Link styles & animations */

.article-link,
.article-link:visited {
  font-family: "DotGothic16", sans-serif;
  text-decoration: none;
  color: #ac7cb4;
  position: relative;
}

.article h2:hover {
  /* transform: scale(1.25); */
  transform: scale(1.15);
  translate: 0px -10px;
  cursor: pointer;
}

/* 'This Week's Trending Chapters!' & 'This Week's Trending Episodes!' sections styles */
.chapter,
.episode {
  position: relative;
  flex-direction: column;
  justify-content: center;
  width: 50px;
  height: 400px;
  /* box-shadow: 10px -10px; */
  border-radius: 10px;
  cursor: pointer;
  transition: all 0.35s ease;
  background-size: cover;
  background-repeat: no-repeat;
  background-position: center;
}

.chapter {
  box-shadow: 10px -10px;
}

.chapter:hover {
  translate: 0px -10px;
  border: solid 5px yellow;
}

.episode {
  width: 375px;
  height: 600px;
}

/* Thinking about doing something different for the animations on this one */
.episode:hover {
  translate: 0px -10px;
  border: solid 5px var(--secondary-color);
}

/* Makes a div a link */
.link-spanner {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  z-index: 1;
}

/* .top1 { */
/* width: 400px;
    height: 600px; */
/* } */

.chapter.jjk {
  background-image: url(images/jjk-vol1.webp);
}

/* Manga cover styles */
.c1 { background-image: url('images/mona-cover/1.png'); }
.c2 { background-image: url('images/mona-cover/2.png'); }
.c3 { background-image: url('images/mona-cover/3.png'); }
.c4 { background-image: url('images/mona-cover/4.png'); }
.c5 { background-image: url('images/mona-cover/5.png'); }
.c6 { background-image: url('images/mona-cover/6.png'); }

/* Duplicates for the second row (or add new images!) */
.c7 { background-image: url('images/mona-cover/7.png'); }
.c8 { background-image: url('images/mona-cover/8.png'); }
.c9 { background-image: url('images/mona-cover/9.png'); }
.c10 { background-image: url('images/mona-cover/10.png'); }

/* --- TV GUIDE CONTAINER --- */
.tv-guide {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 70px; /* Keep your "xtra-gap" spacing */
    max-width: 1200px;
    margin: 0 auto;
}

/* --- EPISODE BASE STYLES --- */
.episode {
    position: relative;
    width: 375px; /* Default width */
    height: 600px; /* Default height */
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.35s ease;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    
    /* Fluid sizing for mobile (From previous step) */
    width: 100%;
    max-width: 375px;
    aspect-ratio: 2 / 3;
    height: auto;
}

/* --- HOVER EFFECT --- */
.episode:hover {
    transform: translateY(-10px);
    border: solid 5px var(--secondary-color);
}

/* --- IMAGE MAPPING (Posters & GIFs) --- */

/* Episode 1: JJK */
.e1 { background-image: url('images/mona-cover/1.png'); }
.e1:hover { background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 1)), url('images/mona-video/1.gif'); }

/* Episode 2: Frieren */
.e2 { background-image: url('images/mona-cover/2.png'); }
.e2:hover { background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 1)), url('images/mona-video/2.gif'); }

/* Episode 3: Oshi no Ko */
.e3 { background-image: url('images/onk-s1.png'); }
.e3:hover { background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 1)), url('images/onk-gif.gif'); }

/* Episode 4: One Piece */
.e4 { background-image: url('images/op-egghead.jpg'); }
.e4:hover { background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 1)), url('images/op-wano-gif.gif'); }

/* Episode 5: Nier */
.e5 { background-image: url('images/nier1.1a-s1.png'); }
.e5:hover { background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 1)), url('images/nier-gif.webp'); }

/* Episode 6: Bleach */
.e6 { background-image: url('images/bleach-tybw.png'); }
.e6:hover { background-image: linear-gradient(rgba(255, 255, 255, 0.2), rgba(0, 0, 0, 1)), url('images/bleach-tybw-gif.gif'); }

/* Prototype version of what I want to happen, not exactly the end product */
/* .chapter:hover {
    width: 400px;
} */
/* Footer styles */
/* Lightswitch styles */

.lightswitch {
  cursor: pointer;
  border-style: dotted;
  border-radius: 45px;
  padding: 10px;
}

.peko {
  width: 250px;
  height: auto;
}

.copyright {
  font-size: 1em;
}

/* Fake ID selectors, just house color palettes */
#colors1 {
  color: #ef7674;
  color: #ec5766;
  color: #da344d;
  color: #d91e36;
  color: #c42348;
}

#colors2 {
  color: #e23e57;
  color: #88304e;
  color: #522546;
  color: #311d3f;
}

/* Palettes from dark mode header image */
#colors3 {
  color: #34779b;
  color: #f1ece1;
  color: #dfacc4;
  color: #aecded;
  color: #ac7cb4;
}

#darkColors {
  color: #00506f;
  color: #ff6666;
  color: #17a7c6;
  color: #002233;
  color: #ded687;
}

hr {
  border-top: 2px dotted;
  border-bottom: none;
}

/* Media styles (different viewport sizes styles) */
@media (max-width: 1024px) {
  .hamburger {
    display: block;
  }

  .mobile-only {
    display: block;
  }

  .container.no-wrap {
    display: flex;
  }

  .cross {
    display: block;
  }

  .empty {
    display: block;
  }

  .nav-div {
    padding: 10px;
    position: absolute;
    left: -1px;
    height: 100vh;
    background-color: var(--primary-color);
    display: flex;
    flex-direction: column;
    justify-content: start;
    align-items: center;
    width: 35%;
    transition: transform 0.5s ease-in;
    /* Moves the links to the desired position (positive values = moves right, negative values = moves left) */
    transform: translateX(-100%);
    /* border-style: none; */
    border-radius: 0;
    z-index: 999;
  }

  .menu-title {
    display: block;
    font-family: inherit;
  }

  .nav-link {
    opacity: 0;
  }

  .banner {
    display: none;
  }
}

@media (max-width: 768px) {
  .episode.jjk {
    background-image: url(images/jjk-s2-gif.webp);
  }
  .episode.frieren {
    background-image: url(images/frieren-gif.gif);
  }
  .episode.onk {
    background-image: url(images/onk-gif.gif);
  }
  .episode.op-wano {
    background-image: url(images/op-wano-gif.gif);
  }
  .episode.nier {
    background-image: url(images/nier-gif.webp);
  }
  .episode.bleach {
    background-image: url(images/bleach-tybw-gif.gif);
  }
}

@media (max-width: 485px) {
  .logo-text {
    font-size: 40px;
  }
}

@media (max-width: 430px) {
  .episode {
    width: 200px;
    height: 400px;
  }

  .nav-div {
    width: 94%;
  }
}

@media (max-width: 400px) {
  .logo-text {
    font-size: 30px;
  }
}

@media (max-width: 320px) {
  .logo-text {
    font-size: 0.5em;
  }
  .nav-div {
    width: 92%;
  }
}

/* For even smaller screens (ex. Galaxy Fold) */
@media (max-width: 280px) {
  .logo-text {
    font-size: 20px;
  }
}

/* Hamburger animation (toggled using JS) */
.toggle .line1 {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.toggle .line2 {
  opacity: 0;
}

.toggle .line3 {
  transform: rotate(45deg) translate(-5px, -6px);
}

.cross .line1 {
  transform: rotate(-45deg) translate(-5px, 6px);
}

.cross .line2 {
  opacity: 0;
}

.cross .line3 {
  transform: rotate(45deg) translate(-5px, -6px);
}

.nav-active {
  transform: translateX(0%);
  overflow-y: hidden;
}

/* .nav-darken {
    box-shadow:0 0 0 2000px rgba(0,0,0,0.65);
} */

/* Link animation */
@keyframes navLinkFade {
  from {
    opacity: 0;
    transform: translateX(-50px);
  }

  to {
    opacity: 1;
    transform: translateX(0px);
  }
}

/* Specific styles, if needed */
.xtra-padding {
  padding: 20px;
}

.xtra-gap {
  gap: 70px;
}

.no-wrap {
  flex-wrap: nowrap;
}

.flexible {
  width: 100%;
  height: auto;
}

.column {
  flex-direction: column;
}

/* Animations that play when an element is in the viewport */
/* [data-inviewport] {
    width:100px; height:600px;
} */
[data-inviewport="scale-in"] {
  transform: scale(1);
}

[data-inviewport="scale-in"].is-inViewport {
  transform: scale(1);
}

/* --- LOADER STYLES --- */
#loader-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh; /* Covers full viewport height */
    background-color: var(--primary-color); /* Matches your body background */
    z-index: 10000; /* Ensures it sits on top of everything */
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease-out, visibility 0.5s;
    cursor: pointer;
}

.loader-content {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.loader-gif {
    max-width: 350px; /* Prevents it from being too huge on mobile */
    height: auto;
    image-rendering: pixelated; /* Keeps pixel art crisp */
}

.loader-text {
    font-family: "DotGothic16", sans-serif;
    font-size: 1.5em;
    color: var(--secondary-color);
    margin: 0;
    letter-spacing: 2px;
    animation: blink 1.5s infinite; /* Retro blinking effect */
}

/* Blinking Animation */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Helper class to stop scrolling while loading */
body.loading {
    overflow: hidden; 
}

.music-switch {
  cursor: pointer;
  border-style: dotted;
  border-radius: 45px;
  padding: 10px;
  transition: all 0.3s ease;
}

.music-switch:hover {
    transform: scale(1.1);
}

/* --- JAPANESE HOVER FIX --- */

/* 1. Target the link explicitly */
a.hover-jp {
    position: relative !important;
    display: inline-block;
    transition: all 0.2s ease;
}

/* 2. When hovering, force English text to be invisible */
a.hover-jp:hover {
    color: transparent !important;
    text-shadow: none !important;
}

/* 3. The Japanese Text Overlay */
a.hover-jp:hover::after {
    content: attr(data-jp); /* This grabs the text from the HTML */
    
    /* Position exactly over the original text */
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%); /* Centers it perfectly */
    
    /* Styling */
    color: #ac7cb4; /* Make sure this matches your link color */
    font-family: 'Noto Sans JP', sans-serif; /* Force Japanese Font */
    font-weight: bold;
    white-space: nowrap; /* Prevents text from breaking lines */
    pointer-events: none; /* Allows you to click "through" the text */
    
    /* Ensure it sits on top */
    z-index: 999; 
    opacity: 1;
}

/* --- CHAPTER HOVER EXPANSION --- */

.chapter:hover {
    /* Existing styles you already have */
    translate: 0px -10px;
    border: solid 5px yellow;
    
    /* NEW: Expands the width to show the full image */
    width: 280px; 
    
    /* Optional: Ensures the expanded image sits on top of neighbors */
    z-index: 10; 
}

/* --- INFINITE MARQUEE STYLES --- */
.marquee-container {
    width: 100vw;  /* Forces width to be 100% of the VIEWPORT (screen), not the parent */
    position: relative;
    left: 50%;     /* Move to the middle of the parent */
    right: 50%;
    margin-left: -50vw; /* Pull it back to the left edge of the screen */
    margin-right: -50vw; /* Pull it back to the right edge of the screen */
    overflow: hidden; 
    background-color: var(--secondary-color);
    color: var(--primary-color);
    border-top: 4px dotted var(--primary-color);
    border-bottom: 4px dotted var(--primary-color);
    padding: 10px 0;
    margin-top: 30px;
    margin-bottom: 30px; 
    white-space: nowrap;
    box-sizing: border-box;
}    

.marquee-track {
    display: flex;
    width: fit-content; /* Adjusts width to content size */
    animation: scroll-left 15s linear infinite; /* The infinite movement */
}

.marquee-content {
    font-family: "DotGothic16", sans-serif;
    font-size: 1.5em;
    padding-right: 50px; /* Space between the two sentences */
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* The Animation Keyframes */
@keyframes scroll-left {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%); /* Moves exactly half way (one full set of text) */
    }
}

/* Optional: Pause on hover so people can read it */
.marquee-container:hover .marquee-track {
    animation-play-state: paused;
}

/* --- LORE SLIDESHOW --- */
.lore-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px 0;
}

.lore-track {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px;
    scroll-snap-type: x mandatory; /* Makes it snap like a slideshow */
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    scrollbar-width: thin; /* Firefox thin scrollbar */
    align-items: center; 
    height: 350px;
}

/* Hide scrollbar for Chrome/Safari/Opera */
.lore-track::-webkit-scrollbar {
    height: 8px;
}
.lore-track::-webkit-scrollbar-thumb {
    background: var(--secondary-color);
    border-radius: 4px;
}

.lore-slide {
    flex: 0 0 auto; /* Don't squash images */
    width: 80%;     /* Mobile: Show 80% of image so they know to scroll */
    max-width: 300px; /* Desktop: Cap size */
    scroll-snap-align: center;
}

.lore-img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    border: 2px solid var(--secondary-color);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.lore-img:hover {
    transform: scale(1.05);
}

/* --- LIGHTBOX (POPUP) STYLES --- */
.lightbox {
    display: none; /* Hidden by default */
    position: fixed;
    z-index: 99999; /* Top of everything */
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.25); /* Dark background */
    backdrop-filter: blur(5px);
}

.lightbox-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh; /* Keeps it within screen height */
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border: 2px solid #fff;
    box-shadow: 0 0 20px #fff;
}

/* --- LIGHTBOX NAVIGATION --- */
.lb-prev, .lb-next {
    cursor: pointer;
    position: absolute;
    top: 50%;
    width: auto;
    padding: 16px;
    margin-top: -50px; /* Centers vertically */
    color: white;
    font-weight: bold;
    font-size: 30px;
    transition: 0.3s ease;
    border-radius: 0 3px 3px 0;
    user-select: none;
    background-color: rgba(0,0,0,0.3); /* Slight background for visibility */
    z-index: 100000;
}

.lb-next {
    right: 0;
    border-radius: 3px 0 0 3px;
}

.lb-prev {
    left: 0;
    border-radius: 3px 0 0 3px;
}

.lb-prev:hover, .lb-next:hover {
    background-color: var(--secondary-color);
}

/* Close Button (X) */
.close-lightbox {
    position: absolute;
    top: 20px;
    right: 35px;
    color: #f1f1f1;
    font-size: 50px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-family: sans-serif; /* Cleaner X */
    z-index: 100000;
}

.close-lightbox:hover {
    color: var(--primary-color);
    text-shadow: 0 0 10px #fff;
}