/* Presentación pública. Selectores acotados: no estilizar modales ni sus controles. */
/* Títulos internos: el hero del inicio conserva sus reglas y su estructura. */
.internal-page-hero .internal-page-heading { position: absolute; inset: auto 0 0; padding: 32px 20px 24px; text-align: center; background: linear-gradient(transparent, #14281bd9); }
.internal-page-hero .internal-page-title { max-width: 1100px; margin: 0 auto; font-size: 36px; line-height: 1.2; font-weight: 700; letter-spacing: -.025em; color: #fff; text-wrap: balance; }
.internal-page-hero .internal-page-title::after { width: 40px; height: 3px; margin: 14px auto 0; background: #83c79a; }
.internal-page-title::after,
#homeRight > h2::after,
body > section:has(#newsList) > div > .grid > div:first-child > h2::after,
body > [data-news-sector] > div:first-child h2::after,
#sectorsGrid h3::after,
#horarios-telefonos > h2::after,
body > section:has(#clsGrid) > div:first-child h2::after,
#newsTitle:not(:empty)::after {
  content: ""; display: block; width: 40px; height: 3px; margin: 14px auto 0; border-radius: 3px; background: #478760;
}
body > [data-news-sector] > div:first-child { flex-wrap: wrap; justify-content: center; gap: 16px; }
body > [data-news-sector] > div:first-child > div:first-child { width: 100%; text-align: center; }
body > [data-news-sector] > div:first-child p { margin-top: 12px; }
body #sectorsGrid > a { flex-direction: column; align-items: center; text-align: center; }
#sectorsGrid > a > div { width: 100%; }
#sectorsGrid h3::after { width: 28px; height: 2px; margin-top: 10px; }
#sectorsGrid p { margin-top: 12px; }
body > section:has(#clsGrid) > div:first-child,
#homeRight > h2,
body > section:has(#newsList) > div > .grid > div:first-child > h2,
#horarios-telefonos > h2,
#newsTitle, #newsDate { text-align: center; }
@media (max-width: 767px) {
  .internal-page-hero .internal-page-heading { padding: 28px 16px 20px; }
  .internal-page-hero .internal-page-title { font-size: 28px; }
}

body[class] {
  background: linear-gradient(110deg, #e8ece9 0%, #f8faf8 48%, #e9edeb 100%);
}
body[class] > header[class] {
  background: linear-gradient(110deg, #17221d, #303c35 65%, #49534c);
  box-shadow: 0 3px 18px #14251c20;
  border-bottom: 1px solid #ffffff1c;
}
body[class] footer:has(#y) {
  background: linear-gradient(110deg, #17221d, #303c35 65%, #49534c);
  border-top: 3px solid #238257;
  padding-block: 30px;
}
body footer:has(#y) > div { max-width: 1280px; }
body footer:has(#y) p { line-height: 1.8; }

/* Un único formato horizontal: imagen completa, sin deformación ni recorte.
   Alturas independientes de la altura de la ventana. */
body .site-hero {
  height: 400px;
  overflow: hidden;
  background-color: #24352c;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  isolation: isolate;
}
.site-hero > div:first-child {
  background: linear-gradient(180deg, #0d1e1710, #0d1e1728 45%, #0d1e17c9);
}
.site-hero > div:nth-child(2) {
  padding: 28px;
}
.site-hero h1 {
  max-width: 1000px;
  text-align: center;
  text-wrap: balance;
  font-size: 44px;
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: -.025em;
  text-shadow: 0 2px 18px #07150cb3;
}
.site-hero h1::after {
  content: "";
  display: block;
  width: 52px;
  height: 4px;
  margin: 22px auto 0;
  border-radius: 4px;
  background: #6bd59a;
}
body .site-hero-logo { height: 250px; max-width: 90%; object-fit: contain; }
#heroBand > div:nth-child(2) { gap: 20px; }
#heroBand a {
  min-height: 46px;
  padding: 12px 24px;
  border-radius: 12px;
  background: #147443;
  box-shadow: 0 8px 24px #0003;
}
.site-hero + div,
#inicio + [role="separator"] {
  height: 5px;
  background: linear-gradient(90deg, #23352a, #36985f 50%, #23352a);
}

/* Contenido público: no aplicar reglas globales a títulos ni botones. */
body[class] > section:not(:has(.site-hero)), body[class] > main {
  background: transparent;
  padding-top: 48px;
  padding-bottom: 56px;
}
body > section[data-news-sector] { min-height: 260px; }
body > main:has(#historia) { padding-top: 16px; }
#historia { padding-inline: 0; }
#newsList, #homeRight { min-width: 0; }
#homeRight > .grid { gap: 12px; }
#homeRight > .grid > a,
#sectorsGrid > a,
#newsList > article,
[data-news-sector] article,
#clsGrid > article,
#newsArticle {
  border: 1px solid #dbe5dd;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 5px 20px #22382b08;
}
#homeRight > .grid > a, #sectorsGrid > a {
  padding: 18px;
  gap: 12px;
  align-items: flex-start;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
#homeRight > .grid > a > span, #sectorsGrid > a > span {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
}
#homeRight h3 { font-size: 14px; line-height: 1.4; }
#homeRight .grid p { margin-top: 5px; font-size: 12px; line-height: 1.55; }
#homeRight > a { font-size: 14px; font-weight: 600; margin-top: 20px; }
#sectorsGrid > a { padding: 26px; }
#sectorsGrid h3 { line-height: 1.35; }
#sectorsGrid p { line-height: 1.65; }
#newsList > article { padding: 20px; }
#newsList h3 { line-height: 1.4; }
#newsList > article p { line-height: 1.65; }
#newsList { gap: 18px; }
#homeRight > h2,
body > section:has(#newsList) > div > .grid > div:first-child > h2 {
  font-size: 28px;
  letter-spacing: -.025em;
  font-weight: 700;
  margin-bottom: 24px;
  color: #223b2d;
}
[data-news-sector] > p {
  padding: 32px;
  border: 1px dashed #bacfc0;
  border-radius: 18px;
  background: #ffffffa6;
  text-align: center;
}
#clsGrid { gap: 24px; }
body > section:has(#clsGrid) > div:first-child {
  padding-bottom: 26px;
  border-bottom: 1px solid #d7e2db;
}
body > section:has(#clsGrid) > div:first-child h2 { font-size: 36px; }
body > section:has(#clsGrid) > div:first-child p { margin-top: 12px; font-size: 16px; }
#newsArticle { overflow: hidden; }
#newsTitle { font-size: 36px; line-height: 1.2; letter-spacing: -.025em; text-wrap: balance; }
#newsDate { color: #52705c; }
#newsBody { color: #38483e; line-height: 1.85; }

@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #homeRight > .grid > a:hover, #sectorsGrid > a:hover {
    transform: translateY(-3px);
    border-color: #83b798;
    box-shadow: 0 12px 24px #22382b12;
  }
}
#homeRight a:focus-visible, #sectorsGrid a:focus-visible, #heroBand a:focus-visible {
  outline: 3px solid #37a66b;
  outline-offset: 4px;
}
@media (min-width: 768px) and (max-width: 1023px) {
  body .site-hero { height: 320px; }
  body .site-hero-logo { height: 190px; }
  .site-hero h1 { font-size: 36px; }
}
@media (max-width: 767px) {
  body .site-hero { height: 240px; }
  body .site-hero-logo { height: 130px; }
  .site-hero > div:nth-child(2) { padding: 20px; }
  .site-hero:not(#heroBand) { background-position: center top; }
  .site-hero:not(#heroBand) > div:nth-child(2) { align-items: flex-end; }
  .site-hero h1 { font-size: 28px; line-height: 1.2; }
  .site-hero h1::after { margin-top: 16px; width: 40px; height: 3px; }
  #heroBand > div:nth-child(2) { gap: 12px; }
  #heroBand a { min-height: 44px; padding: 10px 18px; font-size: 14px; }
  body[class] > section:not(:has(.site-hero)), body[class] > main { padding-block: 32px; }
  body > section[data-news-sector] { min-height: 200px; }
  #homeRight > .grid > a { padding: 14px; flex-direction: column; gap: 10px; }
  #homeRight > .grid > a > span { flex-basis: 38px; width: 38px; height: 38px; }
  #homeRight > .grid { gap: 10px; }
  #newsList > article { padding: 16px; }
  #sectorsGrid > a { padding: 20px; }
  #newsTitle, body > section:has(#clsGrid) > div:first-child h2 { font-size: 28px; }
  #newsBody { font-size: 16px; }
  body[class] footer:has(#y) { padding-block: 24px; }
  body footer:has(#y) p { text-align: center; }
}

/* Presentación de RRHH: estilos limitados a esta sección. */
#rrhh-presentacion .rrhh-presentacion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  padding-bottom: 40px;
  border-bottom: 1px solid #d7e2db;
}
#rrhh-presentacion h2 {
  color: #223b2d;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.025em;
  text-wrap: balance;
}
#rrhh-presentacion h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: #478760;
}
#rrhh-presentacion .rrhh-presentacion-intro {
  margin-top: 20px;
  color: #38483e;
  font-size: 16px;
  line-height: 1.8;
}
#rrhh-presentacion h3 {
  margin-top: 28px;
  color: #223b2d;
  font-size: 18px;
  font-weight: 700;
}
#rrhh-presentacion .rrhh-roles { margin-top: 18px; }
#rrhh-presentacion .rrhh-roles > div {
  padding-left: 16px;
  border-left: 2px solid #a9cbb4;
}
#rrhh-presentacion .rrhh-roles > div + div { margin-top: 20px; }
#rrhh-presentacion dt { color: #203b2b; font-size: 15px; font-weight: 600; line-height: 1.5; }
#rrhh-presentacion dd { margin: 6px 0 0; color: #5c6d62; font-size: 15px; line-height: 1.7; }
#rrhh-presentacion .rrhh-presentacion-imagen {
  overflow: hidden;
  border: 1px solid #dbe5dd;
  border-radius: 18px;
  background: #edf3ee;
  box-shadow: 0 5px 20px #22382b08;
}
#rrhh-presentacion img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; }
@media (max-width: 767px) {
  #rrhh-presentacion .rrhh-presentacion-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-bottom: 32px; }
  #rrhh-presentacion h2 { font-size: 24px; }
  #rrhh-presentacion img { aspect-ratio: 4 / 3; }
}

/* Presentación y catálogo de la fábrica de alimentos. */
#alimentos-presentacion .alimentos-presentacion-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  align-items: center;
  gap: 48px;
  padding-bottom: 44px;
  border-bottom: 1px solid #d7e2db;
}
#alimentos-presentacion .alimentos-presentacion-texto > h2,
#alimentos-presentacion .alimentos-productos-encabezado > h2 {
  color: #223b2d;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: -.025em;
  text-wrap: balance;
}
#alimentos-presentacion .alimentos-presentacion-texto > h2::after,
#alimentos-presentacion .alimentos-productos-encabezado > h2::after {
  content: "";
  display: block;
  width: 40px;
  height: 3px;
  margin-top: 14px;
  border-radius: 3px;
  background: #478760;
}
#alimentos-presentacion .alimentos-presentacion-texto > p {
  margin-top: 18px;
  color: #38483e;
  font-size: 15px;
  line-height: 1.75;
}
#alimentos-presentacion .alimentos-presentacion-texto > .alimentos-destacado {
  color: #287347;
  font-size: 17px;
  font-weight: 700;
}
#alimentos-presentacion .alimentos-servicios { margin-top: 26px; }
#alimentos-presentacion .alimentos-servicios > div {
  padding-left: 16px;
  border-left: 2px solid #a9cbb4;
}
#alimentos-presentacion .alimentos-servicios > div + div { margin-top: 20px; }
#alimentos-presentacion .alimentos-servicios dt { color: #203b2b; font-size: 15px; font-weight: 700; line-height: 1.5; }
#alimentos-presentacion .alimentos-servicios dd { margin: 6px 0 0; color: #5c6d62; font-size: 14px; line-height: 1.7; }
#alimentos-presentacion .alimentos-video-wrap {
  overflow: hidden;
  border: 1px solid #d4e1d8;
  border-radius: 18px;
  background: #17221d;
  box-shadow: 0 8px 26px #22382b16;
}
#alimentos-presentacion .alimentos-video-wrap video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: linear-gradient(135deg, #22352a, #101b15);
  object-fit: contain;
}
#alimentos-presentacion .alimentos-video-wrap > p {
  margin: 0;
  padding: 13px 16px;
  color: #d7e8dc;
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}
#alimentos-presentacion .alimentos-productos { padding-top: 44px; }
#alimentos-presentacion .alimentos-productos-encabezado { margin-bottom: 26px; text-align: center; }
#alimentos-presentacion .alimentos-productos-encabezado > span {
  display: block;
  margin-bottom: 8px;
  color: #478760;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
