/* ==========================================================================
   VALLEY CRAFT — components
   ========================================================================== */

/* ---- buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  line-height: 1;
  min-height: 44px;
  padding: 0.95em 1.6em;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  text-align: center;
  transition: transform 120ms ease, box-shadow 120ms ease, background-color 150ms ease, color 150ms ease, border-color 150ms ease;
}
.btn svg { width: 1.1em; height: 1.1em; flex-shrink: 0; }

.btn--barn {
  background: var(--barn);
  color: var(--paper);
  box-shadow: inset 0 -3px 0 0 var(--barn-deep);
}
.btn--barn:hover, .btn--barn:focus-visible {
  background: var(--barn-deep);
  transform: translateY(1px);
  box-shadow: inset 0 -2px 0 0 var(--pine-deep);
}
.btn--barn:active { transform: translateY(2px); box-shadow: inset 0 -1px 0 0 var(--pine-deep); }

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 1.5px solid var(--ink);
  padding: calc(0.95em - 1.5px) calc(1.6em - 1.5px);
}
.btn--ghost:hover, .btn--ghost:focus-visible { background: var(--ink); color: var(--paper); }

.btn--invert {
  background: var(--paper);
  color: var(--pine-deep);
  box-shadow: inset 0 -3px 0 0 var(--brass);
}
.btn--invert:hover, .btn--invert:focus-visible {
  background: var(--brass-light);
  transform: translateY(1px);
  box-shadow: inset 0 -2px 0 0 var(--brass);
}

.btn--outline-invert {
  background: transparent;
  color: var(--paper);
  border: 1.5px solid var(--brass-light);
  padding: calc(0.95em - 1.5px) calc(1.6em - 1.5px);
}
.btn--outline-invert:hover, .btn--outline-invert:focus-visible {
  background: rgba(216, 184, 124, 0.15);
  border-color: var(--paper);
}

/* Still >=44px tall (WCAG 2.2 target size) — only padding/font-size shrink. */
.btn--sm { padding: 0.6em 1.2em; font-size: 0.9rem; min-height: 44px; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 0.85rem; align-items: center; }

/* ---- promise line ---- */
.promise {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 600;
  font-size: clamp(1.5rem, 1.25rem + 1.4vw, 2.3rem);
  color: var(--ink);
  display: inline-block;
}
.section--pine .promise { color: var(--paper); }
.promise-wrap { display: inline-block; }
.hand-underline {
  display: block;
  width: 100%;
  height: 0.9em;
  margin-top: 0.05em;
  overflow: visible;
}

/* ---- hand-drawn check / bracket accents ---- */
.check-list li, .symptom-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
}
.check-list li + li, .symptom-list li + li { margin-top: 0.65rem; }
.check-list svg, .symptom-list svg { flex-shrink: 0; margin-top: 0.2em; width: 20px; height: 20px; }
.check-list svg { color: var(--barn); }
.symptom-list svg { color: var(--brass-ink); }
.section--pine .check-list svg { color: var(--brass-light); }
.section--pine .symptom-list svg { color: var(--brass-light); }

/* ---- hand-drawn bracket / circle emphasis ---- */
.bracketed {
  display: inline-flex;
  align-items: center;
  gap: 0.3em;
  color: var(--brass-ink);
}
.section--pine .bracketed { color: var(--brass-light); }
.bracket { width: 0.7em; height: 0.7em; flex-shrink: 0; }
.bracket--r { transform: scaleX(-1); }
.bracketed__text { color: inherit; font-weight: 700; }

.circled {
  position: relative;
  display: inline-block;
  padding: 0.1em 0.35em;
}
.circled__ring {
  position: absolute;
  inset: -0.4em -0.45em;
  width: calc(100% + 0.9em);
  height: calc(100% + 0.8em);
  pointer-events: none;
}
.circled__text { position: relative; font-weight: 700; }

/* ---- photo frame: mounted plate ---- */
.frame {
  display: block;
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 10px;
  box-shadow: var(--shadow-frame);
}
.frame__media {
  background: var(--paper-deep);
  overflow: hidden;
  line-height: 0;
}
.frame__media img, .frame__media svg { width: 100%; height: auto; }
.frame__cap-rule { width: 2.75rem; height: 2px; background: var(--brass); border: none; margin: 0.7rem 0 0.5rem; }
.frame__cap {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--ink-soft);
  font-size: 0.92rem;
  line-height: 1.45;
  text-align: left;
}
.frame--sm { max-width: 26rem; }

