/*
 * 2027 Ontario Mixed Curling Championship — shared styles
 * Last updated: 2026-10-19 09:50 ET
 * Palette: main #102a83 · accents #e30016, #ffcb00, #ffffff (Milton Curling Club colours)
 */
:root {
  --navy: #102A83;
  --navy-2: #1E3A9E;
  --blue: #102A83;
  --gold: #FFCB00;
  --ice: #F4F6FC;
  --ice-2: #E8ECF8;
  --red: #E30016;
  --red-dark: #B30011;
  --ink: #151B33;
  --muted: #4A5584;
  --rule: #C8CFE8;
  --on-navy: #D6DCF2;
  --white: #FFFFFF;
  --ok: #1d6b3a;
  --radius: 6px;
  --display: 'Barlow Condensed', 'Arial Narrow', sans-serif;
  --body: 'Source Sans 3', system-ui, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font-family: var(--body); color: var(--ink); background: var(--ice); line-height: 1.55; font-size: 17px; }
img { max-width: 100%; }
a { color: var(--blue); }
a:hover { color: var(--navy); }
h1, h2, h3 { font-family: var(--display); text-transform: uppercase; color: var(--navy); line-height: 1; margin: 0 0 .4em; }
h1 { font-size: clamp(2.6rem, 7vw, 4.6rem); font-weight: 800; }
h2 { font-size: clamp(2rem, 5vw, 2.8rem); font-weight: 800; }
h3 { font-size: 1.45rem; font-weight: 700; }
.kicker { font-size: .8rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--red); margin-bottom: .5rem; }
.muted { color: var(--muted); }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--rule); }

/* Header / nav */
/* Sticky top navigation: stays pinned while the page scrolls */
.site-header { background: var(--navy); color: var(--white); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 8px rgba(9, 24, 82, .25); }
/* Keep section headings visible below the sticky bar when a menu link jumps to them */
html { scroll-behavior: smooth; }
section[id] { scroll-margin-top: 88px; }
@media (max-width: 760px) { section[id] { scroll-margin-top: 140px; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { font-family: var(--display); font-weight: 800; font-size: 1.35rem; text-transform: uppercase; color: var(--white); text-decoration: none; letter-spacing: .02em; display: inline-flex; align-items: center; gap: 10px; }
.brand img { height: 44px; width: auto; }
.hero .wrap { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.hero .hero-logo { width: min(320px, 70vw); height: auto; position: relative; flex-shrink: 0; }
.club-logo { width: 180px; height: auto; display: block; margin-bottom: 16px; }
.footer-logos { display: flex; gap: 20px; align-items: center; margin: 0 0 16px; }
.footer-logos img { height: 56px; width: auto; }
.hero .partner { display: flex; align-items: center; gap: 12px; margin-top: 16px; font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--on-navy); }
.hero .partner img { height: 54px; width: auto; }
.message .msg-logo { height: 52px; width: auto; align-self: flex-start; }
/* Curling Ontario logo: their guidelines allow it only on white, red or black, never on navy or light grey,
   with clear space on all sides equal to the curling-rock height (~21% of the image height; the PNG
   already includes ~7%). On navy it sits on a white tile; 10px padding gives the full safe area at 50–54px. */
.message .msg-logo.co-logo { height: 52px; margin-bottom: 4px; }
.logo-tile { display: inline-flex; align-items: center; background: #FFFFFF; padding: 10px; border-radius: 4px; }
.footer-logos .logo-tile img { height: 50px; }
@media (max-width: 760px) { .hero .hero-logo { order: -1; width: 200px; } }
.brand:hover { color: var(--white); }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a { color: var(--on-navy); text-decoration: none; font-weight: 600; padding: 10px 12px; border-radius: var(--radius); min-height: 44px; display: inline-flex; align-items: center; }
.nav a:hover, .nav a.active { color: var(--white); background: var(--navy-2); }

/* Hero */
.hero { background: var(--navy); color: var(--white); position: relative; overflow: hidden; padding: 64px 0 80px; }
.hero h1 { color: var(--white); }
.hero .kicker { color: var(--gold); }
.hero { border-bottom: 6px solid var(--gold); }
.site-footer { border-top: 6px solid var(--gold); }
.nav a.active { box-shadow: inset 0 -3px 0 var(--gold); }
.hero .rings { position: absolute; right: -180px; bottom: -220px; width: 520px; height: 520px; pointer-events: none; }
.hero .inner { position: relative; max-width: 640px; }
.date-band { display: inline-block; background: var(--red); color: var(--white); font-family: var(--display); font-weight: 700; font-size: 1.6rem; text-transform: uppercase; padding: 6px 16px; margin: 12px 0; }
.hero .where { font-weight: 600; font-size: 1.15rem; }
.hero .presented { color: var(--on-navy); font-size: .85rem; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 24px; }

/* Buttons & forms */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 20px; border-radius: var(--radius); border: 2px solid transparent; font: 700 1rem var(--body); cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--red); color: var(--white); }
.btn-primary:hover { background: var(--red-dark); color: var(--white); }
.btn-secondary { background: var(--white); color: var(--navy); border-color: var(--navy); }
.btn-secondary:hover { background: var(--ice-2); color: var(--navy); }
.btn-ghost { background: transparent; color: var(--navy); border-color: var(--rule); }
.btn-small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn-danger { background: var(--white); color: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.hero .btn-secondary { background: transparent; color: var(--white); border-color: var(--white); }

form .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
label { display: block; font-weight: 600; margin-bottom: 4px; }
.field { margin-bottom: 16px; }
input[type=text], input[type=email], input[type=tel], input[type=url], input[type=number], input[type=date], input[type=time], select, textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #8790BC; border-radius: var(--radius); font: inherit; background: var(--white); color: var(--ink);
}
textarea { min-height: 120px; resize: vertical; }
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 400; min-height: 36px; }
.check input { width: 20px; height: 20px; }
fieldset { border: 1px solid var(--rule); border-radius: var(--radius); padding: 16px; margin: 0 0 16px; background: var(--white); }
legend { font-weight: 700; padding: 0 6px; }

