/* =========================================================================
   SweatyBetty Golf Tour — theme
   Fun, cheeky, mates-on-tour styling. Greens for the golf, a hot-pink
   "Sweaty Betty" accent for anything to do with the loser's outfit, and
   gold for winners.
   ========================================================================= */

:root {
  --green-900: #0f3d2e;
  --green-700: #1f6e4a;
  --green-600: #2a8a5c;
  --green-100: #e7f3ec;
  --fairway: #f4faf6;
  --cream: #fffdf7;
  --ink: #1c2620;
  --muted: #5b6b62;
  --line: #d9e8df;
  --gold: #d9a326;
  --gold-dark: #a4780f;
  --betty-pink: #e94f9b;
  --betty-pink-dark: #c22d78;
  --white: #ffffff;
  --radius: 14px;
  --shadow: 0 6px 20px rgba(15, 61, 46, 0.10);
  --shadow-lg: 0 12px 34px rgba(15, 61, 46, 0.16);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --font-head: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--fairway);
  line-height: 1.55;
}
img { max-width: 100%; display: block; }
a { color: var(--green-700); text-decoration: none; }
a:hover { text-decoration: underline; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 20px; }

h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; color: var(--green-900); }
h1 { font-size: 2.1rem; margin: 0 0 8px; }
h2 { font-size: 1.5rem; margin: 34px 0 14px; }
h3 { font-size: 1.15rem; margin: 20px 0 8px; }
.muted { color: var(--muted); }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 60ch; }

/* ---- Header / nav ------------------------------------------------------ */
.site-header {
  background: linear-gradient(135deg, var(--green-900), var(--green-700));
  color: var(--white);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-weight: 700;
  font-size: 1.15rem;
}
.brand:hover { text-decoration: none; opacity: 0.92; }
.brand__badge {
  background: var(--gold);
  color: var(--green-900);
  font-family: var(--font-head);
  font-weight: 700;
  width: 38px; height: 38px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.brand__text em { font-style: normal; font-weight: 400; opacity: 0.85; display: block; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }

.site-nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.site-nav a {
  color: rgba(255,255,255,0.88);
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  white-space: nowrap;
}
.site-nav a:hover { background: rgba(255,255,255,0.12); text-decoration: none; }
.site-nav a.active { background: rgba(255,255,255,0.18); color: var(--white); font-weight: 600; }
.site-nav a.nav-cta { background: var(--betty-pink); color: var(--white); font-weight: 700; }
.site-nav a.nav-cta:hover { background: var(--betty-pink-dark); }

.nav-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  width: 40px; height: 40px;
  flex-direction: column; align-items: center; justify-content: center; gap: 5px;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--white); border-radius: 2px; }

/* ---- Buttons & forms ---------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-700); color: var(--white);
  padding: 10px 18px; border-radius: 999px; border: none;
  font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.btn:hover { background: var(--green-900); text-decoration: none; }
.btn--pink { background: var(--betty-pink); }
.btn--pink:hover { background: var(--betty-pink-dark); }
.btn--ghost { background: transparent; color: var(--green-700); border: 1.5px solid var(--green-700); }
.btn--ghost:hover { background: var(--green-100); }
.btn--danger { background: #b23a3a; }
.btn--danger:hover { background: #8f2c2c; }
.btn--small { padding: 6px 12px; font-size: 0.85rem; }

form { max-width: 560px; }
form.wide { max-width: none; }
label { display: block; font-weight: 600; margin: 14px 0 6px; font-size: 0.92rem; }
input[type=text], input[type=email], input[type=password], input[type=date], input[type=number], input[type=file], select, textarea {
  width: 100%; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 1rem; font-family: inherit; background: var(--white); color: var(--ink);
}
textarea { min-height: 100px; resize: vertical; }
.field-hint { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }
.form-row { display: flex; gap: 16px; flex-wrap: wrap; }
.form-row > * { flex: 1; min-width: 180px; }
.form-actions { margin-top: 20px; display: flex; gap: 10px; }
fieldset { border: 1.5px dashed var(--line); border-radius: var(--radius); padding: 14px 16px; margin: 18px 0; }
legend { font-weight: 700; color: var(--green-900); padding: 0 6px; }

/* ---- Flash messages ------------------------------------------------------ */
.flash { padding: 12px 16px; border-radius: 10px; margin: 18px 0; font-weight: 600; }
.flash--success { background: var(--green-100); color: var(--green-900); border: 1px solid var(--green-600); }
.flash--error { background: #fbe7e7; color: #8f2c2c; border: 1px solid #d98a8a; }
.flash--info { background: #eef4fb; color: #274a72; border: 1px solid #a9c6e6; }

/* ---- Hero / home --------------------------------------------------------- */
.hero { padding: 46px 0 20px; }
.hero .badge-row { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }

.stat-row { display: flex; gap: 16px; flex-wrap: wrap; margin: 22px 0; }
.stat-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 18px 20px; flex: 1; min-width: 150px;
}
.stat-card .num { font-family: var(--font-head); font-size: 2rem; color: var(--green-800, var(--green-700)); }
.stat-card .label { color: var(--muted); font-size: 0.88rem; text-transform: uppercase; letter-spacing: 0.04em; }

/* ---- Cards / grids -------------------------------------------------------- */
.grid { display: grid; gap: 18px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 20px 0 36px; }
.card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; display: flex; flex-direction: column;
}
.card__media { aspect-ratio: 4/3; background: var(--green-100) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: var(--green-700); font-size: 2.4rem; font-family: var(--font-head); }
.card__body { padding: 14px 16px 18px; flex: 1; display: flex; flex-direction: column; gap: 4px; }
.card__title { font-weight: 700; font-size: 1.05rem; color: var(--green-900); }
.card__meta { color: var(--muted); font-size: 0.88rem; }
.card--inactive { opacity: 0.6; }

