/* ════════════════════════════════════════════════════════════
   User Guides — Index + Detail pages
   Uses the established gold / dark-blue design tokens from
   site.css (--gold, --bg-deep, --text, etc).
   ════════════════════════════════════════════════════════════ */

/* ── Guides index hero ── (reuses .tagline / .divider / .description from site.css) */
.guides-title {
    font-family: 'Cinzel', serif;
    font-size: 2.4rem;
    font-weight: 700;
    color: var(--text-bright);
    text-align: center;
    line-height: 1.15;
    letter-spacing: 0.01em;
    margin-bottom: 28px;
}

/* ── Empty state (card) ── */
.guides-empty {
    text-align: center;
    padding: 0;
    width: 100%;
    max-width: 480px;
}

.guides-empty-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 48px 32px 40px;
    position: relative;
    overflow: hidden;
    transition: border-color 0.3s ease;
}

.guides-empty-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0.4;
}

.guides-empty-icon {
    margin-bottom: 20px;
    color: var(--text-muted);
    opacity: 0.4;
}

.guides-empty-card h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--gold-bright);
    margin-bottom: 12px;
    letter-spacing: 0.02em;
}

.guides-empty-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}

.guides-empty-cta {
    display: flex;
    justify-content: center;
}

.guides-empty-card a {
    color: var(--gold);
    text-decoration: none;
}

/* ── Category section ── */
.guides-sections {
    width: 100%;
    max-width: 1000px;
}

.guide-category {
    width: 100%;
    margin-bottom: 44px;
}

.guide-category .section-header {
    margin-bottom: 22px;
}

/* ── Guide card grid ── */
/* Capped column width + centred tracks so a single guide sits as an
   intentional, well-proportioned card rather than stretching full width. */
.guide-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 340px));
    justify-content: center;
    gap: 20px;
}

/* ── Individual guide card ── */
.guide-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1),
                background 0.3s ease,
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    position: relative;
}

.guide-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--gold), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.guide-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(255, 255, 255, 0.12);
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
}

.guide-card:hover::before { opacity: 1; }

.guide-card.featured {
    border-color: rgba(201, 168, 76, 0.18);
}

.guide-card-image {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #0c0e14;
}

.guide-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.guide-card:hover .guide-card-image img {
    transform: scale(1.04);
}

.guide-card-body {
    padding: 16px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.guide-card-title {
    font-family: 'Cinzel', serif;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--gold-bright);
    letter-spacing: 0.02em;
    line-height: 1.3;
}

.guide-card-summary {
    font-size: 0.8rem;
    color: var(--silver);
    font-weight: 300;
    line-height: 1.5;
    flex: 1;
}

/* ── "Read guide" affordance ── */
.guide-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    font-family: 'Cinzel', serif;
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--gold-bright);
}

.guide-card-readmore svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.guide-card:hover .guide-card-readmore svg {
    transform: translateX(4px);
}

/* ── Featured ribbon (mirrors the script-card ribbon) ── */
.guide-ribbon {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    font-family: 'Cinzel', serif;
    font-size: 0.55rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--bg-deep);
    background: linear-gradient(135deg, var(--gold-bright), var(--gold));
    padding: 3px 9px;
    border-radius: 999px;
    box-shadow: 0 4px 14px rgba(201, 168, 76, 0.35);
}


/* ════════════════════════════════════════════════════════════
   Guide detail page
   ════════════════════════════════════════════════════════════ */

main.guide-detail-main {
    max-width: 960px;
}

/* ── Detail hero ── */
.guide-detail-hero {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 360px) 1fr;
    gap: 40px;
    align-items: center;
    margin-bottom: 48px;
}

.guide-detail-hero.featured {
    border-color: rgba(201, 168, 76, 0.18);
}

.guide-hero-image {
    border-radius: 14px;
    overflow: hidden;
    background: #0c0e14;
    border: 1px solid var(--border);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45);
}

.guide-hero-image img {
    width: 100%;
    height: auto;
    display: block;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.guide-hero-text {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.guide-hero-text h1 {
    font-family: 'Cinzel', serif;
    font-size: 2rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--text-bright);
    letter-spacing: 0.01em;
}

.guide-hero-summary {
    font-size: 1.05rem;
    color: var(--gold-bright);
    font-weight: 400;
    line-height: 1.5;
    font-style: italic;
}

.guide-hero-meta {
    display: flex;
    gap: 12px;
    align-items: center;
    flex-wrap: wrap;
}

.guide-hero-meta .chip {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 4px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.02);
}

.guide-script-cta {
    margin-top: 6px;
}

/* ── Table of contents ── */
.guide-toc {
    width: 100%;
    margin-bottom: 36px;
}

.guide-toc-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 6px 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.guide-toc-list a {
    display: block;
    padding: 8px 14px;
    border-radius: 8px;
    color: var(--silver);
    font-size: 0.88rem;
    text-decoration: none;
    border-left: 2px solid var(--border);
    transition: all 0.2s ease;
}

.guide-toc-list a:hover {
    color: var(--gold-bright);
    border-left-color: var(--gold);
    background: var(--bg-card);
}

.guide-toc-list a.active {
    color: var(--gold-bright);
    border-left-color: var(--gold);
    background: rgba(201, 168, 76, 0.06);
    font-weight: 500;
}

/* ── Body (rendered markdown) ── */
.guide-body-section {
    width: 100%;
    margin-bottom: 48px;
}

