/* =====================
   GUIDE PAGE
   ===================== */

/* Overall page shell: centers the guide content and keeps the layout readable on wide screens. */
.guide-layout {
    width: min(100%, 70rem);
    margin: 0 auto;
    padding: 0 5%;
    box-sizing: border-box;
    overflow-x: hidden;
}

body.guide-view .content {
    padding-bottom: 0;
}

/* Hero section: intro headline and short summary at the top of the guide. */
.guide-hero {
    display: grid;
    gap: 0.85rem;
    margin: 0 auto 1.2rem;
    max-width: 52rem;
    width: min(100%, 52rem);
}

.guide-kicker {
    color: var(--accent-soft);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.guide-hero h2 {
    margin: 0;
    font-size: clamp(1.9rem, 1.55rem + 1.3vw, 2.8rem);
    line-height: 1.08;
    color: var(--text-primary);
}

.guide-hero p {
    margin: 0;
    max-width: 48rem;
    color: var(--text-secondary);
    font-size: clamp(1rem, 0.96rem + 0.22vw, 1.08rem);
    line-height: 1.65;
}

.guide-flow {
    display: grid;
    gap: 1.1rem;
    max-width: 52rem;
    margin: 0 auto;
    padding-top: 0.5rem;
    padding-bottom: 1.5rem;
}

/* Individual guide blocks: each step is styled as a card with subtle surface and border treatment. */
.guide-section {
    position: relative;
    padding: 1.1rem 1.5rem 1.35rem;
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--border-default);
    border-radius: 8px;
    isolation: isolate;
    box-shadow:
        inset 0 1px 0 var(--border-subtle),
        0 2px 4px rgba(0, 0, 0, 0.12),
        0 8px 20px rgba(0, 0, 0, 0.25);
    transition: box-shadow 0.25s ease;
}

.guide-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--bg-surface);
    z-index: -1;
}

.guide-section:hover {
    border-color: var(--border-strong);
}

.guide-section-full {
    padding: 1.1rem 1.5rem 1.35rem;
}

.guide-section h3 {
    margin: 0 0 0.45rem;
    color: var(--accent-soft);
    font-size: 1rem;
    letter-spacing: 0.02em;
}

.guide-section p,
.guide-section li {
    color: var(--text-secondary);
    line-height: 1.75;
}

.guide-section p {
    margin: 0;
}

.guide-section ul {
    margin: 0;
    padding-left: 0;
}

.guide-note {
    margin: 0.6rem 0 0;
    padding: 0.5rem 0.72rem;
    background: var(--accent-bg);
    border-left: 3px solid var(--accent-border);
    border-radius: 0 6px 6px 0;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.55;
}

.guide-code {
    display: block;
    margin-top: 0.7rem;
    padding: 0.65rem 0.85rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--border-strong);
    border-radius: 8px;
    font-family: "SF Mono", "Fira Code", "Fira Mono", "Roboto Mono", monospace;
    font-size: 0.82rem;
    color: var(--text-primary);
    line-height: 1.7;
    white-space: pre-wrap;
    word-break: break-all;
    overflow-x: auto;
}

/* Action lists and signal examples: compact inline modules for steps, badges, and intervals. */
.guide-action-list {
    list-style: none;
    padding: 0.6rem 0;
    margin: 0.65rem 0 0;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.guide-action-list li {
    padding: 0.32rem 0.6rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    border-radius: 7px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.guide-signal-row {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-top: 0.7rem;
}

.guide-signal-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.4rem 0.7rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    font-size: 0.84rem;
    color: var(--text-secondary);
}

.guide-interval-row {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-top: 0.7rem;
}

.guide-interval-chip {
    padding: 0.25em 0.7em;
    background: var(--bg-hover);
    border: 1px solid var(--border-strong);
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-primary);
    letter-spacing: 0.03em;
}

/* Metric table: explains each dashboard value in a readable comparison layout. */
.guide-metric-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-top: 0.7rem;
}

.guide-metric-table {
    width: 100%;
    min-width: 480px;
    border-collapse: collapse;
    font-size: 0.83rem;
}

.guide-metric-table th,
.guide-metric-table td {
    padding: 0.45rem 0.6rem;
    text-align: left;
    border-bottom: 1px solid var(--border-strong);
}

.guide-metric-table th {
    color: var(--accent-soft);
    font-weight: 600;
    letter-spacing: 0.03em;
}

