/* ============================================================
   PRESIDENT'S INSIGHTS — president.css (v4 — flat structure, todo en la raíz)
   IASH — Inter-American Society of Hypertension

   v2 rebuilds the visual language to match the reference
   screenshot the client provided: white background, institutional
   blue, rounded soft-shadow cards, a sticky "In this article" TOC,
   dropdown filters, and a few functional motion effects (reading
   progress, scrollspy, counted stat, hover lift/zoom).

   Everything stays namespaced under .pi- so it cannot collide with
   classes already used by the legacy site's header/footer CSS.
   ============================================================ */

/* Reset the browser's default body margin — without this, every
   full-bleed element (institutional header, page banner, footer)
   sits a few pixels in from the edge instead of running edge to
   edge. Safe to keep even once this stylesheet lives alongside the
   real site CSS: it only zeroes margin/padding on the page root. */
html,
body {
  margin: 0;
  padding: 0;
}

.pi-scope {
  --pi-navy: #0f2d52;
  /* headings, ink-on-white emphasis */
  --pi-blue: #1d63b4;
  /* primary brand blue — title, links, buttons */
  --pi-blue-dark: #144a8a;
  --pi-blue-light: #eaf2fc;
  /* tag / pill backgrounds */
  --pi-blue-line: #d7e6fa;
  --pi-ink: #16212b;
  --pi-muted: #64748b;
  --pi-muted-light: #94a3b3;
  --pi-line: #e6e9ee;
  --pi-paper: #ffffff;
  --pi-paper-alt: #f6f8fb;
  --pi-shadow: 0 10px 30px -12px rgba(15, 45, 82, 0.18);
  --pi-shadow-hover: 0 18px 40px -14px rgba(15, 45, 82, 0.26);
  --pi-cta-blue: #4fa8de;
  /* "Read More" button — per client reference */
  --pi-cta-blue-dark: #3a8fc4;

  --pi-font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --pi-font-display: "Manrope", var(--pi-font-sans);

  --pi-radius: 14px;
  --pi-radius-sm: 8px;
  --pi-maxw: 1180px;

  font-family: var(--pi-font-sans);
  color: var(--pi-ink);
  background: var(--pi-paper);
  -webkit-font-smoothing: antialiased;
}

.pi-scope * {
  box-sizing: border-box;
}

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

.pi-scope a {
  color: inherit;
  text-decoration: none;
}

.pi-scope button {
  font-family: inherit;
  cursor: pointer;
}

.pi-container {
  max-width: var(--pi-maxw);
  margin: 0 auto;
  padding: 0 24px;
}

@media (prefers-reduced-motion: reduce) {
  .pi-scope * {
    animation: none !important;
    transition: none !important;
  }
}

/* ------------------------------------------------------------
   READING PROGRESS BAR (article page only)
   ------------------------------------------------------------ */

.pi-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  width: 0%;
  background: linear-gradient(90deg, var(--pi-blue), #4f9bff);
  z-index: 60;
  transition: width 0.08s linear;
}

/* ------------------------------------------------------------
   PAGE BANNER — replaces the old white section-head. Same idea
   as the site's interior-page banners (e.g. New Investigators):
   full-width colored band with a big title, plus a breadcrumb
   bar underneath. Ours uses the navy institutional blue with a
   continuously looping ECG line instead of a stock photo, so the
   section keeps its own identity while matching the site pattern.
   ------------------------------------------------------------ */

.pi-page-banner {
  position: relative;
  overflow: hidden;
  text-align: center;
  color: #fff;
  min-height: clamp(200px, 26vw, 280px);
}

.pi-page-banner__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* la imagen ahora cubre el alto mínimo, no lo define */
}

