/* ============================================================
   Plantillas genéricas (Luz y Saber)
   404.php, page.php, search.php, archive-course_activity.php,
   searchform.php y template-parts/content-none.php / activity-card.php.
   Se encola desde cada plantilla con hsc_enqueue_generic_styles().
   ============================================================ */

.hsg-page {
    background: var(--ls-surface, #f9f9fb);
    color: var(--ls-on-surface, #1a1c1d);
    font-family: var(--ls-font-body, 'Inter', sans-serif);
    padding: 0 16px 72px;
    min-height: 60vh;
}
.hsg-wrap { max-width: 1040px; margin: 0 auto; }
.hsg-wrap--narrow { max-width: 760px; }
.hsg-page h1, .hsg-page h2, .hsg-page h3 {
    font-family: var(--ls-font-headline, 'Manrope', sans-serif);
    color: var(--ls-on-surface, #1a1c1d);
    letter-spacing: -0.02em;
}

/* ---- Cabecera ---- */
.hsg-hero { padding: 40px 0 28px; }
.hsg-hero--center { text-align: center; padding-top: 64px; }
.hsg-eyebrow {
    display: inline-block;
    font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--ls-outline, #747878);
    margin: 0 0 10px;
}
.hsg-hero h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); font-weight: 800; line-height: 1.15; margin: 0 0 10px; }
.hsg-lead { font-size: 1.02rem; line-height: 1.6; color: var(--ls-on-surface-variant, #444748); margin: 0; max-width: 620px; }
.hsg-hero--center .hsg-lead { margin: 0 auto; }
.hsg-code {
    font-family: var(--ls-font-headline, 'Manrope', sans-serif);
    font-size: clamp(4.5rem, 16vw, 7.5rem); font-weight: 800; line-height: 1;
    color: var(--ls-surface-high, #e8e8ea);
    margin: 0 0 8px; letter-spacing: -0.04em;
}

/* ---- Botones ---- */
.hsg-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.hsg-hero--center .hsg-actions { justify-content: center; }
.hsg-btn {
    display: inline-flex; align-items: center; gap: 8px;
    font: 600 0.92rem var(--ls-font-body, 'Inter', sans-serif);
    padding: 11px 22px; border-radius: var(--ls-radius-full, 9999px);
    border: 1px solid transparent; cursor: pointer; text-decoration: none;
    background: var(--ls-primary, #000); color: var(--ls-on-primary, #fff);
    transition: opacity .15s ease, background .15s ease;
}
.hsg-btn:hover { opacity: .85; color: var(--ls-on-primary, #fff); }
.hsg-btn--ghost {
    background: var(--ls-surface-lowest, #fff); color: var(--ls-on-surface, #1a1c1d);
    border-color: var(--ls-outline-variant, #c4c7c7);
}
.hsg-btn--ghost:hover { background: var(--ls-surface-low, #f3f3f5); color: var(--ls-on-surface, #1a1c1d); opacity: 1; }

/* ---- Buscador (searchform.php) ---- */
.hsg-search {
    display: flex; align-items: center; gap: 6px;
    background: var(--ls-surface-lowest, #fff);
    border: 1px solid var(--ls-outline-variant, #c4c7c7);
    border-radius: var(--ls-radius-full, 9999px);
    padding: 5px 5px 5px 16px; max-width: 520px; width: 100%;
    box-shadow: var(--ls-shadow-card);
}
.hsg-hero > .hsg-search { margin-top: 20px; }
.hsg-hero--center .hsg-search { margin: 24px auto 0; }
.hsg-search:focus-within { border-color: var(--ls-on-surface, #1a1c1d); }
.hsg-search svg { flex-shrink: 0; color: var(--ls-outline, #747878); }
.hsg-search input[type="search"] {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font: 400 0.95rem var(--ls-font-body, 'Inter', sans-serif);
    color: var(--ls-on-surface, #1a1c1d); padding: 8px 4px;
}
.hsg-search button { padding: 9px 18px; }

/* ---- Chips (niveles / tipos) ---- */
.hsg-section-title { font-size: 1.1rem; font-weight: 800; margin: 40px 0 14px; }
.hsg-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.hsg-hero--center .hsg-chips { justify-content: center; }
.hsg-chips--filters { margin-top: 20px; }
.hsg-chip {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 0.85rem; font-weight: 600; text-decoration: none;
    padding: 7px 14px; border-radius: var(--ls-radius-full, 9999px);
    background: var(--ls-surface-lowest, #fff);
    border: 1px solid var(--ls-outline-variant, #c4c7c7);
    color: var(--ls-on-surface-variant, #444748);
    transition: background .15s ease, border-color .15s ease;
}
.hsg-chip:hover { background: var(--ls-surface-low, #f3f3f5); color: var(--ls-on-surface, #1a1c1d); }
.hsg-chip.is-active { background: var(--ls-primary, #000); border-color: var(--ls-primary, #000); color: var(--ls-on-primary, #fff); }
.hsg-chip--level { border-color: var(--hsg-level-border, #c4c7c7); background: var(--hsg-level-tint, #fff); color: var(--hsg-level-dark, #1a1c1d); font-weight: 700; }
.hsg-chip--level:hover { background: var(--hsg-level-border, #e8e8ea); color: var(--hsg-level-dark, #1a1c1d); }

/* ---- Rejilla de tarjetas (template-parts/activity-card.php) ---- */
.hsg-meta-line { font-size: 0.88rem; color: var(--ls-outline, #747878); margin: 0 0 16px; }
.hsg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.hsg-card {
    position: relative; display: flex; flex-direction: column; gap: 8px;
    background: var(--ls-surface-lowest, #fff);
    border-radius: var(--ls-radius-lg, 1rem);
    box-shadow: var(--ls-shadow-card);
    padding: 20px 22px; text-decoration: none; color: inherit;
    transition: box-shadow .2s ease, transform .2s ease;
}
.hsg-card:hover { box-shadow: var(--ls-shadow-card-hover); transform: translateY(-2px); color: inherit; }
.hsg-card__top { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 24px; }
.hsg-badge {
    display: inline-flex; align-items: center; gap: 4px;
    font-size: 0.72rem; font-weight: 700; line-height: 1;
    padding: 5px 9px; border-radius: var(--ls-radius-full, 9999px);
    background: var(--ls-surface-low, #f3f3f5); color: var(--ls-on-surface-variant, #444748);
}
.hsg-badge--level { background: var(--hsg-level-tint, #f3f3f5); color: var(--hsg-level-dark, #1a1c1d); }
.hsg-badge--premium { background: var(--ls-secondary-fixed, #ffe088); color: var(--ls-on-secondary-container, #745c00); }
.hsg-badge--done { background: transparent; color: var(--ls-success, #10B981); padding-left: 0; padding-right: 0; margin-left: auto; }
.hsg-card__title { font-size: 1.05rem; font-weight: 800; line-height: 1.3; margin: 0; color: var(--hsg-level-dark, var(--ls-on-surface, #1a1c1d)); }
.hsg-card__text { font-size: 0.9rem; line-height: 1.55; color: var(--ls-on-surface-variant, #444748); margin: 0; }
.hsg-card__more {
    display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 6px;
    font-size: 0.85rem; font-weight: 700; color: var(--ls-on-surface, #1a1c1d);
}

/* ---- Paginación ---- */
.hsg-pagination { margin-top: 32px; }
.hsg-pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.hsg-pagination .page-numbers {
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 40px; height: 40px; padding: 0 12px;
    border-radius: var(--ls-radius-full, 9999px);
    font-size: 0.9rem; font-weight: 600; text-decoration: none;
    background: var(--ls-surface-lowest, #fff); color: var(--ls-on-surface-variant, #444748);
    border: 1px solid var(--ls-outline-variant, #c4c7c7);
}
.hsg-pagination .page-numbers:hover { background: var(--ls-surface-low, #f3f3f5); }
.hsg-pagination .page-numbers.current { background: var(--ls-primary, #000); border-color: var(--ls-primary, #000); color: var(--ls-on-primary, #fff); }
.hsg-pagination .page-numbers.dots { border: 0; background: transparent; }

/* ---- Estado vacío (content-none.php) ---- */
.hsg-empty {
    text-align: center;
    background: var(--ls-surface-lowest, #fff);
    border-radius: var(--ls-radius-xl, 1.5rem);
    box-shadow: var(--ls-shadow-card);
    padding: 48px 24px;
}
.hsg-empty__icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 56px; height: 56px; border-radius: var(--ls-radius-full, 9999px);
    background: var(--ls-surface-low, #f3f3f5); color: var(--ls-on-surface-variant, #444748);
    margin-bottom: 14px;
}
.hsg-empty h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 8px; }
.hsg-empty p { color: var(--ls-on-surface-variant, #444748); line-height: 1.6; margin: 0 auto; max-width: 460px; }
.hsg-empty .hsg-search { margin: 20px auto 0; box-shadow: none; }
.hsg-empty .hsg-actions { justify-content: center; }

/* ---- Contenido de página (page.php) ---- */
.hsg-article {
    background: var(--ls-surface-lowest, #fff);
    border-radius: var(--ls-radius-xl, 1.5rem);
    box-shadow: var(--ls-shadow-card);
    padding: 32px 36px;
}
.hsg-thumb { margin: 0 0 24px; border-radius: var(--ls-radius-lg, 1rem); overflow: hidden; }
.hsg-thumb img { display: block; width: 100%; height: auto; }
.hsg-prose { font-size: 1rem; line-height: 1.75; color: var(--ls-on-surface-variant, #444748); }
.hsg-prose > :first-child { margin-top: 0; }
.hsg-prose > :last-child { margin-bottom: 0; }
.hsg-prose h2 { font-size: 1.45rem; font-weight: 800; margin: 2em 0 .6em; }
.hsg-prose h3 { font-size: 1.15rem; font-weight: 800; margin: 1.6em 0 .5em; }
.hsg-prose p, .hsg-prose ul, .hsg-prose ol { margin: 0 0 1.1em; }
.hsg-prose ul, .hsg-prose ol { padding-left: 1.3em; }
.hsg-prose ul { list-style: disc; }
.hsg-prose ol { list-style: decimal; }
.hsg-prose li { margin-bottom: .35em; }
.hsg-prose strong { color: var(--ls-on-surface, #1a1c1d); }
.hsg-prose a { color: var(--ls-on-surface, #1a1c1d); text-decoration: underline; text-underline-offset: 2px; }
.hsg-prose img { max-width: 100%; height: auto; border-radius: var(--ls-radius-md, .75rem); }
.hsg-prose blockquote {
    margin: 1.4em 0; padding: 4px 0 4px 18px;
    border-left: 3px solid var(--ls-outline-variant, #c4c7c7);
    color: var(--ls-on-surface, #1a1c1d); font-style: italic;
}
.hsg-prose table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: 0 0 1.2em; }
.hsg-prose th, .hsg-prose td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--ls-surface-container, #edeef0); }
.hsg-prose th { background: var(--ls-surface-low, #f3f3f5); color: var(--ls-on-surface, #1a1c1d); }
.hsg-prose .wp-block-table { overflow-x: auto; }
.hsg-prose .alignwide, .hsg-prose .alignfull { max-width: 100%; }
.hsg-page-links { margin-top: 24px; font-weight: 600; }

@media (max-width: 640px) {
    .hsg-hero { padding-top: 28px; }
    .hsg-hero--center { padding-top: 40px; }
    .hsg-article { padding: 22px 18px; border-radius: var(--ls-radius-lg, 1rem); }
    .hsg-grid { grid-template-columns: 1fr; }
    .hsg-search button { padding: 9px 14px; }
}
