/*
Theme Name: Szeptslowa
Theme URI: https://szeptslowa.pl
Author: Paweł
Description: Minimalistyczny motyw WordPress dla platformy rozdziałów książki audio. Skupiony na łatwym wyszukiwaniu i odtwarzaniu kolejnych rozdziałów.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: szeptslowa
Tags: minimalist, audio, blog, custom-post-types
*/

/* ==========================================================================
   RESET & BASE
   ========================================================================== */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: #1c1c1c;
    background-color: #fafaf8;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

a {
    color: #8b5e3c;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover,
a:focus {
    color: #5c3d22;
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    line-height: 1.3;
    font-weight: 600;
    color: #1c1c1c;
}

ul, ol {
    padding-left: 1.5em;
}

/* ==========================================================================
   LAYOUT
   ========================================================================== */

.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.site-main {
    flex: 1;
    padding: 2rem 1rem 4rem;
}

.container {
    max-width: 760px;
    margin: 0 auto;
    width: 100%;
}

.container--wide {
    max-width: 1100px;
    margin: 0 auto;
    width: 100%;
    padding: 0 1.5rem;
}

/* ==========================================================================
   HEADER
   ========================================================================== */

.site-header {
    border-bottom: 1px solid #e8e4de;
    background: #fafaf8;
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(6px);
}

.site-header__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 60px;
    gap: 1.5rem;
}

.site-branding {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    flex-shrink: 0;
}

.site-branding .custom-logo-link {
    display: inline-flex;
    align-items: center;
    line-height: 1;
}

.site-branding .custom-logo {
    width: auto;
    max-width: 220px;
    max-height: 44px;
    height: auto;
}

.site-branding__name {
    font-size: 1.02rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: #1c1c1c;
    text-decoration: none;
    white-space: nowrap;
}

.site-branding__name:hover,
.site-branding__name:focus {
    color: #8b5e3c;
    text-decoration: none;
}

.site-title {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.site-title a {
    color: #1c1c1c;
    text-decoration: none;
}

.site-title a:hover {
    color: #8b5e3c;
    text-decoration: none;
}

.site-tagline {
    font-size: 0.75rem;
    color: #888;
    margin-top: 1px;
    letter-spacing: 0.02em;
}

/* Header search */
.header-search {
    flex: 1;
    max-width: 380px;
    position: relative;
}

.header-search__input {
    width: 100%;
    padding: 0.5rem 2.5rem 0.5rem 0.875rem;
    border: 1px solid #ddd8d0;
    border-radius: 6px;
    background: #fff;
    font-size: 0.9rem;
    color: #1c1c1c;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search__input:focus {
    border-color: #8b5e3c;
    box-shadow: 0 0 0 4px rgba(139, 94, 60, 0.14);
}

.header-search__input::placeholder {
    color: #9b9386;
}

.header-search__icon {
    position: absolute;
    right: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    width: 16px;
    height: 16px;
}

/* Search suggestions dropdown */
.search-results-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd8d0;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    z-index: 200;
    overflow: hidden;
    display: none;
}

.search-results-dropdown.is-open {
    display: block;
}

.search-results-dropdown__item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.65rem 1rem;
    cursor: pointer;
    transition: background 0.15s ease;
    text-decoration: none;
    color: #1c1c1c;
}

.search-results-dropdown__item:hover,
.search-results-dropdown__item:focus {
    background: #f5f0eb;
    text-decoration: none;
    color: #1c1c1c;
}

.search-results-dropdown__num {
    font-size: 0.7rem;
    font-weight: 700;
    background: #8b5e3c;
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
    min-width: 28px;
    text-align: center;
}

.search-results-dropdown__title {
    font-size: 0.875rem;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-results-dropdown__empty {
    padding: 1rem;
    text-align: center;
    color: #aaa;
    font-size: 0.875rem;
}

.search-results-dropdown__loading {
    padding: 1rem;
    text-align: center;
    color: #aaa;
    font-size: 0.875rem;
}

/* Header nav */
.site-nav {
    flex-shrink: 0;
}

.site-nav__list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 1.5rem;
}

.site-nav__list li {
    list-style: none;
}

.site-nav__list a {
    display: inline-flex;
    align-items: center;
    font-size: 0.875rem;
    color: #555;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.site-nav__list a:hover {
    color: #8b5e3c;
    text-decoration: none;
}

