/* ============================================================
   Bericenter Aulas v2 — premium learning surface
   Design directives: VARIANCE 8 / MOTION 6 / DENSITY 4
   No purple. Off-black. One accent (Bericenter red).
   Vanilla CSS — aplica automaticamente a TODAS las aulas.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Geist+Mono:wght@400;500;600&display=swap');

:root {
    /* paleta calibrada — saturacion controlada, base zinc */
    --aula-ink:           #0c1219;     /* off-black, nunca #000 */
    --aula-ink-2:         #161e29;
    --aula-ink-soft:      #525c69;
    --aula-line:          #e4e8ee;
    --aula-line-soft:     #eef1f5;
    --aula-bg:            #f6f8fb;
    --aula-bg-mesh:       #fafbfd;
    --aula-card:          #ffffff;

    --aula-accent:        #ff040e;
    --aula-accent-2:      #d9040d;
    --aula-accent-soft:   rgba(255, 4, 14, .08);
    --aula-accent-glow:   rgba(255, 4, 14, .22);

    --aula-cyan:          #2dd4bf;     /* solo para "live"/status (no hero) */

    --aula-radius-lg:     28px;
    --aula-radius-md:     18px;
    --aula-radius-sm:     12px;

    /* tinted shadows — siempre con tinte del background, nunca puro negro */
    --aula-shadow-card:   0 1px 0 rgba(15, 23, 42, .04),
                          0 12px 28px -10px rgba(15, 23, 42, .08),
                          0 24px 56px -20px rgba(15, 23, 42, .06);
    --aula-shadow-hover:  0 1px 0 rgba(15, 23, 42, .04),
                          0 18px 38px -10px rgba(15, 23, 42, .14),
                          0 32px 72px -24px rgba(15, 23, 42, .12);
    --aula-shadow-press:  0 1px 0 rgba(15, 23, 42, .06),
                          0 4px 12px -2px rgba(15, 23, 42, .08);

    --aula-ease:          cubic-bezier(0.16, 1, 0.3, 1);
}

/* ============================================================
   Shell — full bleed, mesh background, sin desperdicio lateral
   ============================================================ */
body.beri-aula-active,
body:has(.beri-aula-shell) {
    background: var(--aula-bg);
}

.beri-aula-shell {
    /* fuerza romper containers de Kadence */
    width: 100%;
    max-width: none;
    background:
        radial-gradient(ellipse 90% 60% at 80% 0%,  rgba(255, 4, 14, .045) 0%, transparent 60%),
        radial-gradient(ellipse 70% 50% at 20% 30%, rgba(20, 184, 166, .035) 0%, transparent 55%),
        var(--aula-bg);
    color: var(--aula-ink);
    font-family: 'Outfit', system-ui, -apple-system, sans-serif;
    font-feature-settings: "ss01", "ss02";
    padding-bottom: 96px;
    overflow-x: clip;
    position: relative;
}

.beri-aula-shell * {
    box-sizing: border-box;
}

.beri-aula-container {
    width: 100%;
    max-width: 1480px;
    margin-inline: auto;
    padding-inline: clamp(20px, 4vw, 56px);
    position: relative;
}

/* ============================================================
   Hero header — off-black con mesh blobs animados
   ============================================================ */
