/**
 * Overrides de diseño CUAAD.
 * Sitio: Drupal100
 * Tema: drudg8b3
 * Este archivo se carga después de los CSS existentes del tema.
 */

/* Base defensiva: evita desbordamientos visuales comunes */
img,
video,
iframe {
  max-width: 100%;
}

/* Ajustes suaves para componentes de noticias/directorio sin romper Bootstrap */
.noticias,
.noticias-stitch,
.directorio,
.dir-item {
  box-sizing: border-box;
}

/* Directorio institucional */
.dir-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1rem;
}

.dir-photo {
  flex: 0 0 auto;
  max-width: 120px;
}

.dir-info {
  flex: 1 1 auto;
  min-width: 0;
}

.dir-title {
  margin-top: 0;
}

/* Accesibilidad básica para enlaces y foco */
a:focus,
button:focus,
[tabindex]:focus {
  outline: 2px solid currentColor;
  outline-offset: 2px;
}

/* ==========================================================
   Fase 7 - Refinamiento estético institucional CUAAD
   Archivo reversible: diseno-cuaad-overrides.css
   ========================================================== */

:root {
  --cuaad-azul: #4b5a7b;
  --cuaad-vino: #785177;
  --cuaad-texto: #232323;
  --cuaad-borde: rgba(0, 0, 0, 0.12);
  --cuaad-sombra-suave: 0 8px 20px rgba(0, 0, 0, 0.08);
  --cuaad-radio: 14px;
}

/* Legibilidad general */
body {
  color: var(--cuaad-texto);
}

main a,
.layout-content a {
  text-underline-offset: 0.18em;
}

/* Menús y navegación: refuerzo visual sin cambiar estructura */
.navbar a,
.menu a,
nav a {
  transition: color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.navbar a:hover,
.navbar a:focus,
.menu a:hover,
.menu a:focus,
nav a:hover,
nav a:focus {
  text-decoration: none;
}

/* Noticias: tarjetas más estables y legibles */
.noticia-card,
.noticias .views-row,
.noticias-stitch .views-row {
  border-radius: var(--cuaad-radio);
}

.noticia-card {
  overflow: hidden;
  box-shadow: var(--cuaad-sombra-suave);
}

.noticia-card img,
.noticias img,
.noticias-stitch img {
  display: block;
  width: 100%;
  height: auto;
}

/* Directorio institucional */
.dir-item {
  padding: 1rem;
  border: 1px solid var(--cuaad-borde);
  border-radius: var(--cuaad-radio);
  background: #fff;
}

.dir-photo img {
  border-radius: 10px;
  object-fit: cover;
}

.dir-title {
  color: var(--cuaad-azul);
  line-height: 1.25;
}

/* Footer: consistencia de enlaces */
footer a,
.site-footer a {
  text-underline-offset: 0.2em;
}

footer a:hover,
footer a:focus,
.site-footer a:hover,
.site-footer a:focus {
  text-decoration: underline;
}

/* Formularios */
input,
select,
textarea {
  max-width: 100%;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid var(--cuaad-vino);
  outline-offset: 2px;
}

/* Responsive defensivo */
@media (max-width: 767.98px) {
  .dir-item {
    flex-direction: column;
  }

  .dir-photo {
    max-width: 100%;
  }

  .dir-photo img {
    max-width: 160px;
    height: auto;
  }

  .noticia-card,
  .noticias .views-row,
  .noticias-stitch .views-row {
    margin-bottom: 1rem;
  }
}
