/* ============================================================
   AM0R — capa emocional, humana y artística de n0w
   Lenguaje visual: CONEXIÓN (nodos, relaciones, HumanLens)
   con el silencio y la luz de PRESENCIA, y la materia de ORGÁNICA.

   Regla: no toca JS, no cambia IDs/hooks. Solo superpone lenguaje
   visual sobre los selectores existentes de la vista feed (Home
   móvil del Modo 0). Mobile-first: base 360×800.

   Direcciones de identidad:
   - C (CONEXIÓN)  nodos, presencias, líneas, HumanLens
   - B (PRESENCIA) espacio, silencio, luz
   - A (ORGÁNICA)  grano, deriva, materia digital
   ============================================================ */

/* ── Tokens AM0R (derivan de los tokens base; no los sustituyen) ── */
#viewFeed{
  --am0r-ink:#090909;
  --am0r-ink-soft:rgba(9,9,9,.62);
  --am0r-gold:#B98A2F;
  --am0r-gold-soft:rgba(185,138,47,.10);
  --am0r-line:rgba(9,9,9,.06);
  --am0r-air:28px;                 /* aire base entre presencias */
  --am0r-radius:22px;              /* materia contenida, no tarjetas */
  --am0r-ease:cubic-bezier(.22,1,.36,1);
  position:relative;
  isolation:isolate;
}

body[data-theme="dark"] #viewFeed,
html[data-theme="dark"] #viewFeed{
  --am0r-ink:#EDEAE2;
  --am0r-ink-soft:rgba(237,234,226,.6);
  --am0r-gold:#D9B25E;
  --am0r-gold-soft:rgba(217,178,94,.10);
  --am0r-line:rgba(237,234,226,.08);
}

/* ============================================================
   ATMÓSFERA — fondo vivo, generativo, ligero (solo CSS)
   ============================================================ */
.am0r-atmo{
  position:absolute;
  inset:0;
  z-index:0;
  overflow:hidden;
  pointer-events:none;             /* nunca roza la interacción */
  background:
    radial-gradient(120% 90% at 12% 6%, var(--am0r-gold-soft) 0%, transparent 46%),
    radial-gradient(110% 80% at 88% 92%, rgba(196,168,130,.10) 0%, transparent 50%),
    linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.6) 100%);
}
body.dark-mode #viewFeed .am0r-atmo,
body[data-theme="dark"] #viewFeed .am0r-atmo,
html[data-theme="dark"] #viewFeed .am0r-atmo{
  background:
    radial-gradient(120% 90% at 12% 6%, var(--am0r-gold-soft) 0%, transparent 46%),
    radial-gradient(110% 80% at 88% 92%, rgba(217,178,94,.06) 0%, transparent 50%),
    linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.35) 100%);
}

/* ── Deriva: tres campos de luz que respiran (movimiento lento) ── */
.am0r-drift{
  position:absolute;
  border-radius:50%;
  filter:blur(34px);
  opacity:.5;
  will-change:transform;
}
.am0r-drift-1{
  width:46vmax;height:46vmax;top:-18vmax;right:-14vmax;
  background:radial-gradient(circle, rgba(232,201,119,.34) 0%, transparent 68%);
  animation:am0rDrift1 34s var(--am0r-ease) infinite alternate;
}
.am0r-drift-2{
  width:38vmax;height:38vmax;bottom:-16vmax;left:-12vmax;
  background:radial-gradient(circle, rgba(122,139,106,.22) 0%, transparent 66%);
  animation:am0rDrift2 44s var(--am0r-ease) infinite alternate;
}
.am0r-drift-3{
  width:26vmax;height:26vmax;top:34%;left:56%;
  background:radial-gradient(circle, rgba(196,168,130,.26) 0%, transparent 70%);
  animation:am0rDrift3 28s var(--am0r-ease) infinite alternate;
}
@keyframes am0rDrift1{
  0%{transform:translate3d(0,0,0) scale(1)}
  100%{transform:translate3d(-6vmax,4vmax,0) scale(1.14)}
}
@keyframes am0rDrift2{
  0%{transform:translate3d(0,0,0) scale(1)}
  100%{transform:translate3d(5vmax,-5vmax,0) scale(1.1)}
}
@keyframes am0rDrift3{
  0%{transform:translate3d(0,0,0) scale(.94)}
  100%{transform:translate3d(-3vmax,-3vmax,0) scale(1.06)}
}

/* ── Grano digital (materia, sin fotogramas extra) ── */
.am0r-grain{
  position:absolute;
  inset:-60px;
  opacity:.05;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.6'/%3E%3C/svg%3E");
  animation:am0rGrain 14s steps(4) infinite;
}
@keyframes am0rGrain{
  0%{transform:translate3d(0,0,0)}
  25%{transform:translate3d(18px,-12px,0)}
  50%{transform:translate3d(-14px,16px,0)}
  75%{transform:translate3d(10px,-20px,0)}
  100%{transform:translate3d(0,0,0)}
}

