/* ============================= */
/* GLOBAL STYLES                 */
/* ============================= */
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-decoration: none !important;
  -ms-overflow-style: none;  /* Hide scrollbar IE and Edge */
  scrollbar-width: none;     /* Hide scrollbar Firefox */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html {
  font-size: 16px; /* base font size */
}

body {
  font-size: 1rem;
  line-height: 1.6;
  background-color: #e0f5f7;
}

@media (pointer: coarse) and (max-width: 992px) {
  html, body {
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
  }
}



img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  html {
    font-size: 14px; /* Slightly smaller base on mobile */
  }
 
  /* Adjust text in sections for improved readability */
  .contact-container p,
  .hero-content p,
  .gallery-item .text-content p {
    font-size: 0.95rem;
  }
}

/* Hide the hamburger by default on large screens */
.hamburger {
  display: none;
}

/* ============================= */
/* NAVBAR                        */
/* ============================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  padding: 8px 20px;
  z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s;
}

.navbar.overlay {
  background: transparent;
  box-shadow: none;
}

.navbar.solid {
  background: rgba(30, 30, 30, 0.9);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.navbar nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  white-space: nowrap;
  gap: 20px;
}

.navbar.overlay .nav-links li a,
.navbar.solid .nav-links li a {
  color: #fff !important;
}

.nav-links li a {
  display: inline-block;
  text-decoration: none;
  font-size: 1em;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-links li a:hover {
  text-shadow: 0 0 2px rgba(255,255,255,0.8);
  color: inherit;
}

/* ============================= */
/* HERO SECTION                  */
/* ============================= */

/* —————————————————————————— */
/* HERO SECTION BACKGROUND IMG */
/* —————————————————————————— */

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: block;
  pointer-events: none;
}

.hero-bg-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* default focal point */
  object-position: 50% 50%;
  display: block;
  transform: scale(1.0);
  transform-origin: 50% 50%;
}

/* breakpoint-specific zoom & focal-point tweaks */
@media (min-width: 993px) {
  .hero-bg-img {
    object-position: 50% 50%;
    transform: scale(1.0);
    transform-origin: 50% 50%;
  }
}

@media (min-width: 601px) and (max-width: 992px) {
  .hero-bg-img {
    object-position: 40% 60%;
    transform: scale(1.0);
    transform-origin: 40% 60%;
  }
}

@media (max-width: 600px) {
  .hero-bg-img {
    object-position: 30% 70%;
    transform: scale(1.0);
    transform-origin: 30% 70%;
  }
}

.hero-section {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  margin: 0;
  padding: 0;
  padding-bottom: 100px;
  overflow-x: hidden;
  min-height: 100vh;
  position: relative;
}

.hero-section::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 0;
}

.hero-section::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 200px;
  background: linear-gradient(
    to bottom,
    rgba(0, 0, 0, 0)       0%,
    rgba(224, 245, 247, 0.1) 10%,
    rgba(224, 245, 247, 0.2) 20%,
    rgba(224, 245, 247, 0.3) 30%,
    rgba(224, 245, 247, 0.4) 40%,
    rgba(224, 245, 247, 0.5) 50%,
    rgba(224, 245, 247, 0.6) 60%,
    rgba(224, 245, 247, 0.7) 70%,
    rgba(224, 245, 247, 0.8) 80%,
    #e0f5f7               100%
  );
  z-index: 1;
  pointer-events: none;
  filter: blur(600px);
}

@media (min-width: 992px) {
  .hero-section {
    flex-wrap: nowrap;
  }
}

.hero-content {
  flex-basis: 100%;
  background-color: transparent;
  padding: 3rem 3rem 12rem 5rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative; /* ensures content is above the mask */
  z-index: 1;         
}

@media (min-width: 992px) {
  .hero-content {
    flex-basis: 40%;
    max-width: 40%;
  }
}

/* Hide the separate hero image container */
.hero-image {
  display: none;
}

.hero-title {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: #fff;
}

.hero-content h2 {
  font-size: 1.75rem;
  margin-bottom: 1rem;
  color: #fff;
}

.hero-subtitle {
  font-size: 1.125rem;
  line-height: 1.5;
  margin-bottom: 1.5rem;
  color: #fff;
}

.hero-buttons-container {
  width: 100%;
  text-align: center;
  margin-top: 1rem;
}

.hero-buttons {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 10px;
}

.hero-btn {
  display: inline-block;
  margin: 0 5px;
  padding: 10px 20px;
  background: #1f8fa3;
  color: #fff;
  border-radius: 5px;
  font-size: 1rem;
  text-decoration: none;
  transition: background 0.3s;
}
.hero-btn:hover,
.hero-btn:active {
  background: #147489;
}

/* ============================= */
/*       TIMELINE SECTION        */
/* ============================= */
.timeline-section {
  background-color: #e0f5f7;
  padding: 2rem 0 0; /* added top padding */
  margin-top: 0 !important;
  position: relative;
}

.timeline-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* ========== TIMELINE CARDS ========== */
.timeline-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 2rem;
  z-index: 1;
  transition: height 0.5s ease;
}

.timeline-card {
  position: relative;
  background-color: #e0f5f7;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: opacity 1s ease, transform 1s ease;
}

.timeline-card.card-reveal {
  opacity: 1;
  transform: scaleY(1);
}

/* ========== COMPANY HEADER (LOGO + BADGE + BAR) ========== */
.company-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: .25rem;
  gap: .5rem;
  padding-bottom: 0;
}

.company-logo {
  max-width: 150px;
  height: 75px;
  display: block;
  object-fit: contain;
}

.duration-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #444;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 4px 12px;
  border-radius: 999px;
  text-align: center;
}

.timeline-card .company,
.timeline-card .card-divider,
.timeline-card .achievements,
.timeline-card .titles {
  transition: opacity 0.5s ease;
  opacity: 1;
  visibility: visible;
}

/* Timeline Spacing Adjustments */
.company-bar { 
  width: 25%; 
  height: 4px; 
  background-color: #1f8fa3; 
  border-radius: 4px; 
  margin: 1rem auto;
}

