/* Global Reset */
html, body, div, ul, li, h1, h2, p, a {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font-family: inherit;
    vertical-align: baseline;
    
}

body {
    width: 100%;
    overflow-x: hidden;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    color: #000;
    background-color: #fff;
    text-align: left;
}
p {
  margin-bottom: 10px;
}
a {
    color: #0000FF;
    text-decoration: underline;
}

a:hover {
    color: #0000FF;
    text-decoration: underline;
}

a:active {
    color: #EE0000;
    text-decoration: underline;
}

.clearfix::after {
    content: "";
    display: table;
    clear: both;
}

/* Layout */

.auto-grid {
display: grid;
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: minmax(200px, auto); /* Let text determine row height */
align-items: start; /* Align items at top of grid cells */
gap: 1rem;
}
.grid-box {
  display: flex;
  flex-direction: column;
}
.grid-box img {
  max-width: 100%;
  max-height: none; 
  height: auto;
  object-fit: contain;
  display: block;
}


/* Grid item positioning */
.grid-box-1 {
  grid-column: 1 / 3; /* Spans columns 1-2 */
  grid-row: 1;
}

.grid-box-2 {
  display: flex;
  flex-direction: column;
  align-items: center; /* Forces the box to match row height */
  justify-content: center;
  overflow: visible; /* Prevent image overflow */
  height: auto !important; /* Ensure it respects row height */
  min-height: 450px; /* Restrict growth */
  /* border: 2px solid red; */
}
.grid-box-2 img {
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 100% !important;
  object-fit: contain !important;
  display: block;
  /* border: 2px solid blue; */
}
.grid-box-3 {
  grid-column: 1; /* Column 1 */
  grid-row: 2;
}
.grid-box-4 {
  grid-column: 2 / 4; /* Spans columns 2-3 */
  grid-row: 2;
}

.grid-box-5 {
  grid-column: 1 / 3; /* Spans columns 1-2 */
  grid-row: 3;
}

.grid-box-6 {
  grid-column: 3; /* Column 3 */
  grid-row: 3;
}
/* --- Image Containers --- */
.grid-box-2, .grid-box-3, .grid-box-6 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: visible; /* Prevent image overflow */
  height: auto; /* Ensure it respects row height */
  max-height: 500px; /* Restrict growth */
}


/* Text container styling */
.grid-box-1, .grid-box-4, .grid-box-5 {
  grid-column: span 2;
  background: #f8f8f8;
  padding: 20px;
  min-height: 200px; /* Base height on text content */
}

.grid-box-3 img,
.grid-box-6 img {
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  object-fit: contain;
  display: block;
}
/* Specific grid positioning */
.grid-box-1 { grid-area: 1 / 1 / 2 / 3; }
.grid-box-2 { grid-area: 1 / 3 / 2 / 4; }
.grid-box-3 { grid-area: 2 / 1 / 3 / 2; }
.grid-box-4 { grid-area: 2 / 2 / 3 / 4; }
.grid-box-5 { grid-area: 3 / 1 / 4 / 3; }
.grid-box-6 { grid-area: 3 / 3 / 4 / 4; }


#page {
  /* page: relative; */
  width: 100%;
  max-width: 960px;
  margin: 0 auto;
  padding: 20px;
  background-color: transparent;
}

#header {
  display: flex;
  justify-content: center; /* Horizontally center the image */
  align-items: center; /* Vertically center the image */
  margin-bottom: 20px;
  width: 100%; /* Add this */
  max-width: 100vw; /* Prevent overflow */
  overflow: hidden; /* Hide any residual overflow */
}

#header img {
  max-width: 100%;
  height: auto;
  object-fit: contain; /* Maintain aspect ratio */
}

#content {
  margin-bottom: 20px;
}


#pu724-5{
  z-index:45;
  margin-right:-10000px;
  margin-top:24px;
  width:95.51%;
}

#content p {
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;
    margin-right: 10vw;
}
#content > img[alt="Banner with IPPY Medal"] {
  width: 100vw;
  max-width: 100%;
  height: auto;
  display: block;
  margin-left: 50%;
  transform: translateX(-50%);
}
#news-content {
  display: flex;
  flex-wrap: wrap;
  /* justify-content: center; */
  gap: 10px; /* Space between images */
}

#news-content img {
  max-width: 100%;
  height: auto;
  object-fit: contain;
}



/* Main Content Section */
#main-content {
  display: flex;
  flex-wrap: wrap;
  margin-top: 50px; /* Adjust based on the height of the top images */
  margin-left: 80px; /* 20px to the right of the Chaucer Award */
  margin-right: 80px; /* 20px to the left of the IPPY Gold Medal */
}

