/* Ayrshire.io — design tokens
   Palette drawn from the strategy doc: deep harbour navy, firth teal,
   sandstone cream, gorse gold. Signature: each county keeps its own colour
   (South = navy, North = teal, East = green) across links, cards and pins,
   so "which Ayrshire am I in?" is always answered visually. */
:root {
  --navy: #17456e;
  --teal: #0e7c86;
  --green: #2e7d4f;
  --gold: #c08a2d;
  --cream: #f7f3ea;
  --card: #fffdf8;
  --ink: #1e2a33;
  --muted: #6b7681;
  --line: #e4ddcd;
  --radius: 14px;
  --display: "Bricolage Grotesque", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font-family: var(--body); font-size: 16px; line-height: 1.55;
}
h1, h2, h3, .brand { font-family: var(--display); line-height: 1.12; }
h1 { font-size: clamp(1.7rem, 4.5vw, 2.6rem); font-weight: 800; margin: .3em 0 .4em; }
h2 { font-size: clamp(1.25rem, 3vw, 1.6rem); font-weight: 800; margin: 0 0 .7em; }
h3 { font-size: 1.05rem; font-weight: 600; margin: .2em 0; }
a { color: var(--navy); }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--gold); outline-offset: 2px;
}
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 18px; }
.band { padding: 34px 18px; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }

