/*
Theme Name: Postigo
Theme URI: https://postigo.net
Author: Postigo Team
Author URI: https://postigo.net
Description: Custom theme for Postigo blog in Ant Design style
Version: 1.9
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: postigo
*/

/* Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    color: rgba(0,0,0,0.85);
    line-height: 1.5715;
    background: #fafafa;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s;
}

img {
    max-width: 100%;
    height: auto;
}

/* Ant Design Colors */
:root {
    --primary-color: #1890ff;
    --success-color: #52c41a;
    --warning-color: #faad14;
    --error-color: #ff4d4f;
    --text-color: rgba(0,0,0,0.85);
    --text-secondary: rgba(0,0,0,0.45);
    --border-color: #f0f0f0;
    --bg-color: #fafafa;
}

/* Header */
body .header,
body.home .header,
body.single .header,
body.wp-singular .header {
    background: #fff !important;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
}

body .header-container,
body.home .header-container,
body.single .header-container,
body.wp-singular .header-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    padding: 0 24px !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    height: 64px !important;
}

.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-color);
}

.nav-menu {
    display: flex;
    gap: 32px;
    list-style: none;
}

.nav-menu a {
    color: var(--text-color);
    font-weight: 500;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.ant-btn {
    line-height: 1.5715;
    position: relative;
    display: inline-block;
    font-weight: 400;
    white-space: nowrap;
    text-align: center;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.645, 0.045, 0.355, 1);
    user-select: none;
    touch-action: manipulation;
    height: 32px;
    padding: 4px 15px;
    font-size: 14px;
    border-radius: 2px;
}

.ant-btn-primary {
    color: #fff;
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.ant-btn-primary:hover {
    background: #40a9ff;
    border-color: #40a9ff;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 48px auto;
    padding: 0 24px;
}

.content-wrapper {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 24px;
    align-items: start;
}

/* Blog Posts */
.blog-posts {
    background: transparent;
    border-radius: 0;
    padding: 0;
}

.post-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 32px;
    margin-bottom: 32px;
    transition: all 0.3s;
    box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.post-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    transform: translateY(-4px);
    border-color: var(--primary-color);
}

.post-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 12px;
    color: var(--text-color);
}

.post-title a:hover {
    color: var(--primary-color);
}

.post-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.post-excerpt {
    font-size: 16px;
    line-height: 1.8;
    color: var(--text-color);
    margin-bottom: 16px;
}

.read-more {
    color: var(--primary-color);
    font-weight: 500;
}

.read-more:hover {
    color: #40a9ff;
}

