/* ====================== */
/* RESET Y ESTILOS BASE */
/* ====================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden; /* evita scroll horizontal por width:100vw */
}

body {
    font-family: Arial, sans-serif;
    display: flex;
    flex-direction: column;
}

.page-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.main-content {
    flex: 1;
    padding: 2rem;
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

/* ====================== */
/* FUENTES PERSONALIZADAS */
/* ====================== */
@font-face {
    font-family: 'Frankfrt';
    src: url('../fonts/frankfrt.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

/* ====================== */
/* COMPONENTES GENERALES */
/* ====================== */
.section-title {
    color: #000;
    text-align: left;
    margin: 2rem 0 1.5rem 0;
    font-size: 1.8rem;
    position: relative;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #9E009D;
}

.section-title2 {
    color: #000;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    position: relative;
}

.section-title2::after {
    content: '';
    display: block;
    width: 80px;
    height: 3px;
    background-color: #9E009D;
    margin: 0.5rem auto 0;
}

/* Botones */
.cta-button {
    display: inline-block;
    background-color: #9E009D;
    color: white;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: 2px solid #9E009D;
    font-size: 0.9rem;
}

.cta-button:hover {
    background-color: transparent;
    color: #9E009D;
}

.secondary-button {
    display: inline-block;
    background-color: transparent;
    color: #9E009D;
    padding: 0.8rem 1.5rem;
    border-radius: 50px;
    text-decoration: none;
    font-weight: bold;
    transition: all 0.3s;
    border: 2px solid #9E009D;
    margin-left: 1rem;
    font-size: 0.9rem;
}

.secondary-button:hover {
    background-color: #9E009D;
    color: white;
}

/* ====================== */
/* BLOQUE NOVEDADES + NOTICIAS */
/* ====================== */
.highlights-container {
    display: flex;
    gap: 2rem;
    margin-bottom: 3rem;
    flex-direction: column;
}

/* ====================== */
/* CARRUSEL DE NOVEDADES */
/* ====================== */
.news-carousel {
    flex: 0 0 100%;
    width: 100%;
}

#newsCarousel {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.carousel-inner { border-radius: 8px; }
.carousel-card { height: 100%; border: none; }

.carousel-card .card-img-top {
    height: 200px;
    object-fit: cover;
    width: 100%;
}

.carousel-card .card-body {
    padding: 1.2rem;
    background: white;
}

.carousel-card .card-title {
    color: #9E009D;
    font-size: 1.2rem;
    margin-bottom: 0.6rem;
    font-weight: 600;
    line-height: 1.3;
}

.carousel-card .card-text {
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
    font-size: 0.9rem;
}

.carousel-card .btn-primary {
    background-color: #9E009D;
    border-color: #9E009D;
    padding: 0.4rem 1.2rem;
    font-size: 0.9rem;
}

/* Controles carrusel */
.carousel-control-prev,
.carousel-control-next {
    width: 32px;
    height: 32px;
    top: 40%;
    background-color: rgba(158, 0, 157, 0.7);
    border-radius: 50%;
    opacity: 0.9;
}

.carousel-control-prev { left: 8px; }
.carousel-control-next { right: 8px; }

.carousel-control-prev-icon,
.carousel-control-next-icon {
    width: 0.8rem;
    height: 0.8rem;
}

.carousel-indicators {
    bottom: 10px;
    margin: 0;
}
.carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
    background-color: rgba(255,255,255,0.5);
    border: none;
}
.carousel-indicators button.active { background-color: white; }

/* ====================== */
/* ÚLTIMAS NOTICIAS */
/* ====================== */
.latest-news { flex: 0 0 100%; width: 100%; }
.latest-news-header {
    background: linear-gradient(to right, #9E009D, #c873c8);
    padding: 1rem 1.2rem;
    border-radius: 8px 8px 0 0;
}
.latest-news-header .section-title {
    color: white;
    font-size: 1.2rem;
    text-align: left;
    margin: 0;
    padding: 0;
    border: none;
}
.latest-news-content {
    background: white;
    padding: 1.2rem;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.news-item {
    margin-bottom: 1.2rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #eee;
}
.news-item:last-child { margin:0; padding:0; border:none; }
.news-date { color:#9E009D; font-size:.75rem; font-weight:600; margin-bottom:.3rem; }
.news-title { font-size:.9rem; color:#333; margin-bottom:.3rem; font-weight:600; line-height:1.3; }
.news-link { color:#9E009D; font-size:.8rem; text-decoration:none; display:inline-block; }

/* ====================== */
/* SECCIÓN DE SERVICIOS */
/* ====================== */
.features-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-bottom: 3rem;
}
.feature-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
    text-align: center;
}
.feature-icon { font-size:2rem; color:#9E009D; margin-bottom:1rem; }
.feature-card h3 { font-size:1.1rem; margin-bottom:0.8rem; }
.feature-card p { color:#555; font-size:.9rem; line-height:1.5; }

/* ====================== */
/* SECCIÓN DE CURSOS */
/* ====================== */
.cursos-section { padding: 2rem 0; }
.cursos-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    margin-top: 1.5rem;
}
.curso-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.1);
}
.curso-imagen { position: relative; height: 160px; overflow: hidden; }
.curso-imagen img { width:100%; height:100%; object-fit:cover; }
.curso-fecha {
    position: absolute;
    bottom: 8px; left: 8px;
    background: rgba(158,0,157,0.8);
    color: white;
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
}
.curso-content { padding: 1.2rem; }
.curso-content h3 { color:#9E009D; font-size:1.1rem; margin-bottom:.6rem; }
.curso-content p { color:#555; font-size:.9rem; line-height:1.5; margin-bottom:1rem; }
.ver-mas { color:#9E009D; font-weight:600; text-decoration:none; font-size:.8rem; }
.ver-todos { text-align:center; margin-top:2rem; }
.btn-ver-todos {
    display:inline-block;
    padding:.7rem 1.5rem;
    background:#9E009D;
    color:white;
    border-radius:50px;
    text-decoration:none;
    font-weight:600;
    font-size:.9rem;
}

/* ====================== */
/* SECCIÓN AFILIACIÓN FULL WIDTH */
/* ====================== */
.affiliate-section {
  background: #f2f2f2;          
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  width: 100vw;

  border-radius: 0;
  padding: 3rem 1.25rem;
  display: grid;
  place-items: center;
  text-align: center;

  margin-top: 0;
  margin-bottom: 0;
}

.affiliate-container { max-width: 1200px; width:100%; margin:0 auto; }
.affiliate-title { color:#9E009D; font-size:1.5rem; margin-bottom:1rem; position:relative; display:inline-block; }
.affiliate-title::after {
    content:''; display:block; width:60px; height:3px;
    background:#9E009D; margin:.8rem auto 0;
}
.affiliate-description { color:#555; font-size:.95rem; line-height:1.5; margin:0 auto 1.5rem; max-width:90%; }
.affiliate-highlights { display:flex; flex-direction:column; gap:1.5rem; margin:2rem 0; }
.highlight-item {
    background:white;
    padding:1.5rem;
    border-radius:8px;
    box-shadow:0 3px 10px rgba(0,0,0,0.05);
    border-top:3px solid #9E009D;
    text-align:center;
    max-width:100%;
    margin:0 auto;
}
.highlight-item i { font-size:2rem; color:#9E009D; margin-bottom:1rem; display:block; }
.highlight-item h4 { font-size:1.1rem; margin-bottom:.5rem; color:#333; }
.highlight-item p { color:#666; font-size:.9rem; line-height:1.5; }
.affiliate-cta { display:flex; flex-direction:column; gap:1rem; align-items:center; margin-top:1.5rem; }
.cta-button, .secondary-button {
    width:100%; max-width:280px; text-align:center;
    justify-content:center; padding:.8rem; margin:0; font-size:.95rem;
}

/* ====================== */
/* MEDIA QUERIES */
/* ====================== */
@media (min-width: 768px) {
    .affiliate-section { padding:2rem; }
    .affiliate-title { font-size:1.8rem; }
    .affiliate-description { font-size:1rem; max-width:80%; }
    .affiliate-highlights { flex-direction:row; flex-wrap:wrap; justify-content:center; }
    .highlight-item { flex:0 0 calc(50% - 1rem); max-width:calc(50% - 1rem); }
    .affiliate-cta { flex-direction:row; justify-content:center; }
    .cta-button, .secondary-button { width:auto; padding:0.8rem 1.8rem; }
    .secondary-button { margin-left:1rem; }
}
@media (min-width: 992px) {
    .affiliate-section { padding:3rem 2rem; }
    .affiliate-title { font-size:2.2rem; }
    .affiliate-description { font-size:1.1rem; max-width:700px; }
    .highlight-item { flex:0 0 calc(33.333% - 1.5rem); max-width:calc(33.333% - 1.5rem); padding:2rem 1.5rem; }
    .highlight-item i { font-size:2.2rem; }
    .highlight-item h4 { font-size:1.2rem; }
    .highlight-item p { font-size:.95rem; }
}

/* Layout general */
@media (min-width: 768px) {
    .highlights-container { flex-direction: row; }
    .news-carousel { flex:0 0 68%; }
    .latest-news { flex:0 0 30%; }
    .carousel-card .card-img-top { height: 280px; }
    .carousel-control-prev, .carousel-control-next { width:40px; height:40px; }
    .features-grid { grid-template-columns: repeat(3,1fr); }
    .cursos-grid { grid-template-columns: repeat(3,1fr); }
    .affiliate-highlights { grid-template-columns: repeat(3,1fr); }
    .affiliate-cta { flex-direction:row; justify-content:center; }
}
@media (min-width: 992px) {
    .carousel-card .card-body { padding:1.5rem; }
    .carousel-card .card-title { font-size:1.4rem; }
    .carousel-card .card-text { font-size:1rem; }
    .feature-card { padding:2rem; }
    .affiliate-section { padding:3rem; }
}

/* ====================== */
/* ELLIPSIS PARA TEXTOS LARGOS */
/* ====================== */
.carousel-card .card-text,
.news-title,
.curso-content p,
.curso-content h3,
.feature-card p {
    display:-webkit-box;
    -webkit-box-orient: vertical;
    overflow:hidden;
    text-overflow:ellipsis;
}
.carousel-card .card-text { -webkit-line-clamp:3; min-height:4.5em; }
.news-title { -webkit-line-clamp:2; min-height:2.6em; }
.curso-content p { -webkit-line-clamp:3; min-height:4.5em; }
.curso-content h3 { -webkit-line-clamp:2; min-height:2.6em; }
.feature-card p { -webkit-line-clamp:3; min-height:4.5em; }