.card-divider { 
  width: 25%; 
  height: 4px; 
  background-color: #1f8fa3; 
  border-radius: 4px; 
  margin: 1rem auto;
}

/* ========== ACHIEVEMENTS AND TITLES ========== */
.achievements p {
  margin: 0.5rem 0;
}

.titles p {
  font-weight: bold;
  color: #000;
  margin: 0.25rem 0;
}

.titles p + p {
  margin-top: 0.75rem;
}

.ach-group + .ach-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.2);
}

.promega-card .ach-group + .ach-group {
  border-top: none !important;
  padding-top: 0;
  margin-top: 0;
}

.group-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  gap: 0.5rem;
  margin-top: 0;     /* this pushes the icon down from the bar */
  margin-bottom: 0; /* spacing between icon and first line of text */
}

.group-icon {
  object-fit: contain;
}

.handshake-icon {
  width: 75px;
  height: 75px;
}

.done-icon {
  width: 65px;
  height: 65px;
  position: relative;
  top: -10px;
}

/* ========== HOVER EFFECTS (DESKTOP) ========== */
@media (hover: hover) and (pointer: fine) {
  .timeline-card.card-reveal:hover {
    transform: scale(1.015);
    box-shadow: 0 0 12px rgba(31, 143, 163, 0.25);
    border-color: #1f8fa3;
    transition: all 0.3s ease;
  }
}

/* ============================= */
/* CERTIFICATIONS SECTION (GRID) */
/* ============================= */

#certifications {
  padding: 30px 30px;
  background: #e0f5f7;
}

.cert-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
  gap: 2rem 1.5rem;
  justify-content: center;
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.credential {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.credential a {
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

.credential a:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(31, 143, 163, 0.4));
}

.hover-label {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  background: rgba(30, 30, 30, 0.9);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.credential a:hover .hover-label {
  opacity: 1;
}

/* Hover label height for UW crests */
.hover-label.svg-label {
  bottom: 105px;
}

.cert-img,
.w-logo {
  max-width: 180px;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

.w-logo {
  margin-top: -16px;
}

/*-----------------------------------------*/
/*----Manipulate distance between logos----*/
/*---Elimnate ASAP by fixing source icons--*/
/*-----------------------------------------*/
/* Reduce spacing only between cert logos on desktop */
@media (min-width: 993px) {
  .credential.wisconsin {
    margin-left: -5px;
    margin-right: -30px; /* more space between both WI and rightmost SHRM them */
  }

  .cert-grid-inner .credential:nth-of-type(4) {
    margin-left: 10px; /* more space between the 2 WI logos */
  }

  #certifications .credential:nth-of-type(2) {
    margin-left: 25px;
  }
}

/* Small phones and narrow devices: tighter 2x2 */
@media (max-width: 600px) {
  .cert-grid-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
    justify-items: center;
    padding: 0 1.25rem;
  }
}

/* Mid-range: tablets and large phones in landscape */
@media (min-width: 601px) and (max-width: 899px) {
  .cert-grid-inner {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 2rem 2rem;
    justify-content: center;
    padding: 0 12rem;
  }
}

.credential p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  text-align: center;
  font-weight: normal;
}

/*==========Top/bottom dividers================*/

.section-divider {
  width: 100%;
  background-color: #e0f5f7;
  text-align: center;
  padding: 4px 0 20px;
  box-sizing: border-box;
}

.section-divider::after {
  content: "";
  display: inline-block;
  width: 80%;
  max-width: 1200px;
  height: 4px;
  background-color: #1f8fa3;
  border-radius: 4px;
}

/* ========== TOUCH DEVICES (DISABLE HOVER) ========== */
@media (hover: none) and (pointer: coarse) {
  .timeline-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
  .gallery-nav {
    display: none !important;
  }
}

/* ============================= */
/*       GALLERY SECTION         */
/* ============================= */
#gallery-wrapper {
  position: relative;
  z-index: 1;
}

.pinned-container {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.gallery-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: transparent;
  z-index: 5;
  padding: 10px 0;
}

.gallery-nav ul {
  display: flex;
  justify-content: space-evenly;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gallery-nav ul li a {
  display: inline-block;
  transition: transform 0.3s ease;
  text-decoration: none;
  font-size: 1em;
  color: #fff;
  padding: 4px 0;
}

.gallery-nav ul li a:hover {
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.gallery-progress {
  width: 0%;
  height: 4px;
  background: #fff;
  margin-top: 10px;
  transition: width 0.2s ease;
}

.horizontal-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease-out;
}

.gallery-item {
  flex: 0 0 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
}

/* Default text content styles */
.gallery-item .text-content {
  position: absolute;
  z-index: 2;
  color: #fff;
  padding: 2rem;
  max-width: 80%;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 7px;
}

.gallery-item .text-content h3,
.gallery-item .text-content p {
  margin: 0;
  padding: 0;
}

.gallery-item .text-content h3 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.gallery-item .text-content p {
  font-size: 1.2rem;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* ---------- Desktop-only pane positioning ---------- */
@media (min-width: 993px) {
  .gallery-item.pane-1 .text-content {
    top: 8%;
    right: 10%;
    left: auto;
    transform: none;
    text-align: left;
    max-width: 600px;
  }

  .gallery-item.pane-2 .text-content {
    bottom: 19%;
    left: 31.25%;
    transform: none;
    text-align: left;
    max-width: 600px;
  }

  .gallery-item.pane-3 .text-content {
    top: 20%;
    left: 45%;
    transform: none;
    text-align: left;
    max-width: 600px;
  }

  .gallery-item.pane-4 .text-content {
    bottom: 15%;
    left: 10%;
    transform: none;
    text-align: left;
  }

  .gallery-item.pane-5 .text-content {
    bottom: 15%;
    left: 7%;
    transform: none;
    text-align: left;
    max-width: 400px;
  }
}

/* ---------- Mobile & Touch Layout Overrides ---------- */
@media (max-width: 992px) {
  /* Mobile Hero Section for screens up to 992px */
  .hero-section {
    padding-bottom: 200px;
  }

  .pinned-container,
  .horizontal-container {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  .gallery-track {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100% !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    overscroll-behavior-x: contain;
    transform: none !important;
    scroll-snap-type: x mandatory; /* Enables snapping */
    scroll-padding-left: 0;        /* Aligns first item cleanly */
  }

  .gallery-progress {
    display: none !important;
  }

  .gallery-item .text-content {
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: left;
    padding: 1.5rem;
    width: 80%;         /* Replaces max-width */
    max-width: 600px;   /* Optional: cap on very large screens */
  }

  /* Prevent nav link teal color on mobile */
  .gallery-nav ul li a:active,
  .gallery-nav ul li a:focus {
    color: #fff !important;  /* Maintain default white color */
    text-shadow: none;
  }

  /* Fix navlink clipping issue */
  .gallery-nav ul li a {
    padding: 10px 15px;
    font-size: 1.1rem;
  }

  /* Add offset to smooth scrolling for nav links */
  .gallery-nav ul li a {
    scroll-padding-top: 50px;  /* Adjusted for offset */
  }

  /* Add extra space below gallery pane to accommodate wrapped nav links */
  .gallery-item {
    padding-bottom: 0;
    scroll-snap-align: start;
  }

  /* Ensure #gallery-wrapper doesn't collapse tightly */
  #gallery-wrapper {
    padding-bottom: 0 !important;
  }
}

/* ============================= */
/*     Contact Me Section        */
/* ============================= */
#contact-me {
  padding: 40px 20px;
  background: #eeee;
}

.contact-container {
  max-width: 800px; 
  margin: 0 auto;
  text-align: center; 
}

.contact-container h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #333;
}

