/* ==========================================================================
   CV LINKER — BASE & SHARED COMPONENTS
   --------------------------------------------------------------------------
   Loads after tokens.css, before any page stylesheet.

   Everything here was previously re-declared in four or five page files with
   slightly different values — buttons, badges, cards, form fields. Defining
   them once is what removes the need for !important: rules stop competing
   with each other, and there is one place to change a button.

   Scoped under .cvl to keep specificity low but predictable against the
   parent theme, without resorting to !important.
   ========================================================================== */

/* ---- reset (scoped, minimal) --------------------------------------------- */
.cvl *,
.cvl *::before,
.cvl *::after { box-sizing: border-box; }

.cvl {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.cvl img,
.cvl svg,
.cvl video { max-width: 100%; height: auto; display: block; }

/* ---- typography ---------------------------------------------------------- */
.cvl h1, .cvl h2, .cvl h3, .cvl h4 {
  font-family: var(--font-display);
  color: var(--ink);
  margin: 0;
  text-wrap: balance;
}
.cvl h1 { font-size: var(--fs-h1); font-weight: 700; line-height: var(--lh-tight); letter-spacing: -.022em; }
.cvl h2 { font-size: var(--fs-h2); font-weight: 600; line-height: var(--lh-snug); letter-spacing: -.015em; }
.cvl h3 { font-size: var(--fs-h3); font-weight: 600; line-height: var(--lh-snug); letter-spacing: -.01em; }
.cvl p  { margin: 0 0 var(--sp-2); }
.cvl a  { color: var(--primary); text-decoration: none; }
.cvl a:hover { text-decoration: underline; }

.cvl .eyebrow {
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.cvl .muted { color: var(--ink-3); }
.cvl .num   { font-variant-numeric: tabular-nums; }

/* ---- focus: one visible treatment everywhere ----------------------------- */
.cvl :focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* ---- layout --------------------------------------------------------------
   NAMESPACED DELIBERATELY. Woodmart uses .container and .row for its own page
   grid, and Bootstrap-style names are the most collision-prone thing you can
   put in a child theme: an unprefixed .row rule here silently restyles every
   Woodmart wrapper on every page. Our utilities are cvl- prefixed so they can
   only ever hit our own markup.
   -------------------------------------------------------------------------- */
.cvl .cvl-wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--sp-3);
}
.cvl .cvl-stack  { display: flex; flex-direction: column; gap: var(--sp-2); }
.cvl .cvl-row    { display: flex; align-items: center; gap: var(--sp-1); flex-wrap: wrap; }
.cvl .cvl-spacer { margin-inline-start: auto; }

/* ==========================================================================
   BUTTONS
   One shape, four intents, two sizes. Replaces the five near-identical
   button rules that lived in separate page files.
   ========================================================================== */
.cvl .btn,
.cvl .view-profile-btn,
.cvl .apply-filters-btn,
.cvl .load-more-btn,
.cvl .view-btn-action {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  font-weight: 600;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: 12px 22px;
  border-radius: var(--r-full);
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: background-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
  text-decoration: none;
  white-space: nowrap;
}
.cvl .btn:hover,
.cvl .view-profile-btn:hover { text-decoration: none; }
.cvl .btn:active { transform: translateY(1px); }
.cvl .btn:disabled,
.cvl .btn[aria-disabled="true"] {
  opacity: .5; cursor: not-allowed; transform: none;
}

/* intents */
.cvl .btn-primary,
.cvl .view-profile-btn,
.cvl .apply-filters-btn,
.cvl .view-btn-action { background: var(--primary); color: #fff; }
.cvl .btn-primary:hover,
.cvl .view-profile-btn:hover,
.cvl .apply-filters-btn:hover,
.cvl .view-btn-action:hover { background: var(--primary-bright); color: #fff; }

.cvl .btn-secondary,
.cvl .load-more-btn {
  background: transparent; color: var(--primary); border-color: var(--primary);
}
.cvl .btn-secondary:hover,
.cvl .load-more-btn:hover { background: var(--primary-tint); }

.cvl .btn-ghost,
.cvl .reset-button {
  background: transparent; color: var(--ink-2); border-color: var(--line);
}
.cvl .btn-ghost:hover,
.cvl .reset-button:hover { background: var(--sunken); color: var(--ink); }

.cvl .btn-danger,
.cvl .remove-btn {
  background: transparent; color: var(--danger); border-color: var(--danger);
}
.cvl .btn-danger:hover,
.cvl .remove-btn:hover { background: var(--danger-tint); }

.cvl .btn-sm { font-size: var(--fs-sm); padding: 9px 16px; }
.cvl .btn-block { width: 100%; }

/* ==========================================================================
   BADGES — state, always with a word. Never colour alone.
   ========================================================================== */
.cvl .badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; font-weight: 600; line-height: 1.4;
  padding: 4px 11px; border-radius: var(--r-full);
}
.cvl .badge::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; flex-shrink: 0;
}
.cvl .badge-plain::before { display: none; }
.cvl .badge-ok      { background: var(--ok-tint);     color: var(--ok); }
.cvl .badge-warn    { background: var(--warn-tint);   color: var(--warn); }
.cvl .badge-danger  { background: var(--danger-tint); color: var(--danger); }
.cvl .badge-neutral { background: var(--sunken);      color: var(--ink-2); }

