/* ============================================
   GUIDES SECTION — guides.css
   Loaded alongside /css/index.css on all /guides/ pages.
   Provides: subnav, article layout, code blocks,
   tables, checklists, tip boxes, prev/next nav.
   ============================================ */

/* ============================================
   GUIDES SUBNAV (sticky bar below main header)
   ============================================ */
.guides-subnav {
    background: var(--color-primary);
    border-bottom: 1px solid rgba(0, 0, 0, 0.15);
    position: sticky;
    top: var(--header-height);
    z-index: 900;
    overflow-x: auto;
    scrollbar-width: none;
}

.guides-subnav::-webkit-scrollbar {
    display: none;
}

.guides-subnav-inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: stretch;
    white-space: nowrap;
    min-height: 46px;
}

.subnav-home {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.78rem;
    padding: 0 1rem 0 0;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-right: 1px solid rgba(255, 255, 255, 0.25);
    margin-right: 0.5rem;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.subnav-home:hover {
    color: #fff;
}

.subnav-links {
    display: flex;
    align-items: stretch;
}

.subnav-link {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.78rem;
    padding: 0 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 3px solid transparent;
    display: flex;
    align-items: center;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.subnav-link:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.subnav-link.active {
    color: #fff;
    border-bottom-color: #fff;
    background: rgba(255, 255, 255, 0.12);
}

/* ============================================
   GUIDE MAIN LAYOUT
   ============================================ */
.guide-main {
    background: var(--color-background-duskBlue);
    min-height: calc(100vh - var(--header-height) - 46px);
    padding: 3rem 0 5rem;
}

.guide-container {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 10rem;
}

/* Wide variant for landing page */
.guide-container--wide {
    padding: 0 6rem;
}

/* ============================================
   BREADCRUMB
   ============================================ */
.breadcrumb {
    margin-bottom: 1.75rem;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    padding: 0;
    margin: 0;
    font-size: 0.85rem;
}

.breadcrumb li {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.55);
}

.breadcrumb li + li::before {
    content: '›';
    margin: 0 0.5rem;
    color: rgba(255, 255, 255, 0.35);
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #fff;
    text-decoration: underline;
}

.breadcrumb li[aria-current="page"] {
    color: rgba(255, 255, 255, 0.85);
}

/* ============================================
   ARTICLE HEADER CARD
   ============================================ */
.article-header {
    background: var(--color-white);
    border-radius: 16px;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--color-border);
}

.article-meta {
    display: flex;
    gap: 0.6rem;
    margin-bottom: 1.1rem;
    flex-wrap: wrap;
    align-items: center;
}

.article-number {
    background: rgba(0, 94, 184, 0.1);
    color: var(--color-primary);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-tag {
    background: rgba(40, 167, 69, 0.1);
    color: var(--color-success);
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-tag--warning {
    background: rgba(255, 193, 7, 0.15);
    color: #856404;
}

.article-header h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    line-height: 1.25;
}

.article-intro {
    font-size: 1.05rem;
    color: var(--color-grey-dark);
    line-height: 1.75;
    margin: 0;
    border-top: 1px solid rgba(0, 0, 0, 0.07);
    padding-top: 1rem;
}

/* ============================================
   ARTICLE BODY CARD
   ============================================ */
.article-body {
    background: var(--color-white);
    border-radius: 16px;
    padding: 2.5rem;
    border: 1px solid var(--color-border);
    margin-bottom: 1.5rem;
}

/* --- Headings --- */
.article-body h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--color-primary);
    margin: 2.5rem 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(0, 94, 184, 0.12);
    line-height: 1.3;
}

.article-body h2:first-child {
    margin-top: 0;
}

.article-body h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--color-text-primary);
    margin: 2rem 0 0.75rem;
}

/* --- Body text --- */
.article-body p {
    color: var(--color-grey-dark);
    line-height: 1.8;
    margin-bottom: 1rem;
    font-size: 0.98rem;
    text-align: left;
}

.article-body strong {
    color: var(--color-text-primary);
    font-weight: 700;
}