.beri-aula-header {
    position: relative;
    background: linear-gradient(180deg, #0c1219 0%, #131c28 100%);
    color: #fff;
    padding: 56px 0 92px;
    margin-bottom: -52px;
    overflow: hidden;
    isolation: isolate;
}

/* Mesh blobs — animados via CSS */
.beri-aula-header::before,
.beri-aula-header::after {
    content: "";
    position: absolute;
    inset: -10% -10% auto auto;
    width: 60vw;
    height: 60vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    animation: aula-blob 18s var(--aula-ease) infinite alternate;
    will-change: transform;
}

.beri-aula-header::before {
    background: radial-gradient(circle, rgba(255, 4, 14, .35) 0%, transparent 70%);
    top: -20%;
    right: -10%;
}

.beri-aula-header::after {
    background: radial-gradient(circle, rgba(45, 212, 191, .22) 0%, transparent 70%);
    top: 30%;
    left: -10%;
    right: auto;
    animation-duration: 22s;
    animation-direction: alternate-reverse;
}

@keyframes aula-blob {
    0%   { transform: translate3d(0, 0, 0) scale(1); }
    100% { transform: translate3d(-40px, 30px, 0) scale(1.15); }
}

/* grain pattern decorativo, solo pseudo, no scroll-bound */
.beri-aula-header > .beri-aula-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 56px 56px;
    background-position: -1px -1px;
    mask-image: radial-gradient(ellipse 60% 80% at 30% 50%, #000 40%, transparent 100%);
    pointer-events: none;
    z-index: -1;
}

.beri-aula-header-inner {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 32px;
    align-items: end;
}

/* breadcrumb */
.beri-aula-breadcrumb {
    font-size: 12px;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: rgba(255,255,255,.55);
    margin-bottom: 18px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}
.beri-aula-breadcrumb a {
    color: rgba(255,255,255,.85);
    text-decoration: none;
    transition: color .25s var(--aula-ease);
}
.beri-aula-breadcrumb a:hover { color: #fff; }
.beri-aula-sep {
    width: 14px;
    height: 1px;
    background: rgba(255,255,255,.3);
    display: inline-block;
}
.beri-aula-current {
    color: rgba(255,255,255,.92);
    font-weight: 500;
    max-width: 56ch;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* status pill "live" */
.beri-aula-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 6px 12px;
    background: rgba(255,255,255,.06);
    border: 1px solid rgba(255,255,255,.12);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.85);
    margin-bottom: 22px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    /* glass refraction */
    box-shadow: inset 0 1px 0 rgba(255,255,255,.08);
}

.beri-aula-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--aula-cyan);
    box-shadow: 0 0 0 0 var(--aula-cyan);
    animation: aula-pulse 2s ease-out infinite;
    flex-shrink: 0;
}

@keyframes aula-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(45, 212, 191, .6); }
    70%  { box-shadow: 0 0 0 9px rgba(45, 212, 191, 0); }
    100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, 0); }
}

/* titulo grande pero controlado — no scream */
.beri-aula-title {
    font-family: 'Outfit', system-ui, sans-serif;
    font-size: clamp(32px, 4.2vw, 56px);
    line-height: 1.05;
    margin: 0;
    color: #fff;
    font-weight: 700;
    letter-spacing: -.02em;
    max-width: 22ch;
}

/* accent line bajo el titulo */
.beri-aula-title-accent {
    display: block;
    width: 56px;
    height: 4px;
    margin-top: 22px;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--aula-accent) 0%, var(--aula-accent-2) 100%);
    position: relative;
}
.beri-aula-title-accent::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.5) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: aula-shimmer 3.5s ease-in-out infinite;
}

@keyframes aula-shimmer {
    0%, 100% { background-position: -100% 0; opacity: 0; }
    50%      { background-position: 100% 0; opacity: 1; }
}

.beri-aula-sub {
    margin: 18px 0 0;
    color: rgba(255,255,255,.62);
    font-size: 15px;
    max-width: 62ch;
    line-height: 1.55;
    font-weight: 400;
}

/* meta a la derecha del hero (modulo, leccion, progreso) */
.beri-aula-meta {
    display: flex;
    flex-direction: column;
    gap: 18px;
    align-items: flex-end;
    text-align: right;
    color: rgba(255,255,255,.7);
    min-width: 200px;
}

.beri-aula-meta-block {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.beri-aula-meta-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: rgba(255,255,255,.45);
}

.beri-aula-meta-value {
    font-family: 'Geist Mono', 'JetBrains Mono', monospace;
    font-size: 14px;
    font-weight: 500;
    color: rgba(255,255,255,.92);
    font-feature-settings: "tnum";
    letter-spacing: -.01em;
}

