/* Vista pública — Sala de Profes (línea gráfica Ociann) */
:root {
    --sp-navy: #2b4b63;
    --sp-navy-deep: #20394e;
    --sp-blue: #365d78;
    --sp-blue-mid: #437799;
    --sp-cream: #f4f7fa;
    --sp-card: #ffffff;
    --sp-text: #152839;
    --sp-muted: #5b7285;
    --sp-faint: #8aa0b3;
    --sp-line: #d7e2eb;
    --sp-shadow: 0 10px 28px -18px rgba(21, 40, 57, 0.45);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 20px;
    --bg-primary: var(--sp-cream);
    --bg-secondary: var(--sp-card);
    --bg-tertiary: #e8eef4;
    --text-primary: var(--sp-text);
    --text-secondary: var(--sp-muted);
    --text-muted: var(--sp-faint);
    --border-color: var(--sp-line);
    --primary: var(--sp-blue-mid);
    --accent: var(--sp-blue);
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, sans-serif;
    background:
        radial-gradient(1200px 420px at 12% -10%, rgba(67, 119, 153, 0.12), transparent 55%),
        radial-gradient(900px 380px at 100% 0%, rgba(43, 75, 99, 0.08), transparent 50%),
        var(--sp-cream);
    color: var(--sp-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── Header ── */
.sala-public-header {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.92);
    border-bottom: 1px solid var(--sp-line);
    backdrop-filter: blur(12px);
    position: sticky;
    top: 0;
    z-index: 100;
}

.sala-public-logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
}

.sala-public-logo-img {
    display: block;
    height: 2.35rem;
    width: auto;
    object-fit: contain;
}

.sala-public-space {
    display: inline-flex;
    align-items: center;
    padding: 0.22rem 0.7rem;
    border-radius: 999px;
    background: color-mix(in srgb, var(--sp-blue-mid) 10%, #fff);
    color: var(--sp-navy);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    text-decoration: none;
}

.sala-public-nav {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.sala-public-ghost-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.48rem 0.95rem;
    color: var(--sp-navy);
    border: 1px solid var(--sp-line);
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.84rem;
    text-decoration: none;
    background: #fff;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.sala-public-ghost-btn:hover {
    border-color: var(--sp-blue-mid);
    background: color-mix(in srgb, var(--sp-blue-mid) 8%, #fff);
    color: var(--sp-navy);
}

.sala-public-login-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.48rem 1rem;
    background: var(--sp-navy);
    color: #fff;
    border-radius: 999px;
    font-weight: 600;
    font-size: 0.84rem;
    text-decoration: none;
    transition: background 0.15s ease, transform 0.15s ease;
}

.sala-public-login-btn:hover {
    background: var(--sp-navy-deep);
    color: #fff;
}

/* ── Content ── */
.sala-public-content {
    max-width: 720px;
    margin: 1.5rem auto 0;
    padding: 0 1rem 6.5rem;
}

.sala-public-post {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
}

.sala-public-post .sala-post-header {
    padding: 1.15rem 1.25rem 0.85rem;
}

.sala-public-post .sala-post-body {
    padding: 0 1.25rem 1rem;
    font-size: 1.02rem;
    line-height: 1.65;
    color: var(--sp-text);
}

.sala-public-post .sala-post-body p { margin: 0 0 0.75rem; }
.sala-public-post .sala-post-body p:last-child { margin-bottom: 0; }
.sala-public-post .sala-post-body a { color: var(--sp-blue-mid); font-weight: 600; }

.sala-public-post-loading,
.sala-public-not-found {
    text-align: center;
    padding: 3.5rem 1.5rem;
    color: var(--sp-faint);
}

.sala-public-not-found i {
    font-size: 2.4rem;
    margin-bottom: 0.75rem;
    display: block;
    color: var(--sp-blue-mid);
}

.sala-public-not-found h3 {
    color: var(--sp-navy);
    margin-bottom: 0.35rem;
}

/* ── Comments ── */
.sala-public-comments-header {
    padding: 0.9rem 1.25rem;
    border-top: 1px solid var(--sp-line);
    font-weight: 700;
    font-size: 0.86rem;
    color: var(--sp-navy);
    background: #f8fafc;
}

.sala-public-comment {
    padding: 0.85rem 1.25rem;
    border-top: 1px solid var(--sp-line);
}

.sala-public-comment-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.35rem;
}

.sala-public-comment-avatar {
    width: 28px;
    height: 28px;
    min-width: 28px;
    border-radius: 50%;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 14px;
    overflow: hidden;
}

.sala-public-comment-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sala-public-comment-name { font-weight: 700; font-size: 0.82rem; color: var(--sp-navy); }
.sala-public-comment-date { font-size: 0.72rem; color: var(--sp-faint); }
.sala-public-comment-content { padding-left: 36px; font-size: 0.9rem; line-height: 1.5; color: var(--sp-text); }
.sala-public-comment[data-depth="1"] { padding-left: 2.25rem; }
.sala-public-comment[data-depth="2"] { padding-left: 3.5rem; }
.sala-public-comment[data-depth="3"],
.sala-public-comment[data-depth="4"] { padding-left: 4.5rem; }

/* ── Banner ── */
.sala-public-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #20394e 0%, #2b4b63 55%, #365d78 100%);
    color: #fff;
    padding: 0.85rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem 1.15rem;
    z-index: 100;
    box-shadow: 0 -10px 28px rgba(21, 40, 57, 0.22);
}

