/* ===================================================================
 * WiderMatrix - Single Post Styles (single.css)
 * Loaded only on is_single()
 * =================================================================== */

/* ===================================================================
 * 1. Article Section — Two-Column Layout
 * =================================================================== */
.article-section {
    padding: 60px 0 80px;
    background: var(--color-bg);
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 60px;
    align-items: start;
    min-width: 0;
}
.article-main {
    min-width: 0;
    max-width: 100%;
}

/* ===================================================================
 * 2. Article Main — Left Column
 * =================================================================== */

/* Hero Meta (category + date + read time in hero area) */
.single-hero-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: rgba(255,255,255,0.7);
    margin-top: 16px;
    flex-wrap: wrap;
}
.single-hero-meta .meta-category {
    display: inline-block;
    padding: 3px 12px;
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background var(--transition);
}
.single-hero-meta .meta-category:hover { background: var(--brand-primary); }
.single-hero-meta .meta-dot { opacity: 0.5; }

/* Meta (kept for compatibility) */
.article-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--color-text-muted);
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.meta-category {
    display: inline-block;
    padding: 3px 12px;
    background: var(--color-bg-soft);
    color: var(--brand-primary);
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    transition: background var(--transition);
}
.meta-category:hover { background: var(--brand-primary); color: #fff; }
.meta-dot { opacity: 0.4; }

/* Featured Image */
.article-featured-image {
    margin-bottom: 36px;
    border-radius: var(--radius-lg);
    overflow: hidden;
}
.article-featured-image img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Key Takeaways */
.key-takeaways {
    background: var(--color-bg-soft);
    border-left: 4px solid var(--brand-primary);
    border-radius: var(--radius-md);
    padding: 28px 32px;
    margin-bottom: 40px;
}
.key-takeaways-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--brand-primary);
    margin: 0 0 16px;
}
.key-takeaways-list {
    margin: 0;
    padding: 0 0 0 20px;
    list-style: disc;
}
.key-takeaways-list li {
    font-size: 15px;
    color: var(--color-text-muted);
    line-height: 1.8;
    margin-bottom: 6px;
}
.key-takeaways-list li:last-child { margin-bottom: 0; }

/* Article Content — Typography */
.article-content {
    font-size: 17px;
    line-height: 1.85;
    color: var(--color-text);
    margin-bottom: 40px;
}
.article-content h2 {
    font-size: 26px;
    font-weight: 800;
    margin: 48px 0 16px;
    color: var(--color-text);
    line-height: 1.3;
}
.article-content h3 {
    font-size: 20px;
    font-weight: 700;
    margin: 36px 0 12px;
    color: var(--color-text);
    line-height: 1.4;
}
.article-content h4 {
    font-size: 17px;
    font-weight: 700;
    margin: 28px 0 10px;
}
.article-content p {
    margin: 0 0 20px;
}
.article-content ul,
.article-content ol {
    padding-left: 24px;
    margin-bottom: 20px;
}
.article-content li {
    margin-bottom: 8px;
    line-height: 1.7;
}
.article-content img {
    max-width: 100% !important;
    height: auto !important;
    border-radius: var(--radius-md);
    display: block;
    margin: 20px auto 28px;
}

/* WordPress figure / figcaption */
.article-content figure {
    margin: 20px 0 28px;
    max-width: 100% !important;
}
.article-content figure img {
    margin: 0 auto;
}
.article-content figcaption {
    font-size: 13px;
    color: var(--color-text-muted);
    text-align: center;
    margin-top: 8px;
    font-style: italic;
}

/* WordPress blocks */
.article-content .wp-block-gallery,
.article-content .wp-block-columns {
    max-width: 100%;
    overflow: hidden;
}
.article-content .wp-block-columns {
    flex-wrap: wrap;
}
.article-content pre {
    overflow-x: auto;
    padding: 20px;
    background: var(--color-bg-dark);
    color: #e0d4dc;
    border-radius: var(--radius-md);
    font-size: 14px;
    line-height: 1.6;
    margin: 24px 0;
    -webkit-overflow-scrolling: touch;
}

