:root {
  --ink: #16171a;
  --paper: #f7f6f3;
  --white: #ffffff;
  --line: #d8d6cf;
  --bronze: #a9772f;
  --bronze-dark: #7c5722;
  --muted: #6b6b66;
  --stripe: repeating-linear-gradient(
    135deg,
    var(--ink),
    var(--ink) 10px,
    var(--white) 10px,
    var(--white) 20px
  );
  --serif: "Source Serif Pro", Georgia, "Times New Roman", serif;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.5;
}

a { color: inherit; }

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

.site-header {
  background: var(--ink);
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
}

.stripe-bar {
  height: 6px;
  background: var(--stripe);
}

.header-inner {
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.brand {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--white);
}

.brand-with-logo {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-logo {
  height: 48px;
  width: auto;
  display: block;
}

.brand small {
  display: block;
  font-family: var(--sans);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--bronze);
  font-weight: 600;
  margin-top: 2px;
}

nav.main-nav {
  max-width: 1180px;
  margin: 14px auto 0;
  padding: 0 24px;
}

nav.main-nav ul {
  list-style: none;
  display: flex;
  margin: 0;
  padding: 0;
  border-top: 1px solid rgba(255,255,255,0.15);
  flex-wrap: wrap;
}

nav.main-nav > ul > li {
  position: relative;
}

nav.main-nav > ul > li > a,
nav.main-nav > ul > li > button {
  display: block;
  padding: 14px 18px;
  color: var(--white);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--sans);
}

nav.main-nav > ul > li > a:hover,
nav.main-nav > ul > li > button:hover,
nav.main-nav > ul > li.open > button {
  background: rgba(255,255,255,0.08);
  color: var(--bronze);
}

.submenu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: var(--white);
  color: var(--ink);
  min-width: 240px;
  max-height: min(70vh, 480px);
  overflow-y: auto;
  box-shadow: 0 12px 24px rgba(0,0,0,0.25);
  border-top: 3px solid var(--bronze);
  padding: 6px 0;
}

nav.main-nav > ul > li.open .submenu { display: block; }

.submenu a {
  display: block;
  padding: 10px 18px;
  text-decoration: none;
  font-size: 0.86rem;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

.submenu a:last-child { border-bottom: none; }
.submenu a:hover { background: var(--paper); color: var(--bronze-dark); }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(255,255,255,0.3);
  color: var(--white);
  padding: 8px 12px;
  font-size: 1rem;
  border-radius: 3px;
}

/* ---------- Main content ---------- */

main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 24px 80px;
  min-height: 60vh;
}

.page-title {
  font-family: var(--serif);
  font-size: 2rem;
  margin: 0 0 6px;
}

.page-eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--bronze-dark);
  margin: 0 0 10px;
}

.page-intro {
  color: var(--muted);
  max-width: 62ch;
  margin: 0 0 28px;
}

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

.hero {
  background: var(--ink);
  color: var(--white);
  padding: 64px 40px;
  margin: -40px -24px 40px;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -60px;
  top: -60px;
  width: 260px;
  height: 260px;
  background: var(--stripe);
  opacity: 0.12;
  transform: rotate(12deg);
}

.hero h1 {
  font-family: var(--serif);
  font-size: 2.6rem;
  margin: 0 0 12px;
  max-width: 18ch;
  position: relative;
}

.hero p {
  max-width: 52ch;
  color: rgba(255,255,255,0.75);
  font-size: 1.05rem;
  position: relative;
}

/* ---------- Home history timeline ---------- */

.history-section {
  margin: 8px 0 48px;
}

.history-heading {
  font-family: var(--serif);
  font-size: 1.8rem;
  margin: 0 0 24px;
  color: var(--ink);
}

.history-timeline {
  display: flex;
  flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--ink);
}

.history-entry {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 24px;
  padding: 20px 24px;
  border-bottom: 1px solid var(--line);
}

