/* --------------------------------------------------------------------
   General Body & Header Styles
   -------------------------------------------------------------------- */
body {
  margin: 0;
  padding: 0;
  background: url('Background.png') no-repeat center center fixed;
  background-size: cover;
  font-family: 'Georgia', serif;
  color: #5a4e4b;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  overflow-x: hidden;
}

html {
  overflow-x: hidden;
}

body::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(250, 235, 215, 0.7);
  z-index: -1;
}

header {
  width: 100%;
  text-align: center;
  padding: 50px 20px;
  background: rgba(0, 0, 0, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

header img {
  display: block;
  margin: 0 auto;
  width: 50vw;
  max-width: 1000px;
}

header p {
  font-size: 22px;
  color: #B727C4;
  margin-top: 10px;
  text-align: center;
}



/* ?? Button Hover Effect */
.button-container a:hover {
  background-color: #68156F;
}


/* --------------------------------------------------------------------
   Book Review Section
   -------------------------------------------------------------------- */
.book-review {
  width: 100%;
  box-sizing: border-box;
}

/* 
   book-details = the 2-column container (cover on left + info on right)
   We'll make it responsive with media queries so on mobile it becomes
   stacked vertically.
*/
.book-details {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  max-width: 1000px;
  margin: 20px auto;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  gap: 20px; /* space between left (cover) and right (info) */
}

/* Left side: cover-section */
.cover-section {
  flex: 0 0 auto; /* don't stretch - keeps the cover from growing too wide */
  display: flex;
  flex-direction: column;
  align-items: center; /* center the cover, purchase, spice in that column */
  gap: 10px; /* small space between cover and purchase/spice items */
}

.book-cover {
  width: 250px;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  border: 3px solid black;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Container now stacked: top row for spice/purchase, then social share below */
.purchase-spice {
  display: flex;
  flex-direction: column;   /* stack children vertically */
  align-items: center;      /* center them horizontally */
  gap: 15px;                /* space between .top-row and .social-share */
}

/* Row holding Spice Box & Purchase Box side by side */
.top-row {
  display: flex;
  flex-direction: row;
  align-items: center; 
  justify-content: center; /* center them horizontally */
  gap: 15px;
}

.purchase-button {
  display: inline-block;
  background-color: rgb(5, 154, 144); /* matches your existing button color */
  color: #ffffff;
  padding: 8px 15px;
  font-size: 16px;
  font-family: 'Garamond', serif; /* or whichever font you prefer */
  border-radius: 8px;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s;
  font-weight: bold;
}

.purchase-button:hover {
  background-color: #d1537a; /* your hover color */
}


.purchase-box p,
.spice-box p {
  margin: 0;
  padding: 0;
  font-size: 16px;
  color: #fff;
}

.purchase-box a {
  color: #FFFFFF;
  text-decoration: none;
  font-weight: bold;
}

.purchase-box a:hover {
  color: #fff;
  text-decoration: underline;
}

/* Spice image + text in a small box */
.spice-box {
  display: flex;
  align-items: center;
  gap: 5px;
}

.spice-image {
  height: auto;
}

.spice-number {
  font-size: 16px;
  color: #ffffff;
  font-weight: bold;
  margin: 0;
}

/* Right side: info-section */
.info-section {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 15px; /* space between info boxes */
}

/* Info boxes (Title, Author, Genre, etc.) */
.info-box {
  position: relative;
  font-size: 18px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 5px;
  border: 2px solid #000000;
  text-align: left; 
	 width:100%;             /* let it stretch, then padding/border apply */
    box-sizing:border-box;  /* include the border in that 100% width    */
}

/* The "floating label" above each info-box */
.info-box::before {
  content: attr(data-label);
  position: absolute;
  top: -32px;
  left: 15px;
  transform: none;
  background-color: #059A90;
  color: #ffffff;
  font-size: 16px;
  padding: 3px 10px;
  border-radius: 10px;
  border: 4px solid #000000;
  font-weight: bold;

  /* Prevent vertical expansion */
  white-space: nowrap;         /* single line only */
  overflow: hidden;            /* hide overflow if text is too long */
  text-overflow:clip;     /* show "..." if truncated */
  max-width: 400px;            /* pick a suitable width for your layout */
  display: inline-block;       /* needed for max-width + ellipsis to work */
}


/* --------------------------------------------------------------------
   Tropes
   -------------------------------------------------------------------- */
.trope-details {
  max-width: 1000px;
  margin: 20px auto;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
  text-align: center;
}

.trope-details h3 {
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 10px;
  border-bottom: 2px solid #059A90;
  padding-bottom: 5px;
}

.trope-images {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  justify-content: center;
  margin-top: 10px;
  padding: 10px;
}

.trope-images img {
  width: 150px;
  height: auto;
  border-radius: 8px;
  border: 2px solid #059A90;
  padding: 3px;
  background-color: rgba(255, 255, 255, 0.1);
}

/* --------------------------------------------------------------------
   3 Sentence Summary, Why Recommend, Trigger Warnings
   -------------------------------------------------------------------- */
.plot-summary,
.my-thoughts,
.trigger-warnings {
  max-width: 1000px;
  margin: 20px auto;
  background-color: rgba(0, 0, 0, 0.8);
  padding: 20px;
  border-radius: 15px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
	text-align: center;
}

.plot-summary h3,
.my-thoughts h3,
.trigger-warnings h3 {
  font-size: 20px;
  color: #ffffff;
  margin-bottom: 5px;
  border-bottom: 2px solid #059A90;
  padding-bottom: 5px;
}

.plot-summary p,
.my-thoughts p,
.trigger-warnings p {
  font-size: 18px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px;
  border-radius: 5px;
  border: 2px solid #000000;
  text-align: center;
}


/*  Search Bar Container */
.search-container {
    position: relative;
    text-align: center;
    margin: 20px auto;
    width: 100%;
    max-width: 300px;
}

/*  Search Input */
#search-box {
    width: 100%;
    padding: 10px;
    font-size: 18px;
    font-family: 'Georgia', serif;
    border-radius: 5px;
    border: 2px solid #3b2f2f;
    background-color: #2e1f1f;
    color: #f4f0e6;
    text-align: center;
}

/* Search Results Dropdown */
#search-results {
    position: absolute;
    width: 100%;
    background-color: #2e1f1f;
    
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 1000;
}

/* Search Result Item */
.search-result {
    padding: 10px;
    color: #f4f0e6;
    font-size: 16px;
    font-family: 'Georgia', serif;
    border-bottom: 1px solid #3b2f2f;
    cursor: pointer;
}

.search-result:hover {
    background-color: #453534;
}




/* Container for the 3 social icons in the header */
.header-social-icons {
  display: flex;            /* Lay them out in a row */
  align-items: center;      /* Vertically center them */
  justify-content: center;  /* Center the group horizontally */
  gap: 10px;                /* Spacing between icons */
  margin-top: 10px;         /* Optional, to add space above */
}

/* Generic styling for the social buttons */
.share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: transform 0.2s;
}

