/* ==========================================================================
   Centro de Estudios Clínicos SAGA — Plantilla de infografía de estudios
   Dirección "Editorial" · 1080 × 1620 px
   ========================================================================== */

:root {
  /* Identidad SAGA */
  --saga-navy:       #0A2C4E;   /* azul marino */
  --saga-blue:       #12649F;   /* azul institucional */
  --saga-blue-soft:  #8FB4CE;
  --saga-teal:       #0E9BA6;   /* turquesa */
  --saga-teal-dark:  #0E7B85;
  --saga-teal-light: #6FD3DA;
  --saga-teal-soft:  #9BD6DB;
  --saga-white:      #FFFFFF;
  --saga-grey:       #EEF3F7;   /* gris muy claro */
  --saga-line:       #D6E2EC;
  --saga-text:       #334E68;
  --saga-text-soft:  #5C7891;
  --saga-navy-line:  #3D6183;
  --saga-navy-soft:  #CFE0EC;
  --saga-navy-mute:  #B9CEDE;

  /* Medidas */
  --page-w: 1080px;
  --page-h: 1620px;
  --margin-x: 70px;
  --hero-h: 576px;
  --hero-sheet: 104px;   /* alto de la hoja blanca curva */
  --footer-h: 150px;
  --gap: 24px;
  --hairline: 1px solid var(--saga-line);

  /* Tipografía */
  --font: 'Source Sans 3', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --fs-title: 46px;
  --fs-question: 24px;
  --fs-lead: 17px;
  --fs-body: 17px;
  --fs-label: 14px;
  --fs-eyebrow: 13px;
  --fs-treatment: 23px;
  --fs-highlight: 25px;
  --fs-note: 15px;
  --track: .16em;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: #E4E9EE;
  font-family: var(--font);
  color: var(--saga-navy);
  display: flex;
  justify-content: center;
}

a { color: var(--saga-blue); text-decoration: none; }
a:hover { color: var(--saga-teal); }

.page {
  width: var(--page-w);
  height: var(--page-h);
  flex: none;
  background: var(--saga-white);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  box-shadow: 0 20px 60px rgba(10, 44, 78, .18);
}

/* --- 1. Cabecera visual --------------------------------------------------- */

.hero { position: relative; height: var(--hero-h); flex: none; overflow: hidden; background: var(--saga-navy); }
.hero > img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 72% 28%; display: block;
}
.hero__scrim {
  position: absolute; inset: 0;
  background: linear-gradient(100deg,
    var(--saga-navy) 0%, var(--saga-navy) 42%,
    rgba(10, 44, 78, .86) 56%, rgba(10, 44, 78, .15) 82%, rgba(10, 44, 78, 0) 100%);
}
.hero__copy {
  position: absolute; left: var(--margin-x); top: 48px; right: 400px; bottom: 136px;
  display: flex; flex-direction: column; gap: 16px; color: var(--saga-white);
}
.hero__logo { width: 176px; height: auto; display: block; filter: brightness(0) invert(1); }

/* --- 2. Etiqueta --------------------------------------------------------- */
.badge-row { display: flex; }
.badge {
  display: inline-flex; align-items: center; gap: 11px;
  border: 1.5px solid var(--saga-teal-light); color: var(--saga-teal-light);
  font-size: 16px; font-weight: 700; letter-spacing: .14em; white-space: nowrap;
  padding: 9px 20px; border-radius: 100px;
}
.badge__dot { width: 8px; height: 8px; border-radius: 50%; background: var(--saga-teal); }

/* --- 3-5. Título, pregunta, resumen -------------------------------------- */
#study-title {
  margin: 0; font-size: var(--fs-title); line-height: 1.05; font-weight: 700;
  letter-spacing: -.01em; text-wrap: pretty;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
#study-question {
  margin: 0; padding-left: 18px; border-left: 3px solid var(--saga-teal);
  font-size: var(--fs-question); line-height: 1.3; font-weight: 600;
  color: var(--saga-navy-soft); text-wrap: pretty;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
#study-summary {
  margin: auto 0 0; font-size: var(--fs-lead); line-height: 1.5;
  color: var(--saga-navy-mute); max-width: 470px; text-wrap: pretty;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}

/* --- 6. Código del protocolo -------------------------------------------- */
.hero__sheet {
  position: absolute; left: 0; right: 0; bottom: 0; height: var(--hero-sheet);
  background: var(--saga-white);
  border-top-right-radius: 200px var(--hero-sheet);
}
.protocol {
  position: absolute; left: var(--margin-x); bottom: 26px;
  display: flex; align-items: baseline; gap: 18px;
}
.protocol__label {
  font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: .18em; color: var(--saga-text-soft);
}
#protocol-code { font-size: 31px; font-weight: 700; color: var(--saga-navy); line-height: 1; }

/* --- Cuerpo -------------------------------------------------------------- */
.body {
  flex: 1; min-height: 0;
  padding: 32px var(--margin-x) 28px;
  display: flex; flex-direction: column; gap: var(--gap);
}
.body > section { flex: none; }

/* --- 7-9. Filas de datos del estudio ------------------------------------- */
.rows { display: flex; flex-direction: column; }
.row {
  display: flex; gap: 26px; padding: 20px 0; border-top: var(--hairline);
}
.rows .row:last-child { border-bottom: var(--hairline); }
.row__num { flex: none; width: 34px; font-size: 26px; font-weight: 700; color: var(--saga-teal); line-height: 1; }
.row__label {
  flex: none; width: 196px; font-size: var(--fs-label); font-weight: 700;
  letter-spacing: .14em; color: var(--saga-navy); padding-top: 5px;
}
.row__value { flex: 1; display: flex; flex-direction: column; gap: 5px; }
.row__value, .row__value span { font-size: var(--fs-body); line-height: 1.45; color: var(--saga-text); text-wrap: pretty; }
.row__value strong { font-size: 19px; font-weight: 700; color: var(--saga-navy); }

