/**
 * BookOrb - Application Stylesheet
 * 
 * Supplements the critical CSS inlined in the layout.
 * Kept minimal - target <15KB total CSS.
 */

/* ─────────────────────────────────────────────── */
/* HERO SECTION                                     */
/* ─────────────────────────────────────────────── */

.hero {
    padding: 4rem 0 3rem;
    text-align: center;
    background: radial-gradient(ellipse at 50% 0%, var(--color-accent-glow) 0%, transparent 60%);
}

.hero__title {
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--color-text) 0%, var(--color-accent-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero__subtitle {
    color: var(--color-text-muted);
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.hero__search {
    position: relative;
    max-width: 640px;
    margin: 0 auto 1.5rem;
}

.hero__search-input {
    width: 100%;
    padding: 1rem 3.5rem 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    color: var(--color-text);
    font-size: 1rem;
    font-family: var(--font-body);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.hero__search-input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 4px var(--color-accent-glow), var(--shadow-lg);
}

.hero__search-input::placeholder {
    color: var(--color-text-muted);
}

.hero__search-btn {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: var(--color-accent);
    border: none;
    border-radius: var(--radius-md);
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    font-size: 1.1rem;
    transition: background 0.2s;
}

.hero__search-btn:hover {
    background: var(--color-accent-light);
}

.hero__suggestions {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.85rem;
}

.hero__suggestions-label {
    color: var(--color-text-muted);
}

.hero__suggestion {
    padding: 0.3rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 100px;
    color: var(--color-text-muted);
    font-size: 0.8rem;
    transition: all 0.2s;
}

.hero__suggestion:hover {
    color: var(--color-accent-light);
    border-color: var(--color-accent);
    background: var(--color-accent-glow);
}

/* ─────────────────────────────────────────────── */
/* SECTIONS                                         */
/* ─────────────────────────────────────────────── */

.section {
    padding: 3rem 0;
}

.section__title {
    margin-bottom: 1.5rem;
}

/* ─────────────────────────────────────────────── */
/* GENRE GRID                                       */
/* ─────────────────────────────────────────────── */

.genre-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.genre-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.25rem 0.75rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    text-align: center;
    transition: all 0.2s;
    color: var(--color-text);
}

.genre-card:hover {
    background: var(--color-surface-hover);
    border-color: var(--color-accent);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    color: var(--color-text);
}

.genre-card__icon {
    font-size: 1.75rem;
}

.genre-card__name {
    font-size: 0.85rem;
    font-weight: 600;
}

/* ─────────────────────────────────────────────── */
/* ABOUT BLOCK                                      */
/* ─────────────────────────────────────────────── */

.about-block {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}

.about-block p {
    color: var(--color-text-muted);
    max-width: 700px;
    margin-bottom: 2rem;
    line-height: 1.7;
}

.about-features {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.25rem;
}

.about-feature {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.about-feature strong {
    color: var(--color-accent-light);
    font-size: 0.95rem;
}

.about-feature span {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ─────────────────────────────────────────────── */
/* BOOK CARDS (reusable component)                  */
/* ─────────────────────────────────────────────── */

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.25rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--color-text);
    transition: transform 0.2s;
}

.book-card:hover {
    transform: translateY(-3px);
    color: var(--color-text);
}

.book-card__cover {
    aspect-ratio: 2/3;
    background: var(--color-surface);
    border-radius: var(--radius-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.book-card__title {
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.book-card__author {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.book-card__rating {
    font-size: 0.8rem;
    color: var(--color-gold);
}

/* ─────────────────────────────────────────────── */
/* RATING STARS                                     */
/* ─────────────────────────────────────────────── */

.stars {
    color: var(--color-gold);
    letter-spacing: 1px;
}

/* ─────────────────────────────────────────────── */
/* BOOK GRID                                         */
/* ─────────────────────────────────────────────── */

.book-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1.5rem;
}

.book-grid .book-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    text-decoration: none;
    color: inherit;
    transition: transform 0.15s ease;
}

.book-grid .book-card:hover {
    transform: translateY(-3px);
}

.book-grid .book-card__cover {
    width: 100%;
    aspect-ratio: 2/3;
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}

.book-grid .book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ─────────────────────────────────────────────── */
/* INSTANT SEARCH DROPDOWN                           */
/* ─────────────────────────────────────────────── */

.search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    margin-top: 0.25rem;
    box-shadow: 0 8px 30px rgba(0,0,0,0.4);
    z-index: 1000;
    display: none;
    max-height: 400px;
    overflow-y: auto;
}

.search-dropdown.active { display: block; }

.search-dropdown__item {
    display: flex;
    gap: 0.75rem;
    padding: 0.6rem 0.85rem;
    text-decoration: none;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
    transition: background 0.1s;
}

.search-dropdown__item:last-child { border-bottom: none; }
.search-dropdown__item:hover,
.search-dropdown__item.active { background: rgba(99,102,241,0.08); }

.search-dropdown__cover {
    width: 36px;
    height: 54px;
    border-radius: 3px;
    background: var(--color-bg);
    flex-shrink: 0;
    overflow: hidden;
}

.search-dropdown__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-dropdown__info { min-width: 0; }

.search-dropdown__title {
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-dropdown__author {
    font-size: 0.75rem;
    color: var(--color-text-muted);
}

.search-dropdown__footer {
    padding: 0.5rem 0.85rem;
    font-size: 0.8rem;
    color: var(--color-accent-light);
    text-align: center;
    border-top: 1px solid var(--color-border);
}

/* ─────────────────────────────────────────────── */
/* AUTH FORMS                                        */
/* ─────────────────────────────────────────────── */

.auth-page input:focus {
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.15);
}

.auth-page button[type="submit"]:hover {
    opacity: 0.9;
}

/* ─────────────────────────────────────────────── */
/* BREADCRUMBS (SEO - visible nav on entity pages)  */
/* ─────────────────────────────────────────────── */

.breadcrumb {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
    padding-top: 1.5rem;
}
.breadcrumb a {
    color: var(--color-text-muted);
    text-decoration: none;
}
.breadcrumb a:hover {
    color: var(--color-accent-light);
}

/* ─────────────────────────────────────────────── */
/* GENRE CARD COUNT                                  */
/* ─────────────────────────────────────────────── */

.genre-card__count {
    display: block;
    font-size: 0.7rem;
    color: var(--color-text-muted);
    margin-top: 0.15rem;
}

/* ─────────────────────────────────────────────── */
/* RESPONSIVE                                       */
/* ─────────────────────────────────────────────── */

@media (max-width: 768px) {
    .hero {
        padding: 2.5rem 0 2rem;
    }

    .hero__search-input {
        font-size: 0.9rem;
        padding: 0.85rem 3rem 0.85rem 1rem;
    }

    .genre-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 0.5rem;
    }

    .genre-card {
        padding: 1rem 0.5rem;
    }

    .genre-card__icon {
        font-size: 1.25rem;
    }

    .about-block {
        padding: 1.5rem;
    }

    .about-features {
        grid-template-columns: 1fr;
    }
}

/* ─────────────────────────────────────────────── */
/* HOME FEED (Logged-in personalization)           */
/* ─────────────────────────────────────────────── */

.hf-goal { margin-bottom: 1.5rem; }
.hf-goal__bar { height: 8px; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: 100px; overflow: hidden; }
.hf-goal__fill { height: 100%; background: linear-gradient(90deg, var(--color-accent), var(--color-accent-light)); border-radius: 100px; transition: width 0.4s ease; }
.hf-goal__text { font-size: 0.8rem; color: var(--color-text-muted); margin-top: 0.35rem; display: block; }

.hf-section-title {
    display: flex; align-items: center; gap: 0.5rem;
    font-size: 1rem; font-family: var(--font-body); font-weight: 700;
    color: var(--color-text); margin-bottom: 0.85rem;
}
.hf-section-title svg { color: var(--color-accent-light); }

.hf-reading-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 0.75rem; }

