/* ==================== VARIÁVEIS GLOBAIS ISPOC ==================== */
:root {
  /* Cores Institucionais */
  --primary: #5B7A5B;
  --primary-light: #7a9a7a;
  --primary-dark: #3d523d;
  --secondary: #1E3A5F;
  --secondary-light: #3a5a7f;
  --secondary-dark: #0f1d2f;
  --accent: #C41E3A;
  --accent-light: #e43e5a;
  
  /* Neutros */
  --white: #FFFFFF;
  --gray-50: #F9FAFB;
  --gray-100: #F3F4F6;
  --gray-200: #E5E7EB;
  --gray-300: #D1D5DB;
  --gray-400: #9CA3AF;
  --gray-500: #6B7280;
  --gray-600: #4B5563;
  --gray-700: #374151;
  --gray-800: #1F2937;
  --gray-900: #111827;
  
  /* Gradientes */
  --gradient-primary: linear-gradient(135deg, var(--secondary) 0%, var(--primary) 100%);
  --gradient-accent: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
  
  /* Sombras */
  --shadow-sm: 0 1px 2px rgba(30, 58, 95, 0.08);
  --shadow-md: 0 4px 12px rgba(30, 58, 95, 0.12);
  --shadow-lg: 0 8px 24px rgba(30, 58, 95, 0.16);
  --shadow-xl: 0 16px 40px rgba(30, 58, 95, 0.2);
  
  /* Bordas e Raio */
  --radius: 12px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  
  /* Transições */
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 0.5s ease;
}

/* ==================== LEADERSHIP SECTION ==================== */
.leadership-section {
  padding: clamp(3rem, 8vw, 5rem) 0;
  background: linear-gradient(180deg, var(--gray-50) 0%, var(--white) 50%, var(--gray-50) 100%);
  position: relative;
  overflow: hidden;
}

/* Elemento decorativo de fundo */
.leadership-section::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 120%;
  background: radial-gradient(ellipse, rgba(91, 122, 91, 0.08) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.leadership-section::after {
  content: '';
  position: absolute;
  bottom: -30%;
  left: -10%;
  width: 40%;
  height: 80%;
  background: radial-gradient(ellipse, rgba(30, 58, 95, 0.06) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* Container com padding responsivo */
.leadership-section .container {
  position: relative;
  z-index: 1;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 2rem);
}

/* ==================== SECTION TITLE ==================== */
.section-title {
  text-align: center;
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
}

.section-title h2 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1rem);
  flex-wrap: wrap;
  line-height: 1.2;
}

.section-title h2 i {
  color: var(--primary);
  font-size: clamp(1.5rem, 4vw, 2rem);
  flex-shrink: 0;
}

/* Linha decorativa abaixo do título */
.section-title h2::after {
  content: '';
  display: block;
  width: 100%;
  height: 4px;
  background: var(--gradient-primary);
  border-radius: 2px;
  margin-top: clamp(0.75rem, 2vw, 1rem);
}

.section-title p {
  color: var(--gray-600);
  font-size: clamp(1rem, 2.5vw, 1.15rem);
  line-height: 1.7;
  margin: clamp(1rem, 2vw, 1.5rem) auto 0;
  max-width: 650px;
}

/* ==================== TEAM GRID - FLEXBOX RESPONSIVO ==================== */
.team-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: stretch;
  gap: clamp(1.5rem, 4vw, 2.5rem);
  margin: 0 auto;
  max-width: 1200px;
}

/* ==================== TEAM CARD ==================== */
.team-card {
  flex: 1 1 clamp(260px, 30vw, 320px);
  max-width: clamp(280px, 95vw, 340px);
  min-width: 240px;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 4vw, 2rem);
  text-align: center;
  border: 2px solid var(--gray-200);
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* Barra superior com gradiente */
.team-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gradient-primary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-normal);
}

/* Efeitos de hover */
.team-card:hover {
  transform: translateY(-8px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary);
  z-index: 2;
}

.team-card:hover::before {
  transform: scaleX(1);
}

.team-card:hover .team-avatar {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(91, 122, 91, 0.35);
}

.team-card:hover .team-social a {
  transform: translateY(-3px);
}

