/* ==========================================================================
   GOLF PAGE STYLES
   Implements DESIGN-PRINCIPLES-NEGATIVE-SPACE.md guidelines
   ========================================================================== */

:root {
  /* ======================================================================
     SPACING SYSTEM (8px base unit) - MANDATORY
     ====================================================================== */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-base: 16px;
  --space-lg: 20px;
  --space-xl: 24px;
  --space-2xl: 32px;
  --space-3xl: 40px;
  --space-4xl: 48px;
  --space-5xl: 56px;
  --space-6xl: 64px;

  /* ======================================================================
     FLUID TYPOGRAPHY SYSTEM
     Using clamp() for responsive font sizes without media queries
     ====================================================================== */
  /* Base text: 16px → 18px */
  --fs-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  
  /* Small text: 14px → 16px */
  --fs-small: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);
  
  /* H1: 28px → 48px */
  --fs-h1: clamp(1.75rem, 1.25rem + 2.5vw, 3rem);
  
  /* H3: 20px → 32px */
  --fs-h3: clamp(1.25rem, 1rem + 1.25vw, 2rem);
  
  /* Banner text: 16px → 36px */
  --fs-banner: clamp(1rem, 0.5rem + 2.5vw, 2.25rem);
  
  /* Button text: 14px → 16px */
  --fs-button: clamp(0.875rem, 0.825rem + 0.25vw, 1rem);
  
  /* Promo text: 16px → 20px */
  --fs-promo: clamp(1rem, 0.9rem + 0.5vw, 1.25rem);
  
  /* Price text: 18px → 28px */
  --fs-price: clamp(1.125rem, 0.875rem + 1.25vw, 1.75rem);

  /* ======================================================================
     TYPOGRAPHY SPACING
     ====================================================================== */
  --line-height-tight: 1.3;
  --line-height-normal: 1.6;
  --line-height-relaxed: 1.75;
  --letter-spacing-tight: -0.01em;
  --letter-spacing-normal: 0;
  --letter-spacing-wide: 0.02em;
  --letter-spacing-extra-wide: 0.05em;

  /* ======================================================================
     COLOR PALETTE
     ====================================================================== */
  --clr-bg: #fdfdfd;
  --clr-surface: #ffffff;
  --clr-text: #333333;
  --clr-heading: #1a1a1a;
  --clr-primary: #4a756d;
  --clr-accent: #e9b461;
  --clr-danger: #d9534f;
  --clr-border: #e8e8e8;

  --clr-pastel-red: #ff6961;
  --clr-pastel-1: #8ab0ab;
  --clr-pastel-2: #e9b461;
  --clr-pastel-3: #a1c1d6;
  --clr-text-light: #f0f0f0;
  --clr-banner-bg: #e8f5e9;

  /* ======================================================================
     FONTS
     ====================================================================== */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica,
    Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
  --font-serif: "Georgia", "Times New Roman", serif;

  /* ======================================================================
     SHADOWS & BORDERS
     ====================================================================== */
  --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px -2px rgba(0, 0, 0, 0.08),
    0 2px 6px -2px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 8px 24px -4px rgba(0, 0, 0, 0.1),
    0 4px 8px -4px rgba(0, 0, 0, 0.06);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;

  /* ======================================================================
     COMPONENT SPACING (Mobile First)
     ====================================================================== */
  --container-padding: var(--space-base);
  --section-gap: var(--space-xl);
  --card-padding: var(--space-base);
  --card-gap: var(--space-base);
}

/* Desktop spacing overrides */
@media (min-width: 992px) {
  :root {
    --container-padding: var(--space-xl);
    --section-gap: var(--space-4xl);
    --card-padding: var(--space-xl);
    --card-gap: var(--space-xl);
  }
}

/* ==========================================================================
   BASE STYLES
   ========================================================================== */
body {
  text-rendering: optimizeSpeed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-size: var(--fs-base);
  line-height: var(--line-height-normal);
}

/* ==========================================================================
   PAGE CONTENT CONTAINER
   Proper padding and max-width with breathing room
   ========================================================================== */
.page-content {
  max-width: 1024px;
  margin-inline: auto;
  /* Mobile: 16px horizontal padding, Desktop: 24px+ */
  padding-inline: var(--container-padding);
  /* Mobile: 24px top, 40px bottom / Desktop: 48px top, 64px bottom */
  padding-block-start: var(--section-gap);
  padding-block-end: var(--space-4xl);
}