.site-nav__list .current-menu-item:not(.menu-item-ai-services) > a,
.site-nav__list .current-menu-parent:not(.menu-item-ai-services) > a,
.site-nav__list .current-menu-ancestor:not(.menu-item-ai-services) > a,
.site-nav__list .current_page_item:not(.menu-item-ai-services) > a,
.site-nav__list .current_page_parent:not(.menu-item-ai-services) > a {
    color: #1c1c1c;
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: #8b5e3c;
    text-decoration-thickness: 2px;
    text-underline-offset: 0.35rem;
}

.site-nav__list .menu-item-ai-services a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid #8b5e3c;
    background: #8b5e3c;
    color: #fff;
    font-weight: 700;
    line-height: 1;
}

.site-nav__list .menu-item-ai-services a:hover,
.site-nav__list .menu-item-ai-services a:focus {
    background: #5c3d22;
    border-color: #5c3d22;
    color: #fff;
    text-decoration: none;
}

.site-nav__list .menu-item-ai-services.current-menu-item a {
    box-shadow: 0 0 0 3px rgba(139, 94, 60, 0.14);
}

.site-support-link {
    flex-shrink: 0;
    font-size: 0.8rem;
    font-weight: 700;
    color: #8b5e3c;
    border: 1px solid #e3d8ca;
    border-radius: 999px;
    padding: 0.35rem 0.75rem;
    text-decoration: none;
}

.site-support-link:hover {
    background: #f6efe7;
    text-decoration: none;
}

/* ==========================================================================
   FOOTER
   ========================================================================== */

.site-footer {
    border-top: 1px solid #e8e4de;
    padding: 2rem 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: #999;
}

.site-footer a {
    color: #777;
}

.site-footer__links {
    display: flex;
    gap: 1.5rem;
    justify-content: center;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   CONTACT PAGE
   ========================================================================== */

.contact-page {
    max-width: 760px;
}

.contact-page__lead {
    color: #666;
    margin-top: 0.45rem;
    margin-bottom: 1.25rem;
}

.contact-alert {
    padding: 0.8rem 0.95rem;
    border-radius: 8px;
    border: 1px solid #e8e4de;
    margin-bottom: 1rem;
    font-size: 0.92rem;
}

.contact-alert--success {
    background: #edf8ef;
    border-color: #cde7d2;
    color: #2f6f3b;
}

.contact-alert--error {
    background: #fff2f2;
    border-color: #f0d3d3;
    color: #8a3838;
}

.contact-form {
    background: #fff;
    border: 1px solid #e8e4de;
    border-radius: 12px;
    padding: 1rem;
}

.contact-form__field {
    margin: 0 0 0.85rem;
}

.contact-form__field label {
    display: block;
    margin-bottom: 0.35rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: #5f574f;
}

.contact-form__field input,
.contact-form__field textarea {
    width: 100%;
    border: 1px solid #ddd8d0;
    border-radius: 8px;
    padding: 0.65rem 0.75rem;
    font: inherit;
    color: #1c1c1c;
    background: #fff;
}

.contact-form__field input:focus,
.contact-form__field textarea:focus {
    outline: none;
    border-color: #8b5e3c;
    box-shadow: 0 0 0 4px rgba(139, 94, 60, 0.12);
}

.contact-form__submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: #8b5e3c;
    color: #fff;
    border: 0;
    border-radius: 9px;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
}

.contact-form__submit:hover,
.contact-form__submit:focus {
    background: #6f4a2f;
}

