/* Reddit Font Generator - tool-specific styles. Composes shared
 * primitives in tools.css; only this tool's layout lives here. Sibling of
 * the Pinterest Font Generator's tool.css with a Reddit profile mock
 * (centred avatar, name, handle, About text). */

:root {
    --rfg-accent: #d93a00;
    --rfg-accent-dark: #b33000;
    --rfg-accent-tint: #fff4ef;
    --rfg-near: #d97706;
    --rfg-over: #dc2626;
}

.page-hero h1 .rfg-hero-mark {
    width: 1em;
    height: 1em;
    vertical-align: -0.12em;
    margin-right: 0.4rem;
    color: var(--rfg-accent);
}

/* ---- Inputs ---- */
/* Display name ABOVE the bio (one column) so the bio textarea runs the
 * full card width and needs less height; was a 1fr / 2fr side-by-side
 * grid (operator request, 2026-09-03). */
.rfg-fields { display: grid; grid-template-columns: 1fr; gap: 14px; }
.rfg-field { display: flex; flex-direction: column; min-width: 0; }
.rfg-field-label { display: block; font-weight: 600; font-size: 0.92rem; color: #333; margin-bottom: 6px; }
.rfg-field-opt { font-weight: 400; color: #94a3b8; font-size: 0.82rem; }
.rfg-name-input { width: 100%; max-width: 520px; box-sizing: border-box; flex: 0 0 auto; font-size: 1.05rem; }
.rfg-textarea {
    width: 100%;
    box-sizing: border-box;
    /* .rfg-field is a column flex box: without this the shared .text-input
     * flex-basis (320px) becomes the textarea's HEIGHT. */
    flex: 0 0 auto;
    min-height: 84px;
    resize: vertical;
    line-height: 1.5;
    font-size: 1.05rem;
}
.rfg-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 12px;
}
.rfg-toolbar-hint { font-size: 0.82rem; color: #94a3b8; }

/* ---- Profile preview card ---- */
.rfg-preview-card {
    margin: 18px 0 4px;
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 14px;
    padding: 18px 20px 16px;
}
.rfg-preview-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    margin-bottom: 12px;
}
.rfg-preview-title { margin: 0; font-size: 1rem; font-weight: 700; color: #1f2937; }
.rfg-style-wrap { display: flex; align-items: center; gap: 8px; }
.rfg-style-label { font-size: 0.85rem; color: #475569; font-weight: 600; }
.rfg-style-select {
    font: inherit;
    font-size: 0.9rem;
    padding: 7px 30px 7px 11px;
    border: 1px solid #d7dbe0;
    border-radius: 8px;
    background-color: #fff;
    color: #1f2937;
    cursor: pointer;
    max-width: 100%;
}
.rfg-style-select:focus { outline: 2px solid var(--rfg-accent); border-color: var(--rfg-accent); }

/* The Reddit-style centred profile mock. */
.rfg-mock {
    max-width: 420px;
    background: #fff;
    border: 1px solid #dbdbdb;
    border-radius: 16px;
    padding: 20px 18px 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    text-align: center;
}
.rfg-mock-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 96px;
    height: 96px;
    margin: 0 auto 10px;
    border-radius: 50%;
    background: #efefef;
    color: #8e8e8e;
    padding: 24px;
    box-sizing: border-box;
}
.rfg-mock-avatar svg { width: 100%; height: 100%; }
.rfg-mock-name {
    font-size: 1.35rem;
    font-weight: 700;
    color: #111;
    margin-bottom: 2px;
    word-break: break-word;
    overflow-wrap: anywhere;
    line-height: 1.25;
}
.rfg-mock-handle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8rem;
    color: #767676;
    margin-bottom: 8px;
}
.rfg-mock-handle svg { color: var(--rfg-accent); }
.rfg-mock-bio {
    font-size: 0.9rem;
    line-height: 1.45;
    color: #111;
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: 1.4em;
}
.rfg-mock.is-sample .rfg-mock-name,
.rfg-mock.is-sample .rfg-mock-bio { color: #a3a3a3; }
.rfg-mock-stats { display: flex; justify-content: center; gap: 8px; margin-top: 10px; font-size: 0.8rem; color: #111; font-weight: 600; }
.rfg-mock-stats i { display: inline-block; width: 22px; height: 9px; border-radius: 4px; background: #e5e7eb; vertical-align: middle; }
.rfg-mock-dot { color: #767676; }
.rfg-mock-actions { display: flex; justify-content: center; gap: 8px; margin-top: 12px; }
.rfg-mock-btn {
    min-width: 96px;
    text-align: center;
    font-size: 0.8rem;
    font-weight: 600;
    color: #111;
    background: #efefef;
    border-radius: 999px;
    padding: 9px 14px;
}

/* Meters */
.rfg-meter-row { max-width: 420px; margin-top: 12px; }
.rfg-meter { height: 8px; border-radius: 999px; background: #eef0f3; overflow: hidden; }
.rfg-meter-fill { height: 100%; width: 0; background: var(--rfg-accent); border-radius: 999px; transition: width 0.15s, background-color 0.15s; }
.rfg-meter-text { margin: 6px 0 0; font-size: 0.85rem; color: #64748b; font-variant-numeric: tabular-nums; }
.rfg-bio-count { margin: 3px 0 0; font-size: 0.82rem; color: #94a3b8; font-variant-numeric: tabular-nums; }
.rfg-bio-count.is-over { color: var(--rfg-over); font-weight: 600; }
.rfg-preview-card.is-near .rfg-meter-fill { background: var(--rfg-near); }
.rfg-preview-card.is-near .rfg-meter-text { color: var(--rfg-near); }
.rfg-preview-card.is-over .rfg-meter-fill { background: var(--rfg-over); }
.rfg-preview-card.is-over .rfg-meter-text { color: var(--rfg-over); font-weight: 600; }

.rfg-preview-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.rfg-copy-bio-btn { padding: 8px 18px; font-size: 0.9rem; }
.rfg-note {
    margin: 14px 0 0;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--rfg-accent-tint);
    color: #7a1a24;
    font-size: 0.85rem;
    line-height: 1.5;
}

/* ---- Style cards ---- */
.rfg-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 12px;
    margin: 18px 0 4px;
}
.rfg-card {
    background: #fff;
    border: 1px solid #e6e8eb;
    border-radius: 12px;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}
.rfg-card.is-active { border-color: var(--rfg-accent); box-shadow: 0 0 0 2px var(--rfg-accent-tint); }
.rfg-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rfg-card-name {
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--rfg-accent-dark);
}
.rfg-card-btns { display: flex; gap: 6px; flex: 0 0 auto; }
.rfg-card-btn {
    border: 1px solid #f5b8c1;
    background: var(--rfg-accent-tint);
    color: var(--rfg-accent-dark);
    font-size: 0.76rem;
    font-weight: 600;
    padding: 4px 12px;
    border-radius: 999px;
    cursor: pointer;
}
.rfg-card-btn:hover { background: var(--rfg-accent); color: #fff; border-color: var(--rfg-accent); }
.rfg-card-out {
    font-size: 1.2rem;
    line-height: 1.5;
    color: #1f2937;
    cursor: pointer;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: 1.6em;
    border-radius: 6px;
    padding: 2px 4px;
    margin: 0 -4px;
    transition: background-color 0.12s;
}
.rfg-card-out:hover { background: var(--rfg-accent-tint); }
.rfg-card-out:focus { outline: 2px solid var(--rfg-accent); }
.rfg-list.is-placeholder .rfg-card-out { color: #b6bcc6; }

@media (max-width: 640px) {
    .rfg-fields { grid-template-columns: 1fr; }
    .rfg-list { grid-template-columns: 1fr; }
}