.pi-banner__pulse {
  position: absolute;
  z-index: 1;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pi-pulse-dot {
  fill: rgba(234, 246, 255, 0.72);
  filter: drop-shadow(0 0 3px rgba(160, 210, 255, 0.8)) drop-shadow(0 0 8px rgba(120, 190, 255, 0.6)) drop-shadow(0 0 14px rgba(90, 170, 255, 0.4));
}

.pi-page-banner__inner {
  position: absolute;
  z-index: 2;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: normal;
  padding: 0 24px;
}

.pi-page-banner h1 {
  font-family: var(--pi-font-display);
  font-weight: 800;
  font-size: clamp(30px, 4.4vw, 46px);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
}

.pi-page-banner p.pi-tagline {
  color: #c3d3e0;
  font-size: 16px;
  margin: 0;
}

.pi-page-banner__stat {
  margin-top: 16px;
  font-size: 13px;
  color: #9db2c4;
}

.pi-page-banner__stat strong {
  color: #fff;
  font-weight: 700;
}

.pi-breadcrumb-bar {
  background: var(--pi-paper-alt);
  border-bottom: 1px solid var(--pi-line);
  padding: 13px 0;
  font-size: 13.5px;
  color: var(--pi-muted);
}

.pi-breadcrumb-bar .pi-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.pi-breadcrumb-bar a {
  color: var(--pi-blue);
  font-weight: 600;
}

.pi-breadcrumb-bar a:hover {
  text-decoration: underline;
}

.pi-breadcrumb-bar span.pi-sep {
  margin: 0 6px;
  color: var(--pi-muted-light);
}

.pi-breadcrumb-bar .pi-current {
  color: var(--pi-ink);
  font-weight: 600;
}

.pi-breadcrumb-bar__stat {
  font-size: 13px;
  color: #282829;
}

.pi-breadcrumb-bar__stat strong {
  color: var(--pi-blue);
  font-weight: 700;
}

/* ------------------------------------------------------------
   READ MORE — CTA button used on the feature block and on every
   card, styled after the client's reference button.
   ------------------------------------------------------------ */

.pi-scope a.pi-btn-cta {
  display: inline-block;
  background: var(--pi-cta-blue);
  color: #ffffff;
  font-family: var(--pi-font-sans);
  font-weight: 700;
  font-size: 14px;
  padding: 11px 26px;
  border-radius: 6px;
  transition: background 0.15s ease, transform 0.15s ease;
}

.pi-scope a.pi-btn-cta:hover {
  background: var(--pi-cta-blue-dark);
  color: #ffffff;
  transform: translateY(-1px);
}

.pi-btn-cta--sm {
  padding: 8px 18px;
  font-size: 12.5px;
}



/* ------------------------------------------------------------
   FEATURE / ARTICLE-TOP BLOCK — text + image-with-overlay
   ------------------------------------------------------------ */

.pi-feature {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 40px;
  align-items: center;
  padding: 32px 0 40px;
}

/* En la nota individual, cada columna fluye de manera independiente.
   Así el cuerpo empieza justo debajo del título aunque la imagen sea alta. */
.pi-feature--article {
  align-items: start;
}

.pi-article-right {
  align-self: stretch;
}

.pi-eyebrow {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--pi-blue);
  background: var(--pi-blue-light);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.pi-feature h1,
.pi-feature h2.pi-title {
  font-family: var(--pi-font-display);
  font-weight: 800;
  font-size: clamp(26px, 3.6vw, 38px);
  line-height: 1.16;
  color: var(--pi-navy);
  margin: 0 0 14px;
  letter-spacing: -0.01em;
}

.pi-dek {
  font-size: 16px;
  color: var(--pi-muted);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 55ch;
  text-align: left;
}

/* Solo el destacado del home: máximo 5 líneas con "…".
   La página individual del Insight usa .pi-dek sin este modificador,
   así que ahí el dek se sigue viendo completo. */
.pi-dek--clamp {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 5;
  line-clamp: 5;
  overflow: hidden;
}

.pi-byline {
  display: flex;
  align-items: center;
  gap: 12px;
}

.pi-byline img {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(15, 45, 82, 0.15);
}

.pi-byline__name {
  font-size: 15.5px;
  font-weight: 700;
  color: var(--pi-ink);
}

.pi-byline__role {
  font-size: 13px;
  color: var(--pi-muted-light);
}

.pi-feature .pi-btn-cta {
  margin-top: 22px;
}

.pi-feature__media {
  position: relative;
  border-radius: var(--pi-radius);
  overflow: hidden;
  box-shadow: 0 22px 46px -16px rgba(15, 45, 82, 0.4);
  aspect-ratio: 4 / 3;
}

.pi-feature__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.01);
  transition: transform 6s ease;
}

.pi-feature__media:hover img {
  transform: scale(1.08);
}

.pi-feature__caption {
  position: absolute;
  left: 18px;
  bottom: 18px;
  right: 18px;
  color: #fff;
  font-family: var(--pi-font-display);
  font-weight: 700;
  font-size: 17px;
  line-height: 1.3;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.35);
}

.pi-feature__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 45, 82, 0) 45%, rgba(15, 45, 82, 0.65) 100%);
}

/* ------------------------------------------------------------
   VARIANTE VERTICAL DE LA IMAGEN DESTACADA — solo en la nota
   individual (president-insight.php), para infografías altas.
   El home sigue usando .pi-feature__media tal cual (recorte 4:3).
   ------------------------------------------------------------ */

.pi-lightbox-trigger {
  cursor: zoom-in;
}