#alimentos-presentacion .alimentos-productos-encabezado > h2::after { margin-inline: auto; }
#alimentos-presentacion .alimentos-productos-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: start;
  gap: 22px;
}
#alimentos-presentacion .alimentos-producto-bovinos { grid-column: span 2; }
#alimentos-presentacion .alimentos-productos-lateral { display: contents; }
#alimentos-presentacion .alimentos-productos-lateral > article:last-child { grid-column: 1 / -1; }
#alimentos-presentacion .alimentos-producto-grupo {
  padding: 24px;
  border: 1px solid #dbe5dd;
  border-radius: 16px;
  background: #ffffffb8;
  box-shadow: 0 4px 16px #22382b08;
}
#alimentos-presentacion .alimentos-producto-grupo > header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dbe5dd;
}
#alimentos-presentacion .alimentos-producto-icono {
  display: grid;
  flex: 0 0 40px;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 12px;
  background: #e6f2e9;
  color: #367c50;
}
#alimentos-presentacion .alimentos-producto-icono svg { width: 25px; height: 25px; }
#alimentos-presentacion .alimentos-producto-grupo h3 { color: #203b2b; font-size: 20px; font-weight: 700; }
#alimentos-presentacion .alimentos-sublineas { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 26px; }
#alimentos-presentacion .alimentos-sublineas-compactas { gap: 40px; }
#alimentos-presentacion .alimentos-producto-grupo h4 {
  margin-bottom: 12px;
  color: #397551;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
}
#alimentos-presentacion .alimentos-producto-grupo ul { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
#alimentos-presentacion .alimentos-producto-grupo li {
  position: relative;
  padding-left: 15px;
  color: #526359;
  font-size: 13px;
  line-height: 1.55;
}
#alimentos-presentacion .alimentos-producto-grupo li::before {
  content: "";
  position: absolute;
  top: .66em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #68a47d;
}
@media (max-width: 900px) {
  #alimentos-presentacion .alimentos-presentacion-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  #alimentos-presentacion .alimentos-video-wrap { width: 100%; max-width: 680px; margin-inline: auto; }
  #alimentos-presentacion .alimentos-productos-grid { grid-template-columns: minmax(0, 1fr); }
  #alimentos-presentacion .alimentos-producto-bovinos,
  #alimentos-presentacion .alimentos-productos-lateral > article:last-child { grid-column: auto; }
}
@media (max-width: 600px) {
  #alimentos-presentacion .alimentos-presentacion-grid { gap: 28px; padding-bottom: 32px; }
  #alimentos-presentacion .alimentos-presentacion-texto > h2,
  #alimentos-presentacion .alimentos-productos-encabezado > h2 { font-size: 24px; }
  #alimentos-presentacion .alimentos-productos { padding-top: 34px; }
  #alimentos-presentacion .alimentos-productos-grid,
  #alimentos-presentacion .alimentos-productos-lateral,
  #alimentos-presentacion .alimentos-sublineas { grid-template-columns: minmax(0, 1fr); }
  #alimentos-presentacion .alimentos-producto-grupo { padding: 19px; }
}