/* Left Column: Text */
#text-section {
  position: relative;
  min-width: 420px;
  width: min-content;
  max-width: 100%; /* Prevent overflow on small screens */
  flex-shrink: 0; /* Prevent collapsing in flex container */
  background-color: transparent; /* White background for the top text */
  padding: 20px;
  box-sizing: border-box;
  z-index: 1;
}

#top-text {
  color: #000;
  margin-bottom: 20px;
}

#bottom-text {
  background-color: transparent; /* No background for the bottom text */
  color: #FFFFFF;
  box-sizing: border-box;
  position: relative; /* Ensure the bottom text is positioned relative to its container */
  z-index: 1; /* Ensure the text is above the background image */
}
#top-text, #bottom-text {
  font-size: calc(14px + 0.3vw); /* Responsive base size */
  line-height: 1.4; /* Tighter line spacing */
  hyphens: auto; /* Better word breaking */
  overflow-wrap: break-word; /* Prevent overflow */
  margin: 0 20px 10px 0; /* Reduce vertical spacing */
}

/* Right Column: Image */
#image-section {
  width: 40%;
  padding: 20px;
  box-sizing: border-box;
  z-index: 1; 
  align-items: center; /* Center the image vertically */
  justify-content: center; /* Center the image horizontally */
}

#image-section img {
  width: 40vw;
  height: auto;
  min-width: 100%;
}
/* Book Cover Image */
#book-cover-section {
  position: relative;
  text-align: center;
  margin-top: 20px; /* Gap between text/image and book cover */
  z-index: 2;
}

#book-cover-section img {
  width: 150px; /* Adjust as needed */
  height: auto;
}
/* Flex container for bio text and image */
#bio-container {
  display: flex;
  flex-wrap: wrap; /* Allow wrapping on smaller screens */
  margin: 0 20px; /* Add margins on both sides */
  gap: 20px; /* Add space between text and image */
}

/* Bio text section */
#bio-text {
  flex: 1; /* Allow text to take up remaining space */
  min-width: 300px; /* Ensure text doesn't get too narrow */
}

/* Bio image section */
#bio-image {
  flex: 0 0 auto; /* Prevent image from growing */
  width: 450px; /* Set a fixed width for the image */
}

#bio-image img {
  width: 100%;
  height: auto;
  display: block; /* Remove extra space below the image */
}
/* Background Image */
#background-image-container {
  position: absolute;
  top: 0; /* Start below the second paragraph */
  left: 0;
  width: 100vh;
  height: 550px;
  z-index: 0; /* Place behind other content */
  overflow: hidden;
  /* margin-top: 375px; Adjust this value to create a gap between the bottom text and the background image */
}
#background-image {
  width: 100vw;
  height: auto;
  object-fit: cover; /* Ensure the image covers the entire area */

  /* Navigation Menu */
}
#menu {
    position: relative;
    z-index: 1; /* Ensure the menu is above the background image */
    /* background-color: #754C24; */
    padding: 5px;
    text-align: center;
    margin-top: 40px; /* Adjust based on the height of the background image */
    width: 100%;
  
}

#menu ul {
    display: inline-block;
    list-style: none;
    margin: 0;
    padding: 0;
    z-index: 1; /* Ensure it's above other content */
}

#menu li {
    display: inline-block;
    margin: 0 1px;
}

#menu ul li a {
    color: #FFFFFF;
    text-decoration: none;
    padding: 10px 15px;
    display: block;
    background-color: #754C24;
}

#menu ul li a:hover {
    background-color: #999999;
}

#menu ul li a.active {
  background-color: #999999; /* Grey background for the active page */
}
/* Top Left and Right Images */
#chaucer-award {
  position: absolute;
  top: 0;
  left: 0;
  width: 150px; /* Adjust as needed */
  height: auto;
}

#ippy-medal {
  position: absolute;
  top: 0;
  right: 0;
  width: 150px; /* Adjust as needed */
  height: auto;
  transform: translateY(40px); /* Adjust this value as needed */
  z-index: 1000; /* Ensure it's below the hamburger menu */
}
/* Hamburger Menu for Mobile */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  padding: 10px; /* Add some padding for better touch interaction */
  position: fixed; /* Position fixed for top-right corner */
    top: 40px; /* Adjust as needed */
    right: 20px; /* Adjust as needed */
    z-index: 1001; /* Ensure it's above other content */
    background-color: #754C24; /* Add background color for visibility */
    border-radius: 5px; /* Optional: Add rounded corners */
    width: 40px; /* Ensure enough width for the animation */
    height: 30px; /* Ensure enough height for the animation */
    justify-content: center; /* Center the lines vertically */
    align-items: center; /* Center the lines horizontally */
    overflow: visible; /* Ensure the "X" is fully visible */

}
.hamburger div {
  width: 35px;
  height: 5px;
  background-color: white;
  /* position: absolute; */
  left: 50%;
  transform: translateX(-50%);
  transition: all 0.4s ease-in-out;
  transform-origin: center;
}

