/* =========================================================================
   Weston Masters Cricket Club — page-level extensions
   Built on top of style.css (the designer's core stylesheet / DESIGN.md).
   Adds the page-specific patterns the markup needs: page heroes, split
   layouts, match lists, gallery, timeline, forms and small utilities.
   ========================================================================= */

/* -------------------------------------------------------------------------
   Inner-page hero (shorter than the full home hero)
   ------------------------------------------------------------------------- */
.hero--page {
  padding-block: calc(var(--space-xl) + 16px) var(--space-lg);
}
.hero--page h1 { max-width: 22ch; }

/* Centered hero variant for CTA-heavy pages */
.hero--center { text-align: center; }
.hero--center h1,
.hero--center .hero__sub { margin-inline: auto; }
.hero--center .hero__actions { justify-content: center; }

/* -------------------------------------------------------------------------
   Two-column split layout (about / contact)
   ------------------------------------------------------------------------- */
.split {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}
.split--reverse > :first-child { order: 2; }
@media (max-width: 860px) {
  .split { grid-template-columns: 1fr; gap: var(--space-lg); }
  .split--reverse > :first-child { order: 0; }
}

/* -------------------------------------------------------------------------
   Values / checklist lists
   ------------------------------------------------------------------------- */
.value-list { list-style: none; margin: 0; padding: 0; }
.value-list li {
  display: flex;
  gap: var(--space-sm);
  align-items: flex-start;
  padding: var(--space-sm) 0;
  border-bottom: 1px solid var(--color-border);
}
.value-list li:last-child { border-bottom: none; }
.value-list .value-list__icon {
  flex: none;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
  margin-top: 2px;
}
.value-list h3 { font-size: 1.1rem; margin: 0 0 0.2em; }
.value-list p { margin: 0; color: #4a574f; }

/* -------------------------------------------------------------------------
   Match rows (fixtures / results on the matches page)
   ------------------------------------------------------------------------- */
.match-list { display: flex; flex-direction: column; gap: var(--space-sm); }
.match-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-md);
  justify-content: space-between;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-sm) var(--space-md);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.match-row:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.match-row__main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.match-row__date {
  font-family: var(--font-body);
  font-size: var(--text-label);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-primary-dark);
}
.match-row__title { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin: 0; }
.match-row__meta { font-size: var(--text-body-sm); color: #4a574f; }
.match-row__score { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--color-ink); }
.match-row__score .result { color: var(--color-primary); }

/* "Add to calendar" link */
.cal-link {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-primary-dark);
  text-decoration: none;
  white-space: nowrap;
}
.cal-link:hover { text-decoration: underline; text-decoration-color: var(--color-accent); }

