/* ============================================================
   Thaleria — marketing component primitives
   All values reference colors_and_type.css tokens.
   No inline color/spacing literals.
   Ported as-is from Claude Design "Full website WIP".
   ============================================================ */

/* --- Button -------------------------------------------------- */
.tl-btn {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  font-weight: var(--weight-medium);
  line-height: 1;
  height: 48px;
  min-width: 128px;
  padding: 0 var(--space-8);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  cursor: pointer;
  transition: background var(--dur-base) var(--ease-out),
              color var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.tl-btn:focus-visible {
  outline: 2px solid var(--fg-link);
  outline-offset: 2px;
}
/* Double the class (specificity 0,2,0) so these background/color declarations
   win over Tailwind preflight's `[type="button"|"submit"|"reset"] { background:
   transparent }` (0,1,0), which loads after this file and otherwise makes
   primary submit buttons render transparent until hover. */
.tl-btn.tl-btn--primary {
  background: var(--navy-700);
  color: var(--fg-on-dark);
}
.tl-btn.tl-btn--primary:hover { background: var(--navy-600); }
.tl-btn.tl-btn--ghost {
  background: transparent;
  color: var(--fg-link);
  border-color: var(--fg-link);
}
.tl-btn.tl-btn--ghost:hover { background: rgba(37, 99, 235, 0.08); }
/* Destructive confirmations only (delete account, withdraw application) — the
   portal's app-like screens. Doubled class for the same Tailwind-preflight
   reason as --primary above. */
.tl-btn.tl-btn--danger {
  background: var(--danger);
  color: var(--fg-on-dark);
  border-color: transparent;
}
.tl-btn.tl-btn--danger:hover { background: #C13C38; }
/* Destructive but secondary, sitting in a row of ordinary actions — whether it
   opens a confirmation (Withdraw, on My applications) or deletes on the tap
   (Remove, on the résumé card). Solid --danger is reserved for the irreversible
   commit itself, so a ghost carrying the colour marks the intent without
   shouting it from every row of a list. */
.tl-btn.tl-btn--ghost-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--border-2);
}
.tl-btn.tl-btn--ghost-danger:hover {
  background: rgba(217, 83, 79, 0.08);
  border-color: var(--danger);
  color: var(--danger);
}
.tl-btn[disabled],
.tl-btn[aria-disabled="true"] {
  background: var(--fg-3);
  color: var(--fg-on-dark);
  border-color: transparent;
  cursor: not-allowed;
  pointer-events: none;
}

/* --- Eyebrow + accent word ---------------------------------- */
/* The eyebrow: uppercase, tracked, preceded by a short accent rule.
   Defined on the class itself. It used to live on `.tl-section-head .tl-eyebrow`
   (site.css), which meant an eyebrow anywhere else — a dark CTA band, a form
   header — silently fell back to plain regular-weight text. The pages that
   noticed re-declared the whole treatment locally; the ones that didn't just
   looked wrong. Contexts that need a different colour still override it. */
.tl-eyebrow {
  font-size: var(--fs-eyebrow);
  letter-spacing: var(--tracking-eyebrow);
  text-transform: uppercase;
  font-weight: var(--weight-semibold);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
  line-height: 1.2;
}
.tl-eyebrow::before {
  content: "";
  width: 18px;
  height: 2px;
  background: var(--fg-accent);
  border-radius: 2px;
}
.tl-accent { color: var(--fg-accent); }

/* --- Form fields -------------------------------------------- */
.tl-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.tl-field__label {
  font-size: 13px;
  color: var(--fg-2);
  font-weight: var(--weight-medium);
}
.tl-field__input,
.tl-field__textarea {
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--fg-1);
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out);
}
.tl-field__textarea { min-height: 110px; resize: vertical; }
/* iOS Safari zooms the page in on any input it focuses whose font-size is under
   16px, and never zooms back out — so the 14px --fs-small above left every form
   on the site (contact, the careers application, careers/account, the project
   enquiry) mid-zoom after the first tap. 16px is the threshold, not a
   preference. Scoped to phone widths so the desktop field keeps its 14px. */
@media (max-width: 720px) {
  .tl-field__input,
  .tl-field__textarea { font-size: 16px; }
}
.tl-field__input:focus,
.tl-field__textarea:focus {
  outline: none;
  border-color: var(--fg-link);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.18);
}
.tl-field--error .tl-field__input,
.tl-field--error .tl-field__textarea {
  border-color: var(--danger);
}
.tl-field--error .tl-field__input:focus,
.tl-field--error .tl-field__textarea:focus {
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}
.tl-field__error {
  font-size: 12px;
  color: var(--danger);
}

/* Search variant — muted surface, no border */
.tl-search {
  background: var(--surface-quiet);
  height: 48px;
  border-radius: var(--radius-md);
  padding: 0 var(--space-3);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.tl-search__icon { color: var(--fg-2); flex: none; }
.tl-search__input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-family: var(--font-sans);
  font-size: var(--fs-small);
  color: var(--fg-1);
}
.tl-search__input::placeholder { color: var(--fg-3); }
.tl-search:focus-within {
  box-shadow: 0 0 0 2px var(--fg-link) inset;
}

/* --- Cards --------------------------------------------------- */
.tl-card {
  background: var(--surface-card);
  border-radius: var(--radius-xl);
  padding: 28px;
}

