/* ==========================================================================
   noticias.css — noticias.html
   Masthead con colofón reglado, nota destacada como pliego editorial (plancha
   vertical + columna de texto), archivo en grilla de 2 columnas con tres
   tratamientos de imagen (foto, afiche montado, plancha tipográfica con sello)
   y dialog de noticia con la figura flotada dentro del texto.
   Requiere css/base.css y css/site.css. Solo layout y ajustes; nada pisa clases de base.
   ========================================================================== */

/* ==========================================================================
   1. Hero (masthead + colofón)
   ========================================================================== */
.noticias-hero__bar {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-6) var(--sp-8);
  margin-top: clamp(2rem, 5vw, 3.25rem);
  padding-top: clamp(1.25rem, 3vw, 1.75rem);
  border-top: 1px solid var(--border-strong);
}
.noticias-hero__meta { display: flex; align-items: center; gap: .875rem; color: var(--text-muted); }
.noticias-hero__num {
  font-family: var(--font-display); font-weight: 600; font-size: 3rem; line-height: .85;
  letter-spacing: -.03em; color: var(--primary-strong); font-variant-numeric: tabular-nums; flex: none;
}
.noticias-hero__text { display: grid; gap: .2rem; }
.noticias-hero__strong {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text);
}
.noticias-hero__last { font-size: var(--fs-small); }
.noticias-hero__last time { font-weight: 700; color: var(--text); }
.noticias-hero__links { display: flex; flex-wrap: wrap; gap: var(--sp-3); }
.page-noticias .noticias-hero__links .btn svg { width: 1.125rem; height: 1.125rem; flex: none; }

/* ==========================================================================
   2. Nota destacada (pliego editorial, sin caja de card)
   ========================================================================== */
.noticia-destacada { position: relative; display: grid; gap: 0; }
.noticia-destacada__kicker { margin-bottom: var(--sp-6); }
.noticia-destacada__media {
  margin-bottom: clamp(1.75rem, 4vw, 2.5rem);
  position: relative; overflow: hidden; aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg); background: var(--surface-2); box-shadow: var(--shadow-lg);
}
.noticia-destacada__media img {
  display: block; width: 100%; height: 100%; object-fit: cover; object-position: 50% 12%;
  transition: transform var(--dur-reveal) var(--ease-out);
}
.noticia-destacada__body { display: grid; gap: var(--sp-4); align-content: center; }
.noticia-destacada__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  font-size: var(--fs-small); font-weight: 600; letter-spacing: .02em; color: var(--text-muted);
}
.noticia-destacada__meta time { color: var(--primary-strong); }
.noticia-destacada__title {
  font-family: var(--font-display); font-weight: 600; line-height: 1.08; letter-spacing: -.025em;
  font-size: clamp(2rem, 1.3rem + 2.4vw, 3.125rem);
}
.noticia-destacada__title a { color: inherit; text-decoration: none; }
.noticia-destacada__title a::after { content: ""; position: absolute; inset: 0; }
.noticia-destacada__excerpt {
  color: var(--text-muted); max-width: 36rem; line-height: 1.6;
  font-size: clamp(1.0625rem, 1rem + .25vw, 1.1875rem);
}
.noticia-destacada__by {
  display: flex; align-items: center; gap: .875rem;
  margin-top: var(--sp-2); padding-top: var(--sp-4); border-top: 1px solid var(--border);
  font-size: var(--fs-small); color: var(--text-muted);
}
.noticia-destacada__by strong { color: var(--text); font-weight: 700; }
.noticia-destacada__avatar {
  width: 3.25rem; height: 3.25rem; flex: none; border-radius: 50%;
  object-fit: cover; object-position: 53% 50%;
  box-shadow: 0 0 0 2px var(--bg), 0 0 0 3px var(--border-strong);
}
.noticia-destacada__actions { margin-top: var(--sp-2); }
.noticia-destacada__btn { position: relative; z-index: 1; }   /* por encima del overlay del título */
.noticia-destacada:hover .noticia-destacada__media img,
.noticia-destacada:focus-within .noticia-destacada__media img { transform: scale(1.03); }
.noticia-destacada:hover .noticia-destacada__title a { text-decoration: underline; text-underline-offset: .1em; }

