/* ==========================================================================
   Leinster League Cyclocross — stylesheet
   Palette: blue / white
   ========================================================================== */

:root {
  --black:      #17171a;
  --grey-dark:  #4a4a4a;
  --grey-mid:   #757575;
  --grey-light: #eaf1f8;
  --blue:       #1c6dd0;
  --blue-dark:  #0c3b64;
  --blue-light: #5fa8e0;
  --blue-mid:   #1553a0;
  --error:      #b3261e;
  --bg:         #ffffff;
  --white:      #ffffff;

  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: 'Oswald', "Arial Narrow", Arial, sans-serif;

  --max-width: 1120px;
  --radius: 10px;
  --shadow: 0 6px 20px rgba(20, 20, 20, 0.12);
}

/* ---- Reset --------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  color: var(--black);
  background: var(--bg);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 0.5em; color: var(--black); }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; }

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

.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--black);
  color: var(--white);
  padding: 0.75em 1em;
  z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---- Buttons -------------------------------------------------------- */
.btn {
  display: inline-block;
  padding: 0.75em 1.6em;
  border-radius: 999px;
  font-weight: 600;
  background: var(--blue);
  color: var(--white);
  text-decoration: none;
  border: 2px solid var(--blue);
  transition: background 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--blue-dark); border-color: var(--blue-dark); text-decoration: none; }
.btn-outline {
  background: transparent;
  color: var(--white);
  border-color: var(--white);
}
.btn-outline:hover { background: var(--white); color: var(--blue-dark); }
.btn-secondary {
  background: transparent;
  color: var(--black);
  border-color: var(--black);
}
.btn-secondary:hover { background: var(--black); color: var(--white); }

/* ---- Header / Nav ----------------------------------------------------- */
.site-header {
  background: var(--white);
  color: var(--black);
  border-bottom: 1px solid var(--grey-light);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  position: relative;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6em;
  color: var(--black);
  font-family: var(--font-head);
  font-size: 1.25rem;
  font-weight: 700;
}
.brand:hover { text-decoration: none; opacity: 0.9; }
.brand-mark {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--blue);
  background-image: linear-gradient(135deg, var(--blue) 0%, var(--blue-light) 100%);
  position: relative;
  flex: none;
}
.brand-mark::after {
  content: "";
  position: absolute;
  inset: 6px;
  border: 2px solid var(--bg);
  border-radius: 50%;
}
.brand-text.small { font-size: 1.1rem; color: var(--white); }

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  list-style: none;
}
.site-nav a {
  color: var(--black);
  font-weight: 600;
  font-size: 0.92rem;
  padding: 0.4em 0;
  border-bottom: 2px solid transparent;
  white-space: nowrap;
}
.site-nav a:hover,
.site-nav a.active {
  color: var(--blue);
  border-bottom-color: var(--blue-light);
  text-decoration: none;
}

.nav-toggle-input { display: none; }
.nav-toggle-btn {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 0.5em;
}
.nav-toggle-btn span {
  width: 26px;
  height: 3px;
  background: var(--black);
  border-radius: 2px;
}

/* ---- Hero ------------------------------------------------------------- */
.hero {
  background: linear-gradient(rgba(6,26,48,0.6), rgba(6,26,48,0.6)),
              var(--blue-dark) url('../images/hero/hero-home.jpg') center/cover no-repeat;
  color: var(--white);
  padding: 6rem 0 5rem;
  text-align: center;
}
.hero h1 {
  color: var(--white);
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin-bottom: 0.35em;
}
.hero p.lead {
  font-size: 1.2rem;
  max-width: 640px;
  margin: 0 auto 1.75em;
  color: rgba(255,255,255,0.92);
}
.hero-actions { display: flex; gap: 1rem; justify-content: center; flex-wrap: wrap; }

.page-hero {
  background: var(--blue-dark);
  color: var(--white);
  padding: 3.5rem 0;
  text-align: center;
}
.page-hero h1 { color: var(--white); margin-bottom: 0.25em; }
.page-hero p { color: rgba(255,255,255,0.92); max-width: 640px; margin: 0 auto; }

/* ---- Sections ---------------------------------------------------------- */
section { padding: 4rem 0; }
section.alt { background: var(--grey-light); }
.section-head { text-align: center; max-width: 640px; margin: 0 auto 2.5rem; }
.section-head p { color: var(--grey-mid); }

/* ---- Card grid ---------------------------------------------------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.75rem;
}
.card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem 1.75rem;
  box-shadow: var(--shadow);
}
.card h3 { margin-bottom: 0.4em; }
.card .icon {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--blue-light);
  margin-bottom: 1rem;
}

/* ---- Two-column feature ------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.split img { border-radius: var(--radius); box-shadow: var(--shadow); }
@media (max-width: 760px) {
  .split { grid-template-columns: 1fr; }
}

/* ---- Tables (fixtures, placings, fees) ---------------------------------- */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
  box-shadow: var(--shadow);
  border-radius: var(--radius);
  overflow: hidden;
}
th, td {
  text-align: left;
  padding: 0.9em 1.1em;
  border-bottom: 1px solid var(--grey-light);
  white-space: nowrap;
}
th {
  background: var(--blue-dark);
  color: var(--white);
  font-family: var(--font-head);
  font-weight: 400;
}
tr:last-child td { border-bottom: none; }

