/**
 * Shared styles for the content-generation "gen" family
 * (YouTube Tag Generator, Social Media Post Generator, Headline Generator).
 *
 * Composes the project's shared tools.css primitives. The accent is
 * injected as --gen-accent / --gen-accent-dark / --gen-accent-tint by
 * gen-page.php. Three result shapes: tags (chips), posts (cards),
 * scored (headline cards with a strength badge).
 */

:root {
    --gen-accent: #dc2626;
    --gen-accent-dark: #b91c1c;
    --gen-accent-tint: #fee2e2;
}

/* Hero icon inside the page H1 (inherits the H1 colour via currentColor). */
.gen-hero-mark {
    width: 1em;
    height: 1em;
    vertical-align: -0.12em;
    margin-right: 8px;
}

/* ---- Form ------------------------------------------------------------- */
.gen-intro {
    margin: 0 0 14px;
    color: #475569;
    font-size: 14.5px;
    line-height: 1.5;
}
.gen-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 14px;
}
.gen-fields--two {
    grid-template-columns: 1fr 1fr;
}
@media (max-width: 640px) {
    .gen-fields--two { grid-template-columns: 1fr; }
}
/* fields.stacked: the secondary field sits under the primary one. */
.gen-fields--stacked { grid-template-columns: 1fr; }
.gen-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.gen-field-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
}
/* In a column-flex parent the shared .text-input { flex: 1 1 320px } would
   become a 320px HEIGHT request. Pin the box explicitly. */
.gen-input {
    width: 100%;
    box-sizing: border-box;
    flex: 0 0 auto;
}

.gen-pill-row {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-top: 14px;
    flex-wrap: wrap;
}
.gen-pill-label {
    font-size: 13px;
    font-weight: 600;
    color: #334155;
    padding-top: 7px;
    min-width: 64px;
}
.gen-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1 1 auto;
}
.gen-pill {
    border: 1px solid #d8dee9;
    background: #fff;
    color: #475569;
    border-radius: 999px;
    padding: 6px 13px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: background .14s, border-color .14s, color .14s;
}
.gen-pill:hover { border-color: var(--gen-accent); color: var(--gen-accent); }
.gen-pill.is-active {
    background: var(--gen-accent);
    border-color: var(--gen-accent);
    color: #fff;
}
.gen-submit-row { margin-top: 18px; }

/* ---- Results: shared -------------------------------------------------- */
.gen-results-body { padding: 16px 18px 6px; }
.gen-grid { display: grid; gap: 12px; }

/* Tags: a wrap of chips. */
.gen-grid--tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.gen-tag {
    border: 1px solid #d8dee9;
    background: #f8fafc;
    color: #1f2937;
    border-radius: 8px;
    padding: 7px 12px;
    font-size: 13.5px;
    cursor: pointer;
    transition: background .14s, border-color .14s, transform .06s;
}
.gen-tag:hover { border-color: var(--gen-accent); background: var(--gen-accent-tint); }
.gen-tag:active { transform: scale(.97); }

