/* ===== CORE VARIABLES ===== */
:root {
    /* Color scheme based on BookstoreX */
    --primary-color: #1a4d2e;      /* Dark green */
    --secondary-color: #4ade80;     /* Light green */
    --accent-color: #22c55e;        /* Accent green */
    --text-dark: #1f2937;           /* Dark text */
    --text-light: #6b7280;          /* Light text */
    --white: #ffffff;               /* White */
    --light-gray: #f9fafb;          /* Light gray */
    --border-color: #e5e7eb;        /* Border color */
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); /* Shadow */
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1); /* Large shadow */
    --font-size-xs: 0.75rem;
    --font-size-sm: 0.875rem;
    --font-weight-medium: 500;
    --font-weight-bold: 700;
    --text-medium: #4b5563;
    --text-muted: #9ca3af;
    --primary-dark: #15432a;
    --radius: 8px;
    --border-light: #f0f0f0;
    --transition-normal: all 0.3s ease;
}

/* ===== RESET STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    min-height: 100%;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1 0 auto;
}

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 1rem;
}

h1 { font-size: 2.5rem; }
h2 { font-size: 2rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

.section-title {
    color: var(--primary-color);
    font-weight: 700;
    text-align: center;
    margin-bottom: 2rem;
}

.lead {
    font-size: 1.25rem;
    font-weight: 300;
    color: var(--text-light);
}

/* ===== HEADER ===== */
.header-main {
    background: var(--white);
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color) !important;
    text-decoration: none;
}

.navbar-brand:hover {
    color: var(--accent-color) !important;
}

.nav-link {
    color: var(--text-dark) !important;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary-color) !important;
}

.navbar-text {
    font-size: 0.875rem;
}

/* Стили для выравнивания слогана и контактов в шапке */
.header-right .slogan {
    font-size: 0.95rem;
    color: var(--text-muted);
}
.header-right .contacts {
    font-size: 0.875rem;
}
.header-right .contacts i {
    color: var(--primary-color);
}
.header-right .contacts div {
    line-height: 1.2;
}

/* Обеспечиваем, чтобы логотип, меню и правая колонка корректно выравнивались */
@media (min-width: 992px) {
    .header-main .container.d-flex {
        display: flex !important;
        align-items: center;
    }
    .header-main .navbar-brand {
        margin-right: 1rem;
    }
}

