/* ========================================
   BIF - Brigada de Instrucción Forestal
   Estilos compartidos
   ======================================== */

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --green-dark: #1a3a0a;
  --green-primary: #2d5016;
  --green-medium: #4a7c2e;
  --green-light: #6b9b4a;
  --green-pale: #e8f0e0;
  --earth: #8B7355;
  --earth-light: #a89279;
  --earth-pale: #f0ebe3;
  --cream: #faf8f5;
  --white: #ffffff;
  --gray-900: #1a1a1a;
  --gray-700: #333333;
  --gray-500: #666666;
  --gray-300: #999999;
  --gray-100: #e5e5e5;
  --orange-accent: #d4772c;
  --orange-light: #f0a050;
  --red-alert: #c0392b;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg: 0 8px 30px rgba(0,0,0,0.12);
  --radius-sm: 6px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --transition: 0.3s ease;
  --max-width: 1200px;
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  color: var(--gray-700);
  background: var(--cream);
  line-height: 1.7;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--green-medium); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--green-dark); }

h1, h2, h3, h4 { color: var(--green-dark); line-height: 1.3; font-weight: 700; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.4rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.6rem); }

.container { max-width: var(--max-width); margin: 0 auto; padding: 0 24px; }

/* --- Header & Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--gray-100);
  transition: box-shadow var(--transition);
}

.site-header.scrolled { box-shadow: var(--shadow-md); }

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--green-dark);
  text-decoration: none;
}

.logo-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.logo-icon {
  width: 44px;
  height: 44px;
  background: var(--green-primary);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 900;
  font-size: 0.9rem;
  letter-spacing: -0.5px;
}

.logo-text span { color: var(--green-medium); font-weight: 400; font-size: 0.75rem; display: block; margin-top: -4px; }

.nav-menu {
  display: flex;
  list-style: none;
  gap: 4px;
  align-items: center;
}

.nav-menu a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--gray-700);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
}

.nav-menu a:hover,
.nav-menu a.active {
  background: var(--green-pale);
  color: var(--green-dark);
}

.nav-menu .nav-cta {
  background: var(--green-primary);
  color: white;
  margin-left: 8px;
}

.nav-menu .nav-cta:hover {
  background: var(--green-dark);
  color: white;
}

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--green-dark);
}

.mobile-toggle svg { width: 28px; height: 28px; }

/* --- Mobile Nav --- */
@media (max-width: 900px) {
  .mobile-toggle { display: flex; }

  .nav-menu {
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    flex-direction: column;
    padding: 24px;
    gap: 8px;
    transform: translateX(100%);
    transition: transform var(--transition);
    overflow-y: auto;
  }

  .nav-menu.open { transform: translateX(0); }

  .nav-menu a {
    font-size: 1.1rem;
    padding: 14px 16px;
    width: 100%;
  }

  .nav-menu .nav-cta { margin-left: 0; text-align: center; margin-top: 8px; }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 72px;
  background: linear-gradient(145deg, var(--green-dark) 0%, var(--green-primary) 40%, var(--green-medium) 100%);
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.hero-content {
  position: relative;
  z-index: 2;
  text-align: center;
  color: white;
  max-width: 800px;
  padding: 60px 24px;
}

.hero h1 {
  color: white;
  margin-bottom: 20px;
  font-size: clamp(2.2rem, 5.5vw, 3.5rem);
  text-shadow: 0 2px 20px rgba(0,0,0,0.2);
}

.hero p {
  font-size: clamp(1rem, 2.2vw, 1.25rem);
  opacity: 0.92;
  max-width: 600px;
  margin: 0 auto 36px;
  line-height: 1.8;
}

.hero-buttons { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; }

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: all var(--transition);
  border: 2px solid transparent;
  text-decoration: none;
}

.btn-primary {
  background: var(--orange-accent);
  color: white;
  border-color: var(--orange-accent);
}

.btn-primary:hover {
  background: #b8631f;
  border-color: #b8631f;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(212,119,44,0.4);
}

.btn-secondary {
  background: transparent;
  color: white;
  border-color: rgba(255,255,255,0.6);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.15);
  border-color: white;
  color: white;
}

.btn-outline {
  background: transparent;
  color: var(--green-primary);
  border-color: var(--green-primary);
}

.btn-outline:hover {
  background: var(--green-primary);
  color: white;
}

.btn-green {
  background: var(--green-primary);
  color: white;
}

.btn-green:hover {
  background: var(--green-dark);
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 15px rgba(45,80,22,0.3);
}

.btn-sm { padding: 10px 20px; font-size: 0.9rem; }
.btn-lg { padding: 16px 36px; font-size: 1.1rem; }

/* --- Sections --- */
.section {
  padding: 80px 0;
}

