/**
 * GTGF v15.99.58 — Site-wide contrast guard
 * Final safety layer for desktop + mobile. Loaded after every legacy/component layer.
 * Goal: readable text/control states without changing page geometry or product logic.
 */
:root{
  --gtgf-cg-dark:#090909;
  --gtgf-cg-dark-2:#111;
  --gtgf-cg-paper:#f4f2ed;
  --gtgf-cg-white:#fff;
  --gtgf-cg-ink:#111;
  --gtgf-cg-muted-dark:#cbc7c0;
  --gtgf-cg-muted-paper:#625d56;
  --gtgf-cg-orange:#ff5a00;
}

/* Brand-orange controls need dark ink: white on #ff5a00 is only ~3.1:1. */
body.gtgf-v14 :is(
  .button,.wp-element-button,.v14-btn,
  button[type="submit"],input[type="submit"],
  .planner-readiness__actions button,
  .v1569-form-foot button,
  .gtgf-community-compose__bottom button,
  .gtgf-week-checkin button,
  .gtgf-sharing-form button,
  .gtgf-community-dashboard-teaser__copy a
)[style*="background"]{
  text-shadow:none;
}
body.gtgf-v14 :is(
  .button--orange,.button.is-orange,.v14-btn--orange,
  .planner-readiness__actions button,
  .v1569-form-foot button,
  .gtgf-community-compose__bottom button,
  .gtgf-week-checkin button,
  .gtgf-sharing-form button,
  .gtgf-community-dashboard-teaser__copy a,
  .planner-day__today
){
  color:#111 !important;
  -webkit-text-fill-color:#111 !important;
}

/* Strava orange also needs dark ink at normal text sizes. */
body.gtgf-v14 :is(
  .button--strava,.btn-strava,.gtgf-strava-button,.gtgf-strava-badge,
  .member-strava-connect-button,.gtgf-strava-history__community>a,
  .gtgf-club-nav__strava,.gtgf-private-strava-sync.is-empty>a,
  .gtgf-strava-club-bridge>a,.gtgf-strava-club-bridge__mark,
  .gtgf-community-v143 .gtgf-sync-row a
){
  color:#111 !important;
  -webkit-text-fill-color:#111 !important;
  text-shadow:none !important;
}

