/* ==========================================================================
   PG FITNESS — COMPONENTS STYLESHEET
   Reusable UI Components
   ========================================================================== */

/* ==========================================================================
   01. LOADING / VISIBILITY HELPERS
   ========================================================================== */

/* Body scroll lock (applied via JS for mobile menu) */
body.menu-open {
  overflow: hidden;
}

/* JS-driven visibility: elements hidden until JS reveals them */
.js-reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

.js-reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered children reveal */
.js-reveal-children > * {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s var(--ease-out), transform 0.5s var(--ease-out);
}

.js-reveal-children.is-visible > *:nth-child(1) { transition-delay: 0ms; }
.js-reveal-children.is-visible > *:nth-child(2) { transition-delay: 80ms; }
.js-reveal-children.is-visible > *:nth-child(3) { transition-delay: 160ms; }
.js-reveal-children.is-visible > *:nth-child(4) { transition-delay: 240ms; }
.js-reveal-children.is-visible > *:nth-child(5) { transition-delay: 320ms; }
.js-reveal-children.is-visible > *:nth-child(6) { transition-delay: 400ms; }

.js-reveal-children.is-visible > * {
  opacity: 1;
  transform: none;
}

/* Fade in only (no translate) */
.js-fade {
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}

.js-fade.is-visible {
  opacity: 1;
}

/* ==========================================================================
   02. GALLERY GRID LAYOUTS
   ========================================================================== */

/* Desktop asymmetric layout for gym gallery */
.gallery-grid--asymmetric {
  display: grid;
  grid-template-columns: 1fr;
  grid-template-rows: auto;
  gap: var(--space-4);
}

.gallery-item--tall {
  /* Handled in responsive.css for larger screens */
}

.gallery-item--wide {
  /* Handled in responsive.css for larger screens */
}

/* Standard item heights */
.gallery-item {
  min-height: 240px;
}

/* ==========================================================================
   03. TEXT CLAMP / OVERFLOW UTILITIES
   ========================================================================== */

.text-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.text-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   04. VISUALLY HIDDEN (ACCESSIBLE)
   ========================================================================== */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* ==========================================================================
   05. RED LINE DECORATION
   ========================================================================== */

.red-line {
  display: block;
  width: 48px;
  height: 3px;
  background-color: var(--color-red);
  margin-bottom: var(--space-5);
}

.red-line--center {
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   06. SECTION HEADER LAYOUTS
   ========================================================================== */

.section-header {
  margin-bottom: var(--space-4);
}

.section-header--centered {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.section-header--centered .eyebrow::before {
  display: none; /* remove line decoration in centered state */
}

.section-header--centered .section-subheading {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

/* ==========================================================================
   07. GRID LAYOUTS
   ========================================================================== */

.grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-5);
}

/* ==========================================================================
   08. ICON STYLES
   ========================================================================== */

.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.icon--sm { width: 16px; height: 16px; }
.icon--md { width: 24px; height: 24px; }
.icon--lg { width: 32px; height: 32px; }
.icon--xl { width: 48px; height: 48px; }

/* ==========================================================================
   09. BADGE / TAG COMPONENTS
   ========================================================================== */

.badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.badge--red {
  background-color: rgba(229, 38, 32, 0.12);
  color: var(--color-red);
  border: 1px solid rgba(229, 38, 32, 0.2);
}

.badge--amber {
  background-color: rgba(255, 180, 58, 0.12);
  color: var(--color-amber);
  border: 1px solid rgba(255, 180, 58, 0.2);
}

.badge--green {
  background-color: rgba(77, 138, 53, 0.12);
  color: var(--color-turf);
  border: 1px solid rgba(77, 138, 53, 0.2);
}

.badge--gray {
  background-color: rgba(165, 167, 163, 0.1);
  color: var(--color-concrete);
  border: 1px solid rgba(165, 167, 163, 0.2);
}

/* ==========================================================================
   10. SEPARATOR
   ========================================================================== */

.sep {
  border: none;
  border-top: 1px solid rgba(36, 38, 37, 0.6);
  margin: 0;
}

.sep--light {
  border-top-color: rgba(8, 9, 9, 0.1);
}

/* ==========================================================================
   11. CONTENT PLACEHOLDER BLOCKS
   ========================================================================== */

/* Used for sections awaiting real content */
.content-placeholder {
  border: 2px dashed rgba(165, 167, 163, 0.2);
  border-radius: var(--radius-md);
  padding: var(--space-8);
  text-align: center;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 4px,
    rgba(165, 167, 163, 0.03) 4px,
    rgba(165, 167, 163, 0.03) 8px
  );
}

.content-placeholder--dark {
  border-color: rgba(165, 167, 163, 0.1);
}

/* ==========================================================================
   12. FLOATING ELEMENTS
   ========================================================================== */

/* Used for image badges, overlapping elements */
.float-badge {
  position: absolute;
  background-color: var(--color-red);
  color: var(--color-white);
  border-radius: var(--radius-sm);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-md);
}

/* ==========================================================================
   13. QUOTE / TESTIMONIAL MARKS
   ========================================================================== */

.quote-mark {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 4rem;
  line-height: 1;
  color: var(--color-red);
  opacity: 0.4;
  margin-bottom: -1.5rem;
  display: block;
}

/* ==========================================================================
   14. ANCHOR LINK STYLING
   ========================================================================== */

.link--red {
  color: var(--color-red);
  text-decoration: underline;
  transition: opacity var(--transition-fast);
}

.link--red:hover {
  opacity: 0.8;
}

/* ==========================================================================
   15. INTERACTIVE STATES
   ========================================================================== */

/* Focus ring for non-button interactive elements */
[role="button"]:focus-visible,
a:focus-visible {
  outline: 3px solid var(--color-red);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Touch feedback */
@media (hover: none) {
  .btn:active {
    opacity: 0.85;
  }
}
