/* ==============================
   IMPORT GOOGLE FONTS
============================== */
/* MAIN TITLE / HEADINGS — cinematic serif */
@import url("https://fonts.googleapis.com/css2?family=Cinzel:wght@400;600;700&display=swap");

/* BODY TEXT — clean and readable, pairs well with Cinzel */
@import url("https://fonts.googleapis.com/css2?family=Lora:wght@400;500;600&display=swap");

/* ACCENTS / QUOTES — elegant serif with a bit of flair */
@import url("https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&display=swap");

/* ==============================
   BASE VARIABLES
============================== */
:root {
  /* Colors */
  --primary-accent: #01000f; /* Deep blue for buttons and highlights */
  --secondary-accent: #a0a0a0; /* Subtle hover / borders */
  --btn-color: rgb(0, 7, 21); /* Subtle hover / borders */
  --background-light: #f7f7f7; /* Light neutral background */
  --dark-text: #222222; /* Main text color */
  --light-text: #555555; /* Secondary text */

  /* Fonts */
  --font-body: "Cinzel", serif; /* Comfortable for long reading */
  --font-heading: "Lora", sans-serif; /* Modern, structured headings */
  --font-accent: "Cormorant Garamond", serif; /* Pull quotes / hero text */

  /* Font sizes */
  --font-size-base: 16px;
  --font-size-h1: 3rem;
  --font-size-h2: 2.25rem;
  --font-size-h3: 1.75rem;
  --font-size-h4: 1.5rem;
  --font-size-h5: 1.25rem;
  --font-size-h6: 1rem;

  /* Line heights */
  --line-height-body: 1.6;
  --line-height-heading: 1.2;

  /* Spacing */
  --spacing-base: 16px;
  --spacing-lg: 32px;
  --spacing-sm: 8px;
}

/* ==============================
   GLOBAL RESET
============================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Prevent horizontal scroll */
html,
body {
  width: 100%;
  overflow-x: hidden;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--font-size-base);
  line-height: var(--line-height-body);
  color: var(--dark-text);
  background-color: var(--background-light);
}

/* Full-page loader */
#page-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: var(--btn-color); /* matches your site palette */
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99999;
  transition: opacity 0.5s ease;
}

/* Loader content */
.loader-content {
  position: fixed; /* stays on top of the screen */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999; /* very high to stay above all elements */

  display: flex; /* center content */
  justify-content: center;
  align-items: center;

  text-align: center;
}

/* Spinner */
.spinner {
  width: 50px;
  height: 50px;
  border: 5px solid var(--secondary-accent);
  border-top: 5px solid var(--primary-accent); /* gold accent */
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin-bottom: 10px;
}

/* Spinner animation */
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

/* ==============================
   HEADINGS
============================== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  line-height: var(--line-height-heading);
  color: var(--primary-accent); /* Make gold prominent */
  margin-bottom: calc(var(--spacing-base) / 2);
}

h1 {
  font-size: var(--font-size-h1);
  font-weight: 400;
}
h2 {
  font-size: var(--font-size-h2);
  font-weight: 400;
}
h3 {
  font-size: var(--font-size-h3);
  font-weight: 400;
}
h4 {
  font-size: var(--font-size-h4);
  font-weight: 400;
}
h5 {
  font-size: var(--font-size-h5);
  font-weight: 400;
}
h6 {
  font-size: var(--font-size-h6);
  font-weight: 400;
}

p {
  font-family: var(--font-accent);
  font-weight: 600;
  font-size: 18px; /* makes text readable */
  line-height: 1.6; /* adds spacing between lines */
}

.indented p {
  text-indent: 2em; /* indent first line */
  text-align: justify; /* justify the paragraph */
  line-height: 1.8; /* make spacing more readable */
}
/* ==============================
   LINKS
============================== */
a {
  color: var(--primary-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-accent);
}

/* ==============================
   NAVIGATION
============================== */
/* Fixed Navbar always on top */
/* Navbar always fixed on top */
nav {
  font-family: var(--font-ui);
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 85px;
  padding: 0 40px;

  position: fixed !important; /* force it to be fixed */
  top: 0;
  left: 0;
  width: 100%;
  z-index: 9999 !important; /* very high to stay above video and content */

  background-color: transparent; /* solid background to make links readable */
}