.pi-gallery-thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.pi-gallery-thumb {
  padding: 0;
  border: 1px solid var(--pi-line);
  border-radius: 8px;
  overflow: hidden;
  width: 76px;
  height: 76px;
  background: none;
}

.pi-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.pi-zoom-hint {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(15, 45, 82, 0.78);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ------------------------------------------------------------
   LIGHTBOX — pantalla completa al hacer click en la imagen
   destacada de una nota individual.
   ------------------------------------------------------------ */

.pi-lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(10, 18, 28, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.pi-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.pi-lightbox img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
  cursor: zoom-out;
}

/* ------------------------------------------------------------
   ARTICLE BODY + sticky "In this article" TOC
   ------------------------------------------------------------ */

.pi-body {
  font-size: 16.5px;
  line-height: 1.75;
  color: var(--pi-ink);
  max-width: 640px;
  text-align: justify;
}

.pi-body h2 {
  font-family: var(--pi-font-display);
  font-size: 22px;
  color: var(--pi-navy);
  margin: 38px 0 14px;
  scroll-margin-top: 24px;
}

.pi-body p {
  margin: 0 0 20px;
}

.pi-pullquote {
  font-family: var(--pi-font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--pi-navy);
  background: var(--pi-blue-light);
  border-radius: var(--pi-radius-sm);
  padding: 22px 26px;
  margin: 32px 0;
}

.pi-toc {
  align-self: start;
  position: sticky;
  top: 24px;
  background: var(--pi-paper-alt);
  border-radius: var(--pi-radius);
  padding: 22px 22px 20px;
}

.pi-toc--feature {
  margin-top: 30px;
}

.pi-toc h4 {
  font-size: 12.5px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--pi-muted-light);
  margin: 0 0 14px;
}

.pi-toc ol {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: pi-toc;
}

.pi-toc li {
  counter-increment: pi-toc;
  margin-bottom: 4px;
}

.pi-toc a {
  display: flex;
  gap: 10px;
  font-size: 14px;
  color: var(--pi-muted);
  padding: 7px 8px;
  border-radius: var(--pi-radius-sm);
  transition: background 0.15s ease, color 0.15s ease;
}

.pi-toc a::before {
  content: counter(pi-toc);
  font-weight: 700;
  color: var(--pi-muted-light);
  min-width: 16px;
}

.pi-toc a:hover {
  background: #fff;
  color: var(--pi-blue);
}

.pi-toc a.is-active {
  background: var(--pi-blue-light);
  color: var(--pi-blue-dark);
  font-weight: 600;
}

.pi-toc a.is-active::before {
  color: var(--pi-blue);
}

.pi-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 47px 0 35px 0;
  max-width: 640px;
}

.pi-tag {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--pi-blue-dark);
  background: var(--pi-blue-light);
  padding: 7px 14px;
  border-radius: 999px;
  transition: background 0.15s ease, color 0.15s ease;
}

.pi-tag:hover {
  background: var(--pi-blue);
  color: #fff;
}

.pi-references {
  list-style: none;
  counter-reset: pi-ref;
  margin: 30px 0 0;
  padding: 20px 0 0;
  border-top: 1px solid var(--pi-line);
  max-width: 640px;
  font-size: 13.5px;
  color: var(--pi-muted);
}

.pi-references li {
  counter-increment: pi-ref;
  position: relative;
  padding-left: 26px;
  margin-bottom: 9px;
  line-height: 1.5;
}

.pi-references li::before {
  content: "[" counter(pi-ref) "]";
  position: absolute;
  left: 0;
  color: var(--pi-blue);
  font-weight: 600;
}

/* ------------------------------------------------------------
   RELATED INSIGHTS
   ------------------------------------------------------------ */

.pi-section-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 0 0 22px;
}

.pi-section-title-row h3 {
  font-family: var(--pi-font-display);
  font-size: 21px;
  color: var(--pi-navy);
  margin: 0;
}

.pi-view-all {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--pi-blue);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: gap 0.15s ease;
}

.pi-view-all:hover {
  gap: 10px;
}

.pi-related {
  padding: 8px 0 54px;
}

.pi-related__grid,
.pi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ------------------------------------------------------------
   CARDS (library grid + related)
   ------------------------------------------------------------ */

.pi-card {
  background: var(--pi-paper);
  border-radius: var(--pi-radius);
  box-shadow: var(--pi-shadow);
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  /* columna flex: todas las cards de una fila miden lo mismo y el
     botón "Read More" queda siempre pegado abajo */
  display: flex;
  flex-direction: column;
}

.pi-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--pi-shadow-hover);
}

.pi-card__media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
}