/* progress bar inferior del hero */
.beri-aula-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,.06);
    overflow: hidden;
}
.beri-aula-progress::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    width: 18%;
    background: linear-gradient(90deg, var(--aula-accent) 0%, var(--aula-accent-2) 100%);
    box-shadow: 0 0 12px var(--aula-accent-glow);
    animation: aula-progress-march 2.4s var(--aula-ease) infinite alternate;
}
@keyframes aula-progress-march {
    0%   { transform: translateX(-30%); }
    100% { transform: translateX(420%); }
}

/* ============================================================
   Grid principal — asimetrico (no centrado, no 3-col)
   ============================================================ */
.beri-aula-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 28px;
    align-items: start;
    position: relative;
    z-index: 2;
    padding-top: 8px;
}

@media (max-width: 1100px) {
    .beri-aula-grid {
        grid-template-columns: 1fr;
        gap: 22px;
    }
    .beri-aula-header-inner {
        grid-template-columns: 1fr;
    }
    .beri-aula-meta {
        align-items: flex-start;
        text-align: left;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 24px;
    }
}

/* ============================================================
   Player card — surface premium, integrada con hero
   ============================================================ */
.beri-aula-player {
    background: var(--aula-card);
    border: 1px solid var(--aula-line);
    border-radius: var(--aula-radius-lg);
    box-shadow: var(--aula-shadow-card);
    padding: 18px;
    overflow: hidden;
    position: relative;
}

/* esquina decorativa — accent corner */
.beri-aula-player::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 80px;
    height: 4px;
    background: linear-gradient(90deg, var(--aula-accent) 0%, transparent 100%);
    border-radius: var(--aula-radius-lg) 0 0 0;
}

.beri-aula-player .wp-block-group {
    margin: 0 !important;
    padding: 0 !important;
}

/* envuelve el UVP en frame oscuro */
.beri-aula-player .beri-aula,
.beri-aula-player > div > .wp-block-shortcode,
.beri-aula-player .fwduvp_main_wrapper {
    border-radius: calc(var(--aula-radius-lg) - 8px) !important;
    overflow: hidden;
}

.beri-aula-player iframe,
.beri-aula-player video {
    max-width: 100% !important;
    border-radius: calc(var(--aula-radius-lg) - 8px) !important;
}

/* ============================================================
   Sidebar
   ============================================================ */
.beri-aula-sidebar {
    display: flex;
    flex-direction: column;
    gap: 18px;
    position: sticky;
    top: 96px;
}

@media (max-width: 1100px) {
    .beri-aula-sidebar { position: static; }
}

.beri-aula-card {
    background: var(--aula-card);
    border: 1px solid var(--aula-line);
    border-radius: var(--aula-radius-md);
    padding: 24px 24px 22px;
    box-shadow: var(--aula-shadow-card);
    position: relative;
    overflow: hidden;
}

/* hairline accent en card titular */
.beri-aula-card.is-primary::before {
    content: "";
    position: absolute;
    top: 0;
    left: 24px;
    right: 24px;
    height: 2px;
    background: linear-gradient(90deg, var(--aula-accent) 0%, var(--aula-accent-2) 50%, transparent 100%);
    border-radius: 0 0 2px 2px;
}

.beri-aula-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--aula-line-soft);
}

.beri-aula-card-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .14em;
    color: var(--aula-ink-soft);
    margin: 0;
    font-weight: 700;
}

.beri-aula-card-icon {
    width: 14px;
    height: 14px;
    color: var(--aula-accent);
    flex-shrink: 0;
}

/* ============================================================
   Curso info rows — herencia del shortcode [beri_curso_info]
   ============================================================ */
.beri-aula-card .beri-info-rows {
    margin: 0;
    display: flex;
    flex-direction: column;
}

.beri-aula-card .beri-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 11px 0;
    border-bottom: 1px solid var(--aula-line-soft);
    transition: padding .25s var(--aula-ease);
}

.beri-aula-card .beri-info-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}
.beri-aula-card .beri-info-row:first-child {
    padding-top: 0;
}

