/* ========================================
   ARTICLE PAGE CSS
   Styles specific to article.php
   ======================================== */

/* Article Page Meta */
.article-page-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-md);
    flex-wrap: wrap;
}

.article-author-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.author-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    /* border: 2px solid var(--border-color); */
}

.author-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.author-name {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.article-info {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* Article Actions */
.article-actions {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.article-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: var(--radius-md);
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.article-action-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--border-color-hover);
}

.article-action-btn svg {
    width: 20px;
    height: 20px;
}

.save-btn.saved {
    color: var(--primary-light);
    background: rgba(138, 80, 238, 0.15);
    border-color: var(--primary);
}

.save-btn.saved svg {
    fill: var(--primary-light);
}

/* Share Dropdown */
.share-dropdown {
    position: relative;
}

.share-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 180px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-xs);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all var(--transition-fast);
    z-index: 100;
}

.share-dropdown.active .share-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.share-dropdown-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    width: 100%;
    padding: 0.625rem 0.875rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.875rem;
    font-weight: 500;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: all var(--transition-fast);
}

.share-dropdown-item:hover {
    background: var(--bg-glass-strong);
    color: var(--text-primary);
}

.share-dropdown-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.share-dropdown-item[data-copy-url].copied {
    background: hsl(160, 80%, 45%);
    color: white;
}

.share-dropdown-item[data-copy-url].copied span {
    display: none;
}

.share-dropdown-item[data-copy-url].copied::after {
    content: 'Copied!';
}

@media (max-width: 480px) {
    .article-page-meta {
        gap: var(--spacing-sm);
    }

    .author-avatar {
        width: 36px;
        height: 36px;
    }

    .author-name {
        font-size: 0.875rem;
    }

    .article-info {
        font-size: 0.75rem;
    }

    .article-action-btn {
        width: 32px;
        height: 32px;
    }
}

/* ========================================
   Read Also Inline (WordPress Style)
   ======================================== */
.read-also-inline {
    display: block;
    margin: var(--spacing-lg) 0;
    padding: var(--spacing-md);
    background: rgba(255, 100, 100, 0.08);
    /* Light reddish background */
    border: 2px dotted rgba(241, 46, 46, 0.973);
    /* Dotted red border */
    border-radius: var(--radius-sm);
    position: relative;
    /* Context for overlay */
}

.read-also-label-overlay {
    position: absolute;
    top: -12px;
    left: 20px;
    background: var(--bg-primary);
    /* Match page background to mask border */
    padding: 0 8px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #e74c3c;
    /* Red text */
}

.read-also-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-xs) 0;
    text-decoration: none;
    border-bottom: 1px solid var(--border-color);
}

.read-also-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.read-also-item:first-of-type {
    padding-top: 0;
}

.read-also-thumb {
    flex-shrink: 0;
    width: 100px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--bg-glass-strong);
}

.read-also-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-fast);
}

.read-also-item:hover .read-also-thumb img {
    transform: scale(1.05);
}

.read-also-no-thumb {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-glass-strong);
    color: var(--text-muted);
}

.read-also-no-thumb svg {
    width: 20px;
    height: 20px;
    opacity: 0.5;
}

.read-also-item-title {
    flex: 1;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color var(--transition-fast);
}

.read-also-item:hover .read-also-item-title {
    color: var(--primary);
}

@media (max-width: 480px) {
    .read-also-inline {
        margin: var(--spacing-md) 0;
        padding: var(--spacing-sm);
    }

    .read-also-thumb {
        width: 110px;
        height: 55px;
    }

    .read-also-item-title {
        font-size: 0.8125rem;
    }
}

/* ========================================
   Share Section
   ======================================== */

/* Share Section */
.share-section {
    margin-top: var(--spacing-xl);
    padding: var(--spacing-sm) 0;
    /* background: var(--bg-card);
    background-image: var(--gradient-card);
    border: 1px solid var(--border-color); */
    border-radius: var(--radius-lg);
    text-align: center;
}

