/*
Theme Name:   VPC
Theme URI:    https://www.vpcpickleball.com/
Description:  Custom block theme for the Valleystream Pickleball Club. No page
              builder - design tokens live in theme.json, layout in block
              templates, and everything is a file under version control.
Author:       Ben Dow
Version:      2.1.5
Requires PHP: 7.4
Text Domain:  vpc
*/

/* =========================================================================
   Utility + design layer. Tokens live in theme.json; this file carries what
   theme.json cannot express: waves, cards, motion, a11y details.
   ========================================================================= */

:root {
  --vpc-shadow-card: 0 1px 2px rgba(16,34,43,.06), 0 8px 24px rgba(16,34,43,.10);
  --vpc-shadow-card-hover: 0 2px 4px rgba(16,34,43,.08), 0 16px 40px rgba(16,34,43,.16);
  --vpc-wave-blue: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath d='M0,55 C240,90 480,10 720,35 C960,60 1200,15 1440,45 L1440,90 L0,90 Z' fill='%2300A6E0'/%3E%3C/svg%3E");
  --vpc-wave-green: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath d='M0,60 C260,95 520,20 760,42 C1000,64 1240,22 1440,52 L1440,90 L0,90 Z' fill='%232E8739'/%3E%3C/svg%3E");
  --vpc-wave-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1440 90' preserveAspectRatio='none'%3E%3Cpath d='M0,58 C250,92 500,14 740,38 C980,62 1220,18 1440,48 L1440,90 L0,90 Z' fill='%23ffffff'/%3E%3C/svg%3E");
}

/* --- Header ------------------------------------------------------------- */

.vpc-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(255,255,255,.92);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(16,34,43,.07);
}
.vpc-header .wp-block-navigation a {
  text-decoration: none;
  position: relative;
  padding-bottom: .2em;
}
.vpc-header .wp-block-navigation a:hover { color: var(--wp--preset--color--vpc-blue); }
/* yellow underline swoosh on the current page */
.vpc-header .wp-block-navigation .current-menu-item > a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 4px; border-radius: 2px;
  background: var(--wp--preset--color--vpc-yellow);
}

/* --- Tri-colour rule (logo swoosh as a divider) -------------------------- */

hr.vpc-ball-rule, .vpc-ball-rule {
  height: 6px !important; border: 0; border-radius: 3px; opacity: 1;
  background: linear-gradient(90deg,
    var(--wp--preset--color--vpc-yellow) 0 33%,
    var(--wp--preset--color--vpc-blue-bright) 33% 66%,
    var(--wp--preset--color--vpc-green-bright) 66% 100%);
}
.vpc-header hr.vpc-ball-rule { height: 4px !important; margin: 0; border-radius: 0; }

/* --- Hero ---------------------------------------------------------------- */

.vpc-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60rem 30rem at 85% -20%, rgba(239,230,14,.28), transparent 60%),
    radial-gradient(50rem 28rem at -10% 110%, rgba(0,166,224,.14), transparent 60%),
    var(--wp--preset--color--vpc-mist);
}
/* the actual logo ball, drifting behind the headline */
.vpc-hero::before {
  content: ""; position: absolute; z-index: 0;
  width: 34rem; height: 34rem; top: -7rem;
  /* laptop: tucked behind the headline edge; big screens: pushed right into the free space beside the 46rem column */
  left: max(calc(50% + 10rem), calc(100% - 36rem));
  background: url(assets/ball.svg) center/contain no-repeat;
  opacity: .35;
  filter: saturate(.9);
  animation: vpc-drift 14s ease-in-out infinite alternate;
}
.vpc-hero > * { position: relative; z-index: 1; }

@keyframes vpc-drift {
  from { transform: translateY(0) rotate(0deg); }
  to   { transform: translateY(2.2rem) rotate(9deg); }
}

/* phones: no side space, so a smaller ball peeks from the top-right corner */
@media (max-width: 781px) {
  .vpc-hero::before {
    width: 19rem; height: 19rem;
    left: auto; right: -5.5rem; top: -4.5rem;
  }
}

.vpc-eyebrow {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 700; font-size: .95rem; letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--wp--preset--color--vpc-blue);
}

/* yellow marker sweep behind one word of the headline */
.vpc-mark {
  background: linear-gradient(104deg,
    transparent .12em, var(--wp--preset--color--vpc-yellow) .22em calc(100% - .22em), transparent calc(100% - .12em));
  margin: 0 -.05em;
  padding: 0 .08em;
  border-radius: .1em;
  box-decoration-break: clone; -webkit-box-decoration-break: clone;
}

/* wave section divider: attach to a full-width Group with position relative */
.vpc-wave-bottom-white { padding-bottom: 9rem !important; }
.vpc-wave-bottom-white::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; z-index: 1;
  height: 7.5rem;
  background:
    var(--vpc-wave-white) bottom/100% 5rem no-repeat,
    var(--vpc-wave-green) bottom .8rem center / 100% 6.2rem no-repeat,
    var(--vpc-wave-blue)  bottom 1.7rem center / 100% 7.5rem no-repeat;
}