.contact-container p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #555;
  margin: 0 auto 40px auto;
  text-align: left;  
  max-width: 575px;
}

/* Labels and button are not forced full-width */
.contact-container form label,
.contact-container form button {
  display: block;
  margin-bottom: 15px;
}

/* Stack label above field, left aligned, and bold */
.form-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 20px;
}

.form-row label {
  margin-bottom: 5px !important;  /* Removes extra space below the label */
  text-align: left;
  font-weight: bold;
  line-height: 1 !important;    /* Adjust as needed to ensure minimal extra spacing */
}

/* Make the textarea taller */
.form-row textarea {
  height: 120px; 
  resize: none;  
}

/* ============================= */
/* UTILITY / MISC                */
/* ============================= */

a,
a:visited,
a:hover,
a:focus,
a:active {
  text-decoration: none !important;
}

.group-icon {
  display: inline-block;
  object-fit: contain;
}

.handshake-icon {
  position: relative;
  width: 75px;
  height: 75px;
  margin-bottom: 0 !important;
}

.done-icon {
  position: relative;
  top: -3px;
  width: 65px;
  height: 65px;
}

/* ============================= */
/* RESPONSIVE REFINEMENTS        */
/* ============================= */

@media (max-width: 768px) {
  .timeline-card {
    margin-bottom: 2rem;
    padding: 1rem;
  }

  .titles p {
    font-size: 0.95rem;
  }

  .achievements p {
    font-size: 0.9rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .timeline-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
}

/* Just like 'card-reveal', but no animation. */
.temporary-measure {
  opacity: 1 !important;
  transform: scaleY(1) !important;
  transition: none !important;
}

@media (max-width: 600px) {
  .contact-container form {
    width: 90%;
    padding: 0 5%;
  }
  .form-row input,
  .form-row textarea {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  /* Increase clickable area for nav links */
  .nav-links li a {
    padding: 10px 15px;
    font-size: 1.1rem;
  }

  /* Increase button touch area */
  .hero-btn {
    padding: 12px 20px;  /* adjust if needed */
    font-size: 1.1rem;
  }

  /* Increase gallery navigation links */
  .gallery-nav ul li a {
    padding: 10px 15px;
    font-size: 1.1rem;
  }


  /* Prevent nav link teal color on mobile */
@media (max-width: 992px) {
  .gallery-nav ul li a:active,
  .gallery-nav ul li a:focus {
    color: #fff !important; /* Ensure no color change on click */
    text-shadow: none;
  }
 }
}

@media (hover: none) and (pointer: coarse) {
  .nav-links li a:hover,
  .hero-btn:hover,
  .gallery-nav ul li a:hover {
    transform: none;
    box-shadow: none;
  }

    /* Add offset to smooth scrolling for nav links */
    .gallery-nav ul li a {
      scroll-padding-top: 50px;  /* Adjusted for offset */
    }
}


/* For screens between 420px and 992px, display the hero buttons side by side */
@media (min-width: 421px) and (max-width: 992px) {
  .hero-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
  }
}

  /* Force timeline cards to appear statically */
@media (max-width: 992px) {
  .timeline-card {
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Make sure the container shows all cards and stacks them */
  .timeline-cards {
    height: auto !important;
    grid-template-columns: 1fr;  /* Stack cards vertically */
  }
}
/* ========== MOBILE ADJUSTMENTS ========== */
@media (max-width: 768px) {
  .timeline-cards {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    margin-bottom: 2rem;
    padding: 1rem;
  }

  .titles p {
    font-size: 0.95rem;
  }

  .achievements p {
    font-size: 0.9rem;
  }
}

/* ========== MOBILE NAVIGATION ========== */
@media (max-width: 992px) {
  .hamburger {
    display: block;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    margin-left: auto;
    padding: 8px 12px;
    z-index: 1100;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent; /* Prevent teal tap */
  }
  
  .hamburger:focus,
  .hamburger:active,
  .hamburger:focus-visible,
  .hamburger::-moz-focus-inner {
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .nav-links {
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.95);
    position: absolute;
    top: 60px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: 6px;
    z-index: 1000;
    
    /* Hide navbar by default */
    opacity: 0;
    transform: scaleY(0.95);
    transform-origin: top;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .nav-links.show {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
  }
}

  body.menu-open,
  html.menu-open {
    overflow: hidden;
    height: 100%;
    touch-action: none;
  }

  .backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }
  
  .backdrop.visible {
    display: block;
  }  

/* Prevent teal color on active, focus, and hover states for mobile touch */
@media (hover: none) and (pointer: coarse) {
  /* Navbar links on mobile */
  .nav-links li a:active,
  .nav-links li a:focus,
  .nav-links li a:hover {
    color: #fff !important; /* Ensure color stays white */
    text-shadow: none !important;
    transform: scale(1.1) !important; /* Stronger scale effect */
  }

  /* Gallery nav links on mobile */
  #gallery-wrapper .gallery-nav ul li a:active,
  #gallery-wrapper .gallery-nav ul li a:focus,
  #gallery-wrapper .gallery-nav ul li a:hover {
    color: #fff !important; /* Ensure color stays white */
    text-shadow: none !important;
    transform: scale(1.1) !important; /* Stronger scale effect */
  }
}


/* ============================= */
/* MOBILE GALLERY SPECIFIC STYLES */
/* ============================= */
@media (max-width: 992px) {
  .horizontal-container {
    overflow-x: auto !important; /* Allow horizontal scroll here */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    display: flex;
    width: 100%;   /* Use width: 100% instead of max-width: 100vw */
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
    overscroll-behavior-x: auto;  /* Let the container scroll normally */
  }

  .gallery-track {
    display: flex;
    transition: transform 0.3s ease-out;
  }

  .gallery-item {
    flex: 0 0 100%;
    min-height: 80vh;
    scroll-snap-align: start;
    position: relative;
    padding-bottom: 0;
  }

  #gallery-wrapper {
    height: auto !important; /* Ensure no leftover height from desktop logic */
    padding-bottom: 0 !important;
  }

  .pinned-container {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  .horizontal-container {
    overflow-x: auto !important;
  }
}

/* --- New Contact Form Styles for Right-Aligned Send Button --- */
.contact-container form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: flex;
  flex-direction: column;
  align-items: center; /* center all items within the row */
  margin-bottom: 20px;
}

