/* ===================================
    DiaSam About Us Section Styles
====================================== */

/* Font Import */
@import url('https://fonts.googleapis.com/css2?family=Montserrat:wght@400;600;800&family=Roboto:wght@400;500&display=swap');

/* CSS Custom Properties */
:root {
  /* About Section Colors */
  --about-overlay: rgba(1, 46, 87, 0.9);
  --about-text: #ffffff;
  --about-text-secondary: rgba(255, 255, 255, 0.98);
  
  /* Team Card Colors */
  --card-bg: #ffffff;
  --card-shadow: 0 10px 30px rgba(0,0,0,0.15);
  --member-name: #2c3e50;
  --role-badge-start: #34495e;
  --role-badge-end: #2c3e50;
  --role-badge-text: #ffffff;
  
  /* Spacing */
  --about-padding: 35px 40px;
  --card-border-radius: 12px;
  --badge-border-radius: 15px;
}

/* ===================================
    SECTION HEADING
====================================== */

.about-section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 700;
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  color: #ffffff;
  text-shadow: 0 4px 8px rgba(0,0,0,0.4);
  margin-bottom: 0;
  margin-top: 0;
  letter-spacing: 1px;
  position: relative;
  padding-bottom: 10px;
}

.about-section-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 80px;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ffffff, transparent);
}

.about-us-section .section-heading {
  margin-bottom: 0.5rem !important;
  padding-top: 0.5rem;
}

/* Desktop only: Force no scrollbar */
@media (min-width: 1200px) {
  .about-us-section .section-wrapper {
    overflow: hidden !important;
  }
}

/* Mobile/Tablet: Allow scrolling */
@media (max-width: 1199px) {
  .about-us-section .section-wrapper {
    overflow-y: auto !important;
    overflow-x: hidden !important;
  }
  
  .company-info-container {
    max-height: none !important;
    overflow: visible !important;
  }
}

/* ===================================
    ABOUT US SECTION LAYOUT
====================================== */

.about-us-section {
  overflow: hidden;
  /* Normalize text rendering to match Chrome exactly */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

.about-us-section .container {
  overflow: visible;
  position: relative;
  z-index: 10;
}

/* ===================================
    LEFT SIDE: Company Information
====================================== */

.about-us-left {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 20px 30px;
}

.company-info-container {
  width: 100%;
  max-width: 100%;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  max-height: 90vh; 
  overflow: hidden; /* Definitively remove internal scrollbar */
}

.company-info-section {
  margin-bottom: 15px; /* Reduced from 20px */
}

/* Company Headings - Using svh for cross-browser math stability */
.company-heading {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: clamp(1.4rem, 4svh, 2.4rem); 
  color: var(--about-text);
  letter-spacing: 1px;
  margin-bottom: 1.2svh;
  text-shadow: 0 3px 6px rgba(0,0,0,0.4);
}

.company-info-section:nth-child(2) .company-heading {
  margin-top: 15px;
}

/* Company Paragraphs - Using svh for cross-browser math stability */
.company-paragraph {
  font-family: 'Roboto', sans-serif;
  font-size: clamp(1.1rem, 2.3svh, 1.45rem); 
  line-height: clamp(1.5, 2.8svh, 1.9); 
  text-align: justify;
  margin-bottom: 2svh;
  color: var(--about-text-secondary);
  text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

/* ===================================
    RIGHT SIDE: Team Members
====================================== */

.about-us-right {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  padding: 20px 15px;
}

.team-section-container {
  width: 100%;
}

/* Team Header */
.team-header {
  text-align: center;
  margin-bottom: 25px;
}

.team-main-title {
  font-family: 'Montserrat', sans-serif;
  font-size: clamp(1.5rem, 3.5vh, 2rem); /* Fluid scaling */
  font-weight: 600;
  color: white;
  letter-spacing: 1px;
  text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
  margin-bottom: 8px;
}

/* Title Underline */
.title-underline {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  position: relative;
  margin: 8px auto;
  width: 50px;
  height: 10px;
}

.underline-bar {
  width: 50px;
  height: 2px;
  background: linear-gradient(90deg, white, rgba(255,255,255,0.6));
}

.underline-dot {
  position: absolute;
  width: 5px;
  height: 5px;
  background: white;
  border-radius: 50%;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.team-subtitle {
  font-family: 'Roboto', sans-serif;
  font-size: 0.95rem;
  color: white;
  opacity: 0.8;
  font-style: italic;
  margin-top: 4px;
  margin-bottom: 0;
}

/* ===================================
    TEAM MEMBER CARDS
====================================== */

/* Desktop View */
.team-cards-desktop {
  display: block;
}

.team-cards-mobile {
  display: none;
}

.team-member-card {
  background: var(--card-bg);
  border-radius: var(--card-border-radius);
  overflow: hidden;
  box-shadow: var(--card-shadow);
  transition: all 0.4s ease;
  position: relative;
  height: clamp(260px, 44svh, 480px); 
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-orient: vertical;
  -webkit-box-direction: normal;
  -ms-flex-direction: column;
  flex-direction: column;
  margin-bottom: 1svh;
}

.card-image-section {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.team-member-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  display: block;
}

.card-info-section {
  padding: 14px 10px;
  text-align: center;
  background: var(--card-bg);
}

.member-name {
  font-family: 'Montserrat', sans-serif;
  color: var(--member-name);
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 5px;
  margin-top: 0;
}

.role-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--role-badge-start), var(--role-badge-end));
  color: var(--role-badge-text);
  padding: 4px 14px;
  border-radius: var(--badge-border-radius);
  font-size: 0.85rem;
  font-family: 'Roboto', sans-serif;
}