/* Known low-contrast paper labels/statuses. */
body.gtgf-v14 .trip-v161-comparison__row b.is-added{color:#a83b00 !important;}
body.gtgf-v14 .booking-season-state.is-closed{color:#3f3c38 !important;}
body.gtgf-v14 .v1584-club-onboarding__steps span{color:#5f5a54 !important;}
body.gtgf-v14 .planner-summary__stats span,
body.gtgf-v14 #planner-results .planner-summary__stats > span{color:#625d56 !important;}
body.gtgf-v14 .gtgf-week-checkin__note,
body.gtgf-v14 .v1569-privacy-note,
body.gtgf-v14 .planner-day-nav__item,
body.gtgf-v14 .gtgf-private-strava-sync__policy{color:#625d56 !important;}

/* Known low-contrast dark microcopy. */
body.gtgf-v14 .v1569-race-review-mini span,
body.gtgf-v14 .v1569-race-memory>p{color:#a9a5a0 !important;}
body.gtgf-v14 .v1573-block-row.is-head,
body.gtgf-v14 .v1574-quality-row.is-head{color:#aaa59d !important;}
body.gtgf-v14 .v1595-method-note{color:#c4c0b9 !important;}

/* Orange-on-orange chips become light text on a genuinely dark chip instead. */
body.gtgf-v14 :is(.v159-tri-balance em,.v1588-major-badge,.v1596-event-tags .is-major,
  .planner-week-heading__identity > strong i,.planner-session__signals .is-adaptive,
  #boodschappenlijst .nutrition-shopping__contract strong,
  #boodschappenlijst .nutrition-shopping__amount.is-buy){
  color:#ff8a4b !important;
  -webkit-text-fill-color:#ff8a4b !important;
}

/* Form controls: never inherit a same-colour foreground/background from a parent. */
body.gtgf-v14 :is(.section--black,.v14-member-stage--dark,.planner-form,.nutrition-form,.login-section .planner-auth-card:not(.planner-auth-card--orange))
:is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  background:#151515 !important;
  color:#f8f7f4 !important;
  -webkit-text-fill-color:#f8f7f4 !important;
  border-color:#4a4a4a !important;
}
body.gtgf-v14 :is(.section--black,.v14-member-stage--dark,.planner-form,.nutrition-form,.login-section .planner-auth-card:not(.planner-auth-card--orange))
:is(input,textarea)::placeholder{color:#aaa59d !important;opacity:1 !important;}
body.gtgf-v14 :is(.section--paper,.section--soft,.v14-member-stage--paper,.planner-auth-card--orange)
:is(input:not([type="checkbox"]):not([type="radio"]),select,textarea){
  background:#fff !important;
  color:#171717 !important;
  -webkit-text-fill-color:#171717 !important;
  border-color:#aaa59d !important;
}
body.gtgf-v14 :is(.section--paper,.section--soft,.v14-member-stage--paper,.planner-auth-card--orange)
:is(input,textarea)::placeholder{color:#6e6962 !important;opacity:1 !important;}

/* Explicit auth contract, including the mobile account/create-account surface. */
body.gtgf-v14 .login-section .planner-auth-card:not(.planner-auth-card--orange){background:#0b0b0b !important;color:#fff !important;}
body.gtgf-v14 .login-section .planner-auth-card:not(.planner-auth-card--orange) :is(h1,h2,h3,h4,strong,label,legend,summary){color:#fff !important;}
body.gtgf-v14 .login-section .planner-auth-card:not(.planner-auth-card--orange) :is(p,small,span,.login-register-note){color:#cbc7c0 !important;}
body.gtgf-v14 .login-section .planner-auth-card--orange{background:#fff !important;color:#111 !important;}
body.gtgf-v14 .login-section .planner-auth-card--orange :is(h1,h2,h3,h4,strong,label,legend,summary){color:#111 !important;}
body.gtgf-v14 .login-section .planner-auth-card--orange :is(p,small,span,.login-register-note){color:#5f5a55 !important;}

/* Small muted copy must remain readable on true dark workspaces. */
body.gtgf-v14 :is(.planner-form,.nutrition-form,.training-guide159950,.nutrition-guide159949,.v14-member-stage--dark)
:is(.muted,small,.planner-step__intro,.planner-field-heading small,.nutrition-guide159949__head>p:last-child){
  color:#b9b5ae;
}

/* Focus/disabled states need a visible state, not just lower opacity. */
body.gtgf-v14 :is(a,button,input,select,textarea,summary):focus-visible{
  outline:3px solid #ff7a2d !important;
  outline-offset:3px !important;
}
body.gtgf-v14 button:disabled,
body.gtgf-v14 input:disabled,
body.gtgf-v14 select:disabled,
body.gtgf-v14 textarea:disabled{
  opacity:1 !important;
  cursor:not-allowed !important;
}
body.gtgf-v14 .v1569-form-foot button:disabled{
  background:#b9b3a8 !important;
  color:#3c3935 !important;
  -webkit-text-fill-color:#3c3935 !important;
}

/* Mobile: prevent edge clipping and low-contrast text on image/gradient surfaces. */
@media(max-width:760px){
  body.gtgf-v14 :is(.v14-page,.v14-home-main,.v14-member-app) :is(h1,h2,h3,h4,p,li,label,small,strong,span,a,button){
    overflow-wrap:anywhere;
  }
  body.gtgf-v14 :is(.v14-shell,.wrap){
    width:min(100% - 32px,1240px);
  }
  body.gtgf-v14 :is(.section--black,.v14-member-stage--dark,.planner-form,.nutrition-form)
  :is(p,li,small,.muted){
    color:#c8c4bd;
  }
  body.gtgf-v14 :is(.section--orange,.planner-auth-card--orange){
    color:#111 !important;
  }
  body.gtgf-v14 :is(.section--orange,.planner-auth-card--orange) :is(h1,h2,h3,h4,p,li,label,strong,small,span,a){
    color:#111;
    -webkit-text-fill-color:#111;
  }
  /* image heroes: keep copy readable regardless of crop */
  body.gtgf-v14 :is(.v1576-hero,.v145-article-hero,.v1526-news-article__hero,[class*="hero"][style*="background-image"]){
    text-shadow:0 1px 2px rgba(0,0,0,.45);
  }
}

/* Global utility text that was repeatedly below AA on paper. */
body.gtgf-v14 .v14-site-footer .v14-footer-muted{color:#aaa59d !important;opacity:1 !important;}
body.gtgf-v14 :is(input,textarea)::placeholder{color:#6e6962;opacity:1;}
body.gtgf-v14 :is(.section--black,.v14-member-stage--dark,.planner-form,.nutrition-form,.login-section .planner-auth-card:not(.planner-auth-card--orange))
:is(input,textarea)::placeholder{color:#aaa59d !important;opacity:1 !important;}

/* Community paper microcopy: old #999/#8a857d values were too faint on white. */
body.gtgf-v14 :is(.gtgf-community-post,.gtgf-club-board,.gtgf-challenge-card,.gtgf-week-checkin,.gtgf-sharing-form)
:is(small,.gtgf-community-delete,.gtgf-club-rank__name em,.gtgf-club-rank__name small,.gtgf-challenge-card__top,.gtgf-week-checkin__week span,.gtgf-week-checkin label span){
  color:#625d56 !important;
  opacity:1 !important;
}

/* Planner result paper microcopy. */
body.gtgf-v14 #planner-results :is(.planner-day__date,.planner-day-nav__item small,.planner-session__order,.planner-guide-quickfacts small){
  color:#625d56 !important;
  opacity:1 !important;
}

/* Dashboard paper microcopy that was visually washed out. */
body.gtgf-v14 :is(.v15992-priority,.v159943-progress,.v1561-progress-panel,.v1561-progress-empty,.v1561-sport-progress__grid)
:is(p,small){
  color:#67625c;
}
