﻿:root {
    --primary: #ec0000;
    --primary-dark: #c40000;
    --primary-light: #ff4d4d;
    --secondary: #6c757d;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #dcdcdc;
    --border: #dee2e6;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    --transition: all 0.3s ease;
    --radius: 8px;
    --spacing-xs: 0.5rem;
    --spacing-sm: 1rem;
    --spacing-md: 1.5rem;
    --spacing-lg: 2rem;
    --spacing-xl: 3rem;
}

/* Main Content Layout */
.main-content {
    display: flex;
    gap: var(--spacing-md);
    margin: var(--spacing-xl) 0;
}

.article-container {
    flex: 1;
    min-width: 0;
}

.sidebar {
    width: 320px;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    height: fit-content;
}

/* Article Section */
.article-content {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-xl);
    overflow: hidden;
    margin-bottom: var(--spacing-lg);
}

.article-header {
    text-align: left;
}

.article-title {
    /*font-size: 2.5rem;*/
    line-height: 1.2;
    margin-bottom: var(--spacing-md);
}

.article-meta {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-md);
    color: var(--secondary);
    font-size: 0.95rem;
}

.author-info {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
}

.author-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    object-fit: cover;
}

.date > svg, .reading-time > svg {
    width: 20px;
    height: 20px;
    fill: var(--gray);
    vertical-align: middle;
    margin-top: -4px;
}

.article-featured-img {
    width: 100%;
    height: auto;
    max-height: 675px;
    object-fit: cover;
    border-radius: var(--radius);
    margin: var(--spacing-lg) 0;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.article-body {
    font-size: 1.1rem;
    color: #333333;
}

.article-body p {
    margin-bottom: var(--spacing-md);
}

.article-body h2 {
    /*font-size: 1.8rem;*/
    margin: var(--spacing-lg) 0 var(--spacing-md);
    padding-bottom: var(--spacing-xs);
    border-bottom: 1px solid var(--light-gray);
}

.article-body h3 {
    font-size: 1.4rem;
    margin: var(--spacing-md) 0 var(--spacing-sm);
}

.article-body blockquote {
    border-left: 4px solid var(--primary);
    padding: var(--spacing-md);
    margin: var(--spacing-md) 0;
    background-color: var(--light);
    font-style: italic;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: var(--spacing-md) 0;
    display: block;
}

.article-body ul, .article-body ol {
    margin-bottom: var(--spacing-md);
}

.article-body li {
    position: relative;
    margin-bottom: var(--spacing-xs);
    padding-left: 30px;
}

.article-body li::before {
    display: inline-block;
    content: '';
    position: absolute;
    left: 0;
    top: 3px;
    width: 22px;
    height: 22px;
    background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 -960 960 960' fill='%23ec0000'><path d='M479-352.3q-52.39 0-89.54-37.04Q352.3-426.37 352.3-479q0-52.87 37.16-89.66 37.15-36.8 89.54-36.8 52.87 0 89.78 36.8Q605.7-531.87 605.7-479q0 52.63-36.92 89.66Q531.87-352.3 479-352.3Zm0 280.43L303.98-246.89l64.89-64.89L480-200.41l110.37-110.37 63.89 63.65L479-71.87ZM246.13-303.98 71.11-479l174.78-174.78 64.89 64.89-111.13 111.13 110.13 110.13-63.65 63.65Zm121.74-345.24-63.89-63.65 175.26-175.26 175.02 175.02-64.89 64.89L478-759.35 367.87-649.22Zm344.48 345.24-64.65-64.65 111.13-111.13-110.37-110.37 63.89-63.89L887.37-479 712.35-303.98Z'/></svg>");
	background-repeat: no-repeat;
    background-size: 22px 22px;
}

/* Responsive Table Styles - Applied directly to table */
.responsive-table {
    width: 100%;
    margin: var(--spacing-md) 0;
    border-collapse: collapse;
    display: block;
    overflow-x: auto;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.05);
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch; /* Smooth scroll on iOS */
    scroll-behavior: smooth; /* Smooth scroll on modern browsers */
    scrollbar-width: none;
    will-change: transform;
    transform: translateZ(0);
    white-space: nowrap;
}

.responsive-table::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar - for Firefox */
.responsive-table {
    scrollbar-width: none; /* Firefox */
}

.responsive-table table {
    width:100% /* Firefox */
}

.responsive-table th {
    background-color: var(--primary);
    color: white;
    text-align: center;
    font-weight: 600;
    padding: var(--spacing-xs);
    border: 1px solid var(--border);
}

