@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Open+Sans:wght@400;600&display=swap');

:root {
  --primary-bg: #FFFFFF;
  --text-color: #1a1a1a;
  --primary-accent: #005b96;
  --secondary-accent: #7aaed3;
  --border-color: #e0e0e0;
}

body {
  font-family: 'Open Sans', sans-serif;
  line-height: 1.7;
  max-width: 900px;
  margin: 2rem auto;
  padding: 0 2rem;
  background-color: var(--primary-bg);
  color: var(--text-color);
}

h1, h2, h3 {
  font-family: 'Merriweather', serif;
  color: var(--primary-accent);
}

h1 {
  font-style: italic;
  text-align: center;
  margin: 0.25rem auto;
}

.site-title {
  text-align: center;
  font-weight: 700;
}

.note {
  font-style: italic;
  text-align: center;
  max-width: 700px;
  margin: 0.5rem auto;
  color: #808080;
  font-size: 0.8rem;
}

.chapter-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  background-color: var(--primary-bg);
  box-shadow: 0 2px 10px rgba(0,0,0,0.05);
  transition: box-shadow 0.3s ease;
}

.chapter-card:hover {
  box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.chapter-header {
  padding: 1.25rem 1.5rem;
  font-weight: bold;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Merriweather', serif;
  font-size: 1.2rem;
  color: var(--primary-accent);
  cursor: pointer;
}

.chevron {
  transition: transform 0.3s ease;
}

.chapter-card.is-expanded .chevron {
  transform: rotate(180deg);
}

.chapter-body {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.5s ease-in-out, border-top-color 0.3s ease-in-out;
  border-top: 1px solid transparent;
}

.chapter-card.is-expanded .chapter-body {
  border-top-color: var(--border-color);
}

.ch-body-grid {
  padding: 0rem 1.5rem 1.5rem 1.5rem;
  overflow: auto; /* Clearfix for the floated element */
}

.ch-body-grid.single-column {
  /* This class is no longer needed with the float approach, but we'll keep it for now */
}

.ch-terms {
  float: right;
  width: 33%;
  margin-left: 2rem;
}

.terms dt {
  font-weight: bold;
  color: var(--primary-accent);
}

.terms dd {
  margin-left: 0;
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 2px solid var(--secondary-accent);
}

.book-selector {
  display: flex;
  justify-content: center;
  gap: 4rem;
  margin-bottom: 0rem;
  padding-bottom: 0rem;
}

.book-cover-link {
  position: relative;
  display: inline-block;
  vertical-align: top;
  overflow: hidden;
  border-radius: 16px;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.book-cover {
  height: 300px;
  max-width: 100%;
  display: block;
  border-radius: 16px;
  transform: scale(1.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
  z-index: 1;
}

.book-cover-link:hover .book-cover {
  transform: scale(1.05);
}

.book-cover-link.selected {
  box-shadow: 0 10px 20px -5px rgba(0, 91, 150, 0.5);
}

.book-cover-link.selected::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  border-radius: 16px;
  box-shadow: inset 0 0 0 4px var(--primary-accent);
  pointer-events: none;
  z-index: 2;
}

a {
  color: var(--primary-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--secondary-accent);
}

footer {
  margin-top: 4rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
  text-align: center;
}

.instructional-note-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.bouncing-arrow {
  display: inline-block;
  width: 0.4rem;
  height: 0.4rem;
  border-top: 1px solid #808080;
  border-right: 1px solid #808080;
  transform: rotate(-45deg);
  animation: bounce 1.2s infinite ease-in-out;
  position: relative;
  top: 3.5px;
}

@keyframes bounce {
  0%, 100% {
    transform: translateY(0) rotate(-45deg);
  }
  50% {
    transform: translateY(-6px) rotate(-45deg);
  }
}

/* Book metadata styling */
.book-meta {
  display: flex;
  align-items: center;
  margin-bottom: 20px;
  padding: 10px 15px;
  background-color: #f9f9f9;
  border-left: 5px solid var(--primary-accent);
  font-size: 0.85em;
}

.book-info-syllabus {
  flex: 1; /* 50% of the width */
  padding-right: 15px;
}

.book-link-line {
  margin: 0 0 0.5em 0;
  font-family: 'Merriweather', serif;
  font-size: 1.1em;
}

.book-action-link {
  font-style: italic;
  color: var(--secondary-accent);
  text-decoration: underline;
}

.book-action-link:hover {
  color: var(--primary-accent);
  text-decoration: none;
}

.syllabus-description {
  margin: 0;
  line-height: 1.5;
}

.book-meta-citation {
  flex: 1; /* 50% of the width */
  border-left: 1px solid var(--border-color);
  padding-left: 15px;
}

.apa-citation {
  color: #555;
  line-height: 1.4;
  margin: 0;
}

.apa-title,
.apa-edition {
  display: inline; /* Ensures they don't break the line */
}

.apa-citation strong {
  color: #333;
  margin-right: 5px;
}

@media (max-width: 768px) {
  .book-meta {
    flex-direction: column;
    align-items: stretch;
    /* On mobile, remove the side border for a cleaner stack */
    border-left: none;
    padding: 15px;
  }

  .book-info-syllabus {
    padding-right: 0;
  }

  .book-meta-citation {
    border-left: none;
    border-top: 1px solid var(--border-color);
    padding: 15px 0 0 0;
    margin-top: 15px;
  }
}

@media (max-width: 600px) {
  .book-selector {
    gap: 2rem;
  }
  .book-cover {
    height: 200px;
  }
  body {
    padding: 0 1rem;
  }
}
@media (max-width: 768px) {
  .ch-terms {
    float: none;
    width: 100%;
    margin-left: 0;
    margin-top: 1.5rem; /* Add space between summary and definitions */
  }
}
/* ==========================================================================
   Search Filter Styles
   ========================================================================== */

.search-wrapper {
  margin-bottom: 2rem;
}

#chapter-search {
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  border-radius: 8px;
  border: 1px solid #ccc;
  transition: border-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

#chapter-search:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

#chapter-search::placeholder {
  color: #999;
  font-style: italic;
}

mark {
  background-color: #fff3cd;
  padding: 0.1em 0.2em;
  border-radius: 3px;
}