.guide-metric-table td {
    color: var(--text-secondary);
    vertical-align: top;
    white-space: normal;
    word-break: break-word;
}

.guide-metric-table td:first-child {
    color: var(--text-primary);
    white-space: nowrap;
    font-weight: 500;
}

.guide-metric-table td:last-child {
    color: var(--text-muted);
    white-space: nowrap;
}

.guide-rating-intro {
    display: block;
    margin-bottom: 0.35rem;
}

.guide-rating-scale {
    display: grid;
    gap: 0.18rem;
    color: var(--text-muted);
    font-size: 0.78rem;
}

.guide-rating-scale strong {
    display: inline-block;
    min-width: 8.8rem;
    color: var(--text-secondary);
    font-weight: 600;
}

/* Status badges and score chips: highlight buy/sell state and F-Score categories visually. */
.guide-badge {
    display: inline-block;
    padding: 0.15em 0.5em;
    border-radius: 4px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    line-height: 1.5;
    vertical-align: middle;
}

.guide-badge.buy {
    background: rgba(16, 185, 129, 0.15);
    color: var(--signal-buy);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.guide-badge.sell {
    background: rgba(239, 68, 68, 0.12);
    color: var(--score-poor);
    border: 1px solid rgba(239, 68, 68, 0.25);
}

.guide-badge.neutral {
    background: var(--bg-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border-strong);
}

.guide-fscore-row {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.7rem;
}

.guide-fscore-pip {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border-radius: 6px;
    font-size: 0.82rem;
    font-weight: 700;
    border: 1px solid var(--border-strong);
}

.guide-fscore-pip.weak {
    background: rgba(239, 68, 68, 0.15);
    color: var(--score-poor);
}

.guide-fscore-pip.mid {
    background: rgba(179, 179, 179, 0.13);
    color: var(--score-neutral);
}

.guide-fscore-pip.strong {
    background: rgba(16, 185, 129, 0.16);
    color: var(--signal-buy);
}

.guide-score-legend {
    margin-top: 0.55rem;
    font-size: 0.83rem;
    color: var(--text-secondary);
}

.guide-score-legend .weak {
    color: var(--score-poor);
}

.guide-score-legend .mid {
    color: var(--score-neutral);
}

.guide-score-legend .strong {
    color: var(--signal-buy);
}

.guide-fscore-criteria {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 0.5rem;
    margin: 0.5rem 0 0.6rem;
}

.guide-fscore-group {
    display: flex;
    flex-direction: column;
    gap: 0.18rem;
    padding: 0.4rem 0.5rem;
    background: var(--bg-hover);
    border: 1px solid var(--border-default);
    border-radius: 8px;
    font-size: 0.75rem;
    color: var(--text-secondary);
}

.guide-fscore-group span {
    white-space: normal;
}

.guide-fscore-label {
    color: var(--accent-soft);
    font-weight: 600;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 0.2rem;
}

/* Utility spacing helpers: keep text blocks aligned without adding extra markup in the HTML. */
.guide-copy-gap-sm {
    margin-top: 0.55rem;
}

.guide-copy-gap-md {
    margin-top: 0.6rem;
}

.guide-list-gap-sm {
    margin-top: 0.3rem;
}

.guide-list-gap-md {
    margin-top: 0.4rem;
}

/* Responsive behavior: optimize content width and card spacing on tablet/mobile screens. */
@media (max-width: 900px) {
    .guide-flow {
        max-width: 100%;
    }

    .guide-section {
        padding: 1rem 1.15rem 1.2rem;
    }

    .guide-section-full {
        padding: 1rem 1.15rem 1.2rem;
    }

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

@media (max-width: 500px) {
    .guide-layout {
        padding: 0 4%;
    }

    .guide-flow {
        gap: 0.85rem;
    }

    .guide-section {
        padding: 0.9rem 1rem 1.1rem;
    }

    .guide-section p,
    .guide-section li {
        font-size: 0.96rem;
        line-height: 1.65;
    }

    .guide-section ul,
    .guide-action-list {
        padding-left: 0;
        margin-left: 0;
    }

    .guide-section ul li,
    .guide-action-list li {
        padding-left: 0.35rem;
    }

    .guide-signal-item,
    .guide-action-list li {
        word-break: break-word;
    }
}