/* =====================================================================
   WOTICIA · SHELL ESTILO RED SOCIAL (X/Twitter)
   Capa aditiva: reutiliza las variables de color de style.css
   (--bg-main, --card-bg, --accent-glow, --border-color, etc.)
   No reemplaza el tema, lo reorganiza en 3 columnas fijas:
   [ Sidebar izq. fijo ]  [ Columna central con scroll ]  [ Rail derecho fijo ]
   ===================================================================== */

:root {
    --shell-left: 248px;
    --shell-left-collapsed: 84px;
    --shell-right: 332px;
    --shell-max-center: 700px;
}

/* ---------------------------------------------------------------------
   1. SIDEBAR IZQUIERDO GLOBAL (fijo, presente en TODAS las vistas:
      Noticias, Café, WTrue, Clima, Finanzas)
   --------------------------------------------------------------------- */
.wo-shell-left {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: var(--shell-left);
    padding: 14px 10px 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    z-index: 900;
    overflow-y: auto;
    scrollbar-width: none;
}
.wo-shell-left::-webkit-scrollbar { display: none; }
.admin-bar .wo-shell-left { top: 32px; }
@media (max-width: 782px) { .admin-bar .wo-shell-left { top: 0; } }

.wo-shell-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    margin-bottom: 6px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    width: fit-content;
}
.wo-shell-logo .wo-shell-mark {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
    display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent-glow), #6366f1);
    color: #04121a; font-size: 19px; font-weight: 900;
}
.wo-shell-logo .wo-shell-wordmark {
    font-weight: 900; font-size: 19px; letter-spacing: -.4px; color: var(--text-primary);
}
.wo-shell-logo:hover .wo-shell-mark { transform: scale(1.05); }

.wo-shell-nav { display: flex; flex-direction: column; gap: 2px; margin-top: 4px; }
.wo-shell-link {
    display: flex; align-items: center; gap: 16px;
    padding: 11px 14px;
    border-radius: var(--radius-pill);
    text-decoration: none;
    color: var(--text-primary);
    font-size: 16.5px; font-weight: 600;
    transition: var(--transition-smooth);
    position: relative;
}
.wo-shell-link:hover { background: var(--card-hover); }
.wo-shell-link .wo-shell-ico { font-size: 20px; width: 24px; text-align: center; flex-shrink: 0; }
.wo-shell-link.is-active { color: var(--accent-glow); font-weight: 800; }
.wo-shell-link.is-active .wo-shell-ico { filter: drop-shadow(0 0 6px color-mix(in srgb, var(--accent-glow) 55%, transparent)); }
.wo-shell-link .wo-shell-live-dot {
    width: 7px; height: 7px; border-radius: 50%; background: #ef4444; margin-left: auto;
    box-shadow: 0 0 0 0 rgba(239, 68, 68, .6); animation: shell-live-pulse 1.8s infinite;
}
@keyframes shell-live-pulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.55);} 80%,100% { box-shadow: 0 0 0 7px rgba(239,68,68,0);} }

.wo-shell-post-btn {
    margin: 14px 4px 6px;
    padding: 13px 0;
    text-align: center;
    border-radius: var(--radius-pill);
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-soft));
    color: #0a0a0a; font-weight: 800; font-size: 15px; border: none; cursor: pointer;
    transition: var(--transition-smooth);
    box-shadow: 0 10px 24px -8px color-mix(in srgb, var(--accent-glow) 55%, transparent);
}
.wo-shell-post-btn:hover { transform: translateY(-1px); filter: brightness(1.05); }

.wo-shell-spacer { flex: 1; }

