/* ===== Carrusel ===== */
.carousel-image-crop {
  height: 600px;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}
.carousel-image-crop img { width: 100%; height: 100%; object-fit: cover; }

/* ===== Topbar + Marca ===== */
.topbar-dirsu {
  background: #000000;
  color: #ffffff;
}

.topbar-dirsu .btn.btn-link {
  color: #ffffff;
  opacity: 0.95;
}

.topbar-dirsu .btn.btn-link:hover {
  color: #9ed7a3;
  opacity: 1;
}

.dirsu-brand-wrap {
  height: 80px;
  min-height: 80px;
  max-height: 80px;
  display: inline-flex;
  align-items: center;
  flex: 0 1 560px;
  width: auto;
  max-width: min(56vw, 560px);
  min-width: 0;
  overflow: hidden;
  gap: 10px;
}

.dirsu-brand {
  height: 80px;
  min-height: 80px;
  max-height: 80px;
  margin: 0;
  padding: 0;
  gap: 10px;
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
}

.dirsu-brand-title {
  color: #0f4229;
  line-height: 1;
  font-weight: 800;
  font-size: 1.55rem;
  letter-spacing: 0.2px;
}

.dirsu-brand-logo-wrap {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
}

.dirsu-brand-logo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
  object-fit: contain;
}

.dirsu-brand-sep {
  width: 1px;
  height: 42px;
  flex: 0 0 1px;
  background: rgba(15, 66, 41, 0.32);
}

.dirsu-brand-subtext {
  flex: 1 1 auto;
  max-width: none;
  min-width: 0;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.62rem;
  line-height: 1.18;
  color: #0f4229;
  font-weight: 600;
}

@media (max-width: 1399.98px) {
  .dirsu-brand-wrap {
    flex-basis: 460px;
    max-width: min(52vw, 460px);
  }

  .dirsu-brand-subtext {
    font-size: 0.59rem;
  }
}

@media (max-width: 1199.98px) {
  .dirsu-brand-wrap {
    flex-basis: 360px;
    max-width: min(46vw, 360px);
  }

  .dirsu-brand-subtext {
    font-size: 0.56rem;
  }
}

@media (max-width: 991.98px) {
  .dirsu-brand-wrap {
    height: 72px;
    min-height: 72px;
    max-height: 72px;
    max-width: none;
    flex-basis: auto;
    gap: 0;
  }

  .dirsu-brand {
    height: 72px;
    min-height: 72px;
    max-height: 72px;
  }

  .dirsu-brand-logo-wrap {
    width: 34px;
    height: 34px;
    flex-basis: 34px;
  }

  .dirsu-brand-title {
    font-size: 1.2rem;
  }

  .dirsu-brand-subtext,
  .dirsu-brand-sep {
    display: none;
  }
}

/* ===== Top Feature ===== */
.top-feature .row > [class*="col-"] { display: flex; }
.feature-card {
  display: flex; align-items: flex-start; gap: 16px; width: 100%;
  padding: 24px 32px; background: #ffffff; border-radius: .5rem;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  min-height: 220px;
}
@media (min-width: 992px){ .feature-card { min-height: 240px; } }
.feature-icon { display:flex; align-items:center; justify-content:center; width:64px; height:64px; flex:0 0 64px; border-radius:50%; background:#f3f6f9; }
.feature-icon i { font-size: 24px; }
.feature-body { display:flex; flex-direction:column; justify-content:flex-start; }
.feature-title { margin:0 0 6px 0; line-height:1.2; }
.feature-desc { margin:0; line-height:1.5; }

/* ===== Convocatoria ===== */
.convocatoria-card { position: relative; }
.convocatoria-overlay {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  text-align: center; padding: 24px; background: rgba(255,255,255,0.75);
  border-radius: .5rem; z-index: 3; cursor: not-allowed;
}
.convocatoria-overlay i { font-size: 1.25rem; margin-right: .5rem; color: #0d6efd; }
.convocatoria-overlay span { font-weight: 600; color: #0b132b; }

/* ===== DIRSU (brief y tarjetas) ===== */
.dirsu-brief .person-card { border-radius: .75rem; }
.person-photo { width:84px; height:84px; object-fit:cover; border-radius:50%; }
.dirsu-brief ul { padding-left: 1.2rem; }
.dirsu-brief ul li { margin-bottom: .35rem; }

/* ===== Servicios (cards horizontales) ===== */
.home-services .service-item {
  text-align: left;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0,0,0,.06);
  transition: transform .2s ease, box-shadow .2s ease;
}
.home-services .service-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,.1);
}
.home-services .service-item h4 {
  margin: 0 0 .45rem 0;
  font-size: 1.1rem;
}
.home-services .service-item p {
  margin: 0;
}

