/* ==========================================================================
   components.css — header, buttons, grids, cards, forms, footer
   Existing template class hooks are preserved.
   ========================================================================== */

/* --- Header / nav -------------------------------------------------------- */
header.site {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
header.site .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  /* Header height follows the logo (+ padding) instead of a fixed min-height,
     so the logo never clips and tuning --logo-h is the only knob. */
  padding-block: var(--space-3);
  gap: var(--space-5);
}
.brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 1.35rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.brand-logo {
  height: var(--logo-h, 56px);
  width: auto;
  display: block;
}
header.site nav {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}
/* Exclude the CTA so it keeps its own white-on-ink button colors. */
header.site nav a:not(.cta) {
  font-size: var(--text-sm);
  color: var(--ink-2);
}
header.site nav a:not(.cta):hover {
  color: var(--ink);
  text-decoration: none;
}

/* --- Buttons ------------------------------------------------------------- */
.btn,
.cta {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1;
  padding: 0.72em 1.25em;
  border-radius: var(--radius-sm);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: opacity var(--dur-fast) var(--ease),
    transform var(--dur-fast) var(--ease);
}
.btn:hover,
.cta:hover {
  text-decoration: none;
  opacity: 0.88;
}
.btn:active,
.cta:active {
  transform: translateY(1px);
}
.btn--ghost {
  background: transparent;
  color: var(--ink);
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--bg);
  opacity: 1;
}

/* --- Hero ---------------------------------------------------------------- */
.hero {
  padding-block: var(--space-9) var(--space-7);
  max-width: 24ch;
}
.hero h1 {
  margin-bottom: var(--space-4);
}
.hero .lead {
  margin-bottom: var(--space-5);
  max-width: 46ch;
}

/* --- Image grid ---------------------------------------------------------- */
.grid {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}
.grid picture,
.grid figure {
  display: block;
  margin: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--line);
}
.grid img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--dur) var(--ease);
}
.grid picture:hover img,
.grid figure:hover img {
  transform: scale(1.03);
}
figure figcaption {
  font-family: var(--font-display);
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--ink-2);
  padding-top: var(--space-2);
}

/* --- Page hero (flatpages) ---------------------------------------------- */
.page-hero {
  display: block;
  width: 100%;
  max-height: 420px;
  object-fit: cover;
  /* Square corners — the design system keeps images print-true (radius 0). */
  margin-bottom: var(--space-5);
  background: var(--line);
}

/* --- Pricing cards ------------------------------------------------------- */
.cards {
  display: grid;
  gap: var(--space-5);
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: var(--space-6);
}
.card h3 {
  margin-top: 0;
}
.card .price {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 500;
  margin: var(--space-2) 0 var(--space-4);
}
.card ul {
  list-style: none;
  padding: 0;
  margin: 0;
  color: var(--ink-2);
}
.card li {
  padding-left: var(--space-5);
  position: relative;
  margin-bottom: var(--space-2);
}
.card li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--ink-3);
}

/* --- Testimonials -------------------------------------------------------- */
.testimonial {
  border: 0;
  margin: 0 0 var(--space-6);
  padding: 0;
  max-width: var(--measure);
}
.testimonial p {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.7rem);
  line-height: 1.4;
  color: var(--ink);
  margin: 0 0 var(--space-3);
}
.testimonial footer {
  font-size: var(--text-label);
  text-transform: uppercase;
  letter-spacing: var(--tracking-label);
  color: var(--ink-3);
}

/* --- Forms --------------------------------------------------------------- */
.field {
  margin-bottom: var(--space-4);
  max-width: 34rem;
}
.field label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--ink-2);
  margin-bottom: var(--space-2);
}
.field input,
.field textarea,
.field select {
  width: 100%;
  font: inherit;
  color: var(--ink);
  padding: 0.65em 0.75em;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--ink);
}
.field input::placeholder,
.field textarea::placeholder {
  color: var(--ink-3);
}

/* Honeypot — visually hidden, off-screen. */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --- Alerts -------------------------------------------------------------- */
.alert {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-bottom: var(--space-4);
  font-size: var(--text-sm);
}
.alert.ok {
  border-color: color-mix(in srgb, var(--ok) 40%, var(--line));
  color: var(--ok);
}
.alert.err {
  border-color: color-mix(in srgb, var(--danger) 45%, var(--line));
  color: var(--danger);
}

/* --- Footer -------------------------------------------------------------- */
footer.site {
  border-top: 1px solid var(--line);
  color: var(--ink-3);
  font-size: var(--text-sm);
  padding-block: var(--space-6);
  margin-top: var(--space-9);
}
footer.site a {
  color: var(--ink-2);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  flex-wrap: wrap;
}
.footer-copy {
  margin: 0;
  max-width: none;
}

/* --- Social links -------------------------------------------------------- */
.social {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  list-style: none;
  margin: 0;
  padding: 0;
}
.social-link {
  display: inline-flex;
  color: var(--ink-3);
  transition: color var(--dur-fast) var(--ease);
}
.social-link:hover {
  color: var(--ink);
}
.social-icon {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

/* --- Responsive: header reflows on narrow screens ------------------------ */
@media (max-width: 760px) {
  header.site .wrap {
    flex-wrap: wrap;
    min-height: 0;
    gap: var(--space-3);
    padding-block: var(--space-3);
  }
  .brand {
    white-space: nowrap;
  }
  header.site nav {
    flex-wrap: wrap;
    gap: var(--space-4);
    width: 100%;
  }
  header.site nav .cta {
    margin-left: auto; /* push the CTA to the row's end */
  }
  main {
    padding-block: var(--space-7);
  }
  .hero {
    padding-block: var(--space-7) var(--space-6);
  }
}
