/**
 * GTGF v15.57 — Site 4.0 Deep Dive QA & Straight-to-the-point polish.
 * Final site-wide guardrails after the component/page layers.
 * Goals: readable functional type, safe wrapping/containment, predictable contrast,
 * and task-first spacing without redesigning the existing GTGF visual language.
 */
:root{
  --gtgf-readable-muted:#514c46;
  --gtgf-readable-muted-dark:#c7c3bc;
  --gtgf-accent-text-dark:#111;
  --gtgf-accent-text-on-light:#8f3000;
}

/* Containment: flex/grid children and long labels may shrink/wrap instead of escaping cards. */
body.gtgf-v14 :where(main,header,footer,section,article,aside,nav,div,form,fieldset,li){min-width:0}
body.gtgf-v14 :where(img,picture,video,canvas,svg){max-width:100%}
body.gtgf-v14 :where(h1,h2,h3,h4,p,li,dd,dt,label,summary,a,button,strong,small){overflow-wrap:break-word;word-break:normal}
body.gtgf-v14 :where(h1,h2,h3){text-wrap:balance}
body.gtgf-v14 :where(p,li){text-wrap:pretty}
body.gtgf-v14 :is(.button,.v14-btn,button:not(.submenu-toggle)){white-space:normal;max-width:100%;text-align:center}
body.gtgf-v14 .gtgf-account-incentive .button{white-space:normal}

/* Do not let old display microtype become unreadable functional UI. */
body.gtgf-v14 :is(
  .planner-field label,.planner-field label span,.planner-date-hint,.planner-action-summary,
  .planner-day__today,.planner-week-jump span,.planner-coach-tags span,.planner-coach-rhythm span,
  .nutrition-form label,.nutrition-form label span,.nutrition-day header span,.nutrition-meal small,
  .nutrition-results__legend,.nutrition-shopping__category-check,.nutrition-shopping__remove,
  .recipe-card__meta,.recipe-card__macro-grid small,.recipe-filter-status,.recipe-library-disclaimer,
  .event-card__footer,.event-card__meta,.event-card__share,.event-card__external,.event-login-link,
  .v1524-article-card__top,.v1524-article-card__footer,.v1524-article-card__labels span,
  .gtgf-club-section .eyebrow,.gtgf-community-compose__type span,.gtgf-sharing-automation__card small,
  .login-register-note,.booking-season-state
){font-size:max(.75rem,12px)!important;line-height:1.45}

/* Normal section foregrounds.
 * Important: only set the section itself. Nested components own their own
 * foreground. Earlier descendant selectors could turn dark cards inside a
 * paper section into dark-on-dark UI. */
