/* ================================================================================
   HELP.CSS - The Help list and the guide screen
   Scoped to #helpOverlay and #helpGuideOverlay. Rules shared in look are
   written out under each id on purpose: the two screens can drift apart
   without one silently restyling the other.

   Both screens are sized to fit a phone without scrolling (an iPhone SE,
   375 x 667, is the smallest checked). The bodies keep overflow-y: auto
   only as a safety net for very large text settings.

   Both sit on their own layer (--z-overlay-help in base.css), above every
   other screen, so where help.html falls in the page doesn't matter.
   ================================================================================ */

/* ================================
   HELP LIST
   ================================ */
#helpOverlay {
    flex-direction: column;
    overflow: hidden;
    z-index: var(--z-overlay-help);
}

#helpOverlay .help-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#helpOverlay .help-header {
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
    flex-shrink: 0;
}

#helpOverlay .help-title {
    font-size: var(--text-2xl);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

#helpOverlay .help-subtitle {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin: var(--space-xxs) 0 0;
}

/* A very short phone (360 x 640) is a few pixels shy with the Start here
   tile and a highlighted row both showing. The subtitle is the one thing
   on the screen nobody needs. */
@media (max-height: 650px) {
    #helpOverlay .help-subtitle {
        display: none;
    }
}

#helpOverlay .help-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-xs) var(--space-md) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

/* Start here - the one full-width tile, on the brand gradient so it reads
   as the place to begin rather than an eleventh guide. */
#helpOverlay .help-lead {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    width: 100%;
    min-height: 56px;
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--primary-gradient-simple);
    border: none;
    border-radius: var(--radius-lg);
    box-shadow: 0 4px 16px var(--shadow-purple);
    color: var(--white);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform var(--transition-fast);
}

#helpOverlay .help-lead:active {
    transform: scale(0.98);
}

#helpOverlay .help-lead-icon {
    font-size: var(--text-xl);
    line-height: 1;
    flex-shrink: 0;
}

#helpOverlay .help-lead-text {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

#helpOverlay .help-lead-title {
    font-size: var(--text-md);
    font-weight: 800;
    line-height: 1.25;
}

#helpOverlay .help-lead-sub {
    font-size: var(--text-xs);
    line-height: 1.3;
    opacity: 0.9;
}

#helpOverlay .help-lead-go {
    font-size: var(--text-lg);
    font-weight: 700;
    flex-shrink: 0;
}

/* "Highlighted: guides for the venue page" - the dot matches the
   highlighted tiles' outline, so the note explains them at a glance. */
#helpOverlay .help-here-note {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    margin: 0 var(--space-xxs);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-purple);
}

#helpOverlay .help-here-dot {
    width: 10px;
    height: 10px;
    flex-shrink: 0;
    border-radius: var(--radius-circle);
    background: var(--bg-purple);
    border: 2px solid var(--border-purple);
}

/* The grid - always two across. An odd tile out stretches across the
   last row, so the grid never ends lopsided. */
#helpOverlay .help-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-sm);
}

#helpOverlay .help-tile {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    min-height: 56px;
    padding: var(--space-sm) var(--space-md) var(--space-sm) var(--space-sm);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xs);
    color: var(--text-primary);
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: transform var(--transition-fast), border-color var(--transition-fast);
}

#helpOverlay .help-tile:last-child:nth-child(odd) {
    grid-column: 1 / -1;
}

#helpOverlay .help-tile:active {
    transform: scale(0.98);
    border-color: var(--border-purple);
}

#helpOverlay .help-tile-here {
    background: var(--bg-elevated-card);
    border: 2px solid var(--border-purple);
}

#helpOverlay .help-tile-title {
    font-size: var(--text-sm);
    font-weight: 700;
    line-height: 1.25;
}

#helpOverlay .help-icon {
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    border-radius: var(--radius-circle);
    background: var(--bg-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-md);
    line-height: 1;
}

#helpOverlay .help-icon-brand {
    background: var(--primary-gradient-simple);
}

