@import url('https://fonts.googleapis.com/css2?family=Rubik:ital,wght@0,300..900;1,300..900&display=swap');

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Rubik", sans-serif;
}

body {
  min-height: 100vh;
  background-color: #E6E6E9;
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  padding: 20px clamp(12px, 4vw, 20px);
  display: flex;
  justify-content: right;
  align-items: center;
  z-index: 100;
  transition: transform 0.3s ease-in-out;
  background-color: rgba(230, 230, 233, 0.9);
}

/* Always a single, non-wrapping row - font size and gap scale fluidly
   with viewport width instead of jumping at one fixed breakpoint, so
   the links never spill onto a second row on phones. */
.navbar {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: clamp(8px, 2.5vw, 25px);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}

.navbar::-webkit-scrollbar {
  display: none;
}

.navbar a {
  position: relative;
  flex: 0 0 auto;
  font-size: clamp(12px, 3.8vw, 18px);
  color: #3C4F76;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
}

.navbar a::before {
  content: '';
  position: absolute;
  top: 100%;
  left: 0;
  width: 0%;
  height: 2px;
  background: #3C4F76;
  transition: .3s;
}

.navbar a:hover::before {
  width: 100%;
}

.navbar a.active {
  font-weight: 700;
}

.navbar a.active::before {
  width: 100%;
}

.header.hidden {
  transform: translateY(-100%);
}
  
  .container {
    max-width: 850px;
    margin: 40px auto 0;
    padding: 20px ;
    text-align: center;
  }
  h1 {
    font-size: 50px;
    color: #333;
  }
  .poem {
    margin-top: 40px;
    text-align: left;
    background-color: #fff;
    border-radius: 20px;
    padding: 20px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  }
  .poem-title {
    font-size: 24px;
    font-weight: bold;
    color: #333;
  }
  .poem-content {
    margin-top: 10px;
    font-size: 18px;
    color: #666;
  }
  .poem-date {
    font-size: 14px;
    color: #999;
    text-align: right;
    margin-top: 10px;
  }
  
.poem-image {
  max-width: 600px;   /* same as before — keeps image nicely scaled */
  width: 100%;        /* makes it responsive to screen width */
  margin: 1em auto;   /* centers both image + caption */
}

.poem-image img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

  
.image-caption {
  font-size: 0.7em;       /* smaller text */
  color: grey;             /* grey text */
  text-align: left;       /* aligns it to the right edge */
  margin-top: 0.1em;
  margin-bottom: 1em;      /* space before next section */
  font-style: italic;      /* optional, looks elegant for captions */
}

.poem-image figcaption {
  font-size: 0.9em;
  color: grey;
  font-style: italic;
  margin-top: 0.3em;
  text-align: left;  /* aligns to the same edge as the image */
}

@media screen and (max-width: 600px) {
    .topnav a, .topnav-right {
      float: none;
      display: block;
    }
  
    .topnav-centered a {
      position: relative;
      top: 0;
      left: 0;
      transform: none;
    }
  }
