/* How-To Feature Styles */

:root {
    --howto-primary: var(--gradient-primary);
    --howto-border: var(--border-color);
    --howto-bg: var(--bg-card);
    --howto-text: var(--text-primary);
    --howto-text-muted: var(--text-muted);
}

/* ─────────────────────────────────────────────────────────────── */
/* Browse Page (howto.php)                                          */
/* ─────────────────────────────────────────────────────────────── */

.howto-page {
    width: 100%;
}

.howto-search-section {
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
}

.howto-search-form {
    display: flex;
    align-items: center;
    gap: 10px;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    padding: 10px 15px;
    border-radius: 8px;
    position: relative;
}

.howto-search-form i {
    color: var(--howto-text-muted);
}

.howto-search-form input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 1rem;
}

/* Autocomplete Dropdown */
.howto-autocomplete {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-width: 600px;
    margin: 0 auto;
    background: white;
    border: 1px solid var(--howto-border);
    border-top: none;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-height: 400px;
    overflow-y: auto;
    z-index: 100;
}

.howto-autocomplete-item {
    display: flex;
    flex-direction: column;
    padding: 12px 15px;
    text-decoration: none;
    border-bottom: 1px solid var(--howto-border);
    transition: background 0.2s;
    cursor: pointer;
}

.howto-autocomplete-item:last-child {
    border-bottom: none;
}

.howto-autocomplete-item:hover,
.howto-autocomplete-item.active {
    background: var(--bg-card);
}

.howto-autocomplete-title {
    color: var(--howto-text);
    font-weight: 500;
    font-size: 0.95rem;
    margin-bottom: 4px;
}

.howto-autocomplete-category {
    color: var(--howto-text-muted);
    font-size: 0.8rem;
    font-style: italic;
}

.howto-container {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

/* Sidebar */
.howto-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.howto-filter-section {
    background: var(--howto-bg);
    padding: 20px;
    border-radius: 8px;
}

.howto-filter-section h3 {
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.howto-category-list,
.howto-difficulty-list,
.howto-trending-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.howto-category-list li {
    margin-bottom: 8px;
}

.howto-category-list a {
    color: var(--howto-text);
    text-decoration: none;
    font-size: 0.95rem;
    display: block;
    padding: 5px 0;
}

.howto-category-list a:hover,
.howto-category-list a.active {
    color: var(--primary);
    font-weight: 600;
}

.howto-subcategory-list {
    list-style: none;
    padding-left: 15px;
    margin-top: 5px;
}

.howto-trending-item {
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    padding: 10px;
    border-radius: 6px;
    transition: background 0.2s;
}

.howto-trending-item:hover {
    background: var(--border-color);
}

.howto-trending-item img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
}

.howto-trending-info {
    flex: 1;
    min-width: 0;
}

.howto-trending-title {
    margin: 0;
    font-size: 0.9rem;
    color: var(--howto-text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.howto-trending-views {
    font-size: 0.8rem;
    color: var(--howto-text-muted);
}

/* Main Content */
.howto-main {
    flex: 1;
}

.howto-results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.howto-results-header h2 {
    margin: 0;
    font-size: 1.5rem;
}

.howto-results-count {
    color: var(--howto-text-muted);
    font-size: 0.95rem;
}

.howto-articles-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 40px;
}

/* Tablet: 2 columns (768px+) */
@media (min-width: 768px) {
    .howto-articles-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Desktop: 4 columns (1024px+) */
@media (min-width: 1024px) {
    .howto-articles-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.howto-card {
    background: var(--howto-bg);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.howto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.howto-card-cover {
    display: block;
    position: relative;
    width: 100%;
    height: 160px;
    overflow: hidden;
}

.howto-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.howto-card-difficulty {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
    color: white;
}

.howto-card-difficulty.easy {
    background: #10b981;
}

.howto-card-difficulty.medium {
    background: #f59e0b;
}

.howto-card-difficulty.hard {
    background: #ef4444;
}

.howto-card-body {
    padding: 15px;
}

.howto-card-category {
    display: inline-block;
    font-size: 0.75rem;
    padding: 4px 8px;
    border-radius: 4px;
    background: rgba(139, 92, 246, 0.2);
    color: var(--primary);
    font-weight: 600;
    margin-bottom: 8px;
    text-transform: capitalize;
}

.howto-card-body h3 {
    margin: 0 0 10px 0;
    font-size: 1rem;
}

.howto-card-body h3 a {
    color: var(--howto-text);
    text-decoration: none;
}

.howto-card-body h3 a:hover {
    color: var(--primary);
}

.howto-card-desc {
    margin: 0 0 15px 0;
    font-size: 0.9rem;
    color: var(--howto-text-muted);
    line-height: 1.4;
}

.howto-card-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: var(--howto-text-muted);
    margin-bottom: 10px;
}

.howto-card-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.howto-card-footer {
    padding: 10px 15px 15px 15px;
    border-top: 1px solid var(--howto-border);
    font-size: 0.85rem;
    color: var(--howto-text-muted);
}

/* Pagination */
.howto-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    margin: 40px 0;
}

.howto-pagination-info {
    font-size: 0.95rem;
    color: var(--howto-text-muted);
}

/* Empty State */
.howto-empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--howto-text-muted);
}

.howto-empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    opacity: 0.5;
}

