/* ===== Design tokens ===== */
:root {
  --color-bg: #ffffff;
  --color-bg-alt: #f7f8fa;
  --color-text: #2a2a2a;
  --color-text-muted: #5a5a5a;
  --color-heading: #313131;
  --color-accent: #008aff;
  --color-accent-dark: #0068c4;
  --color-border: #e3e6ea;
  --color-success-bg: #e6f7ec;
  --color-success-text: #1a7f3c;
  --color-error-bg: #fdecec;
  --color-error-text: #c0392b;
  --font-heading: 'Montserrat', Arial, sans-serif;
  --font-body: 'Merriweather', Georgia, serif;
  --radius: 10px;
  --shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
  --max-width: 1120px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--color-heading);
  line-height: 1.25;
  margin: 0 0 0.5em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.65rem; }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1em; }

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

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

.text-muted { color: var(--color-text-muted); }

/* ===== Buttons ===== */
.button {
  display: inline-block;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 0.7rem 1.5rem;
  border-radius: 999px;
  border: 2px solid var(--color-accent);
  background: var(--color-accent);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  text-align: center;
  transition: background 0.15s, color 0.15s, transform 0.1s;
}
.button:hover { background: var(--color-accent-dark); border-color: var(--color-accent-dark); text-decoration: none; }
.button:active { transform: translateY(1px); }
.button-secondary { background: transparent; color: var(--color-accent); }
.button-secondary:hover { background: var(--color-accent); color: #fff; }
.button-small { padding: 0.4rem 0.9rem; font-size: 0.85rem; border-radius: 6px; }
.button-danger { background: #c0392b; border-color: #c0392b; }
.button-danger:hover { background: #992d22; border-color: #992d22; }

/* ===== Flash messages ===== */
.flash {
  border-radius: var(--radius);
  padding: 0.9rem 1.2rem;
  margin: 1.25rem 0;
  font-family: var(--font-heading);
  font-size: 0.95rem;
}
.flash-success { background: var(--color-success-bg); color: var(--color-success-text); }
.flash-error { background: var(--color-error-bg); color: var(--color-error-text); }
.flash-info { background: #eaf4ff; color: var(--color-accent-dark); }

/* ===== Site notification banner ===== */
.site-banner {
  background: var(--color-accent-dark);
  color: #ffffff;
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.95rem;
  text-align: center;
}
.site-banner-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.65rem 1.5rem;
}

/* ===== Public site header / nav ===== */
.site-header {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-bg);
  position: sticky;
  top: 0;
  z-index: 20;
}
.site-header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--color-heading);
}
.brand:hover { text-decoration: none; }
.brand-logo { height: 48px; width: auto; }
.brand-name {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
}
.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.25rem;
}
.site-nav a {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--color-text);
  padding: 0.4rem 0.1rem;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover, .site-nav a.active {
  color: var(--color-accent);
  text-decoration: none;
  border-bottom-color: var(--color-accent);
}
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}
.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-heading);
}

.site-main { min-height: 60vh; }

/* ===== Hero ===== */
.hero { position: relative; background: var(--color-heading); }
.hero-banner { width: 100%; max-height: 380px; object-fit: cover; opacity: 0.55; }
.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 1.5rem;
  color: #fff;
}
.hero-content h1 { color: #fff; font-size: 2.5rem; }
.hero-content p { color: #f1f1f1; max-width: 640px; font-size: 1.1rem; }
.page-hero-simple {
  background: var(--color-bg-alt);
  padding: 2.5rem 1.5rem 2rem;
  text-align: center;
  border-bottom: 1px solid var(--color-border);
}

/* ===== Sections ===== */
/* Top/bottom only: the padding shorthand would override .container's
   horizontal gutters on elements carrying both classes. */
.section { padding-top: 3rem; padding-bottom: 3rem; }
.section-narrow { max-width: 760px; margin: 0 auto; }
.section-title { text-align: center; margin-bottom: 2rem; }

/* ===== Value props ===== */
.value-props {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.5rem;
}
.value-prop-card {
  background: var(--color-bg-alt);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}
.value-prop-title { font-size: 1.05rem; margin-bottom: 0.4rem; }
.value-prop-text { color: var(--color-text-muted); margin: 0; font-size: 0.95rem; }

/* ===== Info grid (When/Where) ===== */
.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}
.info-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.5rem;
}
.info-card h3 { color: var(--color-accent); }

