/* Club page, 2027 look: the club page reads like the Village Square front
   page. Warm cream paper, hairline borders, deep green for active controls,
   serif headlines; photos and results bring the colour.

   Scope: only pages whose root carries .mv-club-page--fresh. Light-theme
   tokens are re-pointed here; the dark theme keeps the shared dark tokens
   from local_presentation.css and only gets the layout and type changes. */

[data-theme="myvillage"] .lp-page.mv-club-page--fresh {
  --ep-bg: #faf6ed;
  --ep-soft: #f3ecdd;
  --ep-border: #e6ddc9;
  --ep-fg: #1c2620;
  --ep-muted: #59625b;
  --ep-green: #174a32;
  --ep-link: #174a32;
  --ep-availability: #efe7d6;
  --mvc-card: #fffdf8;
  --mvc-win: #1f6b43;
  --mvc-draw: #9a6a12;
  --mvc-loss: #a2402f;
}

[data-theme="myvillage-dark"] .lp-page.mv-club-page--fresh {
  --mvc-card: var(--ep-soft);
  --mvc-win: #7fd3a4;
  --mvc-draw: #e5bd6a;
  --mvc-loss: #f09a88;
}

[data-theme="myvillage"]:has(.mv-club-page--fresh) body,
[data-theme="myvillage"]:has(.mv-club-page--fresh) main,
[data-theme="myvillage"]:has(.mv-club-page--fresh) .page-surface-wrapper,
[data-theme="myvillage"]:has(.mv-club-page--fresh) .ep-host {
  background: #faf6ed;
}

.lp-page.mv-club-page--fresh {
  --mvc-serif: ui-serif, Georgia, Cambria, "Times New Roman", Times, serif;
  --mvc-radius: 14px;
  max-width: 1180px !important;
  padding: 0 16px 160px;
  background: var(--ep-bg) !important;
}

/* Serif headlines, as on the Square (beats the Arial lock in the shared CSS). */
.lp-page.mv-club-page--fresh :is(h1, h2, h3, .font-serif) {
  font-family: var(--mvc-serif) !important;
  letter-spacing: -0.01em;
}

/* ---------- hero ---------- */
.mv-club-page--fresh .ep-hero {
  height: 220px;
  border-radius: 0 0 var(--mvc-radius) var(--mvc-radius);
  overflow: hidden;
}

/* No banner yet: a quiet "pitch" in club green instead of a grey slab. */
.mv-club-page--fresh .ep-hero--empty {
  height: 150px;
  background:
    radial-gradient(circle at 82% 18%, rgb(255 255 255 / 0.14), transparent 42%),
    repeating-linear-gradient(90deg, rgb(255 255 255 / 0.045) 0 64px, transparent 64px 128px),
    linear-gradient(135deg, #1d5a3d 0%, #174a32 55%, #0f3524 100%);
}

.mv-club-page--fresh .ep-hero .ep-banner-start {
  border-radius: 9999px;
  background: rgb(250 246 237 / 0.94);
  color: #174a32;
  border: 0;
  font-weight: 650;
  box-shadow: 0 6px 18px rgb(0 0 0 / 0.18);
}

.mv-club-page--fresh .ep-identity {
  grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
  gap: 28px;
  padding: 26px 8px 18px;
  background: transparent;
}

.mv-club-page--fresh .ep-identity:has(.ep-logo) {
  padding-top: 58px;
}

.mv-club-page--fresh .ep-logo {
  width: 92px;
  height: 92px;
  top: -50px;
  left: 8px;
  padding: 8px;
  background: var(--ep-bg);
  border: 3px solid var(--ep-bg);
  box-shadow: 0 0 0 1px var(--ep-border), 0 8px 22px rgb(23 74 50 / 0.16);
}

.mv-club-page--fresh .ep-logo--monogram {
  display: grid;
  place-items: center;
  padding: 0;
  background: #174a32;
  color: #faf6ed;
  font-family: var(--mvc-serif);
  font-size: 40px;
  font-weight: 700;
  line-height: 1;
}

.mv-club-page--fresh .ep-identity h1 {
  font-size: clamp(30px, 4.2vw, 46px);
  line-height: 1.05;
  font-weight: 700;
}

.mv-club-page--fresh .ep-description {
  font-size: 17px;
  line-height: 1.55;
  max-width: 620px;
  margin-top: 12px !important;
}

.mv-club-page--fresh .ep-meta {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px !important;
  padding: 5px 12px;
  border: 1px solid var(--ep-border);
  border-radius: 9999px;
  background: var(--mvc-card);
  font-size: 13px;
  font-weight: 600;
  color: var(--ep-fg);
}

.mv-club-page--fresh .ep-meta svg {
  width: 15px;
  height: 15px;
}

.mv-club-page--fresh .ep-actions {
  grid-template-columns: 1fr;
  gap: 8px;
  align-self: end;
}

.mv-club-page--fresh .ep-actions > a,
.mv-club-page--fresh .ep-actions .ep-follow :is(a, button) {
  min-height: 44px;
  border-radius: 9999px;
  border: 1px solid var(--ep-border) !important;
  background: var(--mvc-card) !important;
  box-shadow: none;
  font-size: 14px;
}

.mv-club-page--fresh .ep-actions > a:hover,
.mv-club-page--fresh .ep-actions .ep-follow :is(a, button):hover {
  border-color: var(--ep-green) !important;
}

.mv-club-page--fresh .ep-actions .ep-call {
  background: var(--ep-green) !important;
  border-color: var(--ep-green) !important;
  color: #fff !important;
}

.mv-club-page--fresh .ep-actions .ep-follow > div {
  display: grid !important;
  grid-template-columns: 1fr;
  gap: 8px;
}

.mv-club-page--fresh .lp-address {
  margin: 0 8px 12px;
  border-radius: var(--mvc-radius);
  background: var(--mvc-card);
}

/* ---------- utility row: back, share, manage as quiet pills ---------- */
.mv-club-page--fresh .lp-utility-row {
  gap: 8px;
  padding: 4px 8px 16px;
  border-bottom: 1px solid var(--ep-border);
}

.mv-club-page--fresh .lp-utility-row > a,
.mv-club-page--fresh .lp-utility-row > :not(details) :is(a, button) {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--ep-border);
  border-radius: 9999px;
  background: var(--mvc-card);
  color: var(--ep-fg) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}

