/* ==========================================================================
   IPESFA – Home institucional (home.css)
   Mobile-first · System fonts · Accesible
   v3.0 – Hero with bg image, fixed header overlay, JS-measured --header-h
   ========================================================================== */

/* ---------- Tokens ---------- */
:root {
  --accent: #5FA9B3;
  --accent-hover: #4d8e95;
  --accent-soft: #e8f6f8;
  --dark: #3F4656;
  --text: var(--dark);
  --muted: #6b7280;
  --light: #f4f5f7;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --border: #e2e5e9;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-card: 0 1px 3px rgba(0,0,0,.06), 0 4px 12px rgba(0,0,0,.04);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --focus-ring: 0 0 0 3px rgba(95,169,179,.45);
}

/* ---------- Shared ---------- */
#ipesfa-home {
  font-family: var(--font-sans);
  color: var(--text);
  line-height: 1.6;
}

#ipesfa-home *:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
  border-radius: var(--radius-sm);
}

.ipesfa-wrap {
  width: 100%;
  max-width: 1140px;
  margin: 0 auto;
  padding-left: 20px;
  padding-right: 20px;
}

.ipesfa-section__title {
  font-size: clamp(22px, 2vw + 14px, 32px);
  font-weight: 700;
  color: var(--dark);
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}

/* ==============================
   HERO – Background image with dark overlay
   padding-top uses --header-h (set by JS from actual header
   offsetHeight) so hero content never hides behind the fixed bar.
   ============================== */
.ipesfa-hero {
  position: relative;
  overflow: hidden;
  background-color: var(--dark);
  background-image: linear-gradient(170deg, var(--dark) 0%, #2d3440 100%);
  color: #fff;
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: calc(var(--header-h, 72px) + 40px) 0 48px;
  text-align: left;
}

/* When a background image is set via inline style */
.ipesfa-hero--has-bg {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* Semi-transparent overlay for legibility over any photo */
.ipesfa-hero--has-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(0, 0, 0, 0.52) 0%,
    rgba(0, 0, 0, 0.35) 45%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Content above the overlay */
.ipesfa-hero .ipesfa-wrap {
  position: relative;
  z-index: 1;
}

/* Small label badge above the title (like "MISSÃO" in the reference) */
.ipesfa-hero__label {
  display: inline-block;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 6px 16px;
  margin-bottom: 20px;
  border-radius: 2px;
  backdrop-filter: blur(4px);
}

.ipesfa-hero__title {
  font-family: var(--font-sans);
  font-size: clamp(2.8rem, 6vw + 1rem, 5.5rem);
  font-weight: 700;
  line-height: 1.05;
  margin: 0 0 28px;
  color: #fff;
  letter-spacing: -0.03em;
  max-width: 800px;
}

.ipesfa-hero__desc {
  font-size: clamp(16px, 0.5vw + 14px, 19px);
  color: rgba(255,255,255,.7);
  max-width: 520px;
  margin: 0 0 40px;
  line-height: 1.6;
  font-weight: 400;
}

.ipesfa-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 16px;
  letter-spacing: 0.01em;
  padding: 16px 36px;
  border-radius: 100px;
  text-decoration: none;
  border: none;
  transition: background .2s ease, transform .15s ease;
}
.ipesfa-btn:hover {
  background: var(--accent-hover);
  color: #fff;
  transform: translateY(-1px);
}
.ipesfa-btn svg {
  flex-shrink: 0;
}

/* ==============================
   ACCESOS RÁPIDOS — Barra full-bleed de color
   ============================== */
.ipesfa-accesos {
  padding: 0;
  border: none;
}

.ipesfa-accesos .ipesfa-section__title {
  display: none;
}

/* Romper el contenedor .ipesfa-wrap para ir full bleed */
.ipesfa-accesos .ipesfa-wrap {
  max-width: none;
  padding: 0;
  width: 100%;
}

.ipesfa-accesos__grid {
  display: flex;
  align-items: stretch;
  width: 100%;
}

.ipesfa-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 64px 16px;
  text-decoration: none;
  color: #fff;
  border: none;
  transition: filter .2s ease;
}
.ipesfa-card:hover {
  color: #fff;
  filter: brightness(0.88);
}