/* ── Presencias: nodos mínimos que pul san (conexión latente) ── */
.am0r-node{
  position:absolute;
  width:7px;height:7px;
  border-radius:50%;
  background:var(--am0r-gold);
  box-shadow:0 0 0 0 var(--am0r-gold-soft);
  opacity:.38;
  animation:am0rNodePulse 9s ease-in-out infinite;
}
.am0r-node-1{top:18%;left:14%;animation-delay:.2s}
.am0r-node-2{top:30%;right:16%;animation-delay:2.4s}
.am0r-node-3{bottom:24%;left:24%;animation-delay:4.6s}
.am0r-node-4{top:52%;right:26%;animation-delay:6.2s}
.am0r-node-5{bottom:34%;right:8%;animation-delay:8s}
@keyframes am0rNodePulse{
  0%,100%{opacity:.18;transform:scale(.8);box-shadow:0 0 0 0 var(--am0r-gold-soft)}
  50%{opacity:.5;transform:scale(1.15);box-shadow:0 0 0 10px rgba(185,138,47,0)}
}

/* ============================================================
   PROFUNDIDAD — contenido flota sobre la atmósfera
   ============================================================ */
#viewFeed .fi-scroll{
  position:relative;
  z-index:1;
  padding-top:8px;
}

/* ============================================================
   TIPOGRAFÍA — la voz AM0R: jerarquía fuerte, pocas palabras,
   mucho espacio. El header deja de ser "tarjeta" y pasa a ser
   una frase abierta.
   ============================================================ */
#viewFeed .actuality-header{
  padding:28px 24px 10px;
  background:transparent;
}
#viewFeed .actuality-kicker{
  display:inline-flex;
  align-items:center;
  gap:8px;
  margin-bottom:8px;
  color:var(--am0r-gold);
  font-size:.66rem;
  font-weight:700;
  letter-spacing:.16em;
  text-transform:uppercase;
}
#viewFeed .actuality-kicker::before{
  content:"";
  width:18px;height:1px;
  background:var(--am0r-gold);
  opacity:.7;
}
#viewFeed .actuality-header h1{
  font-family:var(--serif);
  font-size:clamp(2.4rem,12vw,3.4rem);
  font-weight:380;
  letter-spacing:-.04em;
  line-height:.96;
  color:var(--am0r-ink);
}
#viewFeed .actuality-header p{
  max-width:34ch;
  margin-top:12px;
  color:var(--am0r-ink-soft);
  font-size:.85rem;
  font-weight:400;
  line-height:1.6;
}

/* ============================================================
   PRESENCIAS (pulse) — personas activas como respiración
   ============================================================ */
#viewFeed .actuality-pulse{
  margin-top:6px;
  padding:10px 24px 14px;
  background:transparent;
  border-bottom:1px solid var(--am0r-line);
}
#viewFeed .actuality-pulse-item{
  color:var(--am0r-ink-soft);
  font-size:.64rem;
}
#viewFeed .actuality-pulse-ring{
  transition:transform .4s var(--am0r-ease);
}
#viewFeed .actuality-pulse-item:hover .actuality-pulse-ring{
  transform:scale(1.06);
}

/* ============================================================
   LA CORRIENTE — menos tarjetas, más presencias.
   Los items dejan de ser cajas separadas por líneas 1px y pasan
   a ser fragmentos con aire, conexión y aparición progresiva.
   ============================================================ */
#viewFeed .feed-list{
  gap:18px;
  padding:16px 16px 80px;
  background:transparent;
}
#viewFeed .actuality-card{
  position:relative;
  border-radius:var(--am0r-radius);
  border:1px solid var(--am0r-line);
  background:rgba(255,255,255,.58);
  box-shadow:0 1px 0 rgba(255,255,255,.6) inset, 0 18px 40px -28px rgba(9,9,9,.22);
  overflow:visible;             /* no recorta menús/popovers que flotan fuera */
  animation:am0rPresenceIn .5s var(--am0r-ease) both;
}
body.dark-mode #viewFeed .actuality-card,
body[data-theme="dark"] #viewFeed .actuality-card,
html[data-theme="dark"] #viewFeed .actuality-card{
  background:rgba(24,23,20,.6);
  box-shadow:0 1px 0 rgba(255,255,255,.04) inset, 0 18px 40px -28px rgba(0,0,0,.5);
}
@keyframes am0rPresenceIn{
  from{opacity:0;transform:translateY(14px)}
  to{opacity:1;transform:translateY(0)}
}
#viewFeed .actuality-card:nth-child(1){animation-delay:.03s}
#viewFeed .actuality-card:nth-child(2){animation-delay:.08s}
#viewFeed .actuality-card:nth-child(3){animation-delay:.13s}
#viewFeed .actuality-card:nth-child(4){animation-delay:.18s}
#viewFeed .actuality-card:nth-child(5){animation-delay:.23s}
#viewFeed .actuality-card:nth-child(n+6){animation-delay:.28s}

