/* ── ZYBIT! — Estilos públicos ─────────────────────────────────────────────── */
:root {
  --navy:   #1a2a4a;
  --orange: #ff6600;
  --orange-light: #fff3e8;
  --bg:     #f4f5f7;
  --bg-card:#ffffff;
  --border: #e2e5ea;
  --text:   #1a1a2e;
  --text-muted: #6b7280;
  --radius: 10px;
  --shadow: 0 2px 8px rgba(0,0,0,.07);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: 'Roboto', sans-serif; background: var(--bg); color: var(--text); line-height: 1.6; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

/* ── HEADER ─────────────────────────────────────────────────────────────────── */
#site-header {
  background: var(--navy);
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,.25);
}
.header-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px; height: 56px;
}
.site-logo {
  font-size: 22px; font-weight: 900; letter-spacing: -1px; color: #fff; white-space: nowrap;
  background: linear-gradient(135deg, #ff6600, #ffaa00);
  -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text;
}
.main-nav { display: flex; gap: 2px; }
.main-nav a {
  color: rgba(255,255,255,.75); padding: 6px 11px; border-radius: 6px;
  font-size: 13px; font-weight: 500; transition: .15s; white-space: nowrap;
  display: flex; align-items: center; gap: 5px;
}
.main-nav a:hover, .main-nav a.active { color: #fff; background: rgba(255,255,255,.12); }
.header-search { display: flex; align-items: center; flex: 1; min-width: 0; max-width: 340px; margin-left: auto; }
.header-search input {
  width: 100%; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2);
  color: #fff; border-radius: 20px 0 0 20px; padding: 7px 14px; font-size: 13px; outline: none;
}
.header-search input::placeholder { color: rgba(255,255,255,.5); }
.header-search button {
  background: var(--orange); border: none; color: #fff; padding: 7px 14px;
  border-radius: 0 20px 20px 0; cursor: pointer;
}

/* ── LAYOUT PRINCIPAL ───────────────────────────────────────────────────────── */
.site-body {
  max-width: 1200px; margin: 24px auto; padding: 0 16px;
  display: grid; grid-template-columns: 220px 1fr 220px; gap: 20px;
}

/* ── SIDEBAR ────────────────────────────────────────────────────────────────── */
.widget {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; margin-bottom: 16px;
}
.widget-header {
  background: var(--navy); color: #fff; padding: 10px 14px;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 7px;
}
.cat-list { list-style: none; padding: 6px 0; }
.cat-link {
  display: flex; align-items: center; gap: 8px; padding: 9px 14px;
  font-size: 13px; color: var(--text); transition: .15s;
}
.cat-link:hover { background: var(--bg); }
.cat-link.active { background: var(--orange-light); color: var(--orange); font-weight: 700; }
.cat-count { margin-left: auto; background: var(--bg); border-radius: 10px; padding: 1px 7px; font-size: 11px; color: var(--text-muted); }

.recent-list { list-style: none; padding: 8px 0; }
.recent-list li { display: flex; align-items: flex-start; gap: 9px; padding: 8px 12px; }
.recent-avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--orange);
  color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.recent-info { min-width: 0; }
