/* ============================================
   Help Center — Page Styles
   ============================================ */

/* Hero */
.help-hero {
    text-align: center;
    padding: 48px 0 56px;
}

.help-hero h1 {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    margin-bottom: 8px;
}

.help-hero p {
    font-size: 1.1rem;
    margin-bottom: 28px;
}

.help-hero-compact {
    padding: 24px 0 40px;
}

.help-hero-compact h1 {
    font-size: 1.5rem;
    margin-bottom: 16px;
}

/* Category Grid */
.help-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 48px;
}

.help-category-card {
    display: block;
    padding: 28px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.help-category-card:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow);
    transform: translateY(-2px);
}

.help-category-card i {
    font-size: 1.5rem;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.help-category-card h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--text);
}

.help-category-card p {
    font-size: 0.875rem;
    color: #3f3f46;
    margin-bottom: 12px;
    line-height: 1.5;
}

.help-category-count {
    font-size: 0.75rem;
    color: #71717a;
    font-weight: 600;
}

/* Popular Articles */
.help-popular {
    margin-bottom: 48px;
}

.help-popular h2 {
    font-size: 1.125rem;
    font-weight: 700;
    margin-bottom: 16px;
}

/* Category Header */
.category-header {
    margin-bottom: 32px;
}

.category-icon {
    font-size: 2rem;
    color: var(--primary);
    margin-bottom: 12px;
    display: block;
}

.category-header h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 8px;
}

.category-header p {
    font-size: 1rem;
}

/* Article List */
.help-article-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 48px;
}

.help-article-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    background: white;
    text-decoration: none;
    transition: background-color 0.15s;
}

.help-article-item:hover {
    background: var(--bg-subtle);
}

.help-article-item-content {
    flex: 1;
    min-width: 0;
}

.help-article-item h2 {
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 2px;
}

.help-article-item p {
    font-size: 0.875rem;
    color: #52525b;
    margin: 0;
}

.help-article-category {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 500;
}

.help-article-item > i {
    color: var(--text-muted);
    font-size: 0.875rem;
    flex-shrink: 0;
    margin-left: 16px;
}

/* Subcategory Groups */
.category-group {
    margin-bottom: 40px;
}

.category-group + .category-group {
    margin-top: 8px;
}

.category-group-title {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-light);
}

.help-cta-contextual {
    padding: 28px 0;
}

.help-cta-contextual p {
    font-size: 0.9375rem;
    color: var(--text-secondary);
}

.help-cta-contextual a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.help-cta-contextual a:hover {
    text-decoration: underline;
}

/* Article Layout */
.article-layout {
    display: grid;
    grid-template-columns: 1fr 260px;
    gap: 48px;
    align-items: start;
}

.article-content h1 {
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 8px;
}

.article-meta {
    font-size: 0.8125rem;
    color: #71717a;
    margin-bottom: 36px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.article-availability {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--primary);
    background: var(--primary-light);
    padding: 2px 10px;
    border-radius: 100px;
}

.article-featured-image {
    width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin-bottom: 28px;
    border: 1px solid var(--border);
}

/* Prose — article body typography */
.help-prose {
    font-size: 1rem;
    line-height: 1.85;
    color: #3f3f46;
}

.help-prose h2 {
    font-size: 1.375rem;
    margin: 40px 0 14px;
    padding-top: 8px;
}

.help-prose h3 {
    font-size: 1.125rem;
    margin: 32px 0 10px;
}

.help-prose p {
    margin-bottom: 18px;
}

.help-prose ul, .help-prose ol {
    margin: 0 0 18px 24px;
}

.help-prose li {
    margin-bottom: 8px;
    line-height: 1.8;
}

/* Numbered steps — styled as soft panels */
.help-prose ol {
    list-style: none;
    counter-reset: step;
    margin-left: 0;
    padding: 0;
}

.help-prose ol > li {
    counter-increment: step;
    padding: 12px 16px 12px 48px;
    position: relative;
    background: white;
    border: 1px solid var(--border-light);
    border-radius: 8px;
    margin-bottom: 8px;
}

.help-prose ol > li::before {
    content: counter(step);
    position: absolute;
    left: 14px;
    top: 12px;
    width: 24px;
    height: 24px;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Callouts — use blockquote with bold first line as title */
.help-prose blockquote {
    border-left: 3px solid var(--primary);
    padding: 14px 20px;
    margin: 20px 0;
    background: #fef9ee;
    border-radius: 0 var(--radius) var(--radius) 0;
}

.help-prose blockquote p {
    margin-bottom: 0;
    color: #44403c;
}

.help-prose blockquote p strong:first-child {
    color: var(--primary);
}

.help-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 8px 8px 0 0;
    margin: 0 auto;
    border: none;
    display: block;
    cursor: zoom-in;
}

