/* ========================================
   COMPLETE FIX FOR FIXED NAVBAR SPACING
   Kelly Bootstrap Portfolio Template
   All Page Titles Fully Visible
   ======================================== */

/* ==========================================
   FIXED HEADER CONFIGURATION
   ========================================== */

/* Ensure Header is Fixed */
.header {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  right: 0 !important;
  width: 100% !important;
  z-index: 999999 !important;
  background: rgba(255, 255, 255, 0.95) !important;
  backdrop-filter: blur(20px) !important;
  -webkit-backdrop-filter: blur(20px) !important;
}

/* ==========================================
   BODY AND MAIN SPACING
   ========================================== */

/* Remove default padding from body and main */
body {
  padding-top: 0 !important;
  margin-top: 0 !important;
  overflow-x: hidden !important;
}

main {
  padding-top: 0 !important;
  margin-top: 0 !important;
  width: 100% !important;
}

/* ==========================================
   HOME PAGE (Hero Section)
   ========================================== */

/* Home Page Hero - No overlap */
.hero {
  margin-top: 0 !important;
  padding-top: 160px !important;
  min-height: 100vh !important;
  background-size: cover !important;
  background-position: center !important;
}

/* ==========================================
   ALL OTHER PAGES
   About, Services, Resume, Contact
   ========================================== */

/* First Section on Non-Home Pages */
body:not(.home-page) main > section:first-child,
body:not(.home-page) main > .section:first-child,
.about-section:first-child,
.services-section:first-child,
.contact-section:first-child,
.resume-section:first-child {
  padding-top: 140px !important;
  margin-top: 0 !important;
}

/* Page Title Sections - Extra Spacing */
.section-title:first-child,
main > section:first-child .section-title {
  padding-top: 2.5rem !important;
  margin-top: 0 !important;
  margin-bottom: 3rem !important;
}

/* ==========================================
   SECTION TITLES - FULLY VISIBLE
   ========================================== */

.section-title {
  position: relative !important;
  z-index: 1 !important;
  text-align: center !important;
  width: 100% !important;
  overflow: visible !important;
}

.section-title h2 {
  font-size: clamp(2rem, 5vw, 2.75rem) !important;
  margin: 0 0 1rem 0 !important;
  padding: 0 1rem !important;
  line-height: 1.3 !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  color: var(--text-primary) !important;
}

.section-title p {
  font-size: clamp(1rem, 2.5vw, 1.15rem) !important;
  margin: 0 auto !important;
  padding: 0 1rem !important;
  max-width: 700px !important;
  line-height: 1.7 !important;
  visibility: visible !important;
  opacity: 1 !important;
  display: block !important;
  color: var(--text-secondary) !important;
}

/* ==========================================
   CONTAINER PROPER SPACING
   ========================================== */

.container {
  width: 100% !important;
  max-width: 1200px !important;
  margin: 0 auto !important;
  padding: 0 2rem !important;
  box-sizing: border-box !important;
}

/* ==========================================
   TABLET RESPONSIVE (768px - 1024px)
   ========================================== */

@media (max-width: 1024px) {
  /* Hero Section */
  .hero {
    padding-top: 140px !important;
  }
  
  /* Other Pages */
  body:not(.home-page) main > section:first-child,
  body:not(.home-page) main > .section:first-child {
    padding-top: 120px !important;
  }
  
  /* Section Titles */
  .section-title:first-child,
  main > section:first-child .section-title {
    padding-top: 2rem !important;
    margin-bottom: 2.5rem !important;
  }
  
  .section-title h2 {
    font-size: clamp(1.85rem, 4.5vw, 2.5rem) !important;
  }
  
  .section-title p {
    font-size: clamp(0.95rem, 2.25vw, 1.1rem) !important;
  }
  
  /* Container */
  .container {
    padding: 0 1.75rem !important;
  }
}

/* ==========================================
   MOBILE RESPONSIVE (481px - 768px)
   ========================================== */

@media (max-width: 768px) {
  /* Hero Section */
  .hero {
    padding-top: 130px !important;
    min-height: 100vh !important;
  }
  
  /* Other Pages */
  body:not(.home-page) main > section:first-child,
  body:not(.home-page) main > .section:first-child,
  .about-section:first-child,
  .services-section:first-child,
  .contact-section:first-child,
  .resume-section:first-child {
    padding-top: 110px !important;
  }
  
  /* Section Titles */
  .section-title:first-child,
  main > section:first-child .section-title {
    padding-top: 1.75rem !important;
    margin-bottom: 2.25rem !important;
  }
  
  .section-title h2 {
    font-size: clamp(1.75rem, 6vw, 2.25rem) !important;
    padding: 0 0.75rem !important;
  }
  
  .section-title p {
    font-size: clamp(0.95rem, 3vw, 1.05rem) !important;
    padding: 0 0.75rem !important;
  }
  
  /* Container */
  .container {
    padding: 0 1.5rem !important;
  }
  
  /* Section Padding */
  .section {
    padding: 3.5rem 0 !important;
  }
}