/* Breadcrumbs */
.breadcrumbs {
    max-width: 1200px;
    margin: 0 auto;
    padding: 24px 24px 0;
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.breadcrumbs a {
    color: var(--text-secondary);
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs i {
    font-size: 12px;
}

.breadcrumbs span {
    color: var(--text-color);
}

/* Single Post */
.single-post {
    background: #fff;
    padding: 32px;
}

/* Category Badge */
.post-categories {
    margin-bottom: 16px;
}

.category-badge {
    display: inline-block;
    padding: 4px 12px;
    background: var(--primary-color);
    color: #fff;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Post Title Single */
.post-title-single {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-color);
    margin-bottom: 24px;
}

/* Post Meta Single */
.post-meta-single {
    display: flex;
    gap: 24px;
    padding: 16px 0;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 32px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.meta-item i {
    color: var(--primary-color);
    font-size: 16px;
}

.meta-item strong {
    color: var(--text-color);
}

/* Post Thumbnail Single */
.post-thumbnail-single {
    margin-bottom: 48px;
    border-radius: 8px;
    overflow: hidden;
}

.post-thumbnail-single img {
    width: 100%;
    height: auto;
    display: block;
}

/* Post Content Single */
.post-content-single {
    font-size: 18px;
    line-height: 1.8;
    color: var(--text-color);
}

.post-content-single h1,
.post-content-single h2,
.post-content-single h3,
.post-content-single h4,
.post-content-single h5,
.post-content-single h6 {
    margin-top: 48px;
    margin-bottom: 24px;
    color: var(--text-color);
    font-weight: 600;
    line-height: 1.3;
}

.post-content-single h1 { font-size: 36px; }
.post-content-single h2 { font-size: 30px; }
.post-content-single h3 { font-size: 24px; }
.post-content-single h4 { font-size: 20px; }

.post-content-single p {
    margin-bottom: 24px;
}

.post-content-single img {
    margin: 32px 0;
    border-radius: 8px;
    max-width: 100%;
    height: auto;
}

.post-content-single ul,
.post-content-single ol {
    margin: 24px 0;
    padding-left: 32px;
}

.post-content-single li {
    margin-bottom: 12px;
}

.post-content-single blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 16px 24px;
    margin: 32px 0;
    background: #f0f9ff;
    font-style: italic;
    color: var(--text-secondary);
}

.post-content-single code {
    background: #f5f5f5;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 14px;
}

.post-content-single pre {
    background: #f5f5f5;
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 24px 0;
}

.post-content-single pre code {
    background: none;
    padding: 0;
}

.post-content-single a {
    color: var(--primary-color);
    text-decoration: underline;
}

.post-content-single a:hover {
    color: #40a9ff;
}

/* Post Tags */
.post-tags {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.post-tags i {
    color: var(--text-secondary);
    font-size: 16px;
}

.tag-badge {
    display: inline-block;
    padding: 6px 12px;
    background: #f5f5f5;
    color: var(--text-color);
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.3s;
}

.tag-badge:hover {
    background: var(--primary-color);
    color: #fff;
}

/* Post Share */
.post-share {
    margin-top: 32px;
    padding: 24px;
    background: #f5f5f5;
    border-radius: 8px;
}

.post-share h3 {
    font-size: 18px;
    margin-bottom: 16px;
    color: var(--text-color);
}

.share-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 4px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.share-btn.twitter {
    background: #1DA1F2;
}

.share-btn.facebook {
    background: #1877F2;
}

.share-btn.linkedin {
    background: #0A66C2;
}

/* Post Navigation */
.post-navigation {
    margin-top: 48px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

.nav-post {
    padding: 24px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.3s;
}

.nav-post:hover {
    border-color: var(--primary-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

.nav-post.prev-post {
    text-align: left;
}

.nav-post.next-post {
    text-align: right;
}

.nav-direction {
    font-size: 12px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.nav-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-color);
}

.nav-post:hover .nav-title {
    color: var(--primary-color);
}

.nav-post-placeholder {
    /* Empty space for alignment */
}

/* Comments Section */
.comments-section {
    margin-top: 48px;
    padding-top: 48px;
    border-top: 2px solid var(--border-color);
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 88px;
    align-self: start;
}

.sidebar-widget {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 24px;
    margin-bottom: 24px;
    transition: all 0.3s;
}

.sidebar-widget:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: var(--primary-color);
}

.widget-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text-color);
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 8px;
}

.widget-title i {
    color: var(--primary-color);
    font-size: 20px;
}

/* Sidebar Lists */
.sidebar-widget ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-widget ul li {
    margin-bottom: 12px;
    padding-left: 0;
}

.sidebar-widget ul li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 4px;
    transition: all 0.3s;
    color: var(--text-color);
}

.sidebar-widget ul li a:hover {
    background: #f0f9ff;
    color: var(--primary-color);
    transform: translateX(4px);
}

.sidebar-widget ul li a i {
    color: var(--primary-color);
    font-size: 14px;
    width: 16px;
}

.sidebar-widget ul li .post-count {
    margin-left: auto;
    background: #f0f0f0;
    color: var(--text-secondary);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

/* Sidebar CTA */
.sidebar-widget .widget-cta {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #1890ff 0%, #096dd9 100%);
    border-radius: 6px;
    text-align: center;
}

.sidebar-widget .widget-cta p {
    color: #fff;
    margin-bottom: 12px;
    font-size: 14px;
    line-height: 1.6;
}

.sidebar-widget .widget-cta .ant-btn {
    background: #fff;
    color: var(--primary-color);
    border: none;
    font-weight: 600;
}

.sidebar-widget .widget-cta .ant-btn:hover {
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Recent Posts Widget */
.recent-post-item {
    display: flex;
    gap: 12px;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.recent-post-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.recent-post-thumb {
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
}

.recent-post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-post-content {
    flex: 1;
}

.recent-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 4px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.recent-post-title:hover {
    color: var(--primary-color);
}

.recent-post-date {
    font-size: 12px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.recent-post-date i {
    font-size: 11px;
}

/* Tags Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-cloud-item {
    display: inline-block;
    padding: 6px 14px;
    background: #f5f5f5;
    color: var(--text-color);
    border-radius: 4px;
    font-size: 13px;
    transition: all 0.3s;
    border: 1px solid transparent;
}

.tag-cloud-item:hover {
    background: var(--primary-color);
    color: #fff;
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

/* Search Widget */
.search-form {
    position: relative;
}

.search-form input[type="search"] {
    width: 100%;
    padding: 10px 45px 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fff;
}

.search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.search-form input[type="search"]::placeholder {
    color: var(--text-secondary);
}

.search-form button[type="submit"],
.search-form input[type="submit"] {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 6px 12px;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
}

.search-form button[type="submit"]:hover,
.search-form input[type="submit"]:hover {
    background: #40a9ff;
    transform: translateY(-50%) scale(1.05);
}

.search-form .search-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    pointer-events: none;
    font-size: 16px;
}

/* WordPress Default Search Widget Styles */
.sidebar-widget .wp-block-search {
    margin: 0;
}

.sidebar-widget .wp-block-search__label {
    display: none;
}

.sidebar-widget .wp-block-search__inside-wrapper {
    position: relative;
    display: flex;
    gap: 8px;
}

.sidebar-widget .wp-block-search__input {
    flex: 1;
    padding: 10px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.sidebar-widget .wp-block-search__input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
}

.sidebar-widget .wp-block-search__button {
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
    white-space: nowrap;
}

.sidebar-widget .wp-block-search__button:hover {
    background: #40a9ff;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.sidebar-widget .wp-block-search__button svg {
    width: 18px;
    height: 18px;
}

/* Custom Search Widget */
.widget-search-form {
    position: relative;
}

.widget-search-form input[type="text"],
.widget-search-form input[type="search"] {
    width: 100%;
    padding: 12px 50px 12px 16px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
    background: #fafafa;
}

.widget-search-form input[type="text"]:focus,
.widget-search-form input[type="search"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(24, 144, 255, 0.1);
    background: #fff;
}

.widget-search-form button {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 4px;
    padding: 8px 16px;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.widget-search-form button:hover {
    background: #40a9ff;
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.3);
}

.widget-search-form button i {
    font-size: 14px;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    padding: 24px 0;
}

.pagination a,
.pagination .current,
.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    background: #fff;
    transition: all 0.3s;
    font-weight: 500;
    text-decoration: none;
}

.pagination a:hover,
.pagination .page-numbers:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.pagination .current,
.pagination .page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    cursor: default;
}

.pagination .dots {
    border: none;
    background: none;
    cursor: default;
}

.pagination .dots:hover {
    border: none;
    background: none;
    transform: none;
    box-shadow: none;
}

/* WordPress Pagination Navigation */
.nav-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 48px;
    padding: 24px 0;
}

.nav-links a,
.nav-links .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-color);
    background: #fff;
    transition: all 0.3s;
    font-weight: 500;
    text-decoration: none;
}