.mv-club-page--fresh .lp-utility-row > a:hover,
.mv-club-page--fresh .lp-utility-row > :not(details) :is(a, button):hover {
  border-color: var(--ep-green);
}

.mv-club-page--fresh .lp-utility-row > a:first-child::before {
  content: "←";
  font-weight: 700;
}

.mv-club-page--fresh .lp-utility-row .lp-owner {
  margin-left: auto;
  position: relative;
  padding: 0;
  border: 0;
  background: transparent;
}

.mv-club-page--fresh .lp-utility-row .lp-owner > summary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 16px;
  border-radius: 9999px;
  background: var(--ep-green);
  color: #fff;
  font-size: 13px;
  list-style: none;
}

.mv-club-page--fresh .lp-utility-row .lp-owner > summary::-webkit-details-marker {
  display: none;
}

.mv-club-page--fresh .lp-utility-row .lp-owner > summary::after {
  content: "";
  width: 6px;
  height: 6px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg) translateY(-2px);
}

.mv-club-page--fresh .lp-utility-row .lp-owner[open] {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.mv-club-page--fresh .lp-utility-row .lp-owner[open] > a {
  padding: 0 14px;
  min-height: 36px;
  align-items: center;
  border: 1px solid var(--ep-border);
  border-radius: 9999px;
  background: var(--mvc-card);
  color: var(--ep-fg) !important;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none !important;
}

.mv-club-page--fresh .lp-utility-row .lp-owner[open] > a:hover {
  border-color: var(--ep-green);
}

/* ---------- sponsors bar ---------- */
.lp-club.mv-club-page--fresh .mv-club-sponsors {
  padding: 14px 8px 0;
  background: transparent !important;
}

.mv-club-page--fresh .mv-club-sponsors > .lp-owner {
  padding: 0;
  border: 1px solid var(--ep-border);
  border-radius: var(--mvc-radius);
  background: var(--mvc-card);
}

.mv-club-page--fresh .mv-club-sponsors > .lp-owner > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 52px;
  padding: 0 18px;
  font-family: var(--mvc-serif);
  font-size: 17px;
  list-style: none;
}

.mv-club-page--fresh .mv-club-sponsors > .lp-owner > summary::-webkit-details-marker {
  display: none;
}

.mv-club-page--fresh .mv-club-sponsors > .lp-owner > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 1.5px solid;
  border-bottom: 1.5px solid;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
}