/* ── Microinteracción: tocar = respuesta física mínima ── */
#viewFeed .actuality-card:active{
  transform:scale(.985);
  transition:transform .12s var(--am0r-ease);
}
#viewFeed .actuality-card-header{
  padding:12px 14px 8px;
}
#viewFeed .actuality-author strong{
  font-size:.84rem;
  font-weight:650;
  letter-spacing:-.01em;
}
#viewFeed .actuality-caption{
  font-size:.88rem;
  line-height:1.62;
}
#viewFeed .actuality-card-body{
  padding:6px 14px 14px;
}

/* ============================================================
   FILTROS Y BÚSQUEDA — más aire, menos botonera.
   ============================================================ */
#viewFeed .feed-filters{
  gap:6px;
  padding:4px 16px 10px;
  background:transparent;
  border:none;
  overflow-x:auto;
  scrollbar-width:none;
}
#viewFeed .feed-filters::-webkit-scrollbar{display:none}
#viewFeed .feed-filters .eco-filter{
  padding:11px 16px;
  border-radius:999px;
  border:1px solid var(--am0r-line);
  background:rgba(255,255,255,.5);
  color:var(--am0r-ink-soft);
  font-size:.76rem;
  font-weight:550;
  white-space:nowrap;
  min-height:44px;
  transition:background .25s, color .25s, border-color .25s, transform .15s var(--am0r-ease);
}
#viewFeed .feed-filters .eco-filter:active{transform:scale(.96)}
#viewFeed .feed-filters .eco-filter.active{
  background:var(--am0r-gold-soft);
  border-color:rgba(185,138,47,.28);
  color:var(--am0r-gold);
  font-weight:650;
}
#viewFeed .feed-toolbar{
  padding:2px 16px 8px;
}
#viewFeed .feed-search-input{
  border-radius:999px;
  border-color:var(--am0r-line);
  background:rgba(255,255,255,.5);
  min-height:44px;
}
#viewFeed .feed-sort-btn{
  border-radius:999px;
  min-height:44px;
}
#viewFeed .feed-type-filters{
  padding:2px 16px 10px;
}
#viewFeed .feed-type-filter{
  border-radius:999px;
  min-height:44px;
}
#viewFeed .feed-type-filter.is-selected{
  background:var(--am0r-gold-soft);
  border-color:rgba(185,138,47,.28);
  color:var(--am0r-gold);
}

/* ============================================================
   "MÁS DE LA CORRIENTE" — invita, no grita.
   ============================================================ */
#viewFeed .feed-load-more-wrap{
  padding:20px 16px 6px;
}
#viewFeed .feed-load-more{
  border-radius:999px;
  border:1px solid var(--am0r-line);
  background:rgba(255,255,255,.5);
  color:var(--am0r-ink-soft);
  font-size:.8rem;
  font-weight:550;
  min-height:46px;
  padding:0 26px;
  transition:border-color .25s, color .25s, transform .15s var(--am0r-ease);
}
#viewFeed .feed-load-more:active{transform:scale(.97)}
#viewFeed .feed-load-more:hover{
  border-color:rgba(185,138,47,.4);
  color:var(--am0r-gold);
}

/* ============================================================
   ESTADOS — carga y vacío con calma.
   ============================================================ */
#viewFeed .actuality-loading,
#viewFeed .actuality-empty{
  background:transparent;
  border:none;
  box-shadow:none;
}
#viewFeed .actuality-empty h2{
  font-family:var(--serif);
  font-weight:400;
  color:var(--am0r-ink);
}
#viewFeed .actuality-empty p{
  color:var(--am0r-ink-soft);
  font-size:.84rem;
}

/* ============================================================
   MOVIMIENTO REDUCIDO — todo lo vivo se calma.
   ============================================================ */
@media (prefers-reduced-motion: reduce){
  #viewFeed .am0r-drift,
  #viewFeed .am0r-grain,
  #viewFeed .am0r-node,
  #viewFeed .actuality-card{
    animation:none !important;
  }
  #viewFeed .actuality-card,
  #viewFeed .actuality-card:active,
  #viewFeed .feed-filters .eco-filter:active,
  #viewFeed .feed-load-more:active{
    transform:none !important;
    transition:none !important;
  }
  #viewFeed .actuality-pulse-ring{
    transition:none;
  }
}

/* ============================================================
   AJUSTES MÓVILES — verificación en 390 y 412.
   ============================================================ */
@media (min-width:391px){
  #viewFeed .actuality-header h1{
    font-size:clamp(2.6rem,11vw,3.4rem);
  }
  #viewFeed .feed-list{
    padding:18px 18px 80px;
  }
}
@media (min-width:413px){
  #viewFeed .feed-list{
    padding:20px 20px 80px;
  }
}

/* ============================================================
   TABLETA / DESKTOP — el lenguaje se mantiene, con más aire.
   ============================================================ */
@media (min-width:768px){
  #viewFeed .fi-scroll{
    padding-top:20px;
  }
  #viewFeed .actuality-header{
    padding:44px 28px 16px;
  }
  #viewFeed .actuality-card{
    border-radius:26px;
  }
  #viewFeed .feed-list{
    padding:20px 20px 100px;
  }
}