/* ========================================
   Article Tags
   ======================================== */
.article-tags {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-md);
    padding: var(--spacing-sm) 0;
    margin-bottom: var(--spacing-lg);
    /* background: var(--bg-card); */
    /* background-image: var(--gradient-card); */
    /* border: 1px solid var(--border-color); */
    border-radius: var(--radius-lg);
    text-align: center;
}

.tags-title {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0;
}

.tags-title svg {
    width: 20px;
    height: 20px;
}

.tags-list {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-xs);
}

.tag-badge {
    display: inline-block;
    padding: 0.175rem 0.55rem;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    transition: all var(--transition-fast);
}

.tag-badge:hover {
    color: white;
    background: var(--gradient-primary);
    border-color: transparent;
    box-shadow: var(--glow-primary);
}

.share-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.share-icons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--bg-glass-strong);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    transition: all var(--transition-fast);
}

.share-btn:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}

.share-btn svg {
    width: 22px;
    height: 22px;
}

/* Social Colors */
.share-btn.facebook:hover {
    background: #1877f2;
    border-color: #1877f2;
    color: white;
}

.share-btn.twitter:hover {
    background: #000;
    border-color: #000;
    color: white;
}

.share-btn.linkedin:hover {
    background: #0a66c2;
    border-color: #0a66c2;
    color: white;
}

.share-btn.whatsapp:hover {
    background: #25d366;
    border-color: #25d366;
    color: white;
}

.share-btn.copy-link:hover {
    background: var(--gradient-primary);
    border-color: transparent;
    color: white;
    box-shadow: var(--glow-primary);
}

.share-btn.copy-link.copied {
    background: hsl(160, 80%, 45%);
    border-color: transparent;
    color: white;
}

/* ========================================
   Comments Section
   ======================================== */
.comments-section {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.comments-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.comments-count {
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.25rem 0.75rem;
    background: var(--gradient-primary);
    color: white;
    border-radius: var(--radius-sm);
}

/* Comment Form */
.comment-form-wrapper {
    background: var(--bg-card);
    background-image: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-xl);
}

.comment-form-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.comment-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.comment-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-md);
}

@media (max-width: 480px) {
    .comment-form-row {
        grid-template-columns: 1fr;
    }
}

.comment-input,
.comment-textarea {
    width: 100%;
    padding: 0.875rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.9375rem;
    transition: all var(--transition-fast);
}

.comment-input:focus,
.comment-textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(138, 80, 238, 0.2);
}

.comment-textarea {
    min-height: 120px;
    resize: vertical;
}

.comment-submit {
    align-self: flex-start;
    padding: 0.875rem 2rem;
    background: var(--gradient-primary);
    border: none;
    border-radius: var(--radius-md);
    color: white;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.comment-submit:hover {
    transform: translateY(-2px);
    box-shadow: var(--glow-primary);
}

/* Comments List */
.comments-list {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

/* Single Comment */
.comment {
    display: flex;
    gap: var(--spacing-md);
}

.comment-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    /* border: 2px solid var(--border-color); */
}

.comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.comment-body {
    flex: 1;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: var(--spacing-md);
}

.comment-header {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-xs);
    flex-wrap: wrap;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.9375rem;
}

.comment-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.comment-text {
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.7;
}

.comment-actions {
    display: flex;
    gap: var(--spacing-md);
    margin-top: var(--spacing-sm);
}

.comment-action {
    font-size: 0.8125rem;
    color: var(--text-muted);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.comment-action:hover {
    color: var(--primary-light);
}

/* Nested Comments (Replies) */
.comment-replies {
    margin-top: var(--spacing-md);
    margin-left: var(--spacing-xl);
    padding-left: var(--spacing-md);
    border-left: 2px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.comment-replies .comment-avatar {
    width: 40px;
    height: 40px;
}

.comment-replies .comment-replies {
    margin-left: var(--spacing-lg);
}

/* Mobile Adjustments */
@media (max-width: 480px) {
    .comment-avatar {
        width: 40px;
        height: 40px;
    }

    .comment-replies {
        margin-left: var(--spacing-md);
        padding-left: var(--spacing-sm);
    }

    .comment-replies .comment-avatar {
        width: 32px;
        height: 32px;
    }
}

/* ========================================
   Related Articles (List View)
   ======================================== */
.related-articles {
    margin-top: var(--spacing-2xl);
    padding-top: var(--spacing-xl);
    border-top: 1px solid var(--border-color);
}

.related-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-lg);
}

