/*
Theme Name: Book Vault
Theme URI: https://example.com/book-vault
Author: Vault Dev
Description: A premium, Storytel-inspired black and white e-library theme.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
Text Domain: bookvault
*/

:root {
    --bg-white: #ffffff;
    --bg-light-gray: #f5f5f5;
    --text-black: #000000;
    --text-dark-gray: #333333;
    --text-mid-gray: #757575;
    --border-color: #e0e0e0;
    --shadow-soft: 0 10px 30px rgba(0, 0, 0, 0.08);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background-color: var(--bg-white);
    color: var(--text-black);
    font-family: "Inter", Arial, sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
}

body.admin-bar .site-header {
    top: 32px;
}

h1,
h2,
h3 {
    font-family: "Playfair Display", Georgia, serif;
}

a {
    color: inherit;
}

img {
    height: auto;
    max-width: 100%;
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}

.site-header {
    align-items: center;
    background: var(--bg-white);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    padding: 15px 4%;
    position: sticky;
    top: 0;
    z-index: 100;
}

.logo-container {
    align-items: center;
    color: var(--text-black);
    display: flex;
    gap: 12px;
    text-decoration: none;
}

.logo-mark {
    align-items: center;
    border: 2px solid var(--text-black);
    border-radius: 50%;
    display: inline-flex;
    height: 34px;
    justify-content: center;
    width: 34px;
}