.section-alt { background: var(--white); }
.section-green { background: var(--green-dark); color: white; }
.section-green h2, .section-green h3 { color: white; }
.section-earth { background: var(--earth-pale); }

.section-header {
  text-align: center;
  margin-bottom: 50px;
}

.section-header h2 { margin-bottom: 14px; }

.section-header p {
  color: var(--gray-500);
  font-size: 1.1rem;
  max-width: 650px;
  margin: 0 auto;
}

.section-green .section-header p { color: rgba(255,255,255,0.8); }

/* --- Stats Row --- */
.stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 32px;
  margin: 50px 0;
}

.stat-item {
  text-align: center;
  padding: 24px;
}

.stat-number {
  font-size: 2.8rem;
  font-weight: 800;
  color: var(--green-primary);
  line-height: 1;
  margin-bottom: 8px;
}

.section-green .stat-number { color: var(--orange-light); }

.stat-label {
  font-size: 0.95rem;
  color: var(--gray-500);
  font-weight: 500;
}

.section-green .stat-label { color: rgba(255,255,255,0.7); }

/* --- Cards --- */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 28px;
}

.card {
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
  border: 1px solid var(--gray-100);
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-4px);
}

.card-img {
  height: 200px;
  background: linear-gradient(135deg, var(--green-medium), var(--green-dark));
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.3);
  font-size: 3rem;
}

.card-body { padding: 24px; }
.card-body h3 { margin-bottom: 10px; font-size: 1.2rem; }
.card-body p { color: var(--gray-500); font-size: 0.95rem; line-height: 1.6; }

.card-meta {
  display: flex;
  gap: 16px;
  margin-top: 14px;
  font-size: 0.85rem;
  color: var(--gray-300);
}

.card-meta span { display: flex; align-items: center; gap: 4px; }

.card-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--gray-100);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- Tags / Badges --- */
.badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 50px;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-green { background: var(--green-pale); color: var(--green-primary); }
.badge-orange { background: #fef0e0; color: var(--orange-accent); }
.badge-earth { background: var(--earth-pale); color: var(--earth); }

/* --- Course Card Specific --- */
.course-card { border-left: 4px solid var(--green-medium); }
.course-card.cerrado { border-left-color: var(--earth); }

.course-details {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}

.course-detail {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.88rem;
  color: var(--gray-500);
}

.course-detail svg { width: 16px; height: 16px; color: var(--green-medium); flex-shrink: 0; }

.course-dates {
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-top: 16px;
}

.course-dates h4 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--green-primary);
  margin-bottom: 10px;
}

.date-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  font-size: 0.9rem;
  border-bottom: 1px solid rgba(45,80,22,0.1);
}

.date-row:last-child { border-bottom: none; }

/* --- Testimonials --- */
.testimonials-band {
  overflow: hidden;
  position: relative;
}

.testimonial-card {
  background: white;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
}

.testimonial-card blockquote {
  font-style: italic;
  font-size: 1.05rem;
  color: var(--gray-700);
  line-height: 1.7;
  margin-bottom: 16px;
  position: relative;
  padding-left: 24px;
}

.testimonial-card blockquote::before {
  content: '\201C';
  position: absolute;
  left: 0;
  top: -4px;
  font-size: 2.5rem;
  color: var(--green-light);
  font-family: Georgia, serif;
  line-height: 1;
}

.testimonial-author {
  font-weight: 600;
  color: var(--green-dark);
  font-size: 0.9rem;
}

.testimonial-role {
  color: var(--gray-300);
  font-size: 0.85rem;
}

/* --- Caso de éxito --- */
.caso-exito-card {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 0;
  background: white;
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
}

.caso-exito-card .card-img { height: 100%; min-height: 200px; }

@media (max-width: 700px) {
  .caso-exito-card { grid-template-columns: 1fr; }
}

/* --- Team --- */
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 28px;
}

.team-member {
  text-align: center;
  padding: 32px 20px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  transition: all var(--transition);
}

.team-member:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.team-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--green-medium), var(--green-dark));
  margin: 0 auto 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.5);
  font-size: 2rem;
}

.team-member h3 { font-size: 1.1rem; margin-bottom: 4px; }
.team-member .role-title { color: var(--green-medium); font-size: 0.85rem; font-weight: 600; margin-bottom: 4px; }
.team-member .role { color: var(--gray-300); font-size: 0.85rem; line-height: 1.5; }

/* Team photo: enmarcada, encuadre de retrato */
.team-photo-wrap {
  width: 140px;
  height: 160px;
  border-radius: var(--radius-md);
  overflow: hidden;
  margin: 0 auto 18px;
  border: 3px solid var(--green-pale);
  box-shadow: var(--shadow-sm);
}

.team-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
  display: block;
}

/* --- Map --- */
.map-container {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--gray-100);
}