.article-body a {
    color: var(--color-primary);
    text-decoration: underline;
}

.article-body a:hover {
    color: var(--color-secondary);
}

.article-body ul,
.article-body ol {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
    color: var(--color-grey-dark);
    line-height: 1.8;
    font-size: 0.98rem;
}

.article-body li {
    margin-bottom: 0.4rem;
}

.article-body hr {
    border: none;
    border-top: 2px solid rgba(0, 94, 184, 0.1);
    margin: 2.25rem 0;
}

/* ============================================
   CODE BLOCKS
   ============================================ */
.article-body pre {
    background: #1a1d23;
    border-radius: 10px;
    padding: 1.5rem;
    overflow-x: auto;
    margin: 0.5rem 0;
    border: 1px solid #2d3748;
}

.article-body pre code {
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.85rem;
    color: #e2e8f0;
    line-height: 1.7;
    display: block;
    white-space: pre;
}

/* Inline code */
.article-body code:not(pre code) {
    background: rgba(0, 94, 184, 0.08);
    color: var(--color-primary);
    font-family: 'JetBrains Mono', 'Courier New', monospace;
    font-size: 0.875em;
    padding: 0.15em 0.45em;
    border-radius: 4px;
    border: 1px solid rgba(0, 94, 184, 0.15);
    white-space: nowrap;
}

/* ============================================
   TIP / WARNING BOXES
   ============================================ */
.tip-box {
    background: rgba(0, 94, 184, 0.06);
    border-left: 4px solid var(--color-primary);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-size: 0.95rem;
    color: var(--color-grey-dark);
    line-height: 1.7;
}