/* --- Buttons ------------------------------------------------------------- */

.wp-block-button__link {
  box-shadow: 0 2px 8px rgba(16,34,43,.18);
  transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.wp-block-button__link:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(16,34,43,.24);
}
.is-style-outline .wp-block-button__link { box-shadow: none; border-width: 2px; }

/* --- Stat cards ----------------------------------------------------------- */

.vpc-cards { margin-top: -3.25rem; position: relative; z-index: 2; }
.vpc-card {
  background: #fff;
  border-radius: 18px;
  padding: 2rem 1.5rem 1.6rem !important;
  box-shadow: var(--vpc-shadow-card);
  border-top: 6px solid var(--vpc-card-accent, var(--wp--preset--color--vpc-blue));
  transition: transform .18s ease, box-shadow .18s ease;
}
.vpc-card:hover { transform: translateY(-4px); box-shadow: var(--vpc-shadow-card-hover); }
.vpc-card--yellow { --vpc-card-accent: var(--wp--preset--color--vpc-yellow); }
.vpc-card--blue   { --vpc-card-accent: var(--wp--preset--color--vpc-blue-bright); }
.vpc-card--green  { --vpc-card-accent: var(--wp--preset--color--vpc-green-bright); }
.vpc-card .vpc-stat {
  font-family: var(--wp--preset--font-family--display);
  font-weight: 800; font-size: var(--wp--preset--font-size--colossal);
  line-height: 1; letter-spacing: -0.02em;
}

/* --- Panels (New to the club? / Latest news) ------------------------------ */

.vpc-panel {
  background: var(--wp--preset--color--vpc-mist);
  border-radius: 18px;
  padding: 2rem !important;
  height: 100%;
}
.vpc-panel .wp-block-latest-posts { margin: 0; padding-left: 0; list-style: none; }
.vpc-panel .wp-block-latest-posts li {
  padding: .65rem 0;
  border-bottom: 1px dashed rgba(16,34,43,.18);
}
.vpc-panel .wp-block-latest-posts li:last-child { border-bottom: 0; }
.vpc-panel .wp-block-latest-posts a { font-weight: 700; text-decoration: none; }
.vpc-panel .wp-block-latest-posts a:hover { text-decoration: underline; }
.vpc-panel .wp-block-latest-posts__post-date {
  display: block; font-size: .9rem; color: var(--wp--preset--color--vpc-muted);
}

/* --- Inner-page title band ------------------------------------------------ */

.vpc-title-band {
  background:
    radial-gradient(46rem 18rem at 90% -30%, rgba(239,230,14,.20), transparent 60%),
    var(--wp--preset--color--vpc-mist);
}

/* --- Badges, tables ------------------------------------------------------- */

.vpc-badge {
  display: inline-block; padding: .2em .6em; border-radius: 999px;
  font-weight: 700; font-size: .8em; letter-spacing: .02em;
  background: var(--wp--preset--color--vpc-yellow);
  color: var(--wp--preset--color--vpc-ink);
}
.vpc-badge--closed { background: #E5E7EA; color: var(--wp--preset--color--vpc-muted); }
.vpc-badge--open   { background: var(--wp--preset--color--vpc-green); color: #fff; }

.vpc-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.vpc-table-wrap table { min-width: 32rem; border-collapse: collapse; width: 100%; }
.vpc-table-wrap th, .vpc-table-wrap td {
  padding: .6rem .75rem; border-bottom: 1px solid #E1E6EA; text-align: left;
}
.vpc-table-wrap thead th { background: var(--wp--preset--color--vpc-mist); }

/* --- Footer ---------------------------------------------------------------- */

.vpc-footer a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.vpc-footer .wp-block-list { list-style: none; padding-left: 0; }
.vpc-footer .wp-block-list li { padding: .2rem 0; }

/* --- Motion: staggered hero entrance -------------------------------------- */

@media not (prefers-reduced-motion: reduce) {
  .vpc-hero .vpc-eyebrow,
  .vpc-hero h1,
  .vpc-hero p,
  .vpc-hero .wp-block-buttons {
    animation: vpc-rise .6s cubic-bezier(.2,.7,.3,1) both;
  }
  .vpc-hero h1 { animation-delay: .08s; }
  .vpc-hero p { animation-delay: .16s; }
  .vpc-hero .wp-block-buttons { animation-delay: .26s; }
}
@keyframes vpc-rise {
  from { opacity: 0; transform: translateY(1.1rem); }
  to   { opacity: 1; transform: none; }
}

/* --- A11y ------------------------------------------------------------------ */

a:focus-visible, button:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, [tabindex]:focus-visible {
  outline: 3px solid var(--wp--preset--color--vpc-blue);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important; transition-duration: .01ms !important;
  }
}
