/* =========================================================================
   KAREL VODEN — style.css
   Тема: Тъмен трилър — дълбоко синьо, студена стомана, кримзон акцент
   ========================================================================= */

:root {
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Lato', sans-serif;
    --color-text: #1c1c1e;
    --color-text-light: #5a6570;
    --color-background: #f0f2f4;
    --color-primary: #1a3a4a;
    --color-primary-dark: #0d2233;
    --color-secondary: #b5402a;       /* кримзон — напрежение, опасност */
    --color-white: #ffffff;
    --color-border: #d4dae0;
    --container-width: 1200px;
    --shadow: 0 4px 15px rgba(0,0,0,0.1);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--color-text);
    background-color: var(--color-background);
    text-rendering: optimizeLegibility;
}

.container { max-width: var(--container-width); margin: 0 auto; padding: 0 20px; }
img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 1rem;
    color: var(--color-primary-dark);
}

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

/* --- НАВИГАЦИЯ --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    background: rgba(13, 34, 51, 0.97);   /* почти черно-синьо */
    backdrop-filter: blur(10px);
    position: fixed;
    width: 100%;
    top: 0;
    left: 0;
    z-index: 1000;
    border-bottom: 2px solid var(--color-secondary);
}

.nav-logo {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-white);
    letter-spacing: 2px;
}
.nav-logo:hover { color: var(--color-secondary); }

.nav-menu { display: flex; list-style: none; gap: 2.5rem; }

.nav-link {
    font-family: var(--font-body);
    color: #c8d0d8;
    font-weight: 400;
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    padding-bottom: 5px;
    border-bottom: 2px solid transparent;
}
.nav-link:hover, .nav-link.active {
    color: var(--color-white);
    border-bottom-color: var(--color-secondary);
}

.lang-switcher { font-family: var(--font-body); font-size: 0.9rem; }
.lang-switcher a { color: #8a9aa8; }
.lang-switcher a:hover { color: var(--color-white); }
.lang-switcher span { color: var(--color-white); font-weight: 700; }

/* --- ОСНОВНО СЪДЪРЖАНИЕ --- */
main {
    padding: 120px 0 60px;
    min-height: calc(100vh - 80px);
    transition: opacity 0.3s ease-in-out;
}

/* --- FOOTER --- */
footer {
    background-color: var(--color-primary-dark);
    color: #8a9aa8;
    text-align: center;
    padding: 1.5rem 0;
    font-size: 0.9rem;
}
footer p { margin-bottom: 0.4rem; }
footer a { color: var(--color-secondary); }
footer a:hover { color: var(--color-white); }
.footer-publisher { font-size: 0.85rem; }
.footer-publisher a { color: #8a9aa8; font-weight: 600; letter-spacing: 0.05em; }
.footer-publisher a:hover { color: var(--color-white); }

/* --- ХАМБУРГЕР --- */
.hamburger {
    display: none;
    cursor: pointer;
    background: transparent;
    border: none;
    padding: 0;
    z-index: 1001;
}
.hamburger .bar {
    display: block; width: 25px; height: 3px; margin: 5px auto;
    transition: all 0.3s ease-in-out;
    background-color: var(--color-white);
}

/* --- HERO --- */
.hero-section {
    background: linear-gradient(rgba(0,0,0,0.72), rgba(0,0,0,0.72)),
                url('images/common/hero-bg.jpg') center/cover no-repeat;
    color: var(--color-white);
    text-align: center;
    padding: 4rem 2rem 3rem;
}
.hero-section h1 {
    color: var(--color-white);
    font-size: 3rem;
    text-shadow: 2px 2px 10px rgba(0,0,0,0.8);
    letter-spacing: 1px;
}
.hero-section .author-intro {
    font-size: 1.1rem;
    max-width: 650px;
    margin: 1rem auto 0;
    color: #c8d0d8;
    line-height: 1.8;
}
.hero-section .author-intro a { color: var(--color-secondary); font-weight: 700; }

/* --- НАЧАЛНА СТРАНИЦА --- */
.homepage-content { padding-top: 4rem; padding-bottom: 4rem; }
.homepage-content h2 { text-align: center; margin-bottom: 3rem; }
.all-books-link { text-align: center; margin-top: 4rem; }
.all-books-link .btn { padding: 15px 40px; font-size: 1.1rem; }

/* --- КНИЖНИ КАРТИ --- */
.books-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 2rem;
}

/* Featured grid — 2 карти, центрирани хоризонтално */
.books-grid-featured {
    display: grid;
    grid-template-columns: repeat(auto-fit, 220px);
    justify-content: center;
    gap: 2rem;
}
.book-card {
    background: var(--color-white);
    border-radius: 6px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    border-top: 3px solid var(--color-primary);
}
.book-card:hover { transform: translateY(-5px); box-shadow: 0 10px 30px rgba(0,0,0,0.15); }
.book-card img { width: 100%; aspect-ratio: 2/3; object-fit: contain; background-color: var(--color-white); }
.book-card h3 { font-size: 1rem; margin: 1rem 1rem 0.5rem; color: var(--color-primary-dark); }
.book-card-content {
    padding-top: 0.5rem; flex-grow: 1;
    display: flex; flex-direction: column; justify-content: space-between;
}
.book-card .status-tag {
    display: inline-block;
    background-color: var(--color-secondary);
    color: var(--color-white);
    font-size: 0.75rem;
    font-weight: bold;
    padding: 0.2rem 0.8rem;
    border-radius: 12px;
    margin: 0 auto 1rem;
}

/* --- LANG PILLS --- */
.lang-pills {
    display: flex; flex-wrap: wrap; justify-content: center;
    gap: 0.4rem; margin-bottom: 1rem; padding: 0 1rem;
}
.lang-pill {
    display: inline-block;
    font-size: 0.68rem; font-weight: 700;
    color: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 10px; padding: 2px 8px;
    text-transform: uppercase; transition: all 0.2s ease;
}
.lang-pill:hover {
    background-color: var(--color-primary);
    color: var(--color-white); text-decoration: none;
}

/* --- БИБЛИОТЕКА --- */
.library-hub .hub-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 2rem; margin-bottom: 4rem;
}
@media (max-width: 900px) {
    .library-hub .hub-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
    .library-hub .hub-grid { grid-template-columns: 1fr; }
}
.library-hub .hub-grid.small {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}
.hub-card {
    display: flex; flex-direction: column;
    justify-content: center; align-items: center;
    min-height: 200px; padding: 2rem;
    background-color: var(--color-white);
    border-radius: 6px; box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-secondary);
}
.hub-card:hover { transform: translateY(-8px); box-shadow: 0 10px 28px rgba(0,0,0,0.13); }
.hub-card h2 { margin: 0; color: var(--color-primary-dark); }
.hub-card[style] { background-size: cover; background-position: center; border: none; position: relative; overflow: hidden; }
.hub-card[style] h2 { color: var(--color-white); text-shadow: 1px 1px 6px rgba(0,0,0,0.8); }

