/* Chipp support agent — fullscreen overlay (pages with slug "agent").
 * Enqueued by inc/chipp-agent-fullscreen.php.
 * NOTE: theme sets html{font-size:62.5%} so 1rem=10px. Use px/vh, never rem.
 */

/* ── Overlay shell ────────────────────────────────────────────────────────── */

.chipp-agent-overlay {
    position: fixed;
    inset: 0;               /* top/right/bottom/left: 0 */
    z-index: 10001;         /* above .full-screen-menu (z-index: 10000) */
    display: flex;
    flex-direction: column;
    background: #fff;
}

/* ── Top bar ──────────────────────────────────────────────────────────────── */

.chipp-agent-bar {
    background: #004789;    /* matches #page-site-name */
    flex-shrink: 0;
}

/* Inner wrapper constrains content width to match the chatbot's own layout,
 * so the Back button and logo align with the chatbot's left/right edges rather
 * than floating to the physical screen edges on wide monitors.
 * Tune max-width to match the chatbot column width (currently ~960px). */
.chipp-agent-bar-inner {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    min-height: 44px;
    height: auto;           /* grows if the title wraps on narrow screens */
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

/* Back button — upper-left */
.chipp-agent-back,
.chipp-agent-back:visited {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    white-space: nowrap;
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    gap: 6px;
    text-decoration: none;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, 0.5);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.12);
    transition: background 0.15s, border-color 0.15s;
}

.chipp-agent-back:hover,
.chipp-agent-back:focus {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.8);
    color: #fff;
    text-decoration: none;
}

.chipp-agent-back:focus-visible {
    outline: 3px solid #fff;
    outline-offset: 3px;
}

.chipp-agent-back:active {
    background: rgba(255, 255, 255, 0.35);
    border-color: rgba(255, 255, 255, 1);
}

/* Title — centred in remaining space; wraps rather than truncating */
.chipp-agent-title {
    flex: 1;
    min-width: 0;           /* allow flex item to shrink below content size */
    text-align: center;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    word-wrap: break-word;
}

/* SIL logo — right side, balances the Back button on the left */
.chipp-agent-logo {
    flex-shrink: 0;
    height: 26px;           /* fits the 44px bar without making it taller */
    width: auto;
    display: block;
}

/* ── iframe ───────────────────────────────────────────────────────────────── */

.chipp-agent-iframe {
    flex: 1;
    width: 100%;
    border: none;
    display: block;
}
