/* ============================================================
   Genesal Energy — estilos (landing + panel + noticias)
   Tokens tomados del diseño de Figma (WEB_2026 / Home).
   ============================================================ */

:root {
  /* Colores corporativos */
  --primary: #cf0540;        /* rojo Genesal (links, acento) */
  --primary-dark: #a80434;
  --text-dark: #222222;      /* titulares */
  --stroke-soft: #e1e1e1;    /* líneas finas */
  --white: #ffffff;
  --corporate-secondary: #151515;

  /* Tipografía */
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* Otros */
  --radio: 8px;
  --transicion: 0.2s ease;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { height: 100%; }

body {
  font-family: var(--font);
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { display: block; max-width: 100%; }

/* ============================================================
   LANDING
   ============================================================ */

.landing {
  min-height: 100vh;
  min-height: 100dvh;
  /* Color igual al suelo de la imagen (#f7f7f7): si al subir la imagen 50px
     asoma algo de fondo abajo, se funde y no se ve ninguna franja. */
  background-color: #f7f7f7;
  background-image: url("../img/imgi_96_campana-2025-genesal-energy-2.jpg");
  background-repeat: no-repeat;
  background-position: center calc(50% - 50px);  /* imagen 50px más arriba */
  background-size: cover;

  display: flex;
  flex-direction: column;
}

.landing__header {
  flex-shrink: 0;
  display: flex;
  justify-content: center;
  padding: clamp(28px, 6.8vh, 61px) 24px 0;
}

.landing__logo {
  width: 163px;
  height: auto;
}

/* Espaciador transparente: deja ver la imagen de fondo entre logo y CTA */
.landing__hero {
  flex: 1 1 auto;
  min-height: 120px;
}

.landing__footer {
  flex-shrink: 0;
  width: 100%;
  display: flex;
  justify-content: center;
  padding: 0 24px clamp(40px, 14.2vh, 128px);
}

/* --- Bloques CTA (3 botones) --- */
.cta {
  display: flex;
  align-items: stretch;
  gap: 40px;                    /* separación entre botones */
  width: min(960px, 100%);      /* 3 botones del mismo tamaño (~293px c/u) */
}

.cta__cell {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  min-height: 160px;            /* altura de los botones */
  padding: 24px;                /* interno 24px en los 4 lados */
  text-decoration: none;
  border-top: 1px solid var(--stroke-soft);
  border-bottom: 1px solid var(--stroke-soft);
  background-color: transparent;
  transition: background-color var(--transicion), border-color var(--transicion);
}

/* Hover: fondo rojo corporativo, texto e icono en blanco */
.cta__cell:hover {
  background-color: var(--primary);
  border-color: var(--primary);
}
.cta__cell:hover .cta__title,
.cta__cell:hover .cta__link { color: #fff; }

.cta__title {
  color: var(--text-dark);
  font-size: clamp(20px, 2vw, 25px);
  line-height: 1.24;            /* 31/25 */
  letter-spacing: -0.5px;
  font-weight: 500;
  transition: color var(--transicion);
}

.cta__link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--primary);
  font-size: 14px;
  line-height: 20px;
  font-weight: 500;
  padding: 8px 0;
  transition: color var(--transicion);
}

.cta__icon {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  transition: transform var(--transicion);
}
.cta__icon--arrow { width: 20px; height: 20px; }
.cta__icon--download { width: 20px; height: 20px; }

/* Animación ligera de los iconos en hover */
.cta__cell:hover .cta__icon--arrow { transform: translateX(4px); }        /* flecha → derecha */
.cta__cell:hover .cta__icon--external { transform: translate(2px, -2px); } /* enlace externo → arriba-derecha */
.cta__cell:hover .cta__icon--download { transform: translateY(3px); }      /* descarga → abajo */

/* Pantallas estrechas: los botones se apilan */
@media (max-width: 560px) {
  .cta { flex-direction: column; width: 100%; max-width: 360px; }
}

/* Botones sobre la imagen (pantallas pequeñas o bajas): efecto "glass" en reposo */
@media (max-width: 560px), (max-height: 720px) {
  .cta__cell {
    background-color: rgba(255, 255, 255, 0.5);
    -webkit-backdrop-filter: blur(12px) saturate(1.3);
    backdrop-filter: blur(12px) saturate(1.3);
  }
}

/* Muy bajas (móvil apaisado): reduce márgenes verticales */
@media (max-height: 560px) {
  .landing__header { padding-top: 16px; }
  .landing__hero { min-height: 80px; }
  .landing__footer { padding: 16px 24px 20px; }
}

/* ============================================================
   PANEL / ÁREA PRIVADA + NOTICIAS (tarjeta común)
   ============================================================ */

.panel {
  min-height: 100vh;
  min-height: 100svh;   /* altura ESTABLE en móvil (no salta con la barra del navegador) */
  display: grid;
  place-items: center;
  padding: 1.5rem;
  color: var(--text-dark);
  background-color: #f2f2f2;   /* gris claro de fondo */
}

.card {
  width: 100%;
  max-width: 420px;
  background: var(--white);
  border: 1px solid var(--stroke-soft);
  border-radius: 12px;
  padding: 2.5rem;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
}

/* Vista de descargas / noticias: tarjeta ancha para varias columnas */
.card--wide { max-width: 1120px; }

/* Logo dentro de la tarjeta, centrado */
.card__logo {
  display: block;
  width: 150px;
  height: auto;
  margin: 0 auto 1.8rem;
}

.card__title { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.4rem; }
.card__subtitle { font-size: 0.9rem; opacity: 0.65; margin-bottom: 1.8rem; }

/* --- Formulario de login --- */
.form__group { margin-bottom: 1.1rem; }
.form__label { display: block; font-size: 0.82rem; margin-bottom: 0.4rem; opacity: 0.8; }

.form__input {
  width: 100%;
  padding: 0.75rem 0.9rem;
  font-size: 1rem;
  font-family: var(--font);
  color: var(--text-dark);
  background: #fafafa;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radio);
  transition: border-color var(--transicion);
}
.form__input:focus { outline: none; border-color: var(--primary); }

.form__error { color: var(--primary); font-size: 0.85rem; margin-top: 0.8rem; min-height: 1.2em; }

/* --- Botones --- */
.btn {
  display: inline-block;
  padding: 0.9rem 2rem;
  font-size: 1rem;
  font-family: var(--font);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radio);
  border: 2px solid transparent;
  cursor: pointer;
  transition: transform var(--transicion), background var(--transicion);
  text-align: center;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }

