/* ==========================================================================
   FlightDeck Guides Design System
   Matches FlightDeck Aerospace Cyan Aesthetic with Dark Surfaces
   Inherits design tokens from /style.css and /flightdeck/css/styles.css
   ========================================================================== */

/* Breadcrumb Navigation */
.fd-breadcrumb {
    padding: 1.25rem 0 0.5rem;
    font-size: 0.85rem;
    color: var(--text-tertiary, #94a3b8);
    max-width: 100%;
    box-sizing: border-box;
}

.fd-breadcrumb-list {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    list-style: none;
    padding: 0;
    margin: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.fd-breadcrumb-item {
    max-width: 100%;
}

.fd-breadcrumb-item a {
    color: var(--fd-cyan-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}

.fd-breadcrumb-item a:hover {
    color: var(--fd-cyan-bright);
    text-decoration: underline;
}

.fd-breadcrumb-separator {
    color: var(--text-muted, #64748b);
    user-select: none;
}

.fd-breadcrumb-item[aria-current="page"] {
    color: var(--text-secondary, #cbd5e1);
    font-weight: 500;
    word-break: break-word;
}

/* Guide Container & Grid Layout */
.fd-guide-container {
    width: 100%;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 clamp(1rem, 3vw, 2.5rem) 4rem;
    box-sizing: border-box;
    min-width: 0;
}

.fd-guide-grid {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2.5rem;
    align-items: start;
    margin-top: 1.5rem;
    min-width: 0;
    max-width: 100%;
}

@media (max-width: 1024px) {
    .fd-guide-grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
    }

    .fd-guide-sidebar {
        display: none;
    }
}

/* Sticky Table of Contents Sidebar */
.fd-guide-sidebar {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    background: var(--fd-card-surface);
    border: 1px solid var(--fd-border-hairline);
    border-radius: var(--fd-radius-md);
    padding: 1.25rem;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
}

.fd-toc-title {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--fd-cyan-bright);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.fd-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.fd-toc-link {
    display: block;
    font-size: 0.82rem;
    color: var(--text-secondary, #94a3b8);
    text-decoration: none;
    line-height: 1.4;
    padding: 0.3rem 0.5rem;
    border-radius: 4px;
    transition: all 0.15s ease;
    word-break: break-word;
}

.fd-toc-link:hover {
    color: #ffffff;
    background: var(--fd-cyan-dim);
}

.fd-toc-subitem {
    padding-left: 0.85rem;
    font-size: 0.78rem;
}

/* Guide Main Column */
.fd-guide-main {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.fd-guide-article {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Guide Header */
.fd-guide-header {
    margin-bottom: 2rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid var(--fd-border-hairline);
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

.fd-guide-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
    align-items: center;
}

.fd-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.25rem 0.65rem;
    border-radius: 9999px;
    background: var(--fd-card-elevated);
    color: var(--text-secondary, #cbd5e1);
    border: 1px solid var(--fd-border-medium);
}

.fd-badge-category {
    background: rgba(56, 189, 248, 0.12);
    color: var(--fd-cyan-bright);
    border-color: var(--fd-cyan-border);
}

.fd-badge-audience {
    background: rgba(16, 185, 129, 0.12);
    color: #34d399;
    border-color: rgba(16, 185, 129, 0.25);
}

.fd-badge-reading-time {
    color: var(--text-tertiary, #94a3b8);
}

.fd-guide-title {
    font-size: clamp(1.75rem, 3.5vw, 2.5rem);
    font-weight: 800;
    line-height: 1.25;
    color: #ffffff;
    margin: 0 0 1rem;
    word-break: break-word;
    overflow-wrap: break-word;
}

.fd-guide-desc {
    font-size: clamp(1rem, 1.8vw, 1.15rem);
    line-height: 1.6;
    color: var(--text-secondary, #cbd5e1);
    margin: 0 0 1.25rem;
    word-break: break-word;
}

.fd-guide-meta-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-tertiary, #94a3b8);
    margin-bottom: 1rem;
}

.fd-guide-tools-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.8rem;
    color: var(--text-tertiary, #94a3b8);
}

.fd-tool-pill {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    padding: 0.2rem 0.5rem;
    background: var(--fd-card-surface);
    border: 1px solid var(--fd-border-hairline);
    border-radius: 4px;
    color: var(--fd-cyan-bright);
    word-break: break-all;
}

/* Article Typography & Markdown Elements */
.fd-article-content {
    color: var(--text-primary, #f1f5f9);
    line-height: 1.75;
    font-size: 1.02rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.fd-article-content h2 {
    font-size: clamp(1.35rem, 2.5vw, 1.85rem);
    font-weight: 700;
    color: #ffffff;
    margin: 2.75rem 0 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--fd-border-hairline);
    scroll-margin-top: 6rem;
    word-break: break-word;
}

.fd-article-content h3 {
    font-size: clamp(1.15rem, 2vw, 1.45rem);
    font-weight: 600;
    color: var(--fd-cyan-bright);
    margin: 2.25rem 0 0.85rem;
    scroll-margin-top: 6rem;
    word-break: break-word;
}

.fd-article-content h4 {
    font-size: 1.05rem;
    font-weight: 600;
    color: #ffffff;
    margin: 1.5rem 0 0.5rem;
    word-break: break-word;
}

.fd-article-content p {
    margin: 0 0 1.25rem;
    word-break: break-word;
}

.fd-article-content ul,
.fd-article-content ol {
    margin: 0 0 1.25rem;
    padding-left: 1.5rem;
    box-sizing: border-box;
    max-width: 100%;
}

.fd-article-content li {
    margin-bottom: 0.5rem;
    word-break: break-word;
}

.fd-article-content a {
    color: var(--fd-cyan-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.15s ease;
    word-break: break-word;
}

.fd-article-content a:hover {
    color: var(--fd-cyan-bright);
}

.fd-article-content hr {
    border: none;
    border-top: 1px solid var(--fd-border-hairline);
    margin: 2.5rem 0;
}

.fd-article-content code:not([class*="language-"]) {
    font-family: var(--font-mono);
    font-size: 0.88em;
    padding: 0.15rem 0.4rem;
    background: var(--fd-card-elevated);
    border: 1px solid var(--fd-border-hairline);
    border-radius: 4px;
    color: var(--fd-cyan-bright);
    word-break: break-word;
}

/* Callout Alert Boxes */
.fd-callout {
    margin: 1.75rem 0;
    padding: 1.25rem 1.4rem;
    border-radius: var(--fd-radius-md);
    border-left: 4px solid var(--fd-cyan-primary);
    background: var(--fd-card-surface);
    border-top: 1px solid var(--fd-border-hairline);
    border-right: 1px solid var(--fd-border-hairline);
    border-bottom: 1px solid var(--fd-border-hairline);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.fd-callout-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.fd-callout-body {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-secondary, #cbd5e1);
    min-width: 0;
    max-width: 100%;
}

.fd-callout-body p:last-child {
    margin-bottom: 0;
}

.fd-callout-body ul {
    margin-bottom: 0;
}

.fd-callout-note {
    border-left-color: var(--fd-cyan-primary);
    background: rgba(56, 189, 248, 0.05);
}

.fd-callout-tip {
    border-left-color: var(--fd-status-emerald);
    background: rgba(16, 185, 129, 0.05);
}

.fd-callout-important {
    border-left-color: var(--fd-status-amber);
    background: rgba(245, 158, 11, 0.05);
}

.fd-callout-warning {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.05);
}

/* Code Blocks & Copyable Prompts */
.fd-code-block {
    margin: 1.5rem 0;
    background: #080c14;
    border: 1px solid var(--fd-border-medium);
    border-radius: var(--fd-radius-md);
    overflow: hidden;
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.fd-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 1rem;
    background: var(--fd-card-surface);
    border-bottom: 1px solid var(--fd-border-hairline);
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-tertiary, #94a3b8);
    user-select: none;
}

.fd-code-block pre {
    margin: 0;
    padding: 1.15rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.88rem;
    line-height: 1.65;
    color: #e2e8f0;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.fd-code-block code {
    font-family: inherit;
    white-space: pre;
    word-break: normal;
}

.fd-copy-btn {
    background: var(--fd-card-elevated);
    border: 1px solid var(--fd-border-hairline);
    color: var(--text-secondary, #cbd5e1);
    padding: 0.25rem 0.65rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: all 0.15s ease;
}

.fd-copy-btn:hover {
    background: var(--fd-cyan-dim);
    border-color: var(--fd-cyan-border);
    color: var(--fd-cyan-bright);
}

/* Responsive Table Wrapper */
.fd-table-wrapper {
    margin: 1.75rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border: 1px solid var(--fd-border-hairline);
    border-radius: var(--fd-radius-md);
    background: var(--fd-card-surface);
    max-width: 100%;
    box-sizing: border-box;
    min-width: 0;
}

.fd-table-wrapper:focus-visible {
    outline: 2px solid var(--fd-cyan-bright);
    outline-offset: 2px;
}

.fd-table-wrapper table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    text-align: left;
    min-width: 600px;
}

.fd-table-wrapper th {
    background: rgba(56, 189, 248, 0.08);
    color: #ffffff;
    font-weight: 600;
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--fd-border-medium);
    white-space: nowrap;
}

.fd-table-wrapper td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--fd-border-hairline);
    color: var(--text-secondary, #cbd5e1);
}

.fd-table-wrapper tr:last-child td {
    border-bottom: none;
}

.fd-table-wrapper tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

/* Call to Action Box */
.fd-cta-box {
    margin: 3rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(56, 189, 248, 0.08) 0%, rgba(99, 102, 241, 0.08) 100%);
    border: 1px solid var(--fd-cyan-border);
    border-radius: var(--fd-radius-lg);
    display: flex;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.fd-cta-box h3 {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
}

.fd-cta-box p {
    margin: 0;
    color: var(--text-secondary, #cbd5e1);
    line-height: 1.6;
}

.fd-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: var(--fd-cyan-primary);
    color: #0a0d12;
    font-weight: 700;
    border-radius: var(--fd-radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
    max-width: 100%;
    box-sizing: border-box;
    word-break: break-word;
}

.fd-cta-btn:hover {
    background: var(--fd-cyan-bright);
    box-shadow: 0 0 20px rgba(56, 189, 248, 0.4);
    color: #0a0d12;
}

/* Guide Index Hero & Grid */
.fd-guides-hero {
    text-align: center;
    padding: 3.5rem 1rem 2.5rem;
    max-width: 800px;
    margin: 0 auto;
    box-sizing: border-box;
}

.fd-guides-hero-title {
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 800;
    color: #ffffff;
    margin: 0 0 1rem;
    line-height: 1.2;
}

.fd-guides-hero-desc {
    font-size: clamp(1.05rem, 2vw, 1.2rem);
    color: var(--text-secondary, #cbd5e1);
    line-height: 1.6;
    margin: 0;
}

.fd-guides-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 1.5rem;
    margin: 2.5rem 0;
    box-sizing: border-box;
    min-width: 0;
}

@media (max-width: 480px) {
    .fd-guides-grid {
        grid-template-columns: 1fr;
    }
}

.fd-guide-card {
    background: var(--fd-card-surface);
    border: 1px solid var(--fd-border-hairline);
    border-radius: var(--fd-radius-lg);
    padding: 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-decoration: none;
    transition: all 0.2s ease;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.fd-guide-card:hover {
    transform: translateY(-3px);
    border-color: var(--fd-cyan-border-hover);
    box-shadow: var(--fd-shadow-glow);
}

.fd-guide-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.fd-guide-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #ffffff;
    margin: 0.5rem 0 0.75rem;
    line-height: 1.35;
    word-break: break-word;
}

.fd-guide-card-desc {
    font-size: 0.92rem;
    color: var(--text-secondary, #cbd5e1);
    line-height: 1.55;
    margin: 0 0 1.25rem;
    flex-grow: 1;
}

.fd-guide-card-tools {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-bottom: 1.25rem;
}

.fd-guide-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--fd-cyan-primary);
    padding-top: 1rem;
    border-top: 1px solid var(--fd-border-hairline);
    font-weight: 600;
}

.fd-guide-card-arrow {
    transition: transform 0.2s ease;
}

.fd-guide-card:hover .fd-guide-card-arrow {
    transform: translateX(4px);
}

/* Related Guides Section */
.fd-related-section {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--fd-border-hairline);
    box-sizing: border-box;
    max-width: 100%;
    min-width: 0;
}

.fd-related-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 1.25rem;
}

.fd-related-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1rem;
    min-width: 0;
    max-width: 100%;
}

.fd-related-item {
    display: block;
    padding: 1rem 1.25rem;
    background: var(--fd-card-surface);
    border: 1px solid var(--fd-border-hairline);
    border-radius: var(--fd-radius-md);
    text-decoration: none;
    transition: all 0.15s ease;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
}

.fd-related-item:hover {
    border-color: var(--fd-cyan-border);
    background: var(--fd-card-surface-hover);
}

.fd-related-item-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.25rem;
    line-height: 1.4;
    word-break: break-word;
}

.fd-related-item-desc {
    font-size: 0.8rem;
    color: var(--text-tertiary, #94a3b8);
    word-break: break-word;
}