/* ---- header ---- */
.site-head { background: var(--navy); color: #fff; }
.head-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; padding: 14px 18px; }
.brand { color: #fff; text-decoration: none; font-weight: 800; font-size: 1.3rem; letter-spacing: .02em; }
.brand span { color: var(--gold); }
.main-nav { display: flex; gap: 14px; flex-wrap: wrap; margin-right: auto; }
.main-nav a { color: #dfe8f0; text-decoration: none; font-weight: 500; font-size: .92rem; padding: 4px 2px; border-bottom: 2px solid transparent; }
.main-nav a:hover { border-color: var(--gold); color: #fff; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* county colour system */
.c-south-ayrshire { --county: var(--navy); }
.c-north-ayrshire { --county: var(--teal); }
.c-east-ayrshire  { --county: var(--green); }
.county-link.c-south-ayrshire:hover { border-color: #6ea6d8; }
.county-link.c-north-ayrshire:hover { border-color: #58c2cb; }
.county-link.c-east-ayrshire:hover  { border-color: #6fbf8f; }

/* ---- buttons ---- */
.btn {
  display: inline-block; border: 0; border-radius: 999px; cursor: pointer;
  padding: 9px 18px; font: 600 .92rem var(--body); text-decoration: none; text-align: center;
}
.btn-gold  { background: var(--gold); color: #fff; }
.btn-gold:hover  { background: #a97722; }
.btn-navy  { background: var(--navy); color: #fff; }
.btn-navy:hover  { background: #103351; }
.btn-wa    { background: #1fa855; color: #fff; }
.btn-ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn-block { display: block; width: 100%; margin-bottom: 9px; }

/* ---- hero ---- */
.hero { background: linear-gradient(160deg, var(--navy) 55%, var(--teal)); color: #fff; padding: 56px 0 60px; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; font-size: .78rem; color: var(--gold); font-weight: 600; margin: 0 0 10px; }
.hero h1 { font-size: clamp(2.1rem, 6vw, 3.4rem); margin: 0 0 14px; }
.hero-sub { max-width: 520px; color: #dfe8f0; margin: 0 0 22px; }
.hero-search { display: flex; gap: 8px; max-width: 560px; }
.hero-search input {
  flex: 1; border: 0; border-radius: 999px; padding: 12px 20px; font: 400 1rem var(--body);
}

/* ---- county cards ---- */
.county-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.county-card {
  background: var(--card); border-left: 6px solid var(--county); border-radius: var(--radius);
  padding: 18px 20px; text-decoration: none; color: var(--ink);
  box-shadow: 0 1px 3px rgba(30, 42, 51, .08); display: block;
}
.county-card:hover { box-shadow: 0 4px 14px rgba(30, 42, 51, .14); }
.county-name { font-family: var(--display); font-weight: 800; font-size: 1.15rem; color: var(--county); display: block; }
.county-towns { color: var(--muted); font-size: .85rem; }

/* ---- chips ---- */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--card); border: 1px solid var(--line); border-radius: 999px;
  padding: 7px 14px; text-decoration: none; color: var(--ink); font-size: .9rem;
}
.chip:hover { border-color: var(--navy); }
.chip-sm { padding: 4px 11px; font-size: .82rem; }

/* ---- listing cards ---- */
.card-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card {
  position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; text-decoration: none; color: var(--ink); display: flex; flex-direction: column; gap: 6px;
}
.card:hover { border-color: var(--navy); box-shadow: 0 4px 14px rgba(30, 42, 51, .1); }
.card-cat { text-transform: uppercase; letter-spacing: .1em; font-size: .7rem; font-weight: 600; color: var(--muted); }
.card-desc { color: var(--muted); font-size: .9rem; margin: 0; flex: 1; }
.card-meta { display: flex; justify-content: space-between; align-items: center; }
.pin { font-size: .85rem; font-weight: 600; color: var(--county, var(--navy)); }
.pin::before { content: "📍 "; }
.price { font-weight: 700; color: var(--gold); }
.price-lg { font-size: 1.25rem; }
.badge {
  display: inline-block; border-radius: 999px; font-size: .72rem; font-weight: 700;
  padding: 3px 10px; margin-bottom: 4px;
}
.badge-feat { background: #f7e6c4; color: #7a5410; }
.badge-warn { background: #f8d7d2; color: #8a2d1e; }

/* ---- listing page ---- */
.listing-grid { display: grid; gap: 26px; grid-template-columns: 2fr 1fr; align-items: start; }
.listing-main { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.listing-desc { margin-top: 14px; }
.coverage { margin-top: 16px; font-size: .92rem; }
.contact-box {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 20px; position: sticky; top: 16px;
}
.report summary { cursor: pointer; font-size: .85rem; color: var(--muted); margin-top: 12px; }
.report textarea { width: 100%; min-height: 70px; margin: 8px 0; }
.crumbs { font-size: .85rem; color: var(--muted); margin-bottom: 4px; }
.crumbs a { color: var(--muted); }
.page-intro { max-width: 640px; color: var(--muted); margin-top: 0; }

/* ---- forms ---- */
.stack { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.form-narrow { max-width: 440px; }
.form-page label { display: flex; flex-direction: column; gap: 5px; font-weight: 600; font-size: .92rem; }
input, select, textarea {
  border: 1.5px solid var(--line); border-radius: 9px; padding: 10px 12px;
  font: 400 1rem var(--body); background: #fff;
}
.two-col { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
.inline-search { display: flex; gap: 8px; margin: 14px 0 22px; max-width: 460px; }
.inline-search input { flex: 1; }


.account-panel, .town-checks-wrap {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 18px; margin-top: 4px;
}
.account-panel h2 { margin-bottom: 4px; }
.field-head { font-weight: 700; margin: 0 0 10px; }
.town-checks { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.town-check-group { border-top: 1px solid var(--line); padding-top: 10px; }
.town-check-group p { margin: 0 0 7px; font-weight: 700; color: var(--navy); font-size: .9rem; }
.form-page label.check-pill {
  display: grid !important; grid-template-columns: 20px 1fr; align-items: center;
  gap: 9px !important; font-weight: 500 !important; padding: 6px 0; line-height: 1.25;
}
.form-page label.check-pill input { width: 18px; height: 18px; padding: 0; margin: 0; }
.form-page label.check-pill span { display: block; }

/* ---- product cards ---- */
.product-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); margin: 20px 0; }
.product-card { background: var(--card); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 20px; }
.product-name { font-weight: 700; margin: 0; }
.product-price { font-family: var(--display); font-weight: 800; font-size: 1.7rem; color: var(--gold); margin: 6px 0; }
.product-desc { color: var(--muted); font-size: .88rem; min-height: 3em; }

/* ---- tables / admin ---- */
.table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
.table th, .table td { text-align: left; padding: 11px 13px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { background: var(--navy); color: #fff; font-size: .82rem; }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }
.actions .btn { padding: 5px 11px; font-size: .8rem; }
.status { border-radius: 999px; padding: 3px 11px; font-size: .78rem; font-weight: 700; }
.s-active { background: #d9edd9; color: #1e5a1e; }
.s-pending { background: #f7e6c4; color: #7a5410; }
.s-hidden, .s-expired { background: #eee; color: #666; }
.stat-row { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 18px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 18px; font-size: .85rem; color: var(--muted); }
.stat-n { font-family: var(--display); font-weight: 800; font-size: 1.4rem; color: var(--ink); display: block; }
.tab-row { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 16px; }
.tab { padding: 7px 14px; border-radius: 999px; text-decoration: none; color: var(--ink); font-size: .88rem; }
.tab-on { background: var(--navy); color: #fff; }
.row-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.plain-list { columns: 2; padding-left: 18px; }

/* ---- misc ---- */
.flash { background: #d9edd9; color: #1e5a1e; border-radius: 9px; padding: 12px 16px; margin: 14px 0; }
.flash-err { background: #f8d7d2; color: #8a2d1e; }
.empty { background: var(--card); border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; }
.cta-band .cta-box { background: var(--navy); color: #fff; border-radius: var(--radius); padding: 34px; text-align: center; }
.cta-box p { max-width: 520px; margin: 0 auto 18px; color: #dfe8f0; }
.also { margin-top: 30px; }
.foot-head { text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; font-weight: 700; color: var(--muted); margin: 0 0 8px; }

/* ---- footer ---- */
.site-foot { background: var(--ink); color: #cfd6db; margin-top: 40px; padding: 36px 0 20px; }
.foot-grid { display: grid; gap: 24px; grid-template-columns: 2fr 1fr 1fr 1fr; }
.site-foot a { color: #cfd6db; display: block; font-size: .88rem; text-decoration: none; padding: 2px 0; }
.site-foot a:hover { color: #fff; }
.brand-foot { font-family: var(--display); font-weight: 800; color: #fff; }
.foot-legal { border-top: 1px solid #37444f; margin-top: 26px; padding-top: 14px; font-size: .8rem; }

@media (max-width: 760px) {
  .listing-grid, .two-col, .foot-grid { grid-template-columns: 1fr; }
  .contact-box { position: static; }
  .head-inner { gap: 10px; }
  .plain-list { columns: 1; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* final mobile checkbox alignment override */
.form-page .town-checks label.check-pill {
  display: grid !important;
  grid-template-columns: 20px minmax(0, 1fr) !important;
  align-items: center !important;
  gap: 9px !important;
  padding: 6px 0 !important;
  font-weight: 500 !important;
}
.form-page .town-checks label.check-pill input[type="checkbox"] {
  width: 18px !important;
  min-width: 18px !important;
  height: 18px !important;
  margin: 0 !important;
  padding: 0 !important;
}
.form-page .town-checks label.check-pill span {
  display: block !important;
}
