/* ----------------------------------------------------------------------------
   TVLDays · Components
   Buttons, forms, triangle glyph, pill radios. Reusable everywhere.
   Load after tokens.css and base.css.
   ---------------------------------------------------------------------------- */

/* ============================================================================
   BUTTONS
   Four variants: primary (marquee), primary-dark (espresso), ghost, text-link.
   ============================================================================ */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 12px 20px;
  border-radius: var(--r-pill);
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  line-height: 1;
  letter-spacing: -0.005em;
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition:
    background var(--t-fast) var(--ease-out),
    color var(--t-fast) var(--ease-out),
    border-color var(--t-fast) var(--ease-out),
    transform var(--t-fast) var(--ease-out),
    box-shadow var(--t-fast) var(--ease-out);
}

.btn:active {
  transform: translateY(-1px);
}

/* --- Size variants --- */

.btn--lg {
  padding: 16px 32px;
  font-size: 16px;
  height: 56px;
}

.btn--sm {
  padding: 8px 14px;
  font-size: 13px;
}

/* --- Primary · marquee-filled --- */

.btn--primary {
  background: var(--marquee);
  color: var(--bg);
}

.btn--primary:hover {
  background: var(--marquee-deep);
}

/* --- Primary dark · espresso-filled --- */

.btn--primary-dark {
  background: var(--espresso);
  color: var(--bg);
}

.btn--primary-dark:hover {
  background: #1a1512;    /* espresso × 0.9 */
}

/* --- Ghost --- */

.btn--ghost {
  background: transparent;
  color: var(--text);
  border: 1.5px solid var(--border);
}

.btn--ghost:hover {
  background: var(--bg-lift);
  border-color: var(--text-wash);
}

/* --- Text link (inside a .btn row for alignment) --- */

.btn--text {
  background: transparent;
  color: var(--text-soft);
  padding: 12px 4px;
  font-weight: 500;
  position: relative;
}

.btn--text::after {
  content: "";
  position: absolute;
  left: 4px;
  right: 4px;
  bottom: 6px;
  height: 1px;
  background: var(--marquee);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-normal) var(--ease-out);
}

.btn--text:hover {
  color: var(--marquee);
}

.btn--text:hover::after {
  transform: scaleX(1);
}

/* --- The triangle glyph inside a button ---
   Slides in from left on hover. Use a span.btn__glyph inside the button. */

.btn__glyph {
  display: inline-block;
  font-size: 0.85em;
  opacity: 0.9;
  transform: translateX(-4px);
  transition: transform var(--t-fast) var(--ease-out), opacity var(--t-fast) var(--ease-out);
}

.btn:hover .btn__glyph {
  transform: translateX(0);
  opacity: 1;
}

/* ============================================================================
   LINK (standalone, not a button) — the underline-sweep pattern.
   Use .link on inline text anchors.
   ============================================================================ */

.link {
  color: var(--text);
  position: relative;
  font-weight: 500;
  transition: color var(--t-fast) var(--ease-out);
  text-decoration: none;
}

.link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--marquee);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform var(--t-normal) var(--ease-out);
}

.link:hover {
  color: var(--marquee);
}

.link:hover::after {
  transform: scaleX(1);
}

/* ============================================================================
   TRIANGLE GLYPH — the signature ▲▽▲ mark.
   Use <span class="tri-glyph" aria-hidden="true"></span>
   Each triangle is a ::before/::after pair + middle via background-image.
   Simpler: three inline SVG triangles with classes.
   ============================================================================ */

.tri-glyph {
  display: inline-flex;
  align-items: flex-end;
  gap: 0;
  height: 14px;
  vertical-align: middle;
}

.tri-glyph__tri {
  width: 12px;
  height: 14px;
  display: inline-block;
}

.tri-glyph__tri--up-marquee {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--marquee);
}

.tri-glyph__tri--down-amber {
  clip-path: polygon(0 0, 100% 0, 50% 100%);
  background: var(--amber);
  margin-left: -2px;      /* chevron overlap */
}

.tri-glyph__tri--up-cue {
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  background: var(--cue-ui);
  margin-left: -2px;
}

.tri-glyph--lg {
  height: 20px;
}

.tri-glyph--lg .tri-glyph__tri {
  width: 16px;
  height: 20px;
}

/* ============================================================================
   FORMS
   Labels + inputs + pill radios.
   ============================================================================ */

.field {
  display: flex;
  flex-direction: column;
  gap: var(--s-2);
}

.field__label {
  font-size: var(--fs-label);
  font-family: var(--font-sans);
  font-weight: 500;
  letter-spacing: var(--ls-label);
  text-transform: uppercase;
  color: var(--text-wash);
}

.field__input,
.field__textarea {
  height: 48px;
  padding: 0 14px;
  background: var(--bg-lift);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.4;
  transition: border-color var(--t-fast) var(--ease-out), background var(--t-fast) var(--ease-out);
  width: 100%;
}

.field__textarea {
  height: auto;
  padding: 12px 14px;
  resize: vertical;
  min-height: 96px;
}

.field__input:focus,
.field__textarea:focus {
  outline: none;
  border-color: var(--marquee);
  background: var(--bg-lift);
}

.field__input::placeholder,
.field__textarea::placeholder {
  color: var(--text-dim);
}

/* --- Pill radio group (role selector) --- */

.pill-radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s-2);
}

.pill-radio {
  position: relative;
}

.pill-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.pill-radio__label {
  display: inline-flex;
  align-items: center;
  padding: 10px 16px;
  background: var(--bg-lift);
  color: var(--text-soft);
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-out);
  user-select: none;
}

.pill-radio__label:hover {
  border-color: var(--text-wash);
  color: var(--text);
}

.pill-radio input[type="radio"]:checked + .pill-radio__label {
  background: var(--marquee);
  color: var(--bg);
  border-color: var(--marquee);
}

.pill-radio input[type="radio"]:focus-visible + .pill-radio__label {
  outline: 2px solid var(--marquee);
  outline-offset: 2px;
}

/* ============================================================================
   CARD — used by problem cards, pillar cards, use-case tiles.
   Variants compose additional styles.
   ============================================================================ */

.card {
  background: var(--bg-lift);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: var(--s-6);
  transition: transform var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.card--hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

/* Accent stripe (top edge) — used on use-case tiles */
.card--stripe {
  position: relative;
  overflow: hidden;
  padding-top: calc(var(--s-6) + 4px);
}

.card--stripe::before {
  content: "";
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--stripe-color, var(--marquee));
  transition: height var(--t-fast) var(--ease-out);
}

.card--stripe:hover::before {
  height: 8px;
}

/* Stripe color variants — applied via data-attribute or utility class */
.card--stripe-marquee  { --stripe-color: var(--marquee); }
.card--stripe-amber    { --stripe-color: var(--amber); }
.card--stripe-cue      { --stripe-color: var(--cue-ui); }
.card--stripe-espresso { --stripe-color: var(--espresso); }