/* ---- Badges --------------------------------------------------------------- */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; border-radius: 999px; font-size: 0.8rem; font-weight: 700; }
.badge--winner { background: #fbeec7; color: var(--gold-dark); border: 1px solid var(--gold); }
.badge--betty { background: #fbdcec; color: var(--betty-pink-dark); border: 1px solid var(--betty-pink); }
.badge--muted { background: var(--green-100); color: var(--green-700); }

/* ---- Tables / leaderboard --------------------------------------------------- */
.table-wrap { overflow-x: auto; margin: 18px 0 30px; border-radius: var(--radius); box-shadow: var(--shadow); background: var(--white); }
table { width: 100%; border-collapse: collapse; min-width: 480px; }
th, td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--line); }
th { background: var(--green-100); color: var(--green-900); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.03em; }
tr:last-child td { border-bottom: none; }
tr.row-winner { background: #fffaf0; }
tr.row-loser { background: #fff3f9; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.rank { font-weight: 700; color: var(--green-700); }

/* ---- Hall of Fame timeline ------------------------------------------------- */
.year-list { list-style: none; margin: 20px 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.year-list li { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 20px; display: flex; flex-wrap: wrap; gap: 10px 24px; align-items: center; justify-content: space-between; }
.year-list .year-num { font-family: var(--font-head); font-size: 1.4rem; color: var(--green-900); min-width: 70px; }
.year-list .year-people { display: flex; gap: 10px; flex-wrap: wrap; }

/* ---- Photo gallery ------------------------------------------------------------ */
.photo-grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); margin: 16px 0 30px; }
.photo-grid figure { margin: 0; background: var(--white); border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); }
.photo-grid img { aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.photo-grid figcaption { padding: 8px 10px; font-size: 0.82rem; color: var(--muted); }

/* ---- Profile / bio ------------------------------------------------------------- */
.profile-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; margin-bottom: 10px; }
.avatar { width: 108px; height: 108px; border-radius: 50%; object-fit: cover; background: var(--green-100); box-shadow: var(--shadow); }
.avatar--placeholder { display: flex; align-items: center; justify-content: center; font-family: var(--font-head); font-size: 2rem; color: var(--green-700); }

/* ---- Admin ---------------------------------------------------------------------- */
.admin-nav { display: flex; gap: 8px; flex-wrap: wrap; margin: 18px 0 30px; }
.admin-nav a { background: var(--white); box-shadow: var(--shadow); padding: 10px 16px; border-radius: 10px; font-weight: 600; color: var(--green-900); }
.admin-nav a.active, .admin-nav a:hover { background: var(--green-700); color: var(--white); text-decoration: none; }
.admin-table-actions { display: flex; gap: 8px; }
.score-grid td input[type=number] { width: 78px; }
.empty-state { background: var(--white); border: 2px dashed var(--line); border-radius: var(--radius); padding: 30px; text-align: center; color: var(--muted); margin: 20px 0; }

/* ---- Footer --------------------------------------------------------------------- */
.site-footer { margin-top: 60px; padding: 30px 0 50px; text-align: center; color: var(--muted); }
.site-footer p { margin: 4px 0; }

/* ---- Responsive ------------------------------------------------------------------ */
@media (max-width: 820px) {
  .nav-toggle { display: flex; }
  .site-nav {
    display: none;
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    background: var(--green-900);
    position: absolute;
    top: 100%; left: 0; right: 0;
    padding: 10px 20px 18px;
  }
  .site-nav.open { display: flex; }
  .site-nav a { padding: 12px 10px; }
  .site-header__inner { position: relative; }
}
@media (max-width: 560px) {
  h1 { font-size: 1.6rem; }
  .profile-head { flex-direction: column; align-items: flex-start; }
}
