html {
    scroll-behavior: smooth;
}

:root {
    --bg-color: #FDFBF7;
    --text-color: #1A1A1A;
    --accent-color: #333333;
    --line-color: rgba(0,0,0,0.1);
    --serif-title: 'Playfair Display', serif;
    --serif-body: 'Lora', serif;
}

/* Base Styles */
body {
    margin: 0;
    padding: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--serif-body);
    line-height: 1.8;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.35s ease;
}

h1, h2, h3 {
    font-family: var(--serif-title);
    font-weight: 400;
    margin: 0;
}

a {
    color: var(--text-color);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

a:hover {
    opacity: 0.6;
}

.container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header Navigation */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3rem 0;
    flex-wrap: wrap;
    gap: 1.5rem;
}

.logo {
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: 3px;
    font-family: var(--serif-title);
}

nav {
    display: flex;
    gap: 2.2rem;
    font-size: 0.85rem;
    letter-spacing: 1px;
    text-transform: uppercase;
    flex-wrap: wrap;
}

nav a {
    padding-bottom: 4px;
    border-bottom: 1px solid transparent;
}

nav a.active {
    border-bottom: 1px solid var(--text-color);
}

/* Page heading, used at top of each section page */
.page-hero {
    padding: 2rem 0 4rem;
    text-align: center;
}

.page-hero .eyebrow {
    font-family: var(--serif-title);
    font-style: italic;
    font-size: 1.1rem;
    color: var(--accent-color);
    margin-bottom: 0.75rem;
}

.section-title {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 4rem;
    position: relative;
}

.section-title::after {
    content: '';
    display: block;
    width: 50px;
    height: 1px;
    background-color: var(--text-color);
    margin: 1.5rem auto 0;
}

/* Hero / Book Section (used on Knigi page) */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 0 2rem;
    text-align: center;
}

.book-container {
    perspective: 1000px;
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.book-cover {
    width: 350px;
    height: auto;
    border-radius: 2px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.08);
    transition: transform 0.4s ease-out, box-shadow 0.4s ease-out;
    cursor: pointer;
}

.book-cover:hover {
    transform: scale(1.05) translateY(-10px);
    box-shadow: 0 25px 40px rgba(0,0,0,0.15);
}

.hero-subtitle {
    font-family: var(--serif-title);
    font-size: 1.2rem;
    font-style: italic;
    margin-bottom: 2rem;
    color: var(--accent-color);
}

.cta-button {
    display: inline-block;
    padding: 1rem 3rem;
    border: 1px solid var(--text-color);
    font-family: var(--serif-title);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cta-button:hover {
    background: var(--text-color);
    color: var(--bg-color);
}

/* About the Book Section */
.about-book {
    padding: 1rem 0 4rem;
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.15rem;
}

.about-book .section-title {
    font-size: 1.8rem;
    margin-bottom: 2.5rem;
}

.about-book p {
    margin-bottom: 2rem;
    text-indent: 2rem;
    text-align: left;
}

/* About the Author Section */
.about-author {
    padding: 2rem 0 6rem;
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: flex-start;
}

.author-image {
    width: 100%;
    aspect-ratio: 3/4;
    background-color: #E5E5E5;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
}

.author-info h3 {
    font-size: 2rem;
    margin-bottom: 1.5rem;
    font-family: var(--serif-title);
}

.author-info p {
    font-size: 1.1rem;
    margin-bottom: 1.5rem;
}

/* Translations (Perevodi) page */
.translation-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3rem;
    padding: 1rem 0 6rem;
    max-width: 800px;
    margin: 0 auto;
}

.translation-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.translation-tile .book-cover {
    width: 260px;
    margin-bottom: 1.5rem;
}

.translation-tile h3 {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.translation-tile .lang-label {
    font-family: var(--serif-title);
    font-style: italic;
    font-size: 0.95rem;
    color: var(--accent-color);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 1.2rem;
}

.placeholder-tile {
    width: 260px;
    aspect-ratio: 350/500;
    border: 1px dashed rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    color: rgba(0,0,0,0.45);
    font-family: var(--serif-title);
    font-style: italic;
    font-size: 1rem;
    text-align: center;
}

@media (max-width: 700px) {
    .translation-grid {
        grid-template-columns: 1fr;
    }
}

/* Publications (Facebook) page */
.publications {
    padding: 1rem 0 6rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.fb-embed-wrap {
    width: 100%;
    max-width: 560px;
    padding: 2rem;
    display: flex;
    justify-content: center;
}

.fb-embed-wrap rssapp-feed {
    width: 100%;
}

.publications .fallback-link {
    margin-top: 2rem;
    font-family: var(--serif-title);
    font-style: italic;
    font-size: 1rem;
}

/* Recommendations page */
.recommend-grid {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem 0 6rem;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 3rem 2.5rem;
    list-style: none;
}

.recommend-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.recommend-icon {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background-color: #F4F0E7;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.recommend-card:hover .recommend-icon {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.08);
}

.recommend-icon svg {
    width: 62px;
    height: 62px;
    stroke: var(--text-color);
    fill: none;
    stroke-width: 1.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.recommend-title {
    font-family: var(--serif-title);
    font-size: 1.3rem;
}

.recommend-author {
    display: block;
    font-size: 0.95rem;
    color: var(--accent-color);
    margin-top: 0.3rem;
    font-style: italic;
}

@media (max-width: 600px) {
    .recommend-grid {
        grid-template-columns: 1fr;
    }
}

/* Footer */
footer {
    text-align: center;
    padding: 4rem 0;
    font-size: 0.85rem;
    color: var(--accent-color);
    border-top: 1px solid var(--line-color);
}

/* Responsive Design */
@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 1.5rem;
    }
    .about-author {
        grid-template-columns: 1fr;
        text-align: left;
    }
    .book-cover {
        width: 280px;
    }
    .about-book p {
        text-indent: 0;
    }
}

/* Background color switcher */
.color-switcher {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    z-index: 1000;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem;
    background-color: rgba(253, 251, 247, 0.9);
    border: 1px solid var(--line-color);
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.1);
    backdrop-filter: blur(4px);
}

.color-switcher .swatch {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.15);
    cursor: pointer;
    padding: 0;
    flex: none;
    transition: transform 0.2s ease;
}

.color-switcher .swatch:hover {
    transform: scale(1.15);
}

.color-switcher .swatch.active {
    box-shadow: 0 0 0 2px var(--bg-color), 0 0 0 3.5px var(--text-color);
}

.swatch-default { background-color: #FDFBF7; }
.swatch-red { background-color: rgba(214, 66, 56, 0.35); }
.swatch-blue { background-color: rgba(52, 100, 189, 0.35); }
.swatch-yellow { background-color: rgba(224, 178, 33, 0.35); }
.swatch-green { background-color: rgba(72, 168, 90, 0.35); }

@media (max-width: 480px) {
    .color-switcher {
        bottom: 1rem;
        right: 1rem;
    }
}
