/* WOTICIA Comunidad · estilos. Usa las variables del tema (cristal, bordes, acentos) con valores de respaldo. */
/* El atributo hidden SIEMPRE gana: sin esto, una clase con su propio "display" (p. ej. display:flex) lo anula
   silenciosamente en cualquier navegador, porque una regla de autor empata o supera a la hoja del navegador. */
[hidden] { display: none !important; }
.woc-modal, .woc-header, .woc-toasts { --woc-accent: var(--accent-glow, #38bdf8); --woc-border: var(--border-color, rgba(255,255,255,.12)); --woc-border-hi: var(--border-highlight, rgba(255,255,255,.22)); --woc-muted: var(--text-secondary, #aab0bd); --woc-text: var(--text-primary, #f6f6f8); --woc-danger: #ff4d6d; --woc-ok: #39ff14; }
.woc-header[hidden], .woc-header [hidden], .woc-modal[hidden], .woc-modal [hidden] { display: none !important; }
html.woc-lock { overflow: hidden; }

/* ---------- Cabecera ---------- */
.woc-header { position: relative; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.woc-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 38px; padding: 0 16px;
    border-radius: 999px; font: 700 13px/1 inherit; letter-spacing: .01em; cursor: pointer; white-space: nowrap;
    border: 1px solid var(--woc-border); transition: transform .18s, background .18s, border-color .18s, box-shadow .18s, filter .18s;
}
.woc-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.woc-btn-ghost { background: var(--glass-pill, rgba(255,255,255,.07)); color: var(--woc-text); }
.woc-btn-ghost:hover { background: rgba(255,255,255,.14); border-color: var(--woc-border-hi); transform: translateY(-1px); }
.woc-btn-primary { background: linear-gradient(135deg, #38bdf8, #818cf8); color: #06101c; border-color: transparent; box-shadow: 0 6px 18px -6px rgba(56,189,248,.65); }
.woc-btn-primary:hover { filter: brightness(1.08); transform: translateY(-1px); }
.woc-btn:focus-visible, .woc-user:focus-visible, .woc-like:focus-visible, .woc-follow:focus-visible, .woc-link:focus-visible { outline: 2px solid var(--woc-accent); outline-offset: 2px; }

.woc-user {
    display: inline-flex; align-items: center; gap: 9px; min-height: 40px; padding: 4px 12px 4px 4px; max-width: 220px;
    border-radius: 999px; border: 1px solid var(--woc-border); background: var(--glass-pill, rgba(255,255,255,.07)); color: var(--woc-text);
    font: 700 13px/1 inherit; cursor: pointer; transition: background .18s, border-color .18s;
}
.woc-user:hover, .woc-user[aria-expanded="true"] { background: rgba(255,255,255,.14); border-color: var(--woc-border-hi); }
.woc-user-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 130px; }
.woc-chev { width: 14px; height: 14px; flex-shrink: 0; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; opacity: .7; transition: transform .2s; }
.woc-user[aria-expanded="true"] .woc-chev { transform: rotate(180deg); }

.woc-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; object-fit: cover; display: inline-grid; place-items: center; font: 800 12px/1 inherit; color: #06101c; background: linear-gradient(135deg, var(--c, #38bdf8), color-mix(in srgb, var(--c, #38bdf8) 55%, #000)); box-shadow: 0 0 0 2px rgba(255,255,255,.14); }
.woc-avatar-lg { width: 44px; height: 44px; font-size: 15px; }
.woc-avatar-xl { width: 76px; height: 76px; font-size: 26px; box-shadow: 0 0 0 3px rgba(255,255,255,.16), 0 8px 24px -8px rgba(0,0,0,.7); }

.woc-menu {
    position: absolute; right: 0; top: calc(100% + 10px); z-index: 1300; width: 250px; padding: 8px;
    background: linear-gradient(165deg, rgba(30,34,52,.94), rgba(14,16,26,.95)); -webkit-backdrop-filter: blur(22px) saturate(180%); backdrop-filter: blur(22px) saturate(180%);
    border: 1px solid var(--woc-border-hi); border-radius: 18px; box-shadow: 0 22px 50px -10px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.12);
    animation: woc-drop .16s ease-out;
}
@keyframes woc-drop { from { opacity: 0; transform: translateY(-6px) scale(.98); } }
.woc-menu-head { display: flex; align-items: center; gap: 11px; padding: 8px 8px 12px; margin-bottom: 6px; border-bottom: 1px solid var(--woc-border); min-width: 0; }
.woc-menu-head div { min-width: 0; }
.woc-menu-head strong, .woc-menu-head small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.woc-menu-head strong { font-size: 14px; color: #fff; }
.woc-menu-head small { font-size: 12px; color: var(--woc-muted); }
.woc-menu > button { display: block; width: 100%; text-align: left; padding: 11px 12px; border: 0; border-radius: 11px; background: transparent; color: var(--woc-text); font: 600 13.5px/1 inherit; cursor: pointer; }
.woc-menu > button:hover, .woc-menu > button:focus-visible { background: rgba(56,189,248,.16); outline: 0; }
.woc-menu .woc-menu-out { color: #ff8da1; margin-top: 4px; border-top: 1px solid var(--woc-border); border-radius: 0 0 11px 11px; }
.woc-menu .woc-menu-out:hover { background: rgba(255,77,109,.16); }

/* ---------- Ventana ---------- */
.woc-modal { position: fixed; inset: 0; z-index: 2000; display: grid; place-items: center; padding: 16px; }
.woc-backdrop { position: absolute; inset: 0; background: rgba(3,4,9,.66); -webkit-backdrop-filter: blur(7px); backdrop-filter: blur(7px); opacity: 0; transition: opacity .18s; }
.woc-dialog {
    position: relative; width: min(450px, 100%); max-height: min(92vh, 780px); overflow-y: auto; padding: 28px 26px 24px; outline: 0;
    background: linear-gradient(160deg, rgba(32,36,56,.95), rgba(13,15,25,.96)); -webkit-backdrop-filter: blur(26px) saturate(180%); backdrop-filter: blur(26px) saturate(180%);
    border: 1px solid var(--woc-border-hi); border-radius: 26px; box-shadow: 0 30px 80px -12px rgba(0,0,0,.85), inset 0 1px 0 rgba(255,255,255,.14);
    color: var(--woc-text); opacity: 0; transform: translateY(14px) scale(.97); transition: opacity .18s, transform .22s cubic-bezier(.22,1,.36,1);
}
.woc-dialog::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 3px; border-radius: 26px 26px 0 0; background: linear-gradient(90deg, #38bdf8, #b026ff, #ff007f, #39ff14); opacity: .85; }
.woc-modal.is-open .woc-backdrop { opacity: 1; }
.woc-modal.is-open .woc-dialog { opacity: 1; transform: none; }
.woc-x { position: absolute; top: 14px; right: 14px; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--woc-border); background: rgba(255,255,255,.06); color: var(--woc-muted); font-size: 14px; cursor: pointer; }
.woc-x:hover { color: #fff; background: rgba(255,255,255,.14); }
.woc-title { margin: 2px 40px 6px 0; font-size: 22px; font-weight: 800; letter-spacing: -.01em; color: #fff; }
.woc-sub { margin: 0 0 16px; font-size: 13.5px; line-height: 1.5; color: var(--woc-muted); }
.woc-tabs { display: flex; gap: 4px; padding: 4px; margin: 12px 0 18px; border-radius: 999px; background: rgba(0,0,0,.3); border: 1px solid var(--woc-border); }
.woc-tabs button { flex: 1; min-height: 36px; border: 0; border-radius: 999px; background: transparent; color: var(--woc-muted); font: 700 13px/1 inherit; cursor: pointer; }
.woc-tabs button.is-on { background: linear-gradient(135deg, #38bdf8, #818cf8); color: #06101c; }

.woc-form { display: flex; flex-direction: column; gap: 14px; }
.woc-form h3 { margin: 4px 0 0; font-size: 15px; font-weight: 800; color: #fff; }
.woc-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.woc-f { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.woc-f > span:first-child { font-size: 12px; font-weight: 700; color: var(--woc-muted); letter-spacing: .02em; display: flex; justify-content: space-between; }
.woc-f em { font-style: normal; font-weight: 500; opacity: .75; }
.woc-f input:not([type=checkbox]):not([type=file]), .woc-f textarea {
    width: 100%; padding: 12px 14px; border-radius: 13px; border: 1px solid var(--woc-border); background: var(--glass-input, rgba(5,7,13,.45)); color: #fff;
    font: 500 15px/1.3 inherit; outline: 0; transition: border-color .15s, box-shadow .15s;
}
.woc-f textarea { resize: vertical; min-height: 78px; line-height: 1.45; }
.woc-f input::placeholder, .woc-f textarea::placeholder { color: rgba(170,176,189,.55); }
.woc-f input:focus, .woc-f textarea:focus { border-color: var(--woc-accent); box-shadow: 0 0 0 3px rgba(56,189,248,.18); }
.woc-f input[aria-invalid="true"] { border-color: var(--woc-danger); box-shadow: 0 0 0 3px rgba(255,77,109,.16); }
.woc-f input:disabled { opacity: .55; cursor: not-allowed; }
.woc-pw { position: relative; display: block; }
.woc-pw input { padding-right: 46px !important; }
.woc-eye { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border: 0; border-radius: 50%; background: transparent; color: var(--woc-muted); cursor: pointer; display: grid; place-items: center; }
.woc-eye svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.woc-eye.is-on { color: var(--woc-accent); }
.woc-meter { display: block; height: 4px; border-radius: 4px; background: rgba(255,255,255,.1); overflow: hidden; }
.woc-meter b { display: block; height: 100%; width: 0; border-radius: 4px; transition: width .2s, background .2s; }
.woc-meter[data-s="0"] b { width: 12%; background: #ff4d6d; } .woc-meter[data-s="1"] b { width: 32%; background: #ff8a4c; }
.woc-meter[data-s="2"] b { width: 56%; background: #f5c542; } .woc-meter[data-s="3"] b { width: 78%; background: #8be04b; } .woc-meter[data-s="4"] b { width: 100%; background: #39ff14; }
.woc-check { display: flex; align-items: center; gap: 9px; font-size: 13.5px; color: var(--woc-muted); cursor: pointer; }
.woc-check input { width: 17px; height: 17px; accent-color: #38bdf8; }
.woc-hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.woc-err { margin: 0; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; color: #ffc2cc; background: rgba(255,77,109,.12); border: 1px solid rgba(255,77,109,.4); }
.woc-okmsg { margin: 0; padding: 10px 13px; border-radius: 12px; font-size: 13.5px; line-height: 1.4; color: #c9ffb8; background: rgba(57,255,20,.1); border: 1px solid rgba(57,255,20,.35); }
.woc-submit { min-height: 46px; border: 0; border-radius: 14px; background: linear-gradient(135deg, #38bdf8, #818cf8); color: #06101c; font: 800 15px/1 inherit; cursor: pointer; box-shadow: 0 10px 26px -10px rgba(56,189,248,.7); transition: filter .15s, transform .15s; }
.woc-submit:hover:not(:disabled) { filter: brightness(1.08); transform: translateY(-1px); }
.woc-submit:disabled { opacity: .65; cursor: progress; }
.woc-form.is-busy .woc-submit::after { content: ""; display: inline-block; width: 14px; height: 14px; margin-left: 9px; vertical-align: -2px; border: 2px solid rgba(6,16,28,.35); border-top-color: #06101c; border-radius: 50%; animation: woc-spin .7s linear infinite; }
@keyframes woc-spin { to { transform: rotate(360deg); } }
.woc-submit-danger { background: linear-gradient(135deg, #ff4d6d, #ff007f); color: #fff; box-shadow: 0 10px 26px -10px rgba(255,0,127,.6); }
.woc-link { padding: 0; border: 0; background: none; color: var(--woc-accent); font: 700 13.5px/1.2 inherit; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.woc-link:hover { filter: brightness(1.2); }
.woc-alt { margin: 14px 0 0; text-align: center; font-size: 13.5px; color: var(--woc-muted); }
.woc-since { margin: 14px 0 0; text-align: center; font-size: 12px; color: var(--woc-muted); }
.woc-danger { margin-top: 22px; padding-top: 20px; border-top: 1px dashed rgba(255,77,109,.4); }
.woc-danger h3 { color: #ff8da1; }

.woc-avatar-edit { display: flex; align-items: center; gap: 16px; }
.woc-avatar-edit > div { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.woc-avatar-edit small { color: var(--woc-muted); font-size: 12px; }
.woc-file { position: relative; overflow: hidden; min-height: 36px; font-size: 13px; }
.woc-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.woc-favlist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.woc-favlist li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(255,255,255,.05); border: 1px solid var(--woc-border); }
.woc-favlist a { font-weight: 700; color: #fff; text-decoration: none; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.woc-favlist a:hover { color: var(--woc-accent); }
.woc-favlist .woc-link { color: #ff8da1; flex-shrink: 0; }
.woc-skel { height: 46px; border-radius: 14px; background: linear-gradient(90deg, rgba(255,255,255,.05), rgba(255,255,255,.12), rgba(255,255,255,.05)); background-size: 200% 100%; animation: woc-sh 1.2s linear infinite; }
@keyframes woc-sh { to { background-position: -200% 0; } }
.woc-empty { margin: 0; padding: 18px; text-align: center; font-size: 13.5px; color: var(--woc-muted); border: 1px dashed var(--woc-border-hi); border-radius: 14px; }

/* ---------- «Me gusta» y «Seguir» ---------- */
.woc-like, .woc-follow {
    display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--woc-border); background: var(--glass-pill, rgba(255,255,255,.07)); color: var(--woc-muted);
    font: 700 13px/1 inherit; cursor: pointer; transition: color .15s, background .15s, border-color .15s, transform .15s; -webkit-tap-highlight-color: transparent;
}
.woc-like svg, .woc-follow svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linejoin: round; transition: fill .15s; }
.woc-like-sm { min-height: 32px; padding: 0 12px; border-radius: 999px; }
.woc-like-lg { min-height: 42px; padding: 0 18px; border-radius: 999px; font-size: 14px; }
.woc-like-lg svg { width: 20px; height: 20px; }
.woc-like:hover { color: #ff6fa8; border-color: rgba(255,0,127,.5); }
.woc-like.is-on { color: #ff2e8f; background: rgba(255,0,127,.14); border-color: rgba(255,0,127,.55); }
.woc-like.is-on svg { fill: currentColor; filter: drop-shadow(0 0 6px rgba(255,0,127,.7)); }
.woc-like.woc-pop svg { animation: woc-pop .42s cubic-bezier(.2,1.6,.4,1); }
@keyframes woc-pop { 0% { transform: scale(.7); } 55% { transform: scale(1.35); } 100% { transform: scale(1); } }
.woc-like-n:empty { display: none; }
.woc-follow { min-height: 34px; padding: 0 14px; border-radius: 999px; }
.woc-follow:hover { color: #f5c542; border-color: rgba(245,158,11,.55); }
.woc-follow.is-on { color: #f5c542; background: rgba(245,158,11,.14); border-color: rgba(245,158,11,.55); }
.woc-follow.is-on svg { fill: currentColor; }
.woc-follow:disabled { opacity: .6; cursor: progress; }

/* ---------- Avisos ---------- */
.woc-toasts { position: fixed; z-index: 2100; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: min(92vw, 420px); }
.woc-toast { padding: 12px 18px; border-radius: 14px; font: 600 14px/1.35 inherit; color: #fff; text-align: center; background: linear-gradient(160deg, rgba(36,40,62,.96), rgba(16,18,30,.97)); border: 1px solid var(--woc-border-hi); box-shadow: 0 16px 40px -10px rgba(0,0,0,.8); opacity: 0; transform: translateY(10px); transition: opacity .22s, transform .22s; }
.woc-toast.is-in { opacity: 1; transform: none; }
.woc-toast-ok { border-color: rgba(57,255,20,.5); } .woc-toast-err { border-color: rgba(255,77,109,.6); }

/* ---------- Integración con el tema ---------- */
.news-row-actions { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.woc-home-feed .magazine-title { color: #f5c542; }
@media (min-width: 641px) { .header-top-row > .woc-header { margin-left: 4px; } }

/* ---------- Móvil ---------- */
@media (max-width: 640px) {
    /* El widget pasa a la fila del buscador: logo | clima+hora  /  buscador | cuenta */
    body.woc-active .header-top-row { grid-template-areas: "brand widgets" "search account"; grid-template-columns: minmax(0, 1fr) auto; }
    body.woc-active .header-top-row > .woc-header { grid-area: account; }
    .woc-btn-primary { display: none; }
    .woc-btn-ghost { width: 44px; min-height: 44px; padding: 0; border-radius: 50%; }
    .woc-btn-ghost .woc-lbl { display: none; }
    .woc-btn-ghost svg { width: 20px; height: 20px; }
    .woc-user { padding: 3px; min-height: 44px; border-radius: 50%; }
    .woc-user .woc-avatar { width: 38px; height: 38px; }
    .woc-user-name, .woc-user .woc-chev { display: none; }
    .woc-menu { position: fixed; right: 12px; left: auto; top: auto; width: min(290px, calc(100vw - 24px)); }
    .woc-modal { align-items: end; padding: 0; }
    .woc-dialog { width: 100%; max-height: 94vh; border-radius: 26px 26px 0 0; padding: 26px 20px calc(22px + env(safe-area-inset-bottom, 0px)); transform: translateY(40px); }
    .woc-dialog::before { border-radius: 26px 26px 0 0; }
    .woc-row { grid-template-columns: 1fr; }
    .woc-f input:not([type=checkbox]):not([type=file]), .woc-f textarea { font-size: 16px; }   /* evita el zoom de iOS al enfocar */
    .woc-like-sm { min-height: 36px; }
    .woc-toasts { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
}
@media (prefers-reduced-motion: reduce) { .woc-dialog, .woc-backdrop, .woc-toast, .woc-menu { transition: none; animation: none; } .woc-like.woc-pop svg { animation: none; } }

/* ---------- Tarjetas de noticias (mag-card): el botón flota sobre la miniatura ---------- */
.mag-card-wrap { position: relative; }
.mag-card-wrap .woc-like { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(5,6,11,.55); border-color: rgba(255,255,255,.22); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.mag-card-wrap .woc-like .woc-like-n:empty + svg, .mag-card-wrap .woc-like .woc-like-n { font-size: 12px; }

/* ---------- Variante grande del botón «Seguir» (cabecera de una fuente) ---------- */
.woc-follow-lg { min-height: 42px; padding: 0 20px; font-size: 14px; }
.woc-follow-lg svg { width: 19px; height: 19px; }
.source-head { flex-wrap: wrap; row-gap: 10px; }

/* ---------- Noticia individual: fila del botón grande de «me gusta» ---------- */
.post-like-row { margin: 18px 0 4px; }

/* ---------- «Comentando como…» (con sesión iniciada) ---------- */
.comment-as-me { display: flex; align-items: center; gap: 9px; margin-bottom: 10px; font-size: 13.5px; color: var(--woc-muted); }
.comment-as-me strong { color: #fff; }
.woc-avatar-sm { width: 26px; height: 26px; font-size: 11px; }

/* ---------- Invitación a registrarse en el formulario de comentarios ---------- */
.comment-guest-hint { margin: 0 0 12px; padding: 11px 14px; border-radius: 13px; font-size: 13px; line-height: 1.5; color: var(--woc-muted); background: rgba(56,189,248,.08); border: 1px dashed rgba(56,189,248,.35); }
.comment-guest-hint .woc-link { color: var(--woc-accent); }

/* ---------- Comentario recién publicado: un breve resplandor para distinguirlo del resto ---------- */
.comment-item:target, .reply-item:target { animation: woc-comment-new 2.4s ease-out; border-radius: var(--radius-md, 16px); }
@keyframes woc-comment-new {
    0%   { box-shadow: 0 0 0 2px rgba(56,189,248,.65), 0 0 24px rgba(56,189,248,.35); background: rgba(56,189,248,.08); }
    100% { box-shadow: 0 0 0 0 rgba(56,189,248,0); background: transparent; }
}
@media (prefers-reduced-motion: reduce) { .comment-item:target, .reply-item:target { animation: none; outline: 2px solid var(--woc-accent); } }

/* ---------- Chulo de verificación (fuentes: pegado al nombre del feed) ---------- */
.post-source-label, .meta-source-label, .tv6-author-name-wrap, .cafe-row-author { display: inline-flex; align-items: center; gap: 3px; }
.woc-verified, .cafe-verified { width: 14px; height: 14px; flex-shrink: 0; display: inline-block; vertical-align: middle; margin: 0 0 0 1px !important; }
.meta .woc-verified { width: 12px; height: 12px; margin: 0 0 0 1px !important; }
.post-source-name .woc-verified { width: 15px; height: 15px; margin: 0 0 0 2px !important; }

/* ---------- Barra de fuente en la noticia: botón «Fuente ↗» más discreto, junto a la hora ---------- */
.post-source-right { gap: 10px; }
.post-go-site-btn {
    padding: 5px 12px; font-size: 11.5px; background: var(--glass-pill, rgba(255,255,255,.08)); color: var(--woc-muted, #aab0bd);
    border: 1px solid var(--woc-border, rgba(255,255,255,.12));
}
.post-go-site-btn:hover { background: rgba(255,255,255,.14); color: #fff; transform: none; }
@media (max-width: 640px) {
    .post-source-right { justify-content: space-between; }
}

/* ---------- Modo Claro ---------- */
html[data-theme="light"] .woc-menu,
html[data-theme="light"] .woc-dialog,
html[data-theme="light"] .woc-toast {
    background: rgba(255, 255, 255, 0.98);
    color: #0f172a;
    box-shadow: 0 22px 50px -10px rgba(15, 23, 42, 0.22);
}
html[data-theme="light"] .woc-menu-head strong,
html[data-theme="light"] .woc-title,
html[data-theme="light"] .woc-form h3,
html[data-theme="light"] .woc-favlist a,
html[data-theme="light"] .comment-as-me strong {
    color: #0f172a;
}
html[data-theme="light"] .woc-f input:not([type=checkbox]):not([type=file]),
html[data-theme="light"] .woc-f textarea {
    background: #f8fafc;
    color: #0f172a;
}