/* ===== Photo block ===== */
.photo-block { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }

/* ===== Tables (league standings) ===== */
.table-wrap { overflow-x: auto; margin: 1.5rem 0; }
table.table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-heading);
  font-size: 0.92rem;
}
table.table th, table.table td {
  padding: 0.6rem 0.8rem;
  text-align: left;
  border-bottom: 1px solid var(--color-border);
}
table.table th {
  background: var(--color-bg-alt);
  font-weight: 700;
  color: var(--color-heading);
}
table.table tr.is-norton td { background: #eaf4ff; font-weight: 700; }
table.table td.num, table.table th.num { text-align: center; }

.match-list { list-style: none; margin: 1.5rem 0; padding: 0; }
.match-list li {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.95rem;
}
.match-list .match-date { color: var(--color-text-muted); min-width: 110px; }
.match-list .match-score { font-weight: 700; font-family: var(--font-heading); }

/* ===== Division links ===== */
.division-links { display: flex; gap: 1.5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.division-links a.button { min-width: 180px; }

/* ===== News ===== */
.news-list { display: flex; flex-direction: column; gap: 1.75rem; margin: 1.5rem 0; }
.news-card { border-bottom: 1px solid var(--color-border); padding-bottom: 1.75rem; }
.news-date {
  font-family: var(--font-heading);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.8rem;
  color: var(--color-accent);
  font-weight: 700;
}
.news-title { margin: 0.25rem 0 0.5rem; }
.news-title a { color: var(--color-heading); }
.post-content { font-size: 1.05rem; }
.post-content h2, .post-content h3 { margin-top: 1.5em; }
.post-meta { color: var(--color-text-muted); margin-bottom: 2rem; font-family: var(--font-heading); font-size: 0.9rem; }
.pagination { display: flex; justify-content: space-between; margin-top: 2rem; }

/* ===== Policies ===== */
.policies-list { list-style: none; padding: 0; margin: 1.5rem 0; display: flex; flex-direction: column; gap: 1rem; }
.policy-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  padding: 1.1rem 1.4rem;
}

/* ===== Forms ===== */
.form { max-width: 560px; margin: 1.5rem 0; }
.form-group { margin-bottom: 1.25rem; }
.form-label { display: block; font-family: var(--font-heading); font-weight: 600; margin-bottom: 0.4rem; font-size: 0.92rem; }
.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 0.65rem 0.8rem;
  border: 1px solid var(--color-border);
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: #fff;
  color: var(--color-text);
}
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(0, 138, 255, 0.15);
}
.form-checkbox-row { display: flex; align-items: flex-start; gap: 0.6rem; }
.form-checkbox-row input { margin-top: 0.3rem; width: 1.15rem; height: 1.15rem; flex-shrink: 0; }
.form-hint { font-size: 0.85rem; color: var(--color-text-muted); margin-top: 0.3rem; }
.form-error-text { color: var(--color-error-text); font-size: 0.85rem; margin-top: 0.3rem; }
.form-actions { margin-top: 1.5rem; }

/* ===== Footer ===== */
.site-footer {
  border-top: 1px solid var(--color-border);
  background: var(--color-bg-alt);
  margin-top: 3rem;
}
.site-footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  text-align: center;
}
.footer-logo { height: 56px; }
.footer-links { display: flex; gap: 1.5rem; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-family: var(--font-heading); font-weight: 600; font-size: 0.9rem; }
.footer-copy { color: var(--color-text-muted); font-size: 0.85rem; margin: 0; }

