/* ═══════════════════════════════════════════
   admin_newsletter.css — JerezFusión 2026
   Depende de base.css
═══════════════════════════════════════════ */

/* ── HERO ── */
.hero-admin {
  padding: 90px 0 60px;
  background: #f3e4c9;
  border-bottom: 2px solid var(--ink);
}
.hero-admin h1 {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 5rem);
  font-weight: 800;
  line-height: .94;
  letter-spacing: -.01em;
}
.hero-admin h1 em {
  font-style: normal;
  color: #F5A517;
}
.hero-admin p {
  margin-top: 18px;
  font-size: 1rem;
  color: var(--ink-dim);
  max-width: 50ch;
}

/* ── LAYOUT ── */
.admin-layout {
  padding-top: 70px;
  padding-bottom: 100px;
  display: grid;
  grid-template-columns: 1fr minmax(0, 680px);
  gap: 80px;
  align-items: start;
}

.admin-layout--single {
  grid-template-columns: minmax(0, 560px);
  justify-content: center;
}

#contenido h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 16px;
}
#contenido h2 em { font-style: normal; color: #F5A517; }
#contenido p {
  font-size: .98rem;
  color: var(--ink-dim);
  line-height: 1.7;
}

/* ── LISTA DE NOTICIAS ── */
.noticia-list { display: flex; flex-direction: column; gap: 14px; }
.noticia-empty { font-size: .9rem; color: var(--ink-dim); }
.noticia-item {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  padding: 18px 20px;
}
.noticia-item-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.noticia-item-head strong {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
}
.noticia-fecha {
  display: block;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .04em;
  color: var(--ink-dim);
  margin-top: 4px;
}
.noticia-item p {
  margin-top: 10px;
  font-size: .92rem;
  color: var(--ink-dim);
  line-height: 1.6;
  white-space: pre-line;
}
.noticia-delete {
  flex: none;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--ink-dim);
  padding: 4px;
  border-radius: 8px;
  transition: color .25s, background .25s;
}
.noticia-delete:hover { color: #b5314b; background: #fdecea; }
.noticia-delete .material-symbols-outlined { font-size: 20px; display: block; }

/* ── COLUMNA LATERAL ── */
.admin-aside h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 700;
  margin-bottom: 12px;
}
.admin-aside h2 em { font-style: normal; color: #F5A517; }

.admin-aside p {
  font-size: .95rem;
  color: var(--ink-dim);
  line-height: 1.7;
  margin-bottom: 28px;
}

.tip-card {
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
  padding: 20px 22px;
  margin-bottom: 14px;
  transition: border-color .3s var(--ease), transform .3s var(--ease);
}
.tip-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
}
.tip-card strong {
  display: block;
  font-family: var(--font-display);
  font-size: .88rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.tip-card span {
  font-size: .82rem;
  color: var(--ink-dim);
  line-height: 1.5;
}

/* ── FORMULARIO ── */
.admin-form-col {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.field {
  margin-bottom: 22px;
}
.field label {
  display: block;
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 7px;
}
.field input[type="text"],
.field input[type="password"],
.field textarea {
  width: 100%;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: .96rem;
  transition: border-color .3s var(--ease);
  outline: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field textarea:focus { border-color: var(--accent); }
.field .hint {
  font-size: .75rem;
  color: var(--ink-dim);
  margin-top: 5px;
  opacity: .7;
}

.divider {
  border: none;
  border-top: 2px solid var(--line);
  margin: 10px 0 26px;
}

/* ── EDITOR ── */
.editor-label {
  font-family: var(--font-mono);
  font-size: .7rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-dim);
  margin-bottom: 10px;
}

.editor-tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--line);
  margin-bottom: 0;
}
.etab {
  padding: 8px 20px;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  cursor: pointer;
  border: 2px solid transparent;
  border-bottom: none;
  border-radius: 10px 10px 0 0;
  color: var(--ink-dim);
  background: transparent;
  transition: color .2s, background .2s;
  position: relative;
  bottom: -2px;
}
.etab.active {
  background: var(--bg-2);
  border-color: var(--line);
  color: var(--accent);
}

.etab-content { display: none; }
.etab-content.active { display: block; }

/* Toolbar */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  background: var(--bg-2);
  border: 2px solid var(--line);
  border-bottom: none;
  border-radius: 0 0 0 0;
}

.toolbar-sep {
  width: 1px;
  background: var(--line);
  margin: 2px 2px;
  align-self: stretch;
}

.tbtn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  font-family: var(--font-mono);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  transition: border-color .2s, background .2s, color .2s;
}
.tbtn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: #fff5f6;
}
.tbtn .material-symbols-outlined {
  font-size: 16px;
}
.tbtn.img-btn {
  background: var(--ink);
  color: var(--bg);
  border-color: var(--ink);
}
.tbtn.img-btn:hover {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

#editor {
  min-height: 260px;
  border: 2px solid var(--line);
  border-top: none;
  border-radius: 0 0 12px 12px;
  padding: 18px;
  font-family: var(--font-body);
  font-size: .96rem;
  line-height: 1.7;
  color: var(--ink);
  background: #fff;
  outline: none;
  transition: border-color .3s;
}
#editor:focus { border-color: var(--accent); }
#editor:empty::before {
  content: attr(data-placeholder);
  color: var(--ink-dim);
  opacity: .5;
  pointer-events: none;
}
#editor img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
  display: block;
}

