html {
  font-size: 18px;
  /* Increased from default (16px) for global scaling */
}

@media (max-width: 600px) {
  html {
    font-size: 17px;
    /* Slightly smaller for small screens like iPhone 14 Pro Max */
  }
}

body {
  font-size: 1.125rem; /* 18px base for body text */
  min-width: 390px;   /* Matches iPhone 12 Pro viewport width */
}

/* Add this to your CSS */
body.overlay-open {
  overflow: hidden;
}

.hero-section {
  background: linear-gradient(135deg, #1a3a1a 0%, #0d1f0d 100%);
  color: #ffffff;      /* text-white */
  padding-top: 1.5rem;   /* pt-24 */
  padding-bottom: 1.5rem; /* pb-6 */
}

/****************************************************************************************************/
/* Headings */
/****************************************************************************************************/
h1 {
  font-size: clamp(1.75rem, 4vw, 2.5rem); /* ~28px → 40px */
  line-height: 1.2;                       /* Tight for big headings */
  font-weight: 700;
  margin-bottom: 1rem;                     /* Space below heading */
  text-align: center;
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);     /* ~24px → 32px */
  line-height: 1.3;                        /* Slightly looser */
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-align: center;
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem); /* ~20px → 24px */
  line-height: 1.4;                         /* Comfortable for subheads */
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: center;
}

.lastupdated {
  font-size: 0.75rem;         /* Smaller than Tailwind's text-sm (0.875rem) */
  line-height: 1.25;          /* Tight line spacing */
  text-align: center;
  font-style: italic;
  color: #6b7280;             /* Tailwind's gray-500 */
  margin-bottom: 1.5rem;      /* Equivalent to mb-6 */
}

.label-text {
  font-size: clamp(0.75rem, 2vw, 1.125rem); /* ~12px → 18px */
  color: #374151; /* Tailwind's gray-700 */
  margin-bottom: 0.25rem;
  display: block;
  font-weight: 500;
}

/****************************************************************************************************/
/* Season Select */
/****************************************************************************************************/
.season-select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 100%;
  padding: 0.5rem 1rem;
  font-size: clamp(0.875rem, 2vw, 1rem);
  font-weight: 500;
  color: #111827; /* gray-900 */
  background-color: white;
  border: 1px solid #d1d5db; /* gray-300 */
  border-radius: 0.375rem;
  margin-bottom: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 20 20' fill='none' stroke='%236b7280' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M6 8l4 4 4-4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.season-select:focus {
  outline: none;
  border-color: #16a34a; /* green-600 */
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.5);
}

/****************************************************************************************************/
/* Tables */
/****************************************************************************************************/
.custom-table {
  min-width: 100%;
  border-collapse: collapse;
  background-color: #ffffff; /* Tailwind's white */
  border-radius: 0.5rem;     /* rounded-lg */
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1),
              0 1px 2px rgba(0, 0, 0, 0.06); /* Tailwind's shadow */
  font-size: 0.75rem;        /* text-xs default for mobile */
  padding-left: 0.5rem;      /* px-2 */
  padding-right: 0.5rem;
}

/* Thead styling */
.custom-table thead {
  background-color: #e5e7eb; /* Tailwind's gray-200 */
  position: sticky;
  top: 0;
  z-index: 10;
}

.custom-tbody > tr + tr {
  border-top: 1px solid #e5e7eb; /* Tailwind's gray-200 */
}

/****************************************************************************************************/
/* Alpine.js: Prevent flash of content before initialization */
/****************************************************************************************************/
[x-cloak] {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  pointer-events: none !important;
  position: absolute !important;
}

/****************************************************************************************************/
/* Menu Card Styles */
/****************************************************************************************************/
.menu-card {
  padding: 1.25rem;
  border-radius: 1rem; /* rounded-xl */
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  justify-content: center;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  min-width: 44px;               /* WCAG touch target width */
  min-height: 44px;              /* WCAG touch target height */
  touch-action: manipulation;
}

.menu-card-link {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
}

.menu-card:hover,
.menu-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px #10b981, /* emerald-500 focus ring */
    0 4px 12px rgba(0,0,0,0.12); /* existing shadow */
  background: #f3f4f6;
  transform: translateY(-2px) scale(1.03);
}

.menu-card:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.menu-fixtures  {
  background: #e6f4ea;              /* Soft Mint */
  color: #2f6f4e;                   /* Deep Olive */
}

