/* this is to get the underwood1913 font to work!! */
@font-face {
  font-family: 'Underwood1913';
  src: 
       url('https://harrowick.neocities.org/Lore/Candles/Underwood1913.TTF') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}
/* background imageeee */
body {
  margin: 0;
  padding: 0;
  height: 100vh;
  width: 100vw;
  background: url("https://harrowick.neocities.org/Lore/Candles/candlelorebackground.png") no-repeat center center fixed;
  background-size: cover;
  overflow: hidden;
}

/* back button (todo: make a variant that doesn't say "return home" */
.home-btn {
  position: fixed;
  cursor: pointer;
  z-index: 5;
  filter: brightness(0.8) contrast(0.9);
  transition: filter 0.3s ease;
}

.home-btn:hover {
  filter: brightness(1) contrast(1);
}

/* the entire placement of the image. (this was the character section from the candle lore pages)  */
.polaroid-placement {
  position: absolute;
  left: -5%;
  top: 54%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 2;
}

/* location image!! */
.location-image {
  height: auto;
  filter: drop-shadow(0 0 15px rgba(255, 255, 255, 0.2));
  position: relative;
  z-index: 1; 
  margin-bottom: 20px; 
  left: 8%;
}

/* container */
.content-container {
  position: absolute;
  right: 12%;
  top: 52%;
  transform: translateY(-50%);
  width: 50%;
  max-width: 975px;
  height: auto;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* container placement*/
.content-box {
  position: relative;
  width: 100%;
  max-width: 975px;
  height: 836px;
  background-image: url('https://harrowick.neocities.org/Lore/Candles/LoreContainerAnim.png'); 
  background-size: 100% 100%;
  background-repeat: no-repeat;
  background-position: center;
  padding: 70px;
  box-sizing: border-box;
}

/* candle's story header/title*/
.content-header {
  text-align: center;
  font-family: 'Underwood1913', 'Underwood1913', monospace;
  font-size: 25px;
  font-weight: normal;
  color: rgb(221, 206, 191);
  text-decoration: underline 0.02em;
  margin-bottom: 20px;
  letter-spacing: 2px;
  padding-top: 10px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
}

/* lore text/scroll text */
.scroll-gradient {
  height: 600px;
  overflow-y: scroll;
  padding-right: 40px;
  padding-left: 40px;
  padding-top: 10px;
  font-family: 'Underwood1913', 'Underwood1913', monospace;
  font-size: 20px;
  line-height: 1.5;
  color: rgb(221, 206, 191);
  position: relative;
  text-shadow: 1px 1px 2px rgba(0,0,0,5);
}

.scroll-gradient::after {
  content: '';
  display: block;
  height: 700px; /* this makes room for extra scrollbar space*/
}

/* scrollbar */
.scroll-gradient::-webkit-scrollbar {
  width: 15px;
}

.scroll-gradient::-webkit-scrollbar-track {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbartrack.png');
  background-size: contain;
  background-repeat: repeat-y;
  background-position: center;
}

.scroll-gradient::-webkit-scrollbar-thumb {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbarthumb.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
}

/* webkit masks for the gradient */
.scroll-gradient.scrolled-top {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}

.scroll-gradient.scrolled-middle {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%, rgba(0,0,0,1) 80%, rgba(0,0,0,0) 100%);
}

.scroll-gradient.scrolled-bottom {
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 20%);
}

/* tabs */
.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* portrait navigation (vertical) */
.portrait-nav-vertical {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  z-index: 9;
  padding-right: 15px;
}