/* Novedades públicas. No aplicar a allNewsList ni sectorNewsModal. */
#newsList > article {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  background: #fff;
  border-color: #dce7df;
  box-shadow: 0 6px 22px #233b2b09;
}
#newsList > article > div:first-child {
  width: 132px;
  height: 116px;
  border-radius: 12px;
  background: linear-gradient(135deg, #edf3ee, #dce8df);
}
#newsList > article > div:first-child:not(:has(img))::after {
  content: "";
  display: block;
  width: 36px;
  height: 36px;
  margin: 40px auto;
  border: 2px solid #a9c2b1;
  border-radius: 10px 10px 24px 10px;
}
#newsList h3 {
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #203b2b;
}
#newsList h3 + p { font-size: 11px; color: #718276; }
#newsList h3 + p + p { font-size: 13px; line-height: 1.6; color: #5c6d62; }
#newsList > article > div:nth-child(2) > a {
  align-self: flex-start;
  margin-top: 12px;
  padding-block: 5px;
  font-size: 12px;
  font-weight: 700;
  text-underline-offset: 4px;
}
/* La fila de acciones administrativas conserva sus botones y visibilidad. */
#newsList > article > div:nth-child(3) { grid-column: 2; justify-content: flex-end; }
body > [data-news-sector] article {
  border-radius: 18px;
  box-shadow: 0 6px 22px #233b2b09;
  background: #fff;
}
body > [data-news-sector] article > div:first-child:has(img) { height: 184px; }
body > [data-news-sector] article > div:nth-child(2) { padding: 20px; }
body > [data-news-sector] article h4 {
  font-size: 18px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: -.015em;
  color: #203b2b;
}
body > [data-news-sector] article p { font-size: 13px; line-height: 1.7; color: #5c6d62; }
body > [data-news-sector] article > div:nth-child(2) > div { color: #718276; margin-top: 16px; }
body > [data-news-sector] article a { align-self: flex-start; padding-block: 6px; font-size: 13px; margin-top: 12px; text-underline-offset: 4px; }
#newsList a:focus-visible, body > [data-news-sector] article a:focus-visible {
  outline: 3px solid #37a66b;
  outline-offset: 4px;
  border-radius: 4px;
}
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  #newsList > article:hover, body > [data-news-sector] article:hover {
    background: #fff;
    border-color: #9ec5ac;
    box-shadow: 0 10px 28px #233b2b12;
  }
}