@media (min-width: 900px) {
  .noticia-destacada { grid-template-columns: minmax(0, .82fr) minmax(0, 1fr); column-gap: clamp(2.5rem, 5vw, 4.5rem); align-items: center; }
  .noticia-destacada__kicker { grid-column: 1 / -1; margin-bottom: clamp(1.5rem, 3vw, 2.25rem); }
  .noticia-destacada__media { grid-row: 2; margin-bottom: 0; }
  .noticia-destacada__body { grid-row: 2; }
}

/* ==========================================================================
   3. Archivo: cabecera y grilla
   ========================================================================== */
.noticias-archivo__rango {
  display: flex; align-items: center; gap: .75rem; margin-bottom: var(--sp-4);
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-muted);
}
.noticias-archivo__rango::before { content: ""; flex: none; width: 2.25rem; height: 1px; background: var(--border-strong); }
@media (max-width: 767px) { .noticias-archivo__rango { margin-bottom: 0; } }

.noticias-grid { display: grid; gap: clamp(1.25rem, 3vw, 2.25rem); }
@media (min-width: 768px) { .noticias-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.noticias-grid .card__title { font-size: clamp(1.25rem, 1.1rem + .55vw, 1.5rem); line-height: 1.18; }
.noticias-grid .card__text { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
/* Caja de imagen algo más alta que el 16/10 de base: da aire a la foto, tamaño real al
   afiche montado y campo suficiente para el sello de las planchas tipográficas. */
.page-noticias .noticias-grid .card__media { aspect-ratio: 4 / 3; }
.noticia-card .card__foot { margin-top: auto; }
.noticia-card .news-card__date { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem; }
.noticia-card:hover .link-arrow::after,
.noticia-card:focus-within .link-arrow::after { transform: translateX(4px); }

/* ---------- 3a. Afiche vertical montado sobre paspartú ---------- */
.page-noticias .noticia-card__media--poster { background: var(--surface-2); }
.page-noticias .noticia-card__media--poster img {
  object-fit: contain; padding: clamp(.75rem, 3%, 1.25rem);
  filter: drop-shadow(0 1px 1px rgb(15 22 51 / .22)) drop-shadow(0 14px 26px rgb(15 22 51 / .3));
}
[data-theme="dark"] .page-noticias .noticia-card__media--poster img { filter: drop-shadow(0 10px 22px rgb(0 0 0 / .55)); }
@media (max-width: 767px) { .page-noticias .noticias-grid .noticia-card__media--poster { aspect-ratio: 1 / 1; } }

/* ---------- 3b. Plancha tipográfica (noticias sin foto): sello + fecha ---------- */
.noticia-card__plate { display: grid; place-items: center; background: var(--surface-2); }
.noticia-card__plate::before {
  content: ""; position: absolute; inset: 0;
  background: url("../../assets/img/marca/logo.png") no-repeat center / auto 74%;
  opacity: .13; filter: saturate(1.6) brightness(.6);
}
[data-theme="dark"] .noticia-card__plate::before { opacity: .18; filter: brightness(1.1); }
.noticia-card__plate::after {
  content: ""; position: absolute; inset: clamp(.75rem, 4%, 1.25rem);
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
}
[data-theme="dark"] .noticia-card__plate::after { border-color: var(--border); }
.noticia-card__stamp {
  position: relative; display: grid; justify-items: center; gap: .3rem; text-align: center;
  transition: transform var(--dur-base) var(--ease-out);
}
.noticia-card__stamp-mes {
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-muted);
}
.noticia-card__stamp-anio {
  font-family: var(--font-display); font-weight: 600; font-size: clamp(2.5rem, 6vw, 3.875rem);
  line-height: 1; letter-spacing: -.02em; color: var(--primary-strong); font-variant-numeric: tabular-nums;
}
.card--hover:hover .noticia-card__stamp,
.card--hover:focus-within .noticia-card__stamp { transform: translateY(-3px); }

/* ==========================================================================
   4. Dialog de noticia
   ========================================================================== */
html.noticia-open { overflow: hidden; scrollbar-gutter: stable; }
.noticia__meta {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
  font-size: var(--fs-small); font-weight: 600; letter-spacing: .02em; color: var(--text-muted);
  margin-bottom: var(--sp-3); padding-right: 3rem;
}
.noticia__meta time { color: var(--primary-strong); }
.noticia__layout { margin-top: var(--sp-6); }
.noticia__text { max-width: 68ch; }
.noticia__figure { margin: 0 0 var(--sp-6); border-radius: var(--radius); overflow: hidden; background: var(--surface-2); border: 1px solid var(--border); }
.noticia__figure img { width: 100%; height: auto; display: block; }
.noticia__figure figcaption { padding: .625rem .875rem; font-size: var(--fs-xs); color: var(--text-muted); border-top: 1px solid var(--border); background: var(--bg); }
.noticia__figure--cover img { max-height: 20rem; object-fit: cover; object-position: 50% 12%; }

/* La figura flota dentro de la columna de texto: el párrafo la rodea, sin huecos verticales */
@media (min-width: 768px) {
  .noticia__layout--figure::after { content: ""; display: block; clear: both; }
  .noticia__layout--figure .noticia__figure {
    float: right; width: clamp(12rem, 36%, 18.5rem);
    margin: .2rem 0 var(--sp-6) clamp(1.5rem, 4vw, 2.5rem);
  }
  .noticia__layout--figure .noticia__figure--cover img { max-height: none; }
  .noticia__layout--figure .noticia__text { max-width: none; }
}

.noticia__firma { margin-top: 1.6em; line-height: 1.5; }
.noticia__firma strong { display: block; font-family: var(--font-display); font-size: 1.25rem; font-weight: 600; letter-spacing: -.01em; margin-top: .35em; }
.noticia__firma .muted { display: block; font-size: var(--fs-small); }
.noticia__firmas { display: flex; flex-wrap: wrap; gap: var(--sp-4) var(--sp-12); margin-top: 1.6em; padding-top: 1.2em; border-top: 1px solid var(--border); }
.noticia__firmas p { margin: 0; }
.noticia__firmas strong { display: block; font-family: var(--font-display); font-size: 1.1875rem; font-weight: 600; letter-spacing: -.01em; }
.noticia__firmas .muted { display: block; font-size: var(--fs-small); }
.noticia__adjuntos-wrap { margin-top: var(--sp-8); }
.noticia__kicker { margin-bottom: var(--sp-3); }
.noticia__subtitle { font-family: var(--font-body); font-size: var(--fs-xs); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--text-muted); margin-bottom: var(--sp-3); }
.noticia__adjuntos { display: grid; gap: var(--sp-3); }
@media (min-width: 600px) { .noticia__adjuntos { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.noticia__aviso { display: flex; gap: .75rem; align-items: flex-start; padding: .875rem 1rem; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--border); font-size: var(--fs-small); color: var(--text-muted); }
.noticia__aviso svg { width: 1.125rem; height: 1.125rem; flex: none; margin-top: .15rem; color: var(--primary); }
.noticia__foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--sp-4);
  margin-top: var(--sp-8); padding-top: var(--sp-6); border-top: 1px solid var(--border); clear: both;
}
.noticia__foot .share .btn svg { width: 1.125rem; height: 1.125rem; flex: none; }
/* La fila de acciones se lee como una barra: los ghost toman caja neutra para compartir
   altura y línea de base con el botón con borde (si no, parecen enlaces sueltos). */