.tip-box strong {
    color: var(--color-primary);
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.warning-box {
    background: rgba(255, 193, 7, 0.08);
    border-left: 4px solid var(--color-warning);
    border-radius: 0 8px 8px 0;
    padding: 1rem 1.25rem;
    margin: 1.25rem 0;
    font-size: 0.95rem;
    color: var(--color-grey-dark);
    line-height: 1.7;
}

.warning-box strong {
    color: #856404;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ============================================
   TABLES
   ============================================ */
.article-body .table-wrap {
    overflow-x: auto;
    margin: 1.25rem 0;
    border-radius: 10px;
    border: 1px solid var(--color-border);
}

.article-body table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.article-body th {
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 700;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-body td {
    padding: 0.65rem 1rem;
    border-bottom: 1px solid var(--color-border);
    color: var(--color-grey-dark);
    vertical-align: top;
    line-height: 1.6;
}

.article-body tr:last-child td {
    border-bottom: none;
}

.article-body tr:nth-child(even) td {
    background: rgba(0, 94, 184, 0.025);
}

/* ============================================
   CHECKLIST (- [ ] items from markdown)
   ============================================ */
.checklist {
    list-style: none;
    padding-left: 0;
    margin: 1.25rem 0;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    overflow: hidden;
}

.checklist li {
    display: flex;
    align-items: flex-start;
    gap: 0.85rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    color: var(--color-grey-dark);
    line-height: 1.45;
    font-size: 0.9rem;
    background: #fff;
    text-align: left;
}

.checklist li:last-child {
    border-bottom: none;
}

.checklist li::before {
    content: '☐';
    font-size: 1.05rem;
    color: var(--color-primary);
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* ============================================
   ARTICLE IMAGES
   ============================================ */
.article-figure {
    margin: 1.75rem 0;
}

.article-img {
    width: 100%;
    display: block;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
}

.article-figure figcaption {
    font-size: 0.8rem;
    color: var(--color-grey-medium);
    text-align: center;
    margin-top: 0.5rem;
    font-style: italic;
    line-height: 1.5;
}

/* ============================================
   IMAGE PLACEHOLDERS (used when screenshot not yet available)
   ============================================ */

.figure-placeholder {
    background: var(--color-grey-light);
    border: 2px dashed var(--color-grey-medium);
    border-radius: 10px;
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.6rem;
}

.figure-icon {
    font-size: 1.75rem;
    opacity: 0.4;
}

.figure-label {
    color: var(--color-grey-dark);
    font-size: 0.88rem;
    font-style: italic;
}

/* ============================================
   DOWNLOAD FILE REFERENCES
   ============================================ */
.download-file {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(40, 167, 69, 0.05);
    border: 1px solid rgba(40, 167, 69, 0.2);
    border-radius: 8px;
    padding: 0.75rem 1rem;
    margin: 0.75rem 0;
}

.download-file-icon {
    font-size: 1.2rem;
}

.download-file-name {
    color: var(--color-grey-dark);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.83rem;
}

.download-file-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    min-width: 0;
}

.download-file-top {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.download-file-badge {
    font-size: 0.68rem;
    font-weight: 700;
    padding: 0.15rem 0.5rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    white-space: nowrap;
    flex-shrink: 0;
}

.download-file-badge--corrupt {
    background: rgba(220, 53, 69, 0.1);
    color: var(--color-error);
}

.download-file-badge--clean {
    background: rgba(40, 167, 69, 0.1);
    color: var(--color-success);
}

.download-file-desc {
    font-size: 0.82rem;
    color: var(--color-grey-medium);
    line-height: 1.45;
}

.download-coming-soon {
    color: var(--color-grey-medium);
    font-size: 0.8rem;
    font-style: italic;
}

.download-file-btn {
    color: var(--color-success);
    font-size: 0.8rem;
    font-weight: 700;
    text-decoration: none;
    border: 1px solid rgba(40, 167, 69, 0.4);
    padding: 0.25rem 0.65rem;
    border-radius: 6px;
    white-space: nowrap;
    transition: all 0.2s;
    flex-shrink: 0;
}

.download-file-btn:hover {
    background: var(--color-success);
    color: white;
    border-color: var(--color-success);
}

/* ============================================
   EXCEL ERROR MESSAGE display
   ============================================ */
.excel-error {
    background: rgba(220, 53, 69, 0.06);
    border: 1px solid rgba(220, 53, 69, 0.2);
    border-radius: 8px;
    padding: 0.85rem 1rem;
    margin: 0.75rem 0;
}

.excel-error-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-error);
    margin-bottom: 0.4rem;
    display: block;
}

.excel-error pre {
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
}

.excel-error pre code {
    font-size: 0.83rem;
    color: var(--color-error);
}

/* ============================================
   CORRUPTION BLOCK (styled section per type)
   ============================================ */
.corruption-block {
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    margin: 2rem 0;
}

.corruption-header {
    background: linear-gradient(135deg, var(--color-primary), var(--color-secondary));
    color: white;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.corruption-type-badge {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    flex-shrink: 0;
}

.corruption-header h3 {
    color: white !important;
    margin: 0 !important;
    font-size: 1rem !important;
    font-family: 'Montserrat', sans-serif;
}

.corruption-body {
    padding: 1.5rem;
}

/* ============================================
   ARTICLE NAVIGATION (Prev / Next)
   ============================================ */
.article-prev-next {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.prev-next-link {
    display: flex;
    flex-direction: column;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.25rem 1.5rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

.prev-next-link:hover {
    border-color: var(--color-primary);
    box-shadow: 0 4px 16px rgba(0, 94, 184, 0.12);
    transform: translateY(-2px);
}

.prev-next-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
    margin-bottom: 0.4rem;
}

.prev-next-title {
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--color-text-primary);
    line-height: 1.4;
}

.prev-next-link.next-link {
    text-align: right;
}

.prev-next-placeholder {
    visibility: hidden;
}

/* ============================================
   GUIDES INDEX (Landing page)
   ============================================ */
.guides-hero {
    background: var(--color-white);
    border-radius: 16px;
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--color-border);
    text-align: center;
}

.guides-hero h1 {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.4rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
    line-height: 1.2;
}

.guides-hero .hero-intro {
    font-size: 1.1rem;
    color: var(--color-grey-dark);
    line-height: 1.75;
    max-width: 820px;
    margin: 0 auto 1.75rem;
}

.guides-hero .hero-tags {
    display: flex;
    gap: 0.6rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 0;
}

.hero-tag {
    background: rgba(0, 94, 184, 0.08);
    color: var(--color-primary);
    font-size: 0.8rem;
    font-weight: 700;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    text-transform: uppercase;
    letter-spacing: 0.4px;
}

.guides-section-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.3rem;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.9);
    margin: 0 0 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid rgba(255, 255, 255, 0.15);
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 1.1rem;
    margin-bottom: 2rem;
}