/* -------------------------------------------------------------------------
   Tournament timeline
   ------------------------------------------------------------------------- */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 8px;
  bottom: 8px;
  width: 2px;
  background: var(--color-border);
}
.timeline li { position: relative; padding: 0 0 var(--space-md) calc(var(--space-md) + 8px); }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 6px;
  width: 12px;
  height: 12px;
  border-radius: var(--radius-pill);
  background: var(--color-accent);
  border: 3px solid var(--color-paper);
  box-shadow: 0 0 0 2px var(--color-accent-deep);
}
.timeline time { font-weight: 600; color: var(--color-primary-dark); }
.timeline h3 { font-size: 1.15rem; margin: 0.2em 0 0.3em; }
.timeline p { margin: 0; color: #4a574f; }

/* -------------------------------------------------------------------------
   Gallery
   ------------------------------------------------------------------------- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-md);
}
.photo {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-card);
}
.photo__img { width: 100%; height: 100%; }
.photo__cap {
  position: absolute;
  inset-inline: 0;
  bottom: 0;
  padding: 28px var(--space-sm) var(--space-sm);
  background: linear-gradient(180deg, transparent, rgba(18, 28, 51, 0.82));
  color: var(--color-white);
  font-size: 0.92rem;
  line-height: 1.35;
}
.photo__tag {
  position: absolute;
  top: var(--space-sm);
  left: var(--space-sm);
  z-index: 1;
}
.photo__note {
  display: block;
  margin-top: var(--space-sm);
  font-size: var(--text-body-sm);
  color: var(--color-primary-dark);
  font-style: italic;
}

/* -------------------------------------------------------------------------
   News list
   ------------------------------------------------------------------------- */
.news-list { display: flex; flex-direction: column; gap: var(--space-md); }
.news-item {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md) var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.news-item:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.news-item time { font-weight: 600; color: var(--color-primary-dark); }
.news-item h3 { font-size: 1.3rem; margin: 0.25em 0 0.4em; }
.news-item p { color: #4a574f; margin-bottom: 0.6em; }

/* -------------------------------------------------------------------------
   CTA band (end-of-page next step)
   ------------------------------------------------------------------------- */
.cta-band {
  text-align: center;
  background: linear-gradient(120deg, var(--color-primary), var(--color-primary-dark));
  color: var(--color-white);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
}
.cta-band h2 { color: var(--color-white); margin-bottom: 0.3em; }
.cta-band .label { color: var(--color-accent); }
.cta-band p { color: #EDF3EE; max-width: 52ch; margin-inline: auto; }
.cta-band .btn { margin-top: var(--space-sm); }
.cta-band .btn--primary:hover { background-color: var(--color-accent); color: var(--color-ink); }

/* -------------------------------------------------------------------------
   Forms: success note
   ------------------------------------------------------------------------- */
.form-note {
  display: none;
  margin-top: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  color: var(--color-primary-dark);
  font-weight: 600;
}
.form-note.is-visible { display: block; }

/* -------------------------------------------------------------------------
   Mobile: keep the solid header's dropdown legible
   ------------------------------------------------------------------------- */
@media (max-width: 860px) {
  .site-header--solid .nav__list { background: var(--color-paper); }
  .site-header--solid .nav__list .nav__link { color: var(--color-ink); }
}

/* Small alignment helpers */
.mx-auto { margin-inline: auto; }
.text-muted { color: #4a574f; }

/* -------------------------------------------------------------------------
   Simplified-site additions (player cards, sponsor grid, tournaments,
   gallery lightbox) — build on the existing tokens.
   ------------------------------------------------------------------------- */

/* Player cards (Team page + home preview) */
.player-card {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  text-align: center;
}
.player-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-card-hover); }
.avatar {
  aspect-ratio: 3 / 4;
  display: grid;
  place-items: center;
  background: linear-gradient(140deg, var(--color-primary-light), var(--color-primary));
  color: var(--color-white);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 2.4rem;
}
.player-card__photo { aspect-ratio: 3 / 4; overflow: hidden; }
.player-card__photo img { width: 100%; height: 100%; object-fit: cover; }
.player-card__photo img.photo--top { object-position: center 20%; }
.player-card__body { padding: var(--space-sm) var(--space-md) var(--space-md); }
.player-card__body h3 { font-size: 1.15rem; margin: 0 0 0.15em; }
.player-card__role { color: var(--color-primary-dark); font-weight: 600; font-size: 0.9rem; }
.player-card__style { font-size: var(--text-body-sm); color: #4a574f; margin-top: 4px; }
.player-card .tag { margin: 0 0 8px; }

/* Sponsor logo grid */
.sponsor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: var(--space-md);
}
.sponsor-logo {
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-md);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 132px;
  text-align: center;
  gap: 8px;
  text-decoration: none;
  color: var(--color-ink);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.sponsor-logo:hover { transform: translateY(-3px); box-shadow: var(--shadow-card-hover); }
.sponsor-logo__mark {
  width: 54px;
  height: 54px;
  border-radius: var(--radius-pill);
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  display: grid;
  place-items: center;
  font-weight: 700;
}
.sponsor-logo__name { font-weight: 600; font-size: 0.95rem; }
.sponsor-logo__cat { font-size: var(--text-label); color: #4a574f; text-transform: uppercase; letter-spacing: 0.05em; }

/* Large visual tournament cards */
.tournament-card {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  min-height: 340px;
  display: flex;
  align-items: flex-end;
  box-shadow: var(--shadow-card);
}
.tournament-card__bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.tournament-card__overlay { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(20,62,42,0.05), rgba(20,62,42,0.9)); }
.tournament-card__content { position: relative; z-index: 1; color: var(--color-white); padding: var(--space-lg); width: 100%; }
.tournament-card__content .label { color: var(--color-accent); }
.tournament-card__content h3 { color: var(--color-white); margin: 0 0 0.2em; }
.tournament-card__meta { font-weight: 600; color: var(--color-accent); margin-bottom: 6px; }
.tournament-card__content p { color: #EDF3EE; max-width: 58ch; margin-bottom: 0.8em; }
.tournament-card .btn--accent { background-color: var(--color-accent); color: var(--color-ink); }

/* Lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(20, 42, 30, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--space-md);
}
.lightbox.is-open { display: flex; }
.lightbox img {
  max-width: 100%;
  max-height: 86vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-card-hover);
}
.lightbox__close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: var(--color-white);
  font-size: 2.4rem;
  line-height: 1;
  cursor: pointer;
}
.lightbox__caption {
  position: absolute;
  bottom: 22px;
  left: 0;
  right: 0;
  text-align: center;
  color: #EDF3EE;
  padding: 0 var(--space-md);
}
/* Make gallery tiles clickable to open the lightbox */
.photo--link { cursor: zoom-in; }

/* =========================================================================
   Roster carousel (homepage Meet-the-Team preview)
   Smaller cards, auto-rotates through all players.
   ========================================================================= */
.roster-carousel { position: relative; }
.roster-carousel__viewport { overflow: hidden; }
.roster-carousel__track {
  display: flex;
  gap: var(--space-md);
  transition: transform 0.5s var(--ease);
  will-change: transform;
}
.roster-carousel__track.is-dragging { transition: none; }
.roster-carousel__track > .player-card { flex: 0 0 0%; }
.player-card--sm { text-align: center; box-shadow: var(--shadow-card); }
.player-card--sm .avatar,
.player-card--sm .player-card__photo { aspect-ratio: 4 / 3; font-size: 1.6rem; }
.player-card--sm .player-card__body { padding: var(--space-sm); }
.player-card--sm h3 { font-size: 0.95rem; }
.player-card--sm .player-card__role { font-size: 0.78rem; }

.roster-carousel__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-pill);
  border: none;
  background: var(--color-primary);
  color: var(--color-white);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--shadow-card);
  opacity: 0.85;
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease);
}
.roster-carousel__nav:hover { opacity: 1; transform: translateY(-50%) scale(1.05); }
.roster-carousel__nav--prev { left: -16px; }
.roster-carousel__nav--next { right: -16px; }
@media (max-width: 720px) { .roster-carousel__nav--prev { left: -8px; } .roster-carousel__nav--next { right: -8px; } }
@media (max-width: 480px) { .roster-carousel__nav { display: none; } }