#preview-frame {
  min-height: 260px;
  border: 2px solid var(--line);
  border-radius: 0 0 12px 12px;
  padding: 18px;
  background: #fff;
  font-family: var(--font-body);
  font-size: .96rem;
  line-height: 1.7;
  color: var(--ink);
}
#preview-frame img {
  max-width: 100%;
  border-radius: 8px;
  margin: 8px 0;
}

/* Uploading overlay en editor */
.uploading-badge {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: .72rem;
  background: #F5A517;
  color: var(--ink);
  padding: 3px 10px;
  border-radius: 20px;
  margin-top: 6px;
  animation: pulse .8s ease-in-out infinite alternate;
}
@keyframes pulse { to { opacity: .5; } }

/* ── BOTÓN ENVIAR ── */
.btn-send {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  padding: 16px 32px;
  margin-top: 10px;
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 40px;
  cursor: pointer;
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  letter-spacing: .02em;
  transition: transform .3s var(--ease), background .3s var(--ease);
  box-shadow: 5px 5px 0 #F5A517;
}
.btn-send .material-symbols-outlined { font-size: 20px; }
.btn-send:hover { background: var(--accent); transform: translateY(-2px); }
.btn-send:disabled { opacity: .55; cursor: not-allowed; transform: none; }

/* ── SPINNER ── */
.spinner {
  width: 18px; height: 18px;
  border: 3px solid rgba(247,241,231,.4);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── FEEDBACK ── */
.form-note {
  margin-top: 16px;
  font-family: var(--font-mono);
  font-size: .8rem;
  min-height: 1.4em;
  display: none;
  padding: 12px 16px;
  border-radius: 12px;
}
.form-note.ok    { display: block; background: #e8f5ec; color: #1a6b2e; border: 2px solid #a3d9ac; }
.form-note.warn  { display: block; background: #fff7e6; color: #7a4f00; border: 2px solid #f5c97a; }
.form-note.error { display: block; background: #fdecea; color: #8b1a1a; border: 2px solid #f0b0b0; }

/* ── GALERÍA DE IMÁGENES ── */
.gallery-section {
  margin-top: 32px;
  padding-top: 28px;
  border-top: 2px solid var(--line);
}
.gallery-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.gallery-section h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
}
.gallery-section h3 em { font-style: normal; color: #F5A517; }
.gallery-desc {
  font-size: .82rem;
  color: var(--ink-dim);
  margin-bottom: 14px;
}
.gallery-refresh {
  background: none;
  border: 1.5px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  cursor: pointer;
  color: var(--ink-dim);
  transition: border-color .2s, color .2s;
  display: flex;
  align-items: center;
}
.gallery-refresh:hover { border-color: var(--accent); color: var(--accent); }
.gallery-refresh .material-symbols-outlined { font-size: 18px; }

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.gallery-empty {
  grid-column: 1 / -1;
  font-size: .82rem;
  color: var(--ink-dim);
  opacity: .6;
  text-align: center;
  padding: 20px 0;
}
.gallery-item {
  position: relative;
  border-radius: 10px;
  overflow: hidden;
  border: 2px solid var(--line);
  background: var(--bg-2);
  aspect-ratio: 1;
  cursor: pointer;
  transition: border-color .2s;
}
.gallery-item:hover { border-color: var(--accent); }
.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: rgba(42,20,24,.6);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 0;
  transition: opacity .2s;
}
.gallery-item:hover .gallery-item-overlay { opacity: 1; }

.gallery-insert {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 20px;
  padding: 6px 14px;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  cursor: pointer;
  letter-spacing: .04em;
  transition: background .2s;
}
.gallery-insert:hover { background: #9a2840; }
.gallery-insert .material-symbols-outlined { font-size: 15px; }

.gallery-delete {
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1.5px solid rgba(255,255,255,.4);
  border-radius: 8px;
  padding: 4px 10px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-family: var(--font-mono);
  font-size: .7rem;
  transition: background .2s, border-color .2s;
}
.gallery-delete:hover { background: rgba(181,49,75,.7); border-color: var(--accent); }
.gallery-delete .material-symbols-outlined { font-size: 15px; }

.gallery-size {
  position: absolute;
  bottom: 6px;
  right: 8px;
  font-family: var(--font-mono);
  font-size: .65rem;
  color: #fff;
  background: rgba(42,20,24,.5);
  padding: 2px 6px;
  border-radius: 4px;
  pointer-events: none;
}

/* ── HISTORIAL DE ENVÍOS ── */
.historial-section {
  margin-bottom: 28px;
  padding: 28px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: var(--bg-2);
}
.historial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.historial-section h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 700;
}
.historial-section h3 em { font-style: normal; color: #F5A517; }

#historial-lista { display: flex; flex-direction: column; gap: 10px; }

.hist-item {
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 14px 18px;
  transition: border-color .2s var(--ease);
}
.hist-item:hover { border-color: var(--accent); }

.hist-asunto {
  font-family: var(--font-display);
  font-size: .95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.hist-fecha {
  font-family: var(--font-mono);
  font-size: .72rem;
  color: var(--ink-dim);
  letter-spacing: .03em;
}
.hist-enviados {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  color: #1a6b2e;
  background: #e8f5ec;
  padding: 2px 8px;
  border-radius: 20px;
}
.hist-fallidos {
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 700;
  color: #8b1a1a;
  background: #fdecea;
  padding: 2px 8px;
  border-radius: 20px;
}

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .admin-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .admin-aside { order: 2; }
  .admin-form-col { order: 1; }
}
