/* Team Section - Isolated CSS with Grid Technology */

/* CSS Variables for Team Section */
:root {
  --team-color-text-primary: #232228;
  --team-color-text-secondary: #b1b1b1;
  --team-color-accent: #e3c37a;
  --team-color-accent-light: #e3c37a;
  --team-color-background: #f6f4f5;
  --team-font-primary: 'Cormorant Garamond', serif;
  --team-font-secondary: 'Montserrat', sans-serif;
  --team-font-tertiary: 'Cormorant Garamond', serif;
}

/* Reset and Base Styles for Team Section */
#team-section * {
  box-sizing: border-box;
}

#team-section img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Main Team Section - CSS Grid Layout */
#team-section {
  padding: 60px 20px;
  background-color: #f6f4f5;
  color: var(--team-color-text-primary);
  font-family: var(--team-font-secondary);
  display: flex;
  justify-content: center;
  align-items: center;
}

.team-container {
  max-width: none;
  margin: 0;
  padding: 0 20px;
  display: grid;
  grid-template-columns: 492px 1fr;
  grid-template-areas: "intro gallery";
  align-items: start;
  gap: 80px;
  background-color: #f6f4f5;
  overflow: visible;
}

/* Team Introduction - Grid Layout */
.team-introduction {
  grid-area: intro;
  display: grid;
  grid-template-rows: auto auto auto;
  gap: 40px;
  width: 492px;
  padding-top: 0;
  background-color: #f6f4f5;
  margin-left: 120px;
}

.team-intro__header {
  display: grid;
  grid-template-rows: auto auto;
  gap: 32px;
}

.team-intro__subtitle-wrapper {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 8px;
  align-items: center;
}

.team-intro__line {
  border: none;
  height: 0.5px;
  width: 44px;
  background-color: var(--team-color-text-secondary);
}

.team-intro__subtitle {
  margin: 0;
  font-family: var(--team-font-secondary);
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  color: var(--team-color-text-secondary);
  letter-spacing: 0.32px;
}

.team-intro__title {
  margin: 0;
  font-family: var(--team-font-primary);
  font-weight: 400;
  font-size: 40px;
  line-height: 52px;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--team-color-text-primary);
}

.team-intro__title .highlight {
  color: var(--team-color-accent);
}

.team-intro__description {
  margin: 0;
  font-family: var(--team-font-secondary);
  font-weight: 300;
  font-size: 16px;
  line-height: 24px;
  letter-spacing: 0.32px;
  color: var(--team-color-text-primary);
  max-width: 455px;
}

.team-intro__button {
  display: grid;
  place-items: center;
  width: 200px;
  padding: 12px 24px;
  border: 1px solid var(--team-color-accent-light);
  background-color: transparent;
  color: var(--team-color-text-primary);
  font-family: var(--team-font-tertiary);
  font-size: 16px;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.3s, color 0.3s;
}

.team-intro__button:hover {
  background-color: var(--team-color-accent-light);
  color: var(--team-color-background);
}

/* Team Gallery - Slider Layout */
.team-gallery {
  grid-area: gallery;
  display: flex;
  gap: 20px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 10px;
  padding-left: 80px;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* Internet Explorer 10+ */
  background-color: #f6f4f5;
  justify-self: start;
  margin-right: -20px;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch; /* iOS smooth scrolling */
  width: 100%;
  max-width: none;
}

.team-gallery::-webkit-scrollbar {
  display: none; /* Chrome, Safari, Opera */
}

/* Additional slider styles */
.team-gallery {
  cursor: grab;
}

.team-gallery:active {
  cursor: grabbing;
}

/* Team Card - Grid Layout */
.team-card {
  display: grid;
  grid-template-rows: auto auto;
  width: 229px;
  flex-shrink: 0;
  flex-grow: 0;
  flex-basis: 229px;
}

/* Alternating text position for team cards */
.team-card:nth-child(1) .team-card__info {
  order: 1;
  margin-top: 24px;
}

.team-card:nth-child(2) .team-card__info {
  order: -1;
  margin-bottom: 37px;
}

.team-card:nth-child(3) .team-card__info {
  order: 1;
  margin-top: 24px;
}

.team-card:nth-child(4) .team-card__info {
  order: -1;
  margin-bottom: 37px;
}

.team-card__info {
  display: grid;
  gap: 16px;
}

.team-card__name {
  margin: 0;
  font-family: var(--team-font-tertiary);
  font-weight: 400;
  font-size: 16px;
  line-height: 24px;
  color: var(--team-color-text-primary);
  text-transform: uppercase;
}

