/* Base page styles - uses Bootstrap CSS variables */

/* Prevent horizontal overflow/scroll on all pages */
/* Note: overflow-x: hidden on html/body can break position:sticky - use clip instead */
html, body {
  max-width: 100vw;
  overflow-x: clip;
}

/* Sticky navbar z-index - must be below offcanvas (1045) and modal (1055) */
.sticky-navbar {
  z-index: 1030;
}

/* Site-wide shell background: follow the theme variable (respects light/dark modes) */
body {
  background-color: var(--bs-body-bg);
}

/* Utility: Hover elevation and subtle grow */
.hover-effect {
  transition: box-shadow 0.3s, transform 0.3s;
}
.hover-effect:hover {
  box-shadow: var(--bs-box-shadow);
  transform: scale(1.03);
}

/* CSS Scroll Snap Carousel - modern, no JS dependency */
.snap-carousel {
  scroll-behavior: smooth;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  overflow-x: auto !important; /* Override parent clip */
}
.snap-carousel::-webkit-scrollbar {
  display: none; /* Chrome/Safari */
}

/* Container for carousels needs visible overflow */
.snap-carousel-container {
  overflow: visible !important;
}

/* Utility: Hide element */
.hide {
  display: none !important;
}

/* Landing section links */
.landing-sections a {
  border-bottom: 1px solid;
  padding-bottom: 0.375rem;
  text-decoration: none;
  letter-spacing: 0.5px;
  color: inherit;
  margin: 0;
}

/* Revision content (wiki/article body) */
.revision-content p {
  font-size: 1.125rem;
  line-height: 1.8;
  margin-bottom: 1.5rem;
}

.revision-content h2,
.revision-content h3 {
  margin-top: 2rem;
  margin-bottom: 1rem;
}

/* Forum specific: button variant + hover lift + conversation card shadow */
.btn-outline-purple {
  --bs-btn-color: var(--bs-primary);
  --bs-btn-border-color: var(--bs-primary);
  --bs-btn-hover-color: var(--bs-body-emphasis-color);
  --bs-btn-hover-bg: var(--bs-primary);
  --bs-btn-hover-border-color: var(--bs-primary);
  --bs-btn-focus-shadow-rgb: var(--bs-primary-rgb);
  --bs-btn-active-color: var(--bs-body-emphasis-color);
  --bs-btn-active-bg: var(--bs-primary);
  --bs-btn-active-border-color: var(--bs-primary);
}

.hover-lift {
  transition: transform 0.2s ease-in-out;
}

.hover-lift:hover {
  transform: translateY(-2px);
}

.conversation-card:hover {
  box-shadow: var(--bs-box-shadow-lg) !important;
}

/* Standardized Button Styles for Hero Sections — legacy kept for feed-hero */

/* Standardized Card Hover Effects */
.conversation-card,
.event-card,
.feed-card,
.wiki-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.conversation-card:hover,
.event-card:hover,
.feed-card:hover,
.wiki-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bs-box-shadow-lg);
}

/* Standardized Hero Typography */
.feed-hero h1 {
  font-size: 3.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.1;
}

.feed-hero p {
  font-size: 1.375rem;
  line-height: 1.6;
}