/* List card — links, must be a proper anchor for accessibility */
.tl-list-card {
  display: block;
  background: var(--surface-quiet);
  border-radius: var(--radius-lg);
  padding: 20px;
  text-decoration: none;
  color: inherit;
  transition: background var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.tl-list-card:hover {
  background: var(--surface-card);
  box-shadow: var(--shadow-2);
}
.tl-list-card:focus-visible {
  outline: 2px solid var(--fg-link);
  outline-offset: 2px;
}
.tl-list-card__meta {
  font-size: 13px;
  color: var(--fg-link);
}
.tl-list-card__sub {
  font-size: 13px;
  color: var(--fg-2);
}
.tl-list-card__title {
  font-size: 17px;
  font-weight: var(--weight-medium);
  color: var(--fg-1);
  margin: 6px 0 16px;
}
.tl-list-card__footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--fg-2);
  font-size: 12px;
}
.tl-list-card__footer svg { transition: transform var(--dur-base) var(--ease-out); }
.tl-list-card:hover .tl-list-card__footer svg { transform: translateX(4px); }

/* --- Stat block --------------------------------------------- */
.tl-stat__value {
  display: flex;
  align-items: flex-start;
  font-size: 56px;
  font-weight: var(--weight-semibold);
  line-height: 1;
  color: var(--fg-1);
  letter-spacing: -0.02em;
}
.tl-stat__plus {
  color: var(--fg-accent);
  margin-left: 4px;
  margin-top: 4px;
}
.tl-stat__label {
  color: var(--fg-3);
  margin-top: 12px;
  max-width: 220px;
  font-size: 14px;
  line-height: 1.4;
}

/* --- Numbered info card ------------------------------------- */
.tl-info__num {
  color: var(--fg-accent);
  font-size: 22px;
  font-weight: var(--weight-medium);
  margin-bottom: 16px;
}
.tl-info__title {
  font-size: 20px;
  font-weight: var(--weight-semibold);
  color: var(--fg-1);
  margin: 0 0 8px;
}
.tl-info__body {
  color: var(--fg-2);
  font-size: 14px;
  line-height: 1.6;
  margin: 0;
}
/* Inverted variant — applied to a wrapping element with .tl-on-dark */
.tl-on-dark .tl-info__title { color: var(--fg-on-dark); }
.tl-on-dark .tl-info__body  { color: var(--fg-on-dark-muted); }

/* --- Inline busy indicator ------------------------------------------------
   Inherits currentColor, so it works on a primary button, a ghost button or
   plain text without a variant per surface. */
@keyframes tlSpin { to { transform: rotate(360deg); } }
.tl-spinner {
  display: inline-block;
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: tlSpin 0.6s linear infinite;
  flex: none;
}
/* Still a live indicator, just a calmer one. */
@media (prefers-reduced-motion: reduce) {
  .tl-spinner { animation-duration: 2.4s; }
}

/* ============================================================
   FAQ ACCORDION — shared by the careers FAQ page and the
   per-project FAQ section on flagship project pages. Lives here
   (components.css is linked globally by Shell) because project
   pages don't load careers.css.
   ============================================================ */
.tl-faq-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.tl-faq-item {
  background: var(--surface-card);
  border: 1px solid var(--border-1);
  border-radius: var(--radius-lg);
  transition: border-color var(--dur-base) var(--ease-out),
              box-shadow var(--dur-base) var(--ease-out);
}
.tl-faq-item.is-open {
  border-color: var(--orange-700);
  box-shadow: var(--shadow-2);
}
.tl-faq-item__btn {
  width: 100%;
  background: transparent;
  border: 0;
  text-align: left;
  font: inherit;
  padding: var(--space-6) var(--space-6);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: var(--space-5);
  align-items: center;
  cursor: pointer;
  color: var(--fg-1);
}
.tl-faq-item__q {
  font-size: 16px;
  font-weight: var(--weight-semibold);
  line-height: 1.45;
  letter-spacing: -0.005em;
}
.tl-faq-item__toggle {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--surface-quiet);
  color: var(--fg-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              transform var(--dur-base) var(--ease-out);
}
.tl-faq-item.is-open .tl-faq-item__toggle {
  background: var(--orange-700);
  color: var(--fg-on-dark);
  transform: rotate(45deg);
}
.tl-faq-item__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur-base) var(--ease-out);
}
.tl-faq-item.is-open .tl-faq-item__body { grid-template-rows: 1fr; }
.tl-faq-item__body-inner {
  overflow: hidden;
  padding: 0 var(--space-6);
}
.tl-faq-item.is-open .tl-faq-item__body-inner {
  padding-bottom: var(--space-6);
}
.tl-faq-item__body-inner > * { margin: 0; }
.tl-faq-item__body-inner p {
  font-size: 15px;
  line-height: 1.65;
  color: var(--fg-1);
}
.tl-faq-item__body-inner p + p,
.tl-faq-item__body-inner p + ul,
.tl-faq-item__body-inner p + ol,
.tl-faq-item__body-inner ul + p,
.tl-faq-item__body-inner ol + p { margin-top: var(--space-3); }
.tl-faq-item__body-inner ul,
.tl-faq-item__body-inner ol {
  padding: 0;
  margin: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tl-faq-item__body-inner li {
  font-size: 15px;
  line-height: 1.55;
  color: var(--fg-1);
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding-left: 0;
}
.tl-faq-item__body-inner ul li::before {
  content: "";
  width: 6px; height: 6px;
  border-radius: 999px;
  background: var(--orange-700);
  margin-top: 10px;
  flex: none;
}
.tl-faq-item__body-inner ol { counter-reset: faq-ol; }
.tl-faq-item__body-inner ol li { counter-increment: faq-ol; }
.tl-faq-item__body-inner ol li::before {
  content: counter(faq-ol) ".";
  font-weight: var(--weight-semibold);
  color: var(--orange-700);
  min-width: 22px;
}