/* Pie principal únicamente: excluye los pies de pizarras y de modales. */
body[class] footer:has(#y) { padding-block: 42px; border-top-width: 4px; }
body footer:has(#y):has(ul) > div > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, .85fr);
  align-items: start;
  gap: 40px;
}
body footer:has(#y):has(ul) > div > div > div:first-child { min-width: 0; }
body footer:has(#y):has(ul) > div > div > div:first-child > p {
  max-width: 42ch;
  font-size: 16px;
  line-height: 1.65;
  color: #edf5ef;
  text-wrap: balance;
}
body footer:has(#y):has(ul) > div > div > div:first-child > a { margin: 12px 8px 0 0; font-size: 12px; color: #e5f4eb; }
body footer:has(#y):has(ul) > div > div > div:first-child > a:hover { background: #ffffff1a; color: #fff; }
/* Acceso discreto de RRHH: conservar enlace y visibilidad responsive. */
body footer:has(#y) #openLoginModal,
body footer:has(#y) a[href="/rrhh/Reporte_Asistencia.php"] {
  opacity: 0;
}
body footer:has(#y) #openLoginModal:hover,
body footer:has(#y) #openLoginModal:focus-visible,
body footer:has(#y) a[href="/rrhh/Reporte_Asistencia.php"]:hover,
body footer:has(#y) a[href="/rrhh/Reporte_Asistencia.php"]:focus-visible {
  opacity: 1;
}
body footer:has(#y):has(ul) > div > div > div:last-child {
  width: 100%;
  margin-left: 0;
  padding-left: 32px;
  border-left: 1px solid #ffffff24;
  align-items: flex-start;
}
body footer:has(#y):has(ul) > div > div > div:last-child::before {
  content: "Contacto y redes";
  margin-bottom: 14px;
  color: #acdbbc;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}
body footer:has(#y):has(ul) > div > div > div:last-child > p {
  font-size: 13px;
  text-align: left;
  justify-content: flex-start;
  margin-block: 2px;
  color: #d0dfd5;
  opacity: 1;
  overflow-wrap: anywhere;
}
body footer:has(#y) ul { order: 1; gap: 10px; margin: 18px 0 0; }
body footer:has(#y) ul a {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: #ffffff0d;
  border: 1px solid #ffffff30;
  box-shadow: none;
}
body footer:has(#y) ul a svg { width: 30px; height: 30px; color: #d6eadc; }
body footer:has(#y) ul a:hover { background: #ffffff1c; border-color: #86c79d; }
body footer:has(#y) ul a:hover svg { color: #fff; }
body footer:has(#y) p a { color: #a5dfba; text-underline-offset: 4px; }
body footer:has(#y) p a:hover { color: #fff; text-decoration: underline; }
body footer:has(#y) a:focus-visible { outline: 2px solid #a5dfba; outline-offset: 4px; }
@media (max-width: 767px) {
  #newsList > article { grid-template-columns: 92px minmax(0, 1fr); padding: 14px; gap: 14px; }
  #newsList > article > div:first-child { width: 92px; height: 100px; }
  #newsList > article > div:first-child:not(:has(img))::after { margin-block: 32px; }
  #newsList h3 { font-size: 15px; }
  #newsList > article > div:nth-child(2) > a { font-size: 12px; }
  body[class] footer:has(#y) { padding-block: 32px; }
  body footer:has(#y):has(ul) > div > div { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  body footer:has(#y):has(ul) > div > div > div:first-child { text-align: left; }
  body footer:has(#y):has(ul) > div > div > div:first-child > p { text-align: left; font-size: 15px; }
  body footer:has(#y):has(ul) > div > div > div:last-child {
    padding-left: 0;
    padding-top: 24px;
    border-left: 0;
    border-top: 1px solid #ffffff24;
  }
}
