/* TradeSanAngelo.com */

:root {
  --ink: #15202B;
  --ink-soft: #4A5361;
  --ground: #F4F6F8;
  --card: #FFFFFF;
  --line: #E1E5EA;
  --line-strong: #C9D0D7;
  --gold: #F2B544;
  --gold-text: #8A5A00;
  --teal: #1D6A84;
  --teal-dark: #154F63;
  --on-dark: #D5DCE3;
  --danger: #A12C1F;
  --ok-bg: #E4F2EA;
  --ok-text: #1E5B3A;
  --radius: 16px;
  --display: "Archivo", system-ui, sans-serif;
  --body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: var(--ground);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
body > main { flex: 1 0 auto; }

a { color: var(--teal); }
a:hover { color: var(--ink); }

img { max-width: 100%; height: auto; }

h1, h2, h3 { line-height: 1.1; }

.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 820px; }

.skip {
  position: absolute; left: -9999px; top: 8px;
  background: var(--gold); color: var(--ink); padding: 10px 14px; border-radius: 8px; z-index: 10;
}
.skip:focus { left: 8px; }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

.gold { color: var(--gold); }

/* ---------- Header ---------- */

.site-header { background: var(--ink); }
.header-row {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 12px; padding-top: 14px; padding-bottom: 14px;
}
.logo {
  display: flex; align-items: center; gap: 10px; padding: 8px 0;
  color: #fff; text-decoration: none;
  font-family: var(--display); font-weight: 800; font-size: 22px;
}
.logo:hover { color: #fff; }
.main-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.main-nav a { padding: 12px 14px; color: #fff; text-decoration: none; font-weight: 500; }
.main-nav a:hover { color: var(--gold); }
.main-nav a[aria-current="page"]:not(.btn) { color: var(--gold); font-weight: 600; }
.main-nav a.btn { margin-left: 6px; }
.main-nav a.btn:hover { color: var(--ink); }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 22px;
  border: 1px solid transparent; border-radius: 10px;
  font: inherit; font-weight: 600; text-decoration: none; cursor: pointer;
}
.btn-gold { background: var(--gold); color: var(--ink); }
.btn-gold:hover { background: #E9A72E; color: var(--ink); }
.btn-teal { background: var(--teal); color: #fff; }
.btn-teal:hover { background: var(--teal-dark); color: #fff; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-ink:hover { background: #26323F; color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line-strong); }
.btn-ghost:hover { border-color: var(--ink); color: var(--ink); }
.btn-danger { background: #fff; color: var(--danger); border-color: #E3B7B1; }
.btn-danger:hover { border-color: var(--danger); color: var(--danger); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 8px; }
.btn-lg { min-height: 54px; padding: 0 30px; font-size: 17px; border-radius: 12px; }

/* ---------- Forms ---------- */

label { font-weight: 600; font-size: 14px; }
.hint { font-weight: 400; color: var(--ink-soft); }
input[type="text"], input[type="email"], input[type="tel"], input[type="url"],
input[type="search"], input[type="password"], select, textarea {
  width: 100%; min-height: 46px; padding: 0 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  font: inherit; font-size: 16px; color: var(--ink); background: #fff;
}
textarea { padding: 12px; min-height: 110px; resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 3px solid rgba(29, 106, 132, 0.35); border-color: var(--teal); }
[aria-invalid="true"] { border-color: var(--danger); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-row { display: flex; flex-wrap: wrap; gap: 16px; }
.field-row > .field { flex: 1 1 280px; }
.field-error { margin: 0; color: var(--danger); font-size: 14px; font-weight: 500; }
.check { display: flex; gap: 12px; align-items: flex-start; font-weight: 400; font-size: 15px; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; }
.radio-list label, .check-list label {
  display: flex; align-items: center; gap: 10px; min-height: 36px; font-weight: 400; font-size: 15px;
}
.radio-list input, .check-list input { width: 18px; height: 18px; flex: none; }
fieldset { border: 0; margin: 0; padding: 0; }
legend { font-weight: 600; font-size: 15px; margin-bottom: 8px; padding: 0; }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.notice { padding: 14px 18px; border-radius: 12px; font-weight: 500; }
.notice-ok { background: var(--ok-bg); color: var(--ok-text); }
.notice-error { background: #FBE9E7; color: var(--danger); }

/* ---------- Cards & chips ---------- */

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
}
.panel { padding: 28px; display: flex; flex-direction: column; gap: 18px; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 20px; }
.card-grid.tight { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 18px; }

.listing-card {
  display: flex; flex-direction: column; gap: 12px; padding: 22px;
  text-decoration: none; color: var(--ink);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.listing-card:hover { color: var(--ink); border-color: var(--teal); box-shadow: 0 6px 20px rgba(21, 32, 43, 0.08); }
.card-meta { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; color: var(--ink-soft); }
.card-meta strong { font-weight: 600; }
.card-title { font-family: var(--display); font-size: 21px; font-weight: 700; line-height: 1.2; }
.trade-line { display: flex; gap: 10px; align-items: baseline; font-size: 15px; line-height: 1.4; }

.chip {
  flex: none; display: inline-block; min-width: 64px; text-align: center;
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px;
}
.chip-offer { background: var(--gold); color: var(--ink); }
.chip-want { background: var(--teal); color: #fff; }
.chip-lg { font-size: 12px; padding: 5px 12px; align-self: flex-start; }

/* ---------- Home ---------- */

.hero { background: var(--ink); color: #fff; padding: 72px 0 96px; }
.hero .wrap { display: flex; flex-direction: column; gap: 28px; }
.eyebrow {
  margin: 0; font-size: 15px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--gold);
}
.hero h1 {
  margin: 0; max-width: 900px;
  font-family: var(--display); font-weight: 800; font-size: clamp(2.6rem, 6vw, 4.75rem); line-height: 1.02;
}
.hero .lede { margin: 0; max-width: 640px; font-size: 20px; color: var(--on-dark); }
.hero-search {
  display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end;
  max-width: 920px; padding: 16px; background: #fff; border-radius: var(--radius); color: var(--ink);
}
.hero-search .field { flex: 1 1 260px; }
.hero-search label { color: var(--ink-soft); font-size: 13px; }
.hero-search input { min-height: 48px; }
.hero-search .btn { min-height: 50px; padding: 0 26px; }

.section { padding: 80px 0; }
.section-tight { padding: 0 0 80px; }
.section h2, .section-tight h2 { margin: 0; font-family: var(--display); font-size: 36px; font-weight: 800; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 28px; }
.section-head a { font-weight: 600; padding: 12px 0; }

.steps { display: flex; flex-wrap: wrap; gap: 20px; margin-top: 36px; }
.step { flex: 1 1 280px; padding: 28px; display: flex; flex-direction: column; gap: 10px; }
.step-num { font-family: var(--display); font-size: 44px; font-weight: 800; color: var(--teal); line-height: 1; }
.step h3 { margin: 0; font-size: 20px; font-weight: 600; }
.step p { margin: 0; color: var(--ink-soft); line-height: 1.55; }

.pills { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.pill {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px;
  background: #fff; border: 1px solid var(--line-strong); border-radius: 999px;
  color: var(--ink); text-decoration: none; font-weight: 500;
}
.pill:hover { border-color: var(--teal); color: var(--teal); }

.cta-band {
  background: var(--gold); border-radius: 20px; padding: 48px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 24px;
}
.cta-band h2 { margin: 0 0 8px; font-size: 34px; }
.cta-band p { margin: 0; font-size: 18px; max-width: 640px; }

.empty {
  padding: 40px; text-align: center; color: var(--ink-soft);
  display: flex; flex-direction: column; gap: 16px; align-items: center;
}
.empty p { margin: 0; font-size: 17px; }

/* ---------- Browse ---------- */

.page-head { background: #fff; border-bottom: 1px solid var(--line); padding: 40px 0; }
.page-head h1 { margin: 0 0 18px; font-family: var(--display); font-size: 40px; font-weight: 800; }
.search-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.search-row .field { flex: 1 1 420px; }
.search-row .btn { min-height: 48px; }

.with-sidebar {
  display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start;
  padding-top: 32px; padding-bottom: 72px;
}
.sidebar { flex: 1 1 240px; max-width: 300px; padding: 0; }
.sidebar summary {
  list-style: none; cursor: pointer; padding: 18px 22px; min-height: 44px;
  display: flex; justify-content: space-between; align-items: center; font-weight: 600;
}
.sidebar summary::-webkit-details-marker { display: none; }
.sidebar summary::after { content: "Show"; font-weight: 500; color: var(--teal); font-size: 14px; }
.sidebar[open] summary::after { content: "Hide"; }
.sidebar-body { padding: 0 22px 22px; display: flex; flex-direction: column; gap: 24px; }
.content { flex: 999 1 560px; min-width: 0; display: flex; flex-direction: column; gap: 20px; }
.results-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; color: var(--ink-soft); }
.results-bar p { margin: 0; }
.results-bar select { width: auto; min-height: 40px; }
.match-banner { padding: 16px 20px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.match-banner p { margin: 0; }

.pager { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; padding-top: 12px; }
.pager a, .pager span {
  min-width: 44px; min-height: 44px; padding: 0 14px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line-strong); border-radius: 10px; background: #fff;
  color: var(--ink); text-decoration: none;
}
.pager [aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.pager .disabled { color: #8A929C; border-color: var(--line); }

/* ---------- Listing ---------- */

.crumbs { font-size: 14px; color: var(--ink-soft); display: flex; gap: 8px; flex-wrap: wrap; }
.listing-page { padding-top: 28px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 24px; }
.listing-head h1 { margin: 0 0 8px; font-family: var(--display); font-size: clamp(2rem, 4.5vw, 2.75rem); font-weight: 800; line-height: 1.05; }
.listing-head p { margin: 0; color: var(--ink-soft); }
.trade-panels { display: flex; flex-wrap: wrap; gap: 18px; }
.trade-panel { flex: 1 1 300px; padding: 24px; display: flex; flex-direction: column; gap: 12px; }
.trade-panel h2 { margin: 0; font-size: 22px; font-weight: 600; line-height: 1.25; }
.trade-panel p { margin: 0; color: var(--ink-soft); line-height: 1.6; }
.contact-box { flex: 1 1 320px; max-width: 400px; padding: 24px; display: flex; flex-direction: column; gap: 16px; }
.contact-box h2 { margin: 0; font-family: var(--display); font-size: 24px; font-weight: 800; }
.contact-box p { margin: 0; color: var(--ink-soft); font-size: 15px; }
.matches h2 { margin: 0 0 6px; font-family: var(--display); font-size: 26px; font-weight: 800; }
.matches > p { margin: 0 0 14px; color: var(--ink-soft); }
.match-card { display: flex; flex-direction: column; gap: 6px; padding: 18px; text-decoration: none; color: var(--ink); }
.match-card:hover { border-color: var(--teal); color: var(--ink); }
.match-why { font-size: 13px; font-weight: 600; }
.match-why.offer { color: var(--teal); }
.match-why.want { color: var(--gold-text); }
.match-name { font-family: var(--display); font-size: 18px; font-weight: 700; }
.match-what { font-size: 15px; color: var(--ink-soft); }
.small-link { font-size: 14px; color: var(--ink-soft); }
.website-link { word-break: break-all; }

/* ---------- Post ---------- */

.post-page { padding-top: 48px; padding-bottom: 80px; display: flex; flex-direction: column; gap: 28px; }
.post-page h1 { margin: 0 0 10px; font-family: var(--display); font-size: 44px; font-weight: 800; }
.post-page .intro { margin: 0; font-size: 18px; color: var(--ink-soft); }
.panel h2 { margin: 0; font-size: 20px; font-weight: 600; }
.panel-title { display: flex; align-items: center; gap: 12px; }

/* ---------- Plain content pages ---------- */

.prose { padding-top: 48px; padding-bottom: 80px; }
.prose h1 { font-family: var(--display); font-size: 40px; font-weight: 800; margin: 0 0 20px; }
.prose h2 { font-size: 22px; margin: 32px 0 10px; }
.prose p, .prose li { font-size: 17px; line-height: 1.65; }

/* ---------- 404 ---------- */

.not-found { padding: 96px 24px; display: flex; justify-content: center; text-align: center; }
.not-found .inner { max-width: 640px; display: flex; flex-direction: column; align-items: center; gap: 20px; }
.not-found h1 { margin: 0; font-family: var(--display); font-size: clamp(2.4rem, 6vw, 3.25rem); font-weight: 800; line-height: 1.05; }
.not-found p { margin: 0; font-size: 18px; color: var(--ink-soft); }
.not-found .code { font-family: var(--display); font-weight: 700; font-size: 20px; }
.btn-row { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; padding-top: 8px; }

/* ---------- Footer ---------- */

.site-footer { background: var(--ink); color: var(--on-dark); padding: 44px 0; margin-top: auto; }
.site-footer .wrap { display: flex; flex-direction: column; gap: 14px; }
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 6px; }
.logo-text { font-family: var(--display); font-weight: 800; font-size: 20px; color: #fff; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: 4px; }
.site-footer nav a { padding: 10px 12px; color: var(--on-dark); }
.site-footer nav a:hover { color: #fff; }
.fine { margin: 0; font-size: 14px; line-height: 1.6; max-width: 820px; }

/* ---------- Admin ---------- */

.admin-badge {
  font-family: var(--body); font-size: 13px; font-weight: 600;
  padding: 4px 10px; border: 1px solid var(--ink-soft); border-radius: 999px; color: var(--on-dark);
}
.admin-page { padding-top: 36px; padding-bottom: 72px; display: flex; flex-direction: column; gap: 24px; }
.admin-page h1 { margin: 0; font-family: var(--display); font-size: 36px; font-weight: 800; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tabs a {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: #fff;
  color: var(--ink); text-decoration: none; font-weight: 600;
}
.tabs a[aria-current="page"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.count { font-size: 13px; font-weight: 600; padding: 1px 8px; border-radius: 999px; background: var(--ground); color: var(--ink); }
.tabs a[aria-current="page"] .count { background: var(--gold); }
.table-box { overflow-x: auto; }
.admin-table { width: 100%; min-width: 900px; border-collapse: collapse; font-size: 15px; }
.admin-table th {
  text-align: left; padding: 16px 18px; border-bottom: 1px solid var(--line);
  color: var(--ink-soft); font-size: 13px; text-transform: uppercase; letter-spacing: 0.06em;
}
.admin-table td { padding: 16px 18px; border-bottom: 1px solid var(--line); vertical-align: top; }
.admin-table tr:last-child td { border-bottom: 0; }
.admin-table .sub { font-size: 13px; color: var(--ink-soft); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
.actions form { margin: 0; }
.login-box { max-width: 420px; margin: 72px auto; padding: 32px; display: flex; flex-direction: column; gap: 18px; }
.login-box h1 { margin: 0; font-family: var(--display); font-size: 30px; font-weight: 800; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 14px; word-break: break-all; background: var(--ground); padding: 12px; border-radius: 8px; }

/* ---------- Layout helpers ---------- */

.page { min-height: 100vh; display: flex; flex-direction: column; }

@media (max-width: 640px) {
  .hero { padding: 48px 0 64px; }
  .hero .lede { font-size: 18px; }
  .section { padding: 56px 0; }
  .section h2, .section-tight h2 { font-size: 30px; }
  .cta-band { padding: 32px 24px; }
  .panel { padding: 22px; }
  .sidebar { max-width: none; }
  .contact-box { max-width: none; }
  .main-nav a.btn { margin-left: 0; }
}