.form-row label {
  width: 75%;            /* same width as the input/textarea below */
  margin: 0 auto 5px;    /* center horizontally, add spacing below */
  font-weight: bold;
  text-align: left;      /* keep label text left-aligned */
}

.form-row input,
.form-row textarea {
  width: 75%;            /* narrower fields */
  margin: 0 auto;        /* center horizontally */
  padding: 10px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.button-row {
  flex-direction: row;
  justify-content: flex-end;
}

.button-row button {
  background: #007BFF;
  color: #fff;
  padding: 12px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.button-row button:hover {
  background: #0056b3;
}

.button-row {
  /* Use the same width so it aligns with the fields */
  width: 75%;
  margin: 0 auto;
  
  /* Make it a flex container so you can push the button to the right */
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}
.swipe-arrow {
  display: none;
}

/* ========== SWIPE ARROWS FOR TOUCH DEVICES ========== */
@media (hover: none) and (pointer: coarse) {
  .gallery-item .text-content {
    padding: 1.25rem 1rem 3.25rem;
  }

  .gallery-item .text-content .swipe-arrow {
    display: inline-block;
    position: absolute;
    bottom: .08rem;
    font-size: 2.25rem;
    color: rgba(255, 255, 255, 0.85);
    z-index: 3;
    pointer-events: none;
  }

  .gallery-item .text-content .swipe-arrow.right {
    right: 1rem;
    animation: none;
  }

  .gallery-item .text-content .swipe-arrow.left {
    left: 1rem;
    animation: none;
  }

  .gallery-item.pane-1 .text-content .swipe-arrow.right {
    animation: none;
  }

  .gallery-item.pane-5 .text-content .swipe-arrow.left {
    animation: none;
  }
}

/* Restore gallery centering for medium-to-large touchscreens (e.g., iPads) */
@media (hover: none) and (pointer: coarse) and (min-width: 768px) {
  .gallery-item {
    scroll-snap-align: center !important;
  }

  .horizontal-container {
    scroll-padding-left: 0 !important;
    padding-inline: 0 !important;
  }

  .gallery-track {
    justify-content: normal !important;
  }
}

/* ============================= */
/* GLOBAL STYLES                 */
/* ============================= */
html, body {
  margin: 0;
  padding: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  text-decoration: none !important;
  -ms-overflow-style: none;  /* Hide scrollbar IE and Edge */
  scrollbar-width: none;     /* Hide scrollbar Firefox */
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none !important;
  width: 0 !important;
  height: 0 !important;
}

html {
  font-size: 16px; /* base font size */
}

body {
  font-size: 1rem;
  line-height: 1.6;
  background-color: #e0f5f7;
}

@media (pointer: coarse) and (max-width: 992px) {
  html, body {
    overflow-x: hidden !important;
    overscroll-behavior-x: none;
  }
}



img {
  max-width: 100%;
  height: auto;
}

@media (max-width: 600px) {
  html {
    font-size: 14px; /* Slightly smaller base on mobile */
  }
 
  /* Adjust text in sections for improved readability */
  .contact-container p,
  .hero-content p,
  .gallery-item .text-content p {
    font-size: 0.95rem;
  }
}

/* Hide the hamburger by default on large screens */
.hamburger {
  display: none;
}

/* ============================= */
/* NAVBAR                        */
/* ============================= */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  box-sizing: border-box;
  padding: 8px 20px;
  z-index: 1000;
  transition: background 0.3s, box-shadow 0.3s;
}

.navbar.overlay {
  background: transparent;
  box-shadow: none;
}

.navbar.solid {
  background: rgba(30, 30, 30, 0.9);
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
}

.navbar nav {
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

.nav-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: inline-flex;
  white-space: nowrap;
  gap: 20px;
}

.navbar.overlay .nav-links li a,
.navbar.solid .nav-links li a {
  color: #fff !important;
}

.nav-links li a {
  display: inline-block;
  text-decoration: none;
  font-size: 1em;
  transition: transform 0.3s ease, text-shadow 0.3s ease;
  -webkit-tap-highlight-color: transparent;
}

.nav-links li a:hover {
  text-shadow: 0 0 2px rgba(255,255,255,0.8);
  color: inherit;
}

/* ============================= */
/* HERO SECTION                  */
/* ============================= */


/* ============================= */
/*       TIMELINE SECTION        */
/* ============================= */
.timeline-section {
  background-color: #e0f5f7;
  padding: 2rem 0 0; /* added top padding */
  margin-top: 0 !important;
  position: relative;
}

.timeline-wrapper {
  max-width: 1200px;
  margin: 0 auto;
  position: relative;
}

/* ========== TIMELINE CARDS ========== */
.timeline-cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  gap: 2rem;
  z-index: 1;
  transition: height 0.5s ease;
}

