/*
Theme Name: Smile Golf Tournaments
Theme URI: https://tour.smilegolf.co.nz
Author: blamejen
Description: Tournament site for Smile Golf: dates by level, entries and results. Builds on the Smile Golf parent theme.
Template: smilegolf
Version: 0.1.0
Requires PHP: 8.0
Text Domain: smilegolf-tour
*/

/* ---------------------------------- header */
.tour-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
  padding: 1rem var(--gutter);
  max-width: 76rem;
  margin: 0 auto;
}
.tour-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
}
.tour-brand img { width: 3rem; }
.tour-brand__name { font-weight: 900; font-size: var(--step-1); line-height: 1; }
.tour-brand__site { display: block; font-weight: 700; font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.2rem; }

.tour-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-weight: 700;
}
.tour-nav a { text-decoration: none; }
.tour-nav a:hover { text-decoration: underline; }

/* ---------------------------------- hero */
.tour-hero {
  background: var(--green);
  color: var(--paper);
  padding: clamp(3.5rem, 9vw, 7rem) var(--gutter);
}
/* Same content width as the header and sections, which pad inside 76rem. */
.tour-hero__inner { max-width: calc(76rem - 2 * var(--gutter)); margin: 0 auto; }
.tour-hero__title {
  max-width: 14ch;
  font-size: var(--step-4);
}
.tour-hero__text {
  max-width: var(--measure);
  margin: 1.25rem 0 2rem;
  font-size: var(--step-1);
}
.tour-hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; }

/* ---------------------------------- sections */
.tour-section {
  max-width: 76rem;
  margin: 0 auto;
  padding: clamp(3rem, 7vw, 5.5rem) var(--gutter);
}
.tour-section__title { font-size: var(--step-3); }
.tour-section__intro { max-width: var(--measure); margin-top: 0.75rem; color: var(--ink-soft); }

/* ---------------------------------- scorecard */
/* Upcoming tournaments, drawn like a golf scorecard: a green header row,
   a full grid, and the column that matters most (places left) in yellow. */
.scorecard {
  margin-top: 2rem;
  border: 2px solid var(--green);
  border-radius: 0.75rem;
  overflow-x: auto;
}
.scorecard table {
  width: 100%;
  min-width: 46rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}
.scorecard th,
.scorecard td {
  padding: 0.8rem 1rem;
  border: 1px solid var(--line);
  text-align: left;
  vertical-align: middle;
}
.scorecard thead th {
  background: var(--green);
  color: var(--paper);
  border-color: var(--green-hover);
  font-weight: 800;
  font-size: var(--step--1);
}
.scorecard tr > :first-child { border-left: 0; }
.scorecard tr > :last-child { border-right: 0; }
.scorecard tbody tr:last-child > * { border-bottom: 0; }
.scorecard tbody th { font-weight: 800; white-space: nowrap; }
.scorecard__time { display: block; font-weight: 600; color: var(--ink-soft); font-size: var(--step--1); }
.scorecard__left { background: #fffbd6; text-align: center; font-weight: 900; font-size: var(--step-1); }
.scorecard__left--full { background: var(--range); color: var(--ink-soft); font-size: var(--step-0); font-weight: 700; }
.scorecard__fee { white-space: nowrap; }
.scorecard__action { text-align: right; }
.scorecard__action .button { padding: 0.55rem 1.2rem; }
.scorecard__closed { font-weight: 700; color: var(--ink-soft); }

/* LatePoint adds its own button classes; ours win, and the loading state
   it sets while opening the form shows as a dimmed button. */
.scorecard .button { font-family: var(--font); cursor: pointer; }
.scorecard .button.os-loading { opacity: 0.6; cursor: progress; }
.button--outline-green { background: var(--paper); color: var(--green); border-color: var(--green); }
.button--outline-green:hover { background: var(--range); }

.level-tag {
  display: inline-block;
  padding: 0.15rem 0.7rem;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: var(--step--1);
  border: 2px solid var(--green);
}
.level-tag--beginner { background: var(--yellow); border-color: var(--yellow); }
.level-tag--intermediate { background: var(--paper); }
.level-tag--advanced { background: var(--green); color: var(--paper); }

/* Words the column headers already say on wide screens. */
.scorecard__label { display: none; }

/* On phones each tournament becomes its own block, so the places left and
   the Enter button show without scrolling sideways. */
@media (max-width: 47.99em) {
  .scorecard { overflow: visible; }
  .scorecard table,
  .scorecard tbody { display: block; min-width: 0; }
  .scorecard thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }
  .scorecard tbody tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "date   level"
      "course course"
      "fee    left"
      "action action";
    gap: 0.35rem 1rem;
    padding: 1.1rem 1rem;
    border-bottom: 1px solid var(--line);
  }
  .scorecard tbody tr:last-child { border-bottom: 0; }
  .scorecard th,
  .scorecard td { display: block; padding: 0; border: 0; }
  .scorecard tbody th { grid-area: date; }
  .scorecard tbody td:nth-child(2) { grid-area: course; }
  .scorecard tbody td:nth-child(3) { grid-area: level; justify-self: end; }
  .scorecard__fee { grid-area: fee; }
  .scorecard__left,
  .scorecard__left--full {
    grid-area: left;
    justify-self: end;
    background: none;
    font-size: var(--step-0);
  }
  .scorecard__action { grid-area: action; text-align: left; margin-top: 0.5rem; }
  .scorecard__action .button { display: block; text-align: center; }
  .scorecard__label { display: inline; font-weight: 600; color: var(--ink-soft); }
}

.draft-note { margin-top: 1rem; font-size: var(--step--1); color: var(--ink-soft); }

/* ---------------------------------- levels */
.levels-wrap { background: var(--range); }
.levels {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
  gap: 1.25rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
}
.level {
  padding: 1.5rem;
  background: var(--paper);
  border-radius: 0.75rem;
}
/* The top edge carries the same colour as the level's tag in the scorecard. */
.level { border-top: 0.5rem solid var(--green); }
.level--beginner { border-top-color: var(--yellow); }
.level--intermediate { border-top-color: var(--line); }
.level__name { font-size: var(--step-2); }
.level__who { margin-top: 0.5rem; }
.level__facts {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.25rem 1rem;
  margin: 1.25rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--line);
  font-size: var(--step--1);
}
.level__facts dt { color: var(--ink-soft); font-weight: 700; }
.level__facts dd { margin: 0; font-weight: 800; }

/* ---------------------------------- how to enter */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 2rem;
  margin: 2rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}
.steps li { counter-increment: step; }
.steps li::before {
  content: counter(step);
  display: grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: 1rem;
  border-radius: 50%;
  background: var(--yellow);
  font-weight: 900;
  font-size: var(--step-1);
}
.steps h3 { font-size: var(--step-1); margin-bottom: 0.4rem; }
.steps p { color: var(--ink-soft); }