.beri-aula-card .beri-info-label {
    flex: 0 0 auto;
    font-family: 'Geist Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    color: var(--aula-ink-soft);
    text-transform: uppercase;
    letter-spacing: .12em;
    line-height: 1.3;
}

.beri-aula-card .beri-info-value {
    flex: 1 1 auto;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--aula-ink);
    text-align: right;
    line-height: 1.5;
    letter-spacing: -.005em;
}

/* ============================================================
   Materiales / archivos
   ============================================================ */
.beri-aula-card .beri-files-card {
    padding: 0;
    border: none;
    box-shadow: none;
    background: transparent;
}
.beri-aula-card .beri-files-title {
    display: none;
}
.beri-aula-card .beri-file-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.beri-aula-card .beri-file-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--aula-radius-sm);
    text-decoration: none !important;
    color: var(--aula-ink);
    font-size: 13.5px;
    font-weight: 600;
    border: 1px solid var(--aula-line);
    background: linear-gradient(180deg, #fff 0%, #fbfcfe 100%);
    transition: transform .25s var(--aula-ease),
                border-color .25s var(--aula-ease),
                box-shadow .25s var(--aula-ease),
                background .25s var(--aula-ease);
    position: relative;
    overflow: hidden;
}

/* directional hover: shimmer barre el card */
.beri-aula-card .beri-file-item::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255, 4, 14, .06) 50%, transparent 70%);
    background-size: 220% 100%;
    background-position: 100% 0;
    transition: background-position .55s var(--aula-ease);
    pointer-events: none;
}

.beri-aula-card .beri-file-item:hover {
    transform: translateY(-2px);
    border-color: rgba(255, 4, 14, .35);
    box-shadow: 0 6px 18px -8px var(--aula-accent-glow);
    color: var(--aula-accent-2);
}
.beri-aula-card .beri-file-item:hover::before {
    background-position: -100% 0;
}
.beri-aula-card .beri-file-item:active {
    transform: translateY(0);
    box-shadow: var(--aula-shadow-press);
}

.beri-aula-card .beri-file-icon {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: var(--aula-accent-soft);
    color: var(--aula-accent);
    font-size: 14px;
    transition: transform .3s var(--aula-ease), background .25s var(--aula-ease);
}
.beri-aula-card .beri-file-item:hover .beri-file-icon {
    transform: rotate(-6deg) scale(1.06);
    background: var(--aula-accent);
    color: #fff;
}

.beri-aula-card .beri-file-name {
    flex: 1;
    line-height: 1.4;
}

/* CTA volver */
.beri-aula-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    text-align: center;
    color: var(--aula-ink-soft);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    padding: 12px 16px;
    border-radius: 10px;
    transition: background .2s var(--aula-ease), color .2s var(--aula-ease);
    align-self: center;
}
.beri-aula-back:hover {
    background: rgba(15, 23, 42, .04);
    color: var(--aula-ink);
}

/* ============================================================
   /mis-cursos/ dashboard — mismo lenguaje visual
   ============================================================ */
.beri-mis-cursos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
    margin: 32px 0 0;
}

.beri-mc-card {
    display: flex;
    flex-direction: column;
    background: var(--aula-card);
    border: 1px solid var(--aula-line);
    border-radius: var(--aula-radius-md);
    overflow: hidden;
    text-decoration: none !important;
    color: inherit;
    box-shadow: var(--aula-shadow-card);
    transition: transform .35s var(--aula-ease),
                box-shadow .35s var(--aula-ease),
                border-color .25s var(--aula-ease);
    position: relative;
}

.beri-mc-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--aula-shadow-hover);
    border-color: #d3dbe5;
    text-decoration: none !important;
}

.beri-mc-thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    background:
        linear-gradient(135deg, rgba(255, 4, 14, .12), transparent 60%),
        linear-gradient(225deg, rgba(45, 212, 191, .12), transparent 60%),
        linear-gradient(180deg, var(--aula-ink-2), var(--aula-ink));
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid var(--aula-line);
    position: relative;
    overflow: hidden;
}