@media (min-width: 992px) {
  .page-content {
    padding-block-start: var(--space-4xl);
    padding-block-end: var(--space-6xl);
  }
}

/* ==========================================================================
   GOLF LAYOUT CARDS
   Card component with proper internal spacing
   ========================================================================== */
.golf-layout {
  display: flex;
  align-items: stretch;
  /* Section separation: 24px mobile, 40px desktop */
  margin-block-end: var(--section-gap);
  gap: 0;
  background-color: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.golf-layout--reverse {
  flex-direction: row-reverse;
}

.golf-layout__image-container {
  flex: 0 0 55%;
}

.golf-layout__image-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Text container with proper breathing room */
.golf-layout__text-container {
  flex: 1;
  /* Card padding: 16px mobile, 24px desktop with extra horizontal on desktop */
  padding: var(--card-padding);
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 992px) {
  .golf-layout__text-container {
    padding: var(--space-2xl) var(--space-3xl);
  }
}

/* ==========================================================================
   TYPOGRAPHY WITHIN CARDS
   ========================================================================== */
.golf-layout__text-container h3 {
  font-family: var(--font-serif);
  /* Fluid: 20px → 32px */
  font-size: var(--fs-h3);
  line-height: var(--line-height-tight);
  letter-spacing: var(--letter-spacing-wide);
  color: var(--clr-primary);
  /* Heading margin: 16px bottom mobile, 20px desktop */
  margin: 0 0 var(--space-base) 0;
  font-weight: 600;
}

@media (min-width: 992px) {
  .golf-layout__text-container h3 {
    margin-bottom: var(--space-lg);
  }
}

.golf-layout__text-container ul {
  list-style-position: outside;
  /* List indent: 20px mobile, 24px desktop */
  padding-left: var(--space-lg);
  /* List bottom margin: 16px mobile, 20px desktop */
  margin-bottom: var(--space-base);
  margin-top: 0;
}

@media (min-width: 992px) {
  .golf-layout__text-container ul {
    padding-left: var(--space-xl);
    margin-bottom: var(--space-lg);
  }
}

.golf-layout__text-container li {
  /* Fluid typography for list items */
  font-size: var(--fs-base);
  line-height: var(--line-height-relaxed);
  /* Item spacing: 8px mobile, 12px desktop */
  margin-bottom: var(--space-sm);
  padding-left: var(--space-xs);
  color: var(--clr-text);
}

@media (min-width: 992px) {
  .golf-layout__text-container li {
    margin-bottom: var(--space-md);
  }
}

.golf-layout__text-container li:last-child {
  margin-bottom: 0;
}

.golf-layout__text-container p {
  font-size: var(--fs-base);
  line-height: var(--line-height-normal);
  /* Paragraph margin: 12px mobile, 16px desktop */
  margin-bottom: var(--space-md);
  margin-top: 0;
}

@media (min-width: 992px) {
  .golf-layout__text-container p {
    margin-bottom: var(--space-base);
  }
}

.golf-layout__text-container a {
  color: var(--clr-accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s ease-in-out;
}

.golf-layout__text-container a:hover {
  opacity: 0.8;
  text-decoration: underline;
}

/* ==========================================================================
   TEXT UTILITIES
   ========================================================================== */
.text-danger {
  color: var(--clr-danger);
  font-weight: 700;
  font-style: italic;
  font-size: var(--fs-base);
  /* Extra top margin for emphasis separation */
  margin-top: var(--space-base);
}

.text-pastel-red {
  color: var(--clr-pastel-red) !important;
}

/* ==========================================================================
   PRIORITIES BANNER
   Hero-like section with generous spacing
   ========================================================================== */
.priorities-banner {
  text-align: left;
  /* Generous padding: hero-level spacing */
  padding: var(--space-2xl) var(--space-lg);
  /* Major section separation */
  margin-block: var(--section-gap);
  background: var(--clr-banner-bg);
  color: var(--clr-text);
  border-radius: var(--radius-md);
  font-weight: 900;
  line-height: var(--line-height-tight);
  text-transform: uppercase;
  letter-spacing: var(--letter-spacing-extra-wide);
  overflow: hidden;
  text-shadow: none;
}

@media (min-width: 992px) {
  .priorities-banner {
    padding: var(--space-4xl) var(--space-3xl);
    margin-block: var(--space-4xl);
  }
}

.priorities-banner div:not(:last-child) {
  margin-bottom: var(--space-md);
}

@media (min-width: 992px) {
  .priorities-banner div:not(:last-child) {
    margin-bottom: var(--space-base);
  }
}

/* Priority Line Animation & Styling */
.priority-line {
  /* Fluid banner text */
  font-size: var(--fs-banner);
  white-space: nowrap;
  opacity: 0;
  transform: translateY(20px);
  animation: fadeIn-up-sequence 12s ease-in-out infinite;
}

/* Animation Delays for Sequential Appearance */
.priority-line:nth-child(1) { animation-delay: 0s; }
.priority-line:nth-child(2) { animation-delay: 1s; }
.priority-line:nth-child(3) { animation-delay: 2s; }
.priority-line:nth-child(4) { animation-delay: 3s; }

/* Staggered indentation - Desktop only */
@media (min-width: 768px) {
  .priority-line:nth-child(1) { margin-left: 5%; }
  .priority-line:nth-child(2) { margin-left: 12%; }
  .priority-line:nth-child(3) { margin-left: 19%; }
  .priority-line:nth-child(4) { margin-left: 26%; }
}

/* Text Colors - High contrast for accessibility */
.priority-line:nth-child(1) { color: #b77a30; }
.priority-line:nth-child(2) { color: #4a7089; }
.priority-line:nth-child(3) { color: #3d7a3b; }
.priority-line:nth-child(4) { color: #8c4f87; }

.priority-line .highlight {
  color: #c92a2a;
  font-weight: 900;
}

@keyframes fadeIn-up-sequence {
  0% {
    opacity: 0;
    transform: translateY(20px);
  }
  8.33% {
    opacity: 1;
    transform: translateY(0);
  }
  75% {
    opacity: 1;
    transform: translateY(0);
  }
  83.33% {
    opacity: 0;
    transform: translateY(-20px);
  }
  100% {
    opacity: 0;
    transform: translateY(20px);
  }
}

/* ==========================================================================
   PRICE HEADER
   Prominent pricing with proper emphasis spacing
   ========================================================================== */
h3.text-pastel-red {
  text-align: center;
  /* Fluid price text */
  font-size: var(--fs-price) !important;
  font-weight: 700;
  /* Generous vertical margins for emphasis */
  margin-block: var(--space-3xl) !important;
  letter-spacing: var(--letter-spacing-wide);
  line-height: var(--line-height-tight);
}

@media (min-width: 992px) {
  h3.text-pastel-red {
    margin-block: var(--space-4xl) !important;
  }
}

/* ==========================================================================
   CTA LINKS
   ========================================================================== */
.golf-layout__cta-links {
  margin-top: var(--space-lg);
  display: flex;
  gap: var(--space-md);
  flex-wrap: wrap;
}

@media (min-width: 992px) {
  .golf-layout__cta-links {
    margin-top: var(--space-xl);
    gap: var(--space-base);
  }
}

.cta-link {
  display: inline-block;
  background-color: var(--clr-accent);
  color: var(--clr-heading) !important;
  /* Button padding: 12px 24px mobile, 14px 28px desktop */
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  text-align: center;
  font-weight: bold !important;
  font-size: var(--fs-button);
  text-decoration: none !important;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.cta-link:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  opacity: 1 !important;
}

/* ==========================================================================
   CUSTOM PACKAGE PROMO TEXT
   ========================================================================== */
.custom-package-promo {
  font-weight: 600;
  /* Fluid promo text */
  font-size: var(--fs-promo);
  line-height: var(--line-height-relaxed);
  text-align: center;
  /* Paragraph spacing */
  margin-bottom: var(--space-base);
  color: var(--clr-text);
}

@media (min-width: 992px) {
  .custom-package-promo {
    margin-bottom: var(--space-lg);
  }
}

.custom-package-promo a {
  color: var(--clr-primary);
  text-decoration: underline;
  font-weight: 700;
  transition: color 0.2s ease;
}

.custom-package-promo a:hover {
  color: var(--clr-accent);
}

/* ==========================================================================
   BUTTONS
   Touch-friendly with adequate spacing
   ========================================================================== */
.btn {
  display: inline-block;
  /* Button padding: 12px 24px mobile, 14px 32px desktop */
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius-md);
  text-decoration: none;
  font-weight: 700;
  font-size: var(--fs-button);
  letter-spacing: var(--letter-spacing-wide);
  text-align: center;
  color: var(--clr-text-light);
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  border: none;
  cursor: pointer;
  /* Minimum touch target */
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 992px) {
  .btn {
    padding: var(--space-md) var(--space-2xl);
  }
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  opacity: 0.95;
}

.btn:focus {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* Button variants */
.btn--pastel-1 { background-color: var(--clr-pastel-1); }
.btn--pastel-2 { background-color: var(--clr-pastel-2); }
.btn--pastel-3 { background-color: var(--clr-pastel-3); }

/* ==========================================================================
   BUTTON GROUP
   Proper spacing between buttons
   ========================================================================== */
.button-group {
  display: flex;
  justify-content: center;
  /* Button gap: 12px mobile, 16px desktop */
  gap: var(--space-md);
  flex-wrap: wrap;
  /* Top margin for separation from content */
  margin-top: var(--space-2xl);
  /* Extra bottom padding */
  padding-bottom: var(--space-lg);
}

@media (min-width: 992px) {
  .button-group {
    gap: var(--space-base);
    margin-top: var(--space-3xl);
    padding-bottom: var(--space-xl);
  }
}

.button-group .btn {
  margin: 0;
}

/* ==========================================================================
   ARTICLE SPACING
   Clear separation between content sections
   ========================================================================== */
article {
  /* Section gap between articles */
  margin-bottom: var(--section-gap);
}

article:last-child {
  margin-bottom: 0;
}

/* Final article with CTA needs extra top spacing */
article:last-child > div {
  padding-top: var(--space-lg);
}

@media (min-width: 992px) {
  article:last-child > div {
    padding-top: var(--space-xl);
  }
}

/* ==========================================================================
   MOBILE OPTIMIZATIONS
   Mobile-first responsive adjustments
   ========================================================================== */
@media (max-width: 768px) {
  .golf-layout,
  .golf-layout--reverse {
    flex-direction: column;
    position: relative;
  }

  .golf-layout__image-container {
    flex-basis: auto;
    width: 100%;
    height: auto;
    position: relative;
    z-index: 1;
  }

  .golf-layout__image-container img {
    height: auto;
    width: 100%;
    object-fit: contain;
    position: relative;
    display: block;
  }

  .golf-layout__text-container {
    /* Mobile card padding with proper breathing room */
    padding: var(--space-lg);
    position: relative;
    z-index: 2;
    background-color: var(--clr-surface);
  }

  /* Mobile adjustments for the banner */
  .priorities-banner {
    text-align: center;
    padding-inline: var(--space-base);
    padding-block: var(--space-xl);
  }

  .priority-line {
    margin-left: 0 !important;
    /* Prevent text overflow on small screens */
    white-space: normal;
    word-wrap: break-word;
  }

  /* Reduced section gaps on mobile but still adequate */
  .page-content {
    padding-block-start: var(--space-lg);
  }

  /* Button group stacks nicely on mobile */
  .button-group {
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
  }

  .button-group .btn {
    width: 100%;
    max-width: 280px;
  }
}

/* ==========================================================================
   TABLET OPTIMIZATIONS
   ========================================================================== */
@media (min-width: 769px) and (max-width: 991px) {
  .golf-layout__image-container {
    flex: 0 0 50%;
  }

  .golf-layout__text-container {
    padding: var(--space-xl);
  }

  .priorities-banner {
    padding: var(--space-2xl) var(--space-xl);
  }
}

/* ==========================================================================
   ACCESSIBILITY
   Focus states and touch targets
   ========================================================================== */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--clr-primary);
  outline-offset: 2px;
}

/* Ensure adequate spacing for users who need it */
@media (prefers-reduced-motion: reduce) {
  .priority-line {
    animation: none;
    opacity: 1;
    transform: none;
  }
}

/* ─── Typography Measure ─── */
/* .custom-package-promo is centered (text-align:center) — exempt.
   .golf-layout__text-container is a constrained flex column so
   paragraphs and list items get a measure cap to prevent over-wide lines
   on wide viewports where the container can stretch past 70ch. */
.golf-layout__text-container p {
  max-width: 68ch;
  line-height: 1.9;
  font-size: clamp(0.9375rem, 1.5vw, 1.0625rem);
}

.golf-layout__text-container li {
  max-width: 72ch;
  line-height: 1.85;
}
