/**
 * Guide pages — long-form evergreen educational content.
 *
 * Used by the standalone "How to Play Texas Hold'em" page (templates/guide_holdem.html).
 * Article typography (.dl-*) follows .claude/rules/content-standards.md.
 *
 * Colors come from the app's design tokens (base/variables.css) so the page
 * reads as native All-In Poker Tool, not a generic article. Deep-navy surfaces
 * (--bg-card), indigo borders (--border), magenta accent (--accent).
 *
 * Position diagrams reuse components/poker-table.css + the shared renderer;
 * nothing table-specific is redefined here, only the embed wrapper.
 */

/* ============================================================
   Layout shell
   ============================================================ */
.guide-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 2.25rem 1.25rem 4rem;
}

/* ============================================================
   Hero
   ============================================================ */
.guide-hero {
    margin-bottom: 1.5rem;
}

.dl-h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    font-weight: 800;
    color: var(--text);
    margin: 0 0 0.75rem;
    letter-spacing: -0.01em;
}

.dl-lead {
    font-size: 0.95rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin: 0 0 1rem;
}

.dl-byline {
    font-size: 0.78rem;
    color: var(--text-muted);
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.dl-byline .dl-dot {
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    display: inline-block;
    opacity: 0.6;
}

/* ============================================================
   Skip banner — quick "jump past the basics" controls
   ============================================================ */
.guide-skip {
    background: rgba(var(--accent-rgb), 0.07);
    border: 1px solid rgba(var(--accent-rgb), 0.25);
    border-radius: 12px;
    padding: 1rem 1.1rem;
    margin: 0 0 1.75rem;
}

.guide-skip-label {
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--accent);
    margin-bottom: 0.6rem;
}

.guide-skip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.guide-skip-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 13px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.guide-skip-btn:hover {
    background: rgba(var(--accent-rgb), 0.14);
    border-color: var(--accent);
    color: #fff;
}

/* ============================================================
   Table of contents — sticky progress rail
   ============================================================ */
.guide-toc {
    position: sticky;
    top: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 0.9rem 1rem;
    margin-bottom: 2rem;
    z-index: 5;
}

.guide-toc-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.6rem;
}

.guide-toc-list {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.guide-toc-link {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.4rem 0.5rem;
    border-radius: 7px;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.15s;
}

.guide-toc-link:hover {
    background: rgba(255,255,255,0.04);
    color: var(--text);
}

.guide-toc-link.active {
    background: rgba(var(--accent-rgb), 0.12);
    color: #fff;
    font-weight: 600;
}

.guide-toc-num {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
}

.guide-toc-link.active .guide-toc-num {
    background: var(--accent);
    color: #fff;
}

.guide-toc-toggle {
    display: none;
}

/* ============================================================
   Sections
   ============================================================ */
.guide-section {
    padding: 1.75rem 0;
    border-bottom: 1px solid var(--border);
    scroll-margin-top: 16px;
}

.guide-section:last-of-type {
    border-bottom: none;
}

.dl-h2 {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text);
    margin: 0 0 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}

.dl-h2 .dl-h2-num {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 7px;
    background: rgba(var(--accent-rgb), 0.14);
    color: var(--accent);
    font-size: 0.8rem;
    font-weight: 800;
}

.dl-h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin: 1.5rem 0 0.6rem;
}

.dl-body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-muted);
    margin: 0 0 0.9rem;
}

.dl-body strong {
    color: var(--text);
    font-weight: 700;
}

.dl-body a {
    color: var(--accent);
    text-decoration: none;
    border-bottom: 1px solid rgba(var(--accent-rgb), 0.4);
}

.dl-body a:hover {
    border-bottom-color: var(--accent);
}

/* Plain bullet list inside body copy */
.dl-list {
    margin: 0 0 1rem;
    padding-left: 1.1rem;
    list-style: none;
}

.dl-list li {
    position: relative;
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    padding-left: 0.4rem;
}

.dl-list li::before {
    content: '';
    position: absolute;
    left: -0.7rem;
    top: 0.62em;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--accent);
}