.guide-prose {
    color: var(--text);
    line-height: 1.75;
    font-size: 1rem;
    font-weight: 300;
}

/* Reuse detail-body markdown styles from site.css but also add guide-specific
   image treatments and callout boxes. The detail-body selectors already handle
   h2, h3, p, ul, ol, a, code, table, details, etc. We add image styling here
   for guide-oriented layouts. */

.guide-prose h2 {
    font-family: 'Cinzel', serif;
    font-size: 1.45rem;
    font-weight: 600;
    color: var(--gold-bright);
    margin: 44px 0 18px;
    padding-bottom: 8px;
    letter-spacing: 0.02em;
    background: linear-gradient(90deg, var(--gold) 0%, transparent 60%);
    background-size: 100% 1px;
    background-repeat: no-repeat;
    background-position: 0 100%;
}

.guide-prose h2:first-child {
    margin-top: 0;
}

.guide-prose h3 {
    font-family: 'Cinzel', serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--text-bright);
    margin: 32px 0 12px;
    letter-spacing: 0.02em;
}

.guide-prose p {
    margin-bottom: 18px;
    line-height: 1.75;
}

.guide-prose strong {
    color: var(--text-bright);
    font-weight: 500;
}

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

.guide-prose ul li,
.guide-prose ol li {
    margin-bottom: 6px;
    line-height: 1.6;
}

.guide-prose a {
    color: var(--gold-bright);
    text-decoration: none;
    border-bottom: 1px solid rgba(201, 168, 76, 0.25);
    transition: border-color 0.2s ease;
}

.guide-prose a:hover {
    border-bottom-color: var(--gold-bright);
}

/* Buttons embedded in the prose (e.g. the "Need Help?" Discord CTA) must not
   inherit the prose link underline. */
.guide-prose a.cta,
.guide-prose a.cta:hover {
    border-bottom: 0;
    color: var(--bg-deep);
}

.guide-help-cta {
    display: flex;
    justify-content: flex-start;
    margin: 20px 0 8px;
}

.guide-prose img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    border: 1px solid var(--border);
    margin: 24px 0;
    display: block;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Image captions — from Markdown alt text rendered as <figure><figcaption> */
.guide-prose figure {
    margin: 24px 0;
}

.guide-prose figure img {
    margin: 0 0 8px;
}

.guide-prose figcaption {
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
    font-style: italic;
}

.guide-prose code {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.88em;
    background: rgba(255, 255, 255, 0.04);
    padding: 2px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    color: var(--gold-light);
}

.guide-prose pre {
    background: #0c0e14;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 18px 20px;
    overflow-x: auto;
    margin: 24px 0;
}

.guide-prose pre code {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.88rem;
    line-height: 1.6;
    color: var(--text);
}

/* ── Callout box (admonition) ──
   Rendered from <blockquote>, styled as a gold-bordered tip box. */
.guide-prose blockquote {
    margin: 24px 0;
    padding: 18px 20px;
    border-left: 3px solid var(--gold);
    background: rgba(201, 168, 76, 0.04);
    border-radius: 0 10px 10px 0;
    color: var(--gold-light);
    font-style: italic;
}

.guide-prose blockquote p:last-child {
    margin-bottom: 0;
}

/* ── Tables ── */
.guide-prose table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.92rem;
}

/* Wide tables get a horizontal scroll on small screens instead of overflowing
   the viewport. commonmark emits a bare <table>, so scroll it directly. */
@media (max-width: 600px) {
    .guide-prose table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
        -webkit-overflow-scrolling: touch;
    }
}

.guide-prose thead {
    border-bottom: 1px solid rgba(201, 168, 76, 0.2);
}

.guide-prose th {
    font-family: 'Cinzel', serif;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--gold-bright);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 10px 14px;
    text-align: left;
}

.guide-prose td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.guide-prose tbody tr:hover td {
    color: var(--text-bright);
}

.guide-prose tbody tr:hover {
    background: var(--bg-card);
}

/* ── Empty body ── */
.guide-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.guide-empty a {
    color: var(--gold);
    text-decoration: none;
}

.guide-empty a:hover {
    text-decoration: underline;
}

/* ── CTA section ── */
.guide-cta-section {
    width: 100%;
    margin-bottom: 24px;
}

.guide-cta-buttons {
    display: flex;
    gap: 14px;
    flex-wrap: wrap;
    margin-top: 20px;
    justify-content: center;
}

.guides-cta {
    width: 100%;
    max-width: 500px;
    text-align: center;
    margin: 40px 0 24px;
    color: var(--silver);
}

.guides-cta p {
    font-size: 0.95rem;
    line-height: 1.7;
    margin-bottom: 20px;
    color: var(--text-muted);
}

.guides-cta .guide-cta-buttons {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
}

/* ════════════════════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════════════════════ */

@media (max-width: 720px) {
    .guide-detail-hero {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .guide-hero-image {
        max-width: 100%;
    }

    .guide-hero-text h1 {
        font-size: 1.5rem;
    }

    .guide-card-grid {
        grid-template-columns: 1fr;
    }

    .guides-hero h1 {
        font-size: 1.5rem;
    }
}

@media (max-width: 560px) {
    main.guide-detail-main {
        padding-left: 16px;
        padding-right: 16px;
    }

    .guide-hero-text h1 {
        font-size: 1.3rem;
    }
}