/* Navbar links */
nav a {
  margin: 0 16px;
  font-weight: 600;
  color: var(--background-light);
  transition: color 0.3s ease;
}

.nav-link {
  color: var(--background-light);
}

nav a:hover {
  color: var(--light-text) !important;
}

/* Navbar background when scrolled */
nav.scrolled {
  background-color: var(--dark-text) !important; /* force background color */
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.navbar-toggler {
  border: none;
}

.navbar-toggler-icon {
  filter: invert(1); /* makes it visible on dark background */
}

/* Make all sections fill full viewport height */
section {
  min-height: 100vh; /* full viewport height */
  display: flex;
  align-items: center; /* vertically center content */
  justify-content: center; /* horizontally center if needed */
  padding: 0 40px; /* horizontal padding only, remove vertical padding */
  box-sizing: border-box;
}

/* If you want text to scroll inside the section if it overflows */
section > .container {
  max-height: 100%;
}

/* ==============================
   BUTTONS
============================== */
button,
.btn {
  font-family: var(--font-ui);
  font-weight: 600;
  background-color: var(--btn-color);
  color: var(--background-light);
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.3s ease;
}

button:hover,
.btn:hover {
  background-color: var(--secondary-accent);
  color: var(--background-light);
}

/* ==============================
   FOOTER
============================== */
footer {
  font-family: var(--font-ui);
  background-color: var(--dark-text);
  color: var(--primary-accent);
  text-align: center;
  padding: 24px 40px;
  z-index: 1;
}

.footer-link {
  color: var(--background-light); /* default link color */
  text-decoration: none;
  transition: color 0.3s ease; /* smooth hover effect */
}

.footer-link:hover {
  color: var(--secondary-accent); /* change color on hover */
}

/* Text Logo */
.logo-text {
  font-size: 2rem;
  font-weight: 500;
  color: var(--background-light); /* gold color from your palette */
  text-decoration: none;
  position: relative;
  z-index: 1;
}

/* ==============================
   HOME
============================== */

/* Landing Section */
.landing-section,
.book-section {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  justify-content: center;
}
/* Background Video */
.bg-video {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 110%; /* fill container width */
  height: 110%; /* fill container height */
  transform: translate(-50%, -50%);
  object-fit: cover; /* fill area */
  z-index: -1;
  filter: blur(8px); /* optional cinematic blur */
}

/* Optional overlay for readability */
/* dark overlay */
.landing-section::after,
.book-section::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
  pointer-events: none;
}

/* content layer ABOVE overlay */
.landing-section .container-fluid,
.book-section .container-fluid {
  position: relative;
  z-index: 2;
}

.landing-image-wrapper {
  position: relative;
  flex: 1;
  height: 100%;
  height: 600px; /* important: define a height so circle can appear */
  overflow: visible; /* allow circle to be visible outside image */
}

/* Big Circle Behind Author */
.landing-shape {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, #2a4d8f, #a0a0a0);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 0; /* behind */
  opacity: 0.3;
}

/* Ensure container and row fill height */
.landing-section .container-fluid,
.landing-section .row,
.book-section .container-fluid,
.book-section .row {
  margin: 0;
}

/* Author Image */
.landing-image {
  position: absolute;
  bottom: 0; /* stick to bottom */
  left: 75%; /* center horizontally */
  transform: translateX(-50%); /* exact center */

  width: auto;
  max-width: 100%; /* responsive width */
  max-height: 100%; /* do not exceed column height */
  height: 100%; /* fill column height */

  object-fit: cover; /* fill area without distortion */
  object-position: bottom; /* bottom stays visible when cropped */

  display: block;
  z-index: 1;
  border-radius: 0;
  overflow: hidden;
  mask-repeat: no-repeat;
  mask-size: cover;
}

/* Text */
.landing-name {
  font-family: var(--font-body), sans-serif; /* use var() for CSS variable */
  font-weight: 700;
  color: #ffffff;
}

.landing-tagline {
  color: #ffffff;
  line-height: 1.5;
}

