/* ========================================
   TJ's Gymnastics Club — Global Styles
   ======================================== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&family=Fredoka:wght@400;500;600&display=swap');

/* --- Design Tokens --- */
:root {
  /* Main palette */
  --plum: #7A2A7A;
  --plum-dark: #5C1F5C;
  --magenta: #D94A9F;
  --blush: #F3C7E7;
  --pink-wash: #F7E9F5;

  /* Secondary */
  --mint: #39C39A;
  --lime: #DDEB3C;

  /* Tertiary */
  --cream: #F5EFE7;

  /* Functional */
  --white: #FFFFFF;
  --text-dark: #2D0A2D;
  --text-body: #4B3044;
  --text-light: #7A5A72;

  /* Spacing scale (8px base) */
  --space-xs: 0.25rem;   /* 4px */
  --space-sm: 0.5rem;    /* 8px */
  --space-md: 1rem;      /* 16px */
  --space-lg: 1.5rem;    /* 24px */
  --space-xl: 2rem;      /* 32px */
  --space-2xl: 3rem;     /* 48px */
  --space-3xl: 4rem;     /* 64px */
  --space-4xl: 6rem;     /* 96px */
  --space-5xl: 8rem;     /* 128px */

  /* Radii */
  --radius-sm: 8px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --radius-circle: 50%;

  /* Typography */
  --font-heading: 'Fredoka', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Font sizes (fluid) */
  --text-sm:   clamp(0.8rem,   0.75rem + 0.25vw, 0.875rem);
  --text-base: clamp(0.938rem, 0.875rem + 0.3vw,  1rem);
  --text-lg:   clamp(1.063rem, 1rem    + 0.3vw,   1.125rem);
  --text-xl:   clamp(1.25rem,  1.1rem  + 0.5vw,   1.5rem);
  --text-2xl:  clamp(1.5rem,   1.2rem  + 1vw,     2rem);
  --text-3xl:  clamp(1.875rem, 1.4rem  + 1.5vw,   2.5rem);
  --text-4xl:  clamp(2.25rem,  1.6rem  + 2vw,     3.25rem);
  --text-5xl:  clamp(2.75rem,  1.8rem  + 3vw,     4rem);

  /* Shadows — plum-tinted, no cold greys */
  --shadow-sm: 0 1px 3px rgba(122, 42, 122, 0.06);
  --shadow-md: 0 4px 16px rgba(122, 42, 122, 0.10);
  --shadow-lg: 0 8px 32px rgba(122, 42, 122, 0.14);

  /* Transitions */
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --duration: 0.25s;

  /* Layout */
  --container-max: 1200px;
  --container-padding: clamp(1rem, 4vw, 2rem);
}

/* --- Reset --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--text-base);
  line-height: 1.65;
  color: var(--text-body);
  background-color: #FFF9FD;
  background-image: radial-gradient(circle, rgba(122,42,122,0.04) 1px, transparent 1px);
  background-size: 22px 22px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--plum);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
a:hover { color: var(--magenta); }

ul, ol { list-style: none; }

button { font-family: var(--font-body); }

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--text-dark);
  line-height: 1.2;
}

h1 { font-size: var(--text-5xl); }
h2 { font-size: var(--text-4xl); }
h3 { font-size: var(--text-3xl); }
h4 { font-size: var(--text-2xl); }
h5 { font-size: var(--text-xl); }
h6 { font-size: var(--text-lg); }

p + p { margin-top: var(--space-md); }

/* --- Layout helpers --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

.section {
  padding-top: var(--space-4xl);
  padding-bottom: var(--space-4xl);
}

@media (max-width: 768px) {
  .section { padding-top: var(--space-3xl); padding-bottom: var(--space-3xl); }
}

/* ========================================
   Header / Navigation
   ======================================== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--blush);
}

.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-sm) var(--container-padding);
  min-height: 68px;
}

.logo-link {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  margin-right: clamp(1.25rem, 2vw, 2rem);
}

.logo-img {
  height: 44px;
  width: auto;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(1.25rem, 1.6vw, var(--space-xl));
}

.nav-back {
  display: none;
}

.nav-link {
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
  transition: all var(--duration) var(--ease);
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--plum);
  border-bottom-color: var(--magenta);
}

.nav-link--promotion {
  color: var(--magenta);
  font-weight: 700;
}

.nav-link--promotion:hover,
.nav-link--promotion.active {
  color: var(--magenta);
}

/* Hamburger */
.nav-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--space-sm);
  flex-direction: column;
  gap: 5px;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}

.nav-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text-dark);
  border-radius: 2px;
  transition: all 0.3s var(--ease);
}

