/* ============================================
   GEANTEK IT Books Library — styles
   Uses existing brand tokens: #4db2ec / #218ac8 / #0b1929 / #eef8ff
   ============================================ */

/* ---------- Section titles ---------- */
.book-section-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.125rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 1rem;
}
.book-section-title i {
    color: #4db2ec;
}

/* ---------- Filter bar ---------- */
.book-filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.6rem;
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    padding: 1rem 1.1rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.book-filter-bar__search {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex: 1 1 220px;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.55rem 0.85rem;
}
.book-filter-bar__search i {
    color: #94a3b8;
    font-size: 0.8rem;
}
.book-filter-bar__search input {
    border: none;
    background: transparent;
    outline: none;
    font-size: 0.8125rem;
    width: 100%;
    color: #0f172a;
}

.book-filter-bar select {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #334155;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.6rem;
    padding: 0.55rem 0.75rem;
    cursor: pointer;
}
.book-filter-bar select:focus {
    outline: none;
    border-color: #4db2ec;
}

.book-filter-bar__checkbox {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: #475569;
    white-space: nowrap;
}

.book-filter-bar__submit {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background-color: #4db2ec;
    color: #ffffff;
    font-weight: 700;
    font-size: 0.8rem;
    padding: 0.6rem 1.1rem;
    border-radius: 0.6rem;
    border: none;
    cursor: pointer;
    transition: background-color 0.2s ease;
}
.book-filter-bar__submit:hover {
    background-color: #218ac8;
}

.book-filter-bar__reset {
    font-size: 0.78rem;
    font-weight: 700;
    color: #ef4444;
    text-decoration: underline;
    white-space: nowrap;
}

/* ---------- Book grid ---------- */
.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 1.25rem;
}
.book-grid--scroll {
    display: flex;
    overflow-x: auto;
    gap: 1.25rem;
    padding-bottom: 0.5rem;
    scrollbar-width: thin;
}
.book-grid--scroll .book-card {
    flex: 0 0 200px;
}

/* ---------- Book card ---------- */
.book-card {
    background-color: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 0.85rem;
    overflow: hidden;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}
.book-card:hover {
    box-shadow: 0 10px 25px -8px rgba(15, 23, 42, 0.15);
    transform: translateY(-2px);
}

.book-card__cover-link {
    display: block;
}
.book-card__cover {
    position: relative;
    aspect-ratio: 3 / 4;
    background-color: #0b1929;
    overflow: hidden;
}
.book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.book-card__cover-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #4db2ec;
    font-size: 2.5rem;
    opacity: 0.7;
}

.book-card__body {
    padding: 0.9rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    flex-grow: 1;
}

.book-card__title {
    font-size: 0.875rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.book-card__title a {
    color: inherit;
    text-decoration: none;
}
.book-card__title a:hover {
    color: #218ac8;
}

.book-card__author {
    font-size: 0.72rem;
    color: #64748b;
    font-weight: 600;
}

.book-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    font-size: 0.65rem;
    font-weight: 700;
    color: #218ac8;
}
.book-card__category,
.book-card__format {
    background-color: #eef8ff;
    padding: 0.15rem 0.5rem;
    border-radius: 0.35rem;
}

.book-card__cta {
    margin-top: auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    font-size: 0.72rem;
    font-weight: 700;
    color: #ffffff;
    background-color: #4db2ec;
    border-radius: 0.5rem;
    padding: 0.5rem;
    text-decoration: none;
    transition: background-color 0.2s ease;
}
.book-card__cta:hover {
    background-color: #218ac8;
}