.landing-btn {
  background-color: #ffffff;
  color: #fff;
  padding: 12px 28px;
  border-radius: 6px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.landing-btn:hover {
  background-color: #1f3a6f;
  text-decoration: none;
}

.img-col {
  display: flex;
  flex-direction: column;
  position: relative; /* for landing-shape */
}

.text-col {
  height: 100%; /* fill the full height of the row/section */
  display: flex;
  flex-direction: column;
  justify-content: center; /* vertically center text */
  align-items: center; /* horizontally center text */
  text-align: center;
}

.book-synopsis {
  font-size: 18px; /* adjust number as needed */
  line-height: 1.8; /* optional: improves readability */
  color: var(--background-light);
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .landing-section,
  .book-section {
    text-align: center;
  }
  .landing-text {
    text-align: center;
  }
  .landing-shape {
    width: 250px;
    height: 250px;
    filter: blur(40px);
  }
  .img-col {
    padding: 0 0px;
  }
  section {
    padding: 0 0px !important;
  }
}

/* Background video */
.landing-video {
  object-fit: cover; /* cover entire section */
  width: 100%;
  height: 100%;
  z-index: -1; /* behind text */
  filter: brightness(0.45); /* darken for text readability */
}

/* Overlay text */
.landing-overlay {
  position: relative;
  z-index: 1;
  font-family: "Baskerville", serif;
  color: #ffffff;
  margin: 0;
}

/* Title hover effect */
.landing-title {
  transition: color 0.3s ease;
  font-size: 7rem; /* bigger than Bootstrap display-3 */
  line-height: 1.1;
  color: #fff;
}

.landing-subtitle {
  display: block; /* puts it on a new line */
  font-size: 3rem; /* smaller than main title */
  font-weight: 400;
  margin-top: 0.2rem; /* small gap, adjust as needed */
  line-height: 1.2;
}

/* Button Styling */
.landing-btn {
  font-family: "Inter", sans-serif;
  font-weight: 600;
  background-color: #ffffff;
  color: var(--dark-text);
  border-radius: 8px;
  transition:
    background-color 0.3s ease,
    transform 0.3s ease;
}

.landing-btn:hover {
  background-color: var(--secondary-accent);
  color: var(--background-light);
  transform: scale(1.05);
}

/* Back to Top Button */
#backToTop {
  position: fixed;
  bottom: 40px;
  right: 40px;
  z-index: 9998;
  background-color: var(--primary-accent);
  color: var(--background-light);
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  font-size: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0; /* start hidden */
  pointer-events: none; /* ignore clicks when hidden */
  transition:
    opacity 0.4s ease,
    transform 0.3s ease;
}

/* Scroll Down */
.scroll-down-wrapper {
  position: absolute;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  z-index: 3;
}

.scroll-text {
  font-size: 0.9rem;
  font-weight: 500;
  color: #ffffff;
  display: block;
  letter-spacing: 1px;
}

/* Arrow pointing down as a V */
.scroll-down .arrow {
  display: block;
  width: 24px;
  height: 24px;
  border-left: 3px solid #ffffff;
  border-bottom: 3px solid #ffffff;
  transform: rotate(315deg); /* downward V */
  margin: 0 auto;
}

/* Animate the whole arrow container vertically */
.scroll-down {
  display: inline-block;
  animation: bounce 1.5s infinite;
}

@keyframes bounce {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(10px);
  }
}

#backToTop.show {
  opacity: 1;
  pointer-events: auto; /* enable clicks */
}

#backToTop:hover {
  background-color: var(--secondary-accent);
  transform: translateY(-4px);
}

#book-hero {
  height: 100vh; /* full viewport height */
  perspective: 1500px;
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  overflow: hidden;

  /* Background image: full height, centered */
  background-image: url("img/Authors/book_404.png");
  background-position: center bottom;
  background-repeat: no-repeat;
  background-size: auto 120%;
  /* Animation for slow zoom */
  animation: bgZoom 10s ease-in-out infinite alternate;
}

/* Optional: slow zoom animation */
@keyframes bgZoom {
  0% {
    transform: scale(1);
  }
  100% {
    transform: scale(1.05);
  }
}

/* Keyframes for smooth zoom */
@keyframes bgZoom {
  0% {
    background-size: 100% auto; /* start at original size */
  }
  100% {
    background-size: 110% auto; /* slowly zoom in */
  }
}

/* ==============================
   BOOK
============================== */

/* Keyframes for subtle movement */
@keyframes grainMove {
  0% {
    background-position:
      0 0,
      0 0;
  }
  50% {
    background-position:
      50px 50px,
      -50px -50px;
  }
  100% {
    background-position:
      0 0,
      0 0;
  }
}

