/*
 * ViPosts Frontend Styles
 * WPBeginner-inspired layout
 */

/* ===== Container & Layout ===== */
.viposts-single-post,
.viposts-archive {
    background-color: #F4F5F5;
    min-height: 100vh;
    padding: 40px 0;
}

.viposts-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
}

.viposts-archive .viposts-container {
    grid-template-columns: 1fr;
}

.viposts-content-area {
    min-width: 0;
    background: #FFFFFF;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* Layout variants */
.viposts-layout-narrow .viposts-container {
    max-width: 800px;
    grid-template-columns: 1fr;
}

.viposts-layout-fullwidth .viposts-container {
    max-width: 100%;
}

/* ===== Breadcrumbs ===== */
.viposts-breadcrumbs {
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.viposts-breadcrumbs-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 8px;
}

.viposts-breadcrumb-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.viposts-breadcrumbs a {
    color: #666;
    text-decoration: none;
    transition: color 0.2s;
    font-weight: 700;
}

.viposts-breadcrumbs a:hover {
    color: #2271b1;
}

.viposts-breadcrumb-separator {
    color: #999;
    font-weight: 700;
}

/* ===== Entry Header ===== */
.viposts-entry-header {
    margin-bottom: 30px;
}

.viposts-entry-title {
    font-size: 36px;
    line-height: 1.3;
    margin: 20px 0;
    color: #1a1a1a;
    font-weight: 700;
}

.viposts-featured-image {
    margin: 20px 0;
    border-radius: 8px;
    overflow: hidden;
}

.viposts-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.viposts-featured-above-header {
    margin: 0 -20px 30px;
    border-radius: 0;
}

.viposts-featured-above-header img {
    max-height: 500px;
    object-fit: cover;
}

.viposts-featured-image-behind {
    position: relative;
    margin: -40px -20px 30px;
    height: 400px;
    overflow: hidden;
}

.viposts-featured-image-behind img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.3;
}

/* ===== Post Meta ===== */
.viposts-entry-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    color: #666;
    margin-bottom: 20px;
}

.viposts-author {
    color: #2271b1;
    text-decoration: none;
    font-weight: 600;
}

.viposts-author:hover {
    text-decoration: underline;
}

.viposts-meta-separator {
    color: #ccc;
}

/* ===== Social Share ===== */
.viposts-social-share {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
    border-bottom: 1px solid #e5e5e5;
    margin: 20px 0;
}

.viposts-share-count {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding-right: 20px;
    border-right: 1px solid #e5e5e5;
    flex-shrink: 0;
}

.viposts-share-number {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    line-height: 1;
}

.viposts-share-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.viposts-share-buttons {
    display: flex;
    gap: 8px;
    flex: 1;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.viposts-share-buttons::-webkit-scrollbar {
    display: none; /* Chrome/Safari */
}

.viposts-share-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.viposts-share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.viposts-share-facebook {
    background: #1877f2;
}

.viposts-share-twitter {
    background: #1da1f2;
}

.viposts-share-linkedin {
    background: #0077b5;
}

.viposts-share-whatsapp {
    background: #25d366;
}

.viposts-share-email {
    background: #666;
}

/* Bottom social share */
.viposts-social-share-bottom {
    flex-direction: column;
    align-items: flex-start;
    padding: 30px 0;
}

.viposts-share-title {
    font-size: 20px;
    margin-bottom: 15px;
}

.viposts-share-buttons-large {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    width: 100%;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.viposts-share-buttons-large::-webkit-scrollbar {
    display: none;
}

.viposts-share-button-large {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    color: #fff;
    transition: all 0.2s;
    white-space: nowrap;
    flex-shrink: 0;
}

.viposts-share-button-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
}

/* ===== Content ===== */
.viposts-entry-content {
    font-size: 18px;
    line-height: 1.8;
    color: #333;
}

.viposts-entry-content p {
    margin-bottom: 1.5em;
}

.viposts-entry-content h2 {
    font-size: 28px;
    margin-top: 2em;
    margin-bottom: 0.8em;
    font-weight: 700;
    color: #1a1a1a;
}

.viposts-entry-content h3 {
    font-size: 24px;
    margin-top: 1.8em;
    margin-bottom: 0.8em;
    font-weight: 700;
    color: #1a1a1a;
}

.viposts-entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

.viposts-entry-content ul,
.viposts-entry-content ol {
    margin: 1.5em 0;
    padding-left: 30px;
}

.viposts-entry-content li {
    margin-bottom: 0.8em;
}

.viposts-entry-content a {
    color: #2271b1;
    text-decoration: underline;
}

.viposts-entry-content a:hover {
    color: #135e96;
}

/* Content spacing variants */
.viposts-spacing-tight .viposts-entry-content {
    line-height: 1.6;
}

.viposts-spacing-loose .viposts-entry-content {
    line-height: 2;
}

/* ===== Tags ===== */
.viposts-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 30px 0;
    padding: 20px 0;
    border-top: 1px solid #e5e5e5;
}

