/**
 * AIWeb Guide — shared styles (guide_public + admin guide).
 * Requires aiweb_render_theme_head() for CSS variables.
 */

.guide-site-header {
    background: var(--card, #fff);
    border-bottom: 1px solid var(--border, #e4e4e7);
}

.guide-site-header-inner {
    max-width: 1180px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.guide-brand-title {
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 18px;
    font-weight: 600;
    color: var(--text, #18181b);
    letter-spacing: var(--tracking-heading, -0.025em);
}

.guide-brand-sub {
    font-size: 12px;
    color: var(--muted, #71717a);
    margin-top: 2px;
}

.guide-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.guide-header-actions .pub-btn {
    width: auto;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
}

.guide-page {
    max-width: 1180px;
    margin: 0 auto;
    padding: var(--space-page, 24px) 24px 48px;
    box-sizing: border-box;
}

.guide-hero {
    margin-bottom: 28px;
}

.guide-hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
}

.guide-hero-title {
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: clamp(1.5rem, 4vw, 2rem);
    font-weight: 700;
    color: var(--text, #18181b);
    margin: 0 0 10px;
    letter-spacing: var(--tracking-heading, -0.025em);
    line-height: 1.25;
}

.guide-hero-desc {
    color: var(--muted, #71717a);
    max-width: 720px;
    font-size: 15px;
    margin: 0;
    line-height: 1.6;
}

.guide-layout {
    display: flex;
    align-items: flex-start;
    gap: 24px;
}

.guide-toc {
    width: 252px;
    flex-shrink: 0;
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}

.guide-toc .guide-card {
    padding: 18px 16px;
    margin-bottom: 0;
}

.guide-toc .guide-section-title {
    font-size: 1rem;
    margin-bottom: 12px;
}

.guide-toc-links {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.guide-toc .toc-link {
    padding: 7px 8px;
    font-size: 13px;
    line-height: 1.35;
}

.guide-main {
    flex: 1;
    min-width: 0;
}

.guide-main .guide-card[id] {
    scroll-margin-top: 20px;
}

.guide-card {
    background: var(--card, #fff);
    border-radius: var(--radius-card, 8px);
    padding: 24px 28px;
    border: 1px solid var(--border, #e4e4e7);
    box-shadow: var(--shadow-card, 0 1px 2px rgba(0, 0, 0, .05));
    margin-bottom: 20px;
}

.guide-section-title {
    font-family: var(--font-sans, system-ui, sans-serif);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text, #18181b);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    letter-spacing: var(--tracking-heading, -0.02em);
}

.guide-section-title i {
    color: var(--accent, #2563eb);
}

.guide-content p {
    margin-bottom: 14px;
    color: var(--muted, #71717a);
    font-size: 15px;
    line-height: 1.65;
}

.guide-video {
    margin: 18px 0 8px;
    max-width: 720px;
}

.guide-video-cap {
    margin: 0 0 8px;
    font-size: 13px;
    font-weight: 650;
    color: var(--text, #18181b);
}

.guide-video-frame {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: var(--radius-card, 14px);
    overflow: hidden;
    background: var(--text, #111);
}

.guide-video-frame iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.guide-step {
    display: flex;
    gap: 14px;
    margin-bottom: 20px;
}

.step-number {
    width: 30px;
    height: 30px;
    background: var(--accent, #2563eb);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    flex-shrink: 0;
}

.step-content h4 {
    font-weight: 600;
    font-size: 16px;
    margin: 0 0 6px;
    color: var(--text, #18181b);
}

.step-content p {
    margin: 0 0 8px;
}

.tip-box {
    background: var(--accent-light, #eff6ff);
    border-left: 4px solid var(--accent, #2563eb);
    padding: 14px 16px;
    border-radius: 0 var(--radius-sm, 6px) var(--radius-sm, 6px) 0;
    margin-top: 14px;
    font-size: 14px;
    color: var(--muted, #71717a);
}

.code-block {
    background: var(--text, #18181b);
    color: var(--border2, #f4f4f5);
    padding: 14px 16px;
    border-radius: var(--radius-sm, 6px);
    font-family: ui-monospace, Consolas, 'Courier New', monospace;
    font-size: 13px;
    margin: 10px 0;
    overflow-x: auto;
    line-height: 1.6;
}

.toc-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    border-radius: var(--radius-sm, 6px);
    color: var(--muted, #71717a);
    text-decoration: none;
    font-size: 14px;
    transition: background .15s ease, color .15s ease;
}

.toc-link:hover {
    background: var(--accent-light, #eff6ff);
    color: var(--accent2, #1d4ed8);
}

.toc-num {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--accent-light, #eff6ff);
    color: var(--accent, #2563eb);
    font-size: 11px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.feature-chip {
    padding: 12px 14px;
    border: 1px solid var(--border, #e4e4e7);
    border-radius: var(--radius-card, 8px);
    background: var(--bg, #fafafa);
    font-size: 13px;
}

.feature-chip strong {
    display: block;
    color: var(--text, #18181b);
    margin-bottom: 4px;
    font-size: 14px;
}

ul.guide-list {
    margin: 8px 0 12px 20px;
    color: var(--muted, #71717a);
    font-size: 15px;
}

ul.guide-list li {
    margin-bottom: 6px;
}

.guide-card code,
.guide-content code {
    background: var(--border2, #f4f4f5);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 13px;
    color: var(--accent2, #1d4ed8);
}

table.guide-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    margin: 12px 0;
}

table.guide-table th,
table.guide-table td {
    border: 1px solid var(--border, #e4e4e7);
    padding: 10px 12px;
    text-align: left;
}

table.guide-table th {
    background: var(--accent-light, #eff6ff);
    color: var(--text, #18181b);
    font-weight: 600;
}

table.guide-table td {
    color: var(--muted, #71717a);
}

.guide-subtitle {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text, #18181b);
    margin: 22px 0 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.guide-subtitle i {
    color: var(--accent, #2563eb);
    font-size: 14px;
}

.flow-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 14px 0 18px;
    padding: 16px;
    background: var(--bg, #fafafa);
    border: 1px dashed var(--border, #e4e4e7);
    border-radius: var(--radius-card, 8px);
}

.flow-box {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius-sm, 6px);
    border: 1px solid var(--border, #e4e4e7);
    background: var(--accent-light, #eff6ff);
    font-size: 13px;
    font-weight: 600;
    color: var(--text, #18181b);
}

.flow-box i {
    color: var(--accent, #2563eb);
}

.flow-arrow {
    color: var(--faint, #a1a1aa);
    font-size: 18px;
    font-weight: 700;
}

.folder-tree {
    font-family: ui-monospace, Consolas, 'Courier New', monospace;
    font-size: 13px;
    background: var(--bg, #fafafa);
    border: 1px solid var(--border, #e4e4e7);
    border-radius: var(--radius-card, 8px);
    padding: 14px 16px;
    margin: 12px 0;
    line-height: 1.7;
    color: var(--muted, #71717a);
}

.folder-tree .active {
    color: var(--accent2, #1d4ed8);
    font-weight: 700;
}

.folder-tree .new {
    color: var(--green, #16a34a);
}

.picto-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
    margin: 12px 0;
}

.picto-card {
    padding: 14px;
    border-radius: var(--radius-card, 8px);
    border: 1px solid var(--border, #e4e4e7);
    background: var(--bg, #fafafa);
    text-align: center;
}

.picto-card i {
    font-size: 28px;
    color: var(--accent, #2563eb);
    margin-bottom: 8px;
    display: block;
}

.picto-card strong {
    display: block;
    font-size: 14px;
    color: var(--text, #18181b);
    margin-bottom: 4px;
}

.picto-card span {
    font-size: 12px;
    color: var(--muted, #71717a);
}

.prompt-card {
    background: var(--card, #fff);
    border: 1px solid var(--accent-border, #bfdbfe);
    border-radius: var(--radius-card, 8px);
    padding: 14px 16px;
    margin: 12px 0;
}

.prompt-label {
    display: block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--accent2, #1d4ed8);
    margin-bottom: 8px;
}

.prompt-text {
    display: block;
    font-size: 14px;
    color: var(--text, #18181b);
    background: transparent;
    padding: 0;
    line-height: 1.5;
    word-break: break-word;
}

.guide-toc-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
    padding: 14px 16px;
    background: var(--card, #fff);
    border: 1px solid var(--border, #e4e4e7);
    border-radius: var(--radius-card, 8px);
    box-shadow: var(--shadow-card, 0 1px 2px rgba(0, 0, 0, .05));
}

.guide-toc-bar a {
    font-size: 13px;
    color: var(--muted, #71717a);
    text-decoration: none;
    padding: 6px 10px;
    border-radius: var(--radius-sm, 6px);
    background: var(--accent-light, #eff6ff);
    transition: color .15s ease;
}

.guide-toc-bar a:hover {
    color: var(--accent2, #1d4ed8);
}

.guide-toc-bar a.guide-toc-bar-external {
    background: var(--card, #fff);
    border: 1px solid var(--border, #e4e4e7);
}

.guide-content a {
    color: var(--accent, #2563eb);
    font-weight: 600;
    text-decoration: none;
}

.guide-content a:hover {
    text-decoration: underline;
}

@media (max-width: 960px) {
    .guide-layout {
        flex-direction: column;
        gap: 20px;
    }

    .guide-toc {
        width: 100%;
        position: static;
        max-height: none;
        overflow: visible;
    }

    .guide-toc-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 4px;
    }

    .guide-page {
        padding: 20px 16px 40px;
    }

    .guide-site-header-inner {
        padding: 14px 16px;
    }

    .guide-card {
        padding: 20px 18px;
    }
}

@media (max-width: 560px) {
    .guide-toc-links {
        grid-template-columns: 1fr;
    }
}
