/* ============== RESPONSIVE BOOK GRID (Shared) ============== */
@media (max-width: 900px) {
  .book-item {
    flex: 1 1 calc(50% - 2rem);
    max-width: calc(50% - 2rem);
  }
}

@media (max-width: 600px) {
  .book-item {
    flex: 1 1 100%;
    max-width: 100%;
  }
}

/* ============== GRID LAYOUTS: Homepage / Tag Archives ============== */

.tag-posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 10px;
  align-items: start;
}

.tag-post-item {
  background: #f9f9f9;
  border-radius: 8px;
  padding: 10px;
  box-shadow: 0 3px 6px rgba(0,0,0,0.08);
}

.tag-post-thumbnail img {
  width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: cover;
  border-radius: 8px;
}

.tag-post-title {
  font-size: 1.1em;
  font-weight: bold;
  margin-top: 6px;
  line-height: 1.3;
  text-decoration: none;
  color: #333;
}

.tag-post-title:hover {
  color: #0073aa;
}

.tag-post-excerpt {
  display: none;
  color: #666;
  font-size: 0.9em;
  margin-top: 8px;
}

.tag-post-item:hover {
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.12);
}

/* ============== ARTIST/PROFILE GRID ============== */
.author-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  justify-items: center;
  padding: 2rem 0;
}

.author-grid .book-item {
  text-align: center;
  max-width: 140px;
}

.author-grid img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
}

.author-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.author-grid p {
  font-size: 0.9rem;
  color: #555;
}

/* ============== CITED CONTENT GRID (Books) ============== */
.cited-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 2rem;
  justify-items: center;
  padding: 2rem 0;
}

.cited-item {
  text-align: center;
  max-width: 200px;
  padding: 1rem;
  background-color: #f9f9f9;
  border-radius: 12px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.cited-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1);
}

.cited-item img {
  width: 150px;
  height: auto;
  max-height: 220px;
  border-radius: 6px;
  object-fit: contain;
}

.cited-item h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.cited-item p {
  font-size: 0.9rem;
  color: #555;
  margin-bottom: 0.25rem;
}

/* ============== SONG GRID ============== */

.song-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 2rem;
  justify-items: center;
  padding: 2rem 0;
}

.song-grid .book-item {
  text-align: center;
  max-width: 140px;
}

.song-grid img {
  width: 100px;
  height: 100px;
  object-fit: cover;
  display: block;
  margin: 0 auto 1rem;
  border-radius: 0; /* Square */
}

.song-grid h3 {
  font-size: 1rem;
  margin-bottom: 0.5rem;
}

.song-grid p {
  font-size: 0.9rem;
  color: #555;
}

/* === Compact Search Grid Styles === */
.grid-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
}

.grid-card {
  background: #fdfdfd;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 4px rgba(0,0,0,0.06);
  padding: 1rem;
  transition: box-shadow 0.2s ease;
}

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

.grid-card-thumbnail img {
  width: 100%;
  height: auto;
  display: block;
  margin-bottom: 0.75rem;
  border-radius: 4px;
}

.grid-card-title {
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 0.4rem;
}

.grid-card-title a {
  text-decoration: none;
  color: #222;
}

.grid-card-title a:hover {
  color: #0073aa;
}

.grid-card-excerpt {
  font-size: 0.8rem;
  color: #666;
  line-height: 1.4;
  max-height: 4em;
  overflow: hidden;
}

/* === Books on Profile Page === */
.profile-books ul.profile-book-grid {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 1em;
}

.profile-book-item {
  text-align: center;
  max-width: 160px;
}

.profile-book-link {
  text-decoration: none;
  color: inherit;
  display: block;
}

.profile-book-cover {
  width: 150px;
  height: auto;
  display: block;
  margin: 0 auto 0.5em;
}

.profile-book-title {
  margin-top: 0.25em;
  font-weight: bold;
  font-size: 1rem;
}

.thread-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 24px;
  margin-top: 1em;
}

.thread-item {
  text-align: center;
  max-width: 240px;
}

.thread-item img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  margin-bottom: 0.5em;
}

.video-grid-a {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.video-card-a a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.mini-video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 14px;

    margin: 0.8em 0 0 1.5em;
}

.mini-video-item {
    text-align: center;
}