/* Tables */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0 28px;
    font-size: 15px;
    line-height: 1.6;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.article-content thead {
    background: var(--brand-primary);
    color: #fff;
}
.article-content th {
    padding: 12px 16px;
    font-weight: 700;
    text-align: left;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.article-content td {
    padding: 12px 16px;
    border-top: 1px solid var(--color-border);
}
.article-content tbody tr:nth-child(even) {
    background: var(--color-bg-soft);
}
.article-content tbody tr:hover {
    background: rgba(0,0,0,0.02);
}
.article-content blockquote {
    border-left: 4px solid var(--brand-primary);
    margin: 28px 0;
    padding: 20px 24px;
    background: var(--color-bg-soft);
    border-radius: 0 var(--radius-md) var(--radius-md) 0;
    font-style: italic;
    color: var(--color-text-muted);
    font-size: 16px;
}
.article-content a {
    color: var(--brand-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--transition);
}
.article-content a:hover {
    color: var(--brand-primary-dark);
}

/* Tags */
.article-tags {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
    margin-bottom: 36px;
}
.tags-label {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-muted);
}
.tag-badge {
    display: inline-block;
    padding: 4px 14px;
    background: var(--color-bg-soft);
    color: var(--color-text-muted);
    border-radius: 999px;
    font-size: 13px;
    font-weight: 500;
    transition: all var(--transition);
}
.tag-badge:hover {
    background: var(--brand-primary);
    color: #fff;
}

/* Post Navigation (Previous / Next) */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    padding: 24px 0;
    margin-bottom: 24px;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
}
.post-nav-prev { text-align: left; }
.post-nav-next { text-align: right; }
.post-nav-link {
    display: inline-block;
    text-decoration: none;
    transition: transform var(--transition);
}
.post-nav-link:hover { transform: translateX(4px); }
.post-nav-prev .post-nav-link:hover { transform: translateX(-4px); }
.post-nav-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--brand-primary);
    margin-bottom: 4px;
}
.post-nav-title {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
}

/* Product Section Header */
.product-section-header {
    margin-top: 32px;
    margin-bottom: 12px;
}
.product-section-title {
    font-size: 22px;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 6px;
}
.product-section-subtitle {
    font-size: 15px;
    color: var(--color-text-muted);
    margin: 0;
}

/* Product Tabs */
.product-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 0;
}
.product-tab {
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-text-muted);
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: -2px;
    white-space: nowrap;
}
.product-tab:hover {
    color: var(--brand-primary);
}
.product-tab.active {
    color: var(--brand-primary);
    border-bottom-color: var(--brand-primary);
}

/* Tab Panels */
.product-tab-panel {
    display: none;
}
.product-tab-panel.active {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Product Info Section */
.product-info-section {
    margin-top: 36px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}
.product-info-top {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}
.product-info-block {
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

/* Carousel */
.pc-carousel-main {
    position: relative;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--color-bg-soft);
}
.pc-slide {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.4s ease;
}
.pc-slide.active { opacity: 1; }
.pc-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255,255,255,0.9);
    color: var(--brand-primary);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition);
    padding: 0;
    line-height: 1;
}
.pc-arrow svg {
    display: block;
    width: 18px;
    height: 18px;
}
.pc-arrow:hover {
    background: var(--brand-primary);
    color: #fff;
}
.pc-arrow-prev { left: 12px; }
.pc-arrow-next { right: 12px; }
.pc-carousel-thumbs {
    display: flex;
    gap: 8px;
    padding: 10px 12px;
    background: var(--color-bg-soft);
    border-top: 1px solid var(--color-border);
}
.pc-thumb {
    width: 56px;
    height: 56px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    opacity: 0.6;
    border: 2px solid transparent;
    transition: all 0.2s ease;
    flex-shrink: 0;
}
.pc-thumb.active,
.pc-thumb:hover {
    opacity: 1;
    border-color: var(--brand-primary);
}