.contact-form__honeypot {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ==========================================================================
   FRONT PAGE — HERO
   ========================================================================== */

.home-hero {
    text-align: center;
    padding: 4rem 1rem 3rem;
    max-width: 640px;
    margin: 0 auto;
}

.home-hero__eyebrow {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8b5e3c;
    margin-bottom: 0.75rem;
}

.home-hero__title {
    font-size: clamp(1.75rem, 5vw, 2.75rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: #1c1c1c;
}

.home-hero__desc {
    font-size: 1.0625rem;
    color: #666;
    line-height: 1.7;
    margin-bottom: 2rem;
}

/* Hero search */
.hero-search {
    position: relative;
    max-width: 500px;
    margin: 0 auto 0.5rem;
}

.hero-search__input {
    width: 100%;
    padding: 0.85rem 3rem 0.85rem 1.25rem;
    border: 2px solid #e0d9d0;
    border-radius: 10px;
    background: #fff;
    font-size: 1rem;
    color: #1c1c1c;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.hero-search__input:focus {
    border-color: #8b5e3c;
    box-shadow: 0 0 0 5px rgba(139, 94, 60, 0.14);
}

.hero-search__input::placeholder {
    color: #b0a898;
}

.hero-search__icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
    pointer-events: none;
    width: 20px;
    height: 20px;
}

.hero-search .search-results-dropdown {
    top: calc(100% + 6px);
    border-radius: 10px;
}

/* ==========================================================================
   CHAPTER LIST (archive + home)
   ========================================================================== */

.section-title {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #8b5e3c;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e8e4de;
}

.chapters-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.chapter-item {
    margin: 0;
}

.chapter-item:last-child {
    border-bottom: 0;
}

.chapter-item__link {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.95rem 1rem;
    text-decoration: none;
    color: inherit;
    border-radius: 10px;
    background: #fff;
    border: 1px solid #ece7df;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: background 0.15s ease, border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.chapter-item__link:hover {
    background: #f9f5f0;
    border-color: #ddd2c3;
    box-shadow: 0 8px 18px rgba(0,0,0,0.08);
    transform: translateY(-1px);
    text-decoration: none;
    color: inherit;
}

.chapter-item__number {
    font-size: 0.72rem;
    font-weight: 700;
    background: #ede6dc;
    color: #8b5e3c;
    border-radius: 7px;
    padding: 4px 9px;
    flex-shrink: 0;
    min-width: 38px;
    text-align: center;
    letter-spacing: 0.03em;
}

.chapter-item__link:hover .chapter-item__number {
    background: #7a5233;
    color: #fff;
}

.chapter-item__title {
    font-size: 0.95rem;
    font-weight: 600;
    flex: 1;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.chapter-item__title::before {
    content: '▶';
    font-size: 0.66rem;
    line-height: 1;
    color: #8b5e3c;
    opacity: 0.82;
    transform: translateY(0.5px);
}

.chapter-item__arrow {
    color: #b5aea4;
    flex-shrink: 0;
    font-size: 0.95rem;
    transition: transform 0.15s ease;
}

.chapter-item__link:hover .chapter-item__arrow {
    transform: translateX(3px);
    color: #8b5e3c;
}

/* CTA link */
.cta-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #8b5e3c;
    text-decoration: none;
    padding: 0.5rem 0;
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s ease;
}

.cta-link:hover {
    border-color: #8b5e3c;
    text-decoration: none;
    color: #8b5e3c;
}

.ai-services-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 0.5rem;
    padding: 0.7rem 1rem;
    border-radius: 10px;
    border: 1px solid #8b5e3c;
    background: #8b5e3c;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background-color 0.2s ease, border-color 0.2s ease;
}

.ai-services-cta:hover,
.ai-services-cta:focus {
    background: #5c3d22;
    border-color: #5c3d22;
    color: #fff;
    text-decoration: none;
}

/* Support box */
.support-box {
    margin-top: 1rem;
    border: 1px solid #e7ddd0;
    background: #fcfaf7;
    border-radius: 12px;
    padding: 0.9rem 1rem;
}

.support-box__text {
    margin: 0;
    color: #5b5650;
    font-size: 0.9rem;
    line-height: 1.55;
}

.support-box__actions {
    margin-top: 0.7rem;
    display: flex;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.support-box__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.45rem 0.75rem;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid transparent;
}

.support-box__btn--patronite {
    background: #8b5e3c;
    color: #fff;
}

.support-box__btn--patronite:hover {
    background: #6f4a2f;
    color: #fff;
    text-decoration: none;
}

.support-box__btn--coffee {
    background: #fff;
    color: #8b5e3c;
    border-color: #dbcdbd;
}

.support-box__btn--coffee:hover {
    background: #f7f0e8;
    color: #6f4a2f;
    text-decoration: none;
}

.support-box--chapter {
    margin-top: 1.1rem;
    margin-bottom: 1rem;
}

/* ==========================================================================
   PAGINATION
   ========================================================================== */

.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 0.5rem;
    border: 1px solid #e0d9d0;
    border-radius: 6px;
    font-size: 0.875rem;
    color: #555;
    text-decoration: none;
    transition: all 0.15s ease;
}

.pagination a:hover {
    background: #8b5e3c;
    border-color: #8b5e3c;
    color: #fff;
    text-decoration: none;
}

.pagination .current {
    background: #8b5e3c;
    border-color: #8b5e3c;
    color: #fff;
}

/* ==========================================================================
   SINGLE CHAPTER PAGE
   ========================================================================== */

.chapter-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8e4de;
}

.chapter-header__meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.chapter-badge {
    font-size: 0.7rem;
    font-weight: 700;
    background: #8b5e3c;
    color: #fff;
    border-radius: 6px;
    padding: 4px 10px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.chapter-header__number-label {
    font-size: 0.8125rem;
    color: #999;
}

.chapter-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.25;
    margin-bottom: 0.75rem;
}

.chapter-header__book-meta {
    font-size: 0.85rem;
    color: #888;
    margin-top: 0.4rem;
}

