/* =========================================================================
   Components — layout primitives, buttons, badges, status, forms
   ========================================================================= */

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--space-2xl); }
.section--tight { padding-block: var(--space-xl); }
.section--dark { background: var(--dark); color: var(--on-dark); }
.section--dark h1, .section--dark h2, .section--dark h3, .section--dark h4 { color: var(--on-dark); }
.section--surface { background: var(--surface); }
/* two grey sections in a row would merge into one block — keep the seam visible */
.section--surface + .section--surface { border-top: 1px solid var(--line-strong); }

.lede {
  font-size: var(--step-1);
  line-height: 1.5;
  color: var(--text-muted);
  max-width: 58ch;
  text-wrap: pretty;
}
.section--dark .lede { color: var(--on-dark-muted); }

.measure { max-width: var(--measure); }

.section-head { max-width: 48ch; margin-bottom: var(--space-lg); }
.section-head .lede { margin-top: var(--space-xs); }
.section-head--split {
  max-width: none;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: var(--space-sm) var(--space-lg);
}
.section-head--split > div { max-width: 48ch; }

/* text link with arrow */
.more {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-weight: 600; color: var(--ink-900); text-decoration: none;
  border-bottom: 2px solid var(--brand); padding-bottom: 0.1em;
}
.more .icon { transition: translate var(--dur-mid) var(--ease-out-quart); }
.more:hover .icon { translate: 4px 0; }
.section--dark .more { color: var(--on-dark); }

/* ---- Buttons ---- */
.btn {
  --btn-bg: var(--ink-900);
  --btn-fg: var(--on-dark);
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.55em;
  padding: 0.9rem 1.45rem;
  min-height: 3.2rem;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: var(--step-0);
  letter-spacing: 0;
  line-height: 1;
  color: var(--btn-fg);
  background: var(--btn-bg);
  border: 2px solid transparent;
  border-radius: var(--r-sm);
  text-decoration: none;
  white-space: nowrap;
  transition: transform var(--dur-fast) var(--ease-out-quart),
              box-shadow var(--dur-mid) var(--ease-out-quart),
              background-color var(--dur-fast) ease,
              border-color var(--dur-fast) ease,
              color var(--dur-fast) ease;
}
.btn svg { width: 1.2em; height: 1.2em; flex: none; }
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); box-shadow: none; }

.btn--call { --btn-bg: var(--brand); --btn-fg: var(--brand-ink); }
.btn--call:hover { --btn-bg: var(--brand-deep); box-shadow: var(--shadow-brand); }

.btn--ghost { --btn-bg: transparent; --btn-fg: var(--ink-900); border-color: var(--line-strong); }
.btn--ghost:hover { --btn-bg: var(--ink-900); --btn-fg: var(--on-dark); border-color: var(--ink-900); }

.btn--on-dark { --btn-bg: transparent; --btn-fg: var(--on-dark); border-color: color-mix(in oklch, var(--on-dark) 40%, transparent); }
.btn--on-dark:hover { --btn-bg: var(--on-dark); --btn-fg: var(--ink-900); border-color: var(--on-dark); }

.btn--lg { padding: 1.05rem 1.8rem; min-height: 3.6rem; font-size: var(--step-1); }
.btn--block { width: 100%; }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 0.45em;
  padding: 0.35em 0.8em;
  font-size: var(--step--1); font-weight: 500;
  border-radius: var(--r-pill);
  background: var(--surface-2); color: var(--ink-800);
  border: 1px solid var(--line);
}
.badge .icon { color: var(--brand-text); }
.section--dark .badge, .site-footer .badge { background: var(--dark-2); border-color: var(--line-dark); color: var(--on-dark); }
.section--dark .badge .icon, .site-footer .badge .icon { color: var(--brand); }

/* stars */
.stars { display: inline-flex; gap: 0.08em; color: var(--brand); }
.stars .icon { width: 1.05em; height: 1.05em; }