/* Paleta institucional — familia teal oscureciendo de izq a der */
.ipesfa-card:nth-child(1) { background: #6BBECB; }
.ipesfa-card:nth-child(2) { background: #5FA9B3; }
.ipesfa-card:nth-child(3) { background: #4A8F98; }
.ipesfa-card:nth-child(4) { background: #3A7580; }
.ipesfa-card:nth-child(5) { background: #2D5C65; }
.ipesfa-card:nth-child(6) { background: #3F4656; }

.ipesfa-card__icon {
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
  flex-shrink: 0;
}

.ipesfa-card__label {
  font-weight: 700;
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #fff;
  text-align: center;
  line-height: 1.4;
  padding-bottom: 12px;
  position: relative;
}
.ipesfa-card__label::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 64px;
  height: 2px;
  background: rgba(255, 255, 255, 0.75);
  border-radius: 2px;
}

/* Mobile: 2 columnas, 3 filas */
@media (max-width: 599px) {
  .ipesfa-accesos__grid {
    flex-wrap: wrap;
  }
  .ipesfa-card {
    flex: 0 0 50%;
    box-sizing: border-box;
    justify-content: flex-start;
    padding: 22px 20px;
  }
}

/* Tablet: 3 columnas */
@media (min-width: 600px) and (max-width: 959px) {
  .ipesfa-accesos__grid {
    flex-wrap: wrap;
  }
  .ipesfa-card {
    flex: 0 0 33.333%;
    box-sizing: border-box;
  }
}

/* ==============================
   NOVEDADES — Editorial universitario
   ============================== */
.ipesfa-novedades {
  background: #cfe3e6;
  padding: 64px 0;
}

/* Header: título izq + línea accent + link der */
.ipesfa-novedades__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 40px;
}

.ipesfa-novedades__header .ipesfa-section__title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 0;
  font-size: clamp(22px, 2vw + 14px, 34px);
  letter-spacing: -0.02em;
  font-weight: 800;
}
.ipesfa-novedades__header .ipesfa-section__title::before {
  content: '';
  display: inline-block;
  width: 5px;
  height: 1em;
  background: var(--accent);
  border-radius: 3px;
  flex-shrink: 0;
}

.ipesfa-novedades__ver-todas {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--dark);
  text-decoration: none;
  border: 2px solid var(--dark);
  padding: 8px 16px;
  border-radius: 2px;
  white-space: nowrap;
  transition: background .2s ease, color .2s ease;
}
.ipesfa-novedades__ver-todas:hover {
  background: var(--dark);
  color: #fff;
}
.ipesfa-novedades__ver-todas svg {
  transition: transform .2s ease;
}
.ipesfa-novedades__ver-todas:hover svg {
  transform: translateX(3px);
}

/* Paginación */
.ipesfa-novedades__paginacion {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  margin-top: 32px;
}
.ipesfa-novedades__paginacion .page-numbers {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  text-decoration: none;
  border-radius: 6px;
  transition: background .15s ease, color .15s ease;
}
.ipesfa-novedades__paginacion .page-numbers:hover {
  background: #e8f6f8;
  color: #3F4656;
}
.ipesfa-novedades__paginacion .page-numbers.current {
  background: #5FA9B3;
  color: #fff;
  font-weight: 600;
}
.ipesfa-novedades__paginacion .page-numbers.dots {
  background: transparent;
  color: #9ca3af;
}

/* Grilla */
.ipesfa-novedades__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

/* Card */
.ipesfa-post-card {
  background: var(--surface);
  border: 1px solid #d4e6e8;
  border-radius: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s ease;
}
.ipesfa-post-card:hover {
  box-shadow: 0 4px 14px rgba(95,169,179,.15);
}

/* Imagen */
.ipesfa-post-card__thumb {
  display: block;
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--light);
  flex-shrink: 0;
}
.ipesfa-post-card__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .5s ease;
}
.ipesfa-post-card:hover .ipesfa-post-card__thumb img {
  transform: scale(1.04);
}

/* Placeholder sin imagen */
.ipesfa-post-card__no-thumb {
  display: block;
  aspect-ratio: 16/9;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.ipesfa-post-card__no-thumb::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 30% 40%, rgba(255,255,255,0.18) 0%, transparent 65%);
}
.ipesfa-post-card__no-thumb::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: repeating-linear-gradient(-45deg, rgba(255,255,255,0.05) 0px, rgba(255,255,255,0.05) 1px, transparent 1px, transparent 10px);
}