/* dark fog background for the quicknav portraits */
.portrait-background {
  position: fixed;
  right: -2%;
  top: 0;
  width: 300px;
  height: 100vh;
  transform: scaleY(150%);
  background-image: url('https://harrowick.neocities.org/Lore/Candles/verticalportraitcontainer.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: right center;
  z-index: 8;
  pointer-events: none;
}

/* for the portraits (reusing the gradient from the container!!) */
.portrait-scroll-vertical {
  display: flex;
  flex-direction: column;
  gap: 15px;
  max-height: 850px;
  overflow-y: scroll;
  overflow-x: hidden;
  padding-right: 6px;

  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
}

.portrait-scroll-vertical::-webkit-scrollbar {
  width: 15px;
}

.portrait-scroll-vertical::-webkit-scrollbar-track {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbartrack.png');
  background-size: contain;
  background-repeat: repeat-y;
  background-position: center;
}

.portrait-scroll-vertical::-webkit-scrollbar-thumb {
  background-image: url('https://harrowick.neocities.org/Lore/Candles/scrollbarthumb.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center top;
}

.portrait-link-vertical {
  display: block;
  width: 100%;
  height: 350px;
  cursor: pointer;
  transition: filter 0.3s ease, transform 0.3s ease;
  filter: brightness(0.85);
  flex-shrink: 0;
}

.portrait-link-vertical:hover {
  filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
  transform: translateX(-5px);
}

.portrait-link-vertical img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}



@media (max-width: 1440px) {
  .polaroid-placement {
    left: -16%;
    transform: translateY(-47%) scale(0.82);
  }
  
  .content-container {
    right: 7%;
    width: 60%;
    transform: translateY(-47%) scale(0.95);
  }
  
  .portrait-background {
    width: 240px;
  }
  
  .portrait-link-vertical {
    height: 280px;
  }
}

@media (max-width: 1024px) {
  .home-btn {
    position: absolute;
    top: 10px;
    left: 0px;
    width: 270px;
  }
  
  .polaroid-placement {
    left: -34%;
    transform: translateY(-46%) scale(0.60);
  }
  
  .content-container {
    right: 7%;
    width: 65%;
  }
  
  .content-box {
    height: 700px;
    padding: 50px;
  }
  
  .scroll-gradient {
    height: 500px;
  }
  
  .portrait-background {
    width: 250px;
    transform: translateX(17%);
  }
  
  .portrait-nav-vertical {
   right: -2%; 
  }
  
  .portrait-link-vertical {
    height: 220px;
    transform: translateX(5%);
  }
  
  .portrait-background {
    transform: scaleY(110%);
    right: -53px;
  }
}

/* mobile */
@media (max-width: 768px) {
  body {
    overflow-y: auto;
    height: auto;
  }
  
  .page-title {
    position: relative;
    max-width: 90%;
    margin: 10px auto;
    display: block;
  }
  
  .home-btn {
    position: absolute;
    top: 10px;
    left: 0px;
    width: 215px;
  }

  .polaroid-placement {
    position: relative;
    left: 65%;
    top: auto;
    transform: translateX(-50%) scale(0.9);
    margin: -100px auto;
  }
  
  .content-container {
    position: relative;
    top: -60%;
    left: 14%;
    width: 100%;
    max-width: 800px;
    margin: 20px auto 100px;
    transform: translateY(-30%) scale(1.2);
  }
  
  .content-box {
    height: 700px;
    padding: 40px 30px;
  }
  
  .scroll-gradient {
    height: 500px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .content-header {
    font-size: 22px;
  }
  
  .scroll-gradient {
    font-size: 18px;
  }

  /* portraits on the bottom for mobile */
  .portrait-nav-vertical {
    position: relative;
    right: auto;
    left: 75%;
    top: auto;
    bottom: 10px;
    transform: translateX(-50%) translateY(-50%) scale(1.3);
    flex-direction: row;
    padding: 10px;
    border-radius: 10px;
    max-width: 95vw;
    margin-bottom: -17px;
  }

  .portrait-scroll-vertical {
    flex-direction: row;
    max-height: none;
    max-width: 80vw;
    overflow-x: scroll;
    overflow-y: hidden;
    gap: 8px;
    padding-right: 0;
    padding-bottom: 6px;
    /* horizontal fade edges */
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  }

  /* horizontal scrollbar for mobile aspect on bottom */
  .portrait-scroll-vertical::-webkit-scrollbar {
    height: 15px;
    width: auto;
  }

  .portrait-scroll-vertical::-webkit-scrollbar-track {
    background-image: url('https://harrowick.neocities.org/Lore/Candles/horizontaltrackbar.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }

  .portrait-scroll-vertical::-webkit-scrollbar-thumb {
    background-image: url('https://harrowick.neocities.org/Lore/Candles/horizontalscrollbarthumb.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
  }

  .portrait-link-vertical {
    width: 150px;
    height: 220px;
    flex-shrink: 0;
    transform: none;
  }

  .portrait-nav-vertical .portrait-link-vertical:hover {
    filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
    transform: translateY(-5px);
  }

  .portrait-background {
    position: fixed;
    left: -294px;
    right: 0;
    top: auto;
    bottom: 0;
    width: 75vw;
    height: 900px;
    transform: rotate(90deg) scale(3.8);
    transform-origin: bottom center;
    background-size: cover;
    background-position: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media (max-width: 425px) {
  body {
    overflow-y: auto;
    height: auto;
  }
  
  .home-btn {
    position: absolute;
    top: 10px;
    left: 0px;
    width: 215px;
  }

  .polaroid-placement {
    position: relative;
    left: 128%;
    top: auto;
    transform: translateX(-43%) scale(1.05);
    margin: -100px auto;
  }
  
  .content-container {
    position: relative;
    top: -61%;
    left: 36%;
    width: 180%;
    max-width: 800px;
    margin: 20px auto 100px;
    transform: translateY(-2%) scale(1.5);
  }
  
  .content-box {
    height: 850px;
    padding: 40px 30px;
  }
  
  .scroll-gradient {
    height: 650px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .content-header {
    font-size: 30px;
  }
  
  .scroll-gradient {
    font-size: 26px;
  }

  /* portraits on the bottom for mobile */
  .portrait-nav-vertical {
    position: relative;
    right: auto;
    left: 123%;
    top: auto;
    bottom: 10px;
    transform: translateX(-50%) translateY(80%) scale(2.4);
    flex-direction: row;
    padding: 10px;
    border-radius: 10px;
    max-width: 195vw;
    margin-bottom: -17px;
  }

  .portrait-scroll-vertical {
    flex-direction: row;
    max-height: none;
    max-width: 100vw;
    overflow-x: scroll;
    overflow-y: hidden;
    gap: 8px;
    padding-right: 0;
    padding-bottom: 6px;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  }

  .portrait-scroll-vertical::-webkit-scrollbar {
    height: 15px;
    width: auto;
  }

  .portrait-scroll-vertical::-webkit-scrollbar-track {
    background-image: url('https://harrowick.neocities.org/Lore/Candles/horizontaltrackbar.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }

  .portrait-scroll-vertical::-webkit-scrollbar-thumb {
    background-image: url('https://harrowick.neocities.org/Lore/Candles/horizontalscrollbarthumb.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
  }

  .portrait-link-vertical {
    width: 150px;
    height: 220px;
    flex-shrink: 0;
    transform: none;
  }

  .portrait-nav-vertical .portrait-link-vertical:hover {
    filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
    transform: translateY(-5px);
  }

  .portrait-background {
    position: fixed;
    left: -294px;
    right: 0;
    top: auto;
    bottom: 0;
    width: 75vw;
    height: 900px;
    transform: rotate(90deg) scale(3.8);
    transform-origin: bottom center;
    background-size: cover;
    background-position: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}

@media (max-width: 375px) {
  body {
    overflow-y: auto;
    height: auto;
  }
  
  .home-btn {
    position: absolute;
    top: 10px;
    left: 0px;
    width: 215px;
  }

  .polaroid-placement {
    position: relative;
    left: 140%;
    top: auto;
    transform: translateX(-50%) scale(1);
    margin: -100px auto;
  }
  
  .content-container {
    position: relative;
    top: -61%;
    left: 38%;
    width: 190%;
    max-width: 800px;
    margin: 20px auto 100px;
    transform: translateY(-10%) scale(1.5);
  }
  
  .content-box {
    height: 800px;
    padding: 40px 30px;
  }
  
  .scroll-gradient {
    height: 600px;
    padding-left: 20px;
    padding-right: 20px;
  }
  
  .content-header {
    font-size: 30px;
  }
  
  .scroll-gradient {
    font-size: 26px;
  }

  /* portraits on the bottom for mobile */
  .portrait-nav-vertical {
    position: relative;
    right: auto;
    left: 123%;
    top: auto;
    bottom: 10px;
    transform: translateX(-50%) translateY(90%) scale(2.4);
    flex-direction: row;
    padding: 10px;
    border-radius: 10px;
    max-width: 195vw;
    margin-bottom: -17px;
  }

  .portrait-scroll-vertical {
    flex-direction: row;
    max-height: none;
    max-width: 100vw;
    overflow-x: scroll;
    overflow-y: hidden;
    gap: 8px;
    padding-right: 0;
    padding-bottom: 6px;
    -webkit-mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
    mask-image: linear-gradient(to right, rgba(0,0,0,0) 0%, rgba(0,0,0,1) 8%, rgba(0,0,0,1) 92%, rgba(0,0,0,0) 100%);
  }

  .portrait-scroll-vertical::-webkit-scrollbar {
    height: 15px;
    width: auto;
  }

  .portrait-scroll-vertical::-webkit-scrollbar-track {
    background-image: url('https://harrowick.neocities.org/Lore/Candles/horizontaltrackbar.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
  }

  .portrait-scroll-vertical::-webkit-scrollbar-thumb {
    background-image: url('https://harrowick.neocities.org/Lore/Candles/horizontalscrollbarthumb.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: left center;
  }

  .portrait-link-vertical {
    width: 150px;
    height: 220px;
    flex-shrink: 0;
    transform: none;
  }

  .portrait-nav-vertical .portrait-link-vertical:hover {
    filter: brightness(1.1) drop-shadow(0 0 8px rgba(255, 255, 255, 0.5));
    transform: translateY(-5px);
  }

  .portrait-background {
    position: fixed;
    left: -294px;
    right: 0;
    top: auto;
    bottom: 0;
    width: 75vw;
    height: 900px;
    transform: rotate(90deg) scale(3.8);
    transform-origin: bottom center;
    background-size: cover;
    background-position: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
  }
}