/* ==========================================================================
   CARDS
   ========================================================================== */
.cvl .card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.cvl .card-pad { padding: var(--sp-3); }
.cvl .card-interactive {
  transition: box-shadow var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              transform var(--dur) var(--ease);
}
.cvl .card-interactive:hover {
  box-shadow: var(--sh-2);
  border-color: var(--primary);
  transform: translateY(-2px);
}

/* ==========================================================================
   FORM CONTROLS
   ========================================================================== */
.cvl .form-group { margin-bottom: var(--sp-2); }
.cvl label,
.cvl .form-group > label {
  display: block;
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: 6px;
}
.cvl input[type="text"],
.cvl input[type="email"],
.cvl input[type="tel"],
.cvl input[type="number"],
.cvl input[type="password"],
.cvl input[type="date"],
.cvl input[type="search"],
.cvl select,
.cvl textarea,
.cvl .form-control {
  width: 100%;
  font-family: var(--font-body);
  font-size: var(--fs-body);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--line);
  border-radius: var(--r-md);
  padding: 11px 14px;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.cvl input:focus,
.cvl select:focus,
.cvl textarea:focus,
.cvl .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-tint);
}
.cvl input::placeholder,
.cvl textarea::placeholder { color: var(--ink-3); }

.cvl .field-hint  { font-size: 12.5px; color: var(--ink-3); margin-top: 5px; }
.cvl .field-error { font-size: 12.5px; color: var(--danger); margin-top: 5px; }
.cvl .has-error input,
.cvl .has-error select { border-color: var(--danger); }

/* select: a chevron that flips with direction, drawn not imaged */
.cvl select,
.cvl .form-control select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%),
                    linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) center, calc(100% - 13px) center;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 38px;
}
[dir="rtl"] .cvl select {
  background-position: 13px center, 18px center;
}

/* ==========================================================================
   FILTER CHIPS
   ========================================================================== */
.cvl .chip {
  font-size: var(--fs-sm);
  font-weight: 500;
  padding: 8px 15px;
  border-radius: var(--r-full);
  border: 1.5px solid var(--line);
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
  transition: all var(--dur) var(--ease);
}
.cvl .chip:hover { border-color: var(--primary); color: var(--primary); }
.cvl .chip[aria-pressed="true"],
.cvl .chip.is-active {
  background: var(--primary); border-color: var(--primary); color: #fff;
}

/* ==========================================================================
   SKELETON / EMPTY / LOADING
   These states existed nowhere in the old CSS — an empty talent pool showed
   a bare sentence, and loading showed nothing at all.
   ========================================================================== */
.cvl .empty-state {
  text-align: center;
  padding: var(--sp-8) var(--sp-3);
  color: var(--ink-2);
}
.cvl .empty-state h3 { margin-bottom: var(--sp-1); }
.cvl .empty-state p  { max-width: 42ch; margin-inline: auto; color: var(--ink-3); }

.cvl .skeleton {
  background: linear-gradient(90deg, var(--sunken) 25%, var(--line) 37%, var(--sunken) 63%);
  background-size: 400% 100%;
  animation: cvl-shimmer 1.4s ease infinite;
  border-radius: var(--r-sm);
}
@keyframes cvl-shimmer { 0% { background-position: 100% 0 } 100% { background-position: -100% 0 } }

/* ---- accessibility helpers ---------------------------------------------- */
.cvl .screen-reader-text,
.cvl .visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

@media (prefers-reduced-motion: reduce) {
  .cvl *,
  .cvl *::before,
  .cvl *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}
/* The four !important above are the only ones in this file, and they are the
   correct use of it: honouring a user's OS-level motion preference must beat
   any component rule, including ones this system does not control. */

/* ==========================================================================
   WOODMART GRID INTEROP
   Woodmart wraps page-template content in .row > .col-12 and declares
   .row { display: flex }. Nothing anywhere declares a width for .col-12, so
   as a flex child with flex-grow:0 and flex-basis:auto it collapses to
   fit-content — which squeezed these pages to roughly 430px on a 1900px
   screen. Giving the column a basis restores full width.

   Scoped under .cvl so it only affects our own templates, and at two classes
   of specificity so it beats Woodmart's single-class rules on load order
   rather than by shouting.
   ========================================================================== */
.cvl .row > .col-12,
.cvl .row > [class*="col-"] {
  flex: 1 1 100%;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* Woodmart's .container caps width via --wd-container-w and loads after our
   sheets. Our page wrappers set their own max-width and need to win, which
   the .cvl scope now gives them without !important. */
.cvl .cvlinker-approval-page,
.cvl .talent-pool-container,
.cvl .profile-container {
  margin-inline: auto;
}