/* Product Details */
.pc-details {
    padding: 28px;
    display: flex;
    flex-direction: column;
    height: 100%;
}
.pc-category {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--brand-primary);
    margin-bottom: 10px;
}
.pc-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--color-text);
    margin: 0 0 14px;
    line-height: 1.4;
}
.pc-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}
.pc-stars { color: #f5a623; font-size: 16px; }
.pc-reviews { font-size: 13px; color: var(--color-text-muted); }
/* Promo Box */
.pc-promo-box {
    background: var(--color-bg-soft);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px 18px;
    margin-bottom: 18px;
    flex-grow: 1;
}
.pc-promo-badge {
    display: inline-block;
    background: var(--brand-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 999px;
    margin-bottom: 10px;
}
.pc-promo-text {
    font-size: 14px;
    color: var(--color-text);
    line-height: 1.6;
    margin: 0 0 10px;
}
.pc-promo-text strong {
    color: var(--brand-primary);
}
.pc-promo-list {
    list-style: none;
    margin: 0;
    padding: 0;
}
.pc-promo-list li {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.8;
    padding-left: 0;
}
.pc-inquiry-btn {
    width: 100%;
    text-align: center;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 700;
}

/* Specs Table */
.pc-specs {
    padding: 28px;
    width: 100%;
}
.pc-specs-title {
    font-size: 18px;
    font-weight: 800;
    color: var(--brand-primary);
    margin: 0 0 20px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--color-border);
}
.pc-specs-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}
.pc-spec-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--color-border);
}
.pc-spec-item:nth-child(odd) {
    background: var(--color-bg-soft);
}
.pc-spec-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.pc-spec-value {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    text-align: right;
}


/* ===================================================================
 * 3. Article Sidebar — Right Column (Sticky)
 * =================================================================== */
.article-sidebar {
    position: sticky;
    top: 90px;
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.sidebar-widget {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
}

.sidebar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--brand-primary);
}

/* Author Card — Left-aligned layout */
.author-card {
    text-align: left;
}
.author-card-top {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.author-avatar {
    flex-shrink: 0;
}
.author-avatar img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--color-border);
    display: block;
}
.author-card-info {
    min-width: 0;
}
.author-name {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    margin: 0 0 2px;
    line-height: 1.3;
}
.author-role {
    font-size: 12px;
    color: var(--color-text-muted);
    margin: 0;
}

/* Stats Bar */
.author-stats {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 10px 0;
    border-top: 1px solid var(--color-border);
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 12px;
}
.stat-item {
    text-align: center;
    flex: 1;
}
.stat-number {
    display: block;
    font-size: 15px;
    font-weight: 800;
    color: var(--brand-primary);
    line-height: 1.2;
}
.stat-label {
    display: block;
    font-size: 11px;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-top: 2px;
}
.stat-sep {
    width: 1px;
    height: 22px;
    background: var(--color-border);
    flex-shrink: 0;
}

/* Author bio text */
.author-bio {
    font-size: 13px;
    color: var(--color-text-muted);
    line-height: 1.5;
    margin: 0;
}

/* Related Widget */
.related-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.related-item {
    display: flex;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    transition: opacity var(--transition);
}
.related-item:first-child { padding-top: 0; }
.related-item:last-child { border-bottom: none; padding-bottom: 0; }
.related-item:hover { opacity: 0.8; }

.related-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.related-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.related-info {
    flex: 1;
    min-width: 0;
}
.related-item-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.4;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.related-item-date {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Inquiry Widget */
.inquiry-desc {
    font-size: 14px;
    color: var(--color-text-muted);
    margin: 0 0 16px;
    line-height: 1.6;
}
.sidebar-inquiry-form input,
.sidebar-inquiry-form textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-bg-soft);
    margin-bottom: 10px;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.sidebar-inquiry-form input:focus,
