/**
 * Article Page Styles
 * Path: assets/css/article.css
 * 
 * This file contains all styles specific to the article page.
 */

/* Article Hero */
.article-hero {
    background-color: var(--dark-color);
    color: white;
    padding: 3rem 0;
    position: relative;
}

.article-hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 80px;
    background: linear-gradient(to bottom, transparent, var(--dark-color));
}

.article-hero-content {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.article-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.article-category {
    display: inline-block;
    background-color: var(--primary-color);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
    text-decoration: none;
    transition: background-color 0.3s ease;
}

.article-category:hover {
    background-color: #cc0000;
}

.article-date {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.9rem;
}

.article-title {
    font-size: 2.5rem;
    line-height: 1.3;
    margin-bottom: 1.5rem;
}

.article-author {
    display: inline-flex;
    align-items: center;
    background-color: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 30px;
}

.author-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0.8rem;
    border: 2px solid var(--primary-color);
}

.author-info {
    text-align: left;
}

.author-name {
    display: block;
    font-weight: 600;
    font-size: 0.95rem;
}

.author-role {
    display: block;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.7);
}

/* Article Layout */
.article-section {
    padding: 3rem 0;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 3rem;
}

/* Article Main */
.article-main {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    min-width: 0; /* prevents grid blowout from wide content like iframes */
}

.article-featured-image {
    width: 100%;
    max-height: 500px;
    overflow: hidden;
}

.article-featured-image img {
    width: 100%;
    height: auto;
    display: block;
}

.article-content {
    padding: 2.5rem;
}

.video-featured {
    margin: -1rem -1rem 2rem;
}

.video-featured iframe {
    width: 100%;
    aspect-ratio: 16/9;
    display: block;
    border: none;
}
/**
 * Table Styling for Articles
 * Path: assets/css/article.css
 * 
 * Add these styles to your article.css file to ensure proper table styling
 */

/* Table styles */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    border-radius: 5px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Table header styling */
.article-table th,
.article-table tr.table-header td {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
    text-align: left;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
}

/* Table cell styling */
.article-table td {
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    vertical-align: top;
}

/* Alternating row colors */
.article-table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.article-table tr:hover:not(.table-header) {
    background-color: #f5f5f5;
}

/* Responsive table wrapper */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 1.5rem;
    border-radius: 5px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Quick Reference table styling */
.article-table tr:first-child th,
.article-table .table-header th {
    background-color: var(--primary-color);
    color: white;
    font-weight: bold;
}

/* Make sure tables display properly on mobile */
@media (max-width: 768px) {
    .article-table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }
}

/* 
 * Table of Contents and FAQ styling 
 * Add to assets/css/article.css
 */

/* Table of Contents styles */
.toc-container {
    margin: 2rem 0;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background-color: #f9f9f9;
}

.toc-header, .faq-header {
    padding: 1rem 1.5rem;
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
    position: relative;
}

.toc-header h3 {
    margin: 0;
    font-size: 1.2rem;
    color: white;
}

.toc-header:hover, .faq-header:hover {
    background-color: #cc0000;
}

.toc-toggle, .faq-toggle {
    font-size: 1.4rem;
    font-weight: 600;
    transition: transform 0.3s ease;
    display: inline-block;
    width: 24px;
    height: 24px;
    text-align: center;
    line-height: 24px;
}

.toc-header.expanded .toc-toggle, 
.faq-header.expanded .faq-toggle {
    transform: rotate(45deg);
}

.toc-content, .faq-content {
    padding: 1.5rem;
    transition: max-height 0.3s ease;
    overflow: hidden;
}

.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    margin: 0.5rem 0;
    line-height: 1.4;
}

.toc-list a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
    display: block;
    padding: 0.2rem 0;
}

.toc-list a:hover {
    color: var(--primary-color);
}

.toc-sublist {
    list-style: none;
    padding-left: 1.5rem;
    margin: 0.5rem 0;
}

.toc-level-2 {
    font-weight: 600;
}

.toc-level-3 {
    font-weight: normal;
}

.toc-level-4 {
    font-weight: normal;
    font-size: 0.95rem;
}

/* FAQ Styles */
.faq-container {
    margin: 2rem 0;
    border: 1px solid #eee;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    background-color: #f9f9f9;
}

.faq-header {
    font-size: 1.3rem;
}

