/* ============================================================
 * Utilities Bunker — CSS Color Names (v2.1)
 * File: /assets/css/modules/colors/css-color-names.v2.1.css
 * Purpose:
 *  - Tool-only layout + color grid tiles + selected swatch styling
 *  - Mobile-first, 44x44 touch targets, clamp typography
 *  - NO changes to ub-toolkit.v2.1.css
 * ============================================================ */

:root{
  --ccn-radius: 16px;
  --ccn-gap: 12px;
}

/* Tool wrapper (safe) */
.ub-tool{
  display:block;
}

/* Selected preview swatch */
.ccn-sel-swatch{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--ub-border);
  box-shadow: var(--ub-shadow);
  display:inline-block;
}

/* Results grid */
.ccn-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--ccn-gap);
  margin-top: 12px;
}

/* Responsive */
@media (max-width: 1024px){
  .ccn-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .ccn-grid{ grid-template-columns: 1fr; }
}

/* Tile button */
.ccn-tile{
  display:flex;
  align-items:center;
  gap: 12px;
  width:100%;
  min-height: var(--ub-hit);
  padding: 12px;
  border-radius: var(--ccn-radius);
  border: 1px solid var(--ub-border);
  background: var(--ub-card-bg);
  box-shadow: var(--ub-shadow);
  cursor:pointer;
  text-align:left;
  user-select:none;
}

@media (hover:hover){
  .ccn-tile:hover{
    background: var(--ub-surface-2);
    text-decoration:none;
  }
}

.ccn-tile:active{
  transform: translateY(1px);
}

/* Focus ring consistent with toolkit */
.ccn-tile:focus-visible{
  outline: 3px solid var(--ub-focus);
  outline-offset: 2px;
}

/* Selected state */
.ccn-tile[aria-pressed="true"]{
  border-color: rgba(249,58,19,.55);
  box-shadow: 0 0 0 4px rgba(249,58,19,.12), var(--ub-shadow);
}

/* Swatch */
.ccn-swatch{
  width: 44px;
  height: 44px;
  border-radius: 14px;
  border: 1px solid var(--ub-border);
  flex: 0 0 auto;
}

/* Text meta */
.ccn-meta{
  display:flex;
  flex-direction:column;
  min-width: 0;
  gap: 4px;
}

.ccn-name{
  font-weight: 950;
  letter-spacing: -0.01em;
  font-size: var(--ub-fs-2);
  overflow-wrap:anywhere;
  word-break:break-word;
}

.ccn-hex{
  font-family: var(--ub-mono);
  font-weight: 900;
  font-size: var(--ub-fs-1);
  color: var(--ub-muted);
}

/* Tighten selected output swatch row on small screens */
@media (max-width: 420px){
  .ccn-sel-swatch{ width: 40px; height: 40px; border-radius: 12px; }
  .ccn-swatch{ width: 40px; height: 40px; border-radius: 12px; }
}