/* Still stuck? */
#helpOverlay .help-contact {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    width: 100%;
    min-height: 48px;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-purple);
    border: 1px solid var(--border-purple);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-family: inherit;
    font-size: var(--text-sm);
    text-align: left;
    cursor: pointer;
}

#helpOverlay .help-contact-sub {
    color: var(--text-secondary);
}

#helpOverlay .help-contact-go {
    color: var(--text-link);
    font-weight: 700;
    white-space: nowrap;
}

/* ================================
   ONE GUIDE
   ================================ */
#helpGuideOverlay {
    flex-direction: column;
    overflow: hidden;
    z-index: var(--z-overlay-help);
}

#helpGuideOverlay .help-guide-shell {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

#helpGuideOverlay .help-guide-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--space-lg) var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

#helpGuideOverlay .help-guide-head {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

#helpGuideOverlay .help-guide-icon {
    width: 42px;
    height: 42px;
    flex-shrink: 0;
    border-radius: var(--radius-circle);
    background: var(--bg-purple);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: var(--text-xl);
    line-height: 1;
}

#helpGuideOverlay .help-guide-icon-brand {
    background: var(--primary-gradient-simple);
}

#helpGuideOverlay .help-guide-title {
    font-size: var(--text-xl);
    font-weight: 800;
    color: var(--text-primary);
    margin: 0;
    line-height: 1.2;
}

#helpGuideOverlay .help-guide-time {
    font-size: var(--text-xs);
    color: var(--text-muted);
    margin: var(--space-xxs) 0 0;
}

/* Capped so a screenshot never pushes the page into scrolling. */
#helpGuideOverlay .help-guide-shot {
    margin: 0;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    background: var(--bg-card);
    overflow: hidden;
}

#helpGuideOverlay .help-guide-shot img {
    display: block;
    width: 100%;
    max-height: 160px;
    object-fit: contain;
}

/* Steps */
#helpGuideOverlay .help-steps {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

#helpGuideOverlay .help-step {
    display: flex;
    align-items: flex-start;
    gap: var(--space-md);
}

#helpGuideOverlay .help-step-n {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    border-radius: var(--radius-circle);
    background: var(--primary-gradient-simple);
    color: var(--white);
    font-size: var(--text-xs);
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
}

#helpGuideOverlay .help-step-text {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.45;
    padding-top: 2px;
}

#helpGuideOverlay .help-step-text b {
    color: var(--text-primary);
}

#helpGuideOverlay .help-guide-tip {
    margin: 0;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-purple);
    border: 1px solid var(--border-purple);
    border-radius: var(--radius-md);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    line-height: 1.4;
}

#helpGuideOverlay .help-guide-tip b {
    color: var(--text-primary);
}

/* Related guides - one wrapping row of pills */
#helpGuideOverlay .help-related {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--space-sm);
}

#helpGuideOverlay .help-related-label {
    font-size: var(--text-xs);
    font-weight: 700;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    color: var(--text-muted);
}

#helpGuideOverlay .help-related-link {
    min-height: 34px;
    padding: 0 var(--space-md);
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-pill);
    color: var(--text-link);
    font-family: inherit;
    font-size: var(--text-xs);
    font-weight: 600;
    cursor: pointer;
}

#helpGuideOverlay .help-guide-missing {
    color: var(--text-secondary);
    margin: 0;
}

/* Do it now - pinned above the bottom nav, outside the scroll */
#helpGuideOverlay .help-guide-footer {
    flex-shrink: 0;
    padding: var(--space-sm) var(--space-lg) var(--space-md);
    border-top: 1px solid var(--border-light);
    background: var(--bg-home-page);
}

#helpGuideOverlay .help-guide-footer[hidden] {
    display: none;
}

#helpGuideOverlay .help-do-it {
    width: 100%;
    min-height: 48px;
    border: none;
    border-radius: var(--radius-md);
    background: var(--primary-gradient-simple);
    color: var(--white);
    font-family: inherit;
    font-size: var(--text-md);
    font-weight: 700;
    box-shadow: 0 4px 16px var(--shadow-purple);
    cursor: pointer;
}

#helpGuideOverlay .help-do-it:active {
    transform: scale(0.98);
}