.viposts-tags-label {
    font-weight: 600;
    color: #666;
}

.viposts-tag {
    display: inline-block;
    padding: 6px 14px;
    background: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
    text-decoration: none;
    transition: background 0.2s;
}

.viposts-tag:hover {
    background: #e0e0e0;
}

/* ===== Author Bio ===== */
.viposts-author-bio {
    display: flex;
    gap: 20px;
    padding: 25px;
    background: #f9f9f9;
    border-radius: 8px;
    margin: 30px 0;
}

.viposts-author-avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
}

.viposts-author-info {
    flex: 1;
}

.viposts-author-name {
    font-size: 20px;
    margin: 0 0 10px;
}

.viposts-author-name a {
    color: #1a1a1a;
    text-decoration: none;
}

.viposts-author-name a:hover {
    color: #2271b1;
}

.viposts-author-description {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
}

/* ===== Sidebar ===== */
.viposts-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.viposts-widget {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 20px;
}

.viposts-widget-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 15px;
    color: #1a1a1a;
}

/* ===== Archive/Blog Listing ===== */
.viposts-archive-header {
    margin-bottom: 40px;
    padding-bottom: 20px;
}

.viposts-archive-header.has-title {
    border-bottom: 2px solid #2271b1;
}

.viposts-archive-title {
    font-size: 36px;
    margin: 20px 0;
    color: #1a1a1a;
}