/* Video embeds in article content */
.article-video,
.video-featured {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.article-video iframe,
.video-featured iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

.article-text {
    font-family: 'Georgia', serif;
    font-size: 1.1rem;
    line-height: 1.8;
    color: #333;
}

.article-text iframe {
    max-width: 100%;
}

.article-text h1 {
    font-size: 2.2rem;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
    font-family: 'Roboto', sans-serif;
}

.article-text h2 {
    font-size: 1.8rem;
    margin-top: 1.8rem;
    margin-bottom: 0.8rem;
    color: var(--primary-color);
    font-family: 'Roboto', sans-serif;
}

.article-text h3 {
    font-size: 1.5rem;
    margin-top: 1.5rem;
    margin-bottom: 0.7rem;
    font-family: 'Roboto', sans-serif;
}

.article-text h4 {
    font-size: 1.3rem;
    margin-top: 1.3rem;
    margin-bottom: 0.6rem;
    font-family: 'Roboto', sans-serif;
}

.article-text ul, 
.article-text ol {
    margin-left: 2rem;
    margin-bottom: 1.5rem;
}

.article-text ul li, 
.article-text ol li {
    margin-bottom: 0.5rem;
}

.article-text p {
    margin-bottom: 1.5rem;
}

.article-text img {
    max-width: 100%;
    height: auto;
    margin: 1.5rem 0;
    display: block;
    border-radius: 5px;
}

.article-text blockquote {
    border-left: 4px solid var(--primary-color);
    padding: 1rem 0 1rem 1.5rem;
    margin: 2rem 0;
    background-color: #f9f9f9;
    font-style: italic;
    color: #555;
}

.article-text pre {
    background-color: #f5f5f5;
    padding: 1rem;
    border-radius: 5px;
    overflow-x: auto;
    margin-bottom: 1.5rem;
    font-family: 'Courier New', monospace;
}

.article-text code {
    font-family: 'Courier New', monospace;
    background-color: #f5f5f5;
    padding: 0.2rem 0.4rem;
    border-radius: 3px;
    font-size: 0.9em;
}

.article-text table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
}

.article-text table th, 
.article-text table td {
    border: 1px solid #ddd;
    padding: 0.8rem;
    text-align: left;
}

.article-text table th {
    background-color: #f5f5f5;
    font-weight: bold;
}

.article-text table tr:nth-child(even) {
    background-color: #f9f9f9;
}

.article-tags {
    margin: 2.5rem 0 1.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
}

.tags-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.article-tags .tag {
    display: inline-block;
    background-color: #f0f0f0;
    color: var(--accent-color);
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.article-tags .tag:hover {
    background-color: var(--primary-color);
    color: white;
}

.article-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #eee;
}

.article-share {
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.share-label {
    font-weight: 600;
    color: #666;
    font-size: 0.9rem;
}

.share-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #f0f0f0;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.share-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.article-likes .like-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #f0f0f0;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
}

.article-likes .like-btn:hover {
    background-color: var(--primary-color);
    color: white;
}

.article-likes .like-btn.active {
    background-color: var(--primary-color);
    color: white;
}

/* Author Box */
.author-box {
    display: flex;
    gap: 1.5rem;
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 2rem;
    margin: 0 2.5rem 2.5rem;
}

.author-box .author-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    object-fit: cover;
    margin-right: 0;
}

.author-box .author-info {
    flex: 1;
}

.author-box h3 {
    margin-top: 0;
    margin-bottom: 0.5rem;
    font-size: 1.3rem;
}

.author-box p {
    margin-bottom: 1rem;
    color: #555;
}

.author-social {
    display: flex;
    gap: 0.8rem;
}

.author-social a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: #eee;
    color: #666;
    text-decoration: none;
    transition: all 0.3s ease;
}

.author-social a:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Comments Section */
.comments-section {
    padding: 2.5rem;
    border-top: 1px solid #eee;
}

.section-title {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--accent-color);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 50px;
    height: 3px;
    background-color: var(--primary-color);
}

.no-comments {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 5px;
    text-align: center;
    color: #666;
}

.comments-list {
    margin-bottom: 3rem;
}

.comment {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid #eee;
}

.comment:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.comment-avatar {
    flex-shrink: 0;
}

.comment-avatar img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
}

.comment-content {
    flex: 1;
}

.comment-meta {
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
}

.comment-author {
    font-weight: 600;
    margin-right: 1rem;
}

.comment-date {
    color: #777;
    font-size: 0.9rem;
}

.comment-text {
    margin-bottom: 1rem;
    color: #444;
}

.comment-actions {
    display: flex;
    gap: 1rem;
}

.comment-like, .reply-btn {
    background: none;
    border: none;
    color: #666;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    transition: color 0.3s ease;
}

.comment-like:hover, .reply-btn:hover {
    color: var(--primary-color);
}

.comment-like.active {
    color: var(--primary-color);
}

/* Comment Form */
.comment-form {
    background-color: #f9f9f9;
    border-radius: 10px;
    padding: 2rem;
}

.error-message, .success-message {
    padding: 1rem;
    border-radius: 5px;
    margin-bottom: 1.5rem;
}

.error-message {
    background-color: #f8d7da;
    color: #721c24;
}

.success-message {
    background-color: #d4edda;
    color: #155724;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-row {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-group-half {
    flex: 1;
    margin-bottom: 0;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #444;
}

.form-group input, .form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    color: #333;
    transition: border-color 0.3s ease;
}

.form-group input:focus, .form-group textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.form-group textarea {
    min-height: 150px;
    resize: vertical;
}

.comment-submit {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem 2rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.comment-submit:hover {
    background-color: #cc0000;
}

/* Article Sidebar */
.article-sidebar {
    align-self: start;
    position: sticky;
    top: 80px;
}

.sidebar-section {
    background-color: white;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    margin-bottom: 2rem;
}

.sidebar-title {
    padding: 1.2rem 1.5rem;
    margin: 0;
    background-color: var(--dark-color);
    color: white;
    font-size: 1.2rem;
    position: relative;
}

.sidebar-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 1.5rem;
    width: 40px;
    height: 3px;
    background-color: var(--primary-color);
}

