/* =========================================================
   Hylzen — estilos base
   ========================================================= */

:root {
  --font-display: 'Manrope', 'Inter', sans-serif;
  --font-body: 'Inter', sans-serif;

  --accent-a: #22d3ee;
  --accent-b: #7c5cff;
  --accent-grad: linear-gradient(135deg, var(--accent-a), var(--accent-b));
  --danger: #ff5470;
  --success: #2ee6a6;

  --radius-sm: 8px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 22px;

  --header-h: 64px;
  --sidebar-w-left: 240px;
  --sidebar-w-right: 300px;

  --transition: 180ms cubic-bezier(.4,0,.2,1);
}

[data-theme="dark"] {
  --bg: #0a0b0e;
  --bg-elevated: #15161c;
  --bg-header: rgba(12, 13, 17, 0.85);
  --bg-sidebar: #101116;
  --bg-card: #16171d;
  --bg-input: #1c1d24;
  --bg-hover: #1e2027;
  --border: #23242c;
  --text: #eef0f4;
  --text-muted: #8d919c;
  --text-faint: #5f636e;
  --shadow: 0 8px 30px rgba(0,0,0,0.45);
}

[data-theme="light"] {
  --bg: #f2f3f6;
  --bg-elevated: #ffffff;
  --bg-header: rgba(255, 255, 255, 0.85);
  --bg-sidebar: #ffffff;
  --bg-card: #ffffff;
  --bg-input: #eef0f4;
  --bg-hover: #eef0f4;
  --border: #e3e5eb;
  --text: #14161c;
  --text-muted: #676b76;
  --text-faint: #9498a2;
  --shadow: 0 8px 24px rgba(20,22,28,0.08);
}

* { box-sizing: border-box; }

html { color-scheme: dark light; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  transition: background var(--transition), color var(--transition);
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
ul { list-style: none; margin: 0; padding: 0; }

::selection { background: var(--accent-b); color: #fff; }

/* scrollbars (webkit) */
* { scrollbar-width: thin; scrollbar-color: var(--border) transparent; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 8px; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: var(--text-muted);
  transition: background var(--transition), color var(--transition);
}
.icon-btn:hover { background: var(--bg-hover); color: var(--text); }
.icon-btn:focus-visible, a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 2px solid var(--accent-a);
  outline-offset: 2px;
}

/* =========================================================
   HEADER
   ========================================================= */
.app-header {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 0 20px;
  background: var(--bg-header);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  border-bottom: 1px solid var(--border);
}

.header-left { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.drawer-toggle { display: none; }

.logo { display: flex; align-items: center; gap: 10px; }

.logo-circle {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-grad);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 17px;
  box-shadow: 0 0 0 3px rgba(124,92,255,0.15);
  flex-shrink: 0;
}

.logo-word {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 19px;
  letter-spacing: -0.02em;
}

.header-search {
  flex: 1;
  max-width: 640px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 16px;
  height: 42px;
  transition: border-color var(--transition), box-shadow var(--transition);
}
.header-search:focus-within {
  border-color: var(--accent-a);
  box-shadow: 0 0 0 3px rgba(34,211,238,0.15);
}
.search-icon { color: var(--text-faint); flex-shrink: 0; }
.header-search input {
  border: none;
  background: transparent;
  outline: none;
  color: var(--text);
  width: 100%;
  font-size: 14px;
}
.header-search input::placeholder { color: var(--text-faint); }

.header-right { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }

.theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: inline-flex; }

/* =========================================================
   LAYOUT
   ========================================================= */
.app-layout {
  display: grid;
  grid-template-columns: var(--sidebar-w-left) minmax(0,1fr) var(--sidebar-w-right);
  gap: 24px;
  max-width: 1440px;
  margin: 0 auto;
  padding: 24px 20px 60px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  max-height: calc(100vh - var(--header-h) - 48px);
  overflow-y: auto;
}

/* LEFT NAV */
.nav-main { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 11px 14px;
  border-radius: var(--radius-md);
  color: var(--text-muted);
  font-size: 15px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
}
.nav-item svg { flex-shrink: 0; }
.nav-item:hover { background: var(--bg-hover); color: var(--text); }
.nav-item.active {
  background: var(--bg-hover);
  color: var(--text);
  font-weight: 700;
}
.nav-item.active svg { color: var(--accent-a); }