.timeline-card {
  position: relative;
  background-color: #e0f5f7;
  border-radius: 6px;
  padding: 1rem;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: scaleY(0);
  transform-origin: bottom center;
  transition: opacity 1s ease, transform 1s ease;
}

.timeline-card.card-reveal {
  opacity: 1;
  transform: scaleY(1);
}

/* ========== COMPANY HEADER (LOGO + BADGE + BAR) ========== */
.company-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: .25rem;
  gap: .5rem;
  padding-bottom: 0;
}

.company-logo {
  max-width: 150px;
  height: 75px;
  display: block;
  object-fit: contain;
}

.duration-badge {
  display: inline-block;
  margin-top: 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: #444;
  background-color: rgba(0, 0, 0, 0.05);
  padding: 4px 12px;
  border-radius: 999px;
  text-align: center;
}

.timeline-card .company,
.timeline-card .card-divider,
.timeline-card .achievements,
.timeline-card .titles {
  transition: opacity 0.5s ease;
  opacity: 1;
  visibility: visible;
}

/* Timeline Spacing Adjustments */
.company-bar { 
  width: 25%; 
  height: 4px; 
  background-color: #1f8fa3; 
  border-radius: 4px; 
  margin: 1rem auto;
}

.card-divider { 
  width: 25%; 
  height: 4px; 
  background-color: #1f8fa3; 
  border-radius: 4px; 
  margin: 1rem auto;
}

/* ========== ACHIEVEMENTS AND TITLES ========== */
.achievements p {
  margin: 0.5rem 0;
}

.titles p {
  font-weight: bold;
  color: #000;
  margin: 0.25rem 0;
}

.titles p + p {
  margin-top: 0.75rem;
}

.ach-group + .ach-group {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px dashed rgba(0, 0, 0, 0.2);
}

.promega-card .ach-group + .ach-group {
  border-top: none !important;
  padding-top: 0;
  margin-top: 0;
}

.group-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  font-size: 1rem;
  gap: 0.5rem;
  margin-top: 0;     /* this pushes the icon down from the bar */
  margin-bottom: 0; /* spacing between icon and first line of text */
}

.group-icon {
  object-fit: contain;
}

.handshake-icon {
  width: 75px;
  height: 75px;
}

.done-icon {
  width: 65px;
  height: 65px;
  position: relative;
  top: -10px;
}

/* ========== HOVER EFFECTS (DESKTOP) ========== */
@media (hover: hover) and (pointer: fine) {
  .timeline-card.card-reveal:hover {
    transform: scale(1.015);
    box-shadow: 0 0 12px rgba(31, 143, 163, 0.25);
    border-color: #1f8fa3;
    transition: all 0.3s ease;
  }
}

/* ============================= */
/* CERTIFICATIONS SECTION (GRID) */
/* ============================= */

#certifications {
  padding: 30px 30px;
  background: #e0f5f7;
}

.cert-grid-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, max-content));
  gap: 2rem 1.5rem;
  justify-content: center;
  align-items: start;
  max-width: 800px;
  margin: 0 auto;
  padding: 0 1rem;
}

.credential {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.credential a {
  position: relative;
  display: inline-block;
  transition: transform 0.3s ease, filter 0.3s ease;
  cursor: pointer;
}

.credential a:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 8px rgba(31, 143, 163, 0.4));
}

.hover-label {
  position: absolute;
  bottom: 76px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.8rem;
  background: rgba(30, 30, 30, 0.9);
  color: #fff;
  padding: 4px 12px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  white-space: nowrap;
}

.credential a:hover .hover-label {
  opacity: 1;
}

/* Hover label height for UW crests */
.hover-label.svg-label {
  bottom: 105px;
}

.cert-img,
.w-logo {
  max-width: 180px;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
}

.w-logo {
  margin-top: -16px;
}

/*-----------------------------------------*/
/*----Manipulate distance between logos----*/
/*---Elimnate ASAP by fixing source icons--*/
/*-----------------------------------------*/
/* Reduce spacing only between cert logos on desktop */
@media (min-width: 993px) {
  .credential.wisconsin {
    margin-left: -5px;
    margin-right: -30px; /* more space between both WI and rightmost SHRM them */
  }

  .cert-grid-inner .credential:nth-of-type(4) {
    margin-left: 10px; /* more space between the 2 WI logos */
  }

  #certifications .credential:nth-of-type(2) {
    margin-left: 25px;
  }
}

/* Small phones and narrow devices: tighter 2x2 */
@media (max-width: 600px) {
  .cert-grid-inner {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem 1rem;
    justify-items: center;
    padding: 0 1.25rem;
  }
}

/* Mid-range: tablets and large phones in landscape */
@media (min-width: 601px) and (max-width: 899px) {
  .cert-grid-inner {
    grid-template-columns: repeat(2, minmax(180px, 1fr));
    gap: 2rem 2rem;
    justify-content: center;
    padding: 0 12rem;
  }
}

.credential p {
  margin-top: 0.5rem;
  font-size: 0.875rem;
  text-align: center;
  font-weight: normal;
}

/*==========Top/bottom dividers================*/

.section-divider {
  width: 100%;
  background-color: #e0f5f7;
  text-align: center;
  padding: 4px 0 20px;
  box-sizing: border-box;
}

.section-divider::after {
  content: "";
  display: inline-block;
  width: 80%;
  max-width: 1200px;
  height: 4px;
  background-color: #1f8fa3;
  border-radius: 4px;
}

/* ========== TOUCH DEVICES (DISABLE HOVER) ========== */
@media (hover: none) and (pointer: coarse) {
  .timeline-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
}

