/* =========================================================
   AgroRuralNoticias - Página de noticia (noticias_pagina.tpl)
   Todo está acotado bajo .nota-page para no afectar otras páginas.
   Algunos !important quedan de cuando convivía con estilos anteriores.
   ========================================================= */

.nota-page {
  --nota-green: #2d5016;
  --nota-green-2: #4a7c59;
  --nota-gold: #a7913f;
  --nota-gold-soft: #f6f1df;
  --nota-text: #1f2a24;
  --nota-muted: #66746b;
  --nota-line: #e6ebe7;
  --nota-card: #ffffff;
  --nota-radius: 14px;
  --nota-shadow: 0 1px 2px rgba(20, 40, 25, .06), 0 8px 24px rgba(20, 40, 25, .06);
  --nota-shadow-hover: 0 2px 4px rgba(20, 40, 25, .08), 0 14px 32px rgba(20, 40, 25, .12);
}


/* ---------- Layout ---------- */
.nota-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  max-width: 1240px;
  margin: 0 auto 40px;
  padding: 0 16px;
  clear: both;
}

.nota-main,
.nota-aside {
  min-width: 0;
}

/* ---------- Artículo ---------- */
.nota-article {
  background: var(--nota-card);
  border-radius: var(--nota-radius);
  box-shadow: var(--nota-shadow);
  overflow: hidden;
}

.nota-header {
  padding: 32px 36px 0;
}

.nota-kicker {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nota-gold);
  margin-bottom: 12px;
}

.nota-page .nota-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: clamp(26px, 19px + 1.6vw, 40px) !important;
  line-height: 1.2 !important;
  font-weight: 700 !important;
  color: var(--nota-text) !important;
  margin: 0 0 16px !important;
  padding: 0 !important;
  border: 0 !important;
  overflow-wrap: anywhere;
}

.nota-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--nota-line);
  font-size: 13px;
  color: var(--nota-muted);
}

.nota-meta i {
  margin-right: 6px;
  color: var(--nota-gold);
}

.nota-page .nota-meta a {
  color: var(--nota-green) !important;
  font-weight: 600;
}

.nota-page .nota-meta a:hover {
  color: var(--nota-gold) !important;
}

/* ---------- Imagen principal ----------
   - Nunca se deforma (width/height auto + object-fit: contain).
   - Si la imagen es grande, se achica respetando su proporción.
   - Si es chica, se muestra a su tamaño real, centrada sobre un
     fondo difuminado con la misma imagen, sin romper el diseño. */
.nota-media {
  position: relative;
  margin: 24px 36px 0;
  border-radius: 12px;
  overflow: hidden;
  background: #eef2ef;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 220px;
  isolation: isolate;
}

.nota-media::before {
  content: "";
  position: absolute;
  inset: -30px;
  background-image: var(--nota-img);
  background-size: cover;
  background-position: center;
  filter: blur(28px) saturate(1.1);
  opacity: .55;
  z-index: -1;
}

.nota-page .nota-media img {
  display: block;
  width: auto !important;
  height: auto !important;
  max-width: 100% !important;
  max-height: 520px;
  object-fit: contain;
  margin: 0 auto !important;
  border-radius: 0 !important;
  transform: none !important;
  filter: none !important;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12);
}

/* ---------- Cuerpo ---------- */
.nota-body {
  padding: 28px 36px 36px;
  font-size: 17px;
  line-height: 1.75;
  color: var(--nota-text);
  overflow-wrap: anywhere;
}

.nota-page .nota-body p {
  font-size: 17px;
  line-height: 1.75 !important;
  color: #33413a !important;
  margin: 0 0 18px !important;
}

.nota-page .nota-body .nota-lead {
  font-size: 19px;
  font-weight: 500;
  color: var(--nota-text) !important;
}

/* Imágenes que pudieran venir dentro del texto largo */
.nota-page .nota-body img {
  max-width: 100% !important;
  height: auto !important;
  display: block;
  margin: 16px auto !important;
  transform: none !important;
}

.nota-page .nota-body a.nota-readmore {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-left: 4px;
  font-weight: 600;
  color: var(--nota-green) !important;
  border-bottom: 2px solid var(--nota-gold);
  white-space: nowrap;
}

.nota-page .nota-body a.nota-readmore:hover {
  color: var(--nota-gold) !important;
}

.nota-ad {
  margin-top: 24px;
  min-width: 0;
}

/* ---------- Compartir ---------- */
.nota-share {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 24px 0;
}

.nota-share-label {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--nota-muted);
  margin-right: 4px;
}

.nota-page .nota-share a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 16px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  color: #fff !important;
  transition: transform .15s ease, box-shadow .15s ease, filter .15s ease !important;
}

.nota-page .nota-share a:hover {
  color: #fff !important;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, .15);
  filter: brightness(1.05);
}

.nota-page .nota-share a i {
  font-size: 16px;
}