.dl-list li strong {
    color: var(--text);
}

/* ============================================================
   Poker-table diagram embed
   ============================================================ */
.guide-diagram {
    margin: 1.5rem 0;
}

.guide-table-embed {
    display: flex;
    justify-content: center;
    padding: 0.5rem 0 0.25rem;
}

.guide-table-embed .poker-table-container {
    max-width: 440px;
    width: 100%;
}

.guide-diagram-caption {
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
    text-align: center;
    margin-top: 0.6rem;
    padding: 0 0.5rem;
}

.guide-diagram-caption strong {
    color: var(--text);
}

/* ============================================================
   Position legend (category cards — pill badges, NOT left borders)
   ============================================================ */
.guide-pos-legend {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin: 1.25rem 0;
}

.guide-pos-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.85rem 0.9rem;
}

.guide-pos-badge {
    display: inline-block;
    font-size: 0.64rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 3px 9px;
    border-radius: 999px;
    margin-bottom: 0.5rem;
}

.guide-pos-badge.badge-ep    { background: rgba(var(--error-light-rgb), 0.14);     color: var(--error-light); }
.guide-pos-badge.badge-mp    { background: rgba(var(--warning-alt-rgb), 0.14);     color: var(--warning-alt); }
.guide-pos-badge.badge-lp    { background: rgba(var(--success-rgb), 0.14);         color: var(--success); }
.guide-pos-badge.badge-blind { background: rgba(41,121,255, 0.14);                 color: var(--label-street); }

.guide-pos-seats {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.35rem;
    letter-spacing: 0.02em;
}

.guide-pos-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

/* ============================================================
   Hand-ranking ladder — uniform horizontal rows
   ============================================================ */
.guide-ranks {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1.25rem 0;
}

.guide-rank {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.7rem 0.85rem;
}

.guide-rank-num {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    background: var(--bg-dark);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
}

.guide-rank-cards {
    flex-shrink: 0;
    display: flex;
    gap: 3px;
    --card-width: 28px;
    --card-height: 38px;
    --card-font: 11px;
}

/* info fills the rest of the row so every entry aligns identically */
.guide-rank-info {
    flex: 1 1 auto;
    min-width: 0;
}

.guide-rank-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
}

.guide-rank-desc {
    font-size: 0.76rem;
    line-height: 1.4;
    color: var(--text-muted);
}

/* ============================================================
   Inline card sizes for prose
   ============================================================ */
/* Medium inline group (board displays) */
.guide-cards {
    display: inline-flex;
    gap: 4px;
    vertical-align: middle;
    --card-width: 34px;
    --card-height: 44px;
    --card-font: 13px;
}

/* Board display row (centered, medium) used in showdown. Block-level so cards
   never sit inside a wrapping sentence (which stretches that line taller). */
.guide-board {
    display: flex;
    justify-content: center;
    gap: 5px;
    margin: 1rem 0;
    --card-width: 44px;
    --card-height: 57px;
    --card-font: 17px;
}

/* Matchup rows — present each player's hole cards on their own aligned line
   instead of inline in prose. Keeps every text line the same height. */
.guide-matchup {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin: 1rem 0;
}

.guide-matchup-row {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
}

.guide-matchup-who {
    flex-shrink: 0;
    width: 78px;
    font-size: 0.78rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
}

.guide-matchup-cards {
    flex-shrink: 0;
    display: inline-flex;
    gap: 3px;
    --card-width: 30px;
    --card-height: 40px;
    --card-font: 12px;
}

.guide-matchup-hand {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
}

/* ============================================================
   Action glossary chips (check / bet / call / raise / fold / all-in)
   ============================================================ */
.guide-actions-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
    margin: 1.25rem 0;
}

.guide-action {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.75rem 0.85rem;
}

.guide-action-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.guide-action-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    flex-shrink: 0;
}

.guide-action-dot.dot-check { background: var(--action-check); }
.guide-action-dot.dot-call  { background: var(--action-call); }
.guide-action-dot.dot-bet   { background: var(--warning-alt); }
.guide-action-dot.dot-fold  { background: var(--action-fold); }
.guide-action-dot.dot-allin { background: var(--error); }