/* Responsive 3D Book */
.book-3d {
  width: var(--book-width, 300px); /* default width 300px */
  height: var(--book-height, 450px); /* default height 450px */
  max-width: 450px; /* limit width */
  aspect-ratio: 2 / 3; /* maintain proportional height */
  max-height: 60vh; /* don’t exceed viewport height */
  transform-style: preserve-3d;
  transition: transform 0.1s ease;
  position: relative;
  z-index: 2; /* stay above tint overlay */
}

.main {
  width: 100%;
  height: 100%;
  position: relative;
  transform-style: preserve-3d;
  transform: rotateY(25deg) rotateX(0deg); /* default side view */
}

/* Front Cover */
.book-cover {
  position: absolute;
  width: 100%;
  height: 100%;
  background-image: url("../img/book-cover.jpg");
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  transform: translateZ(20px);
  border-radius: 4px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  transition: transform 0.3s ease;
  z-index: 3;
}

/* Spine */
.book-spine {
  position: absolute;
  width: 40px;
  height: 100%;
  background-image: url("../img/book-cover.jpg");
  background-size: calc(100% + 40px) cover;
  background-position: left center;
  background-repeat: no-repeat;
  left: -20px;
  transform: rotateY(-90deg) translateZ(0px);
  border-radius: 2px;
  box-shadow: inset 1px 0 0 #00000033;
  z-index: 2;
}

/* Pages */
.book-page {
  position: absolute;
  width: 95%; /* slightly smaller than cover */
  height: 98%; /* slightly smaller than cover */
  background: #f8f5e1; /* off-white paper color */
  left: 2.5%;
  top: 1%;
  border-radius: 2px;
  box-shadow: inset 0 0 1px rgba(0, 0, 0, 0.1);
}

/* Stack three pages with slight Z offset */
.book-page:nth-child(1) {
  transform: translateZ(12px);
}
.book-page:nth-child(2) {
  transform: translateZ(10px);
}
.book-page:nth-child(3) {
  transform: translateZ(8px);
}

/* Back Cover */
.book-back {
  position: absolute;
  width: 100%;
  height: 100%;
  background: #29303a;
  transform: rotateY(180deg) translateZ(20px);
  border-radius: 4px;
  z-index: 0;
}

/* Book Info */
.book-author {
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 0.25rem;
}

.book-genre {
  font-size: 1.5rem;
  color: var(--background-light);
  opacity: 0.8;
}

.book-hero-title {
  font-size: 2.5rem;
  font-weight: 500;
  line-height: 1.2;
  margin: 0;
  color: var(--background-light);
  position: relative;
  padding-bottom: 0.5rem; /* space between text and line */
  display: inline-block; /* keeps line width matched to text */
}

.book-hero-title::after {
  content: "";
  display: block;
  width: 100%; /* length of the line */
  height: 1px; /* thickness of the line */
  background-color: #ffffff; /* color of the line */
  margin-top: 0.3rem; /* space below title */
}

.book-hero-title .subtitle {
  display: block; /* moves subtitle to a new line */
  font-size: 0.7em; /* smaller than main title */
  color: var(--background-light) !important;
  margin-top: 0.2em; /* optional: space between title and subtitle */
}

.featured-title {
  color: var(--dark-text) !important;
}

.book-hero-author {
  font-size: 1.5rem;
  font-weight: 400;
  font-family: "Baskerville", serif !important;
  color: var(--background-light);
}

.book-hero-genre {
  font-size: 1.1rem;
  opacity: 0.8;
  color: var(--background-light);
}

.news-columns {
  column-count: 2;
  column-gap: 40px;
}

.news-columns p {
  text-align: justify;
  margin: 0;
}

.news-columns img {
  width: 100%;
  display: block;
  break-inside: avoid;
}

form,
form input,
form label,
form textarea {
  font-family: var(--font-accent); /* change to your desired font */
  font-weight: 600;
}

/* Carousel Flyers */
#flyersCarousel .carousel-inner img {
  max-height: 500px; /* adjust as needed */
  object-fit: contain; /* keep image proportions */
  margin: 0 auto; /* center horizontally */
}

/* Circular Carousel Controls */
#flyersCarousel .carousel-control-prev,
#flyersCarousel .carousel-control-next {
  width: 50px;
  height: 50px;
  background-color: rgb(0 43 125 / 57%); /* dark semi-transparent */
  border-radius: 50%; /* makes it circular */
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  justify-content: center;
  align-items: center;
}