.hamburger div:nth-child(1) {
  top: 0;
}
.hamburger div:nth-child(2) {
  top: 50%;
  transform: translate(-50%, -50%);
}
.hamburger div:nth-child(3) {
  bottom: 0;
}

.hamburger.active div:nth-child(1),
.hamburger.active div:nth-child(3) {
  width: 50px; /* Ensuring perfect diagonal */
  transform-origin: center;
}

.hamburger.active div:nth-child(1) {
  transform: rotate(-45deg) translate(-5px, 6px);
}
.hamburger.active div:nth-child(2) {
  opacity: 0;
}
.hamburger.active div:nth-child(3) {
  transform: rotate(45deg) translate(-5px, -6px);
}


/* Social Links and Book Cover/Logo Styling */
.social-links {
    margin: 20px 0;
    text-align: left;
  }
  
  .social-links a {
    display: inline-block;
    margin: 0 10px;
  }
  
  .social-links img {
    width: 50px;
    height: auto;
  }
  
  .social-links p {
    font-size: 14px;
    margin-top: 10px;
  }
  
  .social-item {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
  }
  
  .social-item img {
    width: 50px;
    height: auto;
    margin-right: 10px;
  }
  
  .social-item p {
    margin: 0;
    font-size: 14px;
  }

  .book-cover-logo {
    display: flex;
    justify-content: center;
    align-items: center;
    margin: 20px 0;
  }
  
  .book-cover-logo img {
    margin: 0 10px;
    max-width: 200px;
    height: auto;
  }

  /* Two-Column Layout */
.two-column-layout {
    display: flex;
    margin: 0 20px;
  }
  
  .left-column {
    width: 15%;
    margin-right: 20px;
  }
  
  .left-column img {
    width: 100%;
    height: auto;
    margin-bottom: 20px;
  }
  
  .right-column {
    width: 85%;
  }




  /* Ensure "Pelsaert's Nightmare" is always italicized */
em {
    font-style: italic;
  }
 
  @media (max-width: 960px) {
    #news-content img {
        width: 90%; /* Reduce width when viewport gets smaller */
    }
}



@media (max-width: 768px) {
  .hamburger {
    display: flex !important;
    flex-direction: column;
    justify-content: center;
    cursor: pointer;
    align-items: center;
}
#text-section {
  min-width: 420px; /* Slightly smaller for mobile */

  width: 100%; /* Full width on mobile */
}

#news-content img {
  width: 80%;
}

#main-content {
  display: flex;
  flex-wrap: wrap;
  margin-top: 50px; /* Adjust based on the height of the top images */
  margin-left: 50px; /* 20px to the right of the Chaucer Award */
  margin-right: 50px; /* 20px to the left of the IPPY Gold Medal */
}


#menu ul {
    display: none; /* Hide main menu */
}

#menu ul.active {
  display: block !important;
  position: fixed;
  top: 70px; /* Adjust based on hamburger position */
  right: 20px;
  background: #754C24;
  z-index: 1001;
  width: 200px; /* Set appropriate width */
}

#menu ul.active li {
  display: block;
  margin: 5px 0;
}
  .hamburger div {
    width: 20px;
    height: 2px;
    background-color: #FFFFFF;
    margin: 4px 0;
    transition: transform 0.4s, opacity 0.4s; /* Smooth transition */
  
  }
  #header img {
    max-width: 85% !important;
    width: auto !important;
    height: auto;
    padding: 0 10px; /* Add breathing room */
  }

  #chaucer-award {
    position: absolute;
    top: 0;
    left: 0;
    width: 80px; /* Adjust as needed */
    transform: translateY(90px); /* Adjust for smaller screens */
  }
  #background-image {
    width: 100vw;
    min-height: 100vw;
    min-width: 450px;
    object-fit: cover; /* Ensure the image covers the entire area */
  }
  #ippy-medal {
    display: none;
    width: 50px; /* Smaller size for mobile */
    transform: translateY(100px); /* Adjust for smaller screens */
}
@media (max-width: 480px) {
  #news-content img {
      width: 70%;
  }
}

}