.nota-page .nota-share .whatsapp   { background: #25d366; }
.nota-page .nota-share .facebook   { background: #1877f2; }
.nota-page .nota-share .twitter    { background: #111; }
.nota-page .nota-share .googleplus { background: #db4437; }

/* ---------- Anterior / Siguiente ---------- */
.nota-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.nota-page .nota-nav a {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 20px;
  background: var(--nota-card);
  border-radius: var(--nota-radius);
  box-shadow: var(--nota-shadow);
  border: 1px solid transparent;
  color: var(--nota-text) !important;
  transition: box-shadow .2s ease, border-color .2s ease, transform .2s ease !important;
  min-width: 0;
}

.nota-page .nota-nav a:hover {
  box-shadow: var(--nota-shadow-hover);
  border-color: var(--nota-gold);
  transform: translateY(-2px);
}

.nota-nav .nota-nav-next {
  grid-column: 2;
  justify-content: flex-end;
  text-align: right;
}

.nota-nav-arrow {
  flex: 0 0 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--nota-gold-soft);
  color: var(--nota-gold);
  font-size: 18px;
}

.nota-nav-text {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.nota-nav-text small {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--nota-muted);
  margin-bottom: 4px;
}

.nota-nav-text span {
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Títulos de sección ---------- */
.nota-page .nota-section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 26px !important;
  font-weight: 700 !important;
  color: var(--nota-text) !important;
  margin: 0 0 20px !important;
}

.nota-section-title::after {
  content: "";
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--nota-gold), transparent);
}

/* ---------- Grilla de noticias recientes ----------
   Contenedor con proporción fija + object-fit: cover:
   todas las tarjetas miden igual y ninguna imagen se estira. */
.nota-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

.nota-page .nota-card {
  display: flex;
  flex-direction: column;
  background: var(--nota-card);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--nota-shadow);
  color: var(--nota-text) !important;
  transition: box-shadow .25s ease, transform .25s ease !important;
}

.nota-page .nota-card:hover {
  box-shadow: var(--nota-shadow-hover);
  transform: translateY(-3px);
}

.nota-card-img {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #e8efe9, #dfe8e1);
}

.nota-page .nota-card-img img {
  position: absolute;
  inset: 0;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  object-fit: cover;
  object-position: center;
  border-radius: 0 !important;
  margin: 0 !important;
  transition: transform .5s ease !important;
}

.nota-page .nota-card:hover .nota-card-img img {
  transform: scale(1.05);
  filter: none;
}

.nota-card-title {
  padding: 14px 16px 16px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nota-page .nota-card:hover .nota-card-title {
  color: var(--nota-green);
}

.nota-page .nota-all {
  display: block;
  text-align: center;
  padding: 14px 20px;
  border-radius: 999px;
  background: var(--nota-green);
  color: #fff !important;
  font-weight: 600;
  letter-spacing: .02em;
  box-shadow: var(--nota-shadow);
}

.nota-page .nota-all:hover {
  background: var(--nota-green-2);
  color: #fff !important;
}

/* ---------- Barra lateral ---------- */
.nota-aside {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.nota-widget {
  background: var(--nota-card);
  border-radius: var(--nota-radius);
  box-shadow: var(--nota-shadow);
  padding: 22px;
  min-width: 0;
}

.nota-page .nota-widget-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 20px !important;
  font-weight: 700 !important;
  color: var(--nota-text) !important;
  margin: 0 0 14px !important;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--nota-gold);
}

.nota-widget ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.nota-systems li + li {
  border-top: 1px solid var(--nota-line);
}

.nota-page .nota-systems a {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--nota-text) !important;
}

.nota-systems a i {
  margin-top: 3px;
  color: var(--nota-gold);
}

.nota-page .nota-systems a:hover {
  color: var(--nota-green) !important;
}

.nota-recent li {
  padding: 14px 0;
}

.nota-recent li + li {
  border-top: 1px solid var(--nota-line);
}

.nota-page .nota-recent a {
  display: block;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.35;
  color: var(--nota-text) !important;
  margin-bottom: 6px;
}

.nota-page .nota-recent a:hover {
  color: var(--nota-green) !important;
}

.nota-page .nota-recent p {
  font-size: 13px;
  line-height: 1.55 !important;
  color: var(--nota-muted) !important;
  margin: 0 !important;
}

.nota-sticky {
  position: sticky;
  top: 16px;
}

/* ---------- Responsive ---------- */
@media (max-width: 992px) {
  .nota-layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .nota-sticky {
    position: static;
  }
}

@media (max-width: 600px) {
  .nota-layout {
    padding: 0 10px;
    gap: 20px;
  }
  .nota-header {
    padding: 22px 18px 0;
  }
  .nota-media {
    margin: 18px 18px 0;
    min-height: 160px;
  }
  .nota-page .nota-media img {
    max-height: 360px;
  }
  .nota-body {
    padding: 22px 18px 26px;
  }
  .nota-page .nota-body p {
    font-size: 16px;
  }
  .nota-page .nota-body .nota-lead {
    font-size: 17px;
  }
  .nota-nav {
    grid-template-columns: minmax(0, 1fr);
  }
  .nota-nav .nota-nav-next {
    grid-column: 1;
  }
  .nota-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }
  .nota-card-title {
    font-size: 14px;
    padding: 10px 12px 12px;
  }
  .nota-page .nota-share a {
    flex: 1 1 auto;
    justify-content: center;
  }
}

.nota-sticky > .nota-widget + .nota-widget {
  margin-top: 24px;
}
