/* Reddit Embed Generator - tool-specific styles. Composes shared
 * primitives in tools.css (form card, mode toggle, buttons, toasts). */

:root {
    --reg-accent: #d93a00;
    --reg-accent-dark: #b33000;
    --reg-accent-tint: #fff4ef;
    --reg-border: #e6e8eb;
}

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

.reg-intro { color: #475569; font-size: 0.95rem; margin: 0 0 14px; }
[role="tablist"].reg-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). */
.reg-mode .mode-btn { min-width: 0; text-align: center; white-space: nowrap; padding-left: 16px; padding-right: 16px; }
.reg-mode::before { width: calc(33.333% - var(--mode-toggle-pad)) !important; }
.reg-mode[data-mode="embed"]::before { transform: translateX(0) !important; }
.reg-mode[data-mode="rss"]::before { transform: translateX(100%) !important; }
.reg-mode[data-mode="link"]::before { transform: translateX(200%) !important; }
.reg-panel[hidden] { display: none; }
.reg-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 18px; }
.reg-field { display: flex; flex-direction: column; min-width: 0; }
.reg-field[hidden] { display: none; }
.reg-field-wide { grid-column: 1 / -1; }
.reg-label { font-weight: 600; font-size: 0.9rem; color: #333; margin-bottom: 6px; display: block; }
.reg-field .text-input { width: 100%; box-sizing: border-box; flex: 0 0 auto; }
.reg-hint { margin: 6px 0 0; font-size: 0.82rem; color: #94a3b8; }
.reg-options { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: flex-start; }
.reg-opt { display: flex; flex-direction: column; }
.reg-opt[hidden] { display: none; }
/* .reg-opt is a column flex box, so the shared .text-input flex-basis
 * (320px) would become the input's HEIGHT; pin it (tools.css gotcha). */
.reg-opt .text-input { flex: 0 0 auto; }
.reg-num { width: 120px; }
.reg-select { max-width: 360px; }
.reg-pills { display: inline-flex; border: 1px solid #d7dbe0; border-radius: 999px; overflow: hidden; background: #fff; }
.reg-pill { font: inherit; font-size: 0.85rem; padding: 7px 14px; border: 0; background: transparent; color: #475569; cursor: pointer; }
.reg-pill + .reg-pill { border-left: 1px solid #d7dbe0; }
.reg-pill.is-active { background: var(--reg-accent); color: #fff; }
.reg-pill:focus-visible { outline: 2px solid var(--reg-accent); outline-offset: -2px; }
.reg-checks { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding-top: 22px; }
.reg-check { font-size: 0.88rem; color: #334155; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.reg-check[hidden] { display: none; }
.reg-error { margin: 12px 0 0; color: #b91c1c; font-size: 0.9rem; }
.reg-error[hidden] { display: none; }

/* ---- Output card ---- */
.reg-output-card { background: #fff; border: 1px solid var(--reg-border); border-radius: 12px; padding: 16px 18px; margin: 18px 0; }
.reg-output-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.reg-output-title { font-size: 1.05rem; font-weight: 700; margin: 0; color: #1f2937; }
.reg-output-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.reg-open-link { text-decoration: none; }
.reg-open-link[hidden], .reg-output-actions button[hidden] { display: none; }
.reg-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;
}
.reg-output-note { margin: 10px 0 0; font-size: 0.85rem; color: #64748b; }
.reg-variants { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.reg-variants[hidden] { display: none; }
.reg-variant { display: grid; grid-template-columns: 180px 1fr auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--reg-border); border-radius: 8px; background: #fafafa; }
.reg-variant-label { font-size: 0.82rem; font-weight: 600; color: #475569; }
.reg-variant-code { font-family: SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace; font-size: 0.8rem; word-break: break-all; color: #1f2937; }
.reg-variant-copy { font-size: 0.8rem; padding: 5px 10px; }
.reg-preview { margin-top: 14px; }
.reg-preview[hidden] { display: none; }
.reg-preview-label { font-size: 0.82rem; color: #64748b; margin: 0 0 8px; }
.reg-preview-box { min-height: 120px; border: 1px dashed #cbd5e1; border-radius: 10px; padding: 10px; overflow: auto; }
.reg-preview-box iframe { max-width: 100%; }

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