/* ---- Live open/closed status (filled by main.js) ---- */
.status { display: inline-flex; align-items: center; gap: 0.5em; white-space: nowrap; }
.status__dot {
  width: 0.55em; height: 0.55em; border-radius: 50%; flex: none;
  background: currentColor; opacity: 0.45;
}
.status[data-state="open"] .status__dot { background: var(--ok); opacity: 1; box-shadow: 0 0 0 3px color-mix(in oklch, var(--ok) 28%, transparent); }
.status__label { font-weight: 600; }

/* ---- Grav Form plugin skin (scoped to .form-card) ---- */
.form-card .form-field { margin-bottom: var(--space-sm); }
.form-card .form-label { display: block; margin-bottom: 0.35rem; }
.form-card .form-label label { font-weight: 600; font-size: var(--step--1); color: var(--ink-800); }
.form-card .form-label .required { color: var(--signal); margin-left: 0.15em; }
.form-card .form-data,
.form-card .form-input-wrapper,
.form-card .form-select-wrapper,
.form-card .form-textarea-wrapper { width: 100%; }

.form-card .form-input-wrapper input,
.form-card select,
.form-card textarea {
  width: 100%;
  padding: 0.8rem 0.95rem;
  background: var(--bg);
  border: 1.5px solid var(--line-strong);
  border-radius: var(--r-sm);
  font-size: var(--step-0);
  color: var(--text);
  transition: border-color var(--dur-fast) ease, box-shadow var(--dur-fast) ease;
}
.form-card textarea { min-height: 8rem; resize: vertical; }
.form-card .form-input-wrapper input::placeholder,
.form-card textarea::placeholder { color: var(--ink-600); }
.form-card .form-input-wrapper input:focus,
.form-card select:focus,
.form-card textarea:focus {
  outline: none;
  border-color: var(--ink-900);
  box-shadow: 0 0 0 3px color-mix(in oklch, var(--brand) 50%, transparent);
}
.form-card [aria-invalid="true"] { border-color: var(--signal); }

.form-card .form-select-wrapper { position: relative; }
.form-card select {
  appearance: none; -webkit-appearance: none;
  padding-right: 2.75rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23524d47' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 1.1rem;
}

.form-card .form-errors,
.form-card .form-field .form-message { font-size: var(--step--1); color: var(--signal); font-weight: 600; margin-top: 0.35rem; }
.form-card .notices { padding: var(--space-sm) var(--space-md); border-radius: var(--r-md); margin-bottom: var(--space-md); font-weight: 500; }
.form-card .notices.green, .form-card .notices.success { background: color-mix(in oklch, var(--ok) 14%, var(--bg)); border: 1px solid color-mix(in oklch, var(--ok) 40%, var(--line)); }
.form-card .notices.red, .form-card .notices.error { background: color-mix(in oklch, var(--signal) 9%, var(--bg)); border: 1px solid color-mix(in oklch, var(--signal) 35%, var(--line)); }

@media (min-width: 36rem) {
  .form-card form { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--space-sm); }
  .form-card form > * { grid-column: 1 / -1; }
  .form-card form > .form-field.half { grid-column: auto; }
}

.form-card .buttons { margin-top: var(--space-sm); }
.form-card .buttons .button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  width: 100%;
  padding: 1.05rem 1.8rem; min-height: 3.6rem;
  font-family: var(--font-display); font-weight: 500;
  font-size: var(--step-1); line-height: 1;
  color: var(--brand-ink); background: var(--brand);
  border: 2px solid transparent; border-radius: var(--r-sm);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out-quart), box-shadow var(--dur-mid) var(--ease-out-quart), background-color var(--dur-fast) ease;
}
.form-card .buttons .button:hover { background: var(--brand-deep); transform: translateY(-2px); box-shadow: var(--shadow-brand); }
.form-card .buttons .button:disabled { opacity: 0.6; transform: none; box-shadow: none; cursor: progress; }
@media (min-width: 30rem) { .form-card .buttons .button { width: auto; min-width: 16rem; } }

.rule { height: 1px; background: var(--line); border: 0; }
.section--dark .rule { background: var(--line-dark); }