.nav-divider { height: 1px; background: var(--border); margin: 12px 4px; }

.nav-item-ia { position: relative; }
.badge-ia {
  margin-left: auto;
  font-size: 10px;
  font-weight: 800;
  background: var(--accent-grad);
  color: #fff;
  padding: 2px 7px;
  border-radius: 999px;
  letter-spacing: 0.03em;
}

/* =========================================================
   MAIN CONTENT
   ========================================================= */
.main-content { min-width: 0; display: flex; flex-direction: column; gap: 20px; }

.player-card {
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow);
}
.player-embed-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-md);
  overflow: hidden;
}
.player-embed-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  border-radius: var(--radius-md);
}

/* AD BANNER */
.ad-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: linear-gradient(120deg, #ffd76b, #ffb84d 55%, #ff9d5c);
  padding: 22px 26px;
}
.ad-banner-inner { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.ad-copy { display: flex; flex-direction: column; }
.ad-title { font-family: var(--font-display); font-size: 26px; font-weight: 800; color: #241a05; }
.ad-sub { font-size: 14px; color: #4a3a10; }
.ad-price {
  margin-left: auto;
  width: 62px; height: 62px;
  border-radius: 50%;
  background: #241a05;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 16px;
}
.ad-cta {
  background: #ff5470;
  color: #fff;
  border: none;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 14px;
  transition: transform var(--transition), filter var(--transition);
}
.ad-cta:hover { filter: brightness(1.08); transform: translateY(-1px); }
.ad-tag {
  position: absolute;
  bottom: 12px;
  right: 16px;
  background: #14161c;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
}

/* TABS */
.content-tabs { display: flex; gap: 8px; }
.tab {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-muted);
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  transition: background var(--transition), color var(--transition);
}
.tab:hover { color: var(--text); }
.tab.active { background: var(--text); color: var(--bg); border-color: var(--text); }

/* SECTION HEADER */
.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 14px 18px;
}
.section-bar { width: 4px; height: 20px; border-radius: 4px; background: var(--accent-grad); flex-shrink: 0; }
.section-header h2 { font-family: var(--font-display); font-size: 17px; margin: 0; white-space: nowrap; }
.section-hint {
  color: var(--text-faint);
  font-size: 13px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
  margin-left: 4px;
}

/* POSTS GRID */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 16px;
}
.post-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform var(--transition), box-shadow var(--transition);
}
.post-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }

.post-head { display: flex; align-items: center; gap: 10px; padding: 12px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 14px; color: #fff; flex-shrink: 0;
}
.avatar-1 { background: linear-gradient(135deg,#22d3ee,#3b82f6); }
.avatar-2 { background: linear-gradient(135deg,#22d3ee,#0ea5e9); }
.avatar-3 { background: linear-gradient(135deg,#60a5fa,#6366f1); }
.avatar-4 { background: linear-gradient(135deg,#f472b6,#ec4899); }
.avatar-5 { background: linear-gradient(135deg,#a78bfa,#7c5cff); }
.avatar-6 { background: linear-gradient(135deg,#34d399,#10b981); }
.avatar-7 { background: linear-gradient(135deg,#f59e0b,#f97316); }

.post-user { display: flex; flex-direction: column; min-width: 0; }
.post-name { font-size: 13.5px; font-weight: 700; display: flex; align-items: center; gap: 4px; }
.verified { color: var(--accent-a); }
.post-meta {
  font-size: 12px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
.dots { margin-left: auto; width: 30px; height: 30px; }

.post-media { flex: 1; min-height: 140px; }
.post-media-photo { background: linear-gradient(160deg,#3a4657,#1f2733); }
.post-media-text {
  background: linear-gradient(135deg,#22d3ee,#0891b2);
  color: #fff; display: flex; align-items: center; padding: 18px;
}
.post-media-text p { margin: 0; font-weight: 700; font-size: 15px; line-height: 1.4; }
.post-media-product { background: linear-gradient(160deg,#ef4444,#7f1d1d); }

.suggested-tag {
  position: absolute; top: 10px; right: 10px; z-index: 2;
  background: rgba(20,22,28,0.75); color: #fff;
  font-size: 10px; font-weight: 700; padding: 4px 9px; border-radius: 999px;
  backdrop-filter: blur(4px);
}

/* =========================================================
   RIGHT SIDEBAR WIDGETS
   ========================================================= */
.sidebar-right { display: flex; flex-direction: column; gap: 18px; }

.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.widget-title {
  display: flex; align-items: center; gap: 8px;
  font-family: var(--font-display); font-weight: 700; font-size: 15px;
  margin-bottom: 10px; color: var(--text);
}
.widget-title svg { color: var(--accent-a); }
.refresh-btn { margin-left: auto; width: 28px; height: 28px; }

.trend-list li {
  display: flex; flex-direction: column; gap: 1px;
  padding: 9px 4px; border-bottom: 1px solid var(--border);
}
.trend-list li:last-child { border-bottom: none; }
.trend-cat { font-size: 11.5px; color: var(--text-faint); }
.trend-list strong { font-size: 14.5px; font-weight: 700; }
.trend-count { font-size: 12px; color: var(--text-faint); }

.suggest-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 2px;
}
.suggest-user { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.suggest-user strong { font-size: 13.5px; font-weight: 700; }
.suggest-user span {
  font-size: 12px; color: var(--text-faint);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.follow-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text);
  font-size: 12.5px; font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  flex-shrink: 0;
  transition: background var(--transition), color var(--transition);
}
.follow-btn:hover { background: var(--accent-grad); color: #fff; border-color: transparent; }
.follow-btn.following { background: var(--bg-hover); color: var(--text-faint); }

.widget-ad .ad-slot {
  aspect-ratio: 3/4;
  background: repeating-linear-gradient(45deg, var(--bg-hover), var(--bg-hover) 10px, transparent 10px, transparent 20px);
  border: 1px dashed var(--border);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-faint); font-size: 12px; font-weight: 600;
}

/* =========================================================
   PWA INSTALL MODAL
   ========================================================= */
.pwa-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6,7,10,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 220ms ease;
}
.pwa-modal-overlay.visible { opacity: 1; visibility: visible; pointer-events: auto; }

.pwa-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px 26px 22px;
  max-width: 380px;
  width: 100%;
  text-align: center;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), opacity 280ms ease;
  margin-bottom: 20px;
}
.pwa-modal-overlay.visible .pwa-modal { transform: translateY(0) scale(1); opacity: 1; }

@media (min-width: 640px) {
  .pwa-modal-overlay { align-items: center; }
  .pwa-modal { margin-bottom: 0; }
}

.pwa-modal-icon {
  width: 72px; height: 72px;
  border-radius: 22px;
  margin: 0 auto 16px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(124,92,255,0.35);
}
.pwa-modal-icon img { width: 100%; height: 100%; display: block; }

.pwa-modal h3 { font-family: var(--font-display); font-size: 20px; margin: 0 0 8px; }
.pwa-modal p { font-size: 14px; color: var(--text-muted); line-height: 1.5; margin: 0 0 22px; }

.pwa-modal-actions { display: flex; gap: 10px; }
.btn {
  flex: 1;
  padding: 13px 16px;
  border-radius: 999px;
  border: none;
  font-weight: 700;
  font-size: 14.5px;
  transition: transform var(--transition), filter var(--transition), background var(--transition);
}
.btn:active { transform: scale(0.97); }
.btn-ghost { background: var(--bg-hover); color: var(--text); }
.btn-ghost:hover { background: var(--border); }
.btn-primary { background: var(--accent-grad); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }

/* =========================================================
   DRAWER OVERLAY (mobile left sidebar)
   ========================================================= */
.drawer-overlay {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(0,0,0,0.5);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity var(--transition);
}
.drawer-overlay.visible { opacity: 1; visibility: visible; pointer-events: auto; }

/* =========================================================
   RESPONSIVE
   ========================================================= */

/* Tablet: hide right sidebar into stacked column */
@media (max-width: 1180px) {
  .app-layout {
    grid-template-columns: var(--sidebar-w-left) minmax(0,1fr);
  }
  .sidebar-right {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-right .widget { flex: 1 1 260px; }
}

/* Mobile: left sidebar becomes a slide-in drawer, header adapts */
@media (max-width: 860px) {
  :root { --header-h: 58px; }

  .app-layout {
    grid-template-columns: 1fr;
    padding: 16px 14px 90px;
    gap: 16px;
  }

  .drawer-toggle { display: inline-flex; }
  .logo-word { display: none; }

  .header-search { max-width: none; }

  .sidebar-left {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: 78vw;
    max-width: 300px;
    max-height: none;
    z-index: 95;
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border);
    padding: 16px 12px;
    transform: translateX(-100%);
    transition: transform 260ms cubic-bezier(.2,.8,.2,1);
    overflow-y: auto;
  }
  .sidebar-left.open { transform: translateX(0); }
  .sidebar-left::before {
    content: "";
    display: block;
    height: var(--header-h);
  }

  .sidebar-right {
    flex-direction: column;
  }
  .sidebar-right .widget { flex: 1 1 auto; }

  .ad-banner-inner { gap: 12px; }
  .ad-price { width: 52px; height: 52px; font-size: 14px; }

  .posts-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .section-hint { display: none; }
}

@media (max-width: 420px) {
  .header-search input { font-size: 13px; }
  .pwa-modal { padding: 24px 18px 18px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}

/* =========================================================
   NEWS APP — extensiones sobre el estilo base
   ========================================================= */

/* Botones de autenticación en el header */
.btn-header-ghost, .btn-header-publish {
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  white-space: nowrap;
  transition: background var(--transition), color var(--transition), filter var(--transition);
}
.btn-header-ghost { color: var(--text); background: transparent; border: 1px solid var(--border); }
.btn-header-ghost:hover { background: var(--bg-hover); }
.btn-header-publish { color: #fff; background: var(--accent-grad); }
.btn-header-publish:hover { filter: brightness(1.08); }

/* Menú de usuario */
.user-menu { position: relative; }
.user-menu-toggle { padding: 0; }
.user-menu-toggle .avatar { width: 34px; height: 34px; }
.user-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 200px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  flex-direction: column;
  z-index: 50;
}
.user-menu:hover .user-menu-dropdown,
.user-menu:focus-within .user-menu-dropdown { display: flex; }
.user-menu-name {
  padding: 8px 10px 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-faint);
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
}
.user-menu-dropdown a {
  padding: 9px 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text);
}
.user-menu-dropdown a:hover { background: var(--bg-hover); }

/* Layout simple (auth / admin): sin sidebars */
.app-layout-simple { grid-template-columns: 1fr; max-width: 720px; }
.app-layout-simple .main-content { width: 100%; }

/* Formularios genéricos (auth + publish) */
.auth-page { display: flex; justify-content: center; }
.auth-card, .publish-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px;
  width: 100%;
  max-width: 460px;
}
.publish-card { max-width: none; }
.auth-card h1 { font-family: var(--font-display); font-size: 24px; margin: 0 0 6px; }
.auth-sub { color: var(--text-muted); font-size: 14px; margin: 0 0 20px; }

form label { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; font-size: 13.5px; font-weight: 600; color: var(--text-muted); }
form label small { font-weight: 400; color: var(--text-faint); }
form input[type="text"], form input[type="email"], form input[type="password"], form input[type="file"], form textarea {
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}
form input[type="file"] { padding: 9px 10px; font-size: 13px; }
form textarea { resize: vertical; min-height: 160px; line-height: 1.5; }
form input:focus, form textarea:focus { border-color: var(--accent-a); box-shadow: 0 0 0 3px rgba(34,211,238,0.15); }

.auth-switch { text-align: center; font-size: 13.5px; color: var(--text-muted); margin: 18px 0 0; }
.auth-switch a { color: var(--accent-a); font-weight: 700; }

.alert { border-radius: var(--radius-md); padding: 12px 14px; margin-bottom: 16px; font-size: 13.5px; }
.alert-error { background: rgba(255,84,112,0.12); border: 1px solid rgba(255,84,112,0.35); color: #ff8ba0; }
.alert ul { margin: 0; padding-left: 18px; }
[data-theme="light"] .alert-error { color: #b3123a; }

.empty-state {
  background: var(--bg-card);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 40px 20px;
  text-align: center;
  color: var(--text-muted);
}
.empty-state p { margin: 0 0 14px; }

.widget-cta-text { font-size: 13px; color: var(--text-muted); margin: 0 0 12px; }

/* Tarjeta de noticia clicable en la grilla */
.post-card-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.post-body { padding: 2px 12px 14px; }
.post-title { font-size: 14px; font-weight: 700; margin: 0 0 4px; line-height: 1.35; }
.post-excerpt { font-size: 12.5px; color: var(--text-muted); margin: 0; line-height: 1.45; }

/* Artículo de noticia (página pública /new/{slug}) */
.news-article {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 28px 32px;
}
.news-title { font-family: var(--font-display); font-size: 28px; line-height: 1.25; margin: 4px 0 14px; }
.news-byline { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 20px; }
.news-byline .post-meta { font-size: 13.5px; color: var(--text-muted); }
.news-gallery { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px,1fr)); gap: 10px; margin-bottom: 20px; }
.news-gallery img { width: 100%; border-radius: var(--radius-md); display: block; object-fit: cover; max-height: 420px; }
.news-video { margin-bottom: 20px; }
.news-video video { width: 100%; border-radius: var(--radius-md); background: #000; max-height: 480px; }
.news-content { font-size: 16px; line-height: 1.75; color: var(--text); }

/* Panel de administración */
.admin-table-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow-x: auto;
}
.admin-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.admin-table th {
  text-align: left; padding: 14px 16px; color: var(--text-faint);
  font-size: 12px; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 1px solid var(--border);
}
.admin-table td { padding: 12px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:last-child td { border-bottom: none; }
.admin-table tr.row-deleted { opacity: 0.55; }
.admin-table a { color: var(--text); font-weight: 600; }
.admin-table a:hover { color: var(--accent-a); }
.admin-empty { text-align: center; color: var(--text-faint); padding: 30px !important; }

.status-badge { font-size: 11px; font-weight: 700; padding: 4px 10px; border-radius: 999px; }
.status-active { background: rgba(46,230,166,0.15); color: #2ee6a6; }
.status-deleted { background: rgba(255,84,112,0.15); color: #ff5470; }

.admin-inline-form { margin: 0; }
.btn-table {
  border: none; border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 700;
  transition: filter var(--transition);
}
.btn-delete { background: rgba(255,84,112,0.15); color: #ff5470; }
.btn-delete:hover { filter: brightness(1.2); }
.btn-restore { background: rgba(34,211,238,0.15); color: var(--accent-a); }
.btn-restore:hover { filter: brightness(1.2); }

@media (max-width: 860px) {
  .app-layout-simple { padding: 16px 14px 40px; }
  .auth-card, .publish-card { padding: 22px 18px; }
  .news-article { padding: 20px 18px 26px; }
  .news-title { font-size: 22px; }
}

/* =========================================================
   BOTÓN Y MODAL DE COMPARTIR
   ========================================================= */

/* Botón flotante sobre la tarjeta de la grilla */
.post-card { position: relative; }
.share-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: none;
  background: rgba(10,11,14,0.55);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
  transition: background var(--transition), transform var(--transition);
}
.share-btn:hover { background: var(--accent-grad); transform: scale(1.06); }

/* Variante en línea (página de la noticia) */
.share-btn-inline {
  position: static;
  width: auto;
  height: auto;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--bg-hover);
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: none;
}
.share-btn-inline:hover { background: var(--accent-grad); color: #fff; transform: none; }

.share-modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(6,7,10,0.6);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  padding: 20px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 220ms ease;
}
.share-modal-overlay.visible { opacity: 1; visibility: visible; pointer-events: auto; }

.share-modal {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 22px 22px 18px;
  max-width: 380px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  transform: translateY(24px) scale(0.97);
  opacity: 0;
  transition: transform 280ms cubic-bezier(.2,.8,.2,1), opacity 280ms ease;
  margin-bottom: 20px;
}
.share-modal-overlay.visible .share-modal { transform: translateY(0) scale(1); opacity: 1; }
.share-modal h3 { font-family: var(--font-display); font-size: 18px; margin: 0 0 16px; text-align: center; }

@media (min-width: 640px) {
  .share-modal-overlay { align-items: center; }
  .share-modal { margin-bottom: 0; }
}

.share-modal-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.share-option {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  border: none; background: transparent; color: var(--text);
  font-size: 12px; font-weight: 600; padding: 6px 4px; border-radius: var(--radius-md);
  transition: background var(--transition);
}
.share-option:hover { background: var(--bg-hover); }
.share-option-icon {
  width: 46px; height: 46px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
}
.share-icon-whatsapp { background: #25d366; }
.share-icon-telegram { background: #29a9eb; }
.share-icon-x { background: #14161c; }
.share-icon-facebook { background: #1877f2; }
.share-icon-copy { background: var(--bg-hover); color: var(--text); }
