/* Help portal. Brand colours come from base.html (--brand-slate). */
:root {
    --help-line: #ddd;
    --help-tint: #f5f5f5;
    --help-warn: #b3261e;
}

/* Staff pages carry wide reference tables, so give them more room than
   base.html's 720px member column. */
body.help-staff { max-width: 60rem; }

.guide { line-height: 1.5; }
.guide h2 { margin-top: 2.2rem; border-bottom: 1px solid var(--help-line); padding-bottom: 0.3rem; }
.guide h3 { margin-top: 1.6rem; }
.guide .table-wrap { overflow-x: auto; margin: 0.8rem 0; }
.guide table { border-collapse: collapse; margin: 0; }
.guide th, .guide td { text-align: left; vertical-align: top; padding: 0.35rem 1.2rem 0.35rem 0; border-bottom: 1px solid var(--help-line); }
.guide .warn { color: var(--help-warn); }
.guide dt { font-weight: bold; margin-top: 0.7rem; }
.guide dd { margin-left: 0; margin-bottom: 0.4rem; }
.guide ol li, .guide ul li { margin-bottom: 0.35rem; }
.guide .tip { border-left: 4px solid var(--brand-slate); padding: 0.4rem 0.8rem; margin: 0.8rem 0; background: var(--help-tint); }
.guide .who { display: inline-block; font-size: 0.75rem; font-weight: bold; padding: 0.1rem 0.5rem; border-radius: 10px;
    margin-left: 0.4rem; vertical-align: middle; background: var(--brand-slate); color: #fff; }
.guide .toc { columns: 2 18rem; margin: 0.8rem 0 1.5rem 0; padding-left: 1.2rem; }
.guide .toc ul { margin: 0.2rem 0 0.4rem 0; }
.guide code { font-size: 0.9em; }

/* "Staff help" links between the staff sections, and on the help home page. */
.help-sections { list-style: none; padding: 0; margin: 1rem 0 1.5rem; display: grid; gap: 0.75rem;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.help-sections a { display: block; height: 100%; box-sizing: border-box; padding: 0.75rem 0.9rem; border: 1px solid var(--help-line);
    border-radius: 6px; text-decoration: none; color: inherit; }
.help-sections a:hover, .help-sections a:focus { border-color: var(--brand-slate); }
.help-sections a[aria-current="page"] { border: 2px solid var(--brand-slate); background: var(--help-tint); }
.help-sections strong { display: block; color: var(--brand-slate); }
.help-sections .audience { font-size: 0.8rem; color: #555; }
.help-sections .summary { display: block; font-size: 0.85rem; color: #444; margin-top: 0.25rem; }

/* Contact details that don't exist yet (docs/TODO.md). */
.help-contact { margin: 2rem 0 0; padding: 0.8rem 1rem; border: 1px solid var(--help-line); border-radius: 6px; background: var(--help-tint); }
.help-contact h2 { font-size: 1.05rem; margin: 0 0 0.4rem; border: 0; padding: 0; }
.help-contact p { margin: 0.3rem 0; }
.placeholder { font-style: italic; color: #555; }


/* Section index: list of articles. */
.help-articles { list-style: none; padding: 0; margin: 0.5rem 0 1.2rem; }
.help-articles li { padding: 0.55rem 0; border-bottom: 1px solid var(--help-line); }
.help-articles a { font-weight: bold; }
.help-articles .summary { display: block; font-size: 0.9rem; color: #444; margin-top: 0.15rem; }

/* Article page. */
.article-summary { font-size: 1.05rem; color: #444; margin-top: -0.3rem; }
.help-related { margin: 2rem 0 0; }
.help-related h2 { font-size: 1.05rem; border: 0; margin: 0 0 0.3rem; }
.help-related ul { margin: 0; padding-left: 1.2rem; }
.help-pager { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin: 1.5rem 0 0;
    padding-top: 0.8rem; border-top: 1px solid var(--help-line); }
.help-pager a { text-decoration: none; font-weight: bold; }
.help-pager a[rel="next"] { margin-left: auto; text-align: right; }

/* Game rules: worked examples with number balls. */
.example { border: 1px solid var(--help-line); border-radius: 6px; padding: 0.4rem 0.9rem; margin: 0.6rem 0 1rem; }
.example p { margin: 0.45rem 0; }
.example .label { display: inline-block; min-width: 5.5rem; font-size: 0.85rem; color: #555; }
.ball { display: inline-flex; align-items: center; justify-content: center; min-width: 2.1rem; height: 2.1rem; padding: 0 0.3rem;
    box-sizing: border-box; margin: 0 0.25rem 0.2rem 0; border: 2px solid var(--brand-slate); border-radius: 1.05rem;
    font-weight: bold; color: var(--brand-slate); background: #fff; vertical-align: middle; }
.ball.hit { background: var(--brand-slate); color: #fff; }
.ball.any { border-style: dashed; font-weight: normal; font-size: 0.8rem; }
@media (max-width: 480px) { .example .label { display: block; min-width: 0; } }
.guide .win { color: #1d6b31; }
.guide .lose { color: var(--help-warn); }

/* Screenshots (help_portal/screenshots.py). */
.screenshot { margin: 1rem 0 1.4rem; }
.screenshot img { display: block; max-width: 100%; height: auto; border: 1px solid var(--help-line); border-radius: 4px; }
.screenshot figcaption { font-size: 0.88rem; color: #444; margin-top: 0.35rem; }
.screenshot-placeholder { padding: 0.6rem 1rem; border: 2px dashed var(--help-line); border-radius: 6px; text-align: center;
    color: #555; background: var(--help-tint); font-size: 0.9rem; overflow-wrap: anywhere; }

/* Search box and results. */
.help-search { display: flex; gap: 0.5rem; margin: 0 0 1.2rem; }
.help-search input { flex: 1; max-width: none; padding: 0.55rem 0.7rem; font-size: 1rem; border: 1px solid #999; border-radius: 4px; }
.help-search .btn { font-size: 1rem; padding: 0.55rem 1rem; }
.search-results { list-style: none; padding: 0; }
.search-results li { padding: 0.7rem 0; border-bottom: 1px solid var(--help-line); }
.search-results a { font-weight: bold; }
.search-results .place { display: block; font-size: 0.8rem; color: #555; }
.search-results p { margin: 0.3rem 0 0; font-size: 0.92rem; color: #333; }
.search-results mark { background: #fdf0b8; color: inherit; padding: 0 0.1em; }

/* "On this page" list on longer articles. */
.article-contents { margin: 0.5rem 0 1.4rem; padding: 0.6rem 1rem; border-left: 4px solid var(--help-line); }
.guide .article-contents h2 { font-size: 0.95rem; margin: 0 0 0.3rem; border: 0; padding: 0; }
.article-contents ul { margin: 0; padding-left: 1.2rem; }

@media print {
    header, .breadcrumb, .site-footer, .help-sections, .skip-link, .help-pager, .help-related, .screenshot-missing, .help-search { display: none; }
    .screenshot { page-break-inside: avoid; }
    body.help-staff { max-width: none; }
}
