/* =========================================================
   PLEXO BOOKS / LIVROS
   Visual limpo, branco e explorável
   ========================================================= */

:root {
    --plexo-orange: #ff6b1a;
    --plexo-orange-dark: #e25508;
    --plexo-orange-soft: #fff1e8;

    --plexo-green: #12372a;
    --plexo-ink: #17211d;
    --plexo-text: #253238;
    --plexo-muted: #6b7280;
    --plexo-muted-2: #8b93a1;
    --plexo-border: #e7eaf0;
    --plexo-soft-border: rgba(18, 55, 42, 0.08);
    --plexo-bg: #ffffff;
    --plexo-soft: #f7f8f6;
    --plexo-white: #ffffff;

    --font-display: 'Quicksand', 'Nunito', system-ui, sans-serif;
    --font-body: 'Nunito', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-ui: 'Plus Jakarta Sans', 'Nunito', system-ui, sans-serif;

    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --radius-pill: 999px;
}

.books-section {
    min-height: 70vh;
    padding: 44px 0 86px;
    background: #f7f4ef;
    color: var(--plexo-text);
    font-family: var(--font-body);
}

/* =========================================================
   TOPO
   ========================================================= */

.books-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    align-items: end;
    margin-bottom: 22px;
}

.books-title-block {
    min-width: 0;
}

.books-eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 8px;
    color: var(--plexo-orange);
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 900;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.books-head h1,
.books-title-block h1 {
    margin: 0;
    color: var(--plexo-ink);
    font-family: var(--font-display);
    font-size: clamp(2rem, 4vw, 3.2rem);
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.055em;
}

.books-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
}

.books-search {
    flex: 1;
    min-height: 52px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(18, 55, 42, 0.12);
    border-radius: 999px;
    background: #fff;
    padding: 0 18px;
    box-shadow: 0 10px 24px rgba(18, 42, 35, 0.05);
}

.books-search svg {
    width: 19px;
    height: 19px;
    flex: 0 0 auto;
    fill: none;
    stroke: var(--plexo-muted);
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.books-search input {
    width: 100%;
    min-height: 50px;
    border: 0;
    background: transparent;
    color: var(--plexo-text);
    font: inherit;
    font-size: 0.95rem;
    font-weight: 750;
}

.books-search input:focus {
    outline: none;
}

.books-search input::placeholder {
    color: var(--plexo-muted-2);
}

.books-search-submit {
    min-height: 50px;
    padding: 0 18px;
    border: 1px solid var(--plexo-orange);
    border-radius: 999px;
    background: var(--plexo-orange);
    color: #fff;
    font: inherit;
    font-size: 0.9rem;
    font-weight: 950;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease;
}

.books-search-submit:hover {
    transform: translateY(-1px);
    background: var(--plexo-orange-dark);
}

/* =========================================================
   FILTROS
   ========================================================= */

.books-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: 10px;
    margin-bottom: 14px;
}

.filter-field {
    min-width: 170px;
    display: grid;
    gap: 7px;
}

.filter-field span {
    color: var(--plexo-ink);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 950;
    letter-spacing: 0.07em;
    text-transform: uppercase;
}

.books-filter select {
    min-width: 170px;
    height: 42px;
    padding: 0 38px 0 14px;
    color: var(--plexo-text);
    background: #fff;
    border: 1px solid rgba(18, 55, 42, 0.12);
    border-radius: 999px;
    outline: none;
    font-family: var(--font-body);
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
    appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--plexo-muted) 50%),
        linear-gradient(135deg, var(--plexo-muted) 50%, transparent 50%);
    background-position:
        calc(100% - 18px) 18px,
        calc(100% - 13px) 18px;
    background-size: 5px 5px, 5px 5px;
    background-repeat: no-repeat;
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.books-filter select:focus {
    border-color: rgba(255, 107, 26, 0.45);
    box-shadow: 0 0 0 4px rgba(255, 107, 26, 0.08);
}

