/* ============================
   RESET & BASE
============================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  background-color: #f4f4f4;
  color: #333;
  line-height: 1.6;
}

/* Main page wrapper ensures footer sticks to bottom */
.page-wrapper {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Main content grows to fill available space */
.main-content,
main {
  flex: 1;
  padding: 2rem;
}

/* ============================
   HEADER & BANNER
============================ */
.site-header {
  background-color: #222;
  color: white;
  padding: 1.2rem 2rem;
  position: relative;
}

/* Inner container */
.header-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

/* Logo floated left */
.logo-link {
  position: absolute;
  left: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  /*background: rgba(255, 255, 255, 0.1);  subtle contrast */
  /*border-radius: 50%;*/
  padding: 0.4rem;
  transition: background 0.3s ease, transform 0.3s ease;
}

.site-logo {
  height: 70px;
  width: auto;
  display: block;
}

.site-header h1 {
  font-size: 1.8rem;
  font-weight: 600;
  margin: 0;
  text-align: center;
  letter-spacing: 0.5px;
}

/* ============================
   NAVIGATION
============================ */
.main-nav {
  background-color: #444;
}

.main-nav ul {
  display: flex;
  justify-content: center;
  list-style: none;
  padding: 1rem;
  margin: 0;
}

.main-nav ul li {
  margin: 0 1rem;
}

.main-nav ul li a {
  color: white;
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 5px;
  position: relative;
  transition: color 0.3s ease, background-color 0.3s ease;
}

.main-nav ul li a:hover {
  background-color: #666;
}

.main-nav ul li a.active {
  background-color: #555;
  color: #fff;
}

/*.main-nav ul li a.active::after {
  content: "";
  position: absolute;
  left: 10%;
  bottom: 6px;
  width: 80%;
  height: 2px;
  background-color: #ccc;
  border-radius: 2px;
}*/

/* ============================
   FOOTER
============================ */
footer {
  background-color: #222;
  color: white;
  padding: 2rem 1rem;
  margin-top: 0;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Top Row: Ko-Fi + Menu --- */
.footer-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  flex-wrap: wrap;
}

/* Ko-Fi button */
.kofi-button img {
  height: 48px;
  width: auto;
  animation: pulse 4s infinite ease-in-out;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.kofi-button img:hover {
  transform: scale(1.07);
  opacity: 1;
}

/* Smooth, subtle pulse */
@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.85; }
}

/* Footer menu (top right links) */
.footer-menu {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.footer-menu a {
  color: white;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-menu a:hover {
  color: #ccc;
}

/* --- Social icons --- */
.footer-social {
  text-align: center;
  margin-bottom: 1rem;
}

.footer-social a {
  color: white;
  margin: 0 0.75rem;
  font-size: 2rem;
  transition: color 0.3s ease;
}

.footer-social a:hover {
  color: #ccc;
}

/* --- Divider --- */
.footer-divider {
  border: none;
  border-top: 1px solid #555;
  margin: 2rem auto;
  width: 80%;
}

/* --- Bottom area (copyright + legal) --- */
.footer-bottom {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  align-items: center;
  font-size: 0.9rem;
  color: #aaa;
}

.footer-copy {
  text-align: left;
  flex: 1;
  padding: 0.5rem;
}

.footer-copy a {
  color: #d5d5d5;
  text-decoration: none;
  transition: color 0.5s ease;
}

.footer-copy a:hover {
  color: #fff;
}

.footer-legal {
  text-align: right;
  flex: 1;
  padding: 0.5rem;
}

.footer-legal a {
  color: #aaa;
  margin-left: 1rem;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-legal a:hover {
  color: #fff;
}

/* ============================
   BOOKS GRID & DETAIL
============================ */
.book-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.book-box {
  background-color: white;
  padding: 1.5rem;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  flex: 0 1 calc(45% - 2rem);
  max-width: 500px;
  transition: transform 0.3s;
}

.book-box:hover {
  transform: translateY(-5px);
}

.book-box img {
  width: 100%;
  height: auto;
  max-height: 300px;
  object-fit: cover;
  border-radius: 5px;
  margin-bottom: 1rem;
}

.book-link {
  text-decoration: none;
  color: inherit;
}

.book-detail h1,
.book-detail h2 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1rem;
  color: #222;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #ccc;
  display: inline-block;
  padding-bottom: 0.5rem;
}

.book-detail p {
  font-size: 1rem;
  line-height: 1.8;
  margin: 1rem 0;
}

.book-cover {
  text-align: center;
  margin: 2rem auto 1rem;
}

.book-cover img {
  max-width: 250px;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.book-cover img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}

.book-not-found {
  text-align: center;
  padding: 2rem;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  max-width: 600px;
  margin: 4rem auto;
}

.amazon-info a{
	font-weight: bold;
	color: #333;
}

/* Amazon Button - Matches Contact Form */
.amazon-link {
  display: block;               /* Makes it block for centering */
  margin: 1.5rem auto 0 auto;   /* Center horizontally */
  background: linear-gradient(135deg, #5a8dee, #3b6dd9);
  color: #fff;
  padding: 1rem 2.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  max-width: 300px;            /* Restrict width on large screens */
  width: 100%;                 /* Full width on small screens */
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
  box-shadow: 0 5px 12px rgba(0,0,0,0.15);
  text-decoration: none;        /* Remove underline */
}

.amazon-link i {
  margin-right: 0.5rem;
}

.amazon-link:hover {
  background: linear-gradient(135deg, #3b6dd9, #5a8dee);
  transform: translateY(-3px);
  box-shadow: 0 7px 15px rgba(0,0,0,0.2);
}

.amazon-link:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

/* ============================
   SECTIONS (ABOUT, PRIVACY, TERMS)
============================ */
#about-section, #privacy-section, #terms-section, .book-detail {
  background-color: #fff;
  padding: 3rem 2rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  max-width: 1000px;
  margin: 3rem auto;
  line-height: 1.7;
  color: #333;
  animation: fadeIn 0.8s ease-in-out;
}

#about-section h1,
#privacy-section h1,
#terms-section h1,
.book-detail h1 {
  font-size: 2rem;
  text-align: center;
  margin-bottom: 1.5rem;
  color: #222;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #ccc;
  display: inline-block;
  padding-bottom: 0.5rem;
}

/* About Image */
#about-section .img-container {
  text-align: center;
  margin-bottom: 2rem;
}

#about-section .img-container img {
  max-width: 280px;
  width: 100%;
  border-radius: 50%;
  border: 5px solid #eee;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  transition: transform 0.3s, box-shadow 0.3s;
}

#about-section .img-container img:hover {
  transform: scale(1.03);
  box-shadow: 0 6px 14px rgba(0,0,0,0.2);
}