/* ===================================
    MOBILE CAROUSEL
====================================== */

.mobile-carousel-container {
  position: relative;
  max-width: 260px;
  margin: 0 auto;
  display: -ms-grid;
  display: grid;
  -ms-grid-columns: 1fr;
  grid-template-columns: 1fr;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
}

.carousel-card {
  grid-area: 1 / 1 / 2 / 2;
  opacity: 1;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 1;
}

.carousel-card[style*="display: none"] {
  opacity: 0;
  z-index: 0;
}

/* Carousel Indicators */
.carousel-indicators {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  gap: 8px;
  margin-top: 15px;
}

.carousel-dot {
  width: 8px;
  height: 8px;
  border-radius: 4px;
  background: rgba(255,255,255,0.4);
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  padding: 0;
}

.carousel-dot.active {
  width: 20px;
  background: #ffffff;
}

.carousel-dot:hover {
  background: rgba(255,255,255,0.6);
}

/* ===================================
    RESPONSIVE DESIGN
====================================== */

/* Large Desktop (1600px+) */
@media (min-width: 1600px) {
  .about-us-left {
    padding: 45px 30px;
  }

  .company-heading {
    font-size: 2.6rem;
    margin-bottom: 22px;
  }

  .company-paragraph {
    
    line-height: 2;
    margin-bottom: 35px;
  }
}

@media (min-width: 1200px) and (max-width: 1599px) {
  .about-us-left {
    padding: clamp(15px, 3vh, 35px) clamp(10px, 2vw, 25px);
  }

  .company-heading {
    margin-bottom: clamp(5px, 1.5vh, 20px);
  }

  .company-paragraph {
    margin-bottom: clamp(10px, 2vh, 30px);
  }

  .team-member-card {
    height: 42vh;
    min-height: 250px;
    max-height: 480px;
  }
}