.chapter-book-description {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.7;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.chapter-excerpt {
    font-size: 1rem;
    color: #666;
    line-height: 1.7;
}

/* Video / audio player wrapper */
.chapter-player {
    margin-bottom: 2rem;
}

.chapter-player__youtube {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: 10px;
    background: #1c1c1c;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
}

.chapter-player__youtube iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 10px;
}

.chapter-player__audio {
    background: #fff;
    border: 1px solid #e8e4de;
    border-radius: 10px;
    padding: 1.25rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.chapter-player__audio audio {
    width: 100%;
}

/* Chapter navigation */
.chapter-nav {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e8e4de;
}

.chapter-nav__btn {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 1rem;
    border: 1px solid #e0d9d0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    background: #fff;
}

.chapter-nav__btn:hover {
    border-color: #8b5e3c;
    background: #faf5f0;
    text-decoration: none;
    color: inherit;
    box-shadow: 0 2px 8px rgba(139, 94, 60, 0.1);
}

.chapter-nav__btn--next {
    text-align: right;
}

.chapter-nav__label {
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #8b5e3c;
}

.chapter-nav__title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #1c1c1c;
    line-height: 1.4;
}

.chapter-nav__btn--empty {
    visibility: hidden;
}

/* Chapter content / transcript */
.chapter-content {
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 1px solid #e8e4de;
}

.chapter-content h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #1c1c1c;
}

.chapter-content p {
    margin-bottom: 1.25rem;
    color: #444;
}

/* Back to list */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #888;
    text-decoration: none;
    margin-bottom: 2rem;
    padding: 0.25rem 0;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: #8b5e3c;
    text-decoration: none;
}

/* ==========================================================================
   ADVERT SLOTS
   ========================================================================== */

.advert-slot {
    margin: 2rem 0;
    text-align: center;
}

.advert-slot--inline {
    padding: 1rem;
    border-radius: 6px;
    background: #f5f0eb;
    border: 1px dashed #d4c4b0;
    font-size: 0.75rem;
    color: #bbb;
}

/* ==========================================================================
   SEARCH RESULTS PAGE
   ========================================================================== */

.search-page__header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8e4de;
}

.search-page__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.search-page__count {
    font-size: 0.875rem;
    color: #888;
}

.no-results {
    text-align: center;
    padding: 4rem 1rem;
    color: #aaa;
}

.no-results svg {
    margin: 0 auto 1.5rem;
    opacity: 0.3;
}

.no-results h2 {
    font-size: 1.25rem;
    color: #777;
    margin-bottom: 0.5rem;
}

.no-results p {
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

/* ==========================================================================
   STATIC PAGES
   ========================================================================== */

.page-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8e4de;
}

.page-title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
}

.page-content {
    font-size: 1rem;
    line-height: 1.8;
    color: #444;
}

.page-content h2 {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: #1c1c1c;
}

.page-content h3 {
    font-size: 1.0625rem;
    font-weight: 600;
    margin: 1.5rem 0 0.5rem;
    color: #1c1c1c;
}

.page-content p {
    margin-bottom: 1.15rem;
}

.page-content ul,
.page-content ol {
    margin-bottom: 1.15rem;
}

/* ==========================================================================
   404 PAGE
   ========================================================================== */

.error-404 {
    text-align: center;
    padding: 5rem 1rem;
}

.error-404__code {
    font-size: clamp(5rem, 15vw, 9rem);
    font-weight: 800;
    letter-spacing: -0.05em;
    color: #e8e4de;
    line-height: 1;
    margin-bottom: 1rem;
}

.error-404__title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 0.75rem;
}

.error-404__desc {
    color: #999;
    margin-bottom: 2rem;
    font-size: 0.9rem;
}

/* ==========================================================================
   BOOK CARDS GRID
   ========================================================================== */

.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 1.3rem;
    margin-top: 0.5rem;
}

.book-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e4de;
    border-radius: 10px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    transition: box-shadow 0.2s ease, transform 0.2s ease, border-color 0.2s ease;
}

.book-card:hover {
    border-color: #ddd2c3;
    box-shadow: 0 10px 28px rgba(0,0,0,0.12);
    transform: translateY(-3px);
    text-decoration: none;
    color: inherit;
}

.book-card__cover {
    aspect-ratio: 16 / 9;
    background: #f0ede8;
    overflow: hidden;
    position: relative;
}

.book-card__cover-link {
    display: block;
    text-decoration: none;
}

.book-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.book-card:hover .book-card__cover img {
    transform: scale(1.02);
    filter: brightness(0.94);
}

.book-card__author a {
    color: inherit;
    text-decoration: none;
}

