/* ---------------------------------------------------------
   HOH LIBRARY HEADER
--------------------------------------------------------- */
.hoh-library-header {
    text-align: center;
    margin-bottom: 40px;
}

.hoh-library-header h1 {
    font-size: 2.4rem;
    margin-bottom: 6px;
}

.hoh-library-header .subtitle {
    font-size: 1.1rem;
    opacity: 0.8;
}

.hoh-library-header .divider {
    width: 60px;
    height: 3px;
    background: #7a4bd8;
    margin: 16px auto 30px;
    border-radius: 3px;
}

/* Search Bar */
#hoh-library-search {
    width: 90%;
    max-width: 400px;
    padding: 10px 14px;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
    margin-bottom: 30px;
}


/* ---------------------------------------------------------
   TRANSFORM GUTENBERG GALLERY INTO A BOOK GRID
--------------------------------------------------------- */
/* Mobile-first: 1 column */
.hoh-library-grid .wp-block-gallery {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 26px !important;
    padding: 0 20px;
}

/* Desktop: 2 wide columns */
@media (min-width: 900px) {
    .hoh-library-grid .wp-block-gallery {
        grid-template-columns: repeat(2, minmax(430px, 1fr));
    }
}




/* Book Card */
.hoh-library-grid figure.wp-block-image {
    background: #fff;
    border-radius: 10px;
    padding: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    text-align: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.hoh-library-grid figure.wp-block-image:hover {
    transform: translateY(-4px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.12);
}

/* Book Cover */
.hoh-library-grid figure.wp-block-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    display: block;
}

/* Remove default gallery spacing */
.wp-block-gallery.has-nested-images figure.wp-block-image {
    margin: 0 !important;
}

/* ---------------------------------------------------------
   TITLES UNDER EACH BOOK (CSS-ONLY)
   Maps each title to its corresponding image by class.
--------------------------------------------------------- */

/* Shared styling for all titles */
.hoh-library-grid figure.wp-block-image::after {
    display: block;
    margin-top: 12px;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.3;
}

/* Individual titles mapped by order in the gallery */
.hoh-library-grid figure.wp-block-image:nth-child(1)::after {
    content: "Alien Entities";
}

.hoh-library-grid figure.wp-block-image:nth-child(2)::after {
    content: "Battle of the Ages";
}

.hoh-library-grid figure.wp-block-image:nth-child(3)::after {
    content: "Christian Foundations";
}

.hoh-library-grid figure.wp-block-image:nth-child(4)::after {
    content: "Healing of the Memories";
}

.hoh-library-grid figure.wp-block-image:nth-child(5)::after {
    content: "Supernatural Principalities and Powers";
}

.hoh-library-grid figure.wp-block-image:nth-child(6)::after {
    content: "Why the World Will Hail the Antichrist";
}

/* Automatic title + author system */

/* Ensure the image displays normally */
.hoh-library-grid figure.wp-block-image img {
    display: block;
}

/* Author (appears first, above title) */
.hoh-library-grid figure.wp-block-image::before {
    content: attr(data-author);
    display: block;
    margin-top: 10px;
    font-size: 0.85rem;
    font-weight: 500;
    color: #666;
    text-align: center;
    line-height: 1.2;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    white-space: normal;
    word-wrap: break-word;
}

/* Title (appears under author) */
.hoh-library-grid figure.wp-block-image::after {
    content: attr(data-title);
    display: block;
    margin-top: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
    text-align: center;
    line-height: 1.25;
    max-width: 90%;
    margin-left: auto;
    margin-right: auto;
    white-space: normal;
    word-wrap: break-word;
}