#flyersCarousel .carousel-control-prev-icon,
#flyersCarousel .carousel-control-next-icon {
  background-size: 50% 50%; /* make the arrow smaller */
}

.author-circle {
  width: 700px;
  height: 700px;
  background: rgb(255 255 255);
  position: absolute;
  top: 60%;
  left: 75%;
  transform: translate(-50%, -50%);
  z-index: 1; /* behind the image */

  /* Left-pointing triangle with rounded corners */
  clip-path: polygon(
    0% 50%,
    /* left apex */ 90% 10%,
    /* top right */ 90% 90% /* bottom right */
  );
  border-radius: 30px; /* controls roundness of corners */
}

.website-created {
  background-color: rgb(18 18 18);
  color: #333;
  font-size: 0.85rem;
}

/* GALLERY */
.gallery-item {
  overflow: hidden;
  cursor: pointer;
  border-radius: 12px;
}

.gallery-item img {
  width: 100%;
  height: 300px;
  object-position: top; /* 👈 THIS is the key */
  object-fit: cover;
  transition: 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.1);
  filter: brightness(0.8);
}

/* MODAL ARROWS */
.nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 30px;
  padding: 10px 15px;
  cursor: pointer;
  z-index: 10;
  border-radius: 50%;
}

.prev-btn {
  left: 10px;
}
.next-btn {
  right: 10px;
}

.nav-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

/* FADE EFFECT */
#modalImage {
  transition: opacity 0.3s ease;
}

.modal-content {
  background-color: transparent !important;
  border: transparent !important;
}

.nav-btn {
  font-size: 15px;
  padding: 10px 18px;
}

@media (max-width: 991px) {
  .author-circle {
    position: absolute;
    transform: translateX(-50%);
    top: 60%;
    bottom: 0px;
    left: 50%;
    height: 50%;
    width: 250px;
    height: 250px;
  }
  .navbar-collapse {
    position: fixed;
    top: 0;
    right: 0;
    width: 100%; /* adjust width (70–80% feels good) */
    height: 100vh;

    background-color: var(--primary-accent);
    backdrop-filter: blur(10px);

    display: flex;
    text-align: center;
    flex-direction: column;
    transform: translateX(100%); /* start off-screen */
    transition: transform 0.4s ease;
    z-index: 9998;
    justify-content: center !important; /* horizontal center */
    align-items: center; /* ✅ vertical center */
    overflow-y: auto;
  }

  .navbar-collapse.show span.logo-text {
    color: #fff !important; /* different color for collapsed menu */
  }

  .navbar-collapse.show .nav-link {
    color: #fff !important; /* different color for collapsed menu */
  }

  .landing-image {
    left: 50%;
    height: 50%; /* fill column height */
  }

  /* When open */
  .navbar-collapse.show {
    transform: translateX(0);
  }

  /* Nav items */
  .navbar-nav {
    flex-direction: column;
    align-items: center; /* center text horizontally */
    margin: 0 !important;
    gap: 25px;
  }

  .nav-link {
    font-size: 1.8rem;
    color: var(--background-light);
  }

  /* Keep hamburger above */
  .navbar-toggler {
    z-index: 9999;
  }
}

/* Mobile adjustments */
@media (max-width: 768px) {
  .book-3d {
    width: clamp(180px, 40vw, 420px); /* min, fluid, max */
    height: clamp(270px, 60vw, 630px); /* maintain book ratio */
    max-height: 70vh; /* prevent it from exceeding screen height */
  }

  .book-cover,
  .book-back {
    border-radius: 1vw;
  }

  .book-spine {
    width: 12%;
    left: -6%;
    border-radius: 0.5vw;
  }

  .book-hero-title {
    font-size: 3rem;
  }
  .book-hero-author {
    font-size: 1.8rem;
  }
  .book-hero-genre {
    font-size: 0.95rem;
  }

  .news-columns {
    column-count: 1;
  }

  .book-section {
    height: auto !important;
    min-height: 100svh;
  }

  @keyframes bgZoom {
    0% {
      background-size: 190% auto; /* start at original size */
    }
    100% {
      background-size: 200% auto; /* slowly zoom in */
    }
  }
}