.mv-club-page--fresh .mv-club-sponsors > .lp-owner[open] > summary::after {
  transform: rotate(225deg);
}

.mv-club-page--fresh .mv-club-sponsors > .lp-owner[open] > section {
  padding: 4px 18px 18px;
}

/* ---------- section tabs (as the Square's Feed / Noticeboard tabs) ---------- */
.lp-club.mv-club-page--fresh .mv-club-section-tabs {
  margin-top: 10px;
  padding: 0 8px;
  gap: 4px;
  background: transparent !important;
  border-bottom: 1px solid var(--ep-border);
}

.lp-club.mv-club-page--fresh .mv-club-section-tab {
  min-height: 48px;
  padding: 14px 12px 12px;
  border-bottom: 2px solid transparent;
  color: var(--ep-muted) !important;
  font-size: 15px;
  font-weight: 600;
  transition: color 0.15s ease, border-color 0.15s ease;
}

.lp-club.mv-club-page--fresh .mv-club-section-tab:hover {
  color: var(--ep-fg) !important;
  text-decoration: none;
}

.lp-club.mv-club-page--fresh .mv-club-section-tab.is-active {
  color: var(--ep-fg) !important;
  font-weight: 700;
  border-bottom: 2px solid var(--ep-green);
}

/* ---------- body ---------- */
.lp-club.mv-club-page--fresh .mv-club-body {
  padding: 24px 8px 0;
  background: transparent !important;
}

/* Sections sit on the page like the Square feed: no box, a serif head
   with a hairline under it; the cards inside carry the borders. */
.lp-club.mv-club-page--fresh .mv-club-panel {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent !important;
}

.lp-club.mv-club-page--fresh .mv-club-body .space-y-4 > * + * {
  margin-top: 28px;
}

.mv-club-page--fresh .mv-club-panel__title,
.mv-club-page--fresh .mv-club-body h2 {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 8px;
  margin-bottom: 14px !important;
  border-bottom: 1px solid var(--ep-border);
  font-size: 23px !important;
  font-weight: 700 !important;
}

.mv-club-page--fresh .mv-club-panel > .flex:first-child {
  align-items: baseline;
  border-bottom: 1px solid var(--ep-border);
  margin-bottom: 14px !important;
}

.mv-club-page--fresh .mv-club-panel > .flex:first-child > h2 {
  border-bottom: 0;
  margin-bottom: 0 !important;
}

.mv-club-page--fresh .mv-club-panel > .flex:first-child > a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ep-link) !important;
}

/* Visitors often see no rail cards: let the main column take the width. */
.mv-club-page--fresh .mv-club-body__inner > .grid:has(> .mv-club-rail:not(:has(*))) > :first-child {
  grid-column: 1 / -1;
}

.mv-club-page--fresh .mv-club-rail:not(:has(*)) {
  display: none !important;
}

/* Cards: one family for fixtures, results, league, about, feed and teams. */
.mv-club-page--fresh :is(.mv-club-highlight, .mv-club-feed-card, .mv-club-about__card),
.mv-club-page--fresh .mv-club-panel a.block {
  position: relative;
  border: 1px solid var(--ep-border) !important;
  border-radius: var(--mvc-radius) !important;
  background: var(--mvc-card) !important;
  box-shadow: none !important;
  transition: border-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.mv-club-page--fresh .mv-club-feed-card:hover,
.mv-club-page--fresh .mv-club-panel a.block:hover {
  border-color: color-mix(in oklab, var(--ep-green) 45%, var(--ep-border)) !important;
  box-shadow: 0 6px 20px rgb(23 74 50 / 0.08) !important;
  transform: translateY(-1px);
}

.mv-club-page--fresh .mv-club-highlight {
  padding: 18px 20px !important;
}

.mv-club-page--fresh .mv-club-highlight__meta:first-child,
.mv-club-page--fresh .mv-club-highlight > p.uppercase:first-child,
.mv-club-page--fresh .mv-club-highlight__body > p.uppercase:first-child {
  color: var(--ep-link) !important;
  font-size: 11px !important;
  letter-spacing: 0.09em;
}

.mv-club-page--fresh .mv-club-highlight h3 {
  font-size: 17px !important;
  line-height: 1.3;
}

.mv-club-page--fresh .mv-club-panel a.block,
.mv-club-page--fresh .mv-club-panel a.block:hover * {
  text-decoration: none !important;
}

/* Scoreline: big serif numbers, tabular so they line up across cards. */
.mv-club-page--fresh .mv-club-highlight__score,
.mv-club-page--fresh .mv-club-highlight .text-2xl {
  font-family: var(--mvc-serif);
  font-size: 34px !important;
  line-height: 1.1;
  font-weight: 700 !important;
  font-variant-numeric: tabular-nums;
  color: var(--ep-fg) !important;
  margin: 2px 0 4px;
}

/* Result outcome: a slim accent bar down the left edge of the card. */
.mv-club-page--fresh .mv-club-result--w,
.mv-club-page--fresh .mv-club-result--d,
.mv-club-page--fresh .mv-club-result--l {
  padding-left: 24px !important;
  overflow: hidden;
}

.mv-club-page--fresh :is(.mv-club-result--w, .mv-club-result--d, .mv-club-result--l)::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--mvc-accent);
}