/* Mobile nav */
@media (max-width: 860px) {
  .nav-toggle { display: flex; }

  /* backdrop-filter creates a containing block for fixed descendants,
     which would trap the off-canvas nav and overlay inside the header.
     Disable it on mobile so position: fixed is relative to the viewport. */
  .site-header {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--white);
  }

  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--white);
    flex-direction: column;
    align-items: flex-start;
    padding: 80px var(--space-xl) var(--space-xl);
    gap: var(--space-md);
    box-shadow: var(--shadow-lg);
    transition: right 0.35s var(--ease);
    z-index: 200;
    overflow-y: auto;
  }

  .logo-link {
    margin-right: 0;
  }

  .nav-links.open { right: 0; }

  .nav-back {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.45rem;
    min-height: 44px;
    margin-bottom: var(--space-sm);
    padding: 0.35rem 0 var(--space-md);
    border: none;
    border-bottom: 1px solid rgba(217, 74, 159, 0.14);
    border-radius: 0;
    background: transparent;
    color: var(--plum);
    font-family: var(--font-body);
    font-size: var(--text-sm);
    font-weight: 600;
    cursor: pointer;
  }

  .nav-back span[aria-hidden="true"] {
    font-size: 1rem;
    line-height: 1;
  }

  .nav-back:hover {
    color: var(--magenta);
  }

  .nav-link {
    font-size: var(--text-lg);
    width: 100%;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid var(--pink-wash);
    border-right: none;
  }

  .nav-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(45, 10, 45, 0.45);
    z-index: 150;
  }

  .nav-overlay.open { display: block; }
}

/* ========================================
   Footer
   ======================================== */
.site-footer {
  background: var(--plum-dark);
  color: var(--white);
  position: relative;
  overflow: hidden;
}

.footer-watermark {
  display: none;
}

.footer-inner {
  position: relative;
  z-index: 1;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-3xl) var(--container-padding) var(--space-2xl);
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1.4fr;
  gap: var(--space-2xl);
}

.footer-section h4 {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  color: var(--white);
  margin-bottom: var(--space-md);
}

.footer-section p,
.footer-section address {
  color: rgba(255,255,255,0.72);
  font-size: var(--text-sm);
  line-height: 1.75;
  font-style: normal;
  margin: 0;
}

.footer-section a {
  color: rgba(255,255,255,0.72);
  font-size: var(--text-sm);
  transition: color var(--duration) var(--ease);
}
.footer-section a:hover { color: var(--white); }

.footer-links {
  list-style: none;
  /* Negative top margin nudges the partners list up so its first item
     ("British Gymnastics") visually aligns with sibling columns'
     first-line text. Box-model and line-height are already normalised;
     residual offset is optical, fixed here as a small local correction. */
  margin: -0.25rem 0 0;
  padding-left: 0;
}
.footer-links li + li { margin-top: var(--space-xs); }

.footer-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

.footer-find-us {
  display: flex;
  gap: 0;
  align-items: flex-start;
  margin-top: 0;
}

.footer-find-us address {
  font-style: normal;
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.72);
  line-height: 1.75;
  padding-right: var(--space-lg);
  border-right: 1px solid rgba(255,255,255,0.12);
  flex-shrink: 0;
  white-space: nowrap;
}

.footer-find-us-contact {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
  padding-left: var(--space-lg);
  justify-content: center;
  align-self: stretch;
}

.footer-find-us-contact a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.72);
  text-decoration: none;
  transition: color var(--duration) var(--ease);
}
.footer-find-us-contact a:hover { color: var(--white); }

/* Unified line-height across footer content so first-line text aligns
   vertically across the three columns. Uses .footer-find-us-contact > a
   (direct child) so .footer-social a (icon link) is not affected. */
.footer-section p,
.footer-section address,
.footer-links li,
.footer-find-us-contact > a {
  line-height: 1.75;
}

/* Social icons row — colour/hover inherits from .footer-find-us-contact a above. */
.footer-social {
  display: flex;
  gap: var(--space-sm);
  margin-top: var(--space-xs);
}

.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  width: 36px;
  height: 36px;
}

.footer-social svg {
  display: block;
}

.footer-bottom {
  position: relative;
  z-index: 1;
  border-top: 1px solid rgba(255,255,255,0.1);
  max-width: var(--container-max);
  margin: 0 auto;
  padding: var(--space-lg) var(--container-padding);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.footer-bottom p,
.footer-bottom a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.45);
}
.footer-bottom a:hover { color: rgba(255,255,255,0.7); }

@media (max-width: 768px) {
  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
  }
}
