:root {
  --accent-gold: #c5a059;
  --text-parchment: #d1ccc0;
  --border-edge: rgba(197, 160, 89, 0.25);
  --glow: rgba(197, 160, 89, 0.1);
  --ink-black: rgba(10, 10, 12, 0.20); /* Dark overlay for readability */
}

* {
  box-sizing: border-box;
}

body {
  font-family: "Georgia", serif;
  margin: 0;
  color: var(--text-parchment);
  /* The Wallpaper: Tiles the floral pattern behind a dark tint */
  background: 
    linear-gradient(var(--ink-black), var(--ink-black)),
    url('floralbg1.jpg');
  background-repeat: repeat;
  background-attachment: fixed;
}

header {
  text-align: center;
  padding: 4rem 1rem 3rem;
  /* Fades from black into the floral wallpaper */
  background: linear-gradient(to bottom, #000 0%, transparent 100%);
}
header h1 {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px; /* Space between the big logo and the text */
}
.logo-mobile {
  display: block;
  max-width: 200px; /* Adjust this to your preference for mobile */
  height: auto;
  /* Adds a subtle glow to the gold logo to match your text-shadow */
  filter: drop-shadow(0 0 10px rgba(197, 160, 89, 0.3));
}

.logo-desktop {
  display: none;
}

/* Desktop View (768px and wider) */
@media (min-width: 768px) {
  header h1 {
    flex-direction: row;
    justify-content: center;
    gap: 0;
  }

  .logo-mobile {
    display: none;
  }

  .logo-desktop {
    display: inline-block;
    height: 1.4em; /* Slightly larger than the text for an elegant look */
    margin-right: 20px;
    vertical-align: middle;
    filter: drop-shadow(2px 2px 4px rgba(0,0,0,0.5));
  }
}

/* Adjusting your existing mobile media query */
@media (max-width: 600px) {
  h1 { 
    font-size: 1.8rem; 
    letter-spacing: 2px;
  }
  .header-text {
    text-align: center;
  }
}


h1 {
  margin: 0;
  font-size: 3rem;
  letter-spacing: 5px;
  color: var(--accent-gold);
  text-transform: uppercase;
  text-shadow: 2px 2px 10px rgba(0,0,0,0.8), 0 0 20px var(--glow);
}

header p {
  margin-top: 10px;
  color: #777;
  font-style: italic;
  letter-spacing: 2px;
}

/* --- THE DESK CONTROLS --- */
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
  justify-content: center;
  padding: 20px;
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(10, 10, 12, 0.8);
  backdrop-filter: blur(10px); /* Makes the floral pattern blurry behind search */
  border-bottom: 1px solid var(--border-edge);
}

select {
  max-width: 100%;       /* Prevents it from pushing past the screen edge */
  text-overflow: ellipsis; 
  white-space: nowrap;
  overflow: hidden;
}

.controls select, .controls input {
  flex: 1 1 280px; /* Allows them to grow, but they'll wrap to a new line at 280px */
  min-width: 0;    /* Critical fix for flexbox and select elements */
}

@media (max-width: 600px) {
  select#authorFilter {
    width: 100%;         /* Makes it take up the full width of the container on mobile */
  }
}

input, select {
  padding: 12px 15px;
  background: #1a1a1a;
  color: var(--accent-gold);
  border: 1px solid var(--border-edge);
  font-family: inherit;
  font-size: 1rem;
  transition: all 0.3s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--accent-gold);
  box-shadow: 0 0 15px var(--glow);
}

/* --- THE LEATHER BOOKS --- */
#bookContainer {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  padding: 40px 20px;
  gap: 2px;
  max-width: 1400px;
  margin: 0 auto;
}

.book {
  position: relative;
  padding: 0.5rem 2rem 0.5rem;
  border: 1px solid var(--border-edge);
  transition: all 0.4s cubic-bezier(0.17, 0.67, 0.83, 0.67);
  
  /* The Leather: Covers the card perfectly */
  background: 
    linear-gradient(rgba(0,0,0,0.6), rgba(0,0,0,0.75)), 
    url('leatherbg.jpg');
  background-size: cover;
  background-position: center;
  
  /* Give the "book" some physical thickness */
  box-shadow: 
    8px 8px 20px rgba(0,0,0,0.8),
    inset 0 0 50px rgba(0,0,0,0.5);
}

.book:hover {
  transform: translateY(-10px) rotate(-1deg); /* Slight tilt like a real book */
  border-color: var(--accent-gold);
  box-shadow: 12px 20px 40px rgba(0,0,0,0.9), 0 0 20px var(--glow);
}

.book-number {
  position: absolute;
  top: 15px;
  left: 15px;
  font-size: 0.7rem;
  color: var(--accent-gold);
  opacity: 0.6;
  font-family: 'Courier New', monospace; /* Looks like a library stamp */
}

.title {
  font-size: 1.25rem;
  font-weight: bold;
  color: #fff;
  margin-bottom: 8px;
  line-height: 1.2;
  text-shadow: 2px 2px 4px #000;
}

.author {
  font-size: 1rem;
  color: var(--text-parchment);
  opacity: 0.8;
  font-style: italic;
  text-shadow: 1px 1px 2px #000;
}

.genre {
  margin-top: 20px;
  font-size: 0.7rem;
  color: var(--accent-gold);
  text-transform: uppercase;
  letter-spacing: 3px;
  border-top: 1px solid var(--border-edge);
  padding-top: 3px;
}

footer {
  text-align: center;
  padding: 80px 20px;
  color: #444;
  letter-spacing: 5px;
  text-transform: uppercase;
  font-size: 0.8rem;
}

/* Mobile Adjustments */
@media (max-width: 600px) {
  h1 { font-size: 2rem; }
  #bookContainer { padding: 20px 10px; }
}



