/* Golf tools pages (/tools/). The look follows the blog: Inter, green hero,
   720px article column. Generated pages link this file from /tools/assets/. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --red-600: #dc2626;
}
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  color: var(--gray-800);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  background: #fff;
}
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; border-bottom: 1px solid var(--gray-100);
  background: #fff; position: sticky; top: 0; z-index: 10;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; color: var(--gray-900); }
.brand img { width: 28px; height: 28px; border-radius: 6px; }
.nav-links { display: flex; gap: 18px; font-size: 0.9rem; font-weight: 500; }

.hero {
  background: linear-gradient(135deg, var(--green-800) 0%, var(--green-600) 100%);
  color: #fff; padding: 48px 16px 56px; text-align: center;
}
.eyebrow {
  display: inline-block; font-size: 0.78rem; font-weight: 600; letter-spacing: 0.08em;
  text-transform: uppercase; color: var(--green-100); margin-bottom: 12px;
}
.hero h1 { font-size: 2.1rem; font-weight: 700; max-width: 720px; margin: 0 auto 12px; letter-spacing: -0.02em; line-height: 1.2; }
.hero .lede { font-size: 1.05rem; opacity: 0.92; max-width: 620px; margin: 0 auto; }

.crumbs { max-width: 720px; margin: 16px auto 0; padding: 0 16px; font-size: 0.85rem; color: var(--gray-500); }
.crumbs a { color: var(--gray-600); }

main { max-width: 720px; margin: 0 auto; padding: 8px 16px 40px; }
main h2 { font-size: 1.45rem; font-weight: 700; color: var(--gray-900); margin: 44px 0 14px; letter-spacing: -0.01em; }
main h3 { font-size: 1.1rem; font-weight: 600; color: var(--gray-900); margin: 28px 0 10px; }
main p { font-size: 1.02rem; margin-bottom: 16px; color: var(--gray-700); }
main ul { margin: 0 0 20px 22px; color: var(--gray-700); }
main li { margin-bottom: 8px; }
main strong { color: var(--gray-900); font-weight: 600; }
main em { color: var(--gray-600); }

.formula {
  background: var(--gray-50); border: 1px solid var(--gray-200); border-radius: 10px;
  padding: 14px 16px; margin: 8px 0 18px; font-weight: 600; color: var(--gray-900);
  font-size: 0.98rem; line-height: 1.5;
}
.data-table { width: 100%; border-collapse: collapse; margin: 8px 0 18px; font-size: 0.95rem; }
.data-table th, .data-table td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--gray-100); }
.data-table th { color: var(--gray-900); font-weight: 600; background: var(--gray-50); }

/* The calculator */
.tool {
  margin: 28px 0 0; padding: 20px 16px; border: 1px solid var(--gray-200);
  border-radius: 14px; background: #fff; box-shadow: 0 4px 18px rgba(0,0,0,0.05);
}
main .tool-title { margin: 0 0 8px; font-size: 1.2rem; }
main .tool-help { font-size: 0.92rem; color: var(--gray-600); margin-bottom: 14px; }
main .tool-note { font-size: 0.82rem; color: var(--gray-500); margin: 12px 0 0; }

