/* ═══════════════════════════════════════════════════════════════
   Grid Cursos — CSS Grid nativo, ligero y responsive
   ═══════════════════════════════════════════════════════════════ */

/* ─── Variables ────────────────────────────────────────────── */
:root {
    --gc-gap: 1.25rem;
    --gc-radius: 0.25rem;
    --gc-shadow: 0 2px 8px rgba(0,0,0,.08);
    --gc-shadow-hover: 0 8px 24px rgba(0,0,0,.14);
    --gc-transition: .25s ease;
    --gc-font: inherit;
    --gc-badge-bg: rgba(0,0,0,.65);
    --gc-badge-color: #fff;
}

/* ─── Wrapper ──────────────────────────────────────────────── */
.gc-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    font-family: var(--gc-font);
}

/* ─── Filtros ──────────────────────────────────────────────── */
.gc-filtros {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.75rem;
    padding: 0.25rem;
}

.gc-filtro {
    appearance: none;
    border: 2px solid #ddd;
    background: #fff;
    color: #333;
    padding: 0.5rem 1.25rem;
    border-radius: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--gc-transition);
    line-height: 1.4;
    white-space: nowrap;
}

.gc-filtro:hover {
    border-color: #999;
    background: #f5f5f5;
}

.gc-filtro--activo {
    background: #333;
    color: #fff;
    border-color: #333;
}