.sidebar-content {
    padding: 1.5rem;
}

.no-content {
    color: #666;
    text-align: center;
    padding: 1rem 0;
}

/* Sidebar Articles */
.sidebar-articles {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.sidebar-article {
    display: flex;
    gap: 0.8rem;
}

.article-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 5px;
}

.article-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.article-thumb:hover img {
    transform: scale(1.1);
}

.article-info {
    flex: 1;
}

.article-info h4 {
    margin: 0 0 0.3rem;
    font-size: 0.95rem;
    line-height: 1.4;
}

.article-info h4 a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.article-info h4 a:hover {
    color: var(--primary-color);
}

.article-info .date {
    color: #777;
    font-size: 0.8rem;
}

/* Sidebar Video */
.sidebar-video {
    text-align: center;
}

.video-embed {
    position: relative;
    border-radius: 5px;
    overflow: hidden;
    margin-bottom: 1rem;
    cursor: pointer;
}

.video-thumbnail {
    width: 100%;
    height: auto;
    display: block;
}

.video-play-button {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 40px;
    background-color: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    transition: background-color 0.3s ease;
}

.video-play-button::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 55%;
    transform: translate(-50%, -50%);
    width: 0;
    height: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    border-left: 16px solid white;
}

.video-embed:hover .video-play-button {
    background-color: var(--primary-color);
}

.video-title {
    margin: 0.5rem 0;
    font-size: 1.1rem;
}

.video-desc {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Tag Cloud */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.tag-cloud .tag {
    display: inline-block;
    background-color: #f0f0f0;
    color: var(--accent-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.tag-cloud .tag:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Newsletter Box */
.newsletter-box {
    text-align: center;
}

.newsletter-box p {
    margin-bottom: 1.2rem;
    color: #555;
}

.newsletter-form {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    margin-bottom: 1rem;
}

.newsletter-form input {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 0.95rem;
}

.newsletter-form button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.8rem;
    border-radius: 5px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.newsletter-form button:hover {
    background-color: #cc0000;
}

.newsletter-note {
    font-size: 0.8rem;
    color: #777;
    margin: 0;
}

/* Related Content Section */
.related-content-section {
    background-color: #f9f9f9;
    padding: 4rem 0;
}

.related-content-section .section-title {
    text-align: center;
    margin-bottom: 2.5rem;
}

.related-content-section .section-title::after {
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
}

.related-articles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.related-article {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease;
}

.related-article:hover {
    transform: translateY(-5px);
}

.related-article .article-image {
    display: block;
    height: 180px;
    overflow: hidden;
}

.related-article .article-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-article:hover .article-image img {
    transform: scale(1.1);
}

.related-article .article-content {
    padding: 1.5rem;
}

.related-article h3 {
    margin: 0 0 0.8rem;
    font-size: 1.2rem;
    line-height: 1.4;
}

.related-article h3 a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color 0.3s ease;
}

.related-article h3 a:hover {
    color: var(--primary-color);
}

.related-article p {
    color: #666;
    margin-bottom: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.read-more {
    display: inline-block;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    position: relative;
}

.read-more::after {
    content: '→';
    margin-left: 0.3rem;
    transition: transform 0.3s ease;
}

.read-more:hover::after {
    transform: translateX(3px);
}

/* Table of Contents */
.article-toc {
    background-color: #f9f9f9;
    padding: 1.5rem;
    border-radius: 5px;
    margin-bottom: 2rem;
}

.article-toc h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.2rem;
}

.article-toc ul {
    list-style-type: none;
    margin: 0;
    padding: 0;
}

.article-toc li {
    margin-bottom: 0.5rem;
}

.article-toc a {
    text-decoration: none;
    color: var(--accent-color);
    transition: color 0.3s ease;
}

.article-toc a:hover {
    color: var(--primary-color);
}

.toc-h3 {
    padding-left: 1rem;
}

.toc-h4 {
    padding-left: 2rem;
}

/* Responsive Styles */
@media (max-width: 992px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .article-sidebar {
        position: static;
    }

    .related-articles {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .article-hero {
        padding: 2rem 0;
    }

    .article-title {
        font-size: 2rem;
    }

    .article-content {
        padding: 1.5rem;
    }

    .author-box {
        flex-direction: column;
        text-align: center;
        margin: 0 1.5rem 1.5rem;
        padding: 1.5rem;
    }

    .author-box .author-avatar {
        margin: 0 auto 1rem;
    }

    .author-social {
        justify-content: center;
    }

    .comments-section {
        padding: 1.5rem;
    }

    .comment {
        flex-direction: column;
        gap: 1rem;
    }

    .comment-avatar {
        align-self: center;
    }

    .form-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    .related-articles {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .article-meta {
        flex-direction: column;
        gap: 0.5rem;
    }

    .article-actions {
        flex-direction: column-reverse;
        gap: 1rem;
    }

    .article-share {
        width: 100%;
        justify-content: center;
    }
}