/* ==================== TEAM AVATAR ==================== */
.team-avatar {
  width: clamp(90px, 22vw, 130px);
  height: clamp(90px, 22vw, 130px);
  min-width: 90px;
  min-height: 90px;
  border-radius: 50%;
  background: var(--gradient-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto clamp(1rem, 3vw, 1.5rem);
  border: 4px solid var(--white);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  position: relative;
  transition: var(--transition-normal);
  flex-shrink: 0;
}

/* Imagem dentro do avatar */
.team-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  transition: var(--transition-normal);
}

/* Placeholder com iniciais */
.team-avatar:not(:has(img[src])) {
  font-size: clamp(1.5rem, 5vw, 2.2rem);
  font-weight: 700;
  color: var(--white);
  text-transform: uppercase;
  letter-spacing: 2px;
}

/* ==================== CARD CONTENT ==================== */
.team-card h4 {
  font-size: clamp(1.1rem, 3.5vw, 1.35rem);
  font-weight: 700;
  color: var(--secondary);
  margin: 0 0 clamp(0.5rem, 1.5vw, 0.75rem);
  line-height: 1.3;
  width: 100%;
}

.team-card .role {
  color: var(--gray-600);
  font-size: clamp(0.9rem, 2.8vw, 1rem);
  font-weight: 500;
  margin: 0 0 clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.5;
  flex-grow: 1;
  width: 100%;
}

/* ==================== SOCIAL LINKS ==================== */
.team-social {
  display: flex;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 0.875rem);
  padding-top: clamp(1rem, 2.5vw, 1.25rem);
  border-top: 1px dashed var(--gray-300);
  width: 100%;
  margin-top: auto;
}

.team-social a {
  width: clamp(36px, 8vw, 42px);
  height: clamp(36px, 8vw, 42px);
  min-width: 36px;
  min-height: 36px;
  border-radius: 50%;
  background: var(--gray-100);
  color: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-normal);
  font-size: clamp(0.85rem, 2.5vw, 1rem);
  text-decoration: none;
}

.team-social a:hover {
  background: var(--gradient-primary);
  color: var(--white);
  transform: translateY(-4px) scale(1.08);
  box-shadow: var(--shadow-md);
}

.team-social a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ==================== DESTAQUE PARA DIRETOR GERAL ==================== */
.team-card:first-of-type {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--white) 0%, rgba(91, 122, 91, 0.06) 100%);
  box-shadow: 0 8px 20px rgba(91, 122, 91, 0.15);
}

.team-card:first-of-type .team-avatar {
  background: var(--gradient-primary);
  border-width: 5px;
  box-shadow: 0 10px 30px rgba(91, 122, 91, 0.4);
}

/* Badge "Direção" - visível apenas em desktop */
.team-card:first-of-type::after {
  content: 'Direção';
  position: absolute;
  top: 18px;
  right: -35px;
  background: var(--accent);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 45px;
  transform: rotate(45deg);
  text-transform: uppercase;
  letter-spacing: 1px;
  box-shadow: 0 3px 10px rgba(196, 30, 58, 0.3);
}

/* ==================== ANIMAÇÕES DE ENTRADA ==================== */
.team-card.animate {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp var(--transition-slow) forwards;
}

.team-card.animate:nth-child(1) { animation-delay: 0.1s; }
.team-card.animate:nth-child(2) { animation-delay: 0.25s; }
.team-card.animate:nth-child(3) { animation-delay: 0.4s; }

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==================== BREAKPOINTS RESPONSIVOS ==================== */

/* Tablet Landscape (992px) */
@media (max-width: 992px) {
  .team-card {
    flex: 1 1 45%;
    max-width: 310px;
  }
  
  .team-card:first-of-type::after {
    right: -30px;
    padding: 4px 40px;
    font-size: 0.65rem;
  }
}

/* Tablet Portrait (768px) */
@media (max-width: 768px) {
  .leadership-section {
    padding: clamp(2.5rem, 7vw, 4rem) 0;
  }
  
  .section-title h2 {
    flex-direction: column;
    text-align: center;
  }
  
  .section-title h2 i {
    margin-bottom: 0.25rem;
  }
  
  .team-grid {
    gap: clamp(1.25rem, 3vw, 2rem);
  }
  
  .team-card {
    flex: 1 1 100%;
    max-width: 100%;
    margin: 0 auto;
  }
  
  /* Esconder badge em mobile para melhor legibilidade */
  .team-card:first-of-type::after {
    display: none;
  }
  
  /* Adicionar indicador visual alternativo */
  .team-card:first-of-type {
    position: relative;
  }
  
  .team-card:first-of-type .role::before {
    content: '★ ';
    color: var(--accent);
    font-weight: 700;
  }
}

