/* CBBC Hymnals library page */
.hymnals-page {
    background: #f7fafc;
    min-height: 55vh;
}

.hymnals-hero {
    position: relative;
    overflow: hidden;
    padding: 76px 0 70px;
    color: #fff;
    background: linear-gradient(118deg, #102f59 0%, #17648a 62%, #4a9b88 100%);
}

.hymnals-hero::before,
.hymnals-hero::after {
    content: "";
    position: absolute;
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 50%;
    pointer-events: none;
}

.hymnals-hero::before {
    width: 460px;
    height: 460px;
    right: -90px;
    top: -270px;
}

.hymnals-hero::after {
    width: 340px;
    height: 340px;
    right: 90px;
    bottom: -260px;
}

.hymnals-hero-inner {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 34px;
}

.hymnals-eyebrow {
    display: inline-block;
    margin-bottom: 13px;
    color: #c4f0dd;
    font-size: .76rem;
    font-weight: 700;
    letter-spacing: .17em;
}

.hymnals-hero h1 {
    margin: 0 0 13px;
    color: #fff;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(2.35rem, 5vw, 3.7rem);
    line-height: 1.12;
}

.hymnals-hero h1 span {
    color: #bfe9d4;
}

.hymnals-hero p {
    max-width: 650px;
    margin: 0;
    color: rgba(255,255,255,.88);
    font-size: 1.02rem;
    line-height: 1.75;
}

.hymnals-hero-icon {
    display: grid;
    flex: 0 0 130px;
    width: 130px;
    height: 130px;
    place-items: center;
    border: 1px solid rgba(255,255,255,.25);
    border-radius: 32px;
    background: rgba(255,255,255,.11);
    color: #d9f6e7;
    font-family: Georgia, serif;
    font-size: 5.8rem;
    line-height: 1;
    transform: rotate(5deg);
    box-shadow: 0 18px 50px rgba(0,0,0,.12);
}

.hymnals-library-section {
    padding: 60px 0 82px;
}

.hymnals-section-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 26px;
}

.hymnals-section-heading h2 {
    margin: 8px 0 7px;
    color: #173552;
    font-family: "Playfair Display", Georgia, serif;
    font-size: clamp(1.8rem, 3vw, 2.45rem);
}

.hymnals-section-heading p {
    margin: 0;
    color: #68798a;
    line-height: 1.65;
}

.hymnals-home-link,
.hymnals-up-link {
    color: #176b78;
    font-size: .9rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.hymnals-home-link:hover,
.hymnals-up-link:hover {
    color: #0c405f;
    text-decoration: underline;
}

.hymnals-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 20px;
    padding: 14px;
    border: 1px solid #e1eaf0;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 8px 26px rgba(27,62,88,.045);
}

.hymnals-search-wrap {
    display: flex;
    flex: 1 1 280px;
    align-items: center;
    gap: 10px;
    min-width: 220px;
    padding: 0 14px;
    border: 1px solid #dce6ed;
    border-radius: 11px;
    background: #fbfdfe;
    color: #618092;
}

.hymnals-search-wrap span {
    font-size: 1.5rem;
    line-height: 1;
}

.hymnals-search-wrap input {
    width: 100%;
    min-height: 46px;
    border: 0;
    outline: 0;
    background: transparent;
    color: #203b52;
    font: inherit;
    font-size: .93rem;
}

.hymnals-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.hymnals-filters button {
    min-height: 38px;
    padding: 0 13px;
    border: 1px solid transparent;
    border-radius: 9px;
    background: #f0f5f7;
    color: #536c7c;
    cursor: pointer;
    font: inherit;
    font-size: .82rem;
    font-weight: 700;
    transition: .18s ease;
}

.hymnals-filters button:hover {
    border-color: #c9e2dc;
    color: #165d62;
}

.hymnals-filters button.active {
    border-color: #c4e3d4;
    background: #e7f5ed;
    color: #176448;
}

.hymnals-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin: 20px 0 15px;
    color: #91a0ac;
    font-size: .86rem;
}

.hymnals-breadcrumbs a {
    color: #356b83;
    text-decoration: none;
}

.hymnals-breadcrumbs a:hover {
    color: #173e5d;
    text-decoration: underline;
}

.hymnals-results-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    margin: 0 0 16px;
    color: #758694;
    font-size: .84rem;
}

