/* CheckMyBat.com — baseball-themed, parent-friendly, mobile-first */
@import url("https://fonts.googleapis.com/css2?family=Oswald:wght@500;600;700&family=Source+Sans+3:ital,wght@0,400;0,600;0,700;1,400&display=swap");

:root {
  --bg: #f3efe4;
  --bg-deep: #e8e0d0;
  --card: #fbf7ef;
  --ink: #1c2430;
  --muted: #5c6573;
  --line: #d9d0bf;
  --navy: #1a2740;
  --navy-mid: #243552;
  --brand: #1a2740;
  --brand-dark: #0f1828;
  --red: #c8102e;
  --red-dark: #9e0c24;
  --leather: #b8895a;
  --leather-light: #e8d4b8;
  --tan: #c4a574;
  --cream: #f7f2e8;
  --grass: #2d6a3e;
  --grass-light: #e6f2ea;
  --yes: #2d6a3e;
  --yes-bg: #e6f2ea;
  --no: #c8102e;
  --no-bg: #fde8ea;
  --warn: #8a5a00;
  --warn-bg: #fff4d9;
  --accent: #c8102e;
  --radius: 12px;
  --shadow: 0 2px 8px rgba(26, 39, 64, 0.08);
  --shadow-hover: 0 4px 14px rgba(26, 39, 64, 0.12);
  --max: 860px;
  --font: "Source Sans 3", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Oswald", "Segoe UI", system-ui, sans-serif;
  --stitch: url("../img/stitch-divider.svg");
  --bat-divider: url("../img/wood-bat-strip.png");
  --ball-divider: url("../img/baseball-row-strip.png");
  --field: url("../img/field-pattern.svg");
  --ball: url("../img/ball-mark.svg");
  --hero-ball: url("../img/hero-ball.png");
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    linear-gradient(180deg, rgba(243, 239, 228, 0.92), rgba(243, 239, 228, 0.97)),
    var(--field),
    var(--bg);
  background-size: auto, 160px 160px, auto;
  line-height: 1.55;
  font-size: 17px;
}

a { color: var(--red-dark); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--navy); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 1.1rem; }

/* Header — navy nav, then baseball row + wood bat strip (no solid red line) */
.site-header {
  background: linear-gradient(180deg, var(--navy) 0%, var(--navy-mid) 100%);
  color: #fff;
  padding: 0.75rem 0 0;
  border-bottom: none;
  box-shadow: none;
  position: relative;
}
.site-header::after {
  content: "";
  display: block;
  /* ~26px baseballs + ~52px wood bats */
  height: 82px;
  margin-top: 0.55rem;
  background-color: var(--bg);
  background-image:
    var(--ball-divider),
    var(--bat-divider);
  background-repeat: repeat-x, repeat-x;
  background-position: center top 2px, center bottom 4px;
  background-size: auto 26px, auto 52px;
  border-top: none;
  box-shadow: inset 0 1px 0 rgba(15, 24, 40, 0.12);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.logo-mark {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(0,0,0,0.25));
}
.logo-text span,
.logo span { color: var(--red); }
.nav { display: flex; gap: 1rem; flex-wrap: wrap; font-size: 0.95rem; font-weight: 600; }
.nav a {
  color: #d7dde8;
  text-decoration: none;
  padding: 0.2rem 0;
  border-bottom: 2px solid transparent;
}
.nav a:hover {
  color: #fff;
  border-bottom-color: var(--red);
}