/* ---------- Badges ---------- */
.book-badge {
    position: absolute;
    top: 0.5rem;
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    padding: 0.2rem 0.5rem;
    border-radius: 0.3rem;
    color: #ffffff;
}
.book-badge--free {
    right: 0.5rem;
    background-color: #16a34a;
}
.book-badge--category {
    position: static;
    background-color: #eef8ff;
    color: #218ac8;
}
.badge-difficulty--beginner {
    left: 0.5rem;
    background-color: #4db2ec;
}
.badge-difficulty--intermediate {
    left: 0.5rem;
    background-color: #f59e0b;
}
.badge-difficulty--advanced {
    left: 0.5rem;
    background-color: #ef4444;
}
/* On the single page the badges aren't absolutely positioned over an image */
.book-detail-cover + * .book-badge,
h1 ~ .flex .book-badge {
    position: static;
}

/* ---------- Single book page ---------- */
.book-detail-cover {
    border-radius: 0.85rem;
    overflow: hidden;
    border: 1px solid #e2e8f0;
    box-shadow: 0 4px 10px -4px rgba(15, 23, 42, 0.1);
    aspect-ratio: 3 / 4;
    background-color: #0b1929;
}
.book-detail-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
    font-size: 0.78rem;
    color: #475569;
    font-weight: 600;
}
.book-meta-row i {
    color: #4db2ec;
    margin-right: 0.25rem;
}

.book-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 800;
    padding: 0.8rem 1.5rem;
    border-radius: 0.65rem;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}
.book-cta-btn--local {
    background-color: #4db2ec;
    color: #ffffff;
    box-shadow: 0 6px 16px -4px rgba(77, 178, 236, 0.5);
}
.book-cta-btn--local:hover {
    background-color: #218ac8;
}
.book-cta-btn--local:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}
.book-cta-btn--external {
    background-color: #ffffff;
    color: #218ac8;
    border: 2px solid #4db2ec;
}
.book-cta-btn--external:hover {
    background-color: #eef8ff;
}

.book-cta-reference {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    background-color: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 0.65rem;
    padding: 0.9rem 1rem;
    font-size: 0.8rem;
    color: #475569;
}
.book-cta-reference i {
    color: #94a3b8;
    margin-top: 0.15rem;
}
.book-cta-reference a {
    color: #218ac8;
    font-weight: 700;
    text-decoration: underline;
}

.book-license-panel {
    display: flex;
    gap: 0.85rem;
    background-color: #eef8ff;
    border: 1px solid #bee3f8;
    border-radius: 0.75rem;
    padding: 1rem 1.15rem;
    font-size: 0.8rem;
    color: #0f172a;
}
.book-license-panel i {
    color: #218ac8;
    font-size: 1.1rem;
    margin-top: 0.1rem;
}
.book-license-panel p {
    margin: 0 0 0.3rem;
}
.book-license-panel a {
    color: #218ac8;
    font-weight: 700;
    text-decoration: underline;
}

.book-learn-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.6rem;
    font-size: 0.85rem;
    color: #334155;
}
.book-learn-list i {
    margin-right: 0.4rem;
}

.related-article-card {
    display: block;
    background-color: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 0.65rem;
    padding: 0.9rem;
    text-decoration: none;
    transition: border-color 0.2s ease;
}
.related-article-card:hover {
    border-color: #4db2ec;
}
.related-article-card__label {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #4db2ec;
    margin-bottom: 0.35rem;
}
.related-article-card h4 {
    font-size: 0.8rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
    line-height: 1.35;
}

.gean-breadcrumbs {
    font-size: 0.75rem;
    color: #64748b;
    margin-bottom: 0.5rem;
}
.gean-breadcrumbs a {
    color: #218ac8;
    text-decoration: none;
    font-weight: 600;
}
.gean-breadcrumbs a:hover {
    text-decoration: underline;
}
.gean-breadcrumbs .sep {
    margin: 0 0.3rem;
    color: #cbd5e1;
}
.gean-breadcrumbs .current {
    color: #334155;
    font-weight: 700;
}

/* ---------- Responsive ---------- */
@media (max-width: 640px) {
    .book-filter-bar {
        flex-direction: column;
        align-items: stretch;
    }
    .book-filter-bar select,
    .book-filter-bar__submit,
    .book-filter-bar__reset {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
    .book-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}