.pi-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.pi-card:hover .pi-card__media img {
  transform: scale(1.08);
}

.pi-card__body {
  padding: 16px 18px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.pi-card__body .pi-btn-cta {
  margin-top: auto;
  align-self: flex-start;
}

.pi-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--pi-muted-light);
  margin-bottom: 8px;
}

.pi-card__meta .pi-cat-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--pi-blue);
  flex-shrink: 0;
}

.pi-card[data-cat="cv-risk"] .pi-cat-dot {
  background: #d17a3f;
}

.pi-card[data-cat="clinical-practice"] .pi-cat-dot {
  background: #3fa66a;
}

.pi-card h4 {
  font-family: var(--pi-font-display);
  font-size: 16px;
  line-height: 1.35;
  color: var(--pi-navy);
  margin: 0 0 8px;
  font-weight: 700;
  /* título: máximo 3 líneas, después "…" */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

.pi-card h4 a {
  color: inherit;
}

.pi-card h4 a:hover {
  color: var(--pi-blue);
}

.pi-card__excerpt {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--pi-muted);
  margin: 0 0 16px;
  /* síntesis: máximo 3 líneas, después "…" — mantiene la card como
     un rectángulo parejo sin importar cuánto texto traiga la nota */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}

/* ------------------------------------------------------------
   LIBRARY — filters + grid
   ------------------------------------------------------------ */

.pi-library {
  background: var(--pi-paper-alt);
  padding: 54px 0 66px;
}

.pi-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.pi-select {
  position: relative;
}

.pi-select select {
  appearance: none;
  font-family: var(--pi-font-sans);
  font-size: 13.5px;
  font-weight: 500;
  color: var(--pi-ink);
  background: #fff;
  border: 1px solid var(--pi-line);
  border-radius: 999px;
  padding: 9px 34px 9px 16px;
  cursor: pointer;
  transition: border-color 0.15s ease;
}

.pi-select select:hover,
.pi-select select:focus {
  border-color: var(--pi-blue);
  outline: none;
}

.pi-select::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.6px solid var(--pi-muted);
  border-bottom: 1.6px solid var(--pi-muted);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}

.pi-toolbar .pi-search {
  position: relative;
  margin-left: auto;
  min-width: 220px;
}

.pi-toolbar .pi-search svg {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  stroke: var(--pi-muted-light);
  fill: none;
  stroke-width: 2;
}

.pi-toolbar .pi-search input {
  width: 100%;
  font-family: var(--pi-font-sans);
  font-size: 13.5px;
  padding: 9px 14px 9px 34px;
  border: 1px solid var(--pi-line);
  border-radius: 999px;
  background: #fff;
}

.pi-toolbar .pi-search input:focus {
  outline: none;
  border-color: var(--pi-blue);
}

.pi-empty {
  display: none;
  text-align: center;
  padding: 50px 0;
  color: var(--pi-muted);
  font-size: 15px;
}

.pi-empty.is-visible {
  display: block;
}

/* ------------------------------------------------------------
   PLACEHOLDER SHELL NOTE (mockup only)
   ------------------------------------------------------------ */

.pi-shell-note {
  background: #fff4ea;
  border-bottom: 1px dashed #d8a56b;
  color: #7a4f1c;
  font-family: var(--pi-font-sans);
  font-size: 12.5px;
  text-align: center;
  padding: 7px 12px;
}

/* ------------------------------------------------------------
   RESPONSIVE
   ------------------------------------------------------------ */

@media (max-width: 980px) {
  .pi-feature {
    grid-template-columns: 1fr;
  }

  /* En móvil: título → imagen → texto → índice. */
  .pi-feature--article {
    display: flex;
    flex-direction: column;
  }

  .pi-feature--article .pi-article-left,
  .pi-feature--article .pi-article-right {
    display: contents;
  }

  .pi-feature--article .pi-article-heading {
    order: 1;
  }

  .pi-feature--article .pi-article-media {
    order: 2;
    width: 100%;
  }

  .pi-feature--article .pi-body {
    order: 3;
    max-width: none;
    width: 100%;
  }

  .pi-feature--article .pi-toc {
    order: 4;
    width: 100%;
  }

  .pi-toc {
    position: static;
    margin-top: 30px;
  }

  .pi-grid,
  .pi-related__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 640px) {

  .pi-grid,
  .pi-related__grid {
    grid-template-columns: 1fr;
  }

  .pi-toolbar {
    flex-direction: column;
    align-items: stretch;
  }

  .pi-toolbar .pi-search {
    margin-left: 0;
  }

  .pi-feature__media {
    aspect-ratio: 3 / 2;
  }
}