/*
Theme Name: Smile Golf
Theme URI: https://smilegolf.co.nz
Author: blamejen
Description: Parent theme for the Smile Golf network: the landing page, plus the shared look the tournament and academy sites build on.
Version: 0.1.0
Requires PHP: 8.0
Text Domain: smilegolf
*/

/* ---------------------------------- tokens */
:root {
  /* From the two logos: the smiley's yellow and the wordmark's green. Green
     doubles as the text colour, so black only appears in the smiley itself. */
  --yellow: #fde003;
  --green: #133f1a;
  --green-hover: #1e5a28;
  --yellow-hover: #ffea4d;
  --paper: #ffffff;
  --range: #f1f4ec;        /* quiet blocks */
  --line: #d5ddcc;         /* rules and borders */
  --ink: var(--green);
  --ink-soft: #4a6350;     /* secondary text */

  --font: "Nunito", ui-rounded, system-ui, -apple-system, "Segoe UI", sans-serif;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: clamp(1.5rem, 1.25rem + 1vw, 2rem);
  --step-3: clamp(2rem, 1.5rem + 2vw, 3rem);
  --step-4: clamp(2.75rem, 1.75rem + 4.5vw, 5.5rem);

  --gutter: clamp(1rem, 0.5rem + 2.5vw, 2.5rem);
  --measure: 34rem;
  --radius: 999px;         /* buttons only: round like the logo's letters */
}

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
}

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

h1, h2, h3 {
  margin: 0;
  font-weight: 900;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

p { margin: 0; }

a { color: inherit; text-underline-offset: 0.18em; }

:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 3px;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  padding: 0.6rem 1rem;
  background: var(--green);
  color: var(--paper);
  z-index: 10;
}
.skip-link:focus { top: 0.5rem; }

/* ---------------------------------- buttons */
.button {
  display: inline-block;
  padding: 0.8rem 1.6rem;
  border: 2px solid transparent;
  border-radius: var(--radius);
  font-weight: 800;
  font-size: var(--step-0);
  line-height: 1.2;
  text-decoration: none;
  transition: background-color 0.15s ease;
}
.button--green { background: var(--green); color: var(--paper); }
.button--green:hover { background: var(--green-hover); }
.button--yellow { background: var(--yellow); color: var(--green); }
.button--yellow:hover { background: var(--yellow-hover); }
.button--outline { border-color: currentColor; }
.button--outline:hover { background: rgba(255, 255, 255, 0.12); }

/* Focus ring that shows on either colour. */
.button:focus-visible { outline-color: var(--paper); box-shadow: 0 0 0 6px var(--green); }

/* ---------------------------------- landing */
.landing {
  display: flex;
  flex-direction: column;
  min-height: 100svh;
}

.landing__brand {
  padding: 2rem var(--gutter) 1.75rem;
  text-align: center;
}
.landing__wordmark {
  width: min(30rem, 100%);
  margin: 0 auto;
}
.landing__tagline {
  margin-top: 0.75rem;
  font-weight: 700;
  color: var(--ink-soft);
}

.landing__split {
  position: relative;
  flex: 1;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.door {
  display: flex;
  align-items: flex-end;
  padding: clamp(3rem, 8vw, 6rem) var(--gutter) clamp(2.5rem, 6vw, 4.5rem);
}
.door--academy { background: var(--yellow); color: var(--green); justify-content: flex-end; }
.door--tour { background: var(--green); color: var(--paper); }

/* Each half's text sits towards the seam, so the two read as a pair. */
.door__body {
  width: min(var(--measure), 100%);
  padding-inline: clamp(1rem, 5vw, 4.5rem);
}
.door--academy .door__body { padding-left: 0; }
.door--tour .door__body { padding-right: 0; }

.door__title {
  /* Sized so "Tournaments" fits its half at every width. */
  font-size: clamp(2.75rem, 1.5rem + 3.6vw, 4.75rem);
}
.door__text {
  margin: 1rem 0 1.75rem;
  font-size: var(--step-1);
  line-height: 1.45;
}

/* The smiley sits on the seam like a ball on the line. */
.landing__ball {
  position: absolute;
  left: 50%;
  top: clamp(2.5rem, 9vw, 5rem);
  width: clamp(5.5rem, 4rem + 6vw, 10rem);
  transform: translateX(-50%) rotate(-12deg);
  filter: drop-shadow(0 0.6rem 0.8rem rgba(19, 63, 26, 0.25));
}

@media (max-width: 47.99em) {
  /* Stacked halves size to their content instead of stretching to the screen. */
  .landing { min-height: 0; }
  .landing__split { grid-template-columns: 1fr; }
  .door { justify-content: flex-start; padding-block: 3rem 3.5rem; }
  .door--academy { justify-content: flex-start; }
  .door .door__body { padding-inline: 0; }
  .door--tour { padding-top: 4.5rem; }
  .landing__ball {
    top: auto;
    left: auto;
    right: var(--gutter);
    bottom: calc(50% - 2.75rem);
    transform: rotate(-12deg);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .landing__ball { animation: roll-in 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.1) both; }
  @keyframes roll-in {
    from { translate: -40vw 0; rotate: -360deg; }
  }
}

/* ---------------------------------- generic page */
.page {
  max-width: 44rem;
  margin: 0 auto;
  padding: 4rem var(--gutter);
}
.page__title { font-size: var(--step-3); margin-bottom: 1.5rem; }
.page__body > * + * { margin-top: 1em; }

/* ---------------------------------- footer */
.site-footer {
  background: var(--range);
  color: var(--ink);
  padding: 2.5rem var(--gutter) 1.5rem;
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: space-between;
  align-items: center;
  max-width: 72rem;
  margin: 0 auto;
}
.site-footer__name { font-weight: 900; font-size: var(--step-1); margin-bottom: 0.4rem; }
.site-footer__contact a { text-decoration: none; }
.site-footer__contact a:hover { text-decoration: underline; }
.site-footer__pga {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: 18rem;
  font-size: var(--step--1);
  font-weight: 700;
  color: var(--ink-soft);
}
/* The badge is a JPEG on white; multiply lets the footer colour show through. */
.site-footer__pga img { width: 4.5rem; flex: none; mix-blend-mode: multiply; }
.site-footer__legal {
  max-width: 72rem;
  margin: 2rem auto 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}