/* Hero — diamond / dirt / ball watermark */
.hero {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(155deg, rgba(26, 39, 64, 0.94) 0%, rgba(36, 53, 82, 0.9) 45%, rgba(45, 106, 62, 0.55) 100%),
    var(--hero-ball),
    var(--field),
    var(--navy);
  background-size: auto, min(420px, 70vw) auto, 160px 160px, auto;
  background-position: center, right -40px center, center, center;
  background-repeat: no-repeat, no-repeat, repeat, no-repeat;
  color: #fff;
  padding: 2.5rem 0 2.7rem;
  border-bottom: 4px solid var(--tan);
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ball) right 8% center / min(180px, 28vw) no-repeat;
  opacity: 0.12;
  pointer-events: none;
}
.hero .wrap { position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 0.6rem;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(1.75rem, 4.5vw, 2.45rem);
  line-height: 1.15;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.hero p { margin: 0 0 1.2rem; color: #e4ebf5; max-width: 38rem; }
.search-box {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  max-width: 34rem;
}
.search-box input {
  flex: 1 1 14rem;
  padding: 0.8rem 0.95rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-size: 1rem;
  font-family: var(--font);
  background: var(--cream);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.search-box input:focus {
  outline: none;
  border-color: var(--red);
}
.search-box button {
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: var(--radius);
  background: var(--red);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  font-size: 1rem;
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  box-shadow: 0 2px 0 var(--red-dark);
}
.search-box button:hover { filter: brightness(1.08); }
.search-hint { margin-top: 0.55rem; font-size: 0.85rem; color: #b7c9dc; }

/* Content */
main { padding: 1.75rem 0 3rem; }
main h2, .card h2, .card h3, h1.page-title {
  font-family: var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-weight: 600;
}
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.25rem 1.35rem;
  margin-bottom: 1.1rem;
  border-top: 3px solid var(--leather);
}
.card h2, .card h3 { margin-top: 0; color: var(--navy); }
.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.disclaimer {
  background: var(--warn-bg);
  border: 1px solid #e6c97a;
  border-left: 4px solid var(--warn);
  color: var(--warn);
  border-radius: var(--radius);
  padding: 0.9rem 1rem;
  font-size: 0.95rem;
  margin: 1.2rem 0;
}

/* Stitch divider utility */
.stitch-rule {
  height: 12px;
  background: var(--stitch) center / 200px 12px repeat-x;
  margin: 1.25rem 0;
  opacity: 0.75;
  border: 0;
}

/* Legality chips */
.legality-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.6rem;
  margin: 1rem 0;
}
.chip {
  border-radius: 8px;
  padding: 0.7rem 0.8rem;
  text-align: center;
  font-weight: 700;
  font-size: 0.92rem;
  border: 1px solid transparent;
  font-family: var(--font);
}
.chip .label { display: block; font-weight: 600; font-size: 0.78rem; opacity: 0.85; margin-bottom: 0.15rem; text-transform: none; }
.chip.yes { background: var(--yes-bg); color: var(--yes); border-color: #a8d4b5; }
.chip.no { background: var(--no-bg); color: var(--no); border-color: #f0b4bb; }
.chip.warn { background: var(--warn-bg); color: var(--warn); border-color: #e6c97a; }

/* Lists / grids */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.85rem;
}
.list-card {
  display: block;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  text-decoration: none;
  color: inherit;
  box-shadow: var(--shadow);
  transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
  border-left: 4px solid var(--tan);
  position: relative;
}
.list-card:hover {
  border-color: var(--leather);
  border-left-color: var(--red);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  color: inherit;
}
.list-card strong {
  display: block;
  color: var(--navy);
  margin-bottom: 0.25rem;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 1.02rem;
}
.list-card .meta { color: var(--muted); font-size: 0.88rem; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  margin-right: 0.35rem;
  font-family: var(--font-display);
}
.badge.usa { background: #e8eef8; color: #1a4a8a; border: 1px solid #c5d4ea; }
.badge.usssa { background: #f3e8fa; color: #6b2d8b; border: 1px solid #dfc8ef; }
.badge.bbcor { background: var(--grass-light); color: var(--grass); border: 1px solid #b5d9c0; }

/* Spec table */
.spec-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
  margin: 0.8rem 0 1.2rem;
}
.spec-table th, .spec-table td {
  text-align: left;
  padding: 0.55rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
.spec-table th { width: 38%; color: var(--muted); font-weight: 600; }

/* Buttons / CTAs */
.btn-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 1rem 0; }
.btn {
  display: inline-block;
  padding: 0.7rem 1.1rem;
  border-radius: 8px;
  font-weight: 700;
  text-decoration: none;
  font-size: 0.95rem;
  font-family: var(--font-display);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}
.btn-primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 0 var(--red-dark);
}
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-secondary {
  background: var(--cream);
  color: var(--navy);
  border: 2px solid var(--navy);
}
.btn-secondary:hover { background: var(--leather-light); color: var(--navy); }
.affiliate-note {
  font-size: 0.82rem;
  color: var(--muted);
  margin-top: 0.4rem;
}

/* Footer */
.site-footer {
  border-top: 4px solid var(--navy);
  background:
    linear-gradient(180deg, #ebe4d4 0%, #e0d6c2 100%);
  padding: 1.6rem 0 2.2rem;
  font-size: 0.9rem;
  color: var(--muted);
  position: relative;
}
.site-footer::before {
  content: "";
  display: block;
  height: 8px;
  background: var(--stitch) center / 200px 12px repeat-x;
  margin: -1.6rem 0 1rem;
  opacity: 0.85;
}
.site-footer a { color: var(--navy-mid); }
.site-footer a:hover { color: var(--red); }
.site-footer .wrap { display: grid; gap: 0.6rem; }
.site-footer strong { color: var(--navy); font-family: var(--font-display); letter-spacing: 0.03em; text-transform: uppercase; }
.updated { font-size: 0.85rem; color: var(--muted); margin-top: 1.5rem; }

/* Search results overlay on home */
#search-results { margin-top: 1rem; }
#search-results.hidden { display: none; }
.result-item {
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--line);
}
.result-item:last-child { border-bottom: none; }
.result-item a { font-weight: 600; text-decoration: none; color: var(--navy); }
.result-item a:hover { color: var(--red); }
.result-item .meta { font-size: 0.88rem; color: var(--muted); }

h1.page-title {
  font-size: clamp(1.5rem, 3.5vw, 2rem);
  margin: 0 0 0.4rem;
  color: var(--navy);
}
.breadcrumbs {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}
.breadcrumbs a { color: var(--muted); }
.breadcrumbs a:hover { color: var(--red); }

ul.clean { padding-left: 1.2rem; }
ul.clean li { margin-bottom: 0.35rem; }
ol.clean { padding-left: 1.2rem; }
ol.clean li { margin-bottom: 0.45rem; }

/* Decorative diamond accent next to page titles on inner pages */
.page-title::before {
  content: "";
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-right: 0.35em;
  vertical-align: -0.05em;
  background: url("../img/diamond.svg") center / contain no-repeat;
}

@media (max-width: 520px) {
  .nav { width: 100%; gap: 0.75rem; }
  .hero {
    padding: 1.8rem 0 2rem;
    background-position: center, right -80px center, center, center;
    background-size: auto, 280px auto, 160px 160px, auto;
  }
  .logo { font-size: 1.15rem; }
  .logo-mark { width: 32px; height: 32px; }
}

/* Dual search panels (bats + leagues) */
.search-panels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 0.9rem;
  margin-top: 0.35rem;
}
.search-panel {
  background: rgba(15, 24, 40, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  padding: 0.85rem 0.95rem 1rem;
  backdrop-filter: blur(2px);
}
.search-label {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-size: 0.92rem;
  color: #fff;
  margin-bottom: 0.45rem;
}
.search-label-dark { color: var(--navy); }
.search-panel .search-box { max-width: none; }
.search-panel .search-hint { color: #b7c9dc; margin: 0.45rem 0 0; }
.search-hint-dark { color: var(--muted) !important; }
.tip-line { margin-top: 0.85rem; }
.search-panel-inline {
  margin: 1rem 0 1.25rem;
  border-top-color: var(--red);
}
.search-panel-inline .search-box button {
  background: var(--red);
  color: #fff;
  box-shadow: 0 2px 0 var(--red-dark);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-weight: 700;
  border: none;
  border-radius: var(--radius);
  padding: 0.8rem 1.2rem;
  cursor: pointer;
  font-size: 1rem;
}
.search-panel-inline .search-box input {
  border: 2px solid var(--line);
  background: #fff;
}
.search-panel-inline .search-box input:focus {
  outline: none;
  border-color: var(--red);
}
.search-results {
  margin-top: 0.75rem;
  color: var(--ink);
  background: var(--card);
}
.search-results.hidden { display: none; }
.result-type {
  display: inline-block;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  font-family: var(--font-display);
  background: var(--grass-light);
  color: var(--grass);
  border: 1px solid #b5d9c0;
  border-radius: 3px;
  padding: 0.1rem 0.35rem;
  margin-right: 0.25rem;
  vertical-align: middle;
}
.result-type.bat {
  background: #e8eef8;
  color: #1a4a8a;
  border-color: #c5d4ea;
}

@media (max-width: 520px) {
  .search-panels { grid-template-columns: 1fr; }
  .search-panel .search-box button { width: 100%; }
}