#about-section p {
  font-size: 1.1rem;
  color: #444;
  margin-bottom: 1.5rem;
  line-height: 1.8;
  text-align: justify;
}

#about-section em {
  font-style: italic;
  color: #222;
  font-weight: 700;
}

/* Terms & Privacy Text */
.terms-text h3, 
.privacy-text h3 {
  color: #444;
  margin-top: 1.5rem;
  font-size: 1.3rem;
}

.terms-text ul, 
.privacy-text ul {
  margin: 0.5rem 0 1.5rem 1.5rem;
  padding-left: 1rem;
}

.terms-text ul li,
.privacy-text ul li {
  margin-bottom: 0.5rem;
}

.terms-text p,
.privacy-text p {
  margin-bottom: 1rem;
}

/* ============================
   CONTACT FORM
============================ */
#contact-section {
  max-width: 900px;
  margin: 3rem auto 4rem;
  padding: 2rem;
  background-color: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 15px rgba(0,0,0,0.1);
  text-align: left;
  color: #333;
  line-height: 1.7;
}

#contact-section h1 {
  font-size: 2rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid #ccc;
  display: inline-block;
  padding-bottom: 0.5rem;
  margin-bottom: 1.5rem;
  color: #222;
}

#contact-section h3 {
  font-size: 1.5rem;
  color: #222;
  margin: 1rem 0 1.5rem;
}

#contact-section p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 1.5rem;
}

.contact-form-card {
  background-color: #fafafa;
  padding: 2rem;
  border-radius: 8px;
  box-shadow: 0 1px 8px rgba(0,0,0,0.05);
  margin-bottom: 2rem;
}

.contact-form .form-group {
  margin-bottom: 1.2rem;
}

.contact-form label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.4rem;
  color: #444;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.8rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  font-size: 1rem;
  transition: all 0.3s;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: #666;
  box-shadow: 0 0 6px rgba(0,0,0,0.1);
  outline: none;
}

