/* ================================================================
   CeeVeeGlobal — Error Library Styles
   Loaded only on error_library archive, taxonomy, and single pages.
   ================================================================ */

/* ── Shared container ── */
.cvg-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ── Error type badge colours ── */
.error-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: #fff;
    background: #666;
}
.error-badge--sm { font-size: 11px; padding: 2px 8px; }

.error-badge--wordpress-errors  { background: #0073aa; }
.error-badge--python-errors     { background: #306998; }
.error-badge--linux-bash-errors,
.error-badge--linux-errors      { background: #d35400; }
.error-badge--docker-errors     { background: #0db7ed; color: #002b36; }
.error-badge--mysql-errors      { background: #4479a1; }
.error-badge--nginx-apache-errors,
.error-badge--nginx-errors      { background: #269539; }
.error-badge--ssl-https-errors,
.error-badge--ssl-errors        { background: #8e44ad; }
.error-badge--coolify-errors    { background: #e74c3c; }

/* ── Severity dots (for archive cards) ── */
.severity-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.severity-dot--critical { background: #e74c3c; }
.severity-dot--warning  { background: #f39c12; }
.severity-dot--notice   { background: #27ae60; }

/* ── Severity badges (for single page) ── */
.severity-badge {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}
.severity-badge--critical { background: #fde8e8; color: #c0392b; }
.severity-badge--warning  { background: #fef3cd; color: #856404; }
.severity-badge--notice   { background: #d4edda; color: #155724; }

/* ================================================================
   ARCHIVE — Directory Page
   ================================================================ */

.cvg-error-directory {
    padding: 48px 0 80px;
}

.error-dir-header {
    text-align: center;
    margin-bottom: 36px;
}
.error-dir-header h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
}
.error-dir-subtitle {
    color: #555;
    font-size: 1rem;
    max-width: 600px;
    margin: 0 auto;
}

/* Filter bar */
.error-type-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
    margin-bottom: 24px;
}
.error-filter-link {
    padding: 6px 14px;
    border: 1px solid #ddd;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    transition: background 0.15s, border-color 0.15s;
    background: #fff;
}
.error-filter-link:hover { background: #f5f5f5; border-color: #bbb; }
.error-filter-link.active {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Search form */
.error-search-form {
    display: flex;
    gap: 8px;
    max-width: 600px;
    margin: 0 auto 40px;
}
.error-search-input {
    flex: 1;
    padding: 10px 16px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
}
.error-search-input:focus {
    outline: 2px solid #0073aa;
    border-color: #0073aa;
}
.error-search-btn {
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
}
.error-search-btn:hover { background: #005f8d; }

/* Cards grid */
.error-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}
@media (max-width: 900px) { .error-cards-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 580px) { .error-cards-grid { grid-template-columns: 1fr; } }

.error-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    background: #fff;
    transition: box-shadow 0.15s;
}
.error-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }

.error-card-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.error-card-title {
    font-size: 1rem;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.error-card-title a {
    color: #1a1a1a;
    text-decoration: none;
}
.error-card-title a:hover { color: #0073aa; text-decoration: underline; }

.error-card-excerpt {
    font-size: 13px;
    color: #666;
    line-height: 1.5;
    margin: 0;
    flex: 1;
}

.error-view-fix {
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    align-self: flex-start;
}
.error-view-fix:hover { text-decoration: underline; }

/* Pagination */
.error-pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.error-pagination .page-numbers {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
    color: #333;
}
.error-pagination .page-numbers.current {
    background: #0073aa;
    border-color: #0073aa;
    color: #fff;
}

/* Empty state */
.error-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

/* ================================================================
   SINGLE — Error Guide Page
   ================================================================ */

.cvg-error-single {
    padding: 40px 0 80px;
}

.cvg-error-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 40px;
    align-items: start;
}
@media (max-width: 900px) {
    .cvg-error-layout {
        grid-template-columns: 1fr;
    }
    /* Quick Reference sidebar falls naturally after article — do NOT use order:-1 */
}

/* Breadcrumb */
.error-breadcrumb {
    font-size: 13px;
    color: #888;
    margin-bottom: 24px;
}
.error-breadcrumb a { color: #0073aa; text-decoration: none; }
.error-breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-current { color: #444; }

/* Guide header */
.error-guide-header {
    margin-bottom: 32px;
}
.error-guide-header h1 {
    font-size: 1.8rem;
    line-height: 1.3;
    margin: 12px 0 14px;
    word-break: break-word;
}
.error-title-code {
    font-family: var(--cvg-font-mono);
    font-size: 1.5rem;
    background: #f4f4f4;
    padding: 4px 8px;
    border-radius: 4px;
    border: 1px solid #ddd;
    display: inline-block;
    word-break: break-all;
}
.error-guide-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    color: #777;
}

/* Guide body — the OpenAI-generated HTML sections */
.error-guide-body { line-height: 1.7; }

.error-guide-body p { word-break: break-word; }

.error-guide-body table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    width: 100%;
    border-collapse: collapse;
}
.error-guide-body th,
.error-guide-body td {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    white-space: nowrap;
}

.error-guide-body h2 {
    font-size: 1.3rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 8px;
    margin-top: 40px;
    margin-bottom: 16px;
}
.error-guide-body h3 { font-size: 1.1rem; margin-top: 24px; }

.error-guide-body pre {
    background: #1e1e2e;
    color: #cdd6f4;
    padding: 16px 20px;
    border-radius: 6px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 13.5px;
    line-height: 1.6;
    margin: 16px 0;
}
.error-guide-body code {
    font-family: var(--cvg-font-mono);
    font-size: 0.875em;
    background: #f4f4f4;
    padding: 2px 5px;
    border-radius: 3px;
    border: 1px solid #e0e0e0;
}
.error-guide-body pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
}

/* Step confirm callout */
.error-guide-body .step-confirm {
    background: #d4edda;
    border-left: 4px solid #28a745;
    padding: 10px 14px;
    border-radius: 0 4px 4px 0;
    font-size: 13px;
    color: #155724;
    margin: 8px 0 20px;
}

/* FAQ accordion */
.error-guide-body details {
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    margin-bottom: 8px;
    overflow: hidden;
}
.error-guide-body details[open] { border-color: #0073aa; }
.error-guide-body summary {
    padding: 12px 16px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    background: #f9f9f9;
    list-style: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.error-guide-body summary::-webkit-details-marker { display: none; }
.error-guide-body summary::after { content: '+'; font-size: 18px; color: #0073aa; }
.error-guide-body details[open] summary::after { content: '−'; }
.error-guide-body details > p {
    padding: 12px 16px;
    margin: 0;
    font-size: 14px;
}

/* Related errors */
.related-errors {
    margin-top: 56px;
    padding-top: 32px;
    border-top: 2px solid #f0f0f0;
}
.related-errors h2 { font-size: 1.2rem; margin-bottom: 20px; }

.related-errors-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}
@media (max-width: 700px) { .related-errors-grid { grid-template-columns: 1fr; } }

.related-error-card {
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.related-error-card h3 {
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}
.related-error-card h3 a { color: #1a1a1a; text-decoration: none; }
.related-error-card h3 a:hover { color: #0073aa; text-decoration: underline; }
.related-error-card p {
    font-size: 12px;
    color: #777;
    margin: 0;
    line-height: 1.5;
}

/* ── Quick Reference Sidebar ── */
.error-quick-ref {
    position: sticky;
    top: 90px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 24px;
}
.error-quick-ref h3 {
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: #888;
    margin: 0 0 16px;
    font-weight: 600;
}

.error-ref-list {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 10px 12px;
    font-size: 13px;
    margin: 0 0 20px;
}
.error-ref-list dt {
    color: #888;
    font-weight: 600;
    white-space: nowrap;
}
.error-ref-list dd {
    margin: 0;
    color: #333;
    word-break: break-word;
}
.error-ref-list a { color: #0073aa; text-decoration: none; }
.error-ref-list a:hover { text-decoration: underline; }

.error-back-link {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    padding-top: 16px;
    border-top: 1px solid #e0e0e0;
}
.error-back-link:hover { text-decoration: underline; }

/* ── AdSense slots ── */
.error-ad {
    margin: 24px 0;
    overflow: hidden;
    min-height: 90px;
}
@media (min-width: 768px) { .error-ad { min-height: 250px; } }
.error-ad--top  { margin-bottom: 32px; }
.error-ad--bottom { margin-top: 32px; }
.error-ad--sidebar { margin-top: 20px; }

/* ── Responsive images ── */
.error-guide-body img,
.error-featured-image img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 6px;
}

/* ── Featured image ── */
.error-featured-image {
    margin: 0 0 28px;
    border-radius: 8px;
    overflow: hidden;
}
.error-featured-image img {
    width: 100%;
    height: auto;
    margin: 0;
    border-radius: 0;
}

/* ── Responsive ── */
@media (max-width: 900px) {
    .error-guide-body img {
        width: 100% !important;
        height: auto !important;
    }
    .error-guide-header h1 { font-size: 1.4rem; }
    .error-quick-ref {
        position: static;
        margin-top: 40px;
    }
}
@media (max-width: 580px) {
    .cvg-container { padding: 0 16px; overflow-x: hidden; }
    .error-guide-body pre { font-size: 12px; padding: 12px; }
    .error-search-form {
        flex-direction: column;
    }
    .error-search-btn {
        width: 100%;
        padding: 12px;
        text-align: center;
    }
    .error-title-code { font-size: 1.1rem; }
    .error-guide-meta { flex-wrap: wrap; gap: 8px; }
}
@media (max-width: 480px) {
    .cvg-error-single { padding: 24px 0 60px; }
    .error-dir-header h1 { font-size: 1.6rem; }
}
