/* Reset default margin and padding */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* Change all hyperlink text color to green */
a {
  color: #111; /* black text color */
  text-decoration: none;
}

a:hover {
  color: #2a9d8f; /* green shade on hover */
  text-decoration: underline;
}

body {
  font-family: 'Roboto', Arial, sans-serif;
  background-color: #fff; /* white page background */
  color: #111;
  line-height: 1.6;
  margin: 0;
  padding: 0;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 40px;
  background: #fff; /* white to match page background */
  min-height: calc(100vh - 140px); /* account for header/footer height approx */
  box-sizing: border-box;
}

header {
  width: 100vw;
  background: #fff; /* or your chosen color */
  box-sizing: border-box;
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  left: 0;
  z-index: 100;
}

.inner-header.container {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 56px;
  padding: 0 16px;
  box-sizing: border-box;
}

header h1 {
  font-weight: bold;
  font-size: 1.5rem;
}

.header-logo a {
  color: #111111;           /* Keep text color unchanged */
  text-decoration: none;    /* Remove default underline */
  cursor: pointer;
  transition: text-decoration-color 0.3s ease;
}

.header-logo a:hover,
.header-logo a:focus {
  text-decoration: underline;
  text-decoration-color: #2a9d8f;  /* Green underline only on hover */
  color: #111111;                   /* Keep text color same */
  outline: none;
}

.menu-icon {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 32px;
  height: 24px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
}

.menu-icon span {
  display: block;
  height: 4px;
  width: 100%;
  margin: 3px 0;
  background: #222;
  border-radius: 2px;
  transition: all 0.3s;
}

/* Responsive menu style */
@media (max-width: 768px) {
  .menu-icon {
    display: flex;
  }
  nav#main-nav {
    display: none;
    position: absolute;
    top: 56px; /* height of header, adjust as needed */
    left: 0;
    width: 100%;
    background: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.05);
    z-index: 1001;
  }
  nav#main-nav.open {
    display: block;
  }
  nav#main-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0;
    margin: 0;
  }
  nav#main-nav ul li a {
    display: block;
    padding: 16px;
    border-bottom: 1px solid #eee;
    color: #222;
  }
}

@media (min-width: 769px) {
  #menu-toggle {
    display: none;
  }
  nav#main-nav {
    display: block !important;
    position: static;
    background: none;
    box-shadow: none;
  }
  nav#main-nav ul {
    flex-direction: row;
  }
}

.regular-text {
  font-weight: normal;
  color: #111; /* black or your default text color */
}

.highlight-grit {
  color: #2a9d8f;
  text-transform: uppercase;
  font-weight: bold;
}

