/* ==========================================================================
   Middlesex Youth Soccer League — shared stylesheet
   Palette taken from the league logo: green, black, white.
   Plain CSS, no build step. Loaded by every page.
   ========================================================================== */

:root {
  --green-800: #05532b;
  --green-700: #07713b;
  --green-600: #0b8a48;
  --green-500: #12a557;
  --green-100: #dcf3e5;
  --green-50:  #f0fdf4;

  --ink:     #14181d;
  --ink-2:   #39424d;
  --muted:   #5b6672;
  --line:    #e2e6ea;
  --surface: #ffffff;
  --surface-2: #f4f7f5;
  --bg:      #f7f9f8;

  --red-600: #c0392b;
  --amber-100: #fdf3d7;
  --amber-700: #8a6100;

  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 2px rgba(20, 24, 29, .06), 0 4px 14px rgba(20, 24, 29, .06);
  --shadow-lg: 0 2px 6px rgba(20, 24, 29, .08), 0 12px 28px rgba(20, 24, 29, .10);

  --wrap: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --green-100: #10331f;
    --ink:     #e8edf0;
    --ink-2:   #c2ccd4;
    --muted:   #97a3ad;
    --line:    #2b333b;
    --surface: #171c21;
    --surface-2: #1e242a;
    --bg:      #101418;
    --amber-100: #33290d;
    --amber-700: #e5c265;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 4px 14px rgba(0, 0, 0, .3);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .45), 0 12px 28px rgba(0, 0, 0, .4);
  }
}

/* --------------------------------------------------------------- base ---- */

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

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

body {
  margin: 0;
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { line-height: 1.25; margin: 0; font-weight: 700; letter-spacing: -.01em; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }

a { color: var(--green-700); }
a:hover { color: var(--green-600); }

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

:focus-visible {
  outline: 3px solid var(--green-500);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--green-700);
  color: #fff;
  padding: 10px 16px;
  z-index: 100;
}
.skip-link:focus { left: 8px; top: 8px; }

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

/* ------------------------------------------------------------- header ---- */