.team-card__experience {
  margin: 0;
  font-family: var(--team-font-secondary);
  font-weight: 300;
  font-size: 14px;
  line-height: 21px;
  color: var(--team-color-text-secondary);
}

/* Team Card Image Wrapper - Grid Layout */
.team-card__image-wrapper {
  position: relative;
  width: 229px;
  height: 312px;
  display: grid;
  grid-template-areas: "stack";
}

.team-card__bg {
  grid-area: stack;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--team-color-accent);
}

.team-card__photo {
  grid-area: stack;
  position: absolute;
  left: 0;
  width: 100%;
  object-fit: cover;
}

.team-card__icon {
  grid-area: stack;
  position: absolute;
}

/* Specific positioning for team members */
.team-card:nth-child(1) .team-card__photo {
  top: 13px;
  height: 299px;
}

.team-card:nth-child(2) .team-card__photo {
  top: 11px;
  height: 301px;
}

.team-card:nth-child(2) .team-card__icon {
  top: 141.59px;
  left: 176px;
}

.team-card:nth-child(3) .team-card__photo {
  top: 27px;
  height: 285px;
}

.team-card:nth-child(4) .team-card__photo {
  top: 24px;
  height: 286px;
}

.team-card:nth-child(4) .team-card__icon {
  top: 141.59px;
  left: 176px;
}

.team-card:nth-child(5) .team-card__photo {
  top: 39px;
  height: 273px;
}

/* Responsive Design with Grid */
@media (max-width: 1550px) {
  .team-container {
    grid-template-columns: 492px 1fr;
    grid-template-areas: "intro gallery";
    align-items: start;
    gap: 80px;
  }
  
  .team-introduction {
    width: 492px;
    margin-left: 120px;
    text-align: left;
    justify-items: start;
  }
  
  .team-intro__subtitle-wrapper {
    grid-template-columns: 44px 1fr;
    justify-items: start;
    gap: 8px;
  }
  
  .team-intro__line {
    order: 0;
  }
  
  .team-gallery {
    display: flex;
    justify-self: start;
    margin-right: -20px;
    max-width: none;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
  }
}

@media (max-width: 1200px) {
  .team-container {
    grid-template-columns: 492px 1fr;
    grid-template-areas: "intro gallery";
    gap: 80px;
  }
  
  .team-introduction {
    margin-left: 120px;
  }
  
  .team-gallery {
    display: flex;
    justify-self: start;
    margin-right: -20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
  }
}

@media (max-width: 768px) {
  #team-section {
    padding: 40px 15px;
  }
  
  .team-container {
    grid-template-columns: 492px 1fr;
    grid-template-areas: "intro gallery";
    gap: 60px;
  }
  
  .team-introduction {
    margin-left: 120px;
  }
  
  .team-intro__title {
    font-size: 32px;
    line-height: 42px;
  }
  
  .team-gallery {
    display: flex;
    justify-self: start;
    margin-right: -20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
  }
}

@media (max-width: 576px) {
  .team-container {
    grid-template-columns: 1fr;
    grid-template-areas: 
      "intro"
      "gallery";
    align-items: center;
    gap: 50px;
  }
  
  .team-introduction {
    width: 100%;
    max-width: 600px;
    margin-left: 0;
    text-align: center;
    justify-items: center;
  }
  
  .team-intro__subtitle-wrapper {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 12px;
  }
  
  .team-intro__line {
    order: -1;
  }
  
  .team-gallery {
    display: flex;
    justify-self: center;
    margin-right: 0;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }
  
  .team-intro__title {
    font-size: 28px;
    line-height: 1.3;
  }
  
  .team-intro__description {
    font-size: 14px;
  }
  
  .team-intro__button {
    width: 100%;
    max-width: 250px;
  }
}

/* Grid Animation Support */
.team-container {
  transition: grid-template-columns 0.3s ease;
}

.team-gallery {
  transition: all 0.3s ease;
}

.team-card {
  transition: transform 0.3s ease;
}

.team-card:hover {
  transform: translateY(-5px);
}

/* Additional Grid Enhancements */
.team-gallery {
  align-items: start;
}

.team-card {
  min-height: 400px;
}

@media (min-width: 1551px) {
  .team-container {
    max-width: none;
    margin: 0;
    padding: 0 20px;
    grid-template-columns: 492px 1fr;
    grid-template-areas: "intro gallery";
    gap: 80px;
  }
  
  .team-gallery {
    display: flex;
    justify-self: start;
    margin-right: -20px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    width: 100%;
  }
}