.book-card__author a:hover {
    text-decoration: underline;
}

.book-card__title-link {
    text-decoration: none;
    color: inherit;
    display: block;
}
.book-card__cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8e4de 0%, #d4c4b0 100%);
}

.book-card__cover-placeholder svg {
    opacity: 0.4;
    width: 48px;
    height: 48px;
    color: #8b5e3c;
}

.book-card__body {
    padding: 1rem 1.1rem 1.05rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
}

.book-card__author {
    font-size: 0.68rem;
    font-weight: 600;
    color: #6f4a2f;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    display: block;
}

.book-card__title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.3;
    color: #1c1c1c;
    display: block;
}

.book-card__count {
    font-size: 0.78rem;
    color: #7f7f7f;
    margin-top: 0.15rem;
    padding-top: 0;
    display: block;
}

/* ==========================================================================
   SINGLE BOOK PAGE
   ========================================================================== */

.book-intro {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2.5rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #e8e4de;
    align-items: stretch;
}

.book-intro__cover {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    aspect-ratio: 16 / 9;
    background: #f0ede8;
}

.book-intro__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.book-intro__cover-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e8e4de 0%, #d4c4b0 100%);
}

.book-intro__cover-placeholder svg {
    opacity: 0.4;
    width: 64px;
    height: 64px;
    color: #8b5e3c;
}

.book-intro__meta {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.book-intro__author {
    font-size: 0.8125rem;
    font-weight: 600;
    color: #8b5e3c;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.book-intro__author a {
    color: #8b5e3c;
    text-decoration: none;
}
.book-intro__author a:hover {
    text-decoration: underline;
}

.book-intro__title {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: #1c1c1c;
}

.book-intro__desc {
    font-size: 0.9375rem;
    color: #555;
    line-height: 1.7;
    margin-top: 0.5rem;
}

.book-intro__desc .book-description__paragraph,
.chapter-book-description .book-description__paragraph,
.chapter-content .book-description__paragraph {
    margin: 0 0 0.85rem;
}

.book-intro__desc .book-description__paragraph:last-of-type,
.chapter-book-description .book-description__paragraph:last-of-type,
.chapter-content .book-description__paragraph:last-of-type {
    margin-bottom: 0.55rem;
}

.book-description__hashtags {
    margin: 0.45rem 0 0;
    padding-top: 0.65rem;
    border-top: 1px dashed #e2ddd5;
    color: #7f7f7f;
    font-size: 0.82rem;
    line-height: 1.65;
}

.book-description__tag {
    color: #8b5e3c;
    font-weight: 600;
}

.book-intro__chapter-count {
    font-size: 0.8rem;
    color: #999;
    margin-top: 0.25rem;
}

.book-intro__cta {
    margin-top: 1.15rem;
    padding: 0.85rem 1.1rem;
    border-radius: 10px;
    background: #8b5e3c;
    color: #fff;
    border-bottom: 0;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 18px rgba(139, 94, 60, 0.28);
}

.book-intro__cta:hover,
.book-intro__cta:focus {
    background: #6f4a2f;
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(111, 74, 47, 0.32);
}

/* Book section title with chapter count */
.section-title__count {
    font-weight: 400;
    color: #aaa;
    margin-left: 0.5rem;
    font-size: 0.65rem;
}

/* ==========================================================================
   AUTHOR TAXONOMY PAGE
   ========================================================================== */

.author-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e8e4de;
}

.author-header__name {
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.author-header__desc {
    font-size: 0.9375rem;
    color: #666;
    line-height: 1.7;
}

/* ==========================================================================
   BREADCRUMB
   ========================================================================== */

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8125rem;
    color: #aaa;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: #888;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #8b5e3c;
    text-decoration: underline;
}

.breadcrumb__sep {
    color: #ddd;
}

/* ==========================================================================
   UTILITIES
   ========================================================================== */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
}

.text-muted {
    color: #999;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */

@media (max-width: 640px) {
    .site-header__inner {
        height: auto;
        padding: 0.75rem 1rem;
        flex-wrap: wrap;
        gap: 0.75rem;
    }

    .header-search {
        order: 3;
        max-width: 100%;
        flex: 0 0 100%;
    }

    .site-nav__list {
        gap: 1rem;
    }

    .site-support-link {
        margin-left: auto;
    }

    .chapter-nav {
        grid-template-columns: 1fr;
    }

    .home-hero {
        padding: 2.5rem 0.5rem 2rem;
    }

    .book-intro {
        grid-template-columns: 120px 1fr;
        gap: 1.25rem;
    }

    .books-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 1rem;
    }
}