.hf-reading-card {
    display: flex; gap: 0.85rem; padding: 0.85rem;
    background: var(--color-surface); border: 1px solid var(--color-border);
    border-radius: var(--radius-md); text-decoration: none; transition: all 0.2s;
}
.hf-reading-card:hover { border-color: var(--color-accent); transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.hf-reading-card__cover {
    width: 48px; height: 72px; border-radius: 4px; overflow: hidden; flex-shrink: 0;
    background: var(--color-bg); display: flex; align-items: center; justify-content: center;
}
.hf-reading-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.hf-reading-card__cover span { font-size: 0.55rem; color: var(--color-text-muted); text-align: center; padding: 0.2rem; }
.hf-reading-card__info { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; }
.hf-reading-card__title { font-size: 0.88rem; font-weight: 600; color: var(--color-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hf-reading-card__author { font-size: 0.75rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 0.1rem; }
.hf-reading-card__progress { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.4rem; }
.hf-reading-card__bar { flex: 1; height: 4px; background: var(--color-border); border-radius: 100px; overflow: hidden; }
.hf-reading-card__fill { height: 100%; background: var(--color-accent); border-radius: 100px; }
.hf-reading-card__progress span { font-size: 0.7rem; color: var(--color-accent-light); font-weight: 600; }

@media (max-width: 640px) {
    .hf-reading-grid { grid-template-columns: 1fr; }
}