.menu-competitions {
  background: #fff7e0;              /* Buttercream */
  color: #a15c1b;                   /* Cinnamon Bronze */
}

.menu-leaguetable {
  background: #e3f0ff;              /* Powder Blue */
  color: #2a4f8a;                   /* Slate Indigo */
}

.menu-handicaps {
  background: #f3e8f9;              /* Lavender Mist */
  color: #5b2a86;                   /* Muted Plum */
}

.menu-highbreaks {
  background: #fbe8e8;              /* Blush Rose */
  color: #a83232;                   /* Ruby Red */
}

.menu-clubs {
  background: #fdf6f0;              /* Almond Cream */
  color: #3b3b3b;                   /* Charcoal */
}

/****************************************************************************************************/
/* Mobile Menu Button */
/****************************************************************************************************/
.mobile-menu-button {
  padding: 0.5rem 1rem;
  min-width: 44px;
  min-height: 44px;
  color: white;
  font-weight: 600;
  border-radius: 0.375rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  border: none;
  cursor: pointer;
  transition: all 150ms ease-in-out;
}

.mobile-menu-button:hover {
  background-color: #1d4ed8; /* Tailwind's blue-700 */
}

.mobile-menu-button:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.5); /* Tailwind's ring-blue-400 */
}

.mobile-menu-button:active {
  background-color: #1e40af; /* Tailwind's blue-800 */
  transform: scale(0.98);
}

/****************************************************************************************************/
/* Shortcut Card Styles */
/****************************************************************************************************/
.shortcut-card {
  border-radius: 1rem; /* rounded-xl */
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 1.25rem;
  text-align: center;
  background: #fff;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  min-width: 44px;               /* WCAG touch target width */
  min-height: 44px;              /* WCAG touch target height */
  touch-action: manipulation;
}

/* Icon */
.shortcut-card i {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

/* Label */
.shortcut-card .label {
  font-weight: bold;
  margin-top: 0.5rem;
  font-size: 1.1rem;
}

/* Hover & focus states */
.shortcut-card:hover,
.shortcut-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px #10b981, /* emerald-500 focus ring */
    0 4px 12px rgba(0,0,0,0.12); /* existing shadow */
  background: #f3f4f6;
  transform: translateY(-2px) scale(1.03);
}

/* Active (pressed) state */
.shortcut-card:active {
  transform: translateY(0) scale(1);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Accessible focus outline */
.shortcut-card:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}

/* Category colour themes */
.shortcut-fixtures {
  background: #e6f4ea; /* Soft Mint */
  color: #2f6f4e;      /* Deep Olive */
}

.shortcut-competitions {
  background: #fff7e0; /* Buttercream */
  color: #a15c1b;      /* Cinnamon Bronze */
}

.shortcut-leaguetable {
  background: #e3f0ff; /* Powder Blue */
  color: #2a4f8a;      /* Slate Indigo */
}

.shortcut-handicaps {
  background: #f3e8f9; /* Lavender Mist */
  color: #5b2a86;      /* Muted Plum */
}

.shortcut-highbreaks {
  background: #fbe8e8; /* Blush Rose */
  color: #a83232;      /* Ruby Red */
}

.shortcut-clubs {
  background: #fdf6f0; /* Almond Cream */
  color: #3b3b3b;      /* Charcoal */
}

/****************************************************************************************************/
/* Competition Cards */
/****************************************************************************************************/
.competition-link,
.notification-link {
  text-decoration: none;
  display: block;
}

.competition,
.competitionNoHover,
.notification,
.notificationNoHover,
.club-card {
  position: relative;
  background-color: #ffffff;
  border: 2px solid #e5e7eb; /* Tailwind's gray-200 — all four sides */
  border-radius: 0.5rem;     /* rounded-lg */
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  margin-bottom: 1rem;
}

.competition:hover,
.notification:hover,
.club-card:hover
 {
  border-color: #10b981; /* emerald-500 */
}

/* Active (pressed) state */
.competition:active,
.notification:active,
.club-card:active {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* Accessible focus outline */
.competition:focus-visible,
.notification:focus-visible,
.club-card:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 3px #10b981, /* emerald-500 focus ring */
    0 4px 12px rgba(0,0,0,0.12); /* existing shadow */
  background: #f3f4f6;
  transform: translateY(-2px) scale(1.03);
}