/* Mobile (480px) */
@media (max-width: 480px) {
  .leadership-section {
    padding: 2rem 0;
  }
  
  .section-title {
    margin-bottom: 2rem;
  }
  
  .section-title p {
    font-size: 0.95rem;
    padding: 0 0.5rem;
  }
  
  .team-card {
    padding: 1.25rem;
    border-radius: var(--radius);
  }
  
  .team-avatar {
    width: 100px;
    height: 100px;
    margin-bottom: 1rem;
    border-width: 3px;
  }
  
  .team-avatar:not(:has(img[src])) {
    font-size: 1.75rem;
  }
  
  .team-card h4 {
    font-size: 1.1rem;
  }
  
  .team-card .role {
    font-size: 0.9rem;
  }
  
  .team-social {
    gap: 0.625rem;
    padding-top: 1rem;
  }
  
  .team-social a {
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
  }
}

/* Mobile Extra Small (360px) */
@media (max-width: 360px) {
  .team-avatar {
    width: 85px;
    height: 85px;
    font-size: 1.4rem;
  }
  
  .team-card h4 {
    font-size: 1rem;
  }
  
  .team-card .role {
    font-size: 0.85rem;
  }
}

/* ==================== ACESSIBILIDADE ==================== */

/* Focus visível para navegação por teclado */
.team-card:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 4px;
  box-shadow: var(--shadow-lg), 0 0 0 4px rgba(91, 122, 91, 0.2);
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
  .team-card {
    border: 3px solid var(--secondary);
  }
  
  .team-card::before {
    height: 6px;
    background: var(--secondary);
  }
  
  .team-avatar {
    border: 4px solid var(--gray-900);
  }
  
  .team-card h4 {
    color: var(--gray-900);
  }
  
  .team-card .role {
    color: var(--gray-700);
  }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .team-card,
  .team-card::before,
  .team-card::after,
  .team-avatar,
  .team-social a {
    transition: none !important;
    transform: none !important;
  }
  
  .team-card.animate {
    opacity: 1;
    transform: none;
    animation: none;
  }
}

/* ==================== DARK MODE ==================== */
@media (prefers-color-scheme: dark) {
  .leadership-section {
    background: linear-gradient(180deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  }
  
  .team-card {
    background: #1e293b;
    border-color: #334155;
  }
  
  .team-card h4 {
    color: #f1f5f9;
  }
  
  .team-card .role {
    color: #94a3b8;
  }
  
  .team-card:first-of-type {
    background: linear-gradient(135deg, #1e293b 0%, rgba(91, 122, 91, 0.25) 100%);
    border-color: var(--primary);
  }
  
  .team-avatar {
    border-color: #1e293b;
  }
  
  .team-social a {
    background: #334155;
    color: var(--primary-light);
  }
  
  .team-social a:hover {
    background: var(--gradient-primary);
    color: var(--white);
  }
  
  .section-title h2 {
    color: #f1f5f9;
  }
  
  .section-title p {
    color: #cbd5e1;
  }
}

/* ==================== PRINT STYLES ==================== */
@media print {
  .leadership-section {
    padding: 2rem 0;
    background: var(--white);
  }
  
  .team-card {
    break-inside: avoid;
    box-shadow: none;
    border: 2px solid #000;
    padding: 1rem;
  }
  
  .team-avatar {
    border-color: #000;
  }
  
  .team-social {
    display: none;
  }
  
  .team-card::before,
  .team-card::after {
    display: none;
  }
}

/* ==================== UTILITÁRIOS ==================== */

/* Animação de pulse sutil no avatar do diretor */
.team-card:first-of-type .team-avatar {
  animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(91, 122, 91, 0.4);
  }
  50% {
    box-shadow: 0 10px 40px rgba(91, 122, 91, 0.6);
  }
}

/* Esconder pulse se reduced motion */
@media (prefers-reduced-motion: reduce) {
  .team-card:first-of-type .team-avatar {
    animation: none;
  }
}

/* Garantir que imagens carregadas não quebrem o layout */
.team-avatar img[style*="display: none"] + * {
  /* Se a imagem falhar, o placeholder de texto já aparece via onerror */
}

/* Smooth scroll para links internos */
html {
  scroll-behavior: smooth;
}