/* Color corporativo dinámico (aplicado via JS) */
.gc-filtro--activo[data-color] {
    /* --gc-filtro-color se aplica vía JS */
    background: var(--gc-filtro-color, #333);
    border-color: var(--gc-filtro-color, #333);
    color: #fff;
}

/* ─── Grid ─────────────────────────────────────────────────── */
.gc-grid {
    display: grid;
    grid-template-columns: repeat(var(--gc-cols, 4), 1fr);
    gap: var(--gc-gap);
    min-height: 120px;
}

/* ─── Card ─────────────────────────────────────────────────── */
.gc-card {
    background: #fff;
    border-radius: var(--gc-radius);
    overflow: hidden;
    box-shadow: var(--gc-shadow);
    transition: transform var(--gc-transition), box-shadow var(--gc-transition);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

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

/* Thumbnail wrapper */
.gc-card__thumb {
    display: block;
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: #e9ecef;
    text-decoration: none;
    color: inherit;
}

.gc-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform var(--gc-transition);
}

.gc-card:hover .gc-card__thumb img {
    transform: scale(1.04);
}

/* Placeholder sin imagen */
.gc-card__thumb--empty {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #dee2e6;
}

.gc-card__thumb--empty::after {
    content: '';
    width: 48px;
    height: 48px;
    background: #adb5bd;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-7 3a2.5 2.5 0 110 5 2.5 2.5 0 010-5zM5 19l3.5-4.5 2.5 3L14.5 13 19 19H5z'/%3E%3C/svg%3E") center / contain no-repeat;
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'%3E%3Cpath d='M19 3H5a2 2 0 00-2 2v14a2 2 0 002 2h14a2 2 0 002-2V5a2 2 0 00-2-2zm-7 3a2.5 2.5 0 110 5 2.5 2.5 0 010-5zM5 19l3.5-4.5 2.5 3L14.5 13 19 19H5z'/%3E%3C/svg%3E") center / contain no-repeat;
    opacity: 0.5;
}

/* Badges sobreimpresos en thumbnail */
.gc-card__badges {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 0.375rem;
    padding: 0.5rem;
    background: linear-gradient(transparent, rgba(0,0,0,.45));
    flex-wrap: wrap;
}

.gc-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    background: var(--gc-badge-bg);
    color: var(--gc-badge-color);
    font-size: 0.75rem;
    font-weight: 500;
    padding: 0.2rem 0.55rem;
    border-radius: 0.25rem;
    line-height: 1.4;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.gc-badge svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    fill: currentColor;
}

/* Body */
.gc-card__body {
    padding: 0.875rem 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.gc-card__titulo {
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.35;
    margin: 0;
    color: #1a1a1a;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.gc-card__titulo a {
    color: inherit;
    text-decoration: none;
}

.gc-card__titulo a:hover {
    text-decoration: underline;
}

/* Color accent (barra entre imagen y texto) */
.gc-card__accent {
    height: 3px;
    background: var(--gc-card-color, transparent);
}

/* ─── Título contextual ────────────────────────────────────── */
.gc-titulo-seccion {
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 1.25rem;
    padding-left: 0.75rem;
    border-left: 4px solid #333;
    line-height: 1.3;
}

/* ─── Botón cargar más ─────────────────────────────────────── */
.gc-paginacion {
    text-align: center;
    margin-top: 1.5rem;
}

.gc-cargar-mas {
    appearance: none;
    background: #333;
    color: #fff;
    border: none;
    padding: 0.7rem 2rem;
    border-radius: 2rem;
    font-size: 0.9375rem;
    font-weight: 500;
    cursor: pointer;
    transition: background var(--gc-transition), transform var(--gc-transition);
}

.gc-cargar-mas:hover {
    background: #555;
    transform: translateY(-1px);
}

.gc-cargar-mas:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ─── Estado vacío ─────────────────────────────────────────── */
.gc-vacio {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem 1rem;
    color: #888;
    font-size: 0.9375rem;
}

/* ─── Skeleton / Loading ───────────────────────────────────── */
.gc-card--skeleton {
    pointer-events: none;
}

.gc-card--skeleton .gc-card__thumb {
    background: #e9ecef;
}

.gc-skel-line {
    border-radius: 4px;
    background: linear-gradient(90deg, #e9ecef 25%, #f1f3f5 50%, #e9ecef 75%);
    background-size: 200% 100%;
    animation: gc-shimmer 1.4s ease-in-out infinite;
}

.gc-skel-line--title {
    height: 1rem;
    width: 80%;
    margin-bottom: 0.5rem;
}

.gc-skel-line--meta {
    height: 0.75rem;
    width: 50%;
}

@keyframes gc-shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ─── Animación entrada cards ──────────────────────────────── */
.gc-card {
    animation: gc-fadeUp .35s ease both;
}

@keyframes gc-fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ─── Filtros de modalidad (segunda fila) ──────────────────── */

/* Separa visualmente la segunda fila de la primera */
.gc-filtros--modalidad {
    margin-top: -1rem;
    margin-bottom: 1.75rem;
    align-items: center;
    gap: 0.375rem;
}

/* Label "Modalidad:" antes de los chips */
.gc-filtros--modalidad::before {
    content: 'Modalidad:';
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #999;
    white-space: nowrap;
    margin-right: 0.125rem;
}

/* Chip de modalidad: outlined, más pequeño, sin color corporativo */
.gc-filtro--modalidad {
    padding: 0.3rem 0.875rem;
    font-size: 0.8125rem;
    font-weight: 500;
    border: 1.5px solid #d5d5d5;
    background: transparent;
    color: #555;
    border-radius: 2rem;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    transition: all var(--gc-transition);
    white-space: nowrap;
    cursor: pointer;
    line-height: 1.4;
}

.gc-filtro--modalidad svg {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    fill: currentColor;
    opacity: 0.75;
}

.gc-filtro--modalidad:hover {
    border-color: #aaa;
    color: #222;
    background: #f7f7f7;
}

.gc-filtro--modalidad:hover svg {
    opacity: 1;
}

/* Estado activo: fondo sólido neutro, sin color corporativo */
.gc-filtro-modalidad--activo {
    background: #1a1a1a;
    color: #fff;
    border-color: #1a1a1a;
}

.gc-filtro-modalidad--activo svg {
    opacity: 1;
}

.gc-filtro-modalidad--activo:hover {
    background: #333;
    border-color: #333;
    color: #fff;
}

/* Responsive: en móvil el label pasa a su propia línea */
@media (max-width: 480px) {
    .gc-filtros--modalidad::before {
        width: 100%;
        margin-bottom: 0.25rem;
    }
}

/* ─── Pastillas de curso [curso_pastillas] ─────────────────── */
.gc-pastillas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0;
}

.gc-pastilla {
    display: inline-flex !important;
    align-items: center !important;
    gap: 0.3rem;
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: 1px solid #ddd !important;
    font-size: 0.8rem !important;
    font-weight: 500 !important;
    padding: 0.25rem 0.6rem !important;
    border-radius: 0.25rem !important;
    line-height: 1.4 !important;
    white-space: nowrap !important;
    box-shadow: none !important;
    text-decoration: none !important;
    text-transform: none !important;
    letter-spacing: normal !important;
    margin: 0 !important;
}

.gc-pastilla svg {
    width: 13px !important;
    height: 13px !important;
    min-width: 13px;
    min-height: 13px;
    max-width: 13px;
    max-height: 13px;
    flex-shrink: 0;
    fill: currentColor;
    opacity: 0.65;
    display: block;
}

/* ─── Pastilla clickable (categoría con enlace) ──────────── */
a.gc-pastilla--link {
    transition: background 0.2s, border-color 0.2s, color 0.2s !important;
}
a.gc-pastilla--link:hover {
    background: var(--gc-pill-color) !important;
    border-color: var(--gc-pill-color) !important;
    color: #ffffff !important;
}
a.gc-pastilla--link:hover svg {
    fill: #ffffff;
}
.gc-pastilla__chevron {
    font-size: 1.5em;
    font-weight: 700;
    line-height: 1;
    transition: transform 0.2s;
}
a.gc-pastilla--link:hover .gc-pastilla__chevron {
    transform: translateX(2px);
}

/* ─── Menú Categorías ─────────────────────────────────────── */
.gc-menu-cat {
    display: grid;
    grid-template-columns: repeat(var(--gc-menu-cols, 3), 1fr);
    gap: 1rem;
    max-width: 1400px;
    margin: 0 auto 2rem;
    padding: 0 1rem;
    font-family: var(--gc-font);
}

.gc-menu-cat__item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.125rem 1.375rem;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    text-decoration: none;
    color: #1a1a1a;
    transition: all .2s ease;
    border: 1px solid rgba(0,0,0,.06);
    overflow: hidden;
}

.gc-menu-cat__item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 4px;
    background: var(--gc-item-color, #ddd);
    border-radius: 4px 0 0 4px;
    transition: width .2s ease;
}

.gc-menu-cat__item:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0,0,0,.08), 0 4px 10px rgba(0,0,0,.05);
    color: #1a1a1a;
    text-decoration: none;
    border-color: transparent;
}

