/*
Theme Name: Recenzeknihy Premium
Theme URI: https://recenzeknihy.cz
Author: Antigravity
Author URI: https://gemini.google.com
Description: A premium, modern, and high-performance theme for a book review aggregator. Features glassmorphism, smooth animations, and a refined "paper" aesthetic.
Version: 3.0.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: recenzeknihy-v3
*/

/* --- Design Tokens --- */
:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #e0e7ff;
    --secondary: #f59e0b;
    --secondary-dark: #d97706;
    --bg-page: #f8fafc;
    --bg-card: #ffffff;
    --text-main: #1e293b;
    --text-muted: #64748b;
    --text-on-primary: #ffffff;
    --border: #e2e8f0;
    --border-focus: #94a3b8;
    --radius-sm: 8px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 10px 25px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-serif: 'Lora', Georgia, 'Times New Roman', serif;
    --container-max: 1280px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.site-content-padding {
    padding-top: 4rem;
    padding-bottom: 4rem;
}

.content-wrapper {
    display: flex;
    gap: 3rem;
}

/* --- Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-page);
    color: var(--text-main);
    line-height: 1.625;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-serif);
    color: var(--text-main);
    line-height: 1.25;
    margin: 0 0 1.5rem;
    font-weight: 700;
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
}

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

.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding: 0 2rem;
}

/* --- Navigation --- */
.header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 1000;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.header.scrolled {
    padding: 0.5rem 0;
    background: rgba(255, 255, 255, 0.95);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4.5rem;
}

.site-branding {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.site-title {
    font-size: 1.5rem;
    font-weight: 800;
    margin: 0;
    font-family: var(--font-sans);
    letter-spacing: -0.025em;
}

.site-title a {
    color: var(--text-main);
}

.main-navigation ul {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2rem;
}

.main-navigation a {
    font-weight: 500;
    color: var(--text-muted);
    font-size: 0.9375rem;
    position: relative;
    padding: 0.5rem 0;
}

.main-navigation a:hover,
.main-navigation li.current-menu-item a {
    color: var(--primary);
}

.main-navigation a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--primary);
    transition: var(--transition);
}

.main-navigation a:hover::after,
.main-navigation li.current-menu-item a::after {
    width: 100%;
}

/* --- Hero Section --- */
.books-hero {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 6rem 2rem;
    position: relative;
    overflow: hidden;
    margin-bottom: 0;
    display: flex;
    justify-content: center;
}

.books-hero > div:first-of-type { /* This targets the wrappers if they exist, or the direct children */
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 4rem;
    position: relative;
    z-index: 1;
    max-width: var(--container-max);
    width: 100%;
    margin: 0 auto;
}

/* If the plugin output is flat: */
.books-hero {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 4rem;
    padding: 6rem 2rem;
}

.books-hero__copy {
    flex: 1;
    min-width: 320px;
    max-width: 700px;
}

.books-hero__eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary);
    margin-bottom: 1rem;
    display: block;
}

.books-hero__title {
    font-size: 3rem;
    letter-spacing: -0.02em;
    margin-bottom: 1.5rem;
    line-height: 1.1;
}

.books-hero__text {
    font-size: 1.125rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 600px;
}

.books-hero__stats {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: 320px;
    flex-shrink: 0;
}

.books-hero__stat {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    border: 1px solid transparent;
}

.books-hero__stat:hover {
    transform: translateX(-8px);
    box-shadow: var(--shadow-md);
    border-color: var(--primary-light);
}

.books-hero__stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1;
}

.books-hero__stat-label {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    margin-top: 0.25rem;
}

/* --- Layout --- */
.books-container {
    display: flex;
    gap: 3rem;
    padding: 4rem 0;
    max-width: var(--container-max);
    margin: 0 auto;
    padding-left: 2rem;
    padding-right: 2rem;
}

.books-main {
    flex: 1;
    min-width: 0;
}

.books-sidebar {
    width: 320px;
    flex-shrink: 0;
}

/* --- Toolbar --- */
.books-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.books-toolbar__title {
    margin: 0;
    font-size: 1.75rem;
}

.books-toolbar__subtitle {
    margin: 0.25rem 0 0;
    color: var(--text-muted);
    font-size: 0.875rem;
}

