/* ==========================================================
   NOTICIAS - estilos de noticias.php y noticia.php
   (usa las variables y estilos base de css/style.css)
   ========================================================== */

/* Fondo de las paginas internas: liso, con un leve brillo arriba */
.pagina-interna {
  background:
    radial-gradient(ellipse at 50% 0, rgba(47, 90, 138, .25), transparent 60%) no-repeat,
    var(--bg);
}

/* Colores por categoria (texto sobre fondo oscuro, contraste mayor a 4.5:1) */
.cat-notas-de-parche { --cat: #c4a3f5; }
.cat-anuncios        { --cat: #e8cf8f; }
.cat-eventos         { --cat: #5fd3c6; }
.cat-mantenimiento   { --cat: #f0a679; }

/* ---------- BANNER ---------- */
.nt-banner {
  padding: 64px 0 56px; text-align: center;
  background: var(--overlay), url("../img/bg-noticias.webp") center 30% / cover no-repeat, var(--bg-band);
  border-bottom: 1px solid var(--line);
}
.nt-banner-title {
  margin: 0; font-family: var(--font-title); font-weight: 400; text-transform: uppercase;
  font-size: clamp(2rem, 6vw, 3.25rem); letter-spacing: .16em; color: var(--gold-light);
  text-shadow: 0 4px 20px #000;
}
.nt-banner-sub { margin: 6px 0 0; font-family: var(--font-serif); font-size: 1.25rem; color: #e3e5dc; }

.nt-page { padding-top: 32px; padding-bottom: 56px; }

/* ---------- FILTROS Y BUSCADOR ---------- */
.nt-tools {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px;
  padding-bottom: 20px; border-bottom: 1px solid var(--line);
}
.nt-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.nt-filters a {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  font-size: .875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--text);
  border: 1px solid rgba(255, 255, 255, .14); background: rgba(13, 26, 46, .6);
  transition: color .2s ease, border-color .2s ease, background-color .2s ease;
}
.nt-filters a:hover { color: var(--gold-light); border-color: var(--line); }
.nt-filters a[aria-current="page"] { color: var(--gold-light); border-color: var(--gold); background: rgba(201, 169, 106, .12); }

.nt-search { display: flex; flex: 0 1 300px; }
.nt-search input {
  flex: 1; min-width: 0; min-height: 40px; padding: 0 12px;
  color: var(--text); background: rgba(13, 26, 46, .8);
  border: 1px solid rgba(255, 255, 255, .14); border-right: 0; border-radius: 0;
}
.nt-search input::placeholder { color: var(--muted); }
.nt-search input:focus { border-color: var(--gold); outline: none; }
.nt-search button {
  width: 44px; min-height: 40px; color: var(--gold-light);
  background: rgba(13, 26, 46, .8); border: 1px solid rgba(255, 255, 255, .14);
}
.nt-search button:hover { border-color: var(--gold); }
.nt-search:focus-within { box-shadow: 0 0 0 2px var(--gold-light); }

.nt-status { margin: 14px 0 0; color: var(--muted); font-size: .9375rem; }
.nt-status a { color: var(--gold-light); text-decoration: underline; margin-left: 6px; }

/* ---------- CARDS ---------- */
.nt-card { height: 100%; }
.nt-link {
  display: flex; flex-direction: column; height: 100%;
  background: rgba(13, 26, 46, .82); border: 1px solid rgba(255, 255, 255, .1);
  transition: transform .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.nt-link:hover { border-color: var(--gold); box-shadow: 0 10px 26px rgba(0, 0, 0, .45); }
@media (hover: hover) { .nt-link:hover { transform: translateY(-4px); } }

.nt-img { aspect-ratio: 16 / 9; overflow: hidden; background: var(--panel); }
.nt-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.nt-link:hover .nt-img img { transform: scale(1.05); }

.nt-body { flex: 1; padding: 18px 18px 8px; }
.nt-meta { display: flex; align-items: center; gap: 10px; margin: 0 0 6px; }
.nt-cat { font-size: .8125rem; letter-spacing: .1em; text-transform: uppercase; color: var(--cat, var(--gold)); }
.nt-new {
  padding: 1px 8px; font-size: .75rem; letter-spacing: .06em; text-transform: uppercase;
  color: #fff; background: #b8322a; border-radius: 2px;
}
.nt-title { margin: 0 0 8px; font-family: var(--font-serif); font-weight: 600; font-size: 1.375rem; line-height: 1.25; color: #fff; }
.nt-link:hover .nt-title { color: var(--gold-light); }
.nt-sum {
  margin: 0; font-size: .9375rem; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}

.nt-foot {
  display: flex; justify-content: space-between; align-items: center; gap: 8px;
  margin-top: 12px; padding: 12px 18px; font-size: .8125rem; color: var(--muted);
  border-top: 1px solid rgba(255, 255, 255, .08); background: rgba(0, 0, 0, .18);
}
.nt-brand { font-family: var(--font-title); letter-spacing: .12em; text-transform: uppercase; color: var(--gold); }

/* Cards que llegan con "Ver mas": aparecen con un fundido */
.nt-col.is-new { animation: nt-in .5s ease both; }
@keyframes nt-in { from { opacity: 0; translate: 0 16px; } to { opacity: 1; translate: 0 0; } }

/* ---------- VER MAS ---------- */
.nt-more-wrap { margin-top: 8px; }
.nt-more {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px;
  font-size: .875rem; letter-spacing: .1em; text-transform: uppercase; color: var(--gold-light);
  border: 1px solid var(--line); background: rgba(13, 26, 46, .6);
  transition: border-color .2s ease, background-color .2s ease;
}
.nt-more:hover { border-color: var(--gold); background: rgba(201, 169, 106, .1); }
.nt-more[aria-busy="true"] { opacity: .6; pointer-events: none; }

/* ---------- SIN RESULTADOS / 404 ---------- */
.nt-empty, .nt-404 { text-align: center; padding-top: 48px; padding-bottom: 48px; color: var(--muted); }
.nt-empty i, .nt-404 i { font-size: 3rem; color: var(--gold); }
.nt-empty p { margin: 12px 0 22px; font-size: 1.0625rem; }
.nt-404 { min-height: 50vh; }
.nt-404 h1, .nt-404 h2 { margin: 14px 0 8px; font-family: var(--font-title); font-weight: 400; color: var(--gold-light); }
.nt-404 p { margin-bottom: 24px; }
.nt-empty .btn-play, .nt-404 .btn-play { padding: 8px 26px; }

/* ==================== DETALLE (noticia.php) ==================== */
.nd-head {
  position: relative; isolation: isolate; display: flex; align-items: flex-end; min-height: 380px;
  background: var(--bg-band);
}
/* La imagen va en su propio div (la ruta queda relativa a la pagina, no al CSS) */
.nd-head-img { position: absolute; inset: 0; z-index: -2; background: center / cover no-repeat; }
.nd-head::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(rgba(10, 14, 38, .35), rgba(10, 14, 38, .65) 55%, var(--bg));
}
.nd-head-inner { padding-top: 48px; padding-bottom: 28px; max-width: 860px; }
.nd-crumbs { display: flex; align-items: center; gap: 8px; font-size: .875rem; color: var(--muted); }
.nd-crumbs a { color: var(--gold-light); padding: 4px 0; }
.nd-crumbs a:hover { text-decoration: underline; }
.nd-crumbs i { font-size: .75rem; }
.nd-title {
  margin: 8px 0 12px; font-family: var(--font-title); font-weight: 400;
  font-size: clamp(1.75rem, 4.5vw, 2.75rem); line-height: 1.2; color: var(--gold-light);
  text-shadow: 0 3px 16px #000;
}
.nd-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin: 0; color: #e3e5dc; font-size: .9375rem; }

.nd-body {
  max-width: 860px; margin: 0 auto; padding: 32px clamp(18px, 4vw, 44px) 36px;
  background: rgba(13, 26, 46, .82); border: 1px solid rgba(255, 255, 255, .1);
  font-size: 1.0625rem; line-height: 1.75;
}
.nd-lead { font-family: var(--font-serif); font-size: 1.375rem; line-height: 1.5; color: #fff; margin-bottom: 24px; }
.nd-body h2 {
  margin: 32px 0 12px; font-family: var(--font-title); font-weight: 400;
  font-size: 1.375rem; color: var(--gold);
}
.nd-body h3 { margin: 24px 0 10px; font-family: var(--font-serif); font-weight: 600; font-size: 1.25rem; color: var(--gold-light); }
.nd-body p, .nd-body ul, .nd-body ol { margin-bottom: 16px; }
.nd-body li { margin: 6px 0; }
.nd-body li::marker { color: var(--gold); }
.nd-body strong { color: #fff; }
.nd-body a { color: var(--teal); text-decoration: underline; }
.nd-body img { max-width: 100%; height: auto; margin: 8px 0; border: 1px solid var(--line); }
.nd-body .nd-back { margin: 32px 0 0; padding-top: 20px; border-top: 1px solid var(--line); }
.nd-body .nd-back a { color: var(--gold-light); text-decoration: none; }
.nd-body .nd-back a:hover { text-decoration: underline; }

.nd-related { padding-top: 56px; }

/* Aviso de vista previa (desde el panel admin) */
.nd-preview {
  position: sticky; top: var(--nav-h); z-index: 15; margin: 0; padding: 10px 16px; text-align: center;
  color: #1a1206; background: var(--gold-light); font-size: .9375rem;
}
.nd-preview a { color: #1a1206; text-decoration: underline; font-weight: 600; margin-left: 8px; }

/* Alineaciones del editor */
.nd-body .ql-align-center { text-align: center; }
.nd-body .ql-align-right { text-align: right; }
.nd-body .ql-align-justify { text-align: justify; }
.nd-body .ql-indent-1 { padding-left: 2em; }
.nd-body .ql-indent-2 { padding-left: 4em; }
.nd-body blockquote { margin: 0 0 16px; padding: 4px 0 4px 18px; border-left: 3px solid var(--gold); color: #e3e5dc; font-style: italic; }

/* ---------- PIE DE PAGINAS INTERNAS ---------- */
.footer-interno { padding: 24px 16px 28px; background: rgba(0, 0, 0, .25); }
.footer-links { margin: 0 0 8px; }
.footer-legal { margin: 0; font-size: .8125rem; }

/* ---------- RESPONSIVE ---------- */
@media (max-width: 767px) {
  .nt-banner { padding: 40px 0 34px; }
  .nt-search { flex-basis: 100%; }
  .nt-filters { gap: 6px; }
  .nt-filters a { padding: 0 12px; font-size: .8125rem; }
  .nd-head { min-height: 300px; }
  .nd-body { font-size: 1rem; }
  .nd-lead { font-size: 1.1875rem; }
}

@media print {
  .nt-tools, .nt-more-wrap, .nd-related, .nd-back { display: none !important; }
  .nd-head { min-height: 0; background: none; }
  .nd-head-img, .nd-head::after { display: none; }
}

.nt-grid, .nt-empty { margin-top: 24px; }