.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-dark); }
.btn--full { width: 100%; margin-top: 0.5rem; }

.btn--back {
  display: inline-block;
  margin-top: 1.4rem;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.5);
  text-decoration: none;
}
.btn--back:hover { color: var(--text-dark); }

/* --- Cabecera de la vista de descargas --- */
.downloads__title { font-size: 1.3rem; font-weight: 700; margin-bottom: 0.3rem; }
.downloads__welcome { font-size: 0.9rem; opacity: 0.65; margin-bottom: 1.6rem; }

.downloads-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.3rem;
}
.downloads-head .downloads__title { margin-bottom: 0.25rem; }
.downloads-head .downloads__welcome { margin-bottom: 0; }

.btn-logout {
  flex-shrink: 0;
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-dark);
  text-decoration: none;
  background: none;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radio);
  transition: border-color var(--transicion), color var(--transicion);
}
.btn-logout:hover { border-color: var(--primary); color: var(--primary); }

/* Buscador */
.downloads-search {
  width: 100%;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-family: var(--font);
  color: var(--text-dark);
  background: #fafafa;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radio);
  margin-bottom: 1.3rem;
  box-sizing: border-box;
}
.downloads-search:focus { outline: none; border-color: var(--primary); }

/* Secciones */
.downloads-section + .downloads-section { margin-top: 1.6rem; }
.downloads-section__title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgba(0, 0, 0, 0.45);
  margin-bottom: 0.5rem;
}