/* ============================= */
/*       GALLERY SECTION         */
/* ============================= */
#gallery-wrapper {
  position: relative;
  z-index: 1;
}

.pinned-container {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.gallery-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: transparent;
  z-index: 5;
  padding: 10px 0;
}

.gallery-nav ul {
  display: flex;
  justify-content: space-evenly;
  list-style: none;
  margin: 0;
  padding: 0;
}

.gallery-nav ul li a {
  display: inline-block;
  transition: transform 0.3s ease;
  text-decoration: none;
  font-size: 1em;
  color: #fff;
  padding: 4px 0;
}

.gallery-nav ul li a:hover {
  transform: scale(1.05);
  text-shadow: 0 0 10px rgba(255,255,255,0.8);
}

.gallery-progress {
  width: 0%;
  height: 4px;
  background: #fff;
  margin-top: 10px;
  transition: width 0.2s ease;
}

.horizontal-container {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.gallery-track {
  display: flex;
  height: 100%;
  transition: transform 0.3s ease-out;
}

.gallery-item {
  flex: 0 0 100vw;
  height: 100vh;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 20px;
  position: relative;
}

/* Default text content styles */
.gallery-item .text-content {
  position: absolute;
  z-index: 2;
  color: #fff;
  padding: 2rem;
  max-width: 80%;
  text-align: center;
  background: rgba(0, 0, 0, 0.7);
  border-radius: 7px;
}

.gallery-item .text-content h3,
.gallery-item .text-content p {
  margin: 0;
  padding: 0;
}

.gallery-item .text-content h3 {
  margin-bottom: 1rem;
  font-size: 2rem;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.gallery-item .text-content p {
  font-size: 1.2rem;
  color: #fff;
  text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

/* ---------- Desktop-only pane positioning ---------- */
@media (min-width: 993px) {
  .gallery-item.pane-1 .text-content {
    top: 8%;
    right: 10%;
    left: auto;
    transform: none;
    text-align: left;
    max-width: 600px;
  }

  .gallery-item.pane-2 .text-content {
    bottom: 19%;
    left: 31.25%;
    transform: none;
    text-align: left;
    max-width: 600px;
  }

  .gallery-item.pane-3 .text-content {
    top: 20%;
    left: 45%;
    transform: none;
    text-align: left;
    max-width: 600px;
  }

  .gallery-item.pane-4 .text-content {
    bottom: 15%;
    left: 10%;
    transform: none;
    text-align: left;
  }

  .gallery-item.pane-5 .text-content {
    bottom: 15%;
    left: 7%;
    transform: none;
    text-align: left;
    max-width: 400px;
  }
}

/* ---------- Mobile & Touch Layout Overrides ---------- */
@media (max-width: 992px) {
  .pinned-container,
  .horizontal-container {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  .gallery-track {
    display: flex !important;
    flex-wrap: nowrap;
    width: 100% !important;
    overflow-x: auto !important;
    scroll-behavior: smooth !important;
    overscroll-behavior-x: contain;
    transform: none !important;
    scroll-snap-type: x mandatory; /* Enables snapping */
    scroll-padding-left: 0;        /* Aligns first item cleanly */
  }

  .gallery-progress {
    display: none !important;
  }

  .gallery-item .text-content {
    bottom: 10%;
    left: 50%;
    transform: translateX(-50%);
    text-align: left;
    padding: 1.5rem;
    width: 80%;         /* Replaces max-width */
    max-width: 600px;   /* Optional: cap on very large screens */
  }

  /* Prevent nav link teal color on mobile */
  .gallery-nav ul li a:active,
  .gallery-nav ul li a:focus {
    color: #fff !important;  /* Maintain default white color */
    text-shadow: none;
  }

  /* Fix navlink clipping issue */
  .gallery-nav ul li a {
    padding: 10px 15px;
    font-size: 1.1rem;
  }

  /* Add offset to smooth scrolling for nav links */
  .gallery-nav ul li a {
    scroll-padding-top: 50px;  /* Adjusted for offset */
  }

  /* Add extra space below gallery pane to accommodate wrapped nav links */
  .gallery-item {
    padding-bottom: 0;
    scroll-snap-align: start;
  }

  /* Ensure #gallery-wrapper doesn't collapse tightly */
  #gallery-wrapper {
    padding-bottom: 0 !important;
  }
}

/* ============================= */
/*     Contact Me Section        */
/* ============================= */
#contact-me {
  padding: 40px 20px;
  background: #eeee;
}

.contact-container {
  max-width: 800px; 
  margin: 0 auto;
  text-align: center; 
}

.contact-container h2 {
  font-size: 2rem;
  margin-bottom: 20px;
  color: #333;
}

.contact-container p {
  font-size: 1.1rem;
  line-height: 1.6;
  color: #555;
  margin: 0 auto 40px auto;
  text-align: left;  
  max-width: 575px;
}

/* Labels and button are not forced full-width */
.contact-container form label,
.contact-container form button {
  display: block;
  margin-bottom: 15px;
}

/* Stack label above field, left aligned, and bold */
.form-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  margin-bottom: 20px;
}

.form-row label {
  margin-bottom: 5px !important;  /* Removes extra space below the label */
  text-align: left;
  font-weight: bold;
  line-height: 1 !important;    /* Adjust as needed to ensure minimal extra spacing */
}

/* Make the textarea taller */
.form-row textarea {
  height: 120px; 
  resize: none;  
}

/* ============================= */
/* UTILITY / MISC                */
/* ============================= */

a,
a:visited,
a:hover,
a:focus,
a:active {
  text-decoration: none !important;
}

.group-icon {
  display: inline-block;
  object-fit: contain;
}

.handshake-icon {
  position: relative;
  width: 75px;
  height: 75px;
  margin-bottom: 0 !important;
}

.done-icon {
  position: relative;
  top: -3px;
  width: 65px;
  height: 65px;
}

/* ============================= */
/* RESPONSIVE REFINEMENTS        */
/* ============================= */

@media (max-width: 768px) {
  .timeline-card {
    margin-bottom: 2rem;
    padding: 1rem;
  }

  .titles p {
    font-size: 0.95rem;
  }

  .achievements p {
    font-size: 0.9rem;
  }
}

@media (hover: none) and (pointer: coarse) {
  .timeline-card:hover {
    transform: none !important;
    box-shadow: none !important;
    border-color: transparent !important;
  }
}

/* Just like 'card-reveal', but no animation. */
.temporary-measure {
  opacity: 1 !important;
  transform: scaleY(1) !important;
  transition: none !important;
}

@media (max-width: 600px) {
  .contact-container form {
    width: 90%;
    padding: 0 5%;
  }
  .form-row input,
  .form-row textarea {
    width: 100%;
    max-width: 100%;
  }
}

@media (max-width: 600px) {
  /* Increase clickable area for nav links */
  .nav-links li a {
    padding: 10px 15px;
    font-size: 1.1rem;
  }

  /* Increase button touch area */
  .hero-btn {
    padding: 12px 20px;  /* adjust if needed */
    font-size: 1.1rem;
  }

  /* Increase gallery navigation links */
  .gallery-nav ul li a {
    padding: 10px 15px;
    font-size: 1.1rem;
  }


  /* Prevent nav link teal color on mobile */
@media (max-width: 992px) {
  .gallery-nav ul li a:active,
  .gallery-nav ul li a:focus {
    color: #fff !important; /* Ensure no color change on click */
    text-shadow: none;
  }
 }
}

@media (hover: none) and (pointer: coarse) {
  .nav-links li a:hover,
  .hero-btn:hover,
  .gallery-nav ul li a:hover {
    transform: none;
    box-shadow: none;
  }

    /* Add offset to smooth scrolling for nav links */
    .gallery-nav ul li a {
      scroll-padding-top: 50px;  /* Adjusted for offset */
    }
}


/* For screens between 420px and 992px, display the hero buttons side by side */
@media (min-width: 421px) and (max-width: 992px) {
  .hero-buttons {
    flex-direction: row;
    justify-content: center;
    gap: 12px;
  }
}

  /* Force timeline cards to appear statically */
@media (max-width: 992px) {
  .timeline-card {
    opacity: 1 !important;
    transform: none !important;
  }
  
  /* Make sure the container shows all cards and stacks them */
  .timeline-cards {
    height: auto !important;
    grid-template-columns: 1fr;  /* Stack cards vertically */
  }
}
/* ========== MOBILE ADJUSTMENTS ========== */
@media (max-width: 768px) {
  .timeline-cards {
    grid-template-columns: 1fr;
  }

  .timeline-card {
    margin-bottom: 2rem;
    padding: 1rem;
  }

  .titles p {
    font-size: 0.95rem;
  }

  .achievements p {
    font-size: 0.9rem;
  }
}

/* ========== MOBILE NAVIGATION ========== */
@media (max-width: 992px) {
  .hamburger {
    display: block;
    font-size: 2rem;
    color: white;
    cursor: pointer;
    margin-left: auto;
    padding: 8px 12px;
    z-index: 1100;
    background: transparent !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent; /* Prevent teal tap */
  }
  
  .hamburger:focus,
  .hamburger:active,
  .hamburger:focus-visible,
  .hamburger::-moz-focus-inner {
    background-color: transparent !important;
    outline: none !important;
    box-shadow: none !important;
    border: none !important;
  }
  
  .nav-links {
    flex-direction: column;
    align-items: center;
    background: rgba(0, 0, 0, 0.95);
    position: absolute;
    top: 60px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: 6px;
    z-index: 1000;
    
    /* Hide navbar by default */
    opacity: 0;
    transform: scaleY(0.95);
    transform-origin: top;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease;
  }
  
  .nav-links.show {
    opacity: 1;
    transform: scaleY(1);
    pointer-events: auto;
  }
}

  body.menu-open,
  html.menu-open {
    overflow: hidden;
    height: 100%;
    touch-action: none;
  }

  .backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
  }
  
  .backdrop.visible {
    display: block;
  }  