.beri-mc-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 80% 20%, rgba(255, 4, 14, .14) 0%, transparent 60%);
    transition: opacity .4s var(--aula-ease);
    opacity: .7;
}
.beri-mc-card:hover .beri-mc-thumb::after { opacity: 1; }

.beri-mc-body {
    padding: 22px 22px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.beri-mc-title {
    margin: 0;
    font-size: 16px;
    line-height: 1.32;
    font-weight: 700;
    color: var(--aula-ink);
    letter-spacing: -.005em;
}

.beri-mc-desc {
    margin: 0;
    font-size: 13.5px;
    color: var(--aula-ink-soft);
    line-height: 1.55;
    flex: 1;
}

.beri-mc-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 12px;
    color: var(--aula-accent);
    font-weight: 700;
    font-size: 13.5px;
    letter-spacing: -.005em;
    transition: gap .25s var(--aula-ease), color .2s var(--aula-ease);
}
.beri-mc-card:hover .beri-mc-cta {
    color: var(--aula-accent-2);
    gap: 10px;
}

.beri-mc-empty {
    text-align: center;
    padding: 64px 28px;
    background: var(--aula-card);
    border-radius: var(--aula-radius-md);
    border: 1px dashed var(--aula-line);
    color: var(--aula-ink-soft);
}
.beri-mc-empty p { margin: 0 0 16px; font-size: 15px; }
.beri-mc-empty a { color: var(--aula-accent); font-weight: 700; }

/* ============================================================
   Sales page CTA "Ir al aula"
   ============================================================ */
.beri-aula-cta-wrap {
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 14px 0;
}

.beri-aula-cta-note {
    margin: 0;
    font-size: 11.5px;
    color: var(--aula-ink-soft);
    font-weight: 500;
    letter-spacing: -.005em;
}

.beri-aula-cta {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 20px;
    background: linear-gradient(180deg, var(--aula-accent) 0%, var(--aula-accent-2) 100%);
    color: #fff !important;
    font-weight: 600;
    font-size: 13.5px;
    letter-spacing: 0;
    text-decoration: none !important;
    border-radius: 999px;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.16),
        0 4px 10px -3px var(--aula-accent-glow);
    transition: transform .2s var(--aula-ease), box-shadow .25s var(--aula-ease);
    position: relative;
    overflow: hidden;
    width: auto;
    align-self: flex-start;
}
.beri-aula-cta::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 30%, rgba(255,255,255,.18) 50%, transparent 70%);
    background-size: 220% 100%;
    background-position: 100% 0;
    transition: background-position .7s var(--aula-ease);
    pointer-events: none;
}
.beri-aula-cta:hover {
    transform: translateY(-2px);
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,.22),
        0 10px 22px -4px var(--aula-accent-glow),
        0 18px 36px -10px rgba(217, 4, 13, .42);
    color: #fff !important;
}
.beri-aula-cta:hover::after {
    background-position: -100% 0;
}
.beri-aula-cta:active {
    transform: translateY(0);
}

/* ============================================================
   Mobile collapse
   ============================================================ */
@media (max-width: 768px) {
    .beri-aula-header {
        padding: 36px 0 76px;
        margin-bottom: -40px;
    }
    .beri-aula-title {
        font-size: clamp(28px, 7vw, 40px);
    }
    .beri-aula-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 14px;
        margin-top: 14px;
    }
    .beri-aula-grid {
        gap: 18px;
        padding-top: 0;
    }
    .beri-aula-player {
        padding: 12px;
        border-radius: 18px;
    }
    .beri-aula-card {
        padding: 20px;
        border-radius: 16px;
    }
    .beri-mis-cursos-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

/* ============================================================
   Reduce motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .beri-aula-header::before,
    .beri-aula-header::after,
    .beri-aula-status-dot,
    .beri-aula-title-accent::after,
    .beri-aula-progress::after,
    .beri-aula-card .beri-file-item::before,
    .beri-aula-cta::after {
        animation: none !important;
    }
    .beri-aula-shell *,
    .beri-aula-shell *::before,
    .beri-aula-shell *::after {
        transition-duration: .01ms !important;
    }
}