.wo-shell-profile-btn {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: var(--radius-pill);
    border: 1px solid transparent; background: transparent; cursor: pointer;
    width: 100%; text-align: left; color: var(--text-primary);
    transition: var(--transition-smooth);
}
.wo-shell-profile-btn:hover { background: var(--card-hover); }
.wo-shell-profile-avatar {
    width: 36px; height: 36px; border-radius: 50%; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-soft), #6366f1);
    display: grid; place-items: center; color: #0a0a0a; font-weight: 800; font-size: 14px;
    overflow: hidden;
}
.wo-shell-profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.wo-shell-profile-text { min-width: 0; line-height: 1.25; }
.wo-shell-profile-text strong { display: block; font-size: 13.5px; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.wo-shell-profile-text span { display: block; font-size: 12px; color: var(--text-secondary); }
.wo-shell-profile-more { margin-left: auto; color: var(--text-secondary); font-size: 16px; }

/* Colapsado: solo iconos (tablets) */
@media (max-width: 1240px) and (min-width: 821px) {
    :root { --shell-left: var(--shell-left-collapsed); }
    .wo-shell-logo .wo-shell-wordmark,
    .wo-shell-link span.wo-shell-label,
    .wo-shell-post-btn span.wo-shell-post-full,
    .wo-shell-profile-text { display: none; }
    .wo-shell-logo { justify-content: center; width: 100%; }
    .wo-shell-link { justify-content: center; padding: 12px; }
    .wo-shell-link .wo-shell-live-dot { margin-left: 0; position: absolute; top: 8px; right: 8px; }
    .wo-shell-post-btn { font-size: 20px; padding: 13px 0; }
    .wo-shell-post-btn::after { content: "+"; }
    .wo-shell-profile-btn { justify-content: center; }
    .wo-shell-profile-more { display: none; }
}

/* Móvil: la barra lateral se convierte en barra inferior tipo Twitter app */
@media (max-width: 820px) {
    .wo-shell-left {
        position: fixed; left: 0; right: 0; top: auto; bottom: 0; width: 100%; height: auto;
        flex-direction: row; align-items: center; justify-content: space-around;
        padding: 6px max(6px, var(--safe-r)) calc(6px + var(--safe-b)) max(6px, var(--safe-l));
        background: var(--bg-header);
        -webkit-backdrop-filter: var(--glass-blur);
        backdrop-filter: var(--glass-blur);
        border-top: 1px solid var(--border-color);
        z-index: 1200;
    }
    .wo-shell-logo, .wo-shell-post-btn, .wo-shell-spacer, .wo-shell-profile-text, .wo-shell-profile-more { display: none; }
    .wo-shell-nav { flex-direction: row; width: 100%; justify-content: space-around; gap: 0; }
    .wo-shell-link { padding: 7px 10px; flex-direction: column; gap: 2px; font-size: 10px; border-radius: var(--radius-sm); }
    .wo-shell-link .wo-shell-ico { font-size: 21px; width: auto; }
    .wo-shell-link .wo-shell-live-dot { position: absolute; top: 2px; right: 10px; margin-left: 0; }
    .wo-shell-profile-btn { padding: 6px; width: auto; }
    .wo-shell-profile-avatar { width: 28px; height: 28px; }
}

/* ---------------------------------------------------------------------
   2. DESPLAZAR TODO EL CONTENIDO EXISTENTE A LA DERECHA DEL RAIL
   --------------------------------------------------------------------- */
body:not(.wo-shell-off) { padding-left: var(--shell-left); }
@media (max-width: 820px) { body:not(.wo-shell-off) { padding-left: 0; padding-bottom: 64px; } }

/* El encabezado superior (ticker + logo/nav/buscador) ya no necesita
   repetir la navegación principal: se simplifica a buscador + reloj. */
body:not(.wo-shell-off) .wo-horizon-dock,
body:not(.wo-shell-off) .wo-brand-area .wo-sidebar-toggle-label,
body:not(.wo-shell-off) .logo-mark,
body:not(.wo-shell-off) .wo-brand-link { display: none; }
body:not(.wo-shell-off) .wo-nav-shell { justify-content: flex-end; gap: 14px; }
@media (max-width: 820px) {
    body:not(.wo-shell-off) .wo-nav-shell { justify-content: space-between; }
    body:not(.wo-shell-off) .wo-brand-link { display: inline-flex; }
}

/* Mantener la franja de categorías y el buscador centrados dentro de la columna central */
body:not(.wo-shell-off) .breaking-ticker,
body:not(.wo-shell-off) .site-header,
body:not(.wo-shell-off) .layout-container,
body:not(.wo-shell-off) .hero-slider-section,
body:not(.wo-shell-off) .site-footer .footer-inner,
body:not(.wo-shell-off) .footer-copy {
    margin-left: auto; margin-right: auto;
}

/* ---------------------------------------------------------------------
   3. COLUMNA CENTRAL + RAIL DERECHO (reemplaza el grid 2-col existente)
   --------------------------------------------------------------------- */
body:not(.wo-shell-off) .layout-container {
    display: grid;
    grid-template-columns: minmax(0, var(--shell-max-center)) var(--shell-right);
    max-width: calc(var(--shell-max-center) + var(--shell-right) + 40px);
    gap: 28px;
}
@media (max-width: 1240px) {
    body:not(.wo-shell-off) .layout-container { grid-template-columns: minmax(0, 1fr) 300px; max-width: 1060px; }
}
@media (max-width: 980px) {
    body:not(.wo-shell-off) .layout-container { grid-template-columns: 1fr; max-width: 640px; }
}

/* Tarjetas del rail derecho con bordes de columna tipo Twitter (sin "cajas" sueltas sino un panel continuo) */
body:not(.wo-shell-off) .wo-sidebars-grid { position: sticky; top: 14px; }
/* En portada (.woticia-view-home) el tema usa un ancho/grid especial de doble sidebar lado a lado:
   lo devolvemos a una sola columna apilada para que quepa en el rail derecho unificado. */
body:not(.wo-shell-off) .woticia-view-home { --max: calc(var(--shell-max-center) + var(--shell-right) + 40px); }
body:not(.wo-shell-off) .woticia-view-home .layout-container {
    grid-template-columns: minmax(0, var(--shell-max-center)) var(--shell-right) !important;
}
body:not(.wo-shell-off) .woticia-view-home .wo-sidebars-grid {
    grid-template-columns: 1fr !important;
}
@media (max-width: 1240px) {
    body:not(.wo-shell-off) .woticia-view-home .layout-container { grid-template-columns: minmax(0, 1fr) 300px !important; }
}
@media (max-width: 980px) {
    body:not(.wo-shell-off) .woticia-view-home .layout-container { grid-template-columns: 1fr !important; }
}

/* ---------------------------------------------------------------------
   4. UNIFICAR WCAFE: oculta el riel izquierdo propio del plugin (duplica
      la navegación que ahora vive en el sidebar global) y ajusta su grid.
   --------------------------------------------------------------------- */
body:not(.wo-shell-off) .wcafe-left-rail { display: none !important; }
@media (min-width: 1024px) {
    body:not(.wo-shell-off) .wcafe-layout { grid-template-columns: minmax(0, var(--shell-max-center)) var(--shell-right) !important; }
}
body:not(.wo-shell-off) .wcafe-app { padding-top: 0.5rem; }
body:not(.wo-shell-off) .wcafe-app::before { inset: -1.5rem calc(-1 * var(--shell-left)) -1.5rem -1rem; }

/* El botón "Perfil" del header (hamburguesa) ya no se necesita: ahora vive abajo del sidebar izquierdo */
body:not(.wo-shell-off) #woSidebarToggle { display: none; }
@media (max-width: 820px) { body:not(.wo-shell-off) #woSidebarToggle { display: inline-flex; } }

/* ---------------------------------------------------------------------
   5. INTERRUPTOR CLARO/OSCURO (visible siempre en el sidebar, no oculto
      en el drawer) + BLOQUE DE LOGIN/REGISTRO + MENÚ DE PERFIL
   --------------------------------------------------------------------- */
.wo-shell-theme-toggle {
    display: flex; gap: 6px; padding: 4px; margin: 6px 4px 10px;
    background: var(--card-alt); border: 1px solid var(--border-color); border-radius: var(--radius-pill);
}
.wo-shell-theme-btn {
    flex: 1; border: none; background: transparent; cursor: pointer; padding: 8px 0; border-radius: var(--radius-pill);
    font-size: 16px; color: var(--text-secondary); transition: var(--transition-smooth);
}
.wo-shell-theme-btn.is-active { background: var(--glass-pill); color: var(--text-primary); box-shadow: inset 0 0 0 1px var(--border-highlight); }
.wo-shell-theme-btn:hover { color: var(--text-primary); }

.wo-shell-auth-box { display: flex; flex-direction: column; gap: 8px; padding: 4px; }
.wo-shell-login-btn, .wo-shell-register-btn {
    display: block; text-align: center; padding: 10px 0; border-radius: var(--radius-pill);
    font-weight: 800; font-size: 14.5px; text-decoration: none; transition: var(--transition-smooth);
}
.wo-shell-login-btn { background: var(--glass-pill); color: var(--text-primary); border: 1px solid var(--border-color); }
.wo-shell-login-btn:hover { background: var(--card-hover); }
.wo-shell-register-btn { background: linear-gradient(135deg, var(--accent-glow), var(--accent-soft)); color: #0a0a0a; }
.wo-shell-register-btn:hover { filter: brightness(1.05); }

.wo-shell-profile-wrap { position: relative; }
.wo-shell-profile-menu {
    position: absolute; bottom: calc(100% + 8px); left: 0; width: 240px;
    background: var(--glass-input); border: 1px solid var(--border-color); border-radius: var(--radius-md);
    box-shadow: var(--glass-shadow); padding: 6px; display: flex; flex-direction: column; gap: 2px; z-index: 950;
    -webkit-backdrop-filter: var(--glass-blur-sm); backdrop-filter: var(--glass-blur-sm);
}
.wo-shell-profile-menu a {
    display: block; padding: 10px 12px; border-radius: var(--radius-sm); text-decoration: none;
    color: var(--text-primary); font-size: 14px; font-weight: 600; transition: var(--transition-smooth);
}
.wo-shell-profile-menu a:hover { background: var(--card-hover); }
.wo-shell-profile-menu a.wo-shell-logout-link { color: var(--danger); }

@media (max-width: 1240px) and (min-width: 821px) {
    .wo-shell-theme-toggle { flex-direction: column; }
    .wo-shell-auth-box .wo-shell-login-btn, .wo-shell-auth-box .wo-shell-register-btn { font-size: 11px; padding: 8px 2px; }
}
@media (max-width: 820px) {
    .wo-shell-theme-toggle, .wo-shell-auth-box, .wo-shell-profile-menu { display: none; }
}

/* ---------------------------------------------------------------------
   6. BUSCADOR GRANDE ESTILO PORTAL (NAVER): más alto, más ancho, con
      botón de "Buscar" explícito para que el envío sea obvio y clicable.
   --------------------------------------------------------------------- */
body:not(.wo-shell-off) .wo-search-naver { padding: 14px max(20px, var(--safe-r)) 18px max(20px, var(--safe-l)); }
body:not(.wo-shell-off) .wo-search-naver .wo-priority-search-form { max-width: 640px; margin: 0 auto; }
body:not(.wo-shell-off) .wo-search-naver .wo-search-input-wrap {
    display: flex; align-items: center; gap: 10px;
    height: 54px; padding: 0 8px 0 20px; border-radius: var(--radius-pill);
    background: var(--glass-input); border: 2px solid var(--border-color);
    transition: var(--transition-smooth);
}
body:not(.wo-shell-off) .wo-search-naver .wo-search-input-wrap:focus-within {
    border-color: var(--accent-glow);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent-glow) 18%, transparent);
}
body:not(.wo-shell-off) .wo-search-naver .wo-search-ico { width: 20px; height: 20px; fill: none; stroke: var(--text-secondary); stroke-width: 2; flex-shrink: 0; }
body:not(.wo-shell-off) .wo-search-naver input#searchInput { flex: 1; background: transparent; border: none; outline: none; font-size: 16px; height: 100%; color: var(--text-primary); min-width: 0; }
body:not(.wo-shell-off) .wo-search-naver .wo-voice-btn { width: 36px; height: 36px; border-radius: 50%; border: none; background: transparent; color: var(--text-secondary); display: grid; place-items: center; flex-shrink: 0; }
body:not(.wo-shell-off) .wo-search-naver .wo-voice-btn:hover { background: var(--card-hover); color: var(--text-primary); }
body:not(.wo-shell-off) .wo-search-naver .wo-voice-btn .wo-mic-ico { width: 17px; height: 17px; }
body:not(.wo-shell-off) .wo-search-submit-btn {
    height: 40px; padding: 0 20px; border-radius: var(--radius-pill); border: none; flex-shrink: 0;
    background: linear-gradient(135deg, var(--accent-glow), var(--accent-soft)); color: #0a0a0a;
    font-weight: 800; font-size: 14px; cursor: pointer; transition: var(--transition-smooth);
}
body:not(.wo-shell-off) .wo-search-submit-btn:hover { filter: brightness(1.06); transform: translateY(-1px); }
@media (max-width: 560px) {
    body:not(.wo-shell-off) .wo-search-submit-btn span { display: none; }
    body:not(.wo-shell-off) .wo-search-submit-btn { padding: 0 16px; }
}

/* ---------------------------------------------------------------------
   7. CORRECCIÓN DE DESBORDE HORIZONTAL
      El padding-left del body + anchos fijos antiguos (vh/vw del fondo
      aurora, calc() del header) producían una barra de scroll horizontal.
   --------------------------------------------------------------------- */
html, body { max-width: 100%; overflow-x: hidden; }
body:not(.wo-shell-off) .site-header,
body:not(.wo-shell-off) .breaking-ticker,
body:not(.wo-shell-off) body::before { width: 100%; }
body:not(.wo-shell-off) .wo-nav-shell,
body:not(.wo-shell-off) .header-top-row { max-width: 100%; }
/* El fondo aurora se dibuja con position:fixed e inset:0 por lo que no necesita ancho propio;
   lo que desbordaba era el ticker/categorías con anchos en vw sin contar el nuevo padding del body. */
body:not(.wo-shell-off) .wo-category-tape-inner,
body:not(.wo-shell-off) .ticker-wrap { max-width: 100%; }