/* --- ПОРЕДИЦА --- */
.series-page-header {
    padding: 6rem 2rem; color: var(--color-white);
    text-align: center; background-size: cover; background-position: center;
    margin-bottom: 4rem;
}
.series-page-header h1 { font-size: 3rem; color: var(--color-white); text-shadow: 2px 2px 10px rgba(0,0,0,0.8); }
.series-page-header .series-synopsis { font-size: 1.1rem; max-width: 700px; margin: 1rem auto 0; opacity: 0.9; }

/* --- КНИГА ДЕТАЙЛ --- */
.book-detail-view {
    display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: start;
}
@media (min-width: 768px) { .book-detail-view { grid-template-columns: 1fr 2fr; } }
.book-detail-cover { display: flex; flex-direction: column; align-items: center; }
.book-detail-cover img { border-radius: 6px; box-shadow: var(--shadow); }
.book-genre { font-style: italic; color: var(--color-text-light); margin-top: -1rem; margin-bottom: 2rem; }
.synopsis p { margin-bottom: 0; line-height: 1.26; text-indent: 0.76rem; }
.synopsis p:first-of-type { text-indent: 0; }

.buy-links { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem; margin-top: 1rem; }
.buy-logo-link img { height: 40px; width: auto; max-width: 150px; opacity: 0.85; transition: opacity 0.3s, transform 0.3s; }
.buy-logo-link:hover img { opacity: 1; transform: scale(1.05); }
.buy-links .btn { display: none; }

.excerpt-link-cover { width: 100%; max-width: 350px; margin-top: 1.5rem; }
.excerpt-link-cover .btn-secondary { width: 100%; box-sizing: border-box; }

.btn-secondary {
    display: inline-block; padding: 12px 22px; font-size: 0.95rem; font-weight: 700;
    text-align: center; border-radius: 5px; background-color: transparent;
    color: var(--color-primary); border: 2px solid var(--color-primary);
    transition: all 0.3s ease;
}
.btn-secondary:hover { background-color: var(--color-primary); color: var(--color-white); }

/* --- БУТОНИ --- */
.btn {
    display: inline-block; padding: 12px 28px;
    font-family: var(--font-body); font-size: 0.95rem; font-weight: 700;
    background-color: var(--color-primary); color: var(--color-white);
    border: 2px solid var(--color-primary); border-radius: 5px;
    transition: all 0.3s ease; letter-spacing: 0.04em;
}
.btn:hover { background-color: var(--color-primary-dark); border-color: var(--color-primary-dark); color: var(--color-white); transform: translateY(-2px); }

/* --- СТРАНИЦА ЗА АВТОРА --- */
.about-page { display: grid; grid-template-columns: 1fr; gap: 3rem; align-items: center; }
@media (min-width: 992px) { .about-page { grid-template-columns: 1fr 2fr; } }
.author-photo-large img {
    max-width: 250px; margin: 0 auto; border-radius: 50%; object-fit: cover;
    border: 6px solid var(--color-primary); box-shadow: 0 5px 20px rgba(0,0,0,0.2);
}
.author-bio-content .bio-text { white-space: pre-wrap; font-size: 1.05rem; line-height: 1.8; }