.hc-head, .hc-row {
  display: grid;
  grid-template-columns: 22px repeat(3, minmax(0, 1fr)) 52px 50px 28px;
  gap: 6px; align-items: center;
}
.hc-head { font-size: 0.75rem; font-weight: 600; color: var(--gray-500); padding: 0 6px 4px; }
.hc-row { padding: 6px; border-radius: 8px; }
.hc-row + .hc-row { margin-top: 2px; }
.hc-row label span { display: none; }
.hc-num { font-size: 0.8rem; color: var(--gray-500); text-align: right; }
.hc-row input, .ch-grid input {
  width: 100%; min-width: 0; padding: 8px; font: inherit; font-size: 16px; /* no iOS zoom */
  border: 1px solid var(--gray-300); border-radius: 8px; background: #fff; color: var(--gray-900);
  font-variant-numeric: tabular-nums;
}
.hc-row input:focus, .ch-grid input:focus { outline: 2px solid var(--green-600); outline-offset: -1px; border-color: transparent; }
.hc-row input.hc-bad { border-color: var(--red-600); background: #fef2f2; }
.hc-diff { font-variant-numeric: tabular-nums; font-weight: 600; text-align: right; color: var(--gray-600); }
.hc-row.hc-used { background: var(--green-50); }
.hc-row.hc-used .hc-diff { color: var(--green-700); }
.hc-row.hc-old { opacity: 0.55; }
.hc-remove {
  width: 28px; height: 28px; border: none; border-radius: 6px; background: transparent;
  color: var(--gray-500); font-size: 1.2rem; line-height: 1; cursor: pointer;
}
.hc-remove:hover { background: var(--gray-100); color: var(--gray-900); }

.tool-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.tool-actions button {
  font: inherit; font-size: 0.9rem; font-weight: 600; padding: 8px 14px; border-radius: 8px; cursor: pointer;
}
.btn-secondary { background: var(--green-50); color: var(--green-800); border: 1px solid var(--green-100); }
.btn-secondary:disabled { opacity: 0.5; cursor: default; }
.btn-ghost { background: transparent; color: var(--gray-600); border: 1px solid var(--gray-200); }

.tool-result {
  margin-top: 16px; padding: 16px; border-radius: 12px; background: var(--gray-50); text-align: center;
}
.tool-result p { font-size: 0.9rem; margin: 6px 0 0; color: var(--gray-600); }
.hc-label { display: block; font-size: 0.8rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--gray-500); }
.hc-index { font-size: 2.6rem; font-weight: 700; color: var(--green-700); font-variant-numeric: tabular-nums; line-height: 1.15; }
.hc-index-empty { color: var(--gray-300); }
.tool-result-inline { display: flex; align-items: center; justify-content: space-between; text-align: left; }
.tool-result-inline .hc-index { font-size: 2rem; }

.ch-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 12px; }
.ch-grid label span { display: block; font-size: 0.8rem; font-weight: 600; color: var(--gray-600); margin-bottom: 4px; }

/* Ads sit between written sections, well away from the calculator's controls */
.ad-slot { margin: 36px 0; min-height: 100px; }

.cta-block {
  margin: 44px 0 8px; padding: 24px 20px; border-radius: 14px; text-align: center;
  background: linear-gradient(135deg, var(--green-50), #fff); border: 1px solid var(--green-100);
}
main .cta-block h2 { margin: 0 0 8px; font-size: 1.3rem; }
.btn {
  display: inline-block; margin-top: 6px; padding: 12px 22px; border-radius: 999px;
  background: var(--green-600); color: #fff; font-weight: 600;
}
.btn:hover { background: var(--green-700); text-decoration: none; }

.tool-cards { display: grid; gap: 14px; margin-top: 24px; }
.tool-card {
  display: block; padding: 18px; border: 1px solid var(--gray-200); border-radius: 12px; color: inherit;
}
.tool-card:hover { border-color: var(--green-600); text-decoration: none; }
.tool-card h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--green-800); }
.tool-card p { margin: 0; font-size: 0.95rem; }

footer {
  border-top: 1px solid var(--gray-100); padding: 24px 16px; text-align: center;
  font-size: 0.85rem; color: var(--gray-500);
}

@media (max-width: 520px) {
  .hero h1 { font-size: 1.7rem; }
  /* Narrow phones: PCC moves out of the row; it is rarely anything but 0 */
  .hc-head, .hc-row { grid-template-columns: 18px repeat(3, minmax(0, 1fr)) 40px 26px; gap: 4px; }
  .hc-pcc { display: none; }
  .hc-row input { padding: 7px 5px; }
}