/* Hover effect */
.share-btn:hover {
  transform: scale(1.05);
}

/* Icon images themselves */
.social-icon {
  width: 40px;
  height: 40px;
  display: block;
}


/* Container that holds the jalapeño + tooltip */
.spice-tooltip {
  position: relative;
  display: inline-block; 
  cursor: pointer;
}

/* The hidden tooltip text (multi-line) */
.tooltip-text {
  visibility: hidden;
  opacity: 0;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 110%;
  background-color: rgba(0,0,0,0.85);
  color: #fff;
  text-align: left;
  border-radius: 6px;
  padding: 10px;
  width: 250px;    /* Enough width for multiline, tweak as desired */
  max-width: 300px;/* or a max if you want */
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 999;
  transition: opacity 0.3s, visibility 0.3s;
  font-size: 14px; 
  line-height: 1.4; /* helps multiline spacing */
  /* NO white-space: nowrap; or overflow: hidden; or text-overflow! */
}

.spice-tooltip:hover .tooltip-text {
  visibility: visible;
  opacity: 1;
}

/* The heading part (centered, different background) */
.tooltip-header {
  text-align: center;
  background: #B727C4;         /* or whichever color you want */
  padding: 5px;
  margin: -10px -10px 10px -10px; 
    /* This trick extends the header’s background horizontally 
       beyond the normal padding, so it looks like a separate bar across the top. 
       We assume the parent .tooltip-text has 10px padding on each side, 
       so negative margins align them. Tweak as needed. */
  border-radius: 6px 6px 0 0; 
    /* top corners if we want to match .tooltip-text's radius */
  font-weight: bold;
}