.guide-action-desc {
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--text-muted);
}

/* ============================================================
   Street chapters (preflop / flop / turn / river) — pill labels
   ============================================================ */
.dl-chapter {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.dl-chapter:last-child {
    border-bottom: none;
}

.dl-chapter-label {
    display: inline-block;
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 3px 10px;
    border-radius: 999px;
    margin-bottom: 0.7rem;
}

.dl-chapter-preflop  .dl-chapter-label { background: rgba(255,64,128,0.14); color: #ff4080; }
.dl-chapter-flop     .dl-chapter-label { background: rgba(255,202,40,0.14); color: #ffca28; }
.dl-chapter-turn     .dl-chapter-label { background: rgba(255,160,0,0.14);  color: #ffa000; }
.dl-chapter-river    .dl-chapter-label { background: rgba(255,82,82,0.14);  color: #ff5252; }
.dl-chapter-showdown .dl-chapter-label { background: rgba(0,230,118,0.14);  color: #00e676; }

.dl-chapter-h {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 0.5rem;
}

.dl-chapter-body {
    font-size: 0.9rem;
    line-height: 1.65;
    color: var(--text-muted);
}

.dl-chapter-body strong { color: var(--text); }

.dl-chapter-cards {
    display: flex;
    gap: 5px;
    margin: 0.6rem 0 0.8rem;
    --card-width: 42px;
    --card-height: 54px;
    --card-font: 16px;
}

/* ============================================================
   Inline quiz / self-check
   ============================================================ */
.guide-quiz {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.1rem 1.15rem;
    margin: 1.5rem 0;
}

.guide-quiz-tag {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--accent);
    margin-bottom: 0.5rem;
}

.guide-quiz-q {
    font-size: 0.92rem;
    font-weight: 600;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 0.85rem;
}

.guide-quiz-opts {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.guide-quiz-opt {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    width: 100%;
    text-align: left;
    padding: 0.7rem 0.85rem;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    border-radius: 9px;
    color: var(--text);
    font-size: 0.86rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}

.guide-quiz-opt:hover:not(:disabled) {
    border-color: rgba(var(--accent-rgb), 0.5);
    background: rgba(var(--accent-rgb), 0.05);
}

.guide-quiz-opt:disabled {
    cursor: default;
}

.guide-quiz-marker {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-card);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
}

.guide-quiz-opt.correct {
    background: rgba(var(--success-rgb), 0.12);
    border-color: var(--success);
    color: #fff;
}

.guide-quiz-opt.correct .guide-quiz-marker {
    background: var(--success);
    border-color: var(--success);
    color: var(--bg-dark);
}

.guide-quiz-opt.incorrect {
    background: rgba(var(--error-rgb), 0.1);
    border-color: var(--error);
    color: var(--error-light);
}

.guide-quiz-opt.incorrect .guide-quiz-marker {
    background: var(--error);
    border-color: var(--error);
    color: #fff;
}

.guide-quiz-feedback {
    margin-top: 0.85rem;
    padding: 0.75rem 0.85rem;
    border-radius: 9px;
    font-size: 0.83rem;
    line-height: 1.55;
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: none;
}

.guide-quiz-feedback.show {
    display: block;
}

.guide-quiz-feedback strong {
    color: var(--text);
}

.guide-quiz.answered-correct .guide-quiz-feedback {
    border-color: rgba(var(--success-rgb), 0.4);
}

/* ============================================================
   Extended optional quiz bank (collapsible)
   ============================================================ */
.guide-quizbank {
    margin: 1.25rem 0 0.5rem;
}

.guide-quizbank-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 0.75rem;
    padding: 1rem 1.15rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: border-color 0.15s;
}

.guide-quizbank-toggle:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
}

.guide-quizbank-toggle-main {
    min-width: 0;
}

.guide-quizbank-toggle-title {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}

.guide-quizbank-toggle-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

.guide-quizbank-chevron {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.guide-quizbank.open .guide-quizbank-chevron {
    transform: rotate(180deg);
}

.guide-quizbank-body {
    display: none;
    margin-top: 0.25rem;
}

.guide-quizbank.open .guide-quizbank-body {
    display: block;
}

.guide-quizbank-progress {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin: 1rem 0 0.25rem;
    font-weight: 600;
}

.guide-quizbank-progress strong {
    color: var(--success);
}

/* ============================================================
   Callout / note box
   ============================================================ */
.guide-note {
    display: flex;
    gap: 0.7rem;
    background: rgba(41,121,255,0.08);
    border: 1px solid rgba(41,121,255,0.28);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    margin: 1.25rem 0;
}

.guide-note-icon {
    flex-shrink: 0;
    color: var(--label-street);
    width: 18px;
    height: 18px;
    margin-top: 1px;
}

.guide-note-body {
    font-size: 0.85rem;
    line-height: 1.55;
    color: var(--text);
}

.guide-note-body strong { color: #fff; }

.guide-note-body a {
    color: var(--label-street);
    text-decoration: none;
    border-bottom: 1px solid rgba(130,177,255,0.4);
}

.guide-note-body a:hover {
    border-bottom-color: var(--label-street);
}

/* ============================================================
   Key takeaways
   ============================================================ */
.dl-takeaways {
    background: rgba(var(--success-rgb), 0.07);
    border: 1px solid rgba(var(--success-rgb), 0.28);
    border-radius: 12px;
    padding: 1.1rem 1.2rem;
    margin: 2rem 0 1.5rem;
}

.dl-takeaways-label {
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--success);
    margin-bottom: 0.75rem;
}

.dl-takeaway {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.88rem;
    line-height: 1.5;
    color: var(--text);
    margin-bottom: 0.6rem;
}

.dl-takeaway:last-child { margin-bottom: 0; }

.dl-takeaway::before {
    content: '';
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    margin-top: 1px;
    border-radius: 50%;
    background: rgba(var(--success-rgb), 0.16) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2300e676' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 11px no-repeat;
}

/* ============================================================
   Closing CTA
   ============================================================ */
.guide-cta {
    text-align: center;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.75rem 1.25rem;
    margin-top: 2rem;
}

.guide-cta-h {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.guide-cta-p {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin-bottom: 1.25rem;
}

.guide-cta-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: center;
}

.guide-cta-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0.6rem 1.1rem;
    border-radius: 9px;
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
}

.guide-cta-btn-primary {
    background: var(--accent);
    color: #fff;
}

.guide-cta-btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-1px);
}

.guide-cta-btn-ghost {
    background: var(--bg-dark);
    border: 1px solid var(--border);
    color: var(--text);
}

.guide-cta-btn-ghost:hover {
    border-color: rgba(var(--accent-rgb), 0.5);
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 640px) {
    .guide-wrap {
        padding: 1.5rem 1rem 3rem;
    }

    .dl-h1 { font-size: 1.5rem; }

    .guide-pos-legend,
    .guide-actions-grid {
        grid-template-columns: 1fr;
    }

    /* Hand-rank rows stay horizontal and uniform; shrink the cards a touch */
    .guide-rank-cards {
        --card-width: 24px;
        --card-height: 33px;
        --card-font: 9px;
        gap: 2px;
    }

    .guide-board {
        --card-width: 38px;
        --card-height: 49px;
        --card-font: 15px;
    }

    /* Collapse the TOC behind a toggle on small screens */
    .guide-toc-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: none;
        border: none;
        padding: 0;
        cursor: pointer;
        color: var(--text-muted);
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        font-family: inherit;
    }

    .guide-toc-toggle svg {
        width: 16px;
        height: 16px;
        transition: transform 0.2s;
    }

    .guide-toc.collapsed .guide-toc-toggle svg {
        transform: rotate(-90deg);
    }

    .guide-toc-title {
        display: none;
    }

    .guide-toc-list {
        margin-top: 0.6rem;
    }

    .guide-toc.collapsed .guide-toc-list {
        display: none;
    }
}