/* Cards & grids */
.card { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); padding: 20px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* Messages */
.message { display: grid; grid-template-columns: 1fr; gap: 16px; }
.message .sig { border-top: 1px solid var(--rule); padding-top: 12px; margin-top: 8px; }
.message .sig strong { font-family: var(--display); font-size: 1.3rem; color: var(--navy); display: block; }
.message p { margin: 0 0 12px; white-space: pre-line; }

/* Schedule */
.day { display: grid; grid-template-columns: 96px 1fr; background: var(--white); border: 1px solid var(--rule); margin-bottom: 12px; }
.day .tile { background: var(--navy); color: var(--white); display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 12px 4px; text-transform: uppercase; }
.day.final .tile { background: var(--red); }
.day .tile .dow { font-size: .8rem; font-weight: 700; letter-spacing: .12em; color: var(--on-navy); }
.day.final .tile .dow { color: var(--white); }
.day .tile .num { font-family: var(--display); font-weight: 800; font-size: 2.4rem; line-height: 1; }
.day .tile .mon { font-size: .8rem; font-weight: 600; }
.day ul { list-style: none; margin: 0; padding: 12px 20px; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.day li { display: flex; gap: 16px; }
.day li .t { flex: 0 0 88px; font-weight: 700; color: var(--navy); font-variant-numeric: tabular-nums; }
.day .draw { min-width: 0; flex: 1; }
.games { list-style: none; margin: 4px 0 6px; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.games li { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.games .sheet { flex: 0 0 auto; background: var(--ice-2); color: var(--navy); border: 1px solid var(--rule); border-radius: 4px; padding: 0 8px; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.games .vs { color: var(--muted); font-size: .85rem; margin: 0 4px; }
.games .mine { font-weight: 700; color: var(--red); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }

/* Teams */
.team h3 { margin-bottom: 2px; }
.team .club { color: var(--red); font-weight: 700; margin-bottom: 12px; }
.team dl { display: grid; grid-template-columns: 90px 1fr; gap: 2px 8px; margin: 0; font-size: .95rem; }
.team dt { color: var(--muted); font-weight: 600; }
.team dd { margin: 0; }
.team img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: 4px; margin-bottom: 12px; background: var(--ice-2); }

/* Sponsors */
.tier { margin-bottom: 28px; }
.tier-label { font-size: .8rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.sponsor { background: var(--white); border: 1px solid var(--rule); border-radius: var(--radius); min-height: 110px; display: flex; align-items: center; justify-content: center; padding: 16px; text-align: center; text-decoration: none; color: var(--navy); font-family: var(--display); font-weight: 700; font-size: 1.3rem; text-transform: uppercase; }
.sponsor img { max-height: 90px; object-fit: contain; }
.tier.title .sponsor { min-height: 160px; font-size: 1.8rem; }
.friends { font-size: 1.05rem; }

/* Footer */
.site-footer { background: var(--navy); color: var(--on-navy); padding: 32px 0; font-size: .95rem; }
.site-footer a { color: var(--white); }

/* Status messages */
.notice { padding: 12px 16px; border-radius: var(--radius); margin: 12px 0; border: 1px solid var(--rule); background: var(--white); }
.notice.ok { border-color: var(--ok); color: var(--ok); }
.notice.err { border-color: var(--red); color: var(--red); }
.hidden { display: none !important; }

/* Tables (admin) */
.table-box { overflow-x: auto; border: 1px solid var(--rule); border-radius: var(--radius); background: var(--white); }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { background: var(--ice-2); font-weight: 700; color: var(--navy); white-space: nowrap; }
td.actions { white-space: nowrap; }
.chip { display: inline-flex; align-items: center; gap: 6px; background: var(--ice-2); border: 1px solid var(--rule); border-radius: 999px; padding: 2px 4px 2px 10px; margin: 2px 4px 2px 0; font-size: .85rem; }
.chip button { border: 0; background: transparent; color: var(--red); font-weight: 700; cursor: pointer; min-width: 28px; min-height: 28px; border-radius: 999px; }
.chip.avail { background: #e6f2ea; border-color: #9cc9ab; }
.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 2px solid var(--rule); margin-bottom: 24px; }
.tabs button { background: none; border: 0; border-bottom: 3px solid transparent; margin-bottom: -2px; padding: 12px 16px; min-height: 44px; font: 700 1rem var(--body); color: var(--muted); cursor: pointer; }
.tabs button[aria-selected=true] { color: var(--navy); border-bottom-color: var(--red); }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.shift-full { color: var(--ok); font-weight: 700; }
.shift-short { color: var(--red); font-weight: 700; }

@media (max-width: 560px) {
  .day { grid-template-columns: 72px 1fr; }
  .day li { flex-direction: column; gap: 0; }
  .day li .t { flex-basis: auto; }
  .section { padding: 40px 0; }
}