.mv-club-page--fresh .mv-club-result--w { --mvc-accent: var(--mvc-win); }
.mv-club-page--fresh .mv-club-result--d { --mvc-accent: var(--mvc-draw); }
.mv-club-page--fresh .mv-club-result--l { --mvc-accent: var(--mvc-loss); }

.mv-club-page--fresh :is(.mv-club-result--w, .mv-club-result--d, .mv-club-result--l) [data-testid="synced-source"] {
  color: var(--mvc-accent) !important;
  font-weight: 650;
}

.mv-club-page--fresh .mv-club-highlight [data-testid="synced-source"] a {
  color: inherit !important;
}

/* Fixtures: date tile like the Square's "Coming up" diary. */
.mv-club-page--fresh .mv-club-fixture {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.mv-club-page--fresh .mv-club-datetile {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 70px;
  border: 1px solid var(--ep-border);
  border-radius: 10px;
  background: var(--ep-bg);
  color: var(--ep-muted);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.mv-club-page--fresh .mv-club-datetile strong {
  font-family: var(--mvc-serif);
  font-size: 28px;
  line-height: 1;
  color: var(--ep-fg);
  letter-spacing: 0;
}

/* Next fixture and latest result side by side on wide screens. */
.mv-club-page--fresh .mv-club-matchday {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.mv-club-page--fresh .mv-club-matchday:empty {
  display: none;
}

/* Feed cards */
.mv-club-page--fresh .mv-club-feed-card__title {
  font-size: 19px !important;
  line-height: 1.3;
}

.mv-club-page--fresh .mv-club-feed-card__badge {
  border-color: var(--ep-border) !important;
  background: var(--ep-bg);
  color: var(--ep-muted) !important;
}

.mv-club-page--fresh .mv-club-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--ep-border);
  border-radius: 9999px;
  background: var(--mvc-card);
  color: var(--ep-fg) !important;
  font-size: 13px;
  font-weight: 600;
}

.mv-club-page--fresh .mv-club-empty-compact {
  padding: 18px 20px;
  border: 1px dashed var(--ep-border);
  border-radius: var(--mvc-radius);
  color: var(--ep-muted) !important;
}

/* Team cards */
.mv-club-page--fresh .mv-club-panel a.block .rounded-lg {
  border-radius: 9999px;
  background: color-mix(in oklab, var(--ep-green) 10%, transparent);
}

.mv-club-page--fresh .mv-club-panel a.block .text-primary,
.mv-club-page--fresh .mv-club-panel a.block:hover .group-hover\:text-primary {
  color: var(--ep-link) !important;
}

/* Owner-only notes (welcome, getting started): one calm card style. */
.mv-club-page--fresh .mv-club-owner-notes > div {
  margin-bottom: 0 !important;
  padding: 16px 18px !important;
  border: 1px solid var(--ep-border) !important;
  border-left: 4px solid var(--ep-green) !important;
  border-radius: var(--mvc-radius) !important;
  background: var(--mvc-card) !important;
}

.mv-club-page--fresh .mv-club-owner-notes > div + div {
  margin-top: 14px;
}

.mv-club-page--fresh .mv-club-owner-notes :is(.text-success, .text-info, .text-green-700) {
  color: var(--ep-fg) !important;
}

.mv-club-page--fresh .mv-club-owner-notes h3 {
  font-size: 17px !important;
  margin-bottom: 10px !important;
}

.mv-club-page--fresh .mv-club-owner-notes .text-info:not(h3) {
  color: var(--ep-link) !important;
  font-weight: 600;
}

.mv-club-page--fresh .mv-club-owner-notes .btn-primary {
  border-radius: 9999px;
  background: var(--ep-green);
  border-color: var(--ep-green);
}

/* ---------- sidebar rail ---------- */
.mv-club-page--fresh .mv-club-rail > * {
  border: 1px solid var(--ep-border) !important;
  border-radius: var(--mvc-radius) !important;
  background: var(--mvc-card) !important;
  box-shadow: none !important;
}

.mv-club-page--fresh .mv-club-rail h3 {
  font-size: 18px !important;
}

.mv-club-page--fresh .mv-club-rail :is(a.rounded-xl, a.block) {
  border-radius: 9999px !important;
}

.mv-club-page--fresh .mv-club-rail :is(.text-green-800, .text-green-700, .text-green-600) {
  color: var(--ep-link) !important;
}

.mv-club-page--fresh .mv-club-rail .bg-green-800 {
  background: var(--ep-green) !important;
}

@media (min-width: 1024px) {
  .mv-club-page--fresh .mv-club-rail {
    position: sticky;
    top: 96px;
    align-self: start;
  }
}

/* ---------- small screens ---------- */
@media (max-width: 767px) {
  .lp-page.mv-club-page--fresh {
    padding: 0 0 140px;
  }

  .mv-club-page--fresh .ep-hero {
    height: 160px;
    border-radius: 0;
  }

  .mv-club-page--fresh .ep-hero--empty {
    height: 110px;
  }

  .mv-club-page--fresh .ep-identity {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 20px 16px 14px;
  }

  .mv-club-page--fresh .ep-identity:has(.ep-logo) {
    padding-top: 46px;
  }

  /* Centred over the centred mobile identity (shared CSS translates it -50%). */
  .mv-club-page--fresh .ep-logo {
    width: 76px;
    height: 76px;
    top: -42px;
    left: 50%;
  }

  .mv-club-page--fresh .ep-logo--monogram {
    font-size: 32px;
  }

  .mv-club-page--fresh .ep-description {
    font-size: 16px;
  }

  .mv-club-page--fresh .ep-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mv-club-page--fresh .ep-actions .ep-call,
  .mv-club-page--fresh .ep-actions .ep-follow {
    grid-column: 1 / -1;
  }

  .mv-club-page--fresh .lp-utility-row {
    padding: 4px 16px 14px;
    flex-wrap: nowrap;
    overflow-x: auto;
    scrollbar-width: none;
  }

  .mv-club-page--fresh .lp-utility-row > * {
    flex: none;
  }

  .mv-club-page--fresh .lp-address,
  .lp-club.mv-club-page--fresh .mv-club-sponsors {
    margin-left: 16px;
    margin-right: 16px;
    padding-left: 0;
    padding-right: 0;
  }

  /* Underline tabs on phones too (the mobile shell otherwise draws pills). */
  .lp-club.mv-club-page--fresh .mv-club-section-tabs,
  body.mv-mobile-shell-on .lp-club.mv-club-page--fresh .mv-club-section-tabs {
    padding: 0 8px;
    gap: 0;
    background: transparent !important;
  }

  .lp-club.mv-club-page--fresh .mv-club-section-tab,
  body.mv-mobile-shell-on .lp-club.mv-club-page--fresh .mv-club-section-tab {
    min-height: 46px;
    padding: 13px 12px 11px;
    border: 0;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    background: transparent !important;
    font-size: 14px;
  }

  body.mv-mobile-shell-on .lp-club.mv-club-page--fresh .mv-club-section-tab.is-active {
    border-bottom-color: var(--ep-green);
  }

  .lp-club.mv-club-page--fresh .mv-club-body,
  body.mv-mobile-shell-on .lp-club.mv-club-page--fresh .mv-club-body {
    padding: 20px 0 0;
    background: transparent !important;
  }

  body.mv-mobile-shell-on .lp-club.mv-club-page--fresh .mv-club-body__inner {
    padding: 0 16px 24px;
  }

  .mv-club-page--fresh .mv-club-highlight__score,
  .mv-club-page--fresh .mv-club-highlight .text-2xl {
    font-size: 28px !important;
  }

  .mv-club-page--fresh .mv-club-panel__title,
  .mv-club-page--fresh .mv-club-body h2 {
    font-size: 21px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mv-club-page--fresh * {
    transition: none !important;
    transform: none !important;
  }
}
