/* ==========================================================================
   St. Trinnean's School — Listado de novedades (publicaciones.php)
   Prefijo .nov- ; mismas variables visuales que publicacion.css
   ========================================================================== */

:root {
  --pub-navy: #001871;
  --pub-navy-90: #14297f;
  --pub-accent: #f57b51;
  --pub-ink: #1d2433;
  --pub-muted: #5b6475;
  --pub-line: #e3e6ee;
  --pub-soft: #f4f6fa;
  --pub-radius: 14px;
  --pub-shadow: 0 10px 30px -12px rgba(0, 24, 113, .25);
}

.nov-breadcrumbs { display: flex; flex-wrap: wrap; gap: .25rem .5rem; font-size: .9rem; }
.nov-breadcrumbs a { color: var(--pub-navy); }
.nov-breadcrumbs span[aria-hidden] { color: #9aa2b1; }

.nov {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--pub-ink);
  background: #fff;
  padding: 2.5rem 0 4rem;
}
.nov .container { max-width: 1140px; }

/* ---------- Encabezado ---------- */
.nov-header { text-align: center; margin-bottom: 1.75rem; }
.nov-header__title {
  margin: 0;
  color: var(--pub-navy);
  font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
  text-transform: none;
}
.nov-header__lead {
  margin: .6rem auto 0;
  max-width: 40rem;
  color: var(--pub-muted);
  font-size: 1.1rem;
  line-height: 1.55;
}

/* ---------- Filtro por nivel ---------- */
.nov-filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: .5rem;
  margin-bottom: 2rem;
}
.nov-chip {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: .45rem 1.1rem;
  border: 1px solid var(--pub-line);
  border-radius: 999px;
  background: #fff;
  color: var(--pub-ink);
  font-size: .95rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
}
.nov-chip:hover { border-color: var(--pub-navy); color: var(--pub-navy); text-decoration: none; }
.nov-chip.is-active { background: var(--pub-navy); border-color: var(--pub-navy); color: #fff; }
.nov-chip:focus-visible { outline: 3px solid var(--pub-accent); outline-offset: 2px; }

/* ---------- Elementos comunes de tarjeta ---------- */
.nov-card__tag {
  margin: 0 0 .35rem;
  color: var(--pub-navy);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.nov-card__more {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  margin-top: auto;
  padding-top: .75rem;
  color: var(--pub-navy);
  font-size: .92rem;
  font-weight: 500;
}
.nov-card__more svg { transition: transform .2s ease; }

.nov-card__placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  background: var(--pub-navy);
  color: rgba(255, 255, 255, .85);
  font-size: .85rem;
  font-weight: 500;
  letter-spacing: .03em;
}
.nov-card__placeholder img { width: auto; height: auto; max-width: 64px; position: static; }

/* ---------- Destacada ---------- */
.nov-featured { margin-bottom: 2rem; }
.nov-featured__link {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  border: 1px solid var(--pub-line);
  border-radius: var(--pub-radius);
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: box-shadow .25s ease, border-color .25s ease;
}
.nov-featured__link:hover { box-shadow: var(--pub-shadow); border-color: transparent; color: inherit; text-decoration: none; }
.nov-featured__link:focus-visible { outline: 3px solid var(--pub-accent); outline-offset: 3px; }
.nov-featured__media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--pub-soft);
  overflow: hidden;
}
.nov-featured__media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.nov-featured__link:hover .nov-featured__media > img { transform: scale(1.03); }
.nov-featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2rem 2.25rem;
}
.nov-featured__badge {
  align-self: flex-start;
  margin: 0 0 .9rem;
  padding: .25rem .75rem;
  border-radius: 999px;
  background: #fde8df;
  color: #8a3413;
  font-size: .8rem;
  font-weight: 700;
}
.nov-featured__title {
  margin: 0;
  color: var(--pub-navy);
  font-size: clamp(1.4rem, 1.1rem + 1.2vw, 2rem);
  font-weight: 700;
  line-height: 1.2;
  text-transform: none;
}
.nov-featured__excerpt {
  margin: .75rem 0 0;
  color: var(--pub-muted);
  font-size: 1.05rem;
  line-height: 1.6;
}
.nov-featured .nov-card__more { margin-top: 1rem; }