/* ===== HERO SECTION ===== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2d5a3d 100%);
    color: var(--white);
    padding: 5rem 0;
    position: relative;
    overflow: hidden;
    width: 100%;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-title {
    font-size: 3rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.hero-subtitle {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.hero-section .latest-post-heading {
    color: var(--white);
    font-size: 1.5rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    z-index: 1;
    opacity: 0.9;
}

.hero-section .latest-post-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin: 0;
}

.hero-section .latest-post-card .blog-card-title,
.hero-section .latest-post-card .blog-card-excerpt,
.hero-section .latest-post-card .blog-card-meta {
    color: var(--white);
}

.hero-section .latest-post-card .blog-card-meta i {
    color: var(--secondary-color);
}

.hero-section .latest-post-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

/* ===== КНОПКИ ===== */
.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: var(--white);
    font-weight: 600;
    padding: 0.75rem 2rem;
    border-radius: 50px;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary:hover {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-outline-primary {
    color: var(--primary-color);
    border-color: var(--primary-color);
    background-color: transparent;
}

.btn-outline-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

/* ===== БЛОГ СЕКЦИЯ ===== */
.blog-section {
    background-color: var(--light-gray);
}

.blog-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.blog-card-image {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blog-card:hover .blog-card-image {
    transform: scale(1.05);
}

.blog-card-body {
    padding: 1.5rem;
}

.blog-card-title {
    color: var(--primary-color);
    font-weight: 600;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.blog-card-excerpt {
    color: var(--text-light);
    margin-bottom: 1rem;
    line-height: 1.6;
}

.blog-card-meta {
    color: var(--text-light);
    font-size: 0.875rem;
}

.blog-card-link {
    text-decoration: none;
    color: inherit;
}

.blog-card-link:hover {
    color: inherit;
}

/* ===== ПАГИНАЦИЯ ===== */
.pagination {
    gap: 0.5rem;
}

.page-link {
    color: var(--primary-color);
    border-color: var(--border-color);
    border-radius: 8px;
    padding: 0.5rem 1rem;
    transition: all 0.3s ease;
}

.page-link:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* Горизонтальная стилизация для пагинации */
.pagination {
    display: flex;
    list-style: none;
    padding-left: 0;
}
.pagination .page-item {
    margin: 0 0.25rem;
}
.pagination .page-link {
    border-radius: 8px;
    padding: 0.5rem 0.85rem;
    min-width: 40px;
    text-align: center;
}
.pagination .page-item .page-link i {
    vertical-align: middle;
}

/* ===== FOOTER ===== */
.footer-main {
    background: linear-gradient(135deg, var(--primary-color) 0%, #2d5a3d 100%);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: auto;
}

.footer-main h5 {
    color: var(--white);
    margin-bottom: 1rem;
}

.footer-main a {
    color: var(--white);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-main a:hover {
    color: var(--secondary-color);
}

/* ===== СТРАНИЦА ПОСТА ===== */
.post-content {
    background-color: var(--light-gray);
}

.post-header {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

.post-title {
    color: var(--primary-color);
    font-size: 2.5rem;
    font-weight: 700;
}

.post-meta {
    font-size: 0.9rem;
}

.post-image {
    border-radius: 15px;
    overflow: hidden;
}

.post-body {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    line-height: 1.8;
}

.post-body h2 {
    color: var(--primary-color);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-body h3 {
    color: var(--accent-color);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.post-body img {
    border-radius: 10px;
    margin: 1.5rem 0;
}

.post-share {
    background: var(--white);
    padding: 1.5rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
}

/* ===== ХЛЕБНЫЕ КРОШКИ ===== */
.custom-breadcrumb {
    background: var(--light-gray);
    border-radius: var(--radius);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--border-light);
}

.custom-breadcrumb .breadcrumb-item {
    font-size: var(--font-size-sm);
    color: var(--text-medium);
}

.custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--text-muted);
    font-weight: var(--font-weight-bold);
    margin: 0 0.5rem;
}

.custom-breadcrumb .breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition-normal);
    display: inline-flex;
    align-items: center;
}

.custom-breadcrumb .breadcrumb-link:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

.custom-breadcrumb .breadcrumb-item.active {
    color: var(--text-dark);
    font-weight: var(--font-weight-medium);
}

.custom-breadcrumb .breadcrumb-item.active i {
    color: var(--primary-color);
}

/* Адаптивность для хлебных крошек */
@media (max-width: 576px) {
    .custom-breadcrumb {
        padding: 0.75rem 1rem;
        margin-bottom: 1.5rem;
    }
    
    .custom-breadcrumb .breadcrumb-item {
        font-size: var(--font-size-xs);
    }
    
    .custom-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
        margin: 0 0.25rem;
    }
}

/* ===== АДАПТИВНОСТЬ ===== */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
        letter-spacing: 1px;
    }
    
    .hero-subtitle {
        font-size: 1.1rem;
    }
    
    .section-title {
        font-size: 1.75rem;
    }
    
    .post-title {
        font-size: 2rem;
    }
    
    .navbar-text {
        display: none !important;
    }
    
    .hero-section {
        padding: 3rem 0;
    }
    
    .blog-card-body {
        padding: 1rem;
    }
    
    .post-body {
        padding: 1.5rem;
    }
}

@media (max-width: 576px) {
    .hero-title {
        font-size: 1.75rem;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .post-title {
        font-size: 1.75rem;
    }
    
    .hero-section {
        padding: 2rem 0;
    }
    
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* Стили для WordPress */
.post-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}

.post-item {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.post-item:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
}

.post-featured-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.post-item:hover .post-featured-image img {
    transform: scale(1.05);
}

.post-item h3 {
    padding: 1rem 1rem 0.5rem;
    font-size: 1.25rem;
}

.post-item h3 a {
    color: var(--primary-color);
    text-decoration: none;
}

.post-item h3 a:hover {
    color: var(--accent-color);
}

.post-item p {
    padding: 0 1rem;
    color: var(--text-light);
    flex-grow: 1;
}

.post-item > a:last-child {
    display: inline-block;
    margin: 1rem;
    padding: 0.5rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 500;
    transition: all 0.3s ease;
    align-self: flex-start;
}

.post-item > a:last-child:hover {
    background-color: var(--accent-color);
    transform: translateY(-2px);
}

/* WordPress пагинация */
.pagination-container {
    margin: 2rem 0;
    display: flex;
    justify-content: center;
}

.page-numbers {
    display: inline-block;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    text-decoration: none;
    color: var(--primary-color);
    transition: all 0.3s ease;
}

.page-numbers:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-numbers.current {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    color: var(--white);
}

.page-content {
    background: var(--white);
    padding: 2rem;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin: 2rem auto;
    max-width: 800px;
}

.page-content h1 {
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.page-content .content {
    line-height: 1.8;
}

/* Хлебные крошки WordPress */
.breadcrumbs {
    background: var(--light-gray);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: var(--radius);
    font-size: var(--font-size-sm);
    border: 1px solid var(--border-light);
}

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

.breadcrumbs a:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.breadcrumbs span {
    color: var(--text-dark);
    font-weight: var(--font-weight-medium);
}