html {
  scroll-behavior: smooth;
}
/* Hero Background Image with Fade */
#hero {
  position: relative;
  overflow: hidden;
}
/* Navbar style transition on scroll */
.navbar {
  transition: background-color 0.4s, box-shadow 0.4s;
  background-color: rgba(0, 0, 0, 0.9);
}

.navbar.scrolled {
  background-color: #000 !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

/* Hero background layer (optional) */
.hero-bg {
  position: absolute;
  inset: 0;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), rgba(0, 0, 0, 0.7)), 
              url('../images/jerry-kavan-sGJomXn2Pu8-unsplash.jpg') no-repeat center center;
  background-size: cover;
  z-index: 0;
}


#hero .container {
  z-index: 1;
}

#hero h1,
#hero p {
  text-shadow: 1px 1px 3px rgba(0, 0, 0, 0.6);
}
.card img {
  height: 300px;
  object-fit: cover;
}
.card-img-top {
  width: 100%;        /* take full width of the card */
  height: auto;       /* scale height proportionally */
  object-fit: contain; /* show full image without cropping */
}

/* Make nav links white and add spacing */
.navbar-nav .nav-link {
  color: #fff !important;
  margin: 0 12px; /* spacing between links */
  font-weight: 500;
  transition: color 0.3s ease;
  margin-left: 1rem;
  margin-right: 1rem;
}

.navbar-nav .nav-link:hover {
  color: #f8f9fa !important;
  text-decoration: underline;
}

.poem-text {
  overflow: hidden;
  transition: max-height 0.5s ease;
  max-height: 150px; /* height when collapsed */
}

.poem-text.expanded {
  max-height: 2000px; /* big enough to fit full poem */
}

#poetry .card {
  border-radius: 1rem;
  background-color: #fff;
  transition: transform 0.3s ease;
}

#poetry .card:hover {
  transform: translateY(-5px);
}

#about-author img {
  border: 5px solid #f0f0f0;
}

@media (max-width: 768px) {
  .navbar-nav .nav-link {
    margin: 10px 0;
    text-align: center;
  }
}
.card-img-top {
  height: 250px;
  object-fit: cover;
}

@media (max-width: 768px) {
  .card-img-top {
    height: 200px;
  }
}
@media (max-width: 768px) {
  #about .row {
    text-align: center;
  }

  #about img {
    margin-bottom: 1rem;
  }
}
footer .row > div {
  margin-bottom: 1rem;
}

@media (max-width: 768px) {
  footer .text-md-start {
    text-align: center !important;
  }

  footer ul {
    padding-left: 0;
  }

  footer li {
    margin-bottom: 0.5rem;
  }
}
@media (max-width: 576px) {
  h1, h2, h3 {
    font-size: 90%;
  }

  .lead {
    font-size: 1rem;
  }

  .btn {
    font-size: 0.9rem;
  }
}
/* Target the scroll container */
#poetryScroll > .d-flex {
  overflow-x: scroll;
  scrollbar-width: none;  /* Firefox */
  -ms-overflow-style: none;  /* IE 10+ */
}

/* Hide scrollbar for Webkit browsers (Chrome, Safari) */
#poetryScroll > .d-flex::-webkit-scrollbar {
  display: none;
}

.poetry-text {
  height: 600px; /* Set desired fixed height for poem area */
  overflow: hidden; /* Or use scroll for long poems: overflow: auto; */
  text-overflow: ellipsis;
}

.card-body {
  display: flex;
  flex-direction: column;
}

.card-title {
  margin-bottom: 0.5rem;
}
.poem-text {
  max-height: 6em; /* show about 4 lines */
  overflow: hidden;
  transition: max-height 0.4s ease;
}

.poem-text.collapsed {
  max-height: 6em;
}

.poem-text:not(.collapsed) {
  max-height: 1500px; /* large enough for full content */
}
button.read-more-btn.btn.btn-link {
  color: #0d6efd;
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 30px;
  background-color: #e7f1ff;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
  border: none;
  cursor: pointer;
  transition: 
    background-color 0.3s ease,
    color 0.3s ease,
    box-shadow 0.3s ease,
    transform 0.2s ease;
  text-decoration: none !important; /* remove underline */
  user-select: none;
  outline: none;
}

button.read-more-btn.btn.btn-link:hover,
button.read-more-btn.btn.btn-link:focus {
  background-color: #0d6efd;
  color: white;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.6);
  transform: scale(1.05);
  text-decoration: none !important; /* remove underline on hover */
}

button.read-more-btn.btn.btn-link:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
}
.read-more-btn {
  color: #0d6efd;
  font-weight: 600;
  font-size: 1rem;
  padding: 6px 14px;
  border-radius: 30px;
  background-color: #e7f1ff;
  border: none;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(13, 110, 253, 0.3);
  transition: background-color 0.3s ease, color 0.3s ease, box-shadow 0.3s ease, transform 0.2s ease;
  text-decoration: none;
  user-select: none;
  outline: none;
  display: inline-block;
  margin-top: auto;
  align-self: start;
}

.read-more-btn:hover,
.read-more-btn:focus {
  background-color: #0d6efd;
  color: white;
  box-shadow: 0 4px 12px rgba(13, 110, 253, 0.6);
  transform: scale(1.05);
  text-decoration: none;
}

.read-more-btn:active {
  transform: scale(0.95);
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.4);
}
.book-img {
  width: 100%;
  height: auto;       /* let the image scale naturally */
  object-fit: cover; /* ensure full image is visible */
}

/* Mobile responsive */
@media (max-width: 768px) {
  .book-img {
    height: 100vw; /* full width as height to keep aspect ratio */
    max-height: 400px; /* optional max height */
  }
}
/* Fixed height for long poems */
.long-poem {
  max-height: 400px; /* adjust as needed */
  overflow-y: auto;
  padding-right: 8px; /* to prevent scrollbar from overlapping text */
}

/* Optional: hide scrollbar in some browsers but still scrollable */
.long-poem::-webkit-scrollbar {
  width: 6px;
}

.long-poem::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.3);
  border-radius: 3px;
}