/* --- КОНТАКТИ --- */
.contact-page { max-width: 800px; }
.contact-page p { text-align: center; margin-bottom: 3rem; }
.contact-form { display: flex; flex-direction: column; gap: 1.5rem; }
.form-group { display: flex; flex-direction: column; }
.form-group label { margin-bottom: 0.5rem; font-weight: 700; color: var(--color-primary-dark); }
.form-group input, .form-group textarea {
    padding: 12px; border-radius: 5px; border: 1px solid var(--color-border);
    font-family: var(--font-body); font-size: 1rem;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.form-group input:focus, .form-group textarea:focus {
    outline: none; border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(181, 64, 42, 0.15);
}
.contact-form .btn { align-self: flex-start; padding: 12px 30px; cursor: pointer; }
#form-status { margin-top: 1.5rem; font-weight: bold; text-align: center; }

/* --- НОВИНИ --- */
.latest-news-section { margin-top: 5rem; padding-top: 3rem; border-top: 1px solid var(--color-border); }
.latest-news-section h2 { text-align: center; margin-bottom: 2rem; }
.news-excerpt { max-width: 700px; margin: 0 auto; text-align: center; }
.news-excerpt h3 { color: var(--color-secondary); }
.news-excerpt .read-more { display: inline-block; margin-top: 1rem; font-weight: bold; }
.news-list { display: flex; flex-direction: column; gap: 4rem; }
.news-item { padding-bottom: 2rem; border-bottom: 1px solid var(--color-border); }
.news-item:last-child { border-bottom: none; }
.news-item h2 { margin-bottom: 0.5rem; }
.news-item .news-meta { font-size: 0.9rem; color: var(--color-text-light); margin-bottom: 1.5rem; }
.news-content { font-size: 1.05rem; line-height: 1.8; }
.news-content p { margin-bottom: 1.5rem; }

/* --- ОТКЪС --- */
.reading-container {
    max-width: 800px; margin: 0 auto; padding: 2rem 1rem;
    background-color: var(--color-white); box-shadow: var(--shadow); border-radius: 6px;
}
@media (min-width: 768px) { .reading-container { padding: 3rem 4rem; } }
.preview-title { text-align: center; margin-bottom: 1rem; }
.back-link { display: block; margin-bottom: 3rem; text-align: center; font-size: 0.9rem; }
.prose { font-family: var(--font-body); font-size: 1.1rem; line-height: 1.7; }
.prose h1, .prose h2, .prose h3 { margin-top: 2rem; margin-bottom: 1rem; border-bottom: 1px solid var(--color-border); padding-bottom: 0.5rem; }
.prose p { margin-bottom: 0; text-indent: 0.76rem; }
.prose h1+p, .prose h2+p, .prose h3+p { text-indent: 0; }

/* --- ТЕКСТОВА СТРАНИЦА (ПОВЕРИТЕЛНОСТ) --- */
.text-page { max-width: 720px; }
.text-page h1 { margin-bottom: 2rem; }
.text-page p { margin-bottom: 1.5rem; line-height: 1.8; }

/* --- COOKIE BANNER --- */
.cookie-banner {
    position: fixed; bottom: -100%; left: 0; width: 100%;
    background-color: var(--color-primary-dark); color: #c8d0d8;
    padding: 1rem; box-shadow: 0 -4px 15px rgba(0,0,0,0.3);
    z-index: 2000; transition: bottom 0.5s ease-in-out;
}
.cookie-banner.show { bottom: 0; }
.cookie-content {
    max-width: var(--container-width); margin: 0 auto;
    display: flex; flex-direction: column; align-items: center; gap: 1rem;
}
@media (min-width: 768px) { .cookie-content { flex-direction: row; justify-content: space-between; } }
.cookie-content p { margin: 0; font-size: 0.9rem; }
.cookie-content p a { color: var(--color-secondary); text-decoration: underline; }
.cookie-banner .btn { padding: 8px 20px; background-color: var(--color-secondary); border-color: var(--color-secondary); flex-shrink: 0; }

/* --- МОБИЛНА НАВИГАЦИЯ --- */
@media (max-width: 992px) {
    .nav-menu {
        position: fixed; left: -100%; top: 58px; gap: 0;
        flex-direction: column;
        background-color: var(--color-primary-dark);
        width: 100%; text-align: center;
        transition: 0.3s ease-in-out;
        box-shadow: 0 10px 20px rgba(0,0,0,0.3);
        border-top: 2px solid var(--color-secondary);
    }
    .nav-menu.active { left: 0; }
    .nav-item { width: 100%; border-bottom: 1px solid rgba(255,255,255,0.08); }
    .nav-item:last-child { border-bottom: none; }
    .nav-link { display: block; padding: 1.2rem 0; width: 100%; color: #c8d0d8; }
    .hamburger { display: block; }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }
}