/* Tablet Portrait and Mobile (≤1279px) - Matches PagePiling breakpoint */
@media (max-width: 1199px) {
  .about-us-left {
    text-align: center;
    padding: 20px;
  }

  .company-paragraph {
    text-align: center;
  }

  .about-us-right {
    padding: 20px;
  }

  .team-member-card {
    height: 38vh; /* Use vh on mobile instead of svh */
    min-height: 250px;
    max-height: 450px;
  }
  
  /* Revert svh to vh on mobile for better compatibility */
  .company-heading {
    font-size: clamp(1.4rem, 4vh, 2.4rem);
    margin-bottom: 1.2vh;
  }
  
  .company-paragraph {
    font-size: clamp(1.1rem, 2.3vh, 1.45rem);
    line-height: clamp(1.5, 2.8vh, 1.9);
    margin-bottom: 2vh;
  }
  
  .team-member-card {
    margin-bottom: 1vh;
  }
}

/* Tablet Landscape ONLY - Better text spacing */
@media (max-width: 1199px) and (orientation: landscape) {
  .about-us-left {
    padding: 30px 40px; /* More horizontal padding */
  }
  
  .company-heading {
    margin-bottom: 2.5vh; /* More space after headings */
  }
  
  .company-paragraph {
    font-size: clamp(1.15rem, 2.5vh, 1.5rem); /* Slightly larger text */
    line-height: 40px !important; /* User's tested value - works perfectly on iPad mini/Air */
    margin-bottom: 3.5vh; /* More space between paragraphs */
  }
  
  .company-info-section {
    margin-bottom: 30px; /* More space between sections */
  }
}


/* Mobile (<768px) */
@media (max-width: 767px) {
  .about-us-left {
    text-align: center;
    padding: 40px 25px;
  }

  .company-heading {
    font-size: 1.75rem;
    margin-bottom: 18px;
  }

  .company-paragraph {
    text-align: center;
    font-size: 1.15rem;
    line-height: 1.7;
    margin-bottom: 25px;
  }

  .about-us-right {
    padding: 30px 20px;
  }

  /* Hide desktop cards, show mobile carousel */
  .team-cards-desktop {
    display: none;
  }

  .team-cards-mobile {
    display: block;
  }

  .team-member-card {
    height: 45vh;
    min-height: 320px;
    max-height: 380px;
    max-width: 260px;
    margin: 0 auto;
  }

  .card-info-section {
    padding: 10px;
  }

  .member-name {
    font-size: 1.1rem;
    margin-bottom: 4px;
  }

  .role-badge {
    padding: 3px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
  }
}

/* ===================================
    HEIGHT-BASED BREAKPOINTS
====================================== */

/* Very tall screens */
@media (min-height: 1000px) {
  .company-info-section:nth-child(2) .company-heading {
    margin-top: 35px;
  }
}

@media (min-height: 900px) {
  .company-paragraph {
    margin-bottom: 35px;
  }

  .company-info-section:nth-child(2) .company-heading {
    margin-top: 25px;
  }
}


/* ===================================
    ACCESSIBILITY ENHANCEMENTS
====================================== */

.carousel-dot:focus {
  outline: 2px solid white;
  outline-offset: 2px;
}

.carousel-dot:focus-visible {
  outline: 2px solid white;
  outline-offset: 2px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  .carousel-card,
  .carousel-dot,
  .team-member-card {
    transition: none;
  }
}

/* ===================================
    VERTICAL HEIGHT OPTIMIZATIONS
    Ensures everything fits on 14-inch laptops without scrolling
====================================== */

@media (max-height: 850px) {
  .about-us-section .section-wrapper {
    padding: clamp(15px, 3svh, 35px) 0 !important; /* Minimized padding */
  }

  .team-header {
    margin-bottom: 12px;
  }

  .company-info-section:nth-child(2) .company-heading {
    margin-top: 10px;
  }
}

@media (max-height: 720px) {
  .company-heading {
    font-size: 1.45rem; 
  }
  
  .company-paragraph {
    font-size: 1.05rem; 
    line-height: 1.6;
  }

  .about-section-title {
    font-size: 2rem; 
  }

  .team-main-title {
    font-size: 1.4rem;
  }
  
  .team-subtitle {
    font-size: 0.9rem;
  }
  
  .team-member-card {
    height: 40svh;
    min-height: 250px;
  }
}