.competition-content,
.notification-content,
.club-card-content {
  padding: 1.5rem; /* px-6 py-4 */
  font-size: clamp(0.75rem, 2vw, 1rem); /* 12px → 16px */
  line-height: 1.625;
  color: #374151; /* Tailwind's gray-700 */
}

.competition-content h3,
.notification-content h3,
.club-card-content h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem); /* ~20px → 24px */
  line-height: 1.4;                         /* Comfortable for subheads */
  font-weight: 600;
  margin-bottom: 0.5rem;
  text-align: center;
}

.competition-content p,
.notification-content p,
.club-card-content p {
  margin-bottom: 0.5rem;
}

.competition-content ul,
.notification-content ul,
.club-card-content ul {
  font-size: clamp(0.75rem, 2vw, 1rem); /* 12px → 16px */
  list-style-type: disc;
  list-style-position: inside;
  line-height: 1.6;
  color: #374151; /* Tailwind's gray-700 */
  padding-left: 0; /* inside bullets don't need extra indent */
  margin-top: 0.5rem;
  margin-bottom: 1rem;
}

.competition-content li,
.notification-content li,
.club-card-content li {
  margin-bottom: 0.5rem;
}

.register-badge {
  position: absolute;
  top: 0.25rem;   /* top-1 */
  right: 0.25rem; /* right-1 */
  background-color: #dc2626; /* red-600 */
  color: #ffffff;
  padding: 0.25rem 0.75rem; /* py-1 px-3 */
  border-radius: 9999px; /* pill shape */
  font-size: clamp(0.75rem, 1.5vw, 0.875rem); 
  /* min 12px, grows with viewport, max ~14px */
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  white-space: nowrap;
}

/****************************************************************************************************/
/* Club Details
/****************************************************************************************************/
.club-photo {
  object-fit: cover;
  width: 100%;
  height: 100%;
}


/****************************************************************************************************/
/* downloads */
/****************************************************************************************************/
.download-card {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  padding: 1.5rem;
  background-color: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.download-card p {
  font-size: clamp(0.875rem, 2vw, 1rem); /* ~14px → 16px */
  text-align: center;
  line-height: 1.5;
  color: #374151;
  font-weight: 500;
}

.download-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.75rem; /* reduced padding */
  background-color: #2563eb; /* blue-600 */
  color: #ffffff;
  border-radius: 0.375rem;
  font-size: clamp(0.75rem, 1.5vw, 0.875rem); /* ~12px → 14px */
  text-decoration: none;
  transition: background-color 0.3s ease;
}

.download-btn:hover {
  background-color: #1d4ed8; /* blue-700 */
}

.download-btn:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(59,130,246,0.5); /* blue-500 ring */
}

.download-btn svg {
  width: 1rem;
  height: 1rem;
}

/****************************************************************************************************/
/* Scale font size at breakpoints */
/****************************************************************************************************/
.pt-safe {
    padding-top: env(safe-area-inset-top);
  }
.pb-safe {
    padding-bottom: env(safe-area-inset-bottom);
  }
.pl-safe {
    padding-left: env(safe-area-inset-left);
  }
.pr-safe {
    padding-right: env(safe-area-inset-right);
  } 

@media (min-width: 640px) { /* sm */
  .custom-table {
    font-size: 0.875rem;     /* text-sm */
    padding-left: 1rem;      /* px-4 */
    padding-right: 1rem;
  }
  .download-card {
    flex-direction: row;
  }
  .download-card p {
    text-align: left;
    margin-bottom: 0;
  }
}

@media (min-width: 768px) { /* md */
  .custom-table {
    font-size: 1rem;         /* text-base */
  }
  .club-card-page {
    flex-direction: row;
  }
  .club-card {
    font-size: 1rem; /* text-base */
  }
}

@media (max-width: 1023px) {
  .club-card {
    font-size: 1.125rem; /* text-lg */
  }

}

@media (prefers-reduced-motion: reduce) {
  /* Disable only motion-heavy animations/transitions */
  * {
    animation: none !important;
    transition-property: transform, opacity !important;
    transition-duration: 0ms !important;
    scroll-behavior: auto !important;
  }

  /* Specifically stop shortcut cards from moving/lifting */
  .shortcut-card {
    transform: none !important;
  }
  .menu-card {
    transition: none;
  }
}

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.7);
  }

  70% {
    box-shadow: 0 0 0 10px rgba(220, 38, 38, 0);
  }

  100% {
    box-shadow: 0 0 0 0 rgba(220, 38, 38, 0);
  }
}
