/*
Theme Name: P2P Journal
Theme URI: https://o-p2p.ru
Author: Finexsa
Description: Custom dark theme for P2P Journal blog
Version: 1.0
Template: kadence
Text Domain: p2p-journal
*/

*, *::before, *::after { box-sizing: border-box; }
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #0f1117;
    color: #e0e0e0;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: #7356BE; text-decoration: none; transition: color 0.2s; }
a:hover { color: #9b7ed8; }
img { max-width: 100%; height: auto; }

.site-header {
    background: #14181F;
    border-bottom: 1px solid #2a2e38;
    padding: 0 40px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-logo {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 18px;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #ffffff;
    white-space: nowrap;
}

.site-logo .p2p { color: #f0c040; }

.header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.header-nav a { color: #94a3b8; font-size: 12px; }
.header-nav a:hover { color: #ffffff; }

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 16px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.2s;
    border: 1px solid #2a2e38;
    color: #e0e0e0;
    background: transparent;
}

.header-btn:hover { border-color: #7356BE; color: #ffffff; }
.header-btn.telegram { border-color: #2a2e38; }
.header-btn.finexsa { background: #7356BE; border-color: #7356BE; color: #ffffff; }
.header-btn.finexsa:hover { background: #5a3f9e; }

.search-toggle {
    background: none !important;
    border: 1px solid #2a2e38 !important;
    border-radius: 6px !important;
    color: #94a3b8 !important;
    cursor: pointer;
    width: 36px !important;
    height: 36px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    transition: all 0.2s;
    padding: 0 !important;
}

.search-toggle:hover {
    border-color: #7356BE !important;
    color: #ffffff !important;
}

.search-toggle svg {
    width: 18px;
    height: 18px;
}

/* Search overlay - ensure it works properly */
.search-overlay {
    display: none;
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: #14181F;
    border-bottom: 1px solid #2a2e38;
    padding: 20px 40px;
    z-index: 1001;
    box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.search-overlay.active {
    display: block;
}

.search-overlay form {
    max-width: 600px;
    margin: 0 auto;
}

.search-overlay input[type=search] {
    width: 100%;
    background: #0f1117;
    border: 1px solid #2a2e38;
    border-radius: 8px;
    padding: 14px 20px;
    color: #ffffff;
    font-size: 16px;
    font-family: "Inter", sans-serif;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.search-overlay input[type=search]:focus {
    border-color: #7356BE;
    box-shadow: 0 0 0 2px rgba(115, 86, 190, 0.2);
}

.search-overlay input[type=search]::placeholder {
    color: #64748b;
}

.site-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 200px 1fr 280px;
    gap: 30px;
}

.sidebar-left { padding-top: 10px; }

.sidebar-left h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 16px;
    font-weight: 600;
}

.cat-list { list-style: none; padding: 0; margin: 0; }
.cat-list li { margin-bottom: 4px; }

.cat-list li a {
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    color: #94a3b8;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s;
}

.cat-list li a:hover,
.cat-list li.current-cat a {
    background: #1a1f2e;
    color: #ffffff;
}

.cat-list li a .count { float: right; color: #64748b; font-size: 12px; }

.main-content { min-width: 0; }

.section-title {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px solid #2a2e38;
}

.hero-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 24px;
    background: #1a1f2e;
}

.hero-card .hero-image { width: 100%; height: 360px; object-fit: cover; display: block; }

.hero-card .hero-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px;
    background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.hero-card .post-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    font-size: 12px;
    color: #94a3b8;
}

.hero-card .post-meta .author-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #7356BE;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
}

.hero-card .hero-title { font-size: 24px; font-weight: 700; color: #ffffff; line-height: 1.3; margin-bottom: 10px; }
.hero-card .hero-title a { color: #ffffff; }
.hero-card .hero-title a:hover { color: #f0c040; }

.hero-card .hero-excerpt { font-size: 14px; color: #b0b0b0; line-height: 1.5; }

.hero-card .post-tags { display: flex; gap: 8px; margin-top: 12px; }

.hero-card .post-tags a {
    padding: 4px 10px;
    background: rgba(115, 86, 190, 0.2);
    border-radius: 4px;
    font-size: 11px;
    color: #7356BE;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.post-views { display: inline-flex; align-items: center; gap: 4px; color: #64748b; font-size: 12px; }

.articles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.article-card {
    background: #1a1f2e;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #2a2e38;
}

.article-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.3); }

.article-card .card-image { width: 100%; height: 180px; object-fit: cover; display: block; }
.article-card .card-body { padding: 16px; }

.article-card .card-title { font-size: 15px; font-weight: 600; color: #ffffff; line-height: 1.4; margin-bottom: 8px; }
.article-card .card-title a { color: #ffffff; }
.article-card .card-title a:hover { color: #f0c040; }

.article-card .card-meta { font-size: 12px; color: #64748b; display: flex; justify-content: space-between; align-items: center; }

.load-more-wrap { text-align: center; margin: 30px 0; }

.load-more-btn {
    display: inline-block;
    padding: 12px 40px;
    background: transparent;
    border: 1px solid #2a2e38;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: 'Inter', sans-serif;
}

.load-more-btn:hover { border-color: #7356BE; color: #ffffff; }
.load-more-btn.loading { opacity: 0.5; pointer-events: none; }

.sidebar-right { padding-top: 10px; }
.sidebar-section { margin-bottom: 30px; }

.sidebar-section h3 {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #64748b;
    margin-bottom: 16px;
    font-weight: 600;
    padding-bottom: 10px;
    border-bottom: 1px solid #2a2e38;
}

.top-articles-list { list-style: none; padding: 0; margin: 0; }

.top-articles-list li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #1a1f2e;
}

.top-articles-list li:last-child { border-bottom: none; }
.top-articles-list .rank { font-size: 14px; font-weight: 700; color: #f0c040; min-width: 20px; }
.top-articles-list .top-article-info { flex: 1; min-width: 0; }

.top-articles-list .top-article-title { font-size: 13px; font-weight: 500; color: #e0e0e0; line-height: 1.4; display: block; margin-bottom: 3px; }
.top-articles-list .top-article-title:hover { color: #f0c040; }
.top-articles-list .top-article-views { font-size: 11px; color: #64748b; }

.top-authors-list { list-style: none; padding: 0; margin: 0; }

.top-authors-list li { display: flex; align-items: center; gap: 10px; padding: 8px 0; }

.top-authors-list .author-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #7356BE;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0;
}

.top-authors-list .author-info { flex: 1; }
.top-authors-list .author-name { font-size: 13px; font-weight: 600; color: #e0e0e0; display: block; }
.top-authors-list .author-stats { font-size: 11px; color: #64748b; }

.subscribe-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: #7356BE;
    border: none;
    border-radius: 8px;
    color: #ffffff;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
    font-family: 'Inter', sans-serif;
}

.subscribe-btn:hover { background: #5a3f9e; color: #ffffff; }

.site-footer {
    background: #14181F;
    border-top: 1px solid #2a2e38;
    padding: 40px;
    margin-top: 40px;
}

.footer-content {
    max-width: 1320px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 40px;
}

.footer-brand .footer-logo { font-family: 'Inter', sans-serif; font-weight: 800; font-size: 16px; color: #ffffff; margin-bottom: 10px; }
.footer-brand .footer-logo .p2p { color: #f0c040; }
.footer-brand p { font-size: 13px; color: #64748b; line-height: 1.6; }

.footer-section h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: #94a3b8; margin-bottom: 16px; font-weight: 600; }
.footer-section ul { list-style: none; padding: 0; margin: 0; }
.footer-section ul li { margin-bottom: 8px; }
.footer-section ul li a { color: #64748b; font-size: 13px; transition: color 0.2s; }
.footer-section ul li a:hover { color: #ffffff; }

.footer-bottom {
    max-width: 1320px;
    margin: 30px auto 0;
    padding-top: 20px;
    border-top: 1px solid #2a2e38;
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #4a4a5a;
}

.single-post-content {
    max-width: 1320px;
    margin: 0 auto;
    padding: 30px 40px;
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 30px;
}

.single-article { min-width: 0; }
.single-article .post-header { margin-bottom: 24px; }
.single-article .post-header h1 { font-size: 32px; font-weight: 700; color: #ffffff; line-height: 1.3; margin-bottom: 16px; }
.single-article .post-header .post-meta { display: flex; align-items: center; gap: 16px; font-size: 13px; color: #64748b; }
.single-article .post-featured-image { width: 100%; border-radius: 12px; margin-bottom: 24px; }

.single-article .entry-content { font-size: 16px; line-height: 1.8; color: #d0d0d0; }
.single-article .entry-content h2 { font-size: 24px; font-weight: 700; color: #ffffff; margin: 32px 0 16px; }
.single-article .entry-content h3 { font-size: 20px; font-weight: 600; color: #ffffff; margin: 24px 0 12px; }
.single-article .entry-content p { margin-bottom: 16px; }
.single-article .entry-content a { color: #7356BE; }
.single-article .entry-content a:hover { color: #9b7ed8; text-decoration: underline; }
.single-article .entry-content ul,
.single-article .entry-content ol { margin: 16px 0; padding-left: 24px; color: #d0d0d0; }
.single-article .entry-content li { margin-bottom: 8px; }

.single-article .entry-content blockquote {
    border-left: 3px solid #7356BE;
    padding: 16px 24px;
    margin: 24px 0;
    background: #1a1f2e;
    border-radius: 0 8px 8px 0;
    color: #b0b0b0;
    font-style: italic;
}

.single-article .entry-content code { background: #1a1f2e; padding: 2px 6px; border-radius: 4px; font-size: 14px; color: #f0c040; }
.single-article .entry-content pre { background: #1a1f2e; padding: 20px; border-radius: 8px; overflow-x: auto; margin: 24px 0; }
.single-article .entry-content img { border-radius: 8px; margin: 16px 0; }

.single-article .post-tags a {
    padding: 4px 10px;
    background: rgba(115, 86, 190, 0.2);
    border-radius: 4px;
    font-size: 11px;
    color: #7356BE;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 1024px) {
    .site-content { grid-template-columns: 1fr 250px; padding: 20px; }
    .sidebar-left { display: none; }
    .single-post-content { padding: 20px; }
}

@media (max-width: 768px) {
    .site-header { padding: 0 16px; }
    .header-nav { display: none; }
    .header-btn.telegram span { display: none; }
    .site-content { grid-template-columns: 1fr; padding: 16px; }
    .sidebar-right { order: 3; }
    .articles-grid { grid-template-columns: 1fr; }
    .single-post-content { grid-template-columns: 1fr; padding: 16px; }
    .footer-content { grid-template-columns: 1fr; gap: 24px; }
    .footer-bottom { flex-direction: column; gap: 8px; }
    .hero-card .hero-title { font-size: 20px; }
    .hero-card .hero-image { height: 240px; }
}

/* Finexsa logo button */
.header-btn.finexsa-logo {
    background: #14181F !important;
    border: 1px solid #2a2e38 !important;
    padding: 4px 12px !important;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    transition: all 0.2s;
    text-transform: none !important;
    letter-spacing: 0 !important;
}

.header-btn.finexsa-logo:hover {
    border-color: #f0c040 !important;
    background: #1a1f2e !important;
}

/* Finexsa logo text */
.finexsa-text {
    font-family: 'Inter', sans-serif;
    font-weight: 800;
    font-size: 17px;
    color: #ffffff;
    letter-spacing: -0.3px;
    font-style: normal !important;
    text-transform: none !important;
    display: inline-block;
}

.finexsa-i {
    position: relative;
    font-style: normal !important;
}

.finexsa-i::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 60%;
    transform: translateX(-50%);
    width: 3px;
    height: 3px;
    background: #f0c040;
    border-radius: 50%;
}

/* Search overlay admin bar fix */
.admin-bar .search-overlay { top: 92px; }
@media (max-width: 782px) { .admin-bar .search-overlay { top: 106px; } }

/* Finexsa button on mobile - keep visible but compact */
@media (max-width: 768px) {
    .header-btn.finexsa-logo {
        padding: 3px 8px !important;
    }
    .finexsa-text {
        font-size: 14px;
    }
}