.howto-empty-state h3 {
    margin: 10px 0;
    color: var(--howto-text);
}

/* ─────────────────────────────────────────────────────────────── */
/* Detail Page (howto_detail.php)                                   */
/* ─────────────────────────────────────────────────────────────── */

.howto-detail-page {
    width: 100%;
}

.howto-article-header {
    background: var(--howto-bg);
    padding: 40px 20px;
    margin-bottom: 40px;
}

.howto-article-header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    align-items: center;
}

.howto-article-header-content > * {
    min-width: 0;
}

.howto-article-meta {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.howto-article-cover {
    width: 100%;
    height: 400px;
    object-fit: cover;
    border-radius: 8px;
}

.howto-article-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    color: var(--howto-text-muted);
    margin-bottom: 20px;
    padding: 10px 0;
}

.howto-article-breadcrumb i {
    font-size: 1rem;
    color: var(--primary);
}

.howto-article-breadcrumb a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.howto-article-breadcrumb a:hover {
    color: var(--howto-text);
    text-decoration: underline;
}

.howto-breadcrumb-sep {
    font-weight: 300;
    opacity: 0.6;
}

.howto-article-meta h1 {
    margin: 0 0 15px 0;
    font-size: 2rem;
    line-height: 1.2;
}

.howto-article-desc {
    font-size: 1.1rem;
    color: var(--howto-text-muted);
    margin-bottom: 20px;
    line-height: 1.6;
}

.howto-article-stats {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.95rem;
    margin-bottom: 25px;
}

.howto-article-stats span {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: var(--border-color);
    border-radius: 20px;
    font-weight: 500;
    transition: all 0.2s;
}

.howto-article-stats span:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.howto-article-stats i {
    font-size: 1.05rem;
}

.howto-article-author-mini {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-top: 20px;
}

.howto-author-avatar-mini {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

/* Engagement Bar */
.howto-engagement-bar {
    background: var(--howto-bg);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    position: sticky;
    top: 60px;
    z-index: 10;
}

.howto-engagement-buttons {
    display: flex;
    gap: 10px;
    max-width: 1400px;
    margin: 0 auto;
}

.howto-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--howto-border);
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.howto-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.howto-btn-like:hover,
.howto-btn-like.active {
    color: #ef4444;
    border-color: #ef4444;
}

/* Detail Container */
.howto-detail-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px 60px 20px;
}