.nav-links a:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #f0f9ff;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(24, 144, 255, 0.15);
}

.nav-links .page-numbers.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #fff;
    cursor: default;
}

.nav-links .dots {
    border: none;
    background: none;
    cursor: default;
}

.nav-links .prev,
.nav-links .next {
    font-weight: 600;
}

.nav-links .prev i,
.nav-links .next i {
    margin: 0 4px;
}

/* Comments */
.comment-list {
    list-style: none;
    margin-top: 24px;
}

.comment {
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    margin-bottom: 16px;
}

.comment-author {
    font-weight: 600;
    margin-bottom: 8px;
}

.comment-meta {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 12px;
}

.comment-respond {
    margin-top: 32px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form textarea {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    margin-bottom: 16px;
    transition: border-color 0.3s;
}

.comment-form input[type="text"]:focus,
.comment-form input[type="email"]:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
}

.comment-form textarea {
    min-height: 120px;
}

.comment-form input[type="submit"] {
    background: var(--primary-color);
    color: #fff;
    border: 1px solid var(--primary-color);
    padding: 8px 24px;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.3s;
}

.comment-form input[type="submit"]:hover {
    background: #40a9ff;
}

/* Footer */
body .footer,
body.home .footer,
body.single .footer,
body.wp-singular .footer {
    background: #001529 !important;
    color: rgba(255,255,255,0.65) !important;
    padding: 60px 24px 24px !important;
    margin: 0 !important;
    width: 100% !important;
}

body .footer-container,
body.home .footer-container,
body.single .footer-container,
body.wp-singular .footer-container {
    max-width: 1200px !important;
    margin: 0 auto !important;
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important;
    gap: 48px !important;
    margin-bottom: 48px !important;
}

.footer-section h3 {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

.footer-section p {
    font-size: 14px;
    line-height: 1.8;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 8px;
}

.footer-links a {
    color: rgba(255,255,255,0.65);
    transition: color 0.3s;
}

.footer-links a:hover {
    color: #fff;
}

.footer-bottom {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.65);
}

/* Responsive */
@media (max-width: 768px) {
    .content-wrapper {
        grid-template-columns: 1fr;
    }

    .footer-container {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .nav-menu {
        display: none;
    }

    .header-container {
        padding: 0 16px;
    }

    .main-content {
        padding: 0 16px;
        margin: 32px auto;
    }

    .blog-posts,
    .single-post {
        padding: 24px;
    }
}

/* Breadcrumbs */
.breadcrumbs {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 0;
    margin-bottom: 24px;
    font-size: 14px;
    color: rgba(0,0,0,0.45);
}

.breadcrumbs a {
    color: rgba(0,0,0,0.65);
    transition: color 0.3s;
}

.breadcrumbs a:hover {
    color: var(--primary-color);
}

.breadcrumbs i {
    font-size: 10px;
    color: rgba(0,0,0,0.25);
}

.breadcrumbs span {
    color: rgba(0,0,0,0.85);
}

/* Internal Links (Wikipedia-style) */
.post-content-single .internal-link {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px dotted var(--primary-color);
    transition: all 0.3s;
}

.post-content-single .internal-link:hover {
    color: #096dd9;
    border-bottom-style: solid;
    background-color: rgba(24, 144, 255, 0.05);
}
