/*
 * Stylesheet for Bruce R. Norton's website
 * This design uses a bold color palette inspired by suicide‑prevention awareness (purple and teal)
 * and is written with mobile‑first principles in mind. Responsive breakpoints ensure that
 * the layout gracefully adapts to tablets and desktops. Cards, buttons and typography
 * have been selected to appeal to teens and young adults.
 */

/* Root colour variables for easy theming */
:root {
  --primary-color: #6B5B95;    /* rich purple */
  --secondary-color: #00BFAE;  /* vibrant teal */
  --background-color: #F7F9FC; /* soft light grey */
  --text-color: #333333;       /* dark grey for readability */
  --button-hover: #5A4A80;     /* darker shade of primary for hover states */
}

/* Base styles */
html, body {
  margin: 0;
  padding: 0;
  font-family: 'Poppins', sans-serif;
  color: var(--text-color);
  background: var(--background-color);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Utility container */
.container {
  width: 90%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 0;
}

/* Hero section */
.hero {
  position: relative;
  height: 70vh;
  background-image: url('../images/hero.jpg');
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.hero-overlay {
  position: relative;
  z-index: 2;
  color: #ffffff;
  padding: 1rem;
  border-radius: 8px;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}

.hero-subtitle {
  font-size: 1.1rem;
  font-weight: 300;
  margin: 0 0 1.5rem;
}

.cta-button {
  display: inline-block;
  background: var(--secondary-color);
  color: #ffffff;
  padding: 0.75rem 1.5rem;
  border-radius: 30px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.cta-button:hover {
  background: var(--primary-color);
}

/* Section headings */
section h2 {
  font-size: 2rem;
  color: var(--primary-color);
  margin-bottom: 1rem;
  text-align: center;
}

/* About and mission sections */
.about p, .mission p {
  line-height: 1.6;
  /* Increase the space between paragraphs for better readability */
  margin-bottom: 1.5rem;
  font-size: 1rem;
}

/* Mission callout */
.mission {
  background: #ffffff;
  border-top: 6px solid var(--secondary-color);
  border-bottom: 6px solid var(--secondary-color);
}

/* Books grid */
.books {
  background: #F0F3FA;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.book-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  justify-content: center;
}

.book-card {
  background: #ffffff;
  border-radius: 10px;
  padding: 1rem;
  flex: 1 1 calc(50% - 1.5rem);
  max-width: 300px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.book-card h3 {
  font-size: 1.3rem;
  color: var(--primary-color);
  margin: 0.75rem 0 0.5rem;
}

.book-card p {
  font-size: 0.9rem;
  color: #555555;
  flex-grow: 1;
}

/* Override the centre alignment for descriptions within book cards and
 * ensure the text aligns to the left. The <strong> tag at the start
 * emphasises the opening sentence. */
/*
 * Book description styling:
 * - the outer container spans full width and cancels inherited centre alignment
 * - the first sentence is centred
 * - the middle paragraphs are left‑aligned
 * - the last sentence is centred and bold via its container and strong element
 */
.book-card .book-description {
  width: 100%;
  text-align: left;
}

.book-card .book-description .first-sentence,
.book-card .book-description .last-sentence {
  display: block;
  text-align: center;
  margin-bottom: 0.5rem;
}

.book-card .book-description .last-sentence {
  font-weight: 700;
}

.book-card .book-description .description-body {
  /* Add extra space above and below the middle paragraphs of the book description */
  margin: 0.75rem 0 1.25rem;
  line-height: 1.5;
}

/* Bullet list inside the book description */
.book-card .book-description .bullet-list {
  list-style-type: disc;
  padding-left: 1.5rem;
  margin: 0.5rem 0 1.25rem;
  text-align: left;
}
.book-card .book-description .bullet-list li {
  margin-bottom: 0.5rem;
}

.book-link {
  margin-top: 1rem;
  background: var(--secondary-color);
  color: #ffffff;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  text-decoration: none;
  font-weight: 600;
  transition: background 0.3s ease;
}

.book-link:hover {
  background: var(--primary-color);
}

/* Footer */
.footer {
  background: var(--primary-color);
  color: #ffffff;
  text-align: center;
  padding: 1rem 0;
}

.footer p {
  margin: 0;
  font-size: 0.85rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .hero-title {
    font-size: 2rem;
  }
  .hero-subtitle {
    font-size: 0.95rem;
  }
  .book-card {
    flex: 1 1 100%;
  }
}

/* Mobile navigation styles */
.menu-toggle {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 1000;
  background: transparent;
  border: none;
  color: #ffffff;
  font-size: 2rem;
  cursor: pointer;
  display: block;
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--primary-color);
  color: #ffffff;
  padding-top: 4rem;
  z-index: 999;
}
.mobile-nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.mobile-nav li {
  margin: 1rem 0;
  text-align: center;
}
.mobile-nav a {
  color: #ffffff;
  text-decoration: none;
  font-size: 1.2rem;
  font-weight: 600;
}
.mobile-nav.open {
  display: block;
}

/* When the viewport is large, you may adjust the size of the hamburger if desired */
@media (min-width: 769px) {
  .menu-toggle {
    font-size: 2.2rem;
  }
}