.history-entry:last-child { border-bottom: none; }

.history-year {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ink);
}

.history-text {
  color: #333;
  line-height: 1.7;
  font-size: 0.95rem;
}

.section-links {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.section-links a {
  display: block;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--ink);
  padding: 20px;
  text-decoration: none;
  color: var(--ink);
}

.section-links a:hover { border-left-color: var(--bronze); background: #fdfcfa; }

.section-links h3 {
  font-family: var(--serif);
  margin: 0 0 6px;
  font-size: 1.15rem;
}

.section-links p {
  margin: 0;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ---------- Controls (filters, search) ---------- */

.controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 20px;
  padding: 14px 16px;
  background: var(--white);
  border: 1px solid var(--line);
}

.controls label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-right: 6px;
}

.controls select,
.controls input[type="search"] {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 7px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}

.controls input[type="search"] { min-width: 220px; }

.print-btn-wrap { margin-left: auto; }

#print-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--ink);
  color: var(--white);
  border: none;
  padding: 8px 16px;
  cursor: pointer;
}

#print-btn:hover:not(:disabled) { background: var(--bronze-dark); }
#print-btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* ---------- Table ---------- */

.table-wrap {
  background: var(--white);
  border: 1px solid var(--line);
  overflow-x: auto;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  user-select: none;
}

table.data-table th {
  text-align: left;
  background: var(--ink);
  color: var(--white);
  padding: 10px 14px;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
  cursor: pointer;
}

table.data-table th:hover { color: var(--bronze); }

table.data-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}