.sidebar-inquiry-form textarea:focus {
    outline: none;
    border-color: var(--brand-primary);
    box-shadow: 0 0 0 3px rgba(136, 62, 116, 0.1);
}
.sidebar-inquiry-form .btn {
    margin-top: 4px;
    padding: 12px;
    font-size: 14px;
}


/* ===================================================================
 * 4. Related Posts Grid (Below Article)
 * =================================================================== */
.related-section {
    padding: 80px 0;
    background: var(--color-bg-soft);
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.related-card {
    display: block;
    background: var(--color-bg);
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition), box-shadow var(--transition);
}
.related-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.related-card-img {
    aspect-ratio: 16 / 9;
    overflow: hidden;
}
.related-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition);
}
.related-card:hover .related-card-img img {
    transform: scale(1.05);
}

.related-card-body {
    padding: 18px 20px;
}
.related-card-date {
    font-size: 12px;
    color: var(--color-text-muted);
}
.related-card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--color-text);
    line-height: 1.4;
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* ===================================================================
 * 5. CTA Banner
 * =================================================================== */
.cta-banner {
    padding: 80px 0;
}
.cta-inner {
    background: linear-gradient(135deg, #2a1626 0%, #3a1d33 50%, #883E74 100%);
    border-radius: var(--radius-lg);
    padding: 56px 48px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
}
.cta-desc {
    font-size: 16px;
    color: rgba(255,255,255,0.95);
    line-height: 1.7;
    margin: 0;
    max-width: 560px;
}
.btn-lg {
    padding: 18px 40px;
    font-size: 16px;
    flex-shrink: 0;
}


/* ===================================================================
 * 6. Responsive — Tablet
 * =================================================================== */
@media (max-width: 1100px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 48px;
    }
    .article-main {
        min-width: 0;
        max-width: 100%;
    }
    .article-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }
    .article-sidebar .inquiry-widget {
        grid-column: 1 / -1;
    }
    .related-grid { grid-template-columns: repeat(2, 1fr); }
    .cta-inner { flex-direction: column; text-align: center; padding: 40px 32px; }
}

/* ===================================================================
 * 7. Responsive — Mobile
 * =================================================================== */
@media (max-width: 768px) {
    .article-section { padding: 40px 0 60px; }
    .article-content { font-size: 16px; overflow-wrap: break-word; }
    .article-content h2 { font-size: 22px; margin-top: 36px; }
    .article-content h3 { font-size: 18px; }
    .article-content a { word-break: break-word; }
    .article-content table {
        font-size: 13px;
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .article-content th,
    .article-content td { padding: 8px 10px; }
    .key-takeaways { padding: 20px 18px; }
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    .post-nav-next { text-align: left; }
    .product-section-header {
        margin-top: 24px;
    }
    .product-section-title {
        font-size: 18px;
    }
    .product-section-subtitle {
        font-size: 13px;
    }
    .product-info-top {
        grid-template-columns: 1fr;
    }
    .pc-carousel-thumbs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    .pc-thumb {
        width: 48px;
        height: 48px;
    }
    .pc-specs-grid {
        grid-template-columns: 1fr;
    }
    .pc-specs { padding: 16px; }
    .pc-details { padding: 16px; }
    .pc-title { font-size: 16px; }
    .pc-price-current { font-size: 24px; }
    .product-tabs {
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 2px;
    }
    .product-tab {
        padding: 10px 14px;
        font-size: 13px;
    }
    .pc-spec-item {
        padding: 10px 12px;
    }
    .pc-arrow {
        width: 32px;
        height: 32px;
    }
    .pc-arrow svg {
        width: 14px;
        height: 14px;
    }

    .article-sidebar {
        grid-template-columns: 1fr;
    }

    .related-grid { grid-template-columns: 1fr; }
    .related-section { padding: 60px 0; }
    .cta-banner { padding: 60px 0; }
    .cta-inner { padding: 36px 24px; }
}