.responsive-table td {
    padding: var(--spacing-xs);
    border: 1px solid var(--border);
    text-align: center;
}

.responsive-table tr:nth-child(even) {
    background-color: var(--light);
}

.responsive-table tr:hover {
    background-color: rgba(236, 0, 0, 0.05);
}

/* FAQ Section */
.faq-section {
    padding: var(--spacing-sm) 0;
}

.faq-item {
    margin-bottom: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.faq-item:hover {
    border-color: var(--primary);
}

.faq-question {
    padding: var(--spacing-sm);
    background-color: var(--light);
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
    transition: var(--transition);
}

.faq-question:hover {
    background-color: var(--primary);
    color: white;
}

.faq-question.active {
    background-color: var(--primary);
    color: white;
}

.faq-icon {
    width: 24px;
    height: 24px;
    fill: currentColor;
    transition: var(--transition);
}

.faq-question.active .faq-icon {
    transform: rotate(180deg);
}

.faq-answer {
    padding: 0 var(--spacing-sm);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.faq-answer.active {
    padding: var(--spacing-sm);
    max-height: 300px;
}

.tags {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--spacing-xs);
    margin: var(--spacing-xl) 0 var(--spacing-lg);
}

.tag {
    display: inline-block;
    background-color: var(--light-gray);
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: 30px;
    font-size: 0.9rem;
}

.article-actions {
    display: flex;
    justify-content: center;
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--border);
}

.social-sharing {
    display: flex;
    gap: var(--spacing-xs);
    justify-content: center;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--light-gray);
    transition: var(--transition);
}

.social-btn > svg {
    width: 20px;
    height: 20px;
    fill: var(--dark);
    transition: var(--transition);
}

.social-btn:hover {
    background-color: var(--primary);
}
.social-btn > svg:hover {
    fill: white;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--primary);
    color: white;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    -webkit-justify-content: center;
    justify-content: center;
}

.btn:hover {
    background-color: var(--primary-dark);
    transform: translateY(-2px);
}

/* Author Section */
.author-card {
    display: flex;
    gap: var(--spacing-lg);
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    color: var(--dark);
}

.author-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
}

.author-details h3 {
    font-size: 1.5rem;
    margin-bottom: var(--spacing-xs);
}

.author-position {
    color: var(--gray);
    margin-bottom: var(--spacing-md);
    font-size: 0.95rem;
}

.author-details p {
    margin-bottom: var(--spacing-md);
}

.author-social {
    display: flex;
    gap: var(--spacing-xs);
    margin-top: var(--spacing-md);
}

/* Sidebar */
.sidebar-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
}

.sidebar-title {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-sm);
    border-bottom: 2px solid var(--primary);
}

.related-articles {
    padding-left: 0;
}

.related-article {
    display: flex;
    align-items: flex-start;
    padding: var(--spacing-xs) 0;
    padding-left: 24px; /* Make room for the icon */
    border-bottom: 1px solid var(--light-gray);
    position: relative;
}

    /* Remove border from the last item */
    .related-article:last-child {
        border-bottom: none;
    }

    /* Icon before each list item */
    .related-article::before {
        content: "";
        position: absolute;
        top: 0.6rem;
        left: -9px;
        width: 23px;
        height: 23px;
        background-color: var(--dark);
        /* SVG icon as a mask */
        mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 12h13l-5.5 5.5L12 19l9-7-9-7-1.5 1.5L16 12H3z"/></svg>') no-repeat center;
        mask-size: contain;
        /* WebKit fallback (only needed for Safari) */
        --webkit-mask-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 12h13l-5.5 5.5L12 19l9-7-9-7-1.5 1.5L16 12H3z"/></svg>');
        --webkit-mask-repeat: no-repeat;
        --webkit-mask-position: center;
        --webkit-mask-size: contain;
        background-size: contain;
        border-radius: 50%;
        transition: background-color 0.3s ease;
    }


/* Link container */
.related-article-content {
    flex: 1;
    text-decoration: none;
}

/* Title inside link */
.related-article h4 {
    font-size: 1rem;
    line-height: 1.4;
    margin-bottom: 0;
    color: var(--dark);
    transition: color 0.3s ease;
}

/* Date under title */
.related-article .date {
    font-size: 0.85rem;
    color: var(--gray);
}

/* Hover effects */
.related-article:hover::before {
    background-color: var(--primary); /* Highlight icon on hover */
}

