/* Navbar */

header {
  position: sticky;
  top: 0;
  z-index: 9999;
}
.navbar {
  position: sticky;
  top: 0;
  z-index: 9999; /* Above EVERYTHING */
}


/* Jumbotron */

/* Full-width hero section */
.hero-section {
  width: 100%;
  padding: 80px 0;
  background: #026722;
  /*background: linear-gradient(
    135deg,
    #013d14 0%,
    #026722 40%,
    #014d1a 100%
  );*/
  position: relative;
  border-top: 4px solid #7a0a0a; /* deep red accent */
  overflow: hidden;
}

.hero-section,
.page-wrapper {
  z-index: 1;
  position: relative;
}

/* Texture overlay */
.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("https://www.transparenttextures.com/patterns/asfalt-light.png");
  opacity: 0.15;
  pointer-events: none;
  z-index: 0;
}

.hero-section::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;

  /* Strong inset shadow */
  box-shadow:
    inset 0 0 20px rgba(0,0,0,0.7),
    inset 0 0 60px rgba(0,0,0,0.5),
    inset 0 0 100px rgba(0,0,0,0.4);

  z-index: 3;
}



/* Fade-in animation */
.fade-in {
  opacity: 0;
  animation: fadeInHero 1.4s ease-out forwards;
}

@keyframes fadeInHero {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Softer, mysterious text */
.text-mystery {
  color: #e6e6e6 !important;
}

/* Inner glow for atmospheric lighting */
.inner-glow {
  box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.4);
}

/* Mystery-themed button */
.btn-mystery {
  background-color: #014d1a;
  border-color: #013d14;
  color: #e6e6e6;
  transition: 0.2s ease;
}

.btn-mystery:hover {
  background-color: #026722;
  border-color: #014d1a;
  color: #fff;
}

/* Dramatic author photo shadow */
.author-photo {
  box-shadow: 0 10px 25px rgba(0,0,0,0.5);
}

/* Info in the Read More section */

.bio-panel {
  background: #fdf8ef; /* parchment */
  color: #222;         /* readable dark text */
  border-radius: 8px;
  padding: 20px;

  /* Remove inherited hero effects */
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
  opacity: 1 !important;

  /* Optional: subtle inset for style */
  box-shadow:
    inset 0 0 12px rgba(0,0,0,0.15),
    0 2px 6px rgba(0,0,0,0.15);
}


/* Carousel */
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    padding: 0.75rem 1.5rem;
    border: 2px solid #fff;
    background: rgba(0,0,0,0.4);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 500;
     border-radius: 8px;
    transition: 0.2s ease;
    }

    /* Hover effect using the hero-section green (#026722) */
.carousel-btn:hover {
  background-color: #026722 !important;
  border-color: #026722 !important;
  color: #fff !important;
  transition: background-color 0.25s ease, border-color 0.25s ease;
}


    .carousel-prev {
    left: 20px;
    }

    .carousel-next {
    right: 20px;
    }

    .text-strong {
    color: #ffffff !important;
    font-weight: 600;
    text-shadow: 0 0 6px rgba(0,0,0,0.9);
    }


    /* Body */
    /* ------------------------------------------
   1. Global parchment background + scrolling texture
    ------------------------------------------- */
    /* GLOBAL BACKGROUND LAYER */
body {
  background-color: #f3e9d2;
  margin: 0;
  padding: 0;
  position: relative;
}

/* Animated parchment texture — isolated so it DOES NOT break sticky */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  background-image: url("https://www.transparenttextures.com/patterns/old-wall.png");
  opacity: 0.25;

  /* Animation stays, but we isolate it OUTSIDE layout */
  animation: scrollTexture 60s linear infinite;

  /* Critical: keep it behind EVERYTHING */
  z-index: -9999;
  pointer-events: none;
}

@keyframes scrollTexture {
  from { background-position: 0 0; }
  to { background-position: 1000px 1000px; }
}

