/* Epic Pathfinder Theme Styles - Enhanced Version */
:root {
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --text-color: #374151;
    --gray-light: #f9fafb;
    --gray-medium: #6b7280;
    --gray-dark: #374151;
    --border-radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --code-bg: #f8fafc;
    --quote-border: #e2e8f0;
}

/* Existing Theme Styles */
.hero-gradient {
    background: var(--primary-gradient);
    color: white;
    padding: 2rem 0;
}

.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.nav-item {
    transition: all 0.3s ease;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
}

.d20-icon {
    width: 60px;
    height: 60px;
    background: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: var(--primary-color);
    margin: 0 auto 1rem;
}

.stat-card {
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    padding: 1rem;
    text-align: center;
    color: white;
}

/* Footer Centering Fix */
.site-footer {
    max-width: 1000px;
    width: 100%;
    margin: 2rem auto 0 auto;
    text-align: center;
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 2rem;
}

.site-footer .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.site-footer h1,
.site-footer h2,
.site-footer h3,
.site-footer p,
.site-footer a {
    margin: 0 auto;
    text-align: center;
}

/* Центрирование для элементов футера внутри bg-white rounded-lg shadow-lg */
.bg-white.rounded-lg.shadow-lg.overflow-hidden .footer-content,
.bg-white.rounded-lg.shadow-lg .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    width: 100%;
}

/* Enhanced Post Content Styles */
.post-content {
    /* ограничиваем ширину читаемой области */
    max-width: 900px;
    /* или 650px–800px по вкусу */
    margin: 0 auto;
    /* центрируем */
    color: var(--text-color);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.7;
}

/* Headings Styling */
.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
    color: var(--primary-color);
    font-weight: 700;
    line-height: 1.3;
    margin-top: 2rem;
    margin-bottom: 1rem;
}

.post-content h1 {
    font-size: 2.25rem;
    margin-top: 0;
}

.post-content h2 {
    font-size: 1.875rem;
    border-bottom: 2px solid var(--gray-light);
    padding-bottom: 0.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content h4 {
    font-size: 1.25rem;
}

.post-content h5 {
    font-size: 1.125rem;
}

.post-content h6 {
    font-size: 1rem;
    color: var(--gray-medium);
}

/* Paragraphs */
.post-content p {
    margin-bottom: 1.5rem;
    line-height: 1.7;
}

.post-content p:last-child {
    margin-bottom: 0;
}

/* Links */
.post-content a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: all 0.3s ease;
}

.post-content a:hover {
    color: var(--secondary-color);
    border-bottom-color: var(--secondary-color);
}

/* Lists */
.post-content ul,
.post-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.post-content ul li,
.post-content ol li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.post-content ul {
    list-style-type: disc;
}

.post-content ul ul {
    list-style-type: circle;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

.post-content ol {
    list-style-type: decimal;
}

.post-content ol ol {
    list-style-type: lower-alpha;
    margin-top: 0.5rem;
    margin-bottom: 0.5rem;
}

/* Blockquotes */
.post-content blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--gray-light);
    padding: 1.5rem;
    margin: 2rem 0;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    position: relative;
}

.post-content blockquote p {
    margin-bottom: 0;
    font-size: 1.1rem;
    color: var(--gray-dark);
}

.post-content blockquote cite {
    display: block;
    margin-top: 1rem;
    font-size: 0.9rem;
    color: var(--gray-medium);
    font-style: normal;
}

/* Code Blocks */
.post-content code {
    background: var(--code-bg);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    color: #e83e8c;
    border: 1px solid #e2e8f0;
}

.post-content pre {
    background: #1a202c;
    color: #e2e8f0;
    padding: 1.5rem;
    border-radius: 8px;
    overflow-x: auto;
    margin: 2rem 0;
    font-family: 'Fira Code', 'Monaco', 'Consolas', monospace;
    font-size: 0.875rem;
    line-height: 1.5;
}

.post-content pre code {
    background: none;
    padding: 0;
    border: none;
    color: inherit;
    font-size: inherit;
}

/* Tables */
.table-wrapper{
      overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: 6px;
}
.post-content table {
    width: 100%;
    min-width: 450px;
    border-collapse: collapse;
    margin: 2rem 0;
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.post-content thead th {
    background: var(--primary-color);
    color: white;
    padding: 1rem;
    text-align: left;
    font-weight: 600;
}

.post-content tbody td {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
}

.post-content tbody tr:nth-child(even) {
    background: #f8fafc;
}

.post-content tbody tr:hover {
    background: #edf2f7;
}

/* Table wrapper for responsive design */
.post-content .table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
}