.gc-menu-cat__item:hover::before {
    width: 5px;
}

.gc-menu-cat__icono {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    border-radius: 12px;
    background: color-mix(in srgb, var(--gc-item-color, #666) 10%, transparent);
    color: var(--gc-item-color, #666);
    font-size: 1.25rem;
    line-height: 1;
    transition: transform .2s ease, background .2s ease;
}

.gc-menu-cat__item:hover .gc-menu-cat__icono {
    transform: scale(1.08);
    background: color-mix(in srgb, var(--gc-item-color, #666) 16%, transparent);
}

.gc-menu-cat__icono .dashicons {
    font-size: 22px;
    width: 22px;
    height: 22px;
    color: inherit;
}

.gc-menu-cat__icono i {
    font-size: 18px;
    color: inherit;
}

.gc-menu-cat__texto {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    min-width: 0;
}

.gc-menu-cat__nombre {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #1a1a1a;
}

.gc-menu-cat__conteo {
    font-size: 0.75rem;
    font-weight: 500;
    color: color-mix(in srgb, var(--gc-item-color, #888) 70%, #666);
    white-space: nowrap;
    letter-spacing: 0.01em;
}

/* ─── Responsive ───────────────────────────────────────────── */
@media (max-width: 1024px) {
    .gc-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .gc-menu-cat {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .gc-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .gc-filtros {
        gap: 0.375rem;
    }
    .gc-filtro {
        font-size: 0.8125rem;
        padding: 0.4rem 1rem;
    }
    .gc-pastilla {
        white-space: normal !important;
    }
    .gc-menu-cat {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .gc-grid {
        grid-template-columns: 1fr;
    }
    .gc-wrapper {
        padding: 0 0.75rem;
    }
    .gc-menu-cat {
        grid-template-columns: 1fr;
    }
}


/* ─── Buscador de cursos [buscador_cursos] ─────────────────── */
.gc-buscador {
    font-family: var(--gc-font);
    margin-bottom: 1.75rem;
}

.gc-buscador__inner {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 2rem;
    padding: 0.5rem 0.875rem;
    transition: border-color var(--gc-transition), box-shadow var(--gc-transition);
}

.gc-buscador__inner:focus-within {
    border-color: #999;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, .06);
    outline: none;
}

.gc-buscador__icon {
    display: flex;
    align-items: center;
    flex-shrink: 0;
    color: #bbb;
    pointer-events: none;
    transition: color var(--gc-transition);
}

.gc-buscador__inner:focus-within .gc-buscador__icon {
    color: #777;
}

.gc-buscador__input {
    flex: 1;
    min-width: 0;
    border: none !important;
    outline: none !important;
    background: transparent;
    font-size: 0.9375rem;
    font-family: var(--gc-font);
    color: #1a1a1a;
    line-height: 1.4;
    /* Reset Divi */
    appearance: none;
    -webkit-appearance: none;
    padding: 0;
    margin: 0;
    box-shadow: none !important;
}

.gc-buscador__input::placeholder {
    color: #bbb;
    font-weight: 400;
}

/* Quitar el botón X nativo de Chrome/Safari en type="search" */
.gc-buscador__input::-webkit-search-decoration,
.gc-buscador__input::-webkit-search-cancel-button,
.gc-buscador__input::-webkit-search-results-button,
.gc-buscador__input::-webkit-search-results-decoration {
    display: none;
}

.gc-buscador__clear {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
    border: none;
    background: transparent;
    color: #bbb;
    cursor: pointer;
    padding: 0.2rem;
    border-radius: 50%;
    transition: color var(--gc-transition), background var(--gc-transition);
    line-height: 0;
}

.gc-buscador__clear:hover {
    color: #333;
    background: #f0f0f0;
}

/* El botón clear se oculta con hidden; este selector añade transición suave */
.gc-buscador__clear:not([hidden]) {
    display: flex;
}
.gc-buscador__clear[hidden] {
    display: none !important;
}

.gc-buscador__estado {
    min-height: 1.25rem;
    margin: 0.375rem 0 0 0.875rem;
    font-size: 0.8125rem;
    color: #888;
    font-weight: 500;
}

/* Resaltado del término buscado en el título de las tarjetas */
.gc-highlight {
    background: #fff3cd;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
    font-style: normal;
}

@media (max-width: 768px) {
    .gc-buscador__input {
        font-size: 0.875rem;
    }
}

/* Menú flotante: estilos inline en el shortcode [menu_flotante] */