/* Consistent hero spacing */
.hero-section,
.feed-hero {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

@media (max-width: 768px) {
  .hero-section,
  .feed-hero {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .feed-hero h1 {
    font-size: 2.25rem;
  }
  
  .feed-hero p {
    font-size: 1.125rem;
  }
}

/* Feed layout shared styles - uses Bootstrap variables */
.feed-topbar {
  background: var(--bs-body-bg);
  padding: 1rem 0;
  border-bottom: 1px solid var(--bs-border-color);
  position: sticky;
  top: 56px;
  z-index: 99;
}

.feed-card {
  background: var(--bs-body-bg);
  border-radius: var(--bs-border-radius-xl);
  box-shadow: var(--bs-box-shadow-sm);
  overflow: hidden;
  transition: all 0.2s ease-in-out;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.feed-card:hover {
  transform: translateY(-2px);
}

.feed-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: var(--bs-secondary-bg-subtle, #f3f4f6);
  display: block;
}

.feed-image-placeholder {
  width: 100%;
  height: 200px;
  background: var(--theme-bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--theme-text-muted);
}

.feed-meta {
  font-size: 0.85rem;
  color: var(--bs-secondary);
}

/* Navbar layout tweaks */
.site-navbar-wrap {
  z-index: 1030;
}

/* Mobile: reduce sticky stack height and fix overlap */
@media (max-width: 991.98px) {
  .sticky-navbar {
    position: relative; /* Don't stick on mobile - causes overlap issues */
  }
  
  /* Ensure offcanvas backdrop covers everything */
  .offcanvas-backdrop {
    z-index: 1040;
  }
  
  /* Ensure offcanvas is above backdrop */
  .offcanvas {
    z-index: 1045;
  }
}

/* Consistent section spacing */
.section-spacing {
  padding-top: var(--ds-space-section-y, 3rem);
  padding-bottom: var(--ds-space-section-y, 3rem);
}

.section-spacing-sm {
  padding-top: var(--ds-space-section-y-compact, 2rem);
  padding-bottom: var(--ds-space-section-y-compact, 2rem);
}

.section-spacing-lg {
  padding-top: var(--ds-space-section-y-expanded, 4rem);
  padding-bottom: var(--ds-space-section-y-expanded, 4rem);
}

/* Consistent heading styles - uses Bootstrap utilities */
.section-heading {
  font-size: 1.75rem;
  font-weight: 600;
  margin-bottom: 1.5rem;
  color: var(--bs-body-color);
}

.section-subheading {
  font-size: 1.125rem;
  color: var(--bs-secondary);
  margin-bottom: 2rem;
}

/* Consistent button styles */
.btn-hero {
  padding: 0.75rem 2rem;
  font-weight: 500;
  border-radius: 999px;
  transition: all 0.2s ease;
}

.btn-hero:hover {
  transform: translateY(-2px);
  box-shadow: var(--bs-box-shadow);
}

/* Consistent card hover effects */
.card-hover {
  transition: all 0.2s ease;
}

.card-hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--bs-box-shadow-lg);
}

/* Utility classes for common patterns */
.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  opacity: 0.2;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

.hero-content {
  position: relative;
  z-index: 2;
}

.overlap-up {
  margin-top: -90px;
}

.sticky-offset {
  top: 100px;
}

/* Image sizing utilities */
.img-square-sm {
  width: 60px;
  height: 60px;
  object-fit: cover;
}

/* Max width utilities */
.max-w-500 {
  max-width: 500px;
}

.max-w-480 {
  max-width: 480px;
}

/* Mobile responsive adjustments */
@media (max-width: 768px) {
  .section-spacing {
    padding-top: 3rem;
    padding-bottom: 3rem;
  }
  
  .section-spacing-lg {
    padding-top: 4rem;
    padding-bottom: 4rem;
  }
  
  .section-heading {
    font-size: 1.5rem;
  }
  
  .overlap-up {
    margin-top: -60px;
  }
}

/* Prevent iOS zoom on input focus - set font-size to 16px minimum */
@media (max-width: 767px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  textarea,
  select {
    font-size: 16px !important;
  }
}

/* ============================================
   AOS — Apple-inspired subtle translate override
   Default AOS uses 100px; we reduce to 24px for
   a gentle "rising into place" feel.
   ============================================ */
[data-aos="fade-up"]    { --aos-translate-y: 24px; transform: translate3d(0, var(--aos-translate-y), 0); }
[data-aos="fade-down"]  { --aos-translate-y: -24px; transform: translate3d(0, var(--aos-translate-y), 0); }
[data-aos="fade-left"]  { --aos-translate-x: 24px; transform: translate3d(var(--aos-translate-x), 0, 0); }
[data-aos="fade-right"] { --aos-translate-x: -24px; transform: translate3d(var(--aos-translate-x), 0, 0); }
[data-aos].aos-animate  { transform: translate3d(0, 0, 0); }