.filter-submit,
.filter-clear {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 16px;
    border-radius: 999px;
    font-family: var(--font-ui);
    font-size: 12px;
    font-weight: 950;
    text-decoration: none;
    cursor: pointer;
}

.filter-submit {
    color: #fff;
    background: var(--plexo-orange);
    border: 1px solid var(--plexo-orange);
}

.filter-submit:hover {
    background: var(--plexo-orange-dark);
}

.filter-clear {
    color: var(--plexo-green);
    background: #fff;
    border: 1px solid rgba(18, 55, 42, 0.14);
}

.books-result-meta {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 24px;
    color: var(--plexo-muted);
    font-size: 0.86rem;
    font-weight: 800;
}
/* =========================================================
   GRID DE LIVROS — ESTILO PRATELEIRA / WATTPAD
   ========================================================= */

.books-grid,
.card-grid,
.books-shelf-grid {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 26px 14px;
}

.book-card,
.book-shelf-card {
    min-width: 0;
    background: transparent;
    border: 0;
    box-shadow: none;
    overflow: visible;
}

.book-shelf-cover {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 2 / 3;
    overflow: hidden;
    border-radius: 6px;
    background: #f1f3f2;
    text-decoration: none;
    box-shadow: 0 8px 18px rgba(18, 42, 35, 0.1);
    transition: transform 160ms ease, box-shadow 160ms ease;
}

.book-shelf-card:hover .book-shelf-cover {
    transform: translateY(-3px);
    box-shadow: 0 14px 28px rgba(18, 42, 35, 0.16);
}

.book-shelf-cover img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}

.book-shelf-placeholder {
    width: 100%;
    height: 100%;
    display: grid;
    place-items: center;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 34%),
        linear-gradient(180deg, #12372a 0%, #0d2d23 100%);
    color: #fff;
    font-family: var(--font-display);
    font-size: 2rem;
    font-weight: 1000;
    letter-spacing: 0.08em;
}

.book-shelf-type {
    position: absolute;
    left: 8px;
    top: 8px;
    min-height: 22px;
    display: inline-flex;
    align-items: center;
    padding: 0 8px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    color: var(--plexo-orange-dark);
    font-family: var(--font-ui);
    font-size: 0.62rem;
    font-weight: 1000;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.book-shelf-card:hover .book-shelf-type {
    opacity: 1;
    transform: translateY(0);
}

.book-shelf-info {
    padding-top: 8px;
}

.book-shelf-info h2 {
    margin: 0;
    max-width: 100%;
    min-height: auto;
    color: var(--plexo-ink);
    font-family: var(--font-body);
    font-size: 0.92rem;
    line-height: 1.22;
    font-weight: 900;
    letter-spacing: -0.01em;
}

.book-shelf-info h2 a {
    color: inherit;
    text-decoration: none;
}

.book-shelf-info h2 a:hover {
    color: var(--plexo-orange);
}

.book-shelf-info p {
    margin: 4px 0 0;
    color: var(--plexo-muted);
    font-size: 0.78rem;
    line-height: 1.25;
    font-weight: 750;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-shelf-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 6px;
    color: var(--plexo-muted);
    font-size: 0.76rem;
    font-weight: 850;
}

.book-shelf-price {
    min-width: 0;
    color: var(--plexo-ink);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.book-shelf-likes {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--plexo-muted);
    white-space: nowrap;
}

.book-shelf-likes svg {
    width: 13px;
    height: 13px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.book-shelf-actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 8px;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 160ms ease, transform 160ms ease;
}

.book-shelf-card:hover .book-shelf-actions,
.book-shelf-card:focus-within .book-shelf-actions {
    opacity: 1;
    transform: translateY(0);
}

.book-shelf-actions form {
    margin: 0;
}

.book-shelf-action {
    width: 30px;
    height: 30px;
    display: inline-grid;
    place-items: center;
    border: 1px solid rgba(255, 107, 26, 0.34);
    border-radius: 999px;
    background: #fff;
    color: var(--plexo-orange);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 1000;
    text-decoration: none;
    cursor: pointer;
    transition: transform 160ms ease, background 160ms ease, border-color 160ms ease, color 160ms ease;
}

.book-shelf-action:hover {
    transform: translateY(-1px);
    background: var(--plexo-orange-soft);
}

.book-shelf-action.is-active {
    background: var(--plexo-orange);
    border-color: var(--plexo-orange);
    color: #fff;
}

/* Compatibilidade com classes antigas */
.book-cover-link,
.book-cover-img,
.cover-img,
.book-cover-placeholder,
.book-info,
.book-type,
.book-bottom,
.small-link,
.read-later-link,
.favorite-link,
.like-link {
    /* Mantidas para outras páginas que ainda possam usar estes seletores */
}

/* =========================================================
   EMPTY STATE
   ========================================================= */

.empty-state {
    grid-column: 1 / -1;
    padding: 54px 24px;
    text-align: center;
    background: #fff;
    border: 1px dashed #d7dde5;
    border-radius: var(--radius-md);
}

.empty-state h2 {
    margin: 0 0 8px;
    color: var(--plexo-ink);
    font-family: var(--font-display);
    font-size: 28px;
    font-weight: 900;
    letter-spacing: -0.035em;
}

.empty-state p {
    margin: 0;
    color: var(--plexo-muted);
    font-size: 15px;
    font-weight: 700;
}

.empty-state a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    margin-top: 18px;
    padding: 0 16px;
    border: 1px solid var(--plexo-orange);
    border-radius: 999px;
    color: var(--plexo-orange);
    text-decoration: none;
    font-weight: 950;
}