.contact-form button {
  display: block;
  margin: 1.5rem auto 0 auto;
  background: linear-gradient(135deg, #5a8dee, #3b6dd9);
  color: #fff;
  padding: 1rem 2.5rem;
  font-size: 1.15rem;
  font-weight: 600;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  text-align: center;
  max-width: 300px;
  width: 100%;
  transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
  box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

.contact-form button:hover {
  background: linear-gradient(135deg, #3b6dd9, #5a8dee);
  transform: translateY(-3px);
  box-shadow: 0 7px 15px rgba(0,0,0,0.2);
}

.contact-form button:active {
  transform: translateY(0);
  box-shadow: 0 5px 12px rgba(0,0,0,0.15);
}

/* Map Styling */
.mapouter {
  margin-top: 2rem;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.gmap_canvas iframe {
  width: 100%;
  height: 400px;
  border: 0;
}

/* ============================
   404 PAGE
============================ */
#error-section {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 70vh;
  padding: 2rem;
}

.error-container {
  background: #fff;
  padding: 3rem 4rem;
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  text-align: center;
  max-width: 600px;
  width: 100%;
}

.error-container h1 {
  font-size: 5rem;
  color: #333;
  margin: 0;
  line-height: 1;
}

.error-container h2 {
  font-size: 1.8rem;
  color: #444;
  margin: 1rem 0;
}

.error-container p {
  font-size: 1rem;
  color: #555;
  margin-bottom: 2rem;
}

/* Reuse back-button style */
.back-button {
  display: inline-flex;
  align-items: center;
  background-color: #444;
  color: white;
  padding: 0.8rem 1.5rem;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  transition: background 0.3s;
}

.back-button:hover {
  background-color: #666;
}

.back-button i {
  margin-right: 0.5rem;
}

/* ============================
   SWIPER & LIGHTBOX
============================ */
.swiper {
  max-width: 1000px;
  margin: 2rem auto;
}

.swiper-slide img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  border-radius: 8px;
  cursor: pointer;
}

.swiper-button-next,
.swiper-button-prev {
  color: #FFF !important;
  font-weight: 700 !important;
}

.swiper-pagination.swiper-pagination-bullet-active {
  color: #FFF !important;
}

.lb-close,
.lb-prev,
.lb-next {
  display: block !important;
  z-index: 99999 !important;
}

/* ============================
   ANIMATIONS
============================ */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================
   RESPONSIVE
============================ */
@media (max-width: 1024px) {
	/* Header */
	.header-inner { display: unset; }
	.logo-link { left: unset; position: relative; }
	.site-header h1 { font-size: 1.5rem; font-weight: 500; }
	
  /* Reduce section padding/margin */
  #about-section,
  #terms-section,
  #privacy-section,
  #contact-section,
  .book-detail {
    padding: 2rem 1.5rem;
    margin: 2.5rem auto;
  }

  .book-grid {
    gap: 1.5rem;
  }

  .book-box {
    flex: 0 1 calc(50% - 1.5rem); /* Two per row on tablets */
    max-width: 100%;
  }

  .contact-form-card,
  .carousel,
  .book-cover {
    margin-bottom: 1.5rem;
  }

  .gmap_canvas iframe {
    height: 300px;
  }
}

@media (max-width: 768px) {
  /* Stack book boxes, reduce section padding */
  #about-section,
  #terms-section,
  #privacy-section,
  #contact-section,
  .book-detail {
    padding: 1.5rem 1rem;
    margin: 2rem auto;
  }

  .book-grid {
    gap: 1rem;
  }

  .book-box {
    flex: 0 1 100%;
    max-width: 100%;
  }

  .contact-form button,
  .amazon-link {
    width: 100%;
    max-width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
  }

  .gmap_canvas iframe {
    height: 250px;
  }

  #contact-section p,
  #about-section p,
  .book-detail p {
    font-size: 0.95rem;
    margin-bottom: 1rem;
  }

  h1, h2, h3 {
    font-size: 1.6rem;
  }

  .book-cover img {
    max-width: 200px;
  }

  .swiper-slide img {
    height: 140px;
  }
  
  .footer-top {
    flex-direction: column;
    align-items: center;
    gap: 1rem;
  }

  .footer-menu {
    justify-content: center;
  }

  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
  }

  .footer-copy,
  .footer-legal {
    text-align: center;
  }

  .kofi-button img {
    height: 44px;
  }
}

@media (max-width: 600px) {
  /* Footer stacking */
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }

  .footer-copy,
  .footer-legal {
    text-align: center;
    padding: 0.25rem;
  }

  /* Buttons full width */
  .contact-form button,
  .amazon-link,
  .back-button {
    width: 100%;
    padding: 1rem 1.5rem;
    font-size: 1.05rem;
    text-align: center;
  }

  /* Reduce card margins/padding */
  .contact-form-card,
  .book-cover,
  .carousel {
    margin-bottom: 1rem;
  }

  /* Carousel images smaller */
  .swiper-slide img {
    height: 120px;
  }

  .error-container {
    padding: 1.5rem 1rem;
  }

  .error-container h1 {
    font-size: 3.5rem;
  }

  .error-container h2 {
    font-size: 1.4rem;
  }
}

@media (max-width: 500px) {
	/* Header */
	.header-inner { display: unset; }
	.logo-link { left: unset; position: relative; }
	.site-header h1 { font-size: 1rem; font-weight: 500; }
	
	/* Books */
	main { padding: 0.7rem; }
	#about-section, #terms-section, #privacy-section, #contact-section, .book-detail { margin: 0.6rem; }  
	#about-section h1, #privacy-section h1, #terms-section h1, #contact-section h1, .book-detail h1 { font-size: 1.5rem; margin-bottom: 0; }
	.swiper { margin: 0; }
	
	/* About */
	#about-section .img-container img { margin-top: 10px; }
}