/* Marca de agua institucional */
.ipesfa-post-card__no-thumb-label {
  position: absolute;
  bottom: 14px;
  left: 18px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.45);
  z-index: 1;
}

/* Colores alternados */
.ipesfa-novedades__grid .ipesfa-post-card:nth-child(6n+1) .ipesfa-post-card__no-thumb { background: #5FA9B3; }
.ipesfa-novedades__grid .ipesfa-post-card:nth-child(6n+2) .ipesfa-post-card__no-thumb { background: #4A8F98; }
.ipesfa-novedades__grid .ipesfa-post-card:nth-child(6n+3) .ipesfa-post-card__no-thumb { background: #3F4656; }
.ipesfa-novedades__grid .ipesfa-post-card:nth-child(6n+4) .ipesfa-post-card__no-thumb { background: #3A7580; }
.ipesfa-novedades__grid .ipesfa-post-card:nth-child(6n+5) .ipesfa-post-card__no-thumb { background: #6BBECB; }
.ipesfa-novedades__grid .ipesfa-post-card:nth-child(6n+6) .ipesfa-post-card__no-thumb { background: #2D5C65; }

/* Cuerpo */
.ipesfa-post-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 10px;
  padding: 20px;
}

/* Meta: categoría + fecha */
.ipesfa-post-card__meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ipesfa-post-card__cat {
  font-weight: 700;
  color: var(--accent);
}

.ipesfa-post-card__meta time::before {
  content: '—';
  margin-right: 8px;
  opacity: .4;
}

/* Título */
.ipesfa-post-card__title {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.35;
  margin: 0;
  letter-spacing: -0.01em;
}
.ipesfa-post-card__title a {
  color: var(--dark);
  text-decoration: none;
  transition: color .2s ease;
}
.ipesfa-post-card:hover .ipesfa-post-card__title a {
  color: var(--accent);
}

/* Extracto */
.ipesfa-post-card__excerpt {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ipesfa-empty {
  text-align: center;
  color: var(--muted);
  padding: 48px 0;
  font-size: 15px;
}

/* ==============================
   PROFESORADOS
   ============================== */
.ipesfa-profesorados {
  background-color: #3F4656;
  background-image:
    linear-gradient(135deg, #3F4656 0%, #2D5C65 100%),
    repeating-linear-gradient(
      -55deg,
      rgba(255,255,255,0.02) 0px,
      rgba(255,255,255,0.02) 1px,
      transparent 1px,
      transparent 18px
    );
  background-blend-mode: normal;
  padding: 64px 20px;
  display: flex;
  flex-direction: column;
  gap: 48px;
  box-sizing: border-box;
  width: 100%;
}

.ipesfa-profesorados__left {
  max-width: 320px;
}

.ipesfa-profesorados__title {
  font-size: clamp(1.4rem, 2.5vw, 2.2rem);
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
  color: #fff;
  margin: 0 0 20px;
  text-transform: uppercase;
  white-space: nowrap;
}

.ipesfa-profesorados__desc {
  font-size: 15px;
  color: rgba(255,255,255,0.6);
  line-height: 1.65;
  margin: 0;
}

/* Grid de cards */
.ipesfa-profesorados__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

.ipesfa-prof-card {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 16px;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  transition: background .2s ease, border-color .2s ease;
  min-height: 90px;
  box-sizing: border-box;
}
.ipesfa-prof-card:hover {
  background: rgba(95,169,179,0.2);
  border-color: var(--accent);
  color: #fff;
}

.ipesfa-prof-card__nombre {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: center;
  line-height: 1.4;
}

/* Tablet */
@media (min-width: 600px) {
  .ipesfa-profesorados {
    padding: 72px 32px;
  }
  .ipesfa-profesorados__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Desktop */
@media (min-width: 960px) {
  .ipesfa-profesorados {
    flex-direction: row;
    align-items: center;
    padding: 80px 48px;
    gap: 64px;
  }
  .ipesfa-profesorados__left {
    flex-shrink: 0;
    width: 260px;
  }
  .ipesfa-profesorados__grid {
    flex: 1;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
  }
}

/* ==============================
   DESTACADO EDITABLE
   ============================== */
.ipesfa-destacado {
  background: var(--light);
  padding: 48px 0;
}

.ipesfa-destacado__content > *:first-child {
  margin-top: 0;
}
.ipesfa-destacado__content > *:last-child {
  margin-bottom: 0;
}

.ipesfa-destacado__placeholder {
  background: var(--surface);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 32px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 15px;
}
.ipesfa-destacado__placeholder code {
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 14px;
}

/* Elimina padding y fondo blanco del wrapper del tema padre */
#main {
  padding-bottom: 0 !important;
}
#page {
  background-color: transparent;
}

/* ==============================
   FOOTER INSTITUCIONAL
   ============================== */
.ipesfa-footer {
  background: #272e3b;
  color: rgba(255,255,255,.70);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.65;
  border-top: 3px solid var(--accent);
}

.ipesfa-footer__inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: 40px;
  padding-top: 56px;
  padding-bottom: 48px;
}

/* Brand / logo */
.ipesfa-footer__logo-wrap {
  margin-bottom: 20px;
}

.ipesfa-footer__logo-wrap .custom-logo-link img {
  height: 40px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  display: block;
  filter: brightness(0) invert(1);
  opacity: .85;
}

.ipesfa-footer__inst-name {
  font-size: 13px;
  color: rgba(255,255,255,.60);
  margin: 0 0 16px;
  line-height: 1.55;
}

.ipesfa-footer__inst-name strong {
  color: #fff;
  font-weight: 600;
}

.ipesfa-footer__address {
  font-style: normal;
  font-size: 13px;
  color: rgba(255,255,255,.45);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  margin-bottom: 24px;
}

/* Social icons */
.ipesfa-footer__social {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ipesfa-footer__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: rgba(255,255,255,.90);
  text-decoration: none;
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}

.ipesfa-footer__social-link:hover {
  background: var(--accent);
  color: #fff;
  opacity: 1;
}

/* Column titles */
.ipesfa-footer__col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 16px;
}

/* Links */
.ipesfa-footer__links {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ipesfa-footer__links a {
  color: rgba(255,255,255,.65);
  text-decoration: none;
  transition: color .2s ease;
}

.ipesfa-footer__links a:hover {
  color: #fff;
}


/* Contact list with icons */
.ipesfa-footer__links--contact li {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  line-height: 1.5;
}

.ipesfa-footer__links--contact li svg {
  flex-shrink: 0;
  margin-top: 3px;
  color: var(--accent);
}

/* Copyright bar */
.ipesfa-footer__bar {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 16px 0;
  font-size: 12px;
  color: rgba(255,255,255,.35);
  text-align: center;
}

/* ==============================
   RESPONSIVE – TABLET (>=600px)
   ============================== */
@media (min-width: 600px) {
  .ipesfa-wrap {
    padding-left: 32px;
    padding-right: 32px;
  }

  .ipesfa-hero {
    padding: calc(var(--header-h, 72px) + 56px) 0 64px;
    min-height: 75vh;
  }

  .ipesfa-novedades__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .ipesfa-novedades,
  .ipesfa-destacado {
    padding: 56px 0;
  }

  .ipesfa-footer__inner {
    grid-template-columns: 1.6fr 1fr 1fr;
    gap: 56px;
  }
}

/* ==============================
   RESPONSIVE – DESKTOP (>=960px)
   ============================== */
@media (min-width: 960px) {
  .ipesfa-hero {
    padding: calc(var(--header-h, 72px) + 72px) 0 80px;
    min-height: 80vh;
  }

  .ipesfa-hero__title {
    max-width: 800px;
  }

  .ipesfa-novedades__grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
  }

  .ipesfa-novedades,
  .ipesfa-destacado {
    padding: 64px 0;
  }
}

/* ==============================
   OCULTAR SIDEBAR + HEADER-TITLE en Home
   ============================== */
.home #secondary,
.home .header-post-title-container {
  display: none;
}
.home #primary {
  width: 100%;
  float: none;
  padding: 0;
  margin: 0;
}
/* Kill any inner-wrap spacing on Home so hero starts flush */
.home #main > .inner-wrap {
  padding: 0;
  margin: 0;
  max-width: none;
  height: 0;
  overflow: hidden;
}
/* #main y #ipesfa-home sin padding lateral para full bleed */
.home #main,
.home #ipesfa-home {
  padding-left: 0;
  padding-right: 0;
  margin-left: 0;
  margin-right: 0;
  width: 100%;
  max-width: none;
  overflow: visible;
}
.home #ipesfa-home > section {
  width: 100%;
  box-sizing: border-box;
}
