/* =============================================================
   How-To / Blog Index Page Styles
   ============================================================= */

/* ── Hero ── */
.howto-hero {
    background: linear-gradient(135deg, #4a6cf7 0%, #7c3aed 100%);
    color: #fff;
    padding: 72px 0 60px;
    text-align: center;
}

.howto-hero h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    font-weight: 800;
    margin: 0 0 14px;
    letter-spacing: -0.02em;
    color: #fff;
}

.howto-hero p {
    font-size: 1.125rem;
    opacity: 0.9;
    max-width: 560px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

/* ── Search bar ── */
.howto-search-wrap {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.howto-search-wrap input {
    width: 100%;
    padding: 14px 48px 14px 20px;
    border-radius: 50px;
    border: none;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    outline: none;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.18);
    color: #1e293b;
    background: #fff;
}

.howto-search-wrap i {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
    pointer-events: none;
}

/* ── Category filter row ── */
.howto-filters {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
    padding: 36px 20px 8px;
}

.filter-btn {
    padding: 8px 20px;
    border-radius: 50px;
    border: 2px solid #e2e8f0;
    background: transparent;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    color: #475569;
    font-family: 'Inter', sans-serif;
    line-height: 1.4;
}

.filter-btn:hover,
.filter-btn.active {
    background: #4a6cf7;
    border-color: #4a6cf7;
    color: #fff;
}

/* ── Section wrapper ── */
.howto-grid-section {
    padding: 16px 0 72px;
}

.howto-section-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 48px 0 0;
}

.howto-section-title span {
    color: #4a6cf7;
}

/* ── Card grid ── */
.howto-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    margin-top: 32px;
}

/* ── Individual article card ── */
.howto-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    cursor: pointer;
}

.howto-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(74, 108, 247, 0.14);
}

.howto-card.hidden {
    display: none;
}

/* ── Card thumbnail area ── */
.card-thumb {
    height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 3.5rem;
    flex-shrink: 0;
}