/* Optional separate body styles (slightly smaller text, etc.) */
.tooltip-body {
  font-size: 14px;
  line-height: 1.4;
}

/* === reviewer avatars row ===================================== */
.reviewers-row{
  display:flex;
  flex-wrap:wrap;
  justify-content:center;
  align-items:center;
  gap:12px;
  margin-top:10px;
}

.reviewer-avatar{
  width:60px;
  height:60px;
  border-radius:50%;
  object-fit:cover;
  border:2px solid #059A90;
}

.reviewer-avatar:hover{
  transform:scale(1.05);
}

#book-summary,
#book-recommendation,
#book-triggers {
  white-space: pre-wrap;  
}

/* 1) give .book-details a positioning context */
.book-details{position:relative;}

/* 2) vertical avatar column pinned top-right */
.reviewers-row{
  position:absolute;top:10px;right:12px;
  display:flex;flex-direction:column;align-items:flex-end;gap:10px;
}

/* 3) avatar ring style — white inner, black outer */
.reviewer-avatar{
  width:54px;height:54px;border-radius:50%;object-fit:cover;
  padding:1px;background:#fff;border:4px solid #000;
  box-shadow:0 0 6px rgba(0,0,0,.6);transition:transform .2s;
}
.reviewer-avatar:hover{transform:scale(1.05);}

/* 4) tooltip */
.tooltip-container-rev{position:relative;cursor:pointer;}
.tooltip-text-rev{
  visibility:hidden;opacity:0;
  position:absolute;bottom:110%;left:50%;transform:translateX(-50%);
  background:rgba(0,0,0,.9);color:#fff;font:18px 'Georgia',serif;
  padding:6px 14px;border-radius:6px;white-space:nowrap;z-index:999;
  transition:opacity .2s,visibility .2s;
  box-shadow:0 0 0 2px #B727C4;
}
/* show on hover (desktop) */
@media (hover:hover){
  .tooltip-container-rev:hover .tooltip-text-rev{
    visibility:visible;opacity:1;
  }
}
/* show on tap (mobile) — JS toggles .visible */
.tooltip-text-rev.visible{visibility:visible;opacity:1;}



/* --------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------- */
footer {
  padding: 30px;
  text-align: center;
  background-color: black;
  border-top: 2px solid white;
}

footer p {
  color: white;
}

footer a {
  color: white;
  text-decoration: none;
}

footer a:hover {
  color: #d1537a;
}

/* --------------------------------------------------------------------
   RESPONSIVENESS (MEDIA QUERIES)
   For smaller screens, we'll stack .cover-section over .info-section
   -------------------------------------------------------------------- */
@media (max-width: 768px) {
  .book-details {
    flex-direction: column;
    align-items: center; /* center everything in column layout */
  }

  /* Center text inside info-box if you prefer, or keep left. Up to you. */
  .info-box {
    text-align: center;
  }

  .info-box::before {
    left: 50%;
    transform: translateX(-50%);
  }

  /* Purchase + Spice can stack or shrink accordingly */
  .purchase-spice {
    flex-direction: column; /* stacked in mobile */
    gap: 5px;
  }
}