nav ul {
  display: flex;
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

nav a, footer a {
  color: #111;
}

nav a:hover, footer a:hover {
  color: #2a9d8f;
  text-decoration: underline;
}


/* hero styling */

.hero {
  padding: 60px 0;
  text-align: center;
}

.hero h2 {
  font-weight: 400;
  font-size: 2rem;
  margin-bottom: 10px;
}

.hero p {
  font-size: 1.1rem;
  color: #444;
}

main {
  margin: 40px 0;
}

/* blog list styling */

.blog-list li {
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.blog-date {
  display: inline-block;
  width: 50px; /* fixed width, adjust if needed */
  color: #888;
  font-size: 0.9em;
  margin-right: 8px;
  text-align: left;
}

.title-tag-wrapper {
  display: inline-flex;
  align-items: center;
  gap: 8px; /* small gap between title text and tags */
  flex-grow: 1;
  min-width: 0;
  flex-wrap: wrap;
}

.blog-title {
  display: inline-block;
  max-width: 900px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
  color: inherit;
  text-decoration: underline;
  transition: color 0.2s;
}

.blog-title:hover,
.blog-title:focus {
  color: #2a9d8f !important; /* force green color on hover */
  outline: none;
}

.blog-tags {
  display: inline-block;
  max-width: 180px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: middle;
}

.tag {
  background: #f0f0f0;
  border-radius: 3px;
  padding: 2px 6px;
  margin-right: 4px;
  font-size: 0.8em;
  color: #000000;
}

.year-group {
  margin-bottom: 30px;
  color: #2a9d8f;
}

.year-group h4 {
  font-weight: 600;
  font-size: 1rem;
  padding-bottom: 4px;
  margin-bottom: 12px;
}

.year-group ul {
  list-style: none;
  padding-left: 0;
}

.year-group li {
  margin-bottom: 10px;
}

.year-group a {
  text-decoration: none;
  color: #111;
}

.year-group a:hover {
  color: #0073e6;
}

@media (max-width: 600px) {
  .blog-list li {
    flex-direction: column; /* vertical stack only on mobile */
    align-items: flex-start;
    gap: 4px;
    margin-bottom: 16px;
  }

  .blog-date {
    width: auto;
    margin-bottom: 2px;
    font-size: 0.95rem;
  }

  .title-tag-wrapper {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    width: 100%;
  }
}


/* Footer styling */

footer::before {
  content: "";
  display: block;
  width: 100vw;
  height: 1px;
  background-color: #ddd;
  position: absolute;
  top: 0;
  left: 50%;
  margin-left: -50vw;
}

footer {
  border-top: 1px solid #ccc; /* grey line above footer */
  padding-top: 20px; /* optional spacing between line and footer content */
  padding-bottom: 20px; /* bottom padding */
  margin-top: 40px; /* optional spacing above the line */
  text-align: center;
  color: #555;
  background: #fff;
  font-size: 1rem;
}

footer a {
  color: #2a9d8f;
  font-size: 1.5rem;
  margin: 0 8px;
  transition: color 0.2s;
  text-decoration: none;
}

footer a:hover,
footer a:focus {
  color: #176d5a;
}

footer i {
  vertical-align: middle;
}



/* About page styling */

.about-image {
  max-width: 100%; /* Image will never be wider than its container */
  height: auto;    /* Maintain aspect ratio */
  display: block;  /* Remove inline spacing issues */
  margin: 0 auto;  /* Center if needed */
}

.about-section {
  max-width: 800px;
  margin: 0 auto 60px auto;
  padding: 0 20px;
  font-size: 1.1rem;
  color: #333;
  line-height: 1.6;
}

.connect-section {
  text-align: center;
  margin-bottom: 50px;
}

.connect-section h2 {
  margin-bottom: 20px;
  font-weight: 700;
}

.social-icons a {
  color: #2a9d8f;
  font-size: 2.2rem;
  margin: 0 15px;
  transition: color 0.3s ease;
}

.social-icons a:hover {
  color: #176d5a; /* darker green on hover */
}

.instagram-section {
  max-width: 900px;
  margin: 0 auto 60px auto;
  padding: 0 20px;
}

.instagram-section h2 {
  font-weight: 700;
  margin-bottom: 20px;
  text-align: center;
}

/* Bookshelf page styling */

.bookshelf-intro {
  max-width: 800px;
  margin: 40px auto 20px auto;
  text-align: center;
  color: #333;
}

.bookshelf-intro h2 {
  font-weight: 700;
  margin-bottom: 8px;
  font-size: 2rem;
}

.bookshelf-list {
  max-width: 700px;
  margin: 0 auto 60px auto;
  padding: 0 20px;
  scroll-margin-top: 56px;
}

.bookshelf-list ul {
  list-style-type: none;
  padding-left: 0;
}

.bookshelf-list li {
  border-bottom: 1px solid #ddd;
  padding: 15px 0;
  font-size: 1.1rem;
  color: #111;
  scroll-margin-top: 56px;
}

.book-title {
  font-weight: 400;
}

.book-author {
  color: #555;
  font-style: italic;
  font-size: 0.95rem;
  margin-top: 4px;
  display: block;
}

.category {
  margin-bottom: 40px;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
  padding: 0 20px;
}

.category h3 {
  font-weight: 400;
  font-size: 1.25rem;
  margin-top: 2em; /* creates space above each year heading */
  border-bottom: 1px solid #2a9d8f; /* green underline for category headers */
  padding-bottom: 6px;
  margin-bottom: 16px;
  color: #2a9d8f;
}

.category ul {
  list-style-type: none;
  padding-left: 0;
}

.category li {
  border-bottom: 1px solid #ddd;
  padding: 12px 0;
  font-size: 1.1rem;
}

.category-tags {
  max-width: 1200px;
  margin: 20px auto 40px auto;
  padding: 0 20px;
  text-align: center;
}

.category-tags a {
  display: inline-block;
  background-color: #f3f3f3; /* very light grey */
  color: #111;
  padding: 8px 18px;
  margin: 0 8px 10px 8px;
  border: none;
  border-radius: 20px;
  font-weight: 400;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 1px 6px rgba(0,0,0,0.03);
  transition: background-color 0.2s, color 0.2s;
}

.category-tags a:hover,
.category-tags a:focus {
  background-color: #2a9d8f; /* green on hover */
  color: #fff;
}


/* My book page styling */

.page-title {
  font-family: 'Roboto', sans-serif; /* match your main font */
  font-weight: 700;
  font-size: 2rem; /* consistent with other page titles */
  color: #111; /* black or default title color */
  text-align: center; /* match your general page alignment */
  margin: 20px 0; /* 20px top and bottom spacing */
}

.book-grid-container {
  display: grid;
  grid-template-columns: 2fr 1fr;  /* First column 2/3 width, second 1/3 */
  grid-template-rows: auto auto;  /* Two rows, height by content */
  gap: 24px;
  max-width: 1200px;
  margin: 40px auto;
  background: #fff;
  padding: 0 20px;
  box-sizing: border-box;
}

.book-grid-item {
  background: transparent;
  padding: 0;
  box-sizing: border-box;
}

/* YouTube video */
.book-grid-item.video iframe {
  width: 100%;
  height: 400px;
  border-radius: 8px;
}

/* Book cover image */
.book-grid-item.image img {
  width: auto;
  max-height: 400px;    /* Adjust to preferred image height */
  display: block;
  margin: 0 auto;
  border-radius: 8px;
  object-fit: contain;

  /* Glow effect */
  box-shadow: 0 0 12px 4px rgba(128, 128, 128, 0.7);
  transition: box-shadow 0.3s ease-in-out;
}

/* Book description text */
.book-grid-item.description {
  font-size: 1.1rem;
  color: #333;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

/* Buy button container */
.book-grid-item.buy {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 8px;
}

/* Buy button styling - keep old green color */
.buy-button {
  background-color: #2a9d8f;
  color: white;
  padding: 12px 28px;
  border-radius: 30px;
  font-weight: 400;
  font-size: 1.1rem;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(42, 157, 143, 0.4);
  transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.buy-button:hover,
.buy-button:focus {
  background-color: #21867a;
  box-shadow: 0 6px 14px rgba(33, 134, 122, 0.6);
}

@media (max-width: 768px) {
  .book-grid-container {
    display: flex;           /* Switch from grid to flex on mobile */
    flex-direction: column;  /* Stack items vertically */
  }

  /* Reset order to stack column 1 items first */
  .book-grid-item.video,
  .book-grid-item.description {
    order: 1;  /* Show first */
  }

  /* Stack second column items below */
  .book-grid-item.image,
  .book-grid-item.buy {
    order: 2;  /* Show second */
  }

  /* Make iframe full width */
  .book-grid-item.video iframe {
    height: auto;
    aspect-ratio: 16 / 9;
    width: 100%;
  }

  /* Book cover image full width and smaller height */
  .book-grid-item.image img {
    max-height: 250px;
    width: auto;
    max-width: 100%;
  }

  /* Button center aligned with margin */
  .book-grid-item.buy {
    margin-top: 16px;
    justify-content: center;
  }
}