/* Highlight league (counting) rounds in the fixtures table */
tr.league-round td:first-child {
  font-weight: 700;
  color: var(--blue-dark);
}

/* Medal highlighting in the placings table */
tr.placing-gold   { background: #fdf3dc; }
tr.placing-silver { background: #f1f2f0; }
tr.placing-bronze { background: #f8e9d8; }

/* ---- Live Google Sheets data tables -------------------------------------- */
.sheet-controls { margin-bottom: 1.25rem; }
.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.tab-btn {
  padding: 0.55em 1.15em;
  border-radius: 999px;
  border: 2px solid var(--blue);
  background: transparent;
  color: var(--blue-dark);
  font-weight: 600;
  font-family: var(--font-body);
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.tab-btn:hover { background: var(--blue); color: var(--white); }
.tab-btn.active { background: var(--blue-dark); border-color: var(--blue-dark); color: var(--white); }

.sheet-status {
  padding: 1.5em;
  color: var(--grey-mid);
  font-style: italic;
  text-align: center;
  background: var(--grey-light);
  border-radius: var(--radius);
}
.sheet-status-error {
  color: var(--error);
  font-style: normal;
  font-weight: 600;
}
.sheet-updated {
  font-size: 0.8rem;
  color: var(--grey-mid);
  margin: 0.75em 0 0;
}
.include-toggle {
  margin: 0 0 1.25rem;
  font-size: 0.92rem;
  color: var(--grey-dark);
}

/* ---- Committee / organisers list ----------------------------------------- */
.people-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.5rem;
}
.person {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem;
  text-align: center;
  box-shadow: var(--shadow);
}
.person .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: var(--grey-light);
  margin: 0 auto 0.75rem;
}
.person .role { color: var(--blue); font-weight: 600; font-size: 0.9rem; }

/* ---- Callout / CTA band ---------------------------------------------------- */
.cta-band {
  background: var(--blue-dark);
  color: var(--white);
  text-align: center;
  padding: 3.5rem 0;
}
.cta-band h2 { color: var(--white); }
.cta-band p { color: rgba(255,255,255,0.9); max-width: 560px; margin: 0 auto 1.5em; }

/* ---- Contact ---------------------------------------------------------------- */
.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.contact-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}
.contact-card h3 { margin-bottom: 0.4em; }
.contact-card p { color: var(--grey-mid); }
.contact-card .btn { margin-top: 0.5em; }

/* ---- Badges / category grading ------------------------------------------- */
.badge {
  display: inline-block;
  padding: 0.2em 0.7em;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--white);
}
.badge.cat-a { background: var(--blue-dark); }
.badge.cat-b { background: var(--blue-mid); }

/* ---- Archive list (Previous years) --------------------------------------- */
.archive-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}
.archive-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
  box-shadow: var(--shadow);
}
.archive-card h3 { margin-bottom: 0.5em; }
.archive-card ul { list-style: none; }
.archive-card li { margin-bottom: 0.4em; }

/* ---- Footer ------------------------------------------------------------------ */
.site-footer {
  background: var(--black);
  color: var(--grey-light);
  padding: 3rem 0 2rem;
  margin-top: 0;
}
.footer-inner {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
}
.footer-inner a { color: var(--grey-light); }
.footer-inner p { margin: 0.25em 0; color: var(--grey-mid); }
.social-links { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 0.5em; }
.footer-legal { text-align: right; align-self: end; font-size: 0.85rem; color: var(--grey-mid); }
@media (max-width: 700px) {
  .footer-inner { grid-template-columns: 1fr; text-align: left; }
  .footer-legal { text-align: left; }
}

/* ---- Responsive nav ------------------------------------------------------------ */
@media (max-width: 900px) {
  .nav-toggle-btn { display: flex; }
  .site-nav {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--blue-dark);
    box-shadow: var(--shadow);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }
  .site-nav ul {
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1rem;
  }
  .site-nav li { border-top: 1px solid rgba(255, 255, 255, 0.15); }
  .site-nav li:first-child { border-top: none; }
  .site-nav a {
    display: block;
    padding: 0.85em 0;
    color: var(--white);
  }
  .site-nav a:hover,
  .site-nav a.active {
    color: var(--white);
    border-bottom-color: var(--blue-light);
  }
  .nav-toggle-input:checked ~ .site-nav { max-height: 500px; }
}

/* ---- Utility ------------------------------------------------------------------- */
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