.howto-detail-main {
    min-width: 0;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

/* Sections */
.howto-section {
    margin-bottom: 50px;
    padding-top: 40px;
    border-top: 2px solid var(--howto-border);
}

.howto-section:first-of-type {
    border-top: none;
    padding-top: 0;
}

.howto-section h2 {
    margin: 0 0 20px 0;
    font-size: 1.5rem;
    color: var(--howto-text);
}

.howto-section h3 {
    margin: 0 0 15px 0;
    font-size: 1.2rem;
}

.howto-content {
    line-height: 1.8;
    color: var(--howto-text);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* Steps */
.howto-steps {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.howto-step {
    padding: 20px;
    background: var(--howto-bg);
    border-radius: 8px;
    border-left: 4px solid var(--primary);
}

.howto-step-header {
    margin-bottom: 20px;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--howto-border);
}

.howto-step-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    padding: 0 8px;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 700;
    margin: 0;
    flex-shrink: 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.2);
}

.howto-step-header-content {
    flex: 1;
}

.howto-step-header h4 {
    margin: 6px 0 6px 0;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--howto-text);
    letter-spacing: -0.3px;
}

.howto-step-progress {
    display: inline-block;
    font-size: 0.85rem;
    color: var(--howto-text-muted);
    font-weight: 500;
}

.howto-step-content {
    margin-bottom: 15px;
    line-height: 1.8;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.howto-step-images {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
    margin: 20px 0;
}

.howto-step-images figure {
    margin: 0;
    padding: 8px;
    background: var(--border-color);
    border-radius: 10px;
    transition: transform 0.3s, box-shadow 0.3s;
}

.howto-step-images figure:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.howto-step-images img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    border: 2px solid var(--howto-bg);
    display: block;
    transition: filter 0.2s;
}

.howto-step-images figure:hover img {
    filter: brightness(1.05);
}

.howto-step-images figcaption {
    font-size: 0.85rem;
    color: var(--howto-text-muted);
    margin-top: 8px;
    padding: 0 4px;
    font-weight: 500;
}

.howto-step-videos {
    margin: 15px 0;
}

.howto-step-videos iframe,
.howto-step-videos video {
    max-width: 100%;
    border-radius: 6px;
}