/* List: the generic text + note cards (Instagram Post Ideas Generator). */
.gen-grid--list { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
@media (max-width: 640px) {
    .gen-grid--list { grid-template-columns: 1fr; }
}

/* Keywords: tag chips with a search-volume badge (Instagram Keyword
 * Generator). The chip keeps .gen-tag so click-to-copy delegation works. */
.gen-grid--keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.gen-kw { display: inline-flex; align-items: center; gap: 8px; padding-right: 8px; }
.gen-kw-vol {
    display: inline-block;
    font-size: 11.5px;
    font-weight: 700;
    line-height: 1;
    padding: 4px 7px;
    border-radius: 999px;
    background: var(--gen-accent-tint);
    color: var(--gen-accent-dark);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.gen-kw-vol.is-na { background: #eef0f3; color: #94a3b8; font-weight: 600; }
.gen-kw-note { font-size: 11.5px; color: #94a3b8; }

/* Posts: full-width-ish cards. */
.gen-grid--posts {
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
}
@media (max-width: 700px) {
    .gen-grid--posts { grid-template-columns: 1fr; }
}

/* Scored headlines. */
.gen-grid--scored {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
@media (max-width: 640px) {
    .gen-grid--scored { grid-template-columns: 1fr; }
}

/* Emails: single-column cards (each is a whole email) with a subject bar. */
.gen-grid--emails { grid-template-columns: 1fr; }
.gen-card--email .gen-card-head { align-items: flex-start; }
.gen-card-subject {
    flex: 1 1 auto; min-width: 0;
    display: flex; align-items: baseline; gap: 8px;
    border-bottom: 1px solid #eef0f4; padding-bottom: 8px;
}
.gen-card-subject-label {
    flex: 0 0 auto; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.04em;
    text-transform: uppercase; color: var(--gen-accent-dark, #b91c1c);
}
.gen-card-subject-text {
    font-weight: 700; color: #1f2937; font-size: 0.95rem;
    overflow-wrap: break-word; min-width: 0;
}
.gen-card-body--email { white-space: pre-wrap; line-height: 1.65; }

.gen-card {
    border: 1px solid #e5e9f0;
    border-radius: 10px;
    background: #fff;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.gen-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}
.gen-card-copy {
    border: none;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    padding: 3px;
    border-radius: 6px;
    line-height: 0;
    flex: 0 0 auto;
}
.gen-card-copy:hover { color: var(--gen-accent); background: var(--gen-accent-tint); }
.gen-card-copy.is-copied { color: #16a34a; }
.gen-card-note {
    font-size: 12px;
    color: #64748b;
    font-style: italic;
}
.gen-card-note--scored { margin-top: 2px; }

/* Post body keeps newlines. */
.gen-card-body {
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    line-height: 1.5;
    color: #1f2937;
}
.gen-card-foot {
    display: flex;
    justify-content: flex-end;
    border-top: 1px solid #f1f5f9;
    padding-top: 7px;
}
.gen-card-chars { font-size: 12px; color: #64748b; }
.gen-card-chars.is-ok   { color: #16a34a; }
.gen-card-chars.is-warn { color: #d97706; }
.gen-card-chars.is-over { color: #dc2626; font-weight: 600; }

/* Scored headline card. */
.gen-card-headline {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    color: #111827;
    cursor: pointer;
}
.gen-card-headline:hover { color: var(--gen-accent); }
.gen-score {
    display: inline-flex;
    align-items: baseline;
    gap: 6px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}
.gen-score-num { font-size: 14px; }
.gen-score-tier { font-weight: 500; }
.gen-score.is-strong { background: #dcfce7; color: #15803d; }
.gen-score.is-solid  { background: #dbeafe; color: #1d4ed8; }
.gen-score.is-okay   { background: #fef3c7; color: #b45309; }
.gen-score.is-weak   { background: #f1f5f9; color: #64748b; }
.gen-reasons {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.gen-reason {
    font-size: 11px;
    color: #475569;
    background: #f1f5f9;
    border-radius: 6px;
    padding: 2px 7px;
}

/* Generate more. */
.gen-more-row {
    display: flex;
    justify-content: center;
    margin-top: 16px;
    padding-bottom: 4px;
}
.gen-more-btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

/* Optional examples block ($gen_extra_html, e.g. Pinterest Board Name
   Generator's "board name ideas by niche"): a responsive column grid of
   short lists inside a static tool-info block. */
.gen-examples-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px 28px; margin-top: 6px; }
.gen-examples-col h3 { font-size: 15px; font-weight: 600; margin: 0 0 6px; color: #3a3f47; }
.gen-examples-col ul { margin: 0; padding-left: 18px; }
.gen-examples-col li { margin: 3px 0; line-height: 1.45; }
.gen-examples-aesthetic { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 0; padding: 0; list-style: none; }
.gen-examples-aesthetic li { background: #f5f6f8; border-radius: 999px; padding: 4px 12px; font-size: 14px; }

/* Long-text primary field (fields.primary.textarea => true). */
.gen-textarea { min-height: 180px; resize: vertical; line-height: 1.55; flex: 0 0 auto; width: 100%; box-sizing: border-box; }
.gen-fields--two .gen-field:first-child .gen-textarea { min-height: 200px; }
/* Stacked textareas: a topic-sized primary, a shorter optional secondary. */
.gen-fields--stacked .gen-field:first-child .gen-textarea { min-height: 130px; }
.gen-fields--stacked .gen-field + .gen-field .gen-textarea { min-height: 96px; }

/* generator.items_layout => 'stacked': one full-width card per row, any
 * shape (the Reddit Post Generator's two whole posts). Declared after the
 * shape rules so it wins at equal specificity. */
.gen-grid--stacked { grid-template-columns: 1fr; }