/* ---- almanac stat / fact plate ---- */
.plate {
  border: 1px solid var(--rule);
  background: var(--paper);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.plate__icon { width: 32px; height: 32px; color: var(--brass-ink); }
.plate__label { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }
.plate__detail { color: var(--ink-soft); font-size: 0.92rem; }
.plate__detail a { font-weight: 700; }
.section--pine .plate { background: rgba(255, 255, 255, 0.045); border-color: rgba(216, 184, 124, 0.3); }
.section--pine .plate__icon { color: var(--brass-light); }
.section--pine .plate__label { color: var(--paper); }
.section--pine .plate__detail { color: var(--on-pine-soft); }

/* ---- cards (services, projects, team) ---- */
.card {
  display: flex;
  flex-direction: column;
  height: 100%;
}
.card__body { padding-top: var(--space-sm); }
.card__title { font-size: 1.2rem; margin-bottom: 0.4rem; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card__blurb { color: var(--ink-soft); font-size: 0.96rem; }
.card__meta { margin-top: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }

.tag {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pine);
  background: var(--paper-deep);
  border: 1px solid var(--rule);
  padding: 0.3em 0.7em;
  border-radius: 999px;
}

/* ---- CTA band ---- */
.cta-band__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
}
.cta-band__text { max-width: 34rem; }
.cta-band__actions { display: flex; gap: 0.85rem; flex-wrap: wrap; }

/* ---- emergency banner (site-wide, thin) ---- */
.emergency-bar {
  background: var(--ink);
  color: var(--paper);
  font-size: 0.86rem;
  text-align: center;
  padding: 0.55rem var(--space-sm);
}
.emergency-bar a { color: var(--brass-light); font-weight: 700; }
.emergency-bar strong { color: var(--paper); }

/* ---- credential strip ---- */
.credential-strip {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  align-items: center;
}
.credential-strip__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-soft);
}
.credential-strip__item svg { width: 22px; height: 22px; color: var(--brass-ink); flex-shrink: 0; }
.section--pine .credential-strip__item { color: var(--on-pine-soft); }
.section--pine .credential-strip__item svg { color: var(--brass-light); }

/* ---- accordion (FAQ), <details>/<summary> based ---- */
.faq-group + .faq-group { margin-top: var(--space-xl); }
.faq-group__title { margin-bottom: var(--space-sm); }
.faq-item {
  border-bottom: 1px solid var(--rule);
}
.faq-item summary {
  cursor: pointer;
  list-style: none;
  padding: 1.1rem 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.08rem;
  min-height: 44px;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary:focus-visible { outline: 2px solid var(--barn); outline-offset: 4px; }
.faq-icon { flex-shrink: 0; width: 22px; height: 22px; color: var(--barn); transition: transform 220ms var(--ease-page); }
.faq-item[open] .faq-icon { transform: rotate(45deg); }
.faq-answer { padding: 0 0 1.3rem; max-width: var(--measure); color: var(--ink-soft); }
@media (prefers-reduced-motion: no-preference) {
  .faq-answer { animation: faq-in 220ms var(--ease-page); }
}
@keyframes faq-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }

/* ---- gallery ---- */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: var(--space-lg);
}
.chip {
  border: 1px solid var(--rule);
  background: var(--paper);
  color: var(--ink);
  padding: 0.55em 1.1em;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.85rem;
  min-height: 44px;
}
.chip[aria-pressed="true"] { background: var(--barn); color: var(--paper); border-color: var(--barn); }
.chip:hover { border-color: var(--barn); }
.gallery-grid { display: grid; gap: var(--space-lg); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.gallery-item[hidden] { display: none; }
.gallery-empty { color: var(--ink-soft); padding: var(--space-lg) 0; }
.gallery-empty[hidden] { display: none; }

/* ---- forms ---- */
.form { max-width: 40rem; }
.form--wide { max-width: 52rem; }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field + .field { margin-top: var(--space-md); }
.field label, .field .field__label { font-weight: 700; font-size: 0.94rem; }
.field .req { color: var(--barn-deep); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"],
.field select, .field textarea {
  border: 1.5px solid var(--rule);
  background: var(--paper);
  padding: 0.8em 0.9em;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  min-height: 46px;
  width: 100%;
}
.field textarea { min-height: 130px; resize: vertical; }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  border-color: var(--barn);
}
.field .hint { color: var(--ink-soft); font-size: 0.85rem; }
.field[data-has-error="true"] input,
.field[data-has-error="true"] select,
.field[data-has-error="true"] textarea {
  border-color: var(--barn);
  background: #fdf3ef;
}
.field__error {
  display: none;
  color: var(--barn-deep);
  font-size: 0.85rem;
  font-weight: 700;
  gap: 0.4rem;
  align-items: flex-start;
}
.field[data-has-error="true"] .field__error { display: flex; }

.field-row { display: grid; gap: var(--space-md); grid-template-columns: 1fr; }
@media (min-width: 34rem) {
  .field-row--2 { grid-template-columns: 1fr 1fr; }
}

fieldset.group {
  border: 1.5px solid var(--rule);
  border-radius: var(--radius-sm);
  padding: 1rem 1.1rem 1.15rem;
}
fieldset.group legend {
  font-weight: 700;
  padding-inline: 0.35rem;
  margin-left: -0.35rem;
}
fieldset.group[data-has-error="true"] { border-color: var(--barn); }
.option-row {
  display: flex;
  align-items: stretch;
  gap: 0.65rem;
  min-height: 44px;
  padding-block: 0.35rem;
}
.option-row input[type="checkbox"], .option-row input[type="radio"] {
  width: 20px; height: 20px;
  accent-color: var(--barn);
  align-self: center;
  flex-shrink: 0;
}
/* The visible glyph stays a compact 20px, but the <label> stretches to the
   row's full min-height so the actual tappable target (glyph + label,
   click-through via `for=`) clears the 44px touch-target bar even though
   the checkbox/radio graphic itself stays small and unobtrusive. */
.option-row label {
  display: flex;
  align-items: center;
  min-height: 44px;
}
.option-row .option-note { display: block; color: var(--ink-soft); font-size: 0.85rem; }

.hp-field {
  position: absolute !important;
  left: -9999px !important;
  top: -9999px !important;
  width: 1px; height: 1px;
  overflow: hidden;
}

.form-summary {
  border: 2px solid var(--barn);
  background: var(--paper-deep);
  padding: 1.1rem 1.3rem;
  margin-bottom: var(--space-lg);
  border-radius: var(--radius-sm);
}
.form-summary[hidden] { display: none; }
.form-summary h2 { font-size: 1.05rem; margin-bottom: 0.6rem; }
.form-summary ul { display: flex; flex-direction: column; gap: 0.35rem; }
.form-summary a { font-weight: 700; color: var(--barn-deep); }

.form-success {
  border: 1px solid var(--rule);
  background: var(--paper-deep);
  padding: var(--space-lg);
}
.form-success[hidden] { display: none; }
.form-success h2 { margin-bottom: 0.6rem; }
.form-success .phone-cta { margin-top: var(--space-md); }
.preview-note {
  margin-top: var(--space-md);
  padding: 0.85rem 1rem;
  border: 1px dashed var(--brass);
  background: var(--paper);
  font-size: 0.88rem;
  color: var(--ink-soft);
}
[data-form-root][hidden] { display: none; }

.submit-row { margin-top: var(--space-lg); display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.submit-note { color: var(--ink-soft); font-size: 0.85rem; }

/* ---- role-conditional fields (Work With Us) ---- */
[data-role-panel] { display: none; }
[data-role-panel].is-active { display: block; }

/* ---- table (service-area) ---- */
.plain-table { width: 100%; border-collapse: collapse; }
.plain-table th, .plain-table td {
  text-align: left;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--rule);
}
.plain-table th { font-family: var(--font-display); font-weight: 700; }

/* ---- phone tap CTA (used repeatedly, esp. emergency) ---- */
.phone-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
}
.phone-cta__num {
  font-family: var(--font-display);
  font-variant-numeric: oldstyle-nums;
  font-weight: 700;
  font-size: 1.15rem;
}