.hymnals-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.hymnals-folder-card,
.hymnals-file-card {
    min-width: 0;
    border: 1px solid #e1eaf0;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(27,62,88,.045);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.hymnals-folder-card:hover,
.hymnals-file-card:hover {
    transform: translateY(-3px);
    border-color: #bfded4;
    box-shadow: 0 14px 30px rgba(27,62,88,.09);
}

.hymnals-folder-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 18px;
    color: #203b52;
    text-decoration: none;
}

.hymnals-item-icon {
    display: inline-grid;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 13px;
    background: #edf6f4;
    font-size: 1.55rem;
}

.hymnals-item-main {
    display: flex;
    flex: 1;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.hymnals-item-main strong {
    overflow-wrap: anywhere;
    color: #1b3a53;
    font-size: .94rem;
    line-height: 1.4;
}

.hymnals-item-main small {
    color: #84929d;
    font-size: .78rem;
}

.hymnals-item-arrow {
    color: #4c8c7c;
    font-size: 1.25rem;
}

.hymnals-file-card {
    display: flex;
    flex-direction: column;
    padding: 18px;
}

.hymnals-file-topline {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.hymnals-file-type {
    padding: 5px 8px;
    border-radius: 7px;
    background: #f0f5f7;
    color: #607988;
    font-size: .68rem;
    font-weight: 800;
    letter-spacing: .07em;
}

.hymnals-file-card h3 {
    display: -webkit-box;
    overflow: hidden;
    min-height: 2.8em;
    margin: 13px 0 5px;
    color: #203b52;
    font-size: .95rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.hymnals-file-meta {
    margin: 0 0 12px;
    color: #8a98a3;
    font-size: .76rem;
}

.hymnals-file-card audio,
.hymnals-file-card video {
    display: block;
    width: 100%;
    max-height: 230px;
    margin: 2px 0 14px;
}

.hymnals-image-preview {
    display: grid;
    height: 145px;
    margin: 2px 0 14px;
    overflow: hidden;
    place-items: center;
    border-radius: 10px;
    background: #f2f6f8;
}

.hymnals-image-preview img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.hymnals-file-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}

.hymnals-action-primary,
.hymnals-action-download {
    display: inline-flex;
    min-height: 37px;
    align-items: center;
    justify-content: center;
    padding: 0 12px;
    border-radius: 8px;
    font-size: .79rem;
    font-weight: 700;
    text-decoration: none;
    transition: .18s ease;
}

.hymnals-action-primary {
    background: #e7f4ec;
    color: #176448;
}

.hymnals-action-primary:hover {
    background: #d5ecdf;
}

.hymnals-action-download {
    border: 1px solid #dce7ed;
    background: #fff;
    color: #48687b;
}

.hymnals-action-download:hover {
    border-color: #b7d7ce;
    background: #f5faf8;
}

.hymnals-empty-state {
    margin: 26px 0 0;
    padding: 54px 24px;
    border: 1px dashed #cbdce3;
    border-radius: 17px;
    background: rgba(255,255,255,.75);
    text-align: center;
}

.hymnals-empty-icon {
    margin-bottom: 12px;
    font-size: 2.3rem;
}

.hymnals-empty-state h3 {
    margin: 0 0 8px;
    color: #21425b;
    font-family: "Playfair Display", Georgia, serif;
    font-size: 1.45rem;
}

.hymnals-empty-state p {
    max-width: 560px;
    margin: 0 auto;
    color: #70818d;
    line-height: 1.65;
}

.hymnals-no-results {
    margin-top: 18px;
    padding: 24px;
    border-radius: 13px;
    background: #fff;
    color: #5e7380;
    text-align: center;
}

.hymnals-no-results strong,
.hymnals-no-results span {
    display: block;
}

.hymnals-no-results span {
    margin-top: 6px;
    font-size: .88rem;
}

[hidden] {
    display: none !important;
}

@media (max-width: 900px) {
    .hymnals-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 620px) {
    .hymnals-hero {
        padding: 58px 0 54px;
    }
    .hymnals-hero-icon {
        flex-basis: 78px;
        width: 78px;
        height: 78px;
        border-radius: 22px;
        font-size: 3.7rem;
    }
    .hymnals-library-section {
        padding: 42px 0 60px;
    }
    .hymnals-section-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
    .hymnals-toolbar {
        align-items: stretch;
        flex-direction: column;
    }
    .hymnals-filters {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .hymnals-filters button {
        padding: 0 7px;
    }
    .hymnals-grid {
        grid-template-columns: 1fr;
    }
    .hymnals-folder-card {
        min-height: 88px;
    }
}