.thumb-blue   { background: #eff6ff; }
.thumb-purple { background: #fdf4ff; }
.thumb-green  { background: #f0fdf4; }
.thumb-orange { background: #fff7ed; }
.thumb-yellow { background: #fefce8; }
.thumb-pink   { background: #fdf2f8; }
.thumb-teal   { background: #f0fdfa; }
.thumb-red    { background: #fff1f2; }

/* ── Card body ── */
.card-body {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

/* ── Badges ── */
.card-badge {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 10px;
    border-radius: 50px;
    white-space: nowrap;
}

.badge-convert  { background: #eff6ff; color: #2563eb; }
.badge-edit     { background: #fdf4ff; color: #9333ea; }
.badge-optimize { background: #f0fdf4; color: #16a34a; }
.badge-bg       { background: #fff7ed; color: #ea580c; }
.badge-design   { background: #fef9c3; color: #b45309; }

/* ── Read time ── */
.card-read-time {
    font-size: 0.8rem;
    color: #94a3b8;
    margin-left: auto;
    white-space: nowrap;
}

.card-read-time i {
    margin-right: 4px;
}

/* ── Card text ── */
.card-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px;
    line-height: 1.35;
}

.card-desc {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.55;
    flex: 1;
    margin: 0 0 18px;
}

.card-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #4a6cf7;
    text-decoration: none;
    transition: gap 0.2s;
    align-self: flex-start;
}

.card-link:hover {
    gap: 10px;
}

.card-link i {
    font-size: 0.75rem;
}

/* ── Featured (full-width) card ── */
.howto-featured {
    background: linear-gradient(135deg, #4a6cf7 0%, #7c3aed 100%);
    border-radius: 20px;
    padding: 40px 44px;
    display: flex;
    align-items: center;
    gap: 36px;
    color: #fff;
    margin-top: 32px;
    text-decoration: none;
    transition: transform 0.22s, box-shadow 0.22s;
    border: none;
}

.howto-featured:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 48px rgba(74, 108, 247, 0.3);
}

.featured-icon {
    font-size: 5rem;
    flex-shrink: 0;
    filter: drop-shadow(0 4px 12px rgba(0, 0, 0, 0.2));
    line-height: 1;
}

.featured-text {
    flex: 1;
}

.featured-text .featured-label {
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    opacity: 0.7;
    margin-bottom: 8px;
    display: block;
}

.featured-text h2 {
    font-size: clamp(1.3rem, 3vw, 1.75rem);
    font-weight: 800;
    margin: 0 0 10px;
    letter-spacing: -0.02em;
    color: #fff;
}

.featured-text p {
    opacity: 0.85;
    font-size: 1rem;
    line-height: 1.55;
    margin: 0 0 18px;
    color: #fff;
}

.featured-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.2);
    border: 2px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    padding: 10px 22px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: background 0.2s, gap 0.2s;
}

.featured-cta:hover {
    background: rgba(255, 255, 255, 0.35);
    gap: 12px;
    color: #fff;
}

/* ── No-results message ── */
#noResults {
    text-align: center;
    color: #94a3b8;
    padding: 40px 0;
    font-size: 1.05rem;
}

#noResults a {
    color: #4a6cf7;
    font-weight: 600;
}

/* =============================================================
   Dark Mode
   ============================================================= */
[data-theme="dark"] .howto-card {
    background: #1e2a3a;
    border-color: #2d3d54;
}

[data-theme="dark"] .card-title {
    color: #f1f5f9;
}

[data-theme="dark"] .card-desc {
    color: #94a3b8;
}

[data-theme="dark"] .filter-btn {
    color: #94a3b8;
    border-color: #2d3d54;
}

[data-theme="dark"] .howto-section-title {
    color: #f1f5f9;
}

[data-theme="dark"] .thumb-blue,
[data-theme="dark"] .thumb-purple,
[data-theme="dark"] .thumb-green,
[data-theme="dark"] .thumb-orange,
[data-theme="dark"] .thumb-yellow,
[data-theme="dark"] .thumb-pink,
[data-theme="dark"] .thumb-teal,
[data-theme="dark"] .thumb-red {
    background: #16213e;
}

/* =============================================================
   Responsive
   ============================================================= */
@media (max-width: 1024px) {
    .howto-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 700px) {
    .howto-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .howto-featured {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
    }

    .featured-icon {
        font-size: 3.5rem;
    }

    .howto-filters {
        padding: 24px 0 8px;
    }
}

/* =============================================================
   Article Page Styles  (how-to/*.html)
   ============================================================= */

/* ── Breadcrumb ── */
.article-breadcrumb {
    padding: 16px 0 0;
    font-size: 0.85rem;
    color: #94a3b8;
}

.article-breadcrumb a {
    color: #4a6cf7;
    text-decoration: none;
}

.article-breadcrumb a:hover {
    text-decoration: underline;
}

.article-breadcrumb .sep {
    margin: 0 6px;
}

/* ── Article header banner ── */
.article-hero {
    border-radius: 20px;
    padding: 48px 44px;
    margin: 24px 0 0;
    display: flex;
    align-items: center;
    gap: 32px;
    color: #fff;
}

.article-hero-icon {
    font-size: 5rem;
    flex-shrink: 0;
    line-height: 1;
    filter: drop-shadow(0 4px 16px rgba(0,0,0,0.2));
}

.article-hero-text .article-category-label {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    background: rgba(255,255,255,0.2);
    border-radius: 50px;
    padding: 3px 12px;
    margin-bottom: 12px;
    color: #fff;
}

.article-hero-text h1 {
    font-size: clamp(1.6rem, 4vw, 2.4rem);
    font-weight: 800;
    margin: 0 0 12px;
    line-height: 1.15;
    letter-spacing: -0.02em;
    color: #fff;
}

.article-hero-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    font-size: 0.875rem;
    opacity: 0.85;
}

.article-hero-meta span {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* colour variants — add these classes to .article-hero */
.hero-convert  { background: linear-gradient(135deg, #2563eb 0%, #4a6cf7 100%); }
.hero-edit     { background: linear-gradient(135deg, #7c3aed 0%, #a855f7 100%); }
.hero-optimize { background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%); }
.hero-bg       { background: linear-gradient(135deg, #ea580c 0%, #f97316 100%); }
.hero-design   { background: linear-gradient(135deg, #b45309 0%, #f59e0b 100%); }

/* ── Article body layout ── */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 48px;
    align-items: start;
    padding: 40px 0 72px;
}

/* ── Article prose ── */
.article-prose {
    min-width: 0;
    font-size: 1.05rem;
    line-height: 1.8;
    color: #1e293b;
}

.article-prose h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 2.5rem 0 0.75rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.article-prose h2:first-child {
    margin-top: 0;
}

.article-prose h3 {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 1.75rem 0 0.5rem;
}

.article-prose p {
    margin: 0 0 1.2rem;
}

.article-prose ul,
.article-prose ol {
    padding-left: 1.5rem;
    margin: 0 0 1.2rem;
}

.article-prose li {
    margin-bottom: 0.5rem;
}

.article-prose strong {
    font-weight: 700;
    color: #0f172a;
}

.article-prose a {
    color: #4a6cf7;
    text-decoration: none;
    font-weight: 500;
}

.article-prose a:hover {
    text-decoration: underline;
}

/* ── Step boxes ── */
.step-list {
    list-style: none;
    padding: 0;
    margin: 0 0 1.5rem;
    counter-reset: steps;
}

.step-list li {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
    align-items: flex-start;
    counter-increment: steps;
}

.step-list li::before {
    content: counter(steps);
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 36px;
    height: 36px;
    background: #4a6cf7;
    color: #fff;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
    margin-top: 2px;
}

.step-list li div {
    flex: 1;
}

.step-list li strong {
    display: block;
    font-size: 1.05rem;
    margin-bottom: 4px;
}

/* ── Tip / Note / Warning boxes ── */
.tip-box,
.note-box,
.warn-box {
    border-radius: 10px;
    padding: 16px 20px;
    margin: 1.5rem 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    font-size: 0.95rem;
    line-height: 1.6;
}

.tip-box  { background: #eff6ff; border-left: 4px solid #4a6cf7; }
.note-box { background: #f0fdf4; border-left: 4px solid #16a34a; }
.warn-box { background: #fff7ed; border-left: 4px solid #ea580c; }

.tip-box  i { color: #4a6cf7;  margin-top: 2px; flex-shrink: 0; }
.note-box i { color: #16a34a; margin-top: 2px; flex-shrink: 0; }
.warn-box i { color: #ea580c; margin-top: 2px; flex-shrink: 0; }

/* ── Comparison table ── */
.article-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.95rem;
}

.article-table th,
.article-table td {
    border: 1px solid #e2e8f0;
    padding: 12px 16px;
    text-align: left;
    vertical-align: top;
}

.article-table th {
    background: #f8fafc;
    font-weight: 700;
    color: #0f172a;
}

.article-table tr:nth-child(even) td {
    background: #f8fafc;
}

/* ── CTA box inside article ── */
.article-cta {
    background: linear-gradient(135deg, #4a6cf7 0%, #7c3aed 100%);
    border-radius: 16px;
    padding: 32px 36px;
    text-align: center;
    color: #fff;
    margin: 2.5rem 0;
}

.article-cta h3 {
    font-size: 1.35rem;
    font-weight: 800;
    margin: 0 0 8px;
    color: #fff;
}

.article-cta p {
    opacity: 0.88;
    margin: 0 0 20px;
    font-size: 0.975rem;
}

.article-cta .btn-white {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    color: #4a6cf7;
    padding: 12px 28px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 0.95rem;
    text-decoration: none;
    transition: opacity 0.2s, gap 0.2s;
}

.article-cta .btn-white:hover {
    opacity: 0.9;
    gap: 12px;
    color: #4a6cf7;
}

/* ── Sidebar ── */
.article-sidebar {
    position: sticky;
    top: 20px;
}

.sidebar-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 24px;
}

.sidebar-card h4 {
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #64748b;
    margin: 0 0 14px;
}

/* Table of contents */
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.toc-list li {
    border-bottom: 1px solid #e2e8f0;
    margin: 0;
}

.toc-list li:last-child {
    border-bottom: none;
}

.toc-list a {
    display: block;
    padding: 9px 0;
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    transition: color 0.15s;
}

.toc-list a:hover {
    color: #4a6cf7;
}

.toc-list .toc-active {
    color: #4a6cf7;
    font-weight: 600;
}

/* Related article links in sidebar */
.related-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.related-list li {
    margin-bottom: 12px;
}

.related-list li:last-child {
    margin-bottom: 0;
}

.related-list a {
    font-size: 0.875rem;
    color: #475569;
    text-decoration: none;
    display: flex;
    gap: 8px;
    align-items: flex-start;
    line-height: 1.4;
    transition: color 0.15s;
}

.related-list a i {
    color: #4a6cf7;
    flex-shrink: 0;
    margin-top: 3px;
    font-size: 0.8rem;
}

.related-list a:hover {
    color: #4a6cf7;
}

/* ── Dark mode — article ── */
[data-theme="dark"] .article-prose {
    color: #cbd5e1;
}

[data-theme="dark"] .article-prose h2,
[data-theme="dark"] .article-prose h3,
[data-theme="dark"] .article-prose strong {
    color: #f1f5f9;
}

[data-theme="dark"] .article-prose h2 {
    border-color: #2d3d54;
}

[data-theme="dark"] .sidebar-card {
    background: #1e2a3a;
    border-color: #2d3d54;
}

[data-theme="dark"] .toc-list li {
    border-color: #2d3d54;
}

[data-theme="dark"] .toc-list a,
[data-theme="dark"] .related-list a {
    color: #94a3b8;
}

[data-theme="dark"] .article-table th {
    background: #1e2a3a;
    color: #f1f5f9;
}

[data-theme="dark"] .article-table th,
[data-theme="dark"] .article-table td {
    border-color: #2d3d54;
}

[data-theme="dark"] .article-table tr:nth-child(even) td {
    background: #16213e;
}

[data-theme="dark"] .tip-box  { background: #1e2a3a; }
[data-theme="dark"] .note-box { background: #142019; }
[data-theme="dark"] .warn-box { background: #1f1509; }

[data-theme="dark"] .article-breadcrumb {
    color: #64748b;
}

/* ── Responsive — article ── */
@media (max-width: 900px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        position: static;
    }

    .article-hero {
        flex-direction: column;
        text-align: center;
        padding: 32px 24px;
    }

    .article-hero-icon {
        font-size: 3.5rem;
    }

    .article-hero-meta {
        justify-content: center;
    }
}