.guide-card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    padding: 1.6rem;
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    transition: all 0.25s ease;
}

.guide-card:hover {
    border-color: var(--color-primary);
    box-shadow: 0 6px 20px rgba(0, 94, 184, 0.12);
    transform: translateY(-3px);
}

.guide-card-number {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--color-primary);
    background: rgba(0, 94, 184, 0.08);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    width: fit-content;
}

.guide-card h3 {
    font-family: 'Montserrat', sans-serif;
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--color-text-primary);
    line-height: 1.4;
    margin: 0;
}

.guide-card p {
    font-size: 0.87rem;
    color: var(--color-grey-dark);
    line-height: 1.6;
    margin: 0;
    flex: 1;
}

.guide-card-arrow {
    color: var(--color-primary);
    font-size: 1rem;
    margin-top: 0.25rem;
    font-weight: 700;
}

/* Who is this for box */
.who-box {
    background: var(--color-white);
    border-radius: 12px;
    padding: 1.75rem;
    border: 1px solid var(--color-border);
    margin-bottom: 2rem;
}

.who-box h2 {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--color-text-primary);
    margin-bottom: 1rem;
}

.who-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 0.6rem;
}

.who-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    color: var(--color-grey-dark);
    line-height: 1.5;
}

.who-list li::before {
    content: '✓';
    color: var(--color-success);
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 0.05rem;
}

/* DIY CTA banner (used on index.html) */
.diy-cta-banner {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(0, 94, 184, 0.06);
    border: 1px solid rgba(0, 94, 184, 0.15);
    border-radius: 12px;
    padding: 1.1rem 1.5rem;
    margin-top: 1.25rem;
}

.diy-cta-icon {
    font-size: 1.75rem;
    flex-shrink: 0;
}

.diy-cta-text {
    flex: 1;
}

.diy-cta-text strong {
    display: block;
    color: var(--color-text-primary);
    font-size: 0.95rem;
    margin-bottom: 0.2rem;
}

.diy-cta-text p {
    color: var(--color-grey-dark);
    font-size: 0.87rem;
    margin: 0;
    line-height: 1.5;
}

.diy-cta-link {
    color: var(--color-primary);
    font-weight: 700;
    font-size: 0.87rem;
    text-decoration: none;
    white-space: nowrap;
    border: 2px solid var(--color-primary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.2s;
    flex-shrink: 0;
}

.diy-cta-link:hover {
    background: var(--color-primary);
    color: #fff;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1200px) {
    .guide-container {
        padding: 0 4rem;
    }
    .guide-container--wide {
        padding: 0 2rem;
    }
}

@media (max-width: 768px) {
    .guide-container,
    .guide-container--wide {
        padding: 0 1rem;
    }

    .guide-main {
        padding: 2rem 0 4rem;
    }

    .article-header {
        padding: 1.75rem 1.5rem;
    }

    .article-header h1 {
        font-size: 1.5rem;
    }

    .article-body {
        padding: 1.75rem 1.5rem;
    }

    .guides-hero {
        padding: 2rem 1.5rem;
    }

    .guides-hero h1 {
        font-size: 1.75rem;
    }

    .article-prev-next {
        grid-template-columns: 1fr;
    }

    .prev-next-link.next-link {
        text-align: left;
    }

    .guides-grid {
        grid-template-columns: 1fr;
    }

    .who-list {
        grid-template-columns: 1fr;
    }

    .diy-cta-banner {
        flex-direction: column;
        text-align: center;
    }

    .corruption-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .article-body pre {
        padding: 1rem;
        border-radius: 8px;
    }

    .article-body pre code {
        font-size: 0.78rem;
    }
}