#map { height: 500px; width: 100%; }

.brigada-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-top: 40px;
}

.brigada-item {
  display: flex;
  gap: 16px;
  padding: 20px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  transition: all var(--transition);
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}

.brigada-item:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  color: inherit;
}

.brigada-marker {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--green-pale);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--green-primary);
}

.brigada-item h3 { font-size: 1rem; margin-bottom: 4px; }
.brigada-item p { font-size: 0.85rem; color: var(--gray-500); }

.brigada-cert {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--green-medium);
  margin-top: 6px;
}

/* --- Brigade Page --- */
.brigada-hero {
  margin-top: 72px;
  padding: 60px 0;
  background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
  color: white;
}

.brigada-hero h1 { color: white; margin-bottom: 8px; }
.brigada-hero p { opacity: 0.85; }

.brigada-info-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
  margin-top: 40px;
}

@media (max-width: 768px) {
  .brigada-info-grid { grid-template-columns: 1fr; }
}

.brigada-sidebar {
  background: white;
  border-radius: var(--radius-md);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  height: fit-content;
  position: sticky;
  top: 96px;
}

.sidebar-item {
  padding: 14px 0;
  border-bottom: 1px solid var(--gray-100);
}

.sidebar-item:last-child { border-bottom: none; }
.sidebar-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-300); margin-bottom: 4px; }
.sidebar-value { font-weight: 600; color: var(--gray-700); }

/* --- Sponsors --- */
.sponsors-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 40px;
}

.sponsor-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px 24px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--gray-100);
  background: white;
  transition: all 0.2s ease;
  text-decoration: none;
}
.sponsor-logo:hover {
  border-color: var(--green-medium);
  box-shadow: var(--shadow-sm);
  transform: translateY(-2px);
}
.sponsor-logo img {
  height: 48px;
  width: auto;
  max-width: 180px;
  object-fit: contain;
  display: block;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.sponsor-logo:hover img {
  opacity: 1;
}

/* --- Forms --- */
.form-group { margin-bottom: 20px; }

.form-group label {
  display: block;
  margin-bottom: 6px;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--gray-700);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px 16px;
  border: 2px solid var(--gray-100);
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-family: inherit;
  transition: border-color var(--transition);
  background: white;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--green-medium);
}

.form-group textarea { resize: vertical; min-height: 120px; }

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* --- Collaboration Section --- */
.collab-ways {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.collab-card {
  padding: 32px 24px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--gray-100);
  text-align: center;
  transition: all var(--transition);
}

.collab-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.collab-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  background: var(--green-pale);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
}

.collab-card h3 { margin-bottom: 10px; font-size: 1.1rem; }
.collab-card p { font-size: 0.92rem; color: var(--gray-500); }

/* --- Footer --- */
.site-footer {
  background: var(--green-dark);
  color: rgba(255,255,255,0.8);
  padding: 60px 0 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
  margin-bottom: 40px;
}

@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}

.footer-brand p { font-size: 0.9rem; line-height: 1.7; margin-top: 12px; }

.site-footer h4 {
  color: white;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 16px;
}

.footer-links { list-style: none; }

.footer-links li { margin-bottom: 10px; }

.footer-links a {
  color: rgba(255,255,255,0.7);
  font-size: 0.9rem;
  transition: color var(--transition);
}

.footer-links a:hover { color: white; }

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.5);
}

/* --- Page Hero (inner pages) --- */
.page-hero {
  margin-top: 72px;
  padding: 60px 0;
  background: linear-gradient(135deg, var(--green-dark), var(--green-primary));
  color: white;
  text-align: center;
}

.page-hero h1 { color: white; margin-bottom: 12px; }
.page-hero p { opacity: 0.85; font-size: 1.1rem; max-width: 600px; margin: 0 auto; }

/* --- Utility --- */
.text-center { text-align: center; }
.mt-20 { margin-top: 20px; }
.mt-40 { margin-top: 40px; }
.mb-20 { margin-bottom: 20px; }
.mb-40 { margin-bottom: 40px; }

/* --- Segments Grid (for capacitaciones) --- */
.segments-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 24px;
}

.segment-card {
  padding: 32px;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  border-top: 4px solid var(--green-medium);
  transition: all var(--transition);
}

.segment-card:hover { box-shadow: var(--shadow-md); transform: translateY(-3px); }

.segment-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 16px;
  background: var(--green-pale);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--green-primary);
  font-size: 1.5rem;
}

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

.fade-in-up {
  opacity: 0;
  animation: fadeInUp 0.6s ease forwards;
}

.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

/* --- Print --- */
@media print {
  .site-header, .site-footer, .mobile-toggle { display: none; }
  .hero { min-height: auto; }
  body { font-size: 12pt; }
}
