/* ============================================================
   AcresAndSquareFeet — Shared Calculator Framework  (styles)
   Version: 2026-07
   Everything is scoped under .asf-calc so it never clashes with
   your WordPress theme. Colours are CSS variables — override them
   once to re-skin every tool on the site.
   ============================================================ */

.asf-calc {
  /* Brand + surface tokens (override these to re-skin) */
  --asf-accent:      #1f7a4d;   /* deep property-green */
  --asf-accent-2:    #2a9d63;
  --asf-accent-ink:  #ffffff;
  --asf-bg:          #ffffff;
  --asf-fg:          #17201b;
  --asf-muted:       #5b6b63;
  --asf-line:        #e4e9e6;
  --asf-soft:        #f5f8f6;
  --asf-soft-2:      #eef4f0;
  --asf-warn-bg:     #fff8e6;
  --asf-warn-fg:     #8a6d1a;
  --asf-radius:      16px;
  --asf-radius-sm:   10px;
  --asf-shadow:      0 1px 2px rgba(16,40,28,.05), 0 8px 24px rgba(16,40,28,.06);

  box-sizing: border-box;
  max-width: 640px;
  margin: 0 auto;
  color: var(--asf-fg);
  font-family: inherit;               /* inherit the theme's font */
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}
.asf-calc *, .asf-calc *::before, .asf-calc *::after { box-sizing: border-box; }

/* ---- Card shell ---- */
.asf-card {
  background: var(--asf-bg);
  border: 1px solid var(--asf-line);
  border-radius: var(--asf-radius);
  box-shadow: var(--asf-shadow);
  padding: 22px;
  overflow: hidden;
}
@media (min-width: 520px) { .asf-card { padding: 28px; } }

.asf-title {
  margin: 0 0 4px;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.25;
}
/* Small architectural accent above the tool title */
.asf-title::before {
  content: "";
  display: block;
  width: 34px; height: 3px;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--asf-accent-2), var(--asf-accent));
  margin: 0 0 14px;
}
.asf-intro {
  margin: 0 0 18px;
  color: var(--asf-muted);
  font-size: .95rem;
}

/* ---- Controls ---- */
.asf-field { margin-bottom: 14px; }
.asf-field > label {
  display: block;
  font-size: .85rem;
  font-weight: 600;
  margin-bottom: 6px;
}
.asf-help { display:block; font-weight:400; color: var(--asf-muted); font-size:.78rem; margin-top:2px; }

.asf-input, .asf-select {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--asf-fg);
  background: var(--asf-bg);
  border: 1.5px solid var(--asf-line);
  border-radius: var(--asf-radius-sm);
  appearance: none;
  /* Astra forces height:40px + line-height:24px on inputs/selects, which clips
     the text against our 12px padding. Let the field size to its content. */
  height: auto !important;
  min-height: 48px;
  line-height: 1.4 !important;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.asf-input:focus, .asf-select:focus {
  outline: none;
  border-color: var(--asf-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--asf-accent) 18%, transparent);
}
.asf-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235b6b63' 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 12px center;
  padding-right: 40px;
}
.asf-row { display: grid; gap: 12px; }
@media (min-width: 460px) { .asf-row--2 { grid-template-columns: 1fr 1fr; } }

.asf-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  padding: 13px 18px;
  font-size: 1rem; font-weight: 700; font-family: inherit;
  color: var(--asf-accent-ink);
  background: linear-gradient(180deg, var(--asf-accent-2), var(--asf-accent));
  border: none; border-radius: var(--asf-radius-sm);
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease, transform .08s ease;
}
/* Premium hover (also defeats Astra's global button:hover that turned the
   label dark-green-on-green): keep white text, deepen green, lift + soft glow. */
.asf-btn:hover {
  color: var(--asf-accent-ink) !important;
  background: linear-gradient(180deg, #24895a, #17603c) !important;
  box-shadow: 0 10px 24px -10px rgba(23,96,60,.6);
  transform: translateY(-1px);
  filter: none;
}
.asf-btn:active { transform: translateY(0); box-shadow: 0 4px 12px -7px rgba(23,96,60,.5); }
.asf-btn:focus-visible { outline: 3px solid rgba(42,157,99,.45); outline-offset: 2px; }

/* ---- Results ---- */
.asf-result { margin-top: 20px; }
.asf-result-lead {
  font-size: .74rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--asf-accent); margin-bottom: 10px;
}
.asf-result-box {
  background: var(--asf-soft);
  border: 1px solid var(--asf-line);
  border-left: 4px solid var(--asf-accent);
  border-radius: var(--asf-radius-sm);
  padding: 18px 20px;
  font-size: 1.05rem;
}
.asf-result-box b { color: var(--asf-accent); }