.related-article:hover h4 {
    color: var(--primary); /* Highlight title on hover */
}

/* Responsive adjustments for mobile */
@media (max-width: 600px) {
    .related-article h4 {
        font-size: 0.95rem;
    }

    .related-article .date {
        font-size: 0.8rem;
    }
}

/* Comments Section */
.comments-section {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--spacing-xl);
    margin-bottom: var(--spacing-xl);
    color: var(--dark);
}

.section-title {
    font-size: 1.8rem;
    margin-bottom: var(--spacing-lg);
    position: relative;
    padding-bottom: var(--spacing-sm);
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary);
}

.comment-form {
    margin-bottom: var(--spacing-xl);
}

.form-group {
    margin-bottom: var(--spacing-md);
}

.form-group label {
    display: block;
    margin-bottom: var(--spacing-xs);
    font-weight: 500;
}

.form-control {
    width: 100%;
    padding: var(--spacing-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    transition: var(--transition);
}

.form-control:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(236, 0, 0, 0.1);
}

textarea.form-control {
    min-height: 150px;
    resize: vertical;
}

/* container: reverse so the ~ selector fills to the left */
.rating-stars {
  display: inline-flex;
  flex-direction: row-reverse;
  gap: 4px;
}

/* hide radios but keep them accessible to screen readers */
.rating-stars input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

/* style the stars (use the glyph ★, not the emoji ⭐) */
.rating-stars label {
  font-size: 40px;
  line-height: 1;
  color: #ccc;
  cursor: pointer;
  user-select: none;
  transition: color .15s ease-in-out, transform .05s ease-in-out;
}

/* hover fills current and all “lower” stars */
.rating-stars label:hover,
.rating-stars label:hover ~ label {
  color: #ec0000;
}

/* checked state fills stars persistently */
.rating-stars input:checked ~ label {
  color: #ec0000;
}

/* small press feedback */
.rating-stars label:active {
  transform: scale(0.95);
}

.comment-rating {
  display: inline-flex;
  gap: 2px;
}

.comment-rating .star {
  font-size: 24px;
  color: #ccc; /* empty stars */
}

.comment-rating .star.filled {
  color: #ec0000; /* filled red stars */
}

.comment {
    display: flex;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid var(--light-gray);
}

.comment:last-child {
    border-bottom: none;
}

.comment-avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--primary-light);
    color: white;
    font-weight: bold;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment-content {
    flex-grow: 1;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: var(--spacing-xs);
}

.comment-author {
    font-weight: 600;
}

.comment-date {
    color: var(--gray);
    font-size: 0.9rem;
}

.comment-text {
    margin-bottom: var(--spacing-md);
}

.comment-actions {
    display: flex;
    gap: var(--spacing-md);
}

.comment-action {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    color: var(--gray);
    cursor: pointer;
    transition: var(--transition);
}

.comment-action:hover {
    color: var(--primary);
}

.reply-form {
    margin-top: var(--spacing-md);
    padding-left: var(--spacing-md);
    border-left: 2px solid var(--light-gray);
    display: none;
}

.reply-form.active {
    display: block;
}

.replies {
    margin-top: var(--spacing-md);
    padding-left: var(--spacing-lg);
    border-left: 2px solid var(--light-gray);
}

.reply {
    margin-top: var(--spacing-md);
}

/* Responsive Design */
@media (max-width: 992px) {
    .article-title {
		font-size: 2.2rem;
    }
    
    .main-content {
		flex-direction: column;
    }
    
    .sidebar {
		width: 100%;
		position: static;
    }
}

@media (max-width: 768px) {
    .article-content {
		padding: var(--spacing-lg);
    }
    
    .article-title {
		font-size: 1.8rem;
    }
    
    .article-actions {
		flex-direction: column;
		gap: var(--spacing-sm);
    }
    
    .author-card {
		flex-direction: column;
		align-items: center;
		text-align: center;
    }
    
    .author-social {
		justify-content: center;
    }
    
    .comment {
		flex-direction: column;
    }

    .responsive-table {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .article-meta {
		flex-direction: column;
		align-items: flex-start;
		gap: var(--spacing-xs);
    }
    
    .article-title {
		font-size: 1.6rem;
    }
    
    .author-card {
		padding: var(--spacing-md);
    }
    
    .section-title {
		font-size: 1.5rem;
    }

    .responsive-table {
        border: 1px solid var(--border);
    }

}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    border: 0;
}