.empty-state a:hover {
    background: var(--plexo-orange);
    color: #fff;
}

.read-later-empty {
    max-width: 680px;
    margin: 0 auto;
    background: var(--plexo-white);
}

.read-later-empty p {
    max-width: 520px;
    margin: 10px auto 20px;
    line-height: 1.6;
}

/* =========================================================
   DETALHE DO LIVRO — COMPATIBILIDADE
   ========================================================= */

.book-cover.large,
.cover-img.large {
    min-height: 320px;
    aspect-ratio: 3 / 4;
    border-radius: 0;
}

.book-detail-page {
    padding-top: 22px;
    background: var(--plexo-bg);
}

.detail-hero {
    display: grid;
    gap: 24px;
}

.detail-cover-column {
    max-width: 360px;
}

.detail-cover {
    width: 100%;
    min-height: 420px;
    border-radius: 0;
    box-shadow: none;
}

.detail-main-column,
.detail-copy,
.detail-body-grid,
.access-form {
    display: grid;
    gap: 18px;
}

.detail-copy h1 {
    margin: 0;
    color: var(--plexo-ink);
    font-family: var(--font-display);
    font-size: clamp(2rem, 7vw, 3.8rem);
    line-height: 0.98;
    font-weight: 850;
    letter-spacing: -0.065em;
}

.detail-author-line {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    color: var(--plexo-muted);
    font-weight: 650;
}

.detail-author-line a,
.detail-author-line strong {
    color: var(--plexo-ink);
    font-weight: 900;
}

.detail-meta-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.detail-meta-grid div,
.detail-access-card,
.detail-description-card,
.detail-chapters-card,
.chapter-card,
.access-panel {
    background: #ffffff;
    border: 1px solid var(--plexo-border);
    border-radius: var(--radius-md);
    box-shadow: none;
}

.detail-meta-grid div,
.detail-access-card,
.detail-description-card,
.detail-chapters-card {
    padding: 20px;
}

