/* Tweet Embed Code & Click-to-Tweet Generator - tool-specific styles.
 * Composes shared primitives in tools.css (form card, mode toggle,
 * buttons, toasts); sibling of the Reddit Embed Generator's tool.css. */

:root {
    --teg-accent: #1d9bf0;
    --teg-accent-dark: #0c7abf;
    --teg-accent-tint: #eaf6fe;
    --teg-border: #e6e8eb;
}

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

.teg-intro { color: #475569; font-size: 0.95rem; margin: 0 0 14px; }
[role="tablist"].teg-mode { margin-bottom: 14px; display: inline-grid; grid-template-columns: repeat(3, 1fr); width: auto; }
/* Three tabs: the shared pill is sized for two (50% wide, slides once),
 * so size it to a third and slide it per data-mode, which the script sets
 * on the toggle ([[mode-toggle-pill-data-mode]]; fixed 2026-09-03, the
 * pill used to end mid-way through the second label). */
.teg-mode .mode-btn { min-width: 0; text-align: center; white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.teg-mode::before { width: calc(33.333% - var(--mode-toggle-pad)) !important; }
.teg-mode[data-mode="embed"]::before { transform: translateX(0) !important; }
.teg-mode[data-mode="buttons"]::before { transform: translateX(100%) !important; }
.teg-mode[data-mode="timeline"]::before { transform: translateX(200%) !important; }
.teg-panel[hidden] { display: none; }
.teg-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.teg-field { display: flex; flex-direction: column; min-width: 0; }
.teg-field[hidden] { display: none; }
.teg-field-wide { grid-column: 1 / -1; }
.teg-label { font-weight: 600; font-size: 0.9rem; color: #333; margin-bottom: 6px; display: block; }
.teg-field .text-input { width: 100%; box-sizing: border-box; flex: 0 0 auto; }
.teg-url-row { display: flex; gap: 8px; align-items: stretch; }
.teg-url-row .text-input { flex: 1 1 auto; min-width: 0; }
.teg-url-row .primary-btn { flex: 0 0 auto; white-space: nowrap; }
.teg-hint { margin: 6px 0 0; font-size: 0.82rem; color: #94a3b8; }
.teg-hint.is-over { color: #b91c1c; font-weight: 600; }
.teg-options { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; }
.teg-opt { display: flex; flex-direction: column; }
.teg-opt[hidden] { display: none; }
/* .teg-opt is a column flex box, so the shared .text-input flex-basis
 * would become a ~320px HEIGHT ([[text_input_flex_basis_height]]). */
.teg-opt .text-input { flex: 0 0 auto; }
.teg-num { width: 120px; }
.teg-select { max-width: 360px; }
.teg-pills { display: inline-flex; border: 1px solid #d7dbe0; border-radius: 999px; overflow: hidden; background: #fff; }
.teg-pill { font: inherit; font-size: 0.85rem; padding: 7px 14px; border: 0; background: transparent; color: #475569; cursor: pointer; }
.teg-pill + .teg-pill { border-left: 1px solid #d7dbe0; }
.teg-pill.is-active { background: var(--teg-accent); color: #fff; }
.teg-pill:focus-visible { outline: 2px solid var(--teg-accent); outline-offset: -2px; }
.teg-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 22px; }
.teg-check { font-size: 0.88rem; color: #334155; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.teg-check[hidden] { display: none; }
.teg-caveat { grid-column: 1 / -1; margin: 4px 0 0; padding: 10px 12px; border-radius: 10px; background: #fffbeb; color: #92400e; font-size: 0.86rem; line-height: 1.5; }
.teg-error { margin: 12px 0 0; color: #b91c1c; font-size: 0.9rem; }
.teg-error[hidden] { display: none; }

/* ---- Output card ---- */
.teg-output-card { background: #fff; border: 1px solid var(--teg-border); border-radius: 12px; padding: 16px 18px; margin: 18px 0; }
.teg-output-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.teg-output-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: #1f2937; }
.teg-output-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.teg-open-link { text-decoration: none; }
.teg-open-link[hidden], .teg-output-actions button[hidden] { display: none; }
.teg-post-meta { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; margin-bottom: 10px; padding: 10px 12px; border: 1px solid var(--teg-border); border-radius: 10px; background: #f8fafc; font-size: 0.9rem; }
.teg-post-meta[hidden] { display: none; }
.teg-post-author { font-weight: 700; color: #0f1419; }
.teg-post-handle { color: #536471; }
.teg-post-text { flex-basis: 100%; color: #0f1419; line-height: 1.45; word-break: break-word; overflow-wrap: anywhere; }
.teg-output {
    width: 100%;
    box-sizing: border-box;
    font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
    font-size: 0.82rem;
    line-height: 1.5;
    background: #f6f7f8;
    resize: vertical;
    word-break: break-all;
}
.teg-output-note { margin: 10px 0 0; font-size: 0.85rem; color: #64748b; }
.teg-variants { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.teg-variants[hidden] { display: none; }
.teg-variant { display: grid; grid-template-columns: 140px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--teg-border); border-radius: 8px; background: #fafafa; }
.teg-variant-label { font-size: 0.82rem; font-weight: 600; color: #475569; }
.teg-variant-code { font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.78rem; word-break: break-all; color: #1f2937; }
.teg-variant-copy { font-size: 0.8rem; padding: 5px 10px; }
.teg-preview { margin-top: 14px; }
.teg-preview[hidden] { display: none; }
.teg-preview-label { font-size: 0.82rem; color: #64748b; margin: 0 0 8px; }
.teg-preview-box { min-height: 120px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 10px; overflow: auto; }
.teg-preview-box iframe { max-width: 100%; }

@media (max-width: 640px) {
    [role="tablist"].teg-mode { display: grid; width: 100%; box-sizing: border-box; }
    .teg-mode .mode-btn { white-space: normal; padding-left: 8px; padding-right: 8px; }
    .teg-panel { grid-template-columns: 1fr; }
    .teg-checks { padding-top: 0; }
    .teg-url-row { flex-direction: column; }
    .teg-variant { grid-template-columns: 1fr; gap: 6px; }
}
