/* ==========================================================================
   MODERN CAROUSEL (Estilo Shareholder Reports)
   ========================================================================== */

:root {
  --mc-foreground: #191c1e;
  --mc-card: #ffffff;
  --mc-border: #e1e2e4;
  --mc-muted: #f2f4f6;
  --mc-primary: #5F5078;
}

.mc-section {
  width: 100%;
  max-width: 80rem; /* max-w-7xl */
  margin: 0 auto;
  padding-top: 2rem;
  padding-bottom: 2rem;
  font-family: 'Inter', sans-serif;
}

/* Header adjustments */
.mc-header {
  display: flex;
  align-items: center;
  /* Centrar los botones y darles espacio */
  justify-content: flex-end;
  padding: 0 12px;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .mc-header {
    padding: 0 12px;
  }
}

/* Base Título */
.mc-title {
  font-size: 1.5rem; /* text-2xl */
  font-weight: 600;
  letter-spacing: -0.025em;
  color: var(--mc-foreground, #191c1e);
  margin: 0;
}

/* Controls */
.mc-controls {
  display: none;
  align-items: center;
  gap: 0.5rem;
}

@media (min-width: 640px) {
  .mc-controls {
    display: flex;
  }
}

.mc-btn {
  padding: 0.5rem;
  border-radius: 9999px;
  border: 1px solid var(--mc-border);
  background-color: var(--mc-card);
  color: var(--mc-foreground);
  transition: opacity 0.3s, background-color 0.3s;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mc-btn:hover:not(:disabled) {
  background-color: var(--mc-muted);
}

.mc-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Scroll Container */
.mc-scroll-container {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  -ms-overflow-style: none;  /* IE and Edge */
  scrollbar-width: none;  /* Firefox */
  /* Remove flex gap. We use internal padding for grids to be mathematically precise without overflow */
  margin: 0 -8px; /* Offset the 8px padding of children */
  /* Extra bottom padding to prevent strict shadow clipping */
  padding: 0 0 5rem 0;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.mc-scroll-container::-webkit-scrollbar {
  display: none;
}

@media (min-width: 640px) {
  .mc-scroll-container {
    /* Offset 12px padding of children to flush align with edges */
    margin: 0 -12px;
    padding: 0 0 5rem 0;
  }
}

/* Card Wrapper - Used as structural column */
.mc-card-wrapper {
  flex: 0 0 100%;
  max-width: 100%;
  scroll-snap-align: start;
  /* El "gap" visual se inyecta como padding interno */
  padding: 0 8px;
}

@media (min-width: 640px) {
  .mc-card-wrapper {
    /* 3 columnas fijas. Matematica infalible. */
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 12px;
  }
}

@media (min-width: 1024px) {
  .mc-card-wrapper {
    /* EXACTAMENTE 4 columnas (100 / 4 = 25). Matematica infalible sin asomos. */
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 12px;
  }
}

.mc-card {
  cursor: pointer;
  text-decoration: none;
  display: block;
}
.mc-card:hover { text-decoration: none; }

.mc-graphic {
  position: relative;
  overflow: hidden;
  border-radius: 0.5rem;
  background-color: var(--mc-card);
  border: 1px solid var(--mc-border);
  margin-bottom: 0;
  transition: all 0.3s ease-in-out;
  /* Sombra base suave para integrarse con la UI y tener un estado natural idéntico a noticias */
  box-shadow: 0px 12px 32px rgba(25, 28, 30, 0.06);
}

.mc-card:hover .mc-graphic {
  /* Misma sombra EXACTA del bloque de Noticias en estado :hover */
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
}

.mc-graphic img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease-out;
}

.mc-card:hover .mc-graphic img {
  transform: scale(1.15); /* Mismo zoom de .noticia-card:hover img */
}

@media (min-width: 640px) {
  .mc-graphic img {
    height: 380px;
  }
}

/* Gradient Overlay */
.mc-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6) 0%, transparent 100%);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: white;
}

.mc-overlay-tag {
  font-size: 0.75rem; /* text-xs */
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.25rem;
}

.mc-overlay-period {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.8);
  margin: 0;
}

.mc-overlay-subtitle {
  font-size: 0.875rem; /* text-sm */
  font-weight: 500;
  margin: 0;
}

/* Card Footer */
.mc-footer {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.mc-footer-title {
  font-weight: 600;
  color: var(--mc-foreground);
  font-size: 0.875rem;
  margin: 0;
  /* limit to 2 lines */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

@media (min-width: 640px) {
  .mc-footer-title {
    font-size: 1rem;
  }
}