.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 74px;
  flex-wrap: wrap;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
  margin-right: auto;
}
.brand img { width: 44px; height: 46px; display: block; border-radius: 6px; }
.brand-name { font-weight: 700; font-size: 1.06rem; letter-spacing: -.02em; line-height: 1.2; }

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.nav a {
  display: block;
  padding: 8px 14px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
  font-size: .95rem;
  font-weight: 500;
}
.nav a:hover { background: var(--surface-2); color: var(--ink); }
.nav a[aria-current="page"] {
  background: var(--green-100);
  color: var(--green-700);
  font-weight: 600;
}
@media (prefers-color-scheme: dark) {
  .nav a[aria-current="page"] { color: #7fdca6; }
}

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

.hero {
  background:
    radial-gradient(1000px 400px at 15% -30%, rgba(18, 165, 87, .35), transparent 65%),
    linear-gradient(135deg, var(--green-800), #04371d 70%);
  color: #fff;
  padding: 52px 0 56px;
}
.hero h1 {
  font-size: clamp(1.9rem, 4.2vw, 2.9rem);
  margin-bottom: 10px;
}
.hero p {
  font-size: 1.06rem;
  color: rgba(255, 255, 255, .82);
  max-width: 60ch;
}
.hero .season-pill {
  display: inline-block;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .28);
  color: #fff;
  padding: 5px 14px;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.hero-actions {
  display: flex;
  gap: 10px;
  margin-top: 22px;
}
.hero-actions .btn { justify-content: center; }

/* --------------------------------------------------- page header (subpages) */

.page-head {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 34px 0 30px;
}
.page-head h1 { font-size: clamp(1.6rem, 3.4vw, 2.2rem); }
.page-head p { color: var(--muted); margin-top: 8px; margin-bottom: 0; }

.breadcrumb {
  font-size: .9rem;
  color: var(--muted);
  margin-bottom: 10px;
}
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { margin: 0 6px; opacity: .6; }

/* --------------------------------------------------------------- main ---- */

main { padding: 40px 0 56px; }

.section { margin-bottom: 44px; }
.section:last-child { margin-bottom: 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.section-head h2 {
  font-size: 1.35rem;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-head h2::before {
  content: "";
  width: 4px;
  height: 1.1em;
  border-radius: 2px;
  background: var(--green-500);
  flex: none;
}
.section-head .note { color: var(--muted); font-size: .92rem; }

/* -------------------------------------------------------------- tiles ---- */

.tiles {
  display: grid;
  /* min() keeps the track from exceeding the container on narrow phones,
     which would otherwise push the page sideways. */
  grid-template-columns: repeat(auto-fit, minmax(min(230px, 100%), 1fr));
  gap: 16px;
}

.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  border-color: var(--green-500);
  color: inherit;
}
.tile .icon {
  flex: none;
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--green-100);
  color: var(--green-700);
}
@media (prefers-color-scheme: dark) {
  .tile .icon { color: #7fdca6; }
}
.tile .icon svg { width: 22px; height: 22px; }
.tile .tile-title { font-weight: 650; display: block; }
.tile .tile-sub { color: var(--muted); font-size: .88rem; display: block; margin-top: 2px; }

.tile.is-alert .icon { background: #fdeceb; color: var(--red-600); }
@media (prefers-color-scheme: dark) {
  .tile.is-alert .icon { background: #3a1a17; color: #f19c92; }
}

/* -------------------------------------------------------------- cards ---- */

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: 20px;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card > h3 {
  font-size: 1.02rem;
  padding: 16px 20px;
  margin: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.card > h3 .tag {
  float: right;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.card .card-body { padding: 8px 20px 16px; }

/* ---------------------------------------------------------- link lists --- */

.link-list { list-style: none; margin: 0; padding: 0; }
.link-list > li { border-bottom: 1px solid var(--line); }
.link-list > li:last-child { border-bottom: 0; }

.link-list a,
.link-list .is-pending {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 13px 20px;
  text-decoration: none;
  color: var(--ink);
  font-weight: 500;
}
.link-list a:hover { background: var(--surface-2); color: var(--green-700); }
.link-list a::after {
  content: "→";
  margin-left: auto;
  color: var(--muted);
  font-weight: 400;
  transition: transform .15s ease;
}
.link-list a:hover::after { transform: translateX(3px); color: var(--green-600); }

.link-list a[target="_blank"]::after { content: "↗"; }

.link-list .hint {
  display: block;
  font-weight: 400;
  font-size: .87rem;
  color: var(--muted);
  margin-top: 2px;
}
.link-list .is-pending {
  color: var(--muted);
  font-weight: 400;
  cursor: default;
}
.link-list .is-pending .badge-soon {
  margin-left: auto;
  font-size: .72rem;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--amber-100);
  color: var(--amber-700);
  padding: 2px 9px;
  border-radius: 999px;
  font-weight: 600;
}

/* ------------------------------------------------------------ buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
}
.btn:hover { background: var(--surface-2); color: var(--ink); }
.btn-primary {
  background: var(--green-700);
  border-color: var(--green-700);
  color: #fff;
}
.btn-primary:hover { background: var(--green-600); border-color: var(--green-600); color: #fff; }

/* ------------------------------------------------------------- tables ---- */

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

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: .96rem;
}
table.data caption {
  text-align: left;
  padding: 16px 20px;
  font-weight: 700;
  border-bottom: 1px solid var(--line);
}
table.data th {
  text-align: left;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
table.data td {
  padding: 13px 20px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data td a { text-decoration: none; word-break: break-word; }
table.data td a:hover { text-decoration: underline; }

/* Belt-and-braces: some UA/reset combinations ignore [hidden] on table rows. */
table.data tr[hidden] { display: none; }

.role-group th {
  background: var(--green-100);
  color: var(--green-800);
  font-size: .8rem;
  letter-spacing: .06em;
}
@media (prefers-color-scheme: dark) {
  .role-group th { color: #9ce6bd; }
}

/* --------------------------------------------------------- status box ---- */

.notice {
  display: flex;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: .94rem;
  margin-bottom: 20px;
}
.notice svg { flex: none; width: 20px; height: 20px; color: var(--muted); margin-top: 2px; }
.notice.is-empty { justify-content: center; text-align: center; color: var(--muted); }

.updated-stamp {
  font-size: .88rem;
  color: var(--muted);
}

/* ------------------------------------------------------------- filter ---- */

.filter-bar {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}
.filter-bar input[type="search"] {
  flex: 1 1 260px;
  max-width: 420px;
  padding: 11px 14px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.filter-bar input[type="search"]::placeholder { color: var(--muted); }
.filter-bar .count { color: var(--muted); font-size: .9rem; }

/* ------------------------------------------------------------- footer ---- */

.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--line);
  padding: 32px 0;
  margin-top: 20px;
}
.site-footer .wrap {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  align-items: center;
}
.site-footer p { margin: 0; color: var(--muted); font-size: .92rem; }
.site-footer .foot-links { display: flex; gap: 18px; flex-wrap: wrap; }
.site-footer .foot-links a { font-size: .92rem; }

/* ------------------------------------------- DataTables 2.x integration --- */

.dt-container { padding: 4px 0 0; }
.dt-container .dt-layout-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 12px 20px;
}
.dt-container .dt-layout-row:first-child { border-bottom: 1px solid var(--line); }
.dt-container .dt-layout-row:last-child { border-top: 1px solid var(--line); }
.dt-container label { color: var(--muted); font-size: .9rem; }
.dt-container input,
.dt-container select {
  font-family: inherit;
  font-size: .95rem;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  margin-left: 8px;
}
.dt-container .dt-info { color: var(--muted); font-size: .9rem; }
.dt-container .dt-paging .dt-paging-button {
  color: var(--ink-2) !important;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  padding: 6px 13px;
}
.dt-container .dt-paging .dt-paging-button:hover {
  background: var(--surface-2) !important;
  border-color: var(--line);
  color: var(--ink) !important;
}
.dt-container .dt-paging .dt-paging-button.current {
  background: var(--green-700) !important;
  border-color: var(--green-700);
  color: #fff !important;
}
.dt-container .dt-paging .dt-paging-button.disabled { opacity: .4; }

table.dataTable { border-collapse: collapse !important; margin: 0 !important; }
table.dataTable thead th {
  text-align: left;
  font-size: .78rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  background: var(--surface-2);
  padding: 12px 20px;
  border-bottom: 1px solid var(--line) !important;
}
table.dataTable tbody td {
  padding: 13px 20px;
  border-top: 1px solid var(--line) !important;
  color: var(--ink);
}
table.dataTable tbody tr { background: transparent !important; }
table.dataTable tbody tr:hover td { background: var(--surface-2); }
table.dataTable.stripe tbody tr.odd > * { box-shadow: none !important; }
.dt-container .dt-empty { text-align: center; color: var(--muted); padding: 32px 20px !important; }

/* --------------------------------------------------------------- misc ---- */

@media (max-width: 620px) {
  body { font-size: 16px; }

  .wrap { padding: 0 16px; }

  /* The header needs two rows on a phone; pinning that much furniture to the
     top costs more than the convenience is worth, so let it scroll away. */
  .site-header { position: static; }
  .site-header .wrap { min-height: 0; padding-top: 12px; padding-bottom: 12px; gap: 10px; }
  .brand { margin-right: 0; }
  .brand img { width: 38px; height: 40px; }
  .brand-name { font-size: 1rem; }
  .nav { width: 100%; gap: 2px; }
  .nav a { padding: 8px 12px; font-size: .92rem; }

  .hero { padding: 32px 0 36px; }
  .hero p { font-size: 1rem; }

  /* Keep the two calls to action on one row, each taking half the width and
     wrapping its own label rather than dropping onto a second line. */
  .hero-actions .btn {
    flex: 1 1 0;
    min-width: 0;
    padding: 11px 12px;
    font-size: .92rem;
    text-align: center;
  }

  main { padding: 26px 0 38px; }
  .section { margin-bottom: 34px; }
  .page-head { padding: 24px 0 22px; }

  .section-head { flex-direction: column; align-items: flex-start; gap: 2px; }

  /* Contacts: three columns of small text plus long addresses do not fit a
     phone, so each contact becomes a stacked block instead of a table row. */
  table.data thead { display: none; }
  table.data,
  table.data tbody,
  table.data tr,
  table.data td { display: block; width: 100%; }
  table.data tr:not(.role-group) { padding: 13px 16px; border-bottom: 1px solid var(--line); }
  table.data tbody:last-child tr:last-child { border-bottom: 0; }
  table.data td { border: 0; padding: 0; }
  table.data td:first-child { font-weight: 650; }
  table.data td:nth-child(2) { color: var(--muted); font-size: .92rem; }
  table.data td:nth-child(3) { margin-top: 3px; font-size: .92rem; }
  table.data tbody tr:hover { background: transparent; }
  .role-group th { display: block; padding: 11px 16px; }

  /* Closures keeps its grid — only three short columns — but tightened up so
     it fits without scrolling sideways. */
  table.dataTable thead th,
  table.dataTable tbody td { padding-left: 10px; padding-right: 10px; font-size: .9rem; }
  .dt-container .dt-layout-row { padding: 10px 14px; }
  .dt-container .dt-length { display: none; }
  .dt-container .dt-search {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
  }
  .dt-container .dt-search input { flex: 1 1 auto; min-width: 0; margin-left: 0; }

  /* 16px keeps iOS Safari from zooming the page when a field takes focus. */
  .dt-container input,
  .dt-container select,
  .filter-bar input[type="search"] { font-size: 16px; }
  .filter-bar input[type="search"] { max-width: none; }

  .site-footer { padding: 26px 0; }
  .site-footer .wrap { flex-direction: column; align-items: flex-start; gap: 14px; }
  .site-footer .foot-links { gap: 14px 18px; }
}

@media print {
  .site-header, .site-footer, .filter-bar, .breadcrumb, .dt-layout-row { display: none; }
  body { background: #fff; font-size: 12px; }
  .card, .table-wrap { box-shadow: none; break-inside: avoid; }
}