/* ==========================================
   SMALL MOBILE (320px - 480px)
   ========================================== */

@media (max-width: 480px) {
  /* Hero Section */
  .hero {
    padding-top: 120px !important;
  }
  
  /* Other Pages */
  body:not(.home-page) main > section:first-child,
  body:not(.home-page) main > .section:first-child,
  .about-section:first-child,
  .services-section:first-child,
  .contact-section:first-child,
  .resume-section:first-child {
    padding-top: 100px !important;
  }
  
  /* Section Titles */
  .section-title:first-child,
  main > section:first-child .section-title {
    padding-top: 1.5rem !important;
    margin-bottom: 2rem !important;
  }
  
  .section-title h2 {
    font-size: clamp(1.5rem, 7vw, 2rem) !important;
    padding: 0 0.5rem !important;
    margin-bottom: 0.85rem !important;
  }
  
  .section-title p {
    font-size: clamp(0.9rem, 3.5vw, 1rem) !important;
    padding: 0 0.5rem !important;
    line-height: 1.6 !important;
  }
  
  /* Container */
  .container {
    padding: 0 1.25rem !important;
  }
  
  /* Section Padding */
  .section {
    padding: 3rem 0 !important;
  }
}

/* ==========================================
   EXTRA SMALL MOBILE (< 360px)
   ========================================== */

@media (max-width: 360px) {
  /* Hero Section */
  .hero {
    padding-top: 110px !important;
  }
  
  /* Other Pages */
  body:not(.home-page) main > section:first-child,
  body:not(.home-page) main > .section:first-child {
    padding-top: 95px !important;
  }
  
  /* Section Titles */
  .section-title h2 {
    font-size: clamp(1.4rem, 8vw, 1.85rem) !important;
  }
  
  .section-title p {
    font-size: clamp(0.875rem, 4vw, 0.95rem) !important;
  }
  
  /* Container */
  .container {
    padding: 0 1rem !important;
  }
}

/* ==========================================
   SPECIFIC PAGE FIXES
   ========================================== */

/* About Page */
.about-section {
  width: 100% !important;
  overflow: visible !important;
}

.about-content {
  width: 100% !important;
  padding: 2.5rem !important;
}

.about-content h2 {
  margin-top: 0 !important;
  font-size: clamp(1.75rem, 4vw, 2.25rem) !important;
}

/* Services Page */
.services-section {
  width: 100% !important;
}

/* Contact Page */
.contact-section {
  width: 100% !important;
}

.contact-form {
  width: 100% !important;
  max-width: 600px !important;
  margin: 0 auto !important;
}

/* Resume Page */
.resume-section {
  width: 100% !important;
}

.resume .resume-item {
  width: 100% !important;
}

/* ==========================================
   PREVENT CONTENT OVERLAP
   ========================================== */

/* Ensure No Elements Hide Behind Header */
section,
.section {
  position: relative !important;
  z-index: 1 !important;
}

/* All Headings Visible */
h1, h2, h3, h4, h5, h6 {
  visibility: visible !important;
  opacity: 1 !important;
  overflow: visible !important;
}

/* All Text Visible */
p, span, a, li {
  visibility: visible !important;
  opacity: 1 !important;
}

/* ==========================================
   BOX SIZING AND OVERFLOW FIX
   ========================================== */

* {
  box-sizing: border-box !important;
}

html {
  overflow-x: hidden !important;
  width: 100% !important;
  scroll-behavior: smooth !important;
}

body {
  overflow-x: hidden !important;
  width: 100% !important;
  max-width: 100vw !important;
}

/* ==========================================
   MAINTAIN ANIMATIONS AND TRANSITIONS
   ========================================== */

/* Keep Existing Animations */
.section-title h2::after {
  animation: none !important;
}

/* Smooth Transitions */
section {
  transition: padding 0.3s ease !important;
}

/* ==========================================
   PRINT STYLES
   ========================================== */

@media print {
  .header {
    position: static !important;
  }
  
  main > section:first-child,
  .hero {
    padding-top: 0 !important;
    margin-top: 0 !important;
  }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

/* Focus Styles */
a:focus, button:focus {
  outline: 2px solid var(--primary-color) !important;
  outline-offset: 2px !important;
}

/* Skip to Content Link */
.skip-to-content {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary-color);
  color: white;
  padding: 8px;
  text-decoration: none;
  z-index: 100000;
}

.skip-to-content:focus {
  top: 0;
}