/* --- 10. Tratamientos del estudio --------------------------------------- */
.treatments { display: flex; flex-direction: column; gap: 16px; }
.treatments h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: var(--track); color: var(--saga-navy); }
.treatments__grid { display: grid; grid-template-columns: 1fr 1fr; border: var(--hairline); }
.treatment { display: flex; flex-direction: column; gap: 12px; padding: 24px 30px; min-height: 132px; }
.treatment:first-child { border-right: var(--hairline); }
.treatment__label {
  display: flex; align-items: center; gap: 12px;
  font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: var(--track); color: var(--saga-blue);
}
.treatment--comparator .treatment__label { color: var(--saga-teal-dark); }
.treatment strong { font-size: var(--fs-treatment); line-height: 1.3; font-weight: 600; text-wrap: pretty; }

/* Motivo de puntos (lenguaje gráfico del logo) */
.dots { flex: none; position: relative; width: 30px; height: 30px; }
.dots i { position: absolute; border-radius: 50%; display: block; background: var(--saga-blue); }
.dots i:nth-child(1) { left: 0;    top: 4px;  width: 11px; height: 11px; }
.dots i:nth-child(2) { left: 11px; top: 15px; width: 8px;  height: 8px;  background: var(--saga-blue-soft); }
.dots i:nth-child(3) { left: 21px; top: 2px;  width: 6px;  height: 6px;  background: var(--saga-blue-soft); }
.dots i:nth-child(4) { left: 20px; top: 19px; width: 9px;  height: 9px; }
.treatment--comparator .dots i { background: var(--saga-teal); }
.treatment--comparator .dots i:nth-child(2),
.treatment--comparator .dots i:nth-child(3) { background: var(--saga-teal-soft); }

/* --- 11-12. Criterios e información destacada --------------------------- */
.lower { display: grid; grid-template-columns: 1fr 1fr; gap: 34px; align-items: start; }
.criteria { display: flex; flex-direction: column; gap: 16px; }
.criteria h2 { margin: 0; font-size: 19px; font-weight: 700; letter-spacing: .08em; color: var(--saga-navy); }
.criteria ol { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.criteria li {
  display: grid; grid-template-columns: 26px 1fr; gap: 14px; align-items: start;
  font-size: var(--fs-body); line-height: 1.45; color: var(--saga-text);
}
.crit-num {
  font-size: var(--fs-eyebrow); font-weight: 700; color: var(--saga-teal);
  letter-spacing: .08em; padding-top: 4px;
}
.criteria__note { margin: 6px 0 0; font-size: var(--fs-note); line-height: 1.4; color: var(--saga-text-soft); }

.highlight {
  display: flex; flex-direction: column; gap: 14px;
  padding: 28px 32px; background: var(--saga-grey); border-top: 4px solid var(--saga-teal);
}
.highlight span {
  font-size: var(--fs-eyebrow); font-weight: 700; letter-spacing: var(--track); color: var(--saga-teal-dark);
}
#study-highlight { font-size: var(--fs-highlight); line-height: 1.32; font-weight: 600; color: var(--saga-navy); text-wrap: pretty; }

/* --- 13. Disclaimer final ----------------------------------------------- */
.disclaimer {
  margin: auto 0 0; font-size: 14px; line-height: 1.5; color: var(--saga-text-soft);
  padding-top: 18px; border-top: var(--hairline);
}

/* --- 14. Footer --------------------------------------------------------- */
.footer {
  flex: none; height: var(--footer-h); background: var(--saga-navy); color: var(--saga-white);
  display: grid; grid-template-columns: 1fr auto auto; align-items: center;
  gap: 44px; padding: 0 var(--margin-x);
}
.footer__cta { display: flex; flex-direction: column; gap: 8px; }
.footer__cta strong { font-size: 17px; font-weight: 700; line-height: 1.25; }
.footer__cta span { font-size: 14px; font-weight: 600; letter-spacing: .12em; color: var(--saga-teal-light); }
.footer__contact {
  display: flex; flex-direction: column; gap: 6px;
  padding-left: 44px; border-left: 1px solid var(--saga-navy-line);
}
.footer__contact .whatsapp-hint { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--saga-teal-light); }
.footer__contact .phone { font-size: 21px; font-weight: 700; color: inherit; }
.footer__contact .phone:hover { color: var(--saga-teal-light); }
.footer__contact .mail { font-size: 21px; color: var(--saga-navy-soft); }
.footer__logo { width: 210px; height: auto; display: block; filter: brightness(0) invert(1); }
/* Control web externo a la pieza; no aparece en el JPEG generado. */
.download-jpg {
  position: fixed;
  right: 18px;
  top: 18px;
  z-index: 100;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #078f9b;
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  color: #073b72;
  font: 700 13px/1 "Source Sans 3", Arial, sans-serif;
  letter-spacing: .01em;
  box-shadow: 0 4px 14px rgba(7, 59, 114, .16);
  cursor: pointer;
}

.download-jpg span { color: #078f9b; font-size: 18px; line-height: 0; }
.download-jpg:hover { background: #eaf8fa; }
.download-jpg:disabled { cursor: wait; opacity: .72; }

@media print {
  .download-jpg { display: none !important; }
}