.help-prose img:hover {
    opacity: 0.95;
}

/* Image + caption wrapper */
.help-prose p:has(> img) {
    background: #fafaf9;
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 28px auto 6px;
    max-width: fit-content;
}

/* Hide the br between image and caption */
.help-prose img + br {
    display: none;
}

/* Caption inside same paragraph as image */
.help-prose img + em,
.help-prose img + br + em {
    display: block;
    font-size: 0.8125rem;
    color: #71717a;
    font-style: normal;
    line-height: 1.4;
    padding: 6px 14px 8px;
}

/* Caption in separate paragraph after image paragraph */
.help-prose p:has(> img) + p > em:only-child {
    display: block;
    font-size: 0.8125rem;
    color: #71717a;
    font-style: normal;
    line-height: 1.4;
}

.help-prose p:has(> img) + p:has(> em:only-child) {
    background: #fafaf9;
    border: 1px solid var(--border-light);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 6px 14px 8px;
    margin-top: -6px;
    margin-bottom: 20px;
    max-width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

/* Tables */
.help-prose table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin: 16px 0;
    font-size: 0.9375rem;
}

.help-prose thead th {
    background: var(--bg-section);
    font-weight: 700;
    font-size: 0.8125rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    padding: 10px 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.help-prose tbody td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border-light);
    color: #3f3f46;
}

.help-prose tbody tr:last-child td {
    border-bottom: none;
}

.help-prose tbody tr:nth-child(even) {
    background: var(--bg-subtle);
}

.help-prose tbody td strong {
    color: var(--text);
}

.help-prose code {
    background: var(--bg-section);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.875em;
}

.help-prose pre {
    background: var(--bg-section);
    padding: 16px;
    border-radius: var(--radius);
    overflow-x: auto;
    margin-bottom: 16px;
}

.help-prose pre code {
    background: none;
    padding: 0;
}


.help-prose a {
    color: var(--primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.help-prose strong {
    color: var(--text);
    font-weight: 600;
}

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

.sidebar-section {
    margin-bottom: 28px;
}

.sidebar-section h4 {
    font-family: var(--font-body);
    font-size: 0.8125rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 12px;
}

.sidebar-nav {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-nav li {
    margin-bottom: 2px;
}

.sidebar-nav a {
    display: block;
    padding: 6px 12px;
    font-size: 0.875rem;
    color: #3f3f46;
    text-decoration: none;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover {
    background: var(--bg-section);
    color: var(--primary);
}

.sidebar-cta {
    padding: 20px;
    background: var(--bg-section);
    border-radius: var(--radius);
}

.sidebar-cta h4 {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 6px;
}

.sidebar-cta p {
    font-size: 0.8125rem;
    color: #52525b;
    margin-bottom: 14px;
}

/* Article Navigation (Prev/Next) */
.article-nav {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-top: 48px;
    padding-top: 28px;
    border-top: 1px solid var(--border-light);
}

.article-nav-link {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 18px;
    background: white;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    text-decoration: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    max-width: 48%;
}

.article-nav-link:hover {
    border-color: var(--primary);
    box-shadow: var(--shadow-sm);
}

.article-nav-next {
    text-align: right;
    margin-left: auto;
}

.article-nav-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.article-nav-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.3;
}

/* CTAs */
.help-cta-bottom {
    text-align: center;
    padding: 40px 0;
}

.help-cta-bottom h3 {
    font-size: 1.25rem;
    margin-bottom: 6px;
}

.help-cta-bottom p {
    margin-bottom: 16px;
}

.help-cta-inline {
    margin-top: 36px;
    padding: 20px 24px;
    background: var(--bg-section);
    border-radius: var(--radius);
}

.help-cta-inline p {
    margin: 0;
    font-size: 0.9375rem;
}

.help-cta-inline a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.help-cta-inline a:hover {
    text-decoration: underline;
}

/* Search */
.search-count {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

/* Empty states */
.help-empty {
    text-align: center;
    padding: 48px 0;
    color: var(--text-muted);
}

.help-empty-sub {
    font-size: 0.875rem;
    margin-top: 8px;
}

.help-empty-sub a {
    color: var(--primary);
}

/* Responsive */
@media (max-width: 768px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .article-sidebar {
        position: static;
    }

    .help-article-item {
        padding: 16px 20px;
    }
}

/* Lightbox */
.lightbox-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    cursor: zoom-out;
}

.lightbox-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.lightbox-img {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}

.lightbox-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: white;
    font-size: 2rem;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
    line-height: 1;
}

.lightbox-close:hover {
    opacity: 1;
}