.logo-text {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.nav-center {
    display: flex;
    gap: 30px;
}

.nav-center a,
.menu a {
    color: var(--text-dark-gray);
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.nav-center a:hover,
.menu a:hover {
    color: var(--text-black);
}

.menu {
    display: flex;
    gap: 30px;
    list-style: none;
}

.nav-right {
    align-items: center;
    display: flex;
    gap: 20px;
}

.btn-outline-black,
.btn-solid-black,
.btn-pricing {
    border-radius: 50px;
    display: inline-flex;
    font-size: 0.9rem;
    font-weight: 700;
    justify-content: center;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-outline-black {
    border: 2px solid var(--text-black);
    color: var(--text-black);
    padding: 8px 20px;
}

.btn-outline-black:hover {
    background: var(--text-black);
    color: var(--bg-white);
}

.btn-solid-black {
    background: var(--text-black);
    border: 2px solid var(--text-black);
    color: var(--bg-white);
    padding: 10px 24px;
}

.btn-solid-black:hover,
.btn-pricing:hover {
    background: var(--text-dark-gray);
    border-color: var(--text-dark-gray);
}

.hero {
    align-items: center;
    background: var(--bg-white);
    display: flex;
    justify-content: space-between;
    min-height: 560px;
    padding: 80px 4% 60px;
}

.hero-text {
    max-width: 45%;
}

.hero-text h1 {
    font-size: clamp(3rem, 6vw, 5.25rem);
    line-height: 1.05;
    margin-bottom: 20px;
}

.hero-text p {
    color: var(--text-mid-gray);
    font-size: 1.2rem;
    margin-bottom: 30px;
    max-width: 90%;
}

.hero-image {
    display: flex;
    justify-content: center;
    position: relative;
    width: 50%;
}

.hero-book-stack {
    display: flex;
    gap: 20px;
    transform: rotate(-5deg);
}

.hero-book {
    aspect-ratio: 2 / 3;
    border-radius: 8px;
    box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    transition: transform 0.3s ease;
    width: 180px;
}

.hero-book:hover {
    transform: translateY(-10px) rotate(5deg);
}

.section-row {
    padding: 40px 0 20px;
}

.section-row.is-muted {
    background: var(--bg-light-gray);
    padding-bottom: 40px;
    padding-top: 40px;
}

.row-header {
    align-items: baseline;
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding: 0 4%;
}

.row-header h2 {
    font-size: 1.8rem;
}

.row-header a {
    align-items: center;
    color: var(--text-mid-gray);
    display: flex;
    font-size: 0.9rem;
    font-weight: 600;
    gap: 5px;
    text-decoration: none;
}

.carousel-track {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 0 4% 30px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.carousel-track::-webkit-scrollbar {
    display: none;
}

.book-card {
    color: var(--text-black);
    cursor: pointer;
    flex: 0 0 auto;
    text-decoration: none;
    transition: transform 0.2s ease;
    width: 160px;
}

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

.book-cover {
    aspect-ratio: 2 / 3;
    background: #eeeeee;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    width: 160px;
}

.book-meta {
    margin-top: 10px;
}

.book-meta h4 {
    font-family: "Inter", Arial, sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.book-meta span {
    color: var(--text-mid-gray);
    display: block;
    font-size: 0.8rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.empty-row {
    color: var(--text-mid-gray);
    padding: 10px 4% 30px;
}

.pricing-section {
    background: var(--bg-light-gray);
    padding: 80px 4%;
}

.pricing-section h2 {
    font-size: 2.5rem;
    margin-bottom: 12px;
    text-align: center;
}

.pricing-subtitle {
    color: var(--text-mid-gray);
    margin-bottom: 40px;
    text-align: center;
}

.pricing-grid {
    display: grid;
    gap: 20px;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    margin: 0 auto;
    max-width: 1200px;
}

.pricing-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 30px;
    text-align: center;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
}

.pricing-card:hover {
    border-color: #cccccc;
    box-shadow: var(--shadow-soft);
}

.pricing-card.featured {
    background: var(--text-black);
    border: none;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.2);
    color: var(--bg-white);
    transform: scale(1.05);
}

.tier {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: 1px;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.price {
    font-size: 3rem;
    font-weight: 800;
    margin-bottom: 5px;
}

.price span {
    font-size: 1rem;
    font-weight: 400;
}

.btn-pricing {
    background: var(--text-black);
    border: 2px solid var(--text-black);
    color: var(--bg-white);
    margin-top: 20px;
    padding: 12px 20px;
}

.pricing-card.featured .btn-pricing {
    background: var(--bg-white);
    border-color: var(--bg-white);
    color: var(--text-black);
}

.pricing-card.featured .btn-pricing:hover {
    background: transparent;
    color: var(--bg-white);
}

.single-book-container,
.content-container {
    margin: 60px auto;
    max-width: 800px;
    padding: 0 4%;
}

.single-book-container h1,
.content-container h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    line-height: 1.1;
}

.single-book-excerpt {
    color: var(--text-mid-gray);
    font-size: 1.1rem;
    margin-top: 10px;
}

.book-preview-container {
    background: var(--bg-light-gray);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-top: 30px;
    max-height: 300px;
    overflow: hidden;
    padding: 30px;
    position: relative;
}

.book-preview-container.is-unlocked {
    max-height: none;
}

.book-preview-text {
    color: var(--text-dark-gray);
    filter: blur(5px);
    line-height: 1.8;
    user-select: none;
}

.unlocked-content {
    color: var(--text-dark-gray);
    line-height: 1.8;
}

.unlocked-content > * + *,
.book-preview-text > * + * {
    margin-top: 1rem;
}

.preview-lock {
    background: var(--bg-white);
    border: 2px solid var(--text-black);
    border-radius: 12px;
    box-shadow: var(--shadow-soft);
    left: 50%;
    max-width: calc(100% - 40px);
    padding: 40px;
    position: absolute;
    text-align: center;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 320px;
    z-index: 10;
}

.preview-lock i {
    font-size: 2rem;
    margin-bottom: 15px;
}

.preview-lock h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.preview-lock p {
    color: var(--text-mid-gray);
    font-size: 0.9rem;
    margin-bottom: 25px;
}

.site-footer {
    background: var(--text-black);
    color: var(--bg-white);
    padding: 36px 4%;
}

.footer-inner {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    max-width: 1200px;
}

.footer-inner p {
    color: rgba(255, 255, 255, 0.72);
    font-size: 0.9rem;
}

@media (max-width: 900px) {
    body.admin-bar .site-header {
        top: 46px;
    }

    .site-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 16px;
        position: relative;
    }

    .nav-center,
    .menu,
    .nav-right {
        flex-wrap: wrap;
        gap: 16px;
    }

    .hero {
        align-items: flex-start;
        flex-direction: column;
        gap: 48px;
        min-height: auto;
        padding-top: 56px;
    }

    .hero-text,
    .hero-image {
        max-width: none;
        width: 100%;
    }

    .hero-text p {
        max-width: none;
    }

    .hero-book {
        width: min(29vw, 160px);
    }

    .pricing-card.featured {
        transform: none;
    }
}

@media (max-width: 560px) {
    .hero {
        padding: 42px 5% 48px;
    }

    .row-header {
        align-items: flex-start;
        flex-direction: column;
        gap: 10px;
        padding: 0 5%;
    }

    .carousel-track {
        padding-left: 5%;
        padding-right: 5%;
    }

    .book-card,
    .book-cover {
        width: 132px;
    }

    .preview-lock {
        padding: 28px 22px;
    }

    .footer-inner {
        align-items: flex-start;
        flex-direction: column;
        gap: 12px;
    }
}
