/* SvarKlar shared components.
   Cross-page patterns lifted from the design system spec
   (design-system/04e-icon-buttons.html, etc).
   Loaded after tokens.css, before page-specific stylesheets. */


/* Caveat italic spacing inside headings.
   The Caveat right-edge bleeds into the next character without margin.
   Applied site-wide on hero H1s and section H2s. */
h1 em, h2 em { margin-right: 0.06em; }


/* Icon button (round, 1px border, line-icon glyph).
   Three flavors: default (paper), ink-fill (one-shot primary), ghost (toolbar density).
   Three sizes: sm 32, md 40 (default), lg 48.
   On-dark variant for ink/photo surfaces. */
.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px; height: 40px;
  background: var(--paper);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-pill);
  text-decoration: none;
  cursor: pointer;
  transition:
    background 180ms cubic-bezier(.2,.8,.2,1),
    border-color 180ms cubic-bezier(.2,.8,.2,1),
    color 180ms cubic-bezier(.2,.8,.2,1),
    transform 180ms cubic-bezier(.2,.8,.2,1);
}
.btn-icon:hover { background: var(--cream); border-color: var(--ink); transform: translateY(-1px); }

.btn-icon.sm { width: 32px; height: 32px; }
.btn-icon.lg { width: 48px; height: 48px; }

.btn-icon.ink-fill {
  background: var(--ink);
  color: var(--gold);
  border-color: var(--ink);
}
.btn-icon.ink-fill:hover { background: #000; }

.btn-icon.ghost {
  background: transparent;
  border-color: transparent;
  color: var(--ink);
}
.btn-icon.ghost:hover { background: var(--cream-2); color: var(--ink); }

.btn-icon.on-dark {
  background: rgba(245, 240, 230, 0.06);
  color: #f5f0e6;
  border-color: rgba(245, 240, 230, 0.22);
}
.btn-icon.on-dark:hover {
  background: rgba(245, 240, 230, 0.12);
  border-color: var(--gold);
  color: var(--gold);
}
.btn-icon.on-dark.gold-glyph { color: var(--gold); }


/* Form fields (lifted from design-system/11-form-fields.html).
   Cross-page form patterns. Used on /start/, /contact/.
   Quiet by default: paper fill, ink-mute border, ink + gold-wash on focus. */
.t-field { display: flex; flex-direction: column; gap: 6px; }
.t-field label,
.t-field .t-field-label {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--ink);
  letter-spacing: -0.005em;
}
.t-field .t-field-help {
  font-family: var(--font-sans);
  font-size: 12px;
  color: var(--ink);
  line-height: 1.45;
}
.t-field input[type="text"],
.t-field input[type="email"],
.t-field input[type="tel"],
.t-field input[type="url"],
.t-field textarea,
.t-field select {
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 400;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 12px 14px;
  width: 100%;
  transition: border-color var(--dur-form) var(--ease-standard), box-shadow var(--dur-form) var(--ease-standard);
}
.t-field input:hover,
.t-field textarea:hover,
.t-field select:hover { border-color: var(--ink-mute); }
.t-field input:focus,
.t-field textarea:focus,
.t-field select:focus {
  outline: 0;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--gold-wash);
}
.t-field input::placeholder,
.t-field textarea::placeholder { color: var(--ink-mute); opacity: 0.7; }
.t-field textarea { resize: vertical; min-height: 96px; line-height: 1.5; }
.t-field.is-error input,
.t-field.is-error textarea { border-color: #8a2a2a; box-shadow: 0 0 0 3px rgba(138, 42, 42, 0.12); }
.t-field.is-error .t-field-help { color: #8a2a2a; }

/* 2-col form grid with .full spans. Stacks at <=600px. */
.t-form-block {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px 20px;
}
.t-form-block .t-field.full { grid-column: 1 / -1; }
@media (max-width: 640px) {
  .t-form-block { grid-template-columns: 1fr; }
}

/* Visually hidden (honeypot, screen-reader-only labels). */
.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;
}


/* Spec-page canon banner.
   Used on /design-system/* pages to remind that the live homepage wins on conflicts. */
.ds-canon-banner {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--ink);
  color: rgba(245, 240, 230, 0.85);
  padding: 9px 16px;
  text-align: center;
  font-family: var(--font-sans);
  font-size: 13px;
  letter-spacing: 0.005em;
  border-bottom: 1px solid var(--border-strong);
}
.ds-canon-banner a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.ds-canon-banner b { color: var(--gold); font-weight: 600; }


/* Skip link for keyboard a11y. Hidden until focused, then sticks top-left. */
.skip-link {
  position: absolute;
  top: -999px;
  left: 0;
  background: var(--gold);
  color: var(--ink);
  padding: 12px 20px;
  font-weight: 700;
  z-index: 200;
  border-bottom-right-radius: 8px;
}
.skip-link:focus { top: 0; outline: 2px solid var(--ink); outline-offset: 2px; }