/* ===== Admin: login ===== */
.admin-login-body {
  background: var(--color-bg-alt);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  padding: 1.5rem;
}
.admin-login-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 2.5rem;
  max-width: 380px;
  width: 100%;
  text-align: center;
}
.admin-login-logo { height: 64px; margin: 0 auto 1rem; }
.admin-login-card .button { width: 100%; margin-top: 1rem; }
.admin-login-back { margin-top: 1.5rem; font-size: 0.9rem; }

/* ===== Admin: chrome ===== */
.admin-body { background: var(--color-bg-alt); }
.admin-header { background: var(--color-heading); color: #fff; }
.admin-header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
}
.admin-brand { display: flex; align-items: center; gap: 0.5rem; color: #fff; font-family: var(--font-heading); font-weight: 700; }
.admin-brand:hover { text-decoration: none; }
.admin-brand-logo { height: 32px; }
.admin-nav { display: flex; gap: 1rem; flex-wrap: wrap; flex: 1; }
.admin-nav a { color: #d7dee6; font-family: var(--font-heading); font-size: 0.88rem; font-weight: 600; }
.admin-nav a:hover, .admin-nav a.active { color: #fff; text-decoration: none; }
.admin-header-user { display: flex; align-items: center; gap: 0.75rem; font-size: 0.85rem; color: #d7dee6; }
.admin-main { max-width: 1280px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.admin-panel { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.75rem; margin-bottom: 1.5rem; }
.admin-panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.25rem; flex-wrap: wrap; gap: 1rem; }

.dashboard-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1.25rem; margin-bottom: 2rem; }
.dashboard-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem; text-decoration: none; color: var(--color-text); display: block; }
.dashboard-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.1); text-decoration: none; }
.dashboard-card .count { font-family: var(--font-heading); font-size: 2rem; font-weight: 700; color: var(--color-accent); }
.dashboard-card .label { color: var(--color-text-muted); font-size: 0.9rem; }

table.table-admin { width: 100%; border-collapse: collapse; }
table.table-admin th, table.table-admin td { padding: 0.6rem 0.7rem; border-bottom: 1px solid var(--color-border); text-align: left; font-size: 0.92rem; }
table.table-admin th { background: var(--color-bg-alt); font-family: var(--font-heading); }
table.table-admin .row-actions { display: flex; gap: 0.5rem; }

.badge { display: inline-block; padding: 0.15rem 0.6rem; border-radius: 999px; font-size: 0.75rem; font-family: var(--font-heading); font-weight: 700; background: var(--color-border); color: var(--color-text-muted); }
.badge-unread { background: var(--color-accent); color: #fff; }

.empty-state { text-align: center; padding: 3rem 1rem; color: var(--color-text-muted); }

/* ===== Responsive ===== */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    flex-direction: column;
    width: 100%;
    padding-top: 0.5rem;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 0.65rem 0; }
  .site-header-inner { flex-wrap: wrap; }
  h1 { font-size: 1.8rem; }
  .admin-nav { order: 3; width: 100%; }
  .admin-nav a { padding: 0.5rem 0; }

  /* The banner photo is short at phone widths; overlaying it clips the text
     onto the white page below. Let the content size the hero instead, with
     the photo as a full-bleed backdrop. Content must stay positioned
     (relative, not static) or the absolutely-positioned translucent photo
     paints over the text and dims it. */
  .hero-banner { position: absolute; inset: 0; height: 100%; object-fit: cover; }
  .hero-content { position: relative; padding: 2.5rem 1.5rem; }
  .hero-content h1 { font-size: 1.8rem; }
  .hero-content p { font-size: 1rem; }
}

@media (max-width: 640px) {
  table.table { font-size: 0.85rem; }
  table.table th, table.table td { padding: 0.5rem 0.45rem; }

  /* Drop the game-points columns so Pos..Pts fits without side-scrolling. */
  .standings-table th:nth-child(7), .standings-table td:nth-child(7),
  .standings-table th:nth-child(8), .standings-table td:nth-child(8) { display: none; }

  .match-list li { flex-wrap: wrap; row-gap: 0.1rem; }
  .match-list .match-date { min-width: 100%; font-size: 0.85rem; }
}