/* Soft vignette */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -9998;
  background: radial-gradient(
    circle,
    rgba(0,0,0,0) 60%,
    rgba(0,0,0,0.15) 100%
  );
}

    /* ------------------------------------------
   2. Page wrapper (the "book page")
    ------------------------------------------- */
    .page-wrapper {
    overflow-x: hidden;
    max-width: 1400px;
    margin: 0 auto;        /* IMPORTANT: no top margin */
    padding: 60px 40px;    /* Add spacing INSIDE instead */
    background: #fdf8ef;   /* parchment interior */

    border: 30px solid transparent;
    border-image: url("https://www.transparenttextures.com/patterns/leather.png") 30 round;
    border-radius: 0 12px 12px 0;
    position: relative;
    z-index: 1;            /* BELOW navbar, ABOVE background */
    }

    /* Inner gilded border */

    .page-inner::after {
    content: "";
    position: absolute;
    inset: 12px; /* distance from leather border */
    border-radius: 0 8px 8px 0;
    pointer-events: none;

    border: 2px solid rgba(121, 93, 32, 0.35);
    box-shadow:
        inset 0 0 6px rgba(0,0,0,0.25),
        0 0 4px rgba(255,255,255,0.15);

    z-index: 2;
    }

    /* ------------------------------------------
    3. Leather spine on the left
    ------------------------------------------- */
    .page-wrapper::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 60px;
    height: 100vh;
    background: url("https://www.transparenttextures.com/patterns/leather.png");
    background-size: cover;
    background-color: #3a2a1a;

    box-shadow:
        inset -6px 0 12px rgba(0,0,0,0.6),
        6px 0 15px rgba(0,0,0,0.4);
    pointer-events: none;

    /* Critical: keep it BELOW wrapper */
    z-index: 0;
    }

    /* GOLD EMBOSSED TEXT ON THE LEATHER SPINE */
    .page-wrapper::after {
    content: "THE CHRONICLES OF GOODRICK";
    position: fixed;

    /* Match the spine’s position exactly */
    top: 50%;
    left: calc(0px + 30px); /* spine left + half spine width */
    transform: translate(-50%, -50%) rotate(-90deg);

    font-family: "Cinzel", serif;
    font-size: 30px;
    letter-spacing: 4px;
    font-weight: 700;

    /* Gold emboss effect */
    color: #d4b46a;
    text-shadow:
        0 0 3px rgba(0,0,0,0.6),
        1px 1px 2px rgba(255,255,255,0.4),
        -1px -1px 2px rgba(0,0,0,0.5),
        0 0 8px rgba(212,180,106,0.6);

    pointer-events: none;
    z-index: 6;
    }

    

    /* CONTACT SECTION */

    .contact-form-wrapper {
    max-width: 600px;
    margin: 0 auto;
    margin-top: 60px;
    }
    
    .contact-form-wrapper {
    position: relative;
    isolation: isolate; /* this is the magic */
    z-index: 10;
    }
    /* Clean, readable input fields */
    .contact-form input,
    .contact-form textarea {
      position: relative;        /* creates a new stacking context */
      z-index: 10;               /* lifts caret + text above overlays */
      background: #e2d7c2 !important;
      color: #222 !important;
      border: 2px solid #014d1a;
      border-radius: 6px;
      padding: 10px;
      box-shadow: none !important;
      text-shadow: none !important;
      mix-blend-mode: normal !important;
      opacity: 1 !important;
    }

    /* Make the typing cursor visible */
    .contact-form input:focus,
    .contact-form textarea:focus {
      outline: 2px solid #026722;
      background: #fff !important;
      color: #000 !important;
      caret-color: #000; /* visible typing cursor */
    }

    /* FIX CUSTOM CAROUSEL BUTTONS */
    .carousel-btn {
      position: absolute;
      top: 50%;                 /* move buttons down so they don't overlap text */
      transform: translateY(-50%);
      z-index: 20;              /* keep above images and text */
      padding: 8px 14px;
      font-size: 0.9rem;
      background: rgba(0,0,0,0.6);
      color: #fff;
      border: 2px solid #fff;
      border-radius: 6px;
      cursor: pointer;
    }

    /* LEFT BUTTON */
    .carousel-prev {
      left: 10px;
    }

    /* RIGHT BUTTON */
    .carousel-next {
      right: 10px;
    }

    /*----------------------------------
              MEDIA QUERIES
    ----------------------------------*/

    @media (max-width: 390px) {
      .hero-section h2 {
        font-size: 1rem;
        line-height: 1.2;
      }
    }
    @media (max-width: 576px) {
    .hero-section {
      padding: 40px 0;
    }
    }

    @media (max-width: 576px) {
    .hero-section::after {
    box-shadow:
      inset 0 0 10px rgba(0,0,0,0.6),
      inset 0 0 30px rgba(0,0,0,0.4);
    }
    }

    

    /* iPhone 14 / small screens */
  @media (max-width: 430px) {

  /* HERO SECTION */
  .hero-section {
    padding: 40px 0; /* reduce huge vertical padding */
    text-align: center;
  }

  .hero-section::after {
    /* soften the inset shadow so it doesn't crush the content */
    box-shadow:
      inset 0 0 10px rgba(0,0,0,0.6),
      inset 0 0 25px rgba(0,0,0,0.4),
      inset 0 0 40px rgba(0,0,0,0.3);
  }

  /* HERO TEXT */
  .hero-section h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .hero-section h2 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .hero-section p {
    font-size: 1rem;
  }

  /* BUTTON */
  .btn-mystery {
    width: 100%;
    max-width: 260px;
    margin: 0 auto;
    display: block;
  }

  /* READ MORE PANEL */
  .bio-panel {
    padding: 16px;
    font-size: 0.95rem;
  }

  /* CONTACT FORM */
  .contact-form-wrapper {
    padding: 0 12px;
  }

  .contact-form input,
  .contact-form textarea {
    font-size: 1rem;
    padding: 10px;
  }

  /* PAGE WRAPPER / SPINE */
  .page-wrapper {
    margin: 0;
    border-radius: 0; /* rounded corners look weird on mobile */
  }

  /* Prevent horizontal scrolling */
  body, html {
    overflow-x: hidden;
  }
  .hero-section {
  padding: 28px 0;
  }
  }

  @media (max-width: 430px) {

  .author-photo {
    width: 130px !important;   /* perfect size for iPhone 14 */
    height: auto !important;
    display: block;
    margin: 0 auto 16px auto;  /* center it */
    border-radius: 6px;
  }

}



  @media (max-width: 430px) {

  /* SPINE FIX */
  .page-wrapper::before {
    width: 40px !important;      /* thinner spine */
    left: -20px !important;      /* pull it off-screen slightly */
    background-size: cover;      /* keeps texture crisp */
  }

  .page-wrapper {
    margin-left: 0 !important;   /* prevent horizontal scroll */
    overflow-x: hidden;
  }

  /* CAROUSEL IMAGE */
  .carousel-item img {
    width: 80% !important;
    margin: 0 auto;
    display: block;
  }

  /* CAPTION TEXT */
  .carousel-caption {
    font-size: 0.9rem;
    padding: 10px 0;
  }

  /* BUTTONS */
  .carousel-control-prev,
  .carousel-control-next {
    width: 15%; /* smaller hitbox */
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    transform: scale(0.7); /* shrink icons */
  }

  /* INDICATORS */
  .carousel-indicators {
    bottom: -10px; /* pull them down slightly */
  }

  .carousel-indicators [data-bs-target] {
    width: 6px;
    height: 6px;
  }

  .carousel-item .card {
    padding: 12px;
    font-size: 0.9rem;
  }
}