/* Prevent teal color on active, focus, and hover states for mobile touch */
@media (hover: none) and (pointer: coarse) {
  /* Navbar links on mobile */
  .nav-links li a:active,
  .nav-links li a:focus,
  .nav-links li a:hover {
    color: #fff !important; /* Ensure color stays white */
    text-shadow: none !important;
    transform: scale(1.1) !important; /* Stronger scale effect */
  }

  /* Gallery nav links on mobile */
  #gallery-wrapper .gallery-nav ul li a:active,
  #gallery-wrapper .gallery-nav ul li a:focus,
  #gallery-wrapper .gallery-nav ul li a:hover {
    color: #fff !important; /* Ensure color stays white */
    text-shadow: none !important;
    transform: scale(1.1) !important; /* Stronger scale effect */
  }
}


/* ============================= */
/* MOBILE GALLERY SPECIFIC STYLES */
/* ============================= */
@media (max-width: 992px) {
  .horizontal-container {
    overflow-x: auto !important; /* Allow horizontal scroll here */
    -webkit-overflow-scrolling: touch; /* Smooth scrolling for iOS */
    display: flex;
    width: 100%;   /* Use width: 100% instead of max-width: 100vw */
    scroll-snap-type: x mandatory;
    scroll-padding-left: 0;
    overscroll-behavior-x: auto;  /* Let the container scroll normally */
  }

  .gallery-track {
    display: flex;
    transition: transform 0.3s ease-out;
  }

  .gallery-item {
    flex: 0 0 100%;
    min-height: 80vh;
    scroll-snap-align: start;
    position: relative;
    padding-bottom: 0;
  }

  #gallery-wrapper {
    height: auto !important; /* Ensure no leftover height from desktop logic */
    padding-bottom: 0 !important;
  }

  .pinned-container {
    position: static !important;
    height: auto !important;
    overflow: visible !important;
  }

  .horizontal-container {
    overflow-x: auto !important;
  }
}

