/* TextStyler - tools.css: hero, input, chips, style grid, cards, copy button.
   Loaded only on the homepage and the /tools/ pages. Breakpoints and motion
   rules live in responsive.css. */

.hero { padding: 26px 0 8px; }
.hero h1 { margin-bottom: 0.3em; }
.hero .sub { color: var(--muted); font-size: 1.05rem; margin-bottom: 20px; max-width: 680px; }

.tool-top { scroll-margin-top: 8px; }

/* ------------------------------------------------------------ input */

.input-box {
  position: sticky; top: 0; z-index: 20;
  background: var(--bg);
  padding: 8px 0 10px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 14px;
}

.input-row { display: flex; gap: 10px; align-items: stretch; }

#text-input {
  flex: 1; resize: none; min-height: 58px; max-height: 120px;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border); border-radius: 12px;
  padding: 12px 14px; font: inherit; font-size: 16px; line-height: 1.45;
}
#text-input:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent); }

.input-meta {
  display: flex; align-items: center; gap: 12px;
  margin-top: 8px; font-size: 0.85rem; color: var(--muted);
}
#char-count { font-variant-numeric: tabular-nums; }

.btn-clear {
  margin-left: auto; background: none; border: 1px solid var(--border);
  color: var(--muted); border-radius: 8px; padding: 6px 14px;
  font: inherit; font-size: 0.85rem; cursor: pointer; min-height: 36px;
}
.btn-clear:hover { color: var(--text); border-color: var(--muted); }

/* ----------------------------------------------------- chips + search */

.filter-row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }

.chips {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  flex: 1 1 100%;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: 0 0 auto; background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 999px; padding: 8px 14px;
  font: inherit; font-size: 0.88rem; font-weight: 500; cursor: pointer;
  min-height: 38px;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); }

#style-search {
  flex: 1 1 180px; max-width: 320px;
  background: var(--surface); border: 1px solid var(--border);
  color: var(--text); border-radius: 10px; padding: 9px 12px;
  font: inherit; font-size: 16px; min-height: 42px;
}
#style-search:focus { border-color: var(--accent); outline: none; }

.result-count { font-size: 0.85rem; color: var(--muted); margin: 4px 0 10px; }

/* -------------------------------------------------------------- grid */

.grid {
  display: grid; gap: 12px;
  grid-template-columns: 1fr;
}

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 10px;
}

.card-top { display: flex; align-items: center; gap: 8px; }
.card-top h3 { margin: 0; font-size: 0.95rem; font-weight: 650; flex: 1; min-width: 0; }

.badge {
  flex: 0 0 auto; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.05em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px;
}
.badge.wide    { background: var(--badge-wide-bg);    color: var(--badge-wide-text); }
.badge.limited { background: var(--badge-limited-bg); color: var(--badge-limited-text); }

.card-out {
  margin: 0; min-height: 3.2em;
  font-family: var(--font-out);
  font-size: 20px; line-height: 1.55;
  overflow-wrap: anywhere; word-break: break-word;
  user-select: all; -webkit-user-select: all;
}

.copy-btn {
  align-self: stretch;
  background: var(--accent); color: var(--accent-contrast);
  border: none; border-radius: 10px;
  min-height: 44px; padding: 10px 18px;
  font: inherit; font-weight: 600; font-size: 0.95rem;
  cursor: pointer; transition: background 0.15s ease, transform 0.05s ease;
}
.copy-btn:hover { filter: brightness(1.08); }
.copy-btn:active { transform: scale(0.985); }
.copy-btn.copied { background: var(--success); color: var(--accent-contrast); }

.card[hidden], .grid-empty { display: none; }
.grid-empty-msg { color: var(--muted); padding: 24px 0; display: none; }
.grid.is-empty .grid-empty-msg { display: block; }

/* ------------------------------------------------------ platform pills */

.platforms { margin: 6px 0 0; }
.platforms h2 { margin-top: 0; font-size: 1.05rem; }

/* --------------------------------------------------------- noscript */

.noscript-note {
  background: var(--badge-limited-bg); color: var(--badge-limited-text);
  border-radius: 10px; padding: 10px 14px; font-size: 0.9rem; margin: 10px 0;
}