/* ---------- Grilla ---------- */
.nov-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
}
.nov-card { display: flex; }
.nov-card__link {
  display: flex;
  flex-direction: column;
  width: 100%;
  border: 1px solid var(--pub-line);
  border-radius: var(--pub-radius);
  overflow: hidden;
  background: #fff;
  color: inherit;
  text-decoration: none;
  transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease;
}
.nov-card__link:hover {
  border-color: transparent;
  box-shadow: var(--pub-shadow);
  transform: translateY(-3px);
  color: inherit;
  text-decoration: none;
}
.nov-card__link:focus-visible { outline: 3px solid var(--pub-accent); outline-offset: 3px; }
.nov-card__link:hover .nov-card__more svg { transform: translateX(3px); }
.nov-card__media {
  position: relative;
  aspect-ratio: 3 / 2;
  background: var(--pub-soft);
  overflow: hidden;
}
@supports not (aspect-ratio: 1 / 1) {
  .nov-card__media, .nov-featured__media { height: 0; padding-top: 66.6667%; }
}
.nov-card__media > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s ease;
}
.nov-card__link:hover .nov-card__media > img { transform: scale(1.04); }
.nov-card__body {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  padding: 1.1rem 1.25rem 1.25rem;
}
.nov-card__title {
  margin: 0;
  color: var(--pub-ink);
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1.3;
  text-transform: none;
  overflow-wrap: anywhere;
}
.nov-card__excerpt {
  margin: .45rem 0 0;
  color: var(--pub-muted);
  font-size: .95rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.nov-card.is-new { animation: nov-in .45s ease both; }
@keyframes nov-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

/* ---------- Ver más ---------- */
.nov-more { margin-top: 2.5rem; text-align: center; }
.nov-more__count { margin: 0 0 1rem; color: var(--pub-muted); font-size: .92rem; }
.nov-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: .75rem 1.75rem;
  border: 0;
  border-radius: 999px;
  background: var(--pub-navy);
  color: #fff;
  font-weight: 500;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .2s ease;
}
.nov-btn:hover { background: var(--pub-navy-90); color: #fff; text-decoration: none; }
.nov-btn:focus-visible { outline: 3px solid var(--pub-accent); outline-offset: 2px; }
.nov-btn[aria-busy="true"] { opacity: .7; cursor: progress; }
.nov-btn[aria-busy="true"]::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, .5);
  border-top-color: #fff;
  border-radius: 50%;
  animation: nov-spin .8s linear infinite;
}
@keyframes nov-spin { to { transform: rotate(360deg); } }

.nov-empty { text-align: center; padding: 3rem 1rem; color: var(--pub-muted); }
.nov-empty p { margin-bottom: 1.25rem; font-size: 1.05rem; }

/* ---------- Bloque reutilizable (inicio y secciones) ---------- */
.nov-block {
  font-family: Roboto, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--pub-ink);
  padding: 4rem 0;
  background: var(--pub-soft);
}
.nov-block .container { max-width: 1140px; }
.nov-block__head { text-align: center; margin-bottom: 2.25rem; }
.nov-block__kicker {
  margin: 0 0 .35rem;
  color: #a8401b; /* naranja institucional oscurecido: contraste AA sobre fondo claro */
  font-size: .85rem;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.nov-block__title {
  margin: 0;
  color: var(--pub-navy);
  font-size: clamp(1.7rem, 1.3rem + 1.6vw, 2.4rem);
  font-weight: 700;
  line-height: 1.15;
  text-transform: none;
}
.nov-block .nov-card__title { font-size: 1.15rem; }
.nov-btn--outline { background: #fff; color: var(--pub-navy); border: 2px solid var(--pub-navy); }
.nov-btn--outline:hover { background: var(--pub-navy); color: #fff; }
@media (max-width: 575.98px) { .nov-block { padding: 3rem 0; } }

/* ---------- Responsive ---------- */
@media (max-width: 991.98px) {
  .nov-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; }
  .nov-featured__link { grid-template-columns: 1fr; }
  .nov-featured__body { padding: 1.5rem; }
}
@media (max-width: 575.98px) {
  .nov { padding: 1.75rem 0 3rem; }
  .nov-grid { grid-template-columns: 1fr; }
  /* Filtros en una sola fila deslizable */
  .nov-filters {
    flex-wrap: nowrap;
    justify-content: flex-start;
    overflow-x: auto;
    margin: 0 -15px 1.5rem;
    padding: 2px 15px 6px;
    scrollbar-width: none;
  }
  .nov-filters::-webkit-scrollbar { display: none; }
  .nov-btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  .nov-card__link, .nov-card__media > img, .nov-featured__media > img, .nov-card__more svg { transition: none; }
  .nov-card.is-new { animation: none; }
  .nov-card__link:hover { transform: none; }
}