.viposts-archive-description {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* Archive Controls */
.viposts-archive-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
    margin-top: 20px;
    padding: 20px;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.viposts-view-toggle {
    display: flex;
    gap: 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}

.viposts-view-btn {
    padding: 10px 15px;
    background: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viposts-view-btn:hover {
    background: #f5f5f5;
}

.viposts-view-btn.active {
    background: #2271b1;
    color: #fff;
}

.viposts-archive-search {
    flex: 1;
    max-width: 400px;
}

.viposts-search-form {
    display: flex;
    gap: 0;
    border: 2px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s;
}

.viposts-search-form:focus-within {
    border-color: #2271b1;
}

.viposts-search-field {
    flex: 1;
    padding: 10px 15px;
    border: none;
    font-size: 15px;
    outline: none;
}

.viposts-search-submit {
    padding: 10px 15px;
    background: #2271b1;
    border: none;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.viposts-search-submit:hover {
    background: #135e96;
}

.viposts-posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* List View */
.viposts-posts-grid.list-view {
    grid-template-columns: 1fr;
}

.viposts-posts-grid.list-view .viposts-post-card {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 25px;
}

.viposts-posts-grid.list-view .viposts-post-thumbnail {
    margin: 0;
}

.viposts-posts-grid.list-view .viposts-post-thumbnail img {
    height: 200px;
    object-fit: cover;
}

.viposts-posts-grid.list-view .viposts-post-content {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.viposts-post-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s, transform 0.2s;
}

.viposts-post-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.viposts-post-thumbnail img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.viposts-post-content {
    padding: 20px;
}

.viposts-post-category {
    margin-bottom: 10px;
}

.viposts-post-category a {
    display: inline-block;
    padding: 4px 12px;
    background: #2271b1;
    color: #fff;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    border-radius: 3px;
    font-weight: 600;
}

.viposts-post-title {
    font-size: 20px;
    margin: 10px 0;
    line-height: 1.4;
}

.viposts-post-title a {
    color: #1a1a1a;
    text-decoration: none;
}

.viposts-post-title a:hover {
    color: #2271b1;
}

.viposts-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
}

.viposts-post-excerpt {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
}

.viposts-read-more {
    display: inline-block;
    color: #2271b1;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.viposts-read-more:hover {
    color: #135e96;
}

/* ===== Pagination ===== */
.viposts-pagination {
    margin: 40px 0;
    text-align: center;
}

.viposts-pagination .page-numbers {
    display: inline-block;
    padding: 10px 15px;
    margin: 0 5px;
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s;
}

.viposts-pagination .page-numbers:hover,
.viposts-pagination .page-numbers.current {
    background: #2271b1;
    color: #fff;
    border-color: #2271b1;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .viposts-container {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .viposts-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .viposts-entry-title {
        font-size: 28px;
    }
    
    .viposts-entry-content {
        font-size: 16px;
    }
    
    .viposts-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .viposts-social-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .viposts-share-count {
        border-right: none;
        border-bottom: 1px solid #e5e5e5;
        padding-right: 0;
        padding-bottom: 15px;
        margin-bottom: 15px;
    }
    
    /* CRITICAL: Hide button text on mobile, show icons only */
    .viposts-share-buttons .viposts-share-button span,
    .viposts-share-buttons-large .viposts-share-button-large span {
        display: none !important;
        visibility: hidden !important;
    }
    
    .viposts-share-button,
    .viposts-share-button-large {
        padding: 10px !important;
        min-width: 44px !important;
        justify-content: center !important;
    }
    
    /* Increase icon size when text is hidden */
    .viposts-share-button svg,
    .viposts-share-button-large svg {
        width: 24px !important;
        height: 24px !important;
        margin: 0 !important;
    }
    
    .viposts-author-bio {
        flex-direction: column;
        text-align: center;
    }
    
    /* Breadcrumbs - enforce single line with horizontal scroll */
    .viposts-breadcrumbs {
        font-size: 11px !important;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        max-width: 100%;
    }
    
    .viposts-breadcrumbs::-webkit-scrollbar {
        display: none;
    }
    
    .viposts-breadcrumbs-list {
        flex-wrap: nowrap !important;
        display: inline-flex !important;
    }
    
    /* Use horizontal scroll for social buttons instead of grid */
    .viposts-share-buttons,
    .viposts-share-buttons-large {
        display: flex !important;
        overflow-x: auto !important;
        overflow-y: hidden !important;
        gap: 6px !important;
        width: 100% !important;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        flex-wrap: nowrap !important;
    }
    
    .viposts-share-buttons::-webkit-scrollbar,
    .viposts-share-buttons-large::-webkit-scrollbar {
        display: none;
    }
    
    /* Truncate breadcrumbs on mobile */
    .viposts-breadcrumbs {
        font-size: 12px;
    }
    
    /* Archive controls on mobile */
    .viposts-archive-controls {
        flex-direction: column;
        gap: 15px;
    }
    
    .viposts-archive-search {
        max-width: 100%;
        width: 100%;
    }
    
    /* List view on mobile */
    .viposts-posts-grid.list-view .viposts-post-card {
        grid-template-columns: 1fr;
    }
    
    .viposts-posts-grid.list-view .viposts-post-thumbnail img {
        height: 200px;
    }
}