/* ===== Portada dinamica de subpaginas ===== */
.page-header-desc {
  max-width: 860px;
  font-size: 1.05rem;
  line-height: 1.55;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

@media (max-width: 768px) {
  .page-header-desc {
    font-size: 0.98rem;
    max-width: 96%;
  }
}

/* ===== Visor de Novedades (Home) ===== */
.home-novedades-wrap {
  background: #ffffff;
  position: relative;
  z-index: 3;
  isolation: isolate;
  margin-bottom: 42px;
  border-top: 1px solid #e6e9ee;
  border-bottom: 1px solid #e6e9ee;
}

.home-novedades-grid {
  display: grid;
  grid-template-columns: 1fr;
  height: 560px;
  min-height: 560px;
  max-height: 560px;
  overflow: hidden;
}

.nov-side {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: repeat(3, minmax(0, 1fr));
  height: 100%;
  min-height: 0;
}

.nov-card {
  position: relative;
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  display: block;
  min-height: 0;
  height: 100%;
  max-height: 100%;
  transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
}

.nov-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  filter: saturate(1.04);
}

.nov-card img,
.nov-card .nov-ph {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: #000000 !important;
}

.nov-card .nov-ph {
  background: linear-gradient(135deg, #1c1f28, #2a3040);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 56px;
  color: rgba(255, 255, 255, 0.7);
}

.nov-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(7, 24, 16, 0.04) 0%, rgba(7, 24, 16, 0.36) 72%);
}

.nov-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 14px 18px;
  color: #0f4229;
  background: #ffffff;
  border-top: 1px solid #e5e8ee;
  overflow: hidden;
}

.nov-main .nov-body {
  max-height: 55%;
}

.nov-mini .nov-body {
  max-height: 60%;
}

.nov-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 7px;
  color: #0f4229;
}

.nov-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 700;
  background: #374151;
  color: #ffffff;
  letter-spacing: 0.3px;
  text-transform: uppercase;
}

.nov-badge-comunicado {
  background: #facc15;
  color: #111111;
}

.nov-badge-evento {
  background: #2563eb;
  color: #ffffff;
}

.nov-meta > span:last-child {
  display: inline-flex;
  align-items: center;
  padding: 1px 0;
  background: transparent;
  border: none;
  color: #205a3f;
  line-height: 1.2;
}

.nov-source {
  font-size: 11px;
  color: #2b6c4a;
  padding: 0;
  margin-bottom: 6px;
}

.nov-main .nov-title {
  font-size: clamp(1.03rem, 1.45vw, 1.3rem);
  line-height: 1.25;
  font-weight: 700;
  margin: 0 0 6px 0;
  color: #0f4229;
  text-shadow: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nov-main .nov-text {
  margin: 0;
  font-size: 0.88rem;
  line-height: 1.35;
  max-width: 92%;
  color: #2f5f46;
  text-shadow: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nov-mini .nov-title {
  font-size: 0.94rem;
  line-height: 1.28;
  margin: 0;
  color: #0f4229;
  text-shadow: none;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.nov-empty {
  background: #f7f9fc;
  border: 1px solid #e3e8ef;
}

.nov-empty-inner {
  width: 100%;
  height: 100%;
  min-height: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #2f5f46;
  font-weight: 600;
}

.nov-empty-inner i {
  font-size: 32px;
}

.nov-empty-all {
  min-height: 420px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
}

.nov-empty-all-inner {
  text-align: center;
  color: #0f4229;
}

.nov-empty-all-inner i {
  font-size: 58px;
  color: #2f7a4d;
}

.nov-empty-all-inner h3 {
  margin-top: 14px;
  margin-bottom: 8px;
}

.nov-empty-all-inner p {
  margin: 0;
  opacity: 0.9;
}

@media (max-width: 992px) {
  .home-novedades-grid {
    grid-template-columns: 1fr;
    height: auto;
    min-height: 0;
    max-height: none;
  }

  .home-novedades-wrap { margin-bottom: 28px; }

  .nov-main {
    min-height: 320px;
    height: 320px;
  }

  .nov-side { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(3, 170px); gap: 0; }
  .nov-mini, .nov-empty { min-height: 170px; height: 170px; }

  .nov-main .nov-title {
    font-size: 1rem;
  }

  .nov-main .nov-text {
    font-size: 0.82rem;
  }
}

@media (max-width: 575.98px) {
  .nov-side {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(6, 160px);
  }

  .nov-mini,
  .nov-empty {
    min-height: 160px;
    height: 160px;
  }
}

@media (min-width: 992px) and (max-width: 1399.98px) {
  .home-novedades-grid { grid-template-columns: 1fr 1fr; }
  .nov-side { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
}

@media (min-width: 1400px) {
  .home-novedades-grid { grid-template-columns: 0.45fr 0.55fr; }
  .nov-side { grid-template-columns: repeat(3, minmax(0, 1fr)); grid-template-rows: repeat(2, minmax(0, 1fr)); }
}

/* ===== Ajuste de separacion: bloque de 3 tarjetas ===== */
@media (min-width: 991.98px) {
  .top-feature,
  .container-fluid.top-feature {
    margin-top: 48px !important;
    position: static !important;
    z-index: auto !important;
    clear: both;
  }

  .top-feature > .container {
    padding-top: 0 !important;
  }
}
