/* ============================================================
   GRIDS
   All card/list layouts: tags, search, portal, tables, etc.
   ============================================================ */

/* ========== 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%;
    }
}

/* ========== TAG POSTS GRID ========== */
.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);
}

/* ========== AUTHOR / 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 ========== */
.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;
}

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

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

/* ========== COMPACT SEARCH GRID ========== */
.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 ========== */
.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;
}

/* ========== CONTENT OBJECTS ========== */
.content-objects-section {
    margin: 3rem 0;
}

.content-objects-title {
    text-align: center;
    margin-bottom: 2rem;
}

.content-object {
    text-align: center;
}

.content-object-title {
    margin-bottom: 1rem;
}

.content-object-render {
    display: flex;
    justify-content: center;
}

.content-objects-grid.layout-1col {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

.content-objects-grid.layout-2col {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
}

.content-objects-grid.layout-3col {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem;
}

/* ========== PORTAL ========== */
.portal-section {
    max-width: 860px;
    margin: 0 auto 3.5rem;
    text-align: center;
}

.portal-section-title {
    font-weight: 500;
    font-size: 2.25rem;
    margin-bottom: 1.5rem;
    color: #111;
}

.portal-quote-list,
.portal-excerpt-list,
.portal-lyric-list {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    text-align: left;
}

.portal-quote-item,
.portal-excerpt-item,
.portal-lyric-item {
    display: flex;
    gap: 1.25rem;
    align-items: flex-start;
    border-bottom: 1px solid #e6e6e6;
    padding-bottom: 1.25rem;
}

.portal-quote-item .quote-thumb,
.portal-excerpt-item .excerpt-thumb,
.portal-lyric-item .lyric-thumb {
    flex: 0 0 120px;
}

.portal-quote-item img,
.portal-excerpt-item img,
.portal-lyric-item img {
    width: 120px;
    height: 120px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.quote-title,
.excerpt-title,
.lyric-title {
    margin: 0 0 0.5rem;
    font-size: 2.05rem;
    font-weight: 400;
}

.quote-excerpt,
.excerpt-text,
.lyric-snippet {
    margin: 0;
    color: #444;
    line-height: 1.5;
}

.quote-source,
.excerpt-source,
.lyric-source {
    margin-top: 0.6rem;
    color: #666;
    font-size: 0.9rem;
}

/* ========== TAG BUBBLES ========== */
.tag-bubbles {
    display: inline-flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5em;
    max-width: 90%;
    margin: 0 auto;
}

.tag-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 4px 10px;
    border: 1px solid #000;
    border-radius: 20px;
    background: #fff;
    color: #000;
    text-decoration: none;
    font-size: 0.9em;
    line-height: 1.4;
    transition: background 0.2s ease, color 0.2s ease;
}

.tag-bubble:hover {
    background: #000;
    color: #fff;
}

.cpt-alpha-list {
    list-style: none;
    padding: 0;
    margin: 2rem auto;
    max-width: 720px;
}

.cpt-alpha-list li {
    display: flex;
    align-items: center;
    font-size: 1.125rem;
    margin: 0.5rem 0;
}

.cpt-icon,
.cpt-emoji,
.cpt-key-emoji {
    font-family:
        "Apple Color Emoji",
        "Segoe UI Emoji",
        "Noto Color Emoji",
        system-ui,
        sans-serif;
    font-variant-emoji: emoji;
    line-height: 1;
}

.cpt-icon {
    width: 2rem;
    text-align: center;
    margin-right: 0.5rem;
    font-size: 1.25rem;
}

/* ========== TABLE ========== */
.chapter-by-song {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 2rem;
}

.chapter-by-song th,
.chapter-by-song td {
    border: 1px solid #ccc;
    padding: 0.5em 0.75em;
}

.chapter-by-song th {
    background: #f5f5f5;
    text-align: left;
}

.chapter-by-song td a {
    text-decoration: none;
    color: #0073aa;
}

.chapter-by-song td a:hover {
    text-decoration: underline;
}