.related-grid {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-lg);
}

.related-grid .article-card {
    display: flex;
    flex-direction: row;
    height: 140px;
    /* Article card height in list view */
    align-items: stretch;
}

.related-grid .article-thumbnail {
    width: 200px;
    height: 100%;
    flex-shrink: 0;
    aspect-ratio: auto;
    border-radius: var(--radius-lg) 0 0 var(--radius-lg);
    overflow: hidden;
}

.related-grid .article-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-grid .article-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--spacing-md) var(--spacing-lg);
}

.related-grid .article-title {
    font-size: 1.125rem;
    margin-bottom: var(--spacing-xs);
    -webkit-line-clamp: 2;
    line-clamp: 2;
}

.related-grid .article-category {
    top: 10px;
    left: 10px;
    font-size: 0.7rem;
    padding: 2px 8px;
}

@media (max-width: 640px) {
    /* .related-grid .article-card {
        height: auto;
    } */

    .related-grid .article-thumbnail {
        width: 160px;
    }

    .related-grid .article-title {
        font-size: 1rem;
    }
}

/* ========================================
   Breadcrumb
   ======================================== */
/* ========================================
   Breadcrumb
   ======================================== */
.article-breadcrumb {
    margin-bottom: var(--spacing-md);
}

.article-breadcrumb ol {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-xs);
    margin: 0;
    padding: 0;
    list-style: none;
}

.article-breadcrumb li {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    color: var(--text-muted);
}

.article-breadcrumb a {
    color: var(--text-secondary);
    transition: color var(--transition-fast);
}

.article-breadcrumb a:hover {
    color: var(--primary-light);
    text-decoration: underline;
}

.article-breadcrumb .breadcrumb-separator {
    opacity: 0.5;
    font-size: 0.75rem;
    margin: 0 2px;
}

.article-breadcrumb span[aria-current="page"] {
    color: var(--text-primary);
    font-weight: 500;
}

/* ========================================
   Article Body Tables
   ======================================== */
.article-body .table-wrapper {
    overflow-x: auto;
    margin: var(--spacing-lg) 0;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-color);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    min-width: 500px;
    font-size: 0.9375rem;
}

.article-body table th,
.article-body table td {
    padding: 0.875rem 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-body table th {
    background: var(--bg-glass-strong);
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
}

.article-body table td {
    color: var(--text-secondary);
}

.article-body table tbody tr:last-child td {
    border-bottom: none;
}

.article-body table tbody tr:nth-child(even) {
    background: var(--bg-glass);
}

.article-body table tbody tr:hover {
    background: rgba(138, 80, 238, 0.05);
}

/* Light mode table adjustments */
[data-theme="light"] .article-body table th {
    background: #f8f9fa;
}

[data-theme="light"] .article-body table tbody tr:nth-child(even) {
    background: #fafafa;
}

[data-theme="light"] .article-body table tbody tr:hover {
    background: rgba(138, 80, 238, 0.08);
}

/* Mobile scroll indicator */
@media (max-width: 768px) {
    .article-body .table-wrapper {
        position: relative;
    }

    .article-body .table-wrapper::after {
        content: '← Scroll →';
        position: absolute;
        bottom: -24px;
        left: 50%;
        transform: translateX(-50%);
        font-size: 0.75rem;
        color: var(--text-muted);
        opacity: 0.7;
    }

    .article-body table th,
    .article-body table td {
        padding: 0.75rem;
        font-size: 0.875rem;
    }
}