/* --- Lista de descargas del panel (una columna, filas con líneas) --- */
.downloads-grid {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--stroke-soft);
}

.download-item {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 0.75rem;
  border-bottom: 1px solid var(--stroke-soft);
  text-decoration: none;
  color: var(--text-dark);
  transition: background var(--transicion);
}
.download-item:hover { background: #f2f2f2; }   /* fondo gris solo en hover */

.download-item__filetype { display: flex; align-items: center; flex-shrink: 0; }
.download-item__text { display: flex; flex-direction: column; flex: 1 1 auto; min-width: 0; }
.download-item__name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.download-item__meta { font-size: 0.78rem; opacity: 0.55; margin-top: 2px; }

/* Documento destacado (exclusivo de accionistas): fondo rojo claro */
.download-item--destacado { background: #fdeff3; }
.download-item--destacado:hover { background: #fce3ea; }

.download-item__icon {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  color: #434343;
  transition: transform var(--transicion), color var(--transicion);
}
.download-item:hover .download-item__icon {
  transform: translateY(3px);
  color: var(--primary);
}

.logout {
  display: inline-block;
  margin-top: 1rem;
  font-size: 0.85rem;
  color: rgba(0, 0, 0, 0.5);
  background: none;
  border: none;
  font-family: var(--font);
  text-decoration: none;
  cursor: pointer;
}
.logout:hover { color: var(--text-dark); }

/* ============================================================
   NOTICIAS — rejilla pública de tarjetas descargables
   ============================================================ */

.noticias-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 0.5rem;
}
.noticia-item {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 1rem;
  background: #fafafa;
  border: 1px solid var(--stroke-soft);
  border-radius: var(--radio);
  text-decoration: none;
  color: var(--text-dark);
  transition: border-color var(--transicion), background var(--transicion), transform var(--transicion), box-shadow var(--transicion);
}
.noticia-item:hover {
  border-color: var(--primary);
  background: #fff;
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
}
.noticia-item__icon { flex-shrink: 0; display: flex; }
.noticia-item__body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.noticia-item__name {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.3;
  overflow-wrap: anywhere;
}
.noticia-item__meta { font-size: 0.78rem; opacity: 0.55; margin-top: 2px; }
.noticia-item__dl {
  flex-shrink: 0;
  display: flex;
  color: #434343;
  transition: transform var(--transicion), color var(--transicion);
}
.noticia-item:hover .noticia-item__dl { color: var(--primary); transform: translateY(3px); }

/* ============================================================
   NOTICIA (detalle) — visor del PDF + descarga
   ============================================================ */

.noticia-page { min-height: 100vh; background: #f2f2f2; }

.noticia-header {
  background: var(--white);
  border-bottom: 1px solid var(--stroke-soft);
  padding: 16px 24px;
  display: flex;
  justify-content: center;
}
.noticia-header__logo { width: 150px; height: auto; }

.noticia-main { max-width: 1000px; margin: 0 auto; padding: 24px; }

.noticia-back { margin-top: 0; margin-bottom: 16px; }

.noticia-bar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 16px;
}
.noticia-title { font-size: 1.4rem; font-weight: 700; line-height: 1.25; overflow-wrap: anywhere; }
.noticia-date { font-size: 0.9rem; opacity: 0.6; margin-top: 4px; }
.noticia-download { flex-shrink: 0; }

/* Visor de PDF (PDF.js): páginas apiladas, ajustadas al ancho */
.noticia-visor {
  max-width: 820px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.noticia-visor .pdf-page {
  width: 100%;
  height: auto;
  background: var(--white);
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}
.noticia-visor__msg {
  color: rgba(0, 0, 0, 0.55);
  font-size: 0.9rem;
  padding: 24px 0;
  text-align: center;
}