table.data-table tbody tr:nth-child(even) { background: #fbfaf7; }
table.data-table tbody tr:hover { background: #f1ede4; }

.rank-cell { color: var(--bronze-dark); font-weight: 700; }

.pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  font-size: 0.85rem;
  color: var(--muted);
}

.pagination .btns { display: flex; gap: 8px; }

.pagination button {
  font-family: var(--sans);
  background: var(--white);
  border: 1px solid var(--line);
  padding: 7px 14px;
  cursor: pointer;
  font-size: 0.85rem;
}

.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination button:not(:disabled):hover { background: var(--ink); color: var(--white); }

.state-msg {
  padding: 40px 20px;
  text-align: center;
  color: var(--muted);
  background: var(--white);
  border: 1px dashed var(--line);
}

.state-msg.error { color: #a33; border-color: #e0b8b8; }

.placeholder-note {
  background: #fdf6e8;
  border: 1px solid #ecd9a8;
  color: #6b4f10;
  padding: 14px 18px;
  font-size: 0.85rem;
  margin-bottom: 20px;
}

/* ---------- AFL/VFL Players (blog-post style) ---------- */

.aflvfl-section { margin-bottom: 56px; }

.aflvfl-heading {
  font-family: var(--serif);
  font-size: 1.5rem;
  border-bottom: 2px solid var(--bronze);
  padding-bottom: 10px;
  margin: 0 0 8px;
}

.aflvfl-list {
  display: flex;
  flex-direction: column;
}

.aflvfl-post {
  max-width: 72ch;
  padding: 32px 0;
  border-bottom: 1px solid var(--line);
}

.aflvfl-list .aflvfl-post:last-child { border-bottom: none; }

.aflvfl-post-title {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  margin: 0 0 6px;
}

.aflvfl-post-meta {
  font-size: 0.82rem;
  color: var(--bronze-dark);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-weight: 600;
  margin: 0 0 18px;
}

.aflvfl-post-body p {
  margin: 0 0 16px;
  font-size: 1rem;
  color: var(--ink);
  line-height: 1.75;
}

.aflvfl-post-body p:last-child { margin-bottom: 0; }

/* ---------- Contact ---------- */

.contact-card {
  background: var(--white);
  border: 1px solid var(--line);
  padding: 28px;
  max-width: 480px;
}

.contact-card dt {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 14px;
}

.contact-card dd {
  margin: 2px 0 0;
  font-size: 1rem;
}

.contact-form {
  display: flex;
  flex-direction: column;
  max-width: 480px;
  background: var(--white);
  border: 1px solid var(--line);
  padding: 28px;
  gap: 6px;
}

.contact-form label {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  margin-top: 14px;
}

.contact-form label:first-of-type { margin-top: 0; }

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
  font-family: var(--sans);
  font-size: 0.95rem;
  padding: 9px 10px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  margin-top: 4px;
  resize: vertical;
}

.contact-form input:focus,
.contact-form textarea:focus {
  outline: 2px solid var(--bronze);
  outline-offset: 1px;
}

.contact-form button {
  margin-top: 20px;
  font-family: var(--sans);
  font-size: 0.9rem;
  font-weight: 600;
  background: var(--ink);
  color: var(--white);
  border: none;
  padding: 12px 20px;
  cursor: pointer;
}

.contact-form button:hover:not(:disabled) { background: var(--bronze-dark); }
.contact-form button:disabled { opacity: 0.6; cursor: not-allowed; }

.contact-form-status {
  margin: 14px 0 0;
  font-size: 0.85rem;
}

.contact-form-status.success { color: #2a7a3b; }
.contact-form-status.error { color: #a33; }

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

.site-footer {
  background: var(--ink);
  color: rgba(255,255,255,0.6);
  margin-top: 40px;
}

.footer-inner {
  max-width: 720px;
  margin: 0 auto;
  padding: 40px 24px 32px;
  text-align: center;
}

.footer-logo {
  height: 72px;
  width: auto;
  display: block;
  margin: 0 auto 20px;
}

.disclaimer {
  border-top: 1px solid rgba(255,255,255,0.15);
  padding-top: 20px;
  text-align: left;
}

.disclaimer-heading {
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 0.7rem;
  font-weight: 700;
  color: rgba(255,255,255,0.85);
  margin: 0 0 8px;
}

.disclaimer p:not(.disclaimer-heading) {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.55);
}

/* ---------- Responsive ---------- */

@media (max-width: 860px) {
  .nav-toggle { display: inline-block; }
  nav.main-nav { display: none; }
  nav.main-nav.open { display: block; }
  nav.main-nav ul { flex-direction: column; border-top: none; }
  nav.main-nav > ul > li > a,
  nav.main-nav > ul > li > button { width: 100%; text-align: left; }
  .submenu { position: static; box-shadow: none; width: 100%; }
  .hero h1 { font-size: 1.9rem; }
  .history-entry { grid-template-columns: 1fr; gap: 6px; }
  .brand-logo { height: 38px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

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

/* ---------- Print ---------- */

.print-area { display: none; }

@media print {
  header.site-header,
  main#content,
  footer.site-footer {
    display: none !important;
  }

  .print-area {
    display: block !important;
    background: #fff;
    color: #000;
    padding: 0;
    margin: 0;
  }

  .print-header {
    display: flex;
    align-items: center;
    gap: 20px;
    border-bottom: 3px solid #000;
    padding-bottom: 16px;
    margin-bottom: 10px;
  }

  .print-logo {
    height: 80px;
    width: auto;
  }

  .print-heading-text h1 {
    font-family: var(--serif);
    font-size: 1.6rem;
    margin: 0 0 4px;
    color: #000;
  }

  .print-club-name {
    margin: 0;
    font-size: 0.85rem;
    color: #444;
  }

  .print-meta {
    font-size: 0.8rem;
    color: #444;
    margin: 0 0 18px;
  }

  table.print-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
  }

  table.print-table th,
  table.print-table td {
    border: 1px solid #999;
    padding: 6px 10px;
    text-align: left;
  }

  table.print-table th {
    background: #eee;
    color: #000;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
  }

  table.print-table tr {
    page-break-inside: avoid;
  }

  @page {
    margin: 16mm;
  }
}