.books-toolbar__reset {
    background: transparent;
    border: 1px solid var(--border);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.books-toolbar__reset:hover {
    background: var(--bg-page);
    border-color: var(--text-muted);
}

.books-toolbar__reset.is-hidden {
    display: none;
}

/* --- Book Grid --- */
#book-list-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

.book-item {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: relative;
    height: 100%;
}

.book-item:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.book-card__image {
    aspect-ratio: 2 / 3;
    overflow: hidden;
    background: #f1f5f9;
    position: relative;
}

.book-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.book-item:hover .book-card__image img {
    transform: scale(1.05);
}

.book-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.book-card__title {
    font-size: 1.125rem;
    margin: 0 0 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.8rem;
    line-height: 1.25;
}

.book-card__title-link {
    color: var(--text-main);
}

.book-card__title-link:hover {
    color: var(--primary);
}

.book-card__author {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.book-card__genre {
    font-size: 0.75rem;
    color: var(--primary);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.book-card__chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.book-card__chip {
    background: var(--primary-light);
    color: var(--primary-dark);
    font-size: 0.75rem;
    padding: 0.25rem 0.625rem;
    border-radius: 9999px;
    font-weight: 600;
}

.book-card__price {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--text-main);
    margin-top: auto;
    margin-bottom: 1.25rem;
}

.book-card__link {
    display: block;
    width: 100%;
    text-align: center;
    background: var(--primary);
    color: var(--text-on-primary);
    padding: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    font-size: 0.875rem;
    transition: var(--transition);
}

.book-card__link:hover {
    background: var(--primary-dark);
    color: var(--text-on-primary);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

/* --- Sidebar Widgets --- */
.widget {
    background: var(--bg-card);
    padding: 1.5rem;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    margin-bottom: 2rem;
    box-shadow: var(--shadow-sm);
}

.widget-title {
    font-size: 1.25rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    font-family: var(--font-sans);
    font-weight: 700;
}

.widget-title::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
    margin-left: 1rem;
}

.filter-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input[type="text"] {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    transition: var(--transition);
    background: #f8fafc;
}

input[type="text"]:focus {
    outline: none;
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

/* --- Dynamic Lists in Sidebar --- */
.dynamic-list {
    list-style: none;
    padding: 0;
    margin: 0.75rem 0 0;
    max-height: 240px;
    overflow-y: auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
}

.dynamic-list li {
    padding: 0.625rem 1rem;
    font-size: 0.875rem;
    cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: var(--transition);
}

.dynamic-list li:last-child {
    border-bottom: none;
}

.dynamic-list li:hover {
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* --- Footer --- */
.site-footer {
    background: var(--text-main);
    color: #cbd5e1;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-inner {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
}

.footer-copyright {
    text-align: center;
    font-size: 0.875rem;
    border-top: 1px solid #334155;
    padding-top: 2rem;
}

/* --- Book Details Page --- */
.book-breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem 0 2rem;
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.book-breadcrumbs__item {
    color: var(--text-muted);
    font-weight: 500;
}

.book-breadcrumbs__item:hover {
    color: var(--primary);
}

.book-breadcrumbs__item--current {
    color: var(--text-main);
    font-weight: 700;
}

.book-breadcrumbs__sep {
    font-size: 0.75rem;
    opacity: 0.5;
}

.book-details {
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 4rem;
    align-items: start;
}

.book-detail-image {
    position: sticky;
    top: 6rem;
}

.book-detail-image img {
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
}

.book-title {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    line-height: 1.1;
}

.book-author, .book-genre {
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.book-author strong, .book-genre strong {
    color: var(--text-muted);
    font-weight: 600;
}

.book-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 1.5rem 0;
}

.book-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    padding: 0.375rem 0.875rem;
    border-radius: 9999px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
}

.book-description {
    font-size: 1.125rem;
    line-height: 1.8;
    color: var(--text-main);
    margin: 2rem 0;
}

.book-affiliate-offers {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: var(--shadow-md);
}

.book-affiliate-offers h3 {
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
}

.book-affiliate-offers ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.book-affiliate-offers li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border);
}

.book-affiliate-offers li:last-child {
    border-bottom: none;
}

.book-affiliate-offers__price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-main);
}

.book-affiliate-offers__merchant {
    color: var(--text-muted);
    font-weight: 500;
    margin-left: 1rem;
    flex: 1;
}

.book-affiliate-offers__button {
    background: var(--secondary);
    color: white;
    padding: 0.75rem 2rem;
    border-radius: var(--radius-sm);
    font-weight: 700;
    transition: var(--transition);
}

.book-affiliate-offers__button:hover {
    background: var(--secondary-dark);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
    color: white;
}

.book-reviews {
    margin-top: 3rem;
    border-top: 1px solid var(--border);
    padding-top: 2rem;
}

/* --- Utilities --- */
.is-hidden {
    display: none !important;
}

/* --- Animations --- */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.book-item {
    animation: fadeIn 0.5s ease-out forwards;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
    .books-container {
        flex-direction: column;
    }
    .books-sidebar {
        width: 100%;
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
        gap: 2rem;
    }
    .books-hero__title {
        font-size: 2.5rem;
    }
}

@media (max-width: 640px) {
    .container {
        padding: 0 1rem;
    }
    .books-hero {
        padding: 4rem 0;
    }
    .books-hero__stats {
        flex-direction: column;
        gap: 2rem;
    }
    #book-list-container {
        grid-template-columns: 1fr;
    }
}