/* --- New Contact Form Styles for Right-Aligned Send Button --- */
.contact-container form {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

.form-row {
  display: flex;
  flex-direction: column;
  align-items: center; /* center all items within the row */
  margin-bottom: 20px;
}

.form-row label {
  width: 75%;            /* same width as the input/textarea below */
  margin: 0 auto 5px;    /* center horizontally, add spacing below */
  font-weight: bold;
  text-align: left;      /* keep label text left-aligned */
}

.form-row input,
.form-row textarea {
  width: 75%;            /* narrower fields */
  margin: 0 auto;        /* center horizontally */
  padding: 10px;
  font-size: 1rem;
  font-family: inherit;
  border: 1px solid #ccc;
  border-radius: 4px;
  box-sizing: border-box;
}

.button-row {
  flex-direction: row;
  justify-content: flex-end;
}

.button-row button {
  background: #007BFF;
  color: #fff;
  padding: 12px 20px;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.3s;
}

.button-row button:hover {
  background: #0056b3;
}

.button-row {
  /* Use the same width so it aligns with the fields */
  width: 75%;
  margin: 0 auto;
  
  /* Make it a flex container so you can push the button to the right */
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
}
.swipe-arrow {
  display: none;
}

/* ========== SWIPE ARROWS FOR TOUCH DEVICES ========== */
@media (hover: none) and (pointer: coarse) {
  .gallery-item .text-content {
    padding: 1.25rem 1rem 3.25rem;
  }

  .gallery-item .text-content .swipe-arrow {
    display: inline-block;
    position: absolute;
    bottom: .08rem;
    font-size: 2.25rem;
    color: rgba(255, 255, 255, 0.85);
    z-index: 3;
    pointer-events: none;
  }

  .gallery-item .text-content .swipe-arrow.right {
    right: 1rem;
    animation: none;
  }

  .gallery-item .text-content .swipe-arrow.left {
    left: 1rem;
    animation: none;
  }

  .gallery-item.pane-1 .text-content .swipe-arrow.right {
    animation: none;
  }

  .gallery-item.pane-5 .text-content .swipe-arrow.left {
    animation: none;
  }
}

/* Restore gallery centering for medium-to-large touchscreens (e.g., iPads) */
@media (hover: none) and (pointer: coarse) and (min-width: 768px) {
  .gallery-item {
    scroll-snap-align: center !important;
  }

  .horizontal-container {
    scroll-padding-left: 0 !important;
    padding-inline: 0 !important;
  }

  .gallery-track {
    justify-content: normal !important;
  }
}

/* ============================= */
/* SUPERPOWERS SECTION           */
/* ============================= */

.superpowers {
  padding: 0;
  align-content: center;
  height: 300px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 2rem;
  text-align: center;
  background: transparent;
  position: relative;
  z-index: 10000;
  margin-bottom: -8vh;
  min-height: 22vh;
  max-width: none;
  width: 100%;
  margin: 0 auto;
}

.superpowers::after {
  content: "";
  position: absolute;
  left: 0;
  height: var(--fade-height, 300px);
  width: 100%;
  background: linear-gradient(
    to bottom,
    rgba(224, 245, 247, 0) 5%,
    rgba(224, 245, 247, 0.02) 15%,
    rgba(224, 245, 247, 0.05) 20%,
    rgba(224, 245, 247, 0.1) 30%,
    rgba(224, 245, 247, 0.25) 40%,
    rgba(224, 245, 247, 0.45) 50%,
    rgba(224, 245, 247, 0.65) 60%,
    rgba(224, 245, 247, 0.85) 75%,
    #e0f5f7 100%
  );
  bottom: 0;
  top: auto;
}

.superpowers::before {
  display: none;
}

.superpower {
  min-width: 140px;
  max-width: 200px;
  flex: 1 1 150px;
}

.superpower-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  margin-top: 0.5rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.superpower-subtext {
  font-size: 0.9rem;
  color: #fff;
  margin-top: 0.25rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.superpower-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
  filter: brightness(0) invert(1) drop-shadow(0 2px 4px rgba(0, 0, 0, 0.5));
}

/* Special handling if ißcons are present */
.superpowers.with-icons .superpower-title {
  margin-top: 0.25rem;
}

/* Ensure superpower content is above the fade layer */
.superpower,
.superpower-title,
.superpower-subtext {
  position: relative;
  z-index: 2;
}

.superpowers + div {
  background-color: #e0f5f7 !important;
}

.superpower-wrapper {
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  z-index: 10;
}

.superpowers::after {
  content: "";
  position: absolute;
  left: 0;
  height: 300px;
  width: 100%;
  background: linear-gradient(
    to bottom,
    rgba(224, 245, 247, 0) 0%,
    rgba(224, 245, 247, 0.06) 10%,
    rgba(224, 245, 247, 0.15) 25%,
    rgba(224, 245, 247, 0.3) 45%,
    rgba(224, 245, 247, 0.5) 60%,
    rgba(224, 245, 247, 0.75) 80%,
    #e0f5f7 100%
  );
  bottom: 0;
  top: auto;
}

.superpowers::before {
  display: none;
}

.superpower {
  min-width: 140px;
  max-width: 200px;
  flex: 1 1 150px;
}

.superpower-title {
  font-size: 1.5rem;
  font-weight: bold;
  color: #fff;
  margin-top: 0.5rem;
}

.superpower-subtext {
  font-size: 0.9rem;
  color: #fff;
  margin-top: 0.25rem;
}

.superpower-icon {
  width: 48px;
  height: 48px;
  margin-bottom: 0.5rem;
  display: block;
  margin-left: auto;
  margin-right: auto;
}

/* Special handling if icons are present */
.superpowers.with-icons .superpower-title {
  margin-top: 0.25rem;
}

/* Ensure superpower content is above the fade layer */
.superpower,
.superpower-title,
.superpower-subtext {
  position: relative;
  z-index: 2;
}

.superpowers + div {
  background-color: #e0f5f7 !important;
}

/* Reduce gap in mobile landscape to lift superpowers up */
@media (max-width: 992px) and (orientation: landscape) {
  .hero-section {
    padding-bottom: 120px !important;
  }
}

/* Slightly tighten portrait spacing for very narrow devices */
@media (max-width: 420px) and (orientation: portrait) {
  .hero-section {
    padding-bottom: 180px !important;
  }
}