.recent-title { font-size: 12px; font-weight: 600; color: var(--text); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.recent-title:hover { color: var(--orange); }
.recent-meta { font-size: 11px; color: var(--text-muted); }

.top-list { list-style: none; padding: 10px 0; }
.top-list li { display: flex; align-items: flex-start; gap: 8px; padding: 7px 12px; font-size: 13px; }
.top-num { width: 22px; height: 22px; border-radius: 50%; background: var(--orange); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

.widget-promo { padding: 18px 14px; text-align: center; }
.promo-icon { font-size: 32px; color: var(--orange); display: block; margin-bottom: 8px; }
.widget-promo strong { font-size: 14px; font-weight: 800; }
.widget-promo p { font-size: 12px; color: var(--text-muted); margin-top: 6px; line-height: 1.5; }

/* ── FEED PRINCIPAL ─────────────────────────────────────────────────────────── */
.main-feed { min-width: 0; }

.search-header, .cat-header {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 16px; margin-bottom: 16px; font-size: 14px; display: flex; align-items: center; gap: 10px;
}
.cat-header { border-left-width: 4px; font-weight: 700; }
.clear-search { margin-left: auto; color: var(--text-muted); font-size: 16px; }
.clear-search:hover { color: var(--orange); }

/* GRID DE POSTS */
.posts-grid { display: grid; grid-template-columns: 1fr; gap: 14px; }

.post-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden; display: flex;
  transition: box-shadow .2s, transform .15s;
}
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.post-card.destacado { border-color: var(--orange); }

.post-thumb {
  width: 130px; flex-shrink: 0; overflow: hidden; position: relative;
}
.post-thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-thumb-no-img {
  display: flex; align-items: center; justify-content: center; font-size: 36px;
}
.badge-destacado {
  position: absolute; top: 6px; left: 6px;
  background: var(--orange); color: #fff; font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: 10px;
}

.post-body { padding: 12px 14px; flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.post-cat {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 20px;
  text-transform: uppercase; letter-spacing: .5px; align-self: flex-start;
}
.post-title { font-size: 15px; font-weight: 700; line-height: 1.35; }
.post-title a:hover { color: var(--orange); }
.post-excerpt { font-size: 13px; color: var(--text-muted); line-height: 1.5; }
.post-footer { display: flex; gap: 14px; font-size: 12px; color: var(--text-muted); margin-top: auto; flex-wrap: wrap; }
.post-footer span { display: flex; align-items: center; gap: 4px; }

/* ── POST COMPLETO ──────────────────────────────────────────────────────────── */
.post-full {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px; min-width: 0; grid-column: 1 / 3;
}

.breadcrumb { font-size: 12px; color: var(--text-muted); margin-bottom: 16px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--orange); }

.post-full-header { margin-bottom: 20px; }
.post-full-header h1 { font-size: 24px; font-weight: 900; line-height: 1.3; margin: 10px 0; }
.post-full-meta { display: flex; gap: 16px; font-size: 13px; color: var(--text-muted); flex-wrap: wrap; }

.post-full-img { width: 100%; max-height: 420px; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }

.post-resumen {
  background: var(--orange-light); border-left: 4px solid var(--orange);
  padding: 14px 16px; border-radius: 0 8px 8px 0; font-size: 15px; font-style: italic;
  margin-bottom: 20px; color: #5a3000;
}

.post-full-body { font-size: 15px; line-height: 1.8; }
.post-full-body p { margin-bottom: 14px; }
.post-full-body h2, .post-full-body h3 { font-weight: 700; margin: 20px 0 10px; }
.post-full-body ul, .post-full-body ol { padding-left: 22px; margin-bottom: 14px; }
.post-full-body li { margin-bottom: 5px; }
.post-full-body a { color: var(--orange); text-decoration: underline; }
.post-full-body img { border-radius: 8px; margin: 12px 0; }
.post-full-body blockquote { border-left: 3px solid var(--orange); padding: 10px 16px; background: var(--bg); margin: 16px 0; border-radius: 0 8px 8px 0; font-style: italic; }
.post-full-body pre { background: #1a1a2e; color: #e2e8f0; padding: 16px; border-radius: 8px; overflow-x: auto; font-size: 13px; margin: 14px 0; }
.post-full-body code { background: var(--bg); padding: 1px 6px; border-radius: 4px; font-size: 13px; }

/* Descarga */
.descarga-wrap {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #f0fdf4; border: 2px solid #22c55e; border-radius: 12px;
  padding: 16px 20px; margin: 24px 0;
}
.btn-descarga {
  display: inline-flex; align-items: center; gap: 8px;
  background: #22c55e; color: #fff; padding: 11px 28px;
  border-radius: 8px; font-size: 16px; font-weight: 800;
  transition: background .15s; white-space: nowrap;
}
.btn-descarga:hover { background: #16a34a; }
.btn-descarga i { font-size: 18px; }
.descarga-hint { font-size: 12px; color: #6b7280; display: flex; align-items: center; gap: 5px; }

/* Compartir */
.share-bar { display: flex; align-items: center; gap: 10px; margin: 24px 0; flex-wrap: wrap; font-size: 13px; }
.share-btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 20px; color: #fff; font-size: 13px; font-weight: 600; }
.share-btn.whatsapp { background: #25d366; }
.share-btn.facebook { background: #1877f2; }
.share-btn.twitter  { background: #000; }

/* Relacionados */
.relacionados { margin: 28px 0 0; }
.relacionados h3 { font-size: 15px; font-weight: 700; margin-bottom: 12px; display: flex; align-items: center; gap: 7px; }
.relacionados-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.rel-card { border-radius: 8px; overflow: hidden; border: 1px solid var(--border); font-size: 12px; font-weight: 600; color: var(--text); }
.rel-card img, .rel-no-img { width: 100%; height: 80px; object-fit: cover; }
.rel-no-img { display: flex; align-items: center; justify-content: center; font-size: 28px; }
.rel-card span { display: block; padding: 7px 8px; }
.rel-card:hover { border-color: var(--orange); }

/* ── COMENTARIOS ────────────────────────────────────────────────────────────── */
.comentarios { margin-top: 32px; border-top: 2px solid var(--border); padding-top: 24px; }
.comentarios h3 { font-size: 17px; font-weight: 800; margin-bottom: 18px; display: flex; align-items: center; gap: 8px; }

.cmt-form-wrap { background: var(--bg); border-radius: var(--radius); padding: 18px; margin-bottom: 24px; }
.cmt-form h4 { font-size: 14px; font-weight: 700; margin-bottom: 12px; }
.form-row { margin-bottom: 10px; }
.form-row input, .form-row textarea {
  width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--bg-card); color: var(--text); outline: none;
}
.form-row input:focus, .form-row textarea:focus { border-color: var(--orange); }
.btn-comentar {
  background: var(--orange); color: #fff; border: none; padding: 10px 22px;
  border-radius: 20px; font-size: 14px; font-weight: 700; cursor: pointer; display: inline-flex; align-items: center; gap: 7px;
}
.btn-comentar:hover { background: #e55500; }

.no-cmt { text-align: center; padding: 24px; color: var(--text-muted); font-size: 14px; }

.cmt-list { display: flex; flex-direction: column; gap: 14px; }
.cmt-item { display: flex; gap: 12px; }
.cmt-avatar {
  width: 38px; height: 38px; border-radius: 50%; color: #fff; font-weight: 700;
  font-size: 15px; display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.cmt-body { flex: 1; background: var(--bg); border-radius: 10px; padding: 12px 14px; }
.cmt-header { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; font-size: 13px; }
.cmt-header strong { font-weight: 700; }
.cmt-header span { color: var(--text-muted); font-size: 12px; }
.cmt-body p { font-size: 14px; line-height: 1.6; }

/* ── ALERTS ─────────────────────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 8px; font-size: 14px; margin-bottom: 14px; display: flex; align-items: center; gap: 8px; }
.alert-ok  { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-err { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

/* ── PAGINACIÓN ─────────────────────────────────────────────────────────────── */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; }
.page-btn { padding: 7px 13px; border-radius: 8px; border: 1px solid var(--border); font-size: 14px; background: var(--bg-card); color: var(--text); }
.page-btn:hover { border-color: var(--orange); color: var(--orange); }
.page-btn.active { background: var(--orange); color: #fff; border-color: var(--orange); }

/* ── EMPTY STATE ────────────────────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text-muted); }
.empty-state i { font-size: 48px; opacity: .3; display: block; margin-bottom: 14px; }

/* ── FOOTER ─────────────────────────────────────────────────────────────────── */
#site-footer { background: var(--navy); color: rgba(255,255,255,.7); text-align: center; padding: 28px 20px; margin-top: 40px; font-size: 13px; }
.footer-logo { font-size: 20px; font-weight: 900; margin-bottom: 10px; background: linear-gradient(135deg,#ff6600,#ffaa00); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; }
.footer-links { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; margin-bottom: 10px; }
.footer-links a { color: rgba(255,255,255,.6); font-size: 12px; }
.footer-links a:hover { color: #fff; }

/* ── USUARIO EN HEADER ───────────────────────────────────────────────────────── */
.header-user { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.btn-nav-login {
  color: rgba(255,255,255,.85); border: 1px solid rgba(255,255,255,.3);
  padding: 6px 12px; border-radius: 20px; font-size: 13px; font-weight: 600;
  display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.btn-nav-login:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn-nav-reg {
  background: var(--orange); color: #fff; padding: 6px 12px; border-radius: 20px;
  font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 5px; white-space: nowrap;
}
.btn-nav-reg:hover { background: #e55500; }

.user-menu { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 7px; background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2); color: #fff; padding: 5px 12px 5px 6px;
  border-radius: 20px; cursor: pointer; font-size: 13px; font-weight: 600;
}
.user-btn:hover { background: rgba(255,255,255,.18); }
.user-avatar {
  width: 26px; height: 26px; border-radius: 50%; background: var(--orange);
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 900;
}
.user-nombre { max-width: 100px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 10px;
  min-width: 180px; box-shadow: 0 6px 20px rgba(0,0,0,.12); z-index: 200;
  display: none; flex-direction: column; overflow: hidden;
}
.user-dropdown.open { display: flex; }
.user-email { padding: 10px 14px; font-size: 12px; color: var(--text-muted); border-bottom: 1px solid var(--border); }
.user-dropdown a { padding: 11px 14px; font-size: 13px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.user-dropdown a:hover { background: var(--bg); color: var(--orange); }

/* ── PÁGINAS AUTH (login / registro) ─────────────────────────────────────────── */
.auth-main { display: flex; align-items: flex-start; justify-content: center; padding: 48px 16px; min-height: 60vh; }
.auth-box {
  background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px;
  padding: 36px 32px; width: 420px; max-width: 100%;
}
.auth-logo { font-size: 26px; font-weight: 900; text-align: center; margin-bottom: 6px;
  background: linear-gradient(135deg,#ff6600,#ffaa00); -webkit-background-clip:text; -webkit-text-fill-color:transparent; background-clip:text; }
.auth-box h2 { text-align: center; font-size: 20px; font-weight: 800; margin-bottom: 4px; }
.auth-sub { text-align: center; font-size: 13px; color: var(--text-muted); margin-bottom: 22px; line-height: 1.5; }
.auth-form .form-group { margin-bottom: 14px; }
.auth-form label { display: block; font-size: 13px; font-weight: 700; margin-bottom: 5px; color: var(--text); }
.auth-form label small { font-weight: 400; color: var(--text-muted); }
.auth-form input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: var(--bg); color: var(--text); outline: none;
}
.auth-form input:focus { border-color: var(--orange); background: var(--bg-card); box-shadow: 0 0 0 3px rgba(255,102,0,.1); }
.btn-auth {
  width: 100%; background: var(--orange); color: #fff; border: none;
  padding: 12px; border-radius: 8px; font-size: 15px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px;
}
.btn-auth:hover { background: #e55500; }
.auth-footer { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }
.auth-footer a { color: var(--orange); font-weight: 700; }

/* ── COMENTARIOS CON LOGIN ───────────────────────────────────────────────────── */
.cmt-login-prompt {
  background: var(--bg); border: 2px dashed var(--border); border-radius: 12px;
  padding: 20px; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
}
.cmt-login-prompt > i { font-size: 28px; color: var(--text-muted); flex-shrink: 0; }
.cmt-login-prompt > div { flex: 1; min-width: 160px; }
.cmt-login-prompt strong { font-size: 15px; font-weight: 700; }
.cmt-login-prompt p { font-size: 13px; color: var(--text-muted); margin-top: 2px; }
.cmt-login-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.btn-registrar {
  background: var(--bg-card); color: var(--text); border: 1px solid var(--border);
  padding: 8px 14px; border-radius: 20px; font-size: 13px; font-weight: 600;
  display: inline-flex; align-items: center; gap: 5px;
}
.btn-registrar:hover { border-color: var(--orange); color: var(--orange); }

/* ── MENÚ MÓVIL ─────────────────────────────────────────────────────────────── */
.hamburger {
  display: none;
  background: none; border: none; color: #fff;
  font-size: 20px; cursor: pointer; padding: 6px 10px;
  border-radius: 6px; margin-left: auto;
}
.hamburger:hover { background: rgba(255,255,255,.12); }

.mobile-nav {
  display: none !important;
  flex-direction: column;
  background: #152238;
  border-top: 1px solid rgba(255,255,255,.1);
}
.mobile-nav a {
  padding: 13px 20px;
  color: rgba(255,255,255,.85);
  font-size: 15px;
  font-weight: 500;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: 10px;
}
.mobile-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }

/* ── RESPONSIVE ─────────────────────────────────────────────────────────────── */

/* Tablet (900px) */
@media (max-width: 900px) {
  .site-body {
    grid-template-columns: 1fr;
    padding: 0 12px;
    margin: 16px auto;
  }
  .sidebar-left  { display: none; }
  .sidebar-right { display: none; }
  .post-full     { grid-column: 1; }

  .posts-grid { gap: 10px; }

  .relacionados-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Celular grande (600px) */
@media (max-width: 600px) {
  /* Header */
  .header-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 12px;
    gap: 8px;
  }
  .site-logo { font-size: 20px; }
  .main-nav  { display: none; }
  .hamburger { display: block; }
  .mobile-nav { display: none !important; }
  .mobile-nav.open { display: flex !important; }
  .header-search {
    order: 3;
    max-width: 100%;
    flex: 1 1 100%;
  }
  .header-search input { border-radius: 20px 0 0 20px; }

  /* Cards de posts */
  .post-card { flex-direction: column; }
  .post-thumb {
    width: 100%;
    height: 160px;
  }
  .post-thumb img { height: 160px; }
  .post-thumb-no-img { height: 100px; font-size: 42px; }
  .post-body { padding: 10px 12px; }
  .post-title { font-size: 14px; }
  .post-excerpt { display: none; }

  /* Post completo */
  .post-full { padding: 14px 12px; }
  .post-full-header h1 { font-size: 18px; }
  .post-full-meta { gap: 10px; font-size: 12px; }
  .post-full-body { font-size: 14px; }
  .post-full-img { max-height: 220px; }
  .post-resumen { font-size: 13px; padding: 10px 12px; }

  /* Compartir */
  .share-bar { gap: 7px; }
  .share-btn { padding: 6px 10px; font-size: 12px; }

  /* Relacionados */
  .relacionados-grid { grid-template-columns: 1fr 1fr; gap: 8px; }

  /* Comentarios */
  .cmt-item { gap: 8px; }
  .cmt-avatar { width: 30px; height: 30px; font-size: 12px; }

  /* Paginación */
  .pagination { gap: 4px; flex-wrap: wrap; justify-content: center; }
  .page-btn { padding: 6px 10px; font-size: 13px; }

  /* Footer */
  .footer-links { gap: 10px; }
  #site-footer { padding: 20px 14px; font-size: 12px; }

  /* Breadcrumb */
  .breadcrumb { font-size: 11px; }
}

/* Celular chico (380px) */
@media (max-width: 380px) {
  .post-full-header h1 { font-size: 16px; }
  .share-bar { flex-direction: column; align-items: flex-start; }
  .relacionados-grid { grid-template-columns: 1fr; }
}