.howto-step-tips,
.howto-step-warnings {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 0.95rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.howto-step-tips {
    background: rgba(16, 185, 129, 0.1);
    border-left: 3px solid #10b981;
}

.howto-step-warnings {
    background: rgba(239, 68, 68, 0.1);
    border-left: 3px solid #ef4444;
}

.howto-step-tips strong,
.howto-step-warnings strong {
    display: block;
    margin-bottom: 6px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

/* FAQ */
.howto-section:has(.howto-faq) h2 {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 25px;
}

.howto-section:has(.howto-faq) h2::before {
    content: "?";
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.howto-faq {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.howto-faq-item {
    padding: 16px 18px;
    background: var(--howto-bg);
    border: 1px solid var(--howto-border);
    border-radius: 8px;
    transition: all 0.2s;
}

.howto-faq-item:hover {
    border-color: var(--primary);
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.15);
}

.howto-faq-item strong {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--howto-text);
    cursor: pointer;
    font-size: 1rem;
    margin-bottom: 10px;
}

.howto-faq-item strong::before {
    content: "Q:";
    font-weight: 700;
    color: var(--primary);
    min-width: 24px;
}

.howto-faq-item p {
    margin: 0;
    padding-left: 32px;
    color: var(--howto-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.howto-faq-item p::before {
    content: "A: ";
    color: var(--primary);
    font-weight: 600;
    margin-left: -32px;
    margin-right: 8px;
}

/* Rating Widget */
.howto-rating-widget {
    background: linear-gradient(135deg, var(--howto-bg) 0%, rgba(139, 92, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    padding: 28px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.howto-rating-widget h3 {
    margin: 0 0 20px 0;
    font-size: 1.2rem;
    color: var(--howto-text);
    display: flex;
    align-items: center;
    gap: 10px;
}

.howto-rating-widget h3::before {
    content: "★";
    color: #fbbf24;
    font-size: 1.3rem;
}

.howto-rating-display {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--howto-border);
}

.howto-rating-stars {
    display: flex;
    gap: 6px;
    font-size: 1.8rem;
    color: #fbbf24;
}

.howto-rating-value {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--howto-text);
}

.howto-rating-count {
    font-size: 0.85rem;
    color: var(--howto-text-muted);
}

.howto-rating-form {
    padding-top: 0;
}

.howto-rating-form p {
    margin: 0 0 16px 0;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--howto-text);
}

.howto-rating-input {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.howto-star-btn {
    background: transparent;
    border: none;
    font-size: 2.4rem;
    color: rgba(217, 119, 6, 0.3);
    cursor: pointer;
    transition: all 0.2s;
    padding: 4px;
}

.howto-star-btn:hover {
    color: #fbbf24;
    transform: scale(1.15);
}

.howto-star-btn.active {
    color: #fbbf24;
    filter: drop-shadow(0 0 4px rgba(251, 191, 36, 0.5));
}

.howto-rating-login {
    margin: 0;
    font-size: 0.95rem;
}

.howto-rating-login a {
    color: var(--primary);
    text-decoration: none;
}

/* Comments */
.howto-comment-form {
    margin-bottom: 30px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: var(--howto-bg);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--howto-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.howto-comment-form::before {
    content: "Share your feedback";
    display: block;
    font-weight: 700;
    color: var(--howto-text);
    margin-bottom: 8px;
    font-size: 1rem;
}

.howto-comment-form textarea {
    padding: 12px 14px;
    border: 1px solid var(--howto-border);
    border-radius: 6px;
    font-family: inherit;
    font-size: 0.95rem;
    resize: vertical;
    min-height: 100px;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: white;
}

.howto-comment-form textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.howto-comment-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.howto-comment-counter {
    font-size: 0.85rem;
    color: var(--howto-text-muted);
    font-weight: 500;
}

.howto-comment-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-weight: 600;
    transition: all 0.2s;
    white-space: nowrap;
}

.howto-comment-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
}

.howto-comment-login {
    margin: 0;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 20px;
    background: var(--howto-bg);
    border-radius: 8px;
    border: 2px dashed var(--howto-border);
}

.howto-comment-login i {
    font-size: 1.3rem;
    color: var(--primary);
}

.howto-comment-login span {
    font-weight: 500;
    color: var(--howto-text);
}

.howto-comment-login .btn-sm {
    padding: 6px 16px;
    font-size: 0.9rem;
}

.howto-comments-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.howto-comment {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--howto-bg);
    border-radius: 6px;
}

.howto-comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
}

.howto-comment-body {
    flex: 1;
}

.howto-comment-body strong {
    display: block;
    margin-bottom: 5px;
}

.howto-comment-text {
    margin: 8px 0;
    line-height: 1.6;
}

.howto-comment-meta {
    display: flex;
    gap: 15px;
    align-items: center;
    font-size: 0.85rem;
    color: var(--howto-text-muted);
}

.howto-comment-reply-btn {
    background: transparent;
    border: none;
    color: var(--primary);
    cursor: pointer;
    text-decoration: none;
}

.howto-comment-replies {
    margin-top: 15px;
    padding-left: 15px;
    border-left: 2px solid var(--howto-border);
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.howto-comment-reply {
    padding: 12px;
    background: transparent;
    border-radius: 0;
    gap: 10px;
}

.howto-empty {
    text-align: center;
    padding: 40px 20px;
    color: var(--howto-text-muted);
}

/* Sidebar */
.howto-detail-sidebar {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.howto-author-card,
.howto-badges-card,
.howto-related-card {
    background: var(--howto-bg);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid var(--howto-border);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.howto-related-card h3 {
    margin: 0 0 16px 0;
    font-size: 1.1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--howto-text);
}

.howto-related-card h3::before {
    content: "\f542";
    font-family: "Font Awesome 6 Free";
    font-weight: 700;
    color: var(--primary);
}

.howto-author-card {
    text-align: center;
}

.howto-author-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 15px;
}

.howto-author-card h3 {
    margin: 10px 0;
}

.howto-author-bio {
    font-size: 0.9rem;
    color: var(--howto-text-muted);
    margin: 5px 0 15px 0;
}

.howto-author-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 15px 0;
    text-align: center;
    font-size: 0.9rem;
}

.howto-stat-value {
    display: block;
    font-weight: 600;
    font-size: 1.1rem;
}

.howto-view-profile-link {
    display: block;
    margin-top: 15px;
    color: var(--primary);
    text-decoration: none;
    font-size: 0.9rem;
}

.howto-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.howto-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    border-radius: 50%;
    background: var(--border-color);
}

.howto-related-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.howto-related-item {
    display: flex;
    gap: 12px;
    text-decoration: none;
    border-radius: 6px;
    overflow: hidden;
    transition: all 0.2s;
    padding: 8px;
    background: var(--border-color);
}

.howto-related-item:hover {
    background: var(--primary);
    opacity: 0.95;
}

.howto-related-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.howto-related-item span {
    flex: 1;
    display: flex;
    align-items: center;
    font-size: 0.9rem;
    color: var(--howto-text);
    font-weight: 500;
    transition: color 0.2s;
}

.howto-related-item:hover span {
    color: white;
}
    color: var(--howto-text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* 404 Page */
.howto-404 {
    text-align: center;
    padding: 100px 20px;
}

.howto-404 h1 {
    font-size: 2rem;
}

/* Responsive */
@media (max-width: 768px) {
    .howto-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .howto-sidebar {
        display: none;
    }

    .howto-article-header-content {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .howto-article-cover {
        height: 250px;
    }

    .howto-detail-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 15px 60px 15px;
    }

    .howto-step {
        padding: 15px;
    }

    .howto-step-tips,
    .howto-step-warnings {
        padding: 10px 12px;
        font-size: 0.9rem;
    }

    .howto-detail-sidebar {
        display: none;
    }

    .howto-article-meta h1 {
        font-size: 1.5rem;
    }

    .howto-search-form {
        gap: 6px;
        padding: 8px 12px;
    }

    .howto-search-form input {
        font-size: 0.95rem;
    }

    .howto-search-form button {
        padding: 8px 12px;
        font-size: 0.9rem;
        white-space: nowrap;
    }

    .howto-engagement-bar {
        position: static;
    }
}

/* ─────────────────────────────────────────────────────────────── */
/* Light Theme (Default)                                           */
/* ─────────────────────────────────────────────────────────────── */

html[data-theme="light"] {
    --howto-primary: var(--gradient-primary);
    --howto-border: var(--border-color);
    --howto-bg: var(--bg-card);
    --howto-text: var(--text-primary);
    --howto-text-muted: var(--text-muted);
}

html[data-theme="light"] .howto-search-form {
    background: white;
    color: #000;
}

html[data-theme="light"] .howto-search-form input {
    background: white;
    color: #000;
}

html[data-theme="light"] .howto-search-form input::placeholder {
    color: #999;
}

html[data-theme="light"] .howto-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

html[data-theme="light"] .howto-comment-form textarea {
    background: white;
    color: #000;
}

html[data-theme="light"] .howto-comment-form textarea::placeholder {
    color: #999;
}

/* ─────────────────────────────────────────────────────────────── */
/* Dark Theme                                                      */
/* ─────────────────────────────────────────────────────────────── */

@media (prefers-color-scheme: dark) {
    :root {
        --howto-primary: var(--gradient-primary);
        --howto-border: var(--border-color);
        --howto-bg: var(--bg-card);
        --howto-text: var(--text-primary);
        --howto-text-muted: var(--text-muted);
    }

    .howto-search-form {
        background: rgba(255, 255, 255, 0.08);
        color: white;
    }

    .howto-search-form input {
        background: transparent;
        color: white;
    }

    .howto-search-form input::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }

    .howto-autocomplete {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .howto-autocomplete-item {
        border-bottom-color: rgba(255, 255, 255, 0.1);
    }

    .howto-autocomplete-item:hover,
    .howto-autocomplete-item.active {
        background: rgba(255, 255, 255, 0.08);
    }

    .howto-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .howto-card:hover {
        background: rgba(255, 255, 255, 0.08);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    .howto-filter-section {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .howto-trending-item:hover {
        background: rgba(255, 255, 255, 0.08);
    }

    .howto-step {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .howto-engagement-bar {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .howto-btn {
        border-color: rgba(255, 255, 255, 0.2);
        color: rgba(255, 255, 255, 0.9);
    }

    .howto-btn:hover {
        border-color: var(--primary);
        background: rgba(255, 255, 255, 0.05);
    }

    .howto-faq-item {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
    }

    .howto-faq-item:hover {
        border-color: var(--primary);
        box-shadow: 0 2px 8px rgba(139, 92, 246, 0.2);
    }

    .howto-rating-widget {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0%, rgba(139, 92, 246, 0.1) 100%);
        border-color: rgba(139, 92, 246, 0.3);
    }

    .howto-rating-form {
        border-top-color: rgba(255, 255, 255, 0.1);
    }

    .howto-comment {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .howto-comment-form textarea {
        background: rgba(255, 255, 255, 0.05);
        border-color: rgba(255, 255, 255, 0.1);
        color: white;
    }

    .howto-comment-form textarea::placeholder {
        color: rgba(255, 255, 255, 0.6);
    }

    .howto-comment-replies {
        border-left-color: rgba(255, 255, 255, 0.1);
    }

    .howto-author-card,
    .howto-badges-card,
    .howto-related-card {
        background: rgba(255, 255, 255, 0.05);
        border: 1px solid rgba(255, 255, 255, 0.08);
    }

    .howto-article-header {
        background: rgba(255, 255, 255, 0.03);
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    }

    .howto-star-btn {
        color: rgba(255, 255, 255, 0.5);
    }

    .howto-star-btn:hover,
    .howto-star-btn.active {
        color: #fbbf24;
    }
}

html[data-theme="dark"] {
    --howto-primary: var(--gradient-primary);
    --howto-border: var(--border-color);
    --howto-bg: var(--bg-card);
    --howto-text: var(--text-primary);
    --howto-text-muted: var(--text-muted);
}

html[data-theme="dark"] .howto-search-form {
    background: rgba(255, 255, 255, 0.08);
    color: white;
}

html[data-theme="dark"] .howto-search-form input {
    background: transparent;
    color: white;
}

html[data-theme="dark"] .howto-search-form input::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] .howto-autocomplete {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .howto-autocomplete-item {
    border-bottom-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .howto-autocomplete-item:hover,
html[data-theme="dark"] .howto-autocomplete-item.active {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-card:hover {
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

html[data-theme="dark"] .howto-filter-section {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-trending-item:hover {
    background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-step {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-engagement-bar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-btn {
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
}

html[data-theme="dark"] .howto-btn:hover {
    border-color: var(--primary);
    background: rgba(255, 255, 255, 0.05);
}

html[data-theme="dark"] .howto-rating-widget {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-rating-form {
    border-top-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .howto-comment {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-comment-form textarea {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

html[data-theme="dark"] .howto-comment-form textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}

html[data-theme="dark"] .howto-comment-replies {
    border-left-color: rgba(255, 255, 255, 0.1);
}

html[data-theme="dark"] .howto-author-card,
html[data-theme="dark"] .howto-badges-card,
html[data-theme="dark"] .howto-related-card {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-article-header {
    background: rgba(255, 255, 255, 0.03);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .howto-star-btn {
    color: rgba(255, 255, 255, 0.5);
}

html[data-theme="dark"] .howto-star-btn:hover,
html[data-theme="dark"] .howto-star-btn.active {
    color: #fbbf24;
}