.sala-public-banner-mark {
    width: 36px;
    height: 36px;
    object-fit: contain;
    flex-shrink: 0;
    filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.2));
}

.sala-public-banner-copy {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.sala-public-banner-copy strong {
    font-size: 0.92rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.sala-public-banner-copy span {
    font-size: 0.8rem;
    opacity: 0.86;
    font-weight: 500;
}

.sala-public-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1.15rem;
    background: #fff;
    color: var(--sp-navy);
    border-radius: 999px;
    font-weight: 700;
    font-size: 0.84rem;
    text-decoration: none;
    white-space: nowrap;
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sala-public-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.18);
    color: var(--sp-navy-deep);
}

@media (max-width: 640px) {
    .sala-public-header {
        padding: 0.55rem 0.9rem;
        gap: 0.55rem;
    }

    .sala-public-logo-img { height: 1.9rem; }

    .sala-public-space {
        font-size: 0.62rem;
        padding: 0.18rem 0.5rem;
    }

    .sala-public-login-btn {
        padding: 0.4rem 0.75rem;
        font-size: 0.78rem;
    }

    .sala-public-banner {
        flex-wrap: wrap;
        text-align: left;
        padding: 0.75rem 0.9rem calc(0.75rem + env(safe-area-inset-bottom));
        justify-content: flex-start;
    }

    .sala-public-banner-copy { flex: 1 1 12rem; }
    .sala-public-cta { width: 100%; }
}

.sala-public-post .sala-media-item {
    cursor: zoom-in;
}

.sala-lightbox.open {
    opacity: 1;
    visibility: visible;
    display: flex;
}

.sala-public-h1 {
    margin: 0 1rem 0.65rem;
    padding: 0 0.25rem;
    font-size: 1.28rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.35;
    color: var(--sp-navy);
}

.sala-public-breadcrumb {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0 0 0.85rem;
    font-size: 0.78rem;
    color: var(--sp-faint);
    min-width: 0;
}

.sala-public-breadcrumb a {
    color: var(--sp-blue-mid);
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
}

.sala-public-breadcrumb a:hover { text-decoration: underline; }

.sala-public-breadcrumb span:last-child {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--sp-muted);
}

.sala-public-author-link {
    color: inherit;
    text-decoration: none;
    font-weight: 600;
}
.sala-public-author-link:hover { text-decoration: underline; }

/* ── Hub /sala ── */
.sala-hub {
    max-width: 960px;
    margin: 0 auto;
    padding: 1.5rem 1.15rem 7rem;
}

.sala-hub-hero {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-radius: var(--radius-lg);
    box-shadow: var(--sp-shadow);
    padding: 1.75rem 1.5rem 1.6rem;
    margin-bottom: 1.5rem;
}

.sala-hub-kicker {
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--sp-blue-mid);
    margin-bottom: 0.45rem;
}

.sala-hub-h1 {
    font-size: clamp(1.7rem, 3.2vw, 2.2rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--sp-navy);
    line-height: 1.15;
    margin-bottom: 0.55rem;
}

.sala-hub-lead {
    max-width: 38rem;
    font-size: 1.02rem;
    line-height: 1.6;
    color: var(--sp-muted);
    margin-bottom: 1.15rem;
}

.sala-hub-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1rem;
}

.sala-hub-cta {
    background: var(--sp-navy);
    color: #fff;
    box-shadow: none;
}

.sala-hub-cta:hover {
    background: var(--sp-navy-deep);
    color: #fff;
    box-shadow: 0 6px 16px rgba(21, 40, 57, 0.22);
}

.sala-hub-login {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--sp-blue-mid);
    text-decoration: none;
}

.sala-hub-login:hover { text-decoration: underline; }

.sala-hub-feed-title {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--sp-navy);
    margin-bottom: 0.85rem;
}

.sala-hub-empty {
    background: var(--sp-card);
    border: 1px dashed var(--sp-line);
    border-radius: var(--radius-md);
    padding: 1.5rem;
    color: var(--sp-muted);
}

.sala-hub-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.sala-hub-card {
    background: var(--sp-card);
    border: 1px solid var(--sp-line);
    border-radius: var(--radius-md);
    box-shadow: var(--sp-shadow);
    overflow: hidden;
    min-width: 0;
}

.sala-hub-card-link {
    display: flex;
    flex-direction: column;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

.sala-hub-card-media {
    aspect-ratio: 16 / 9;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.sala-hub-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.sala-hub-card-body {
    padding: 0.95rem 1rem 1.05rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    min-width: 0;
}

.sala-hub-card-title {
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.35;
    color: var(--sp-navy);
}

.sala-hub-card-excerpt {
    font-size: 0.86rem;
    line-height: 1.5;
    color: var(--sp-muted);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sala-hub-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem 0.7rem;
    margin-top: 0.25rem;
    font-size: 0.74rem;
    font-weight: 600;
    color: var(--sp-faint);
}

@media (max-width: 720px) {
    .sala-hub { padding: 1rem 0.85rem 7.5rem; }
    .sala-hub-hero { padding: 1.25rem 1rem 1.2rem; }
    .sala-hub-grid { grid-template-columns: 1fr; }
    .sala-public-ghost-btn { display: none; }
    .sala-hub-cta { width: auto; }
}