/* ---- Score meter (score-type tools, e.g. build-readiness) ---- */
.asf-scorewrap { --band: var(--asf-accent); }
.asf-band-low  { --band: #c85a3c; }
.asf-band-mid  { --band: #d1912a; }
.asf-band-high { --band: var(--asf-accent-2); }
.asf-score { display: flex; align-items: center; gap: 12px; }
.asf-score__num { font-size: 2.7rem; font-weight: 800; line-height: 1; letter-spacing: -.02em; color: var(--asf-fg); }
.asf-score__max { font-size: 1rem; font-weight: 600; color: var(--asf-muted); margin-left: 3px; }
.asf-score__chip {
  margin-left: auto; padding: 6px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 700; color: var(--band);
  background: color-mix(in srgb, var(--band) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--band) 32%, transparent);
}
.asf-meter { height: 10px; border-radius: 999px; background: var(--asf-soft-2); overflow: hidden; margin: 15px 0 12px; }
.asf-meter__fill {
  height: 100%; border-radius: 999px; width: var(--val, 0);
  background: linear-gradient(90deg, color-mix(in srgb, var(--band) 65%, #fff), var(--band));
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.asf-score__note { margin: 0; color: var(--asf-muted); font-size: .95rem; line-height: 1.55; }

/* Conversion table */
.asf-table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.asf-table th, .asf-table td { text-align: left; padding: 11px 8px; border-bottom: 1px solid var(--asf-line); }
.asf-table th { font-size: .72rem; text-transform: uppercase; letter-spacing: .04em; color: var(--asf-muted); font-weight: 600; }
.asf-table td:nth-child(2) { text-align: right; font-weight: 700; white-space: nowrap; }
.asf-table td:nth-child(3) { color: var(--asf-muted); width: 1%; white-space: nowrap; padding-left: 14px; }
.asf-table tr:last-child td { border-bottom: none; }
.asf-table tr.asf-src td { background: var(--asf-soft-2); }
.asf-table tr.asf-src td:first-child::before {
  content: "▶"; color: var(--asf-accent); font-size: .7rem; margin-right: 6px;
}
.asf-unit-name { font-weight: 600; }
.asf-unit-sub  { color: var(--asf-muted); font-size: .78rem; display:block; }

.asf-copy {
  border: 1px solid var(--asf-line); background: var(--asf-bg);
  color: var(--asf-muted); border-radius: 8px; padding: 3px 8px;
  font-size: .72rem; cursor: pointer; font-family: inherit;
}
.asf-copy:hover { border-color: var(--asf-accent); color: var(--asf-accent); }

/* ---- Disclaimer + CTA + footer ---- */
.asf-note {
  margin-top: 16px; padding: 11px 14px;
  background: var(--asf-warn-bg); color: var(--asf-warn-fg);
  border-radius: var(--asf-radius-sm); font-size: .82rem;
}
.asf-cta {
  margin-top: 18px; padding: 18px;
  background: var(--asf-soft); border: 1px dashed var(--asf-line);
  border-radius: var(--asf-radius-sm); text-align: center;
}
.asf-cta p { margin: 0 0 12px; font-size: .95rem; }
.asf-cta .asf-btn { width: auto; padding: 12px 26px; text-decoration: none; }
.asf-foot {
  margin-top: 16px; font-size: .74rem; color: var(--asf-muted);
  display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.asf-foot a { color: inherit; }

/* ---- Dark mode ---- */
@media (prefers-color-scheme: dark) {
  .asf-calc:not([data-theme="light"]) {
    --asf-bg:#141a17; --asf-fg:#e8efea; --asf-muted:#9db0a6;
    --asf-line:#2a332e; --asf-soft:#1a221d; --asf-soft-2:#202a24;
    --asf-warn-bg:#2a2410; --asf-warn-fg:#e6cf86;
    --asf-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  }
}
.asf-calc[data-theme="dark"] {
  --asf-bg:#141a17; --asf-fg:#e8efea; --asf-muted:#9db0a6;
  --asf-line:#2a332e; --asf-soft:#1a221d; --asf-soft-2:#202a24;
  --asf-warn-bg:#2a2410; --asf-warn-fg:#e6cf86;
  --asf-shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
}