.post-content .table-wrapper table {
    margin: 0;
    min-width: 600px;
}

/* Images */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.post-content figure {
    margin: 2rem 0;
    text-align: center;
}

.post-content figcaption {
    font-size: 0.875rem;
    color: var(--gray-medium);
    margin-top: 0.5rem;
    font-style: italic;
}

/* Horizontal Rule */
.post-content hr {
    border: none;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
    margin: 3rem 0;
}

/* Existing Prose Compatibility */
.prose {
    max-width: none;
    color: var(--text-color);
}

.prose h1,
.prose h2,
.prose h3,
.prose h4,
.prose h5,
.prose h6 {
    color: var(--primary-color);
    font-weight: 700;
}

.prose a {
    color: var(--primary-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.prose a:hover {
    color: var(--secondary-color);
}

.prose blockquote {
    border-left: 4px solid var(--primary-color);
    background: var(--gray-light);
    padding: 1rem;
    margin: 1.5rem 0;
    border-radius: 0 8px 8px 0;
}

.prose code {
    background: var(--gray-light);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-size: 0.9rem;
}

.prose pre {
    background: #1a1a1a;
    color: #00ff00;
    padding: 1rem;
    border-radius: 8px;
    overflow-x: auto;
}

/* Pagination styles */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 3rem;
    gap: 1rem;
}

.pagination a,
.pagination span {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s ease;
}

.pagination a {
    background: white;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

.pagination a:hover {
    background: var(--primary-color);
    color: white;
}

.pagination .current {
    background: var(--primary-color);
    color: white;
}

/* Tag cloud styles */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 2rem 0;
}

.tag-cloud a {
    background: var(--primary-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-cloud a:hover {
    background: var(--secondary-color);
    transform: scale(1.05);
}

/* Search functionality */
.search-container {
    position: relative;
    margin-bottom: 2rem;
}

.search-input {
    width: 100%;
    padding: 1rem;
    border: 2px solid var(--primary-color);
    border-radius: var(--border-radius);
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.search-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    z-index: 1000;
    max-height: 400px;
    overflow-y: auto;
}

.search-result-item {
    padding: 1rem;
    border-bottom: 1px solid #f3f4f6;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.search-result-item:hover {
    background-color: var(--gray-light);
}

.search-result-item:last-child {
    border-bottom: none;
}

/* Animation for loading states */
.loading {
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.6s ease;
}

.loaded {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Media Queries */
/* Large screens (1200px and up) */
@media (min-width: 1200px) {
    .post-content {
        font-size: 18px;
    }

    .post-content h1 {
        font-size: 2.5rem;
    }

    .post-content h2 {
        font-size: 2rem;
    }
}

/* Medium screens (768px to 1199px) */
@media (max-width: 1199px) and (min-width: 768px) {
    .post-content {
        font-size: 16px;
    }

    .post-content h1 {
        font-size: 2.25rem;
    }

    .post-content h2 {
        font-size: 1.875rem;
    }

    .d20-icon {
        width: 50px;
        height: 50px;
        font-size: 1.5rem;
    }
}

/* Small screens (576px to 767px) */
@media (max-width: 767px) and (min-width: 576px) {
    .post-content {
        font-size: 15px;
        line-height: 1.6;
    }

    .post-content h1 {
        font-size: 1.875rem;
        margin-top: 1.5rem;
    }

    .post-content h2 {
        font-size: 1.5rem;
        margin-top: 1.5rem;
    }

    .post-content h3 {
        font-size: 1.25rem;
    }

    .post-content ul,
    .post-content ol {
        padding-left: 1.5rem;
    }

    .post-content blockquote {
        padding: 1rem;
        margin: 1.5rem 0;
    }

    .post-content pre {
        padding: 1rem;
        font-size: 0.75rem;
    }

    .post-content table {
        font-size: 0.875rem;
    }

    .post-content thead th,
    .post-content tbody td {
        padding: 0.75rem;
    }

    .d20-icon {
        width: 45px;
        height: 45px;
        font-size: 1.25rem;
    }

    .hero-gradient {
        padding: 1.5rem 0;
    }

    .hero-gradient h1 {
        font-size: 2rem;
    }

    .hero-gradient p {
        font-size: 1rem;
    }
}

/* Extra small screens (up to 575px) */
@media (max-width: 575px) {
    .post-content {
        font-size: 14px;
        line-height: 1.5;
    }

    .post-content h1 {
        font-size: 1.5rem;
        margin-top: 1rem;
        margin-bottom: 0.75rem;
    }

    .post-content h2 {
        font-size: 1.25rem;
        margin-top: 1rem;
        margin-bottom: 0.75rem;
    }

    .post-content h3 {
        font-size: 1.125rem;
    }

    .post-content h4 {
        font-size: 1rem;
    }

    .post-content p {
        margin-bottom: 1rem;
    }

    .post-content ul,
    .post-content ol {
        padding-left: 1.25rem;
        margin: 1rem 0;
    }

    .post-content blockquote {
        padding: 0.75rem;
        margin: 1rem 0;
        font-size: 0.95rem;
    }

    .post-content pre {
        padding: 0.75rem;
        font-size: 0.7rem;
        margin: 1rem 0;
    }

    .post-content code {
        font-size: 0.75rem;
        padding: 0.2rem 0.3rem;
    }



    .post-content thead th,
    .post-content tbody td {
        padding: 0.5rem;
    }

    .post-content img {
        margin: 1rem 0;
    }

    .d20-icon {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .hero-gradient {
        padding: 1rem 0;
    }

    .hero-gradient h1 {
        font-size: 1.75rem;
    }

    .hero-gradient p {
        font-size: 0.9rem;
    }

    .stat-card {
        margin-bottom: 0.75rem;
        padding: 0.75rem;
    }

    /* Ensure tables are scrollable on small screens */
    .post-content table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
    @media screen and (max-width: 575px) {
        .post-content table {
            white-space: unset;
            font-size: 14px;
        }
        
    }

    .post-content thead,
    .post-content tbody,
    .post-content tr {
        display: table;
        width: 100%;
        table-layout: fixed;
    }
}

/* Print styles */
.post-content {
    font-size: 12pt;
    line-height: 1.4;
    color: black;
}

.post-content h1,
.post-content h2,
.post-content h3 {
    color: var(--primary-color);
    margin-top: 2rem;
    /* сохранить отступ сверху */
    margin-bottom: 1rem;
    /* сохранить отступ снизу */
}

.post-content blockquote {
    border-left: 2px solid black;
    background: none;
}

.post-content pre {
    background: #f5f5f5;
    color: black;
    border: 1px solid black;
}

.post-content img {
    max-width: 100%;
    page-break-inside: avoid;
}

/* Ограничиваем ширину карточки статьи и центрируем */
article.bg-white.rounded-lg.shadow-lg.overflow-hidden {
    max-width: 1000px;
    /* или 700px–900px по вкусу */
    margin: 2rem auto;
    /* по 2rem сверху/снизу, автоматически слева/справа */
    padding: 0;
    /* если нужно убрать дополнительный padding у article */
}

/* Ограничиваем ширину «карточки статьи» и «карточки автора» */
article.bg-white.rounded-lg.shadow-lg.overflow-hidden,
section.bg-white.rounded-lg.shadow-lg.p-6.mt-8 {
    /* та же ширина, что и у .post-content */
    max-width: 1000px;
    width: 100%;
    /* чтобы на узких экранах блок ужимался */
    margin: 2rem auto;
    /* центрируем по горизонтали и даём вертикальный отступ */
}

/* Цвет точек (маркеров) списков */
.post-content ul li::marker,
.post-content ol li::marker {
    color: var(--primary-color);
}

/* 1) Общий отступ под шапкой для всего макета статьи+сайдбара */
.post-layout-wrapper {
    margin-top: 2rem;
    /* или mt-8 в Tailwind, но здесь — чисто CSS */
}

/* 2) Убираем margin-top у <article>, который раньше добавлял отступ только слева */
.post-layout-wrapper article.bg-white.rounded-lg.shadow-lg.overflow-hidden {
    margin-top: 0 !important;
}

/* 3) Отступ сайдбара на мобильных (до 1024px) */
.post-sidebar {
    margin-top: 2rem;
}

/* 4) На десктопе (1024px+) выравниваем сайдбар по верху вместе с баннером */
@media (min-width: 1024px) {
    .post-sidebar {
        margin-top: 0 !important;
    }
}
@media (max-width: 448px) {
    .post-layout-wrapper {
        padding-left: 0.5rem;
        padding-right: 0.5rem;
    }
}



/* Дополнительное центрирование для элементов в header/footer */
.site-header,
.site-footer,
.hero-gradient {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

/* Центрирование текста внутри градиентных блоков */
.hero-gradient .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    max-width: 1120px;
    margin: 0 auto;
}

/* Центрирование для навигации */
.site-nav,
.main-nav {
    max-width: 1000px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
}