.page-noticias .noticia__foot .btn--ghost { --btn-bg: var(--surface); --btn-bd: var(--border); }
.noticia__status { font-size: var(--fs-small); font-weight: 700; color: var(--success); min-height: 1.4em; }
.noticia__status.is-error { color: var(--danger); }
.noticia__status:empty { display: none; }
.noticia__foot .btn.is-done { --btn-fg: var(--success); }

/* ==========================================================================
   5. Print: se imprimen el pliego y las cards; los dialogs ya los oculta base.css
   ========================================================================== */
@media print {
  .noticias-hero__links, .noticia-destacada__actions { display: none; }
  .noticia-destacada { grid-template-columns: 1fr; }
  .noticia-destacada__media { box-shadow: none; }
  .noticia-card__plate::before { display: none; }
}

/* ==========================================================================
   Novedades de Instagram (sección generada por js/novedades.js)
   ========================================================================== */
.novedades__barra {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: var(--sp-3) var(--sp-6);
  margin-bottom: var(--sp-6);
  padding-bottom: var(--sp-4);
  border-bottom: 1px solid var(--border);
}
.novedades__chips { flex: 1 1 26rem; gap: .5rem; }
.novedades__count { white-space: nowrap; font-variant-numeric: tabular-nums; }

.chip--cat { border-color: color-mix(in srgb, var(--c) 35%, var(--border)); }
.chip--cat::before {
  content: ""; width: .5rem; height: .5rem; border-radius: 50%;
  background: var(--c); flex: none;
}
.chip--cat:hover { border-color: var(--c); background: color-mix(in srgb, var(--c) 8%, var(--surface)); }
.chip--cat.is-active,
.chip--cat[aria-pressed="true"] {
  color: #fff; background: var(--c); border-color: var(--c);
}
[data-theme="dark"] .chip--cat.is-active,
[data-theme="dark"] .chip--cat[aria-pressed="true"] {
  color: #0B1020; background: color-mix(in srgb, var(--c) 55%, #fff);
  border-color: color-mix(in srgb, var(--c) 55%, #fff);
}
.chip--cat.is-active::before,
.chip--cat[aria-pressed="true"]::before { background: currentColor; }

.novedades__grid { margin-bottom: var(--sp-8); }
@media (min-width: 62rem) { .novedades__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.novedades__grid .card__title { font-size: clamp(1.0625rem, 1rem + .35vw, 1.25rem); }
.novedades__grid .card__text { -webkit-line-clamp: 3; }
.novedades__mas-wrap { display: flex; justify-content: center; }
.novedades__mas { min-width: 16rem; }

/* Ficha de lectura */
.novedad-dlg .noticia__meta {
  display: flex; align-items: center; gap: .5rem .75rem; flex-wrap: wrap;
  font-size: var(--fs-small); color: var(--text-muted);
}
.novedad-dlg__lugar { font-size: var(--fs-xs); }
.novedad-dlg .noticia__media img { width: 100%; height: auto; border-radius: var(--radius); }
.novedad-dlg .noticia__cuerpo p + p { margin-top: .75rem; }

@media (max-width: 47.99rem) {
  /* Los chips envuelven en varias filas: un carril horizontal con scroll propio hace que la
     página entera se pueda desplazar de costado en Chrome. */
  .novedades__barra { flex-direction: column; align-items: stretch; }
  .novedades__chips { flex-wrap: wrap; max-width: 100%; min-width: 0; }
  .novedades__chips .chip { font-size: var(--fs-xs); }
  .novedades__mas { width: 100%; min-width: 0; }
}

/* Origen de la novedad destacada (icono + palabra) y pie del archivo unificado */
.noticia-destacada__fuente {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--text-muted);
}
.noticia-destacada__media img { object-position: 50% 50%; }
.novedades__pie { margin-top: var(--sp-6); }