@media (max-width: 430px) {

  /* MOBILE SPINE */
  .page-wrapper::before {
    width: 32px !important;      /* slimmer spine */
    left: 0 !important;           /* flush to the edge */
    background-size: cover !important;
    box-shadow:
      inset -4px 0 8px rgba(0,0,0,0.6),
      4px 0 10px rgba(0,0,0,0.4);
  }

  /* MOBILE GOLD TEXT */
  .page-wrapper::after {
    font-size: 18px !important;   /* scale down for mobile */
    letter-spacing: 2px !important;

    /* recenter based on new spine width */
    left: calc(0px + 16px) !important; /* half of 32px */

    transform: translate(-50%, -50%) rotate(-90deg) !important;

    white-space: nowrap;
  }

  /* PREVENT HORIZONTAL SCROLL */
  body, html {
    overflow-x: hidden !important;
  }
}
@media (max-width: 430px) {
  .page-wrapper::after {
    content: "GOODRICK";
  }
}




/* MOBILE FIX */
@media (max-width: 768px) {
  .carousel-btn {
    top: 50%;               /* push even lower on mobile */
    padding: 6px 10px;
    font-size: 0.8rem;
  }

  .carousel-prev {
    left: 5px;
  }

  .carousel-next {
    right: 5px;
  }
}

/* iPhone 14 pro max fixes */
@media (max-width: 450px) {

  .author-photo {
    width: 120px !important;   /* slightly smaller than iPhone 14 */
    height: auto !important;
    margin: 0 auto 16px auto;
    border-radius: 6px;
  }
}

@media (max-width: 450px) {

  .page-wrapper::before {
    width: 28px !important;     /* slightly slimmer for Pro Max */
    left: 0 !important;
  }

  .page-wrapper::after {
    left: 14px !important;       /* half of 28px */
    font-size: 17px !important;  /* scale gold text down slightly */
    letter-spacing: 2px !important;
  }
}

/* iPhone 14 Pro Max and similar (430px width) */
@media (max-width: 450px) {

  .hero-section h1 {
    font-size: 2.2rem !important;   /* down from Bootstrap's huge display-2 */
    line-height: 1.2 !important;
    margin-bottom: 10px !important;
  }

    .hero-section h2 {
    font-size: 2rem !important;   /* down from Bootstrap's huge display-2 */
    line-height: 1.2 !important;
    margin-bottom: 10px !important;
  }

  .hero-section .container {
    padding-top: 20px !important;
    padding-bottom: 20px !important;
  }
}



/* Make the carousel a positioning container */
#bookCarousel {
  position: relative;
}

/* Position buttons relative to the IMAGE, not the text */
#bookCarousel .carousel-btn {
  position: absolute;
  top: 200px;              /* sits just below the 350px max-height image */
  transform: translateY(-50%);
  z-index: 20;
  padding: 6px 12px;
  font-size: 0.85rem;
  background: rgba(0,0,0,0.6);
  color: #fff;
  border: 2px solid #fff;
  border-radius: 6px;
}

/* Left button */
#bookCarousel .carousel-prev {
  left: 10px;
}

/* Right button */
#bookCarousel .carousel-next {
  right: 10px;
}

/* MOBILE TUNING */
@media (max-width: 430px) {
  #bookCarousel .carousel-btn {
    top: 180px;            /* slightly lower for iPhone 14 */
    padding: 5px 10px;
    font-size: 0.8rem;
  }
}