.detail-meta-grid span {
    display: block;
    margin-bottom: 6px;
    color: var(--plexo-muted);
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.detail-meta-grid strong,
.detail-access-card h2,
.detail-description-card h2,
.detail-chapters-card h2 {
    color: var(--plexo-ink);
}

.detail-access-kicker {
    display: inline-flex;
    align-items: center;
    margin-bottom: 12px;
    padding: 7px 11px;
    color: var(--plexo-orange-dark);
    background: var(--plexo-orange-soft);
    border-radius: var(--radius-pill);
    font-family: var(--font-ui);
    font-size: 11px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.detail-access-card h2,
.detail-description-card h2,
.detail-chapters-card h2 {
    margin: 0 0 10px;
    font-family: var(--font-display);
    font-size: 1.35rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.detail-access-card p,
.detail-description-card p,
.detail-muted {
    margin: 0;
    color: var(--plexo-muted);
    line-height: 1.65;
    font-weight: 650;
}

.detail-cta {
    width: 100%;
}

.detail-read-later-form {
    margin-top: 18px;
}

.detail-read-later,
.detail-favorite,
.detail-like {
    margin-top: 18px;
    width: 100%;
}

.detail-read-later-form .detail-read-later,
.detail-read-later-form .detail-favorite,
.detail-read-later-form .detail-like {
    margin-top: 0;
}

.detail-read-later.is-active,
.detail-favorite.is-active,
.detail-like.is-active {
    color: #ffffff;
    background: var(--plexo-orange);
    border-color: var(--plexo-orange);
}

.detail-like {
    color: var(--plexo-green);
    border-color: rgba(18, 55, 42, 0.28);
}

.detail-section-head,
.related-section {
    margin-top: 18px;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.chapter-list {
    margin-top: 36px;
}

.chapter-card,
.access-panel {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 12px;
    padding: 18px;
}

.access-panel {
    display: grid;
    justify-content: stretch;
}

/* =========================================================
   PAGINAÇÃO
   ========================================================= */

.books-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 34px;
    color: var(--plexo-muted);
    font-weight: 850;
}

.books-pagination a {
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 0 16px;
    border: 1px solid var(--plexo-border);
    border-radius: 999px;
    background: #fff;
    color: var(--plexo-ink);
    text-decoration: none;
}

.books-pagination a:hover {
    border-color: var(--plexo-orange);
    color: var(--plexo-orange);
}

/* =========================================================
   ACESSIBILIDADE
   ========================================================= */

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
}

/* =========================================================
   RESPONSIVO
   ========================================================= */
@media (max-width: 1180px) {
    .books-grid,
    .card-grid,
    .books-shelf-grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }
}

@media (max-width: 980px) {
    .books-grid,
    .card-grid,
    .books-shelf-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 760px) {
    .books-section {
        padding-top: 34px;
    }

    .books-search-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .books-search-submit {
        width: 100%;
    }

    .books-filter {
        display: grid;
        grid-template-columns: 1fr 1fr;
        align-items: end;
    }

    .filter-field {
        min-width: 0;
    }

    .books-filter select {
        min-width: 0;
    }

    .filter-submit,
    .filter-clear {
        width: 100%;
    }

    .books-result-meta {
        justify-content: flex-start;
    }

    .books-grid,
    .card-grid,
    .books-shelf-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 24px 12px;
    }

    .book-shelf-actions {
        opacity: 1;
        transform: none;
    }
}

@media (max-width: 520px) {
    .books-section {
        padding-bottom: 58px;
    }

    .books-filter {
        grid-template-columns: 1fr;
    }

    .books-grid,
    .card-grid,
    .books-shelf-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 24px 12px;
    }

    .book-shelf-info h2 {
        font-size: 0.86rem;
    }

    .book-shelf-info p,
    .book-shelf-meta {
        font-size: 0.72rem;
    }

    .detail-meta-grid,
    .related-grid {
        grid-template-columns: 1fr;
    }

    .chapter-card,
    .access-panel {
        align-items: flex-start;
        flex-direction: column;
    }
}