body.gtgf-v14 .section--paper{color:#111}
body.gtgf-v14 .section--black{color:#fff}

/* Explicit contrast repairs found by the full CSS audit. */
body.gtgf-v14 .planner-day__today,
body.gtgf-v14 .gtgf-community-compose__bottom button,
body.gtgf-v14 .gtgf-week-checkin button,
body.gtgf-v14 .gtgf-sharing-form button,
body.gtgf-v14 .gtgf-community-dashboard-teaser__copy a,
body.gtgf-v14 .trip-v161-package-card:nth-child(2)::before,
body.gtgf-v14 .trip-v161-package-card:nth-child(2) .trip-v161-package-card__badge{color:var(--gtgf-accent-text-dark)!important}
body.gtgf-v14 :is(.button--strava,.gtgf-strava-button,.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,.gtgf-strava-history__community>a,.gtgf-strava-badge,.btn-strava,.member-strava-connect-button,.gtgf-private-strava-sync__intro>a:hover){color:#111!important}
body.gtgf-v14 .trip-v161-comparison__row b.is-added{color:var(--gtgf-accent-text-on-light)!important}
body.gtgf-v14 :is(.gtgf-week-checkin__note,.gtgf-private-strava-sync__policy){color:var(--gtgf-readable-muted)!important}
body.gtgf-v14 .booking-season-state.is-closed{color:#3f3b36!important}

/* Task-first archives: the real content begins immediately after the hero. */
body.gtgf-v14 .v156-knowledge-hero{padding-bottom:clamp(32px,5vw,58px)}
body.gtgf-v14 .v156-knowledge-library{padding-top:clamp(38px,5vw,68px)}
body.gtgf-v14 .v156-library-head{margin-bottom:20px}
body.gtgf-v14 .v156-filter-panel{margin-bottom:clamp(20px,3vw,32px)}
body.gtgf-v14 .v156-knowledge-routes,
body.gtgf-v14 .v156-featured,
body.gtgf-v14 .v1515-topic-hubs{padding-top:clamp(46px,6vw,82px);padding-bottom:clamp(46px,6vw,82px)}
body.gtgf-v14 .v156-knowledge-library + .v156-knowledge-routes{border-top:1px solid rgba(17,17,17,.12)}

body.gtgf-v14 .events-browser{padding-top:clamp(44px,6vw,78px)}
body.gtgf-v14 .events-browser__head{margin-bottom:clamp(24px,4vw,42px)}
body.gtgf-v14 .events-intro{padding-top:clamp(50px,6vw,82px);padding-bottom:clamp(50px,6vw,82px)}
body.gtgf-v14 .v1555-discovery-bridge{padding-top:clamp(24px,3vw,38px);padding-bottom:clamp(24px,3vw,38px)}

body.gtgf-v14 .recipe-library-tools{margin-top:clamp(18px,3vw,28px)}
body.gtgf-v14 .recipe-grid{margin-top:clamp(20px,3vw,30px)}
body.gtgf-v14 .recipe-library-more + .recipe-empty + .v1555-discovery-bridge,
body.gtgf-v14 .recipe-empty + .v1555-discovery-bridge{margin-top:clamp(28px,4vw,46px)}

/* Cards and controls should contain their content at every breakpoint. */
body.gtgf-v14 :is(.event-card,.recipe-card,.v145-article-card,.v1524-article-card,.saved-plan-card,.planner-day,.nutrition-day){max-width:100%;overflow-wrap:break-word}
body.gtgf-v14 :is(.event-card__footer,.recipe-card__footer,.v145-article-card__footer,.v1524-article-card__footer){flex-wrap:wrap;row-gap:10px}
body.gtgf-v14 :is(.event-card__share,.event-card__external,.recipe-card__link,.recipe-card__shopping){max-width:100%;white-space:normal}
body.gtgf-v14 .v1555-event-essentials strong{white-space:normal;overflow:visible;text-overflow:clip}
body.gtgf-v14 .events-filter-fields>*{min-width:0}
body.gtgf-v14 .recipe-library-tools__row>*{min-width:0}

/* Horizontal chip groups may scroll intentionally; the page itself never should. */
body.gtgf-v14 :is(.recipe-filters,.events-sport-filter,.planner-week-navigation,.planner-phase-rail){max-width:100%}
body.gtgf-v14 :is(.recipe-filters,.events-sport-filter){overflow-x:auto;overscroll-behavior-inline:contain;scrollbar-width:thin}

/* Make recurrent helper/next-step surfaces compact: content, not another hero. */
body.gtgf-v14 .v1555-discovery-bridge__inner,
body.gtgf-v14 .v1555-discovery-bridge--compact{padding:clamp(18px,2.5vw,28px)}
body.gtgf-v14 .v1555-discovery-bridge strong{font-size:clamp(1.05rem,1.6vw,1.35rem)}

/* Mobile: reduce forced horizontal patterns and guarantee full-width actions. */
@media(max-width:760px){
  body.gtgf-v14 :is(.event-card__footer,.recipe-card__footer,.v145-article-card__footer,.v1524-article-card__footer){align-items:stretch}
  body.gtgf-v14 :is(.event-card__footer a,.event-card__footer button,.recipe-card__footer a,.recipe-card__footer button){width:100%;justify-content:center}
  body.gtgf-v14 .v1555-event-more>summary{white-space:normal}
  body.gtgf-v14 .v156-knowledge-hero__lead{max-width:34rem}
  body.gtgf-v14 .v156-knowledge-proof{display:flex;flex-wrap:wrap;gap:8px 14px}
}

/* Extra narrow devices: avoid accidental two-column squeeze. */
@media(max-width:430px){
  body.gtgf-v14 :is(.v1555-event-essentials,.v1555-apply-row,.gtgf-account-incentive){grid-template-columns:1fr}
  body.gtgf-v14 :is(.planner-summary__stats,.v154-nutrition-centre__grid,.v154-fuel-reference__grid){min-width:0}
}

@media(prefers-reduced-motion:reduce){
  body.gtgf-v14 *{scroll-behavior:auto!important}
}
