/*
 Theme Name: GeneratePress Child
 Theme URI: https://cursin.net
 Description: Tema hijo para Cursin
 Author: Cursin
 Author URI: https://cursin.net
 Template: generatepress
 Version: 1.0
*/

/* =========================================================
   VARIABLES BASE – CURSIN.NET
   ========================================================= */

:root {
  --cursin-primary: #3563E9;
  --cursin-primary-dark: #1F3FB8;
  --cursin-accent: #5BB2E3;

  --cursin-bg: #F6F8FC;
  --cursin-border: #E3E7EE;

  --cursin-text: #1F2933;
  --cursin-text-muted: #5F6C7B;

  --cursin-white: #FFFFFF;
}

/* =========================================================
   CONTENEDOR GLOBAL – CENTRADO REAL
   ========================================================= */

.site-main,
.home-cursin,
.page-cursos,
.archive-cursos,
.taxonomy-tema,
.taxonomy-plataforma,
.taxonomy-institucion {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
  box-sizing: border-box;
}

/* Evitar scroll horizontal */
html,
body {
  overflow-x: hidden;
}

/* =========================================================
   HOME – HERO + BUSCADOR
   ========================================================= */

.home-hero {
  background: var(--cursin-bg);
  padding: 3rem 1rem;
  text-align: center;
}

.home-hero h1 {
  font-size: 2rem;
  margin-bottom: 0.75rem;
  color: var(--cursin-text);
}

.home-hero p {
  color: var(--cursin-text-muted);
  margin-bottom: 1.5rem;
}

/* Buscador */
.home-search {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.home-search input[type="search"] {
  width: 100%;
  padding: 0.7rem;
  border-radius: 6px;
  border: 1px solid var(--cursin-border);
}

.home-search button {
  width: 100%;
  background: var(--cursin-primary);
  color: #fff;
  border: none;
  padding: 0.75rem;
  border-radius: 6px;
  font-weight: 600;
}

/* Escritorio */
@media (min-width: 768px) {
  .home-search {
    flex-direction: row;
  }

  .home-search button {
    width: auto;
    padding: 0 1.5rem;
  }
}

/* =========================================================
   HOME – CATEGORÍAS
   ========================================================= */

.home-temas {
  padding: 3rem 0;
}

.tema-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 1rem;
  margin-top: 1.5rem;
  justify-content: center;
}

.tema-card {
  background: var(--cursin-white);
  border: 1px solid var(--cursin-border);
  padding: 1rem;
  border-radius: 8px;
  text-align: center;
  text-decoration: none;
  color: var(--cursin-text);
  font-weight: 600;
}

.tema-card:hover {
  border-color: var(--cursin-primary);
}

/* =========================================================
   TARJETAS DE CURSO – GRID GLOBAL
   ========================================================= */

.curso-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.5rem;
  margin-top: 2rem;
  justify-content: center;
}

.curso-card {
  background: var(--cursin-white);
  border: 1px solid var(--cursin-border);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  will-change: transform;
}

.curso-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.curso-card a {
  display: block;
  height: 100%;
  text-decoration: none;
  color: inherit;
}

.curso-thumb img {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
}

.curso-card h2,
.curso-card h3 {
  font-size: 0.95rem;
  line-height: 1.4;
  padding: 0.75rem 0.9rem 1rem;
  margin: 0;
  color: var(--cursin-text);
}

/* Accesibilidad */
.curso-card a:focus-visible {
  outline: 3px solid var(--cursin-accent);
  outline-offset: 3px;
}

/* =========================================================
   SINGLE CURSO – FICHA
   ========================================================= */

.curso-meta {
  background: var(--cursin-bg);
  border: 1px solid var(--cursin-border);
  border-radius: 10px;
  padding: 1.25rem;
  margin: 3rem auto 2.25rem;
  max-width: 720px;
}

.curso-meta h2 {
  font-size: 1.15rem;
  margin-bottom: 0.75rem;
  color: var(--cursin-primary-dark);
}

.curso-meta ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.curso-meta li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem;
  font-size: 0.92rem;
  line-height: 1.5;
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--cursin-border);
  color: var(--cursin-text-muted);
}

.curso-meta li:last-child {
  border-bottom: none;
}

.curso-meta strong {
  color: var(--cursin-text);
  font-weight: 600;
  min-width: 150px;
}

.curso-meta a {
  color: var(--cursin-primary);
  text-decoration: none;
}

.curso-meta a:hover {
  text-decoration: underline;
}

/* =========================================================
   CTA – BOTÓN
   ========================================================= */

.curso-cta {
  margin: 2rem 0 2.75rem;
  text-align: center;
}

.curso-boton {
  display: inline-block;
  background: var(--cursin-primary);
  color: var(--cursin-white);
  padding: 0.75rem 1.6rem;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
}

.curso-boton:hover {
  background: var(--cursin-primary-dark);
}

.curso-boton:focus {
  outline: 3px solid var(--cursin-accent);
  outline-offset: 3px;
}

/* =========================================================
   TAXONOMÍAS – HEADER + PAGINACIÓN
   ========================================================= */

.taxonomy-header {
  padding: 2.5rem 0 1.5rem;
  text-align: center;
}

.taxonomy-header h1 {
  font-size: 1.8rem;
  margin-bottom: 0.5rem;
}

.pagination {
  margin: 2.5rem 0;
  text-align: center;
}

/* =========================================================
   LOGO – CLS SAFE
   ========================================================= */

.header-image.is-logo-image {
  width: 140px;
  height: 140px;
  aspect-ratio: 1 / 1;
  display: block;
}

@media (max-width: 768px) {
  .header-image.is-logo-image {
    width: 110px;
    height: 110px;
  }
}

/* =========================================================
   FOOTER
   ========================================================= */

.site-info {
  display: none;
}


/* =========================================================
   FIX 1: BOTÓN "VER TODOS LOS CURSOS" – ESPACIADO
   ========================================================= */

.home-ver-todos {
  margin-top: 3rem;   /* separación clara del grid */
  text-align: center;
}

.home-ver-todos a,
.home-ver-todos button {
  display: inline-block;
  margin-top: 0;
}


/* =========================================================
   FIX 2: ESPACIO EN BLANCO LATERAL (GENERATEPRESS)
   ========================================================= */

/* Forzar ancho real del contenido */
.site-main {
  width: 100%;
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

/* Neutralizar wrappers internos de GeneratePress */
.inside-article,
.inside-page,
.inside-header,
.inside-site-info {
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
  padding-left: 0;
  padding-right: 0;
}



/* Evitar cualquier overflow lateral residual */
body,
#page {
  overflow-x: hidden;
}



/* =========================================================
   FIX HEADER – RESTAURAR ESPACIADO GENERATEPRESS
   ========================================================= */

/* Devolver control al header */
.inside-header {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1.5rem;
  padding-right: 1.5rem;
}

/* Asegurar alineación correcta del menú */
.main-navigation {
  max-width: 100%;
}

/* Evitar que el header herede reglas del contenido */
.site-header {
  overflow: visible;
}

