/* ================= GRID ================= */

.category-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 30px;
}

/* ================= CARD ================= */

.category-card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    overflow: hidden;

    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: #e3eaea;
}

/* ================= IMAGE ================= */

.card-image {
    padding: 16px;
}

.card-image img {
    width: 100%;
    height: 140px;
    object-fit: contain;

    filter: none;
    transition: transform 0.25s ease;
}

.category-card:hover .card-image img {
    transform: scale(1.03);
}

/* ================= OVERLAY DE IDENTIDAD (opcional) ================= */

.card-image {
    position: relative;
}

.card-image::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 108, 115, 0.12); /* verde del hero */
    opacity: 0;
    transition: opacity 0.25s ease;
}

.category-card:hover .card-image::after {
    opacity: 1;
}

/* ================= BODY ================= */

.card-body {
    padding: 14px 16px 18px;
    text-align: center;
}

/* ================= ELIMINAR LINK LEGACY JOOMLA EN CARDS ================= */

/* Base */
.category-card .card-title {
    text-decoration: none !important;
    font-size: 15px;
}

/* Hover */
.category-card .card-title:hover,
.category-card:hover .card-title {
    text-decoration: none !important;
}

/* Estados raros que Joomla suele meter */
.category-card .card-title:focus,
.category-card .card-title:active,
.category-card .card-title:visited {
    text-decoration: none !important;
}


/* ================= RESPONSIVE ================= */

@media (max-width: 900px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* ================= SECTION HEADER ================= */

.section-header {
    max-width: 1200px;
    margin: 40px auto 20px;
    padding: 0 10px;
}

.section-header h2 {
    font-size: 22px!important;
    font-weight: 700!important;
    color: #0a6c73!important;
    margin-bottom: 6px!important;
}

.section-header h2:after {
  content: "";
    display: block;
    width: 50px;
    height: 3px;
    background: #f5c15c;
    margin-top: 0.4rem;
}

.section-header p {
    font-size: 14px;
    color: #667;
}

/* ================= RESET TOTAL LINKS EN CARDS ================= */

.instituciones-section a,
.instituciones-section a:hover,
.instituciones-section a:visited,
.instituciones-section a:active {
    color: inherit !important;
    text-decoration: none !important;
}

.instituciones-section .category-card {
    display: block;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    overflow: hidden;

    transition: transform .25s ease, box-shadow .25s ease;
}

.instituciones-section .category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px rgba(0,0,0,.08);
}

.instituciones-section .category-card {
    display: block;
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    overflow: hidden;

    transition: transform .25s ease, box-shadow .25s ease;
}

.instituciones-section .category-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 35px rgba(0,0,0,.08);
}

/* ================= CARDS MODERNAS ================= */

.card {
    background: #fff;
    border-radius: 16px;
    border: 1px solid #eee;
    overflow: hidden;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

/* Imagen */
.card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    filter: none;
}

/* Overlay sutil */
.card .image-wrapper {
    position: relative;
}

.card .image-wrapper::after {
    content: "";
    position: absolute;
    inset: 0;
    background: rgba(10, 108, 115, 0.15); /* verde del sitio */
    transition: background 0.2s ease;
}

.card:hover .image-wrapper::after {
    background: rgba(10, 108, 115, 0.05);
}

.category-card {
  position: relative;
}

.badge-year {
  position: absolute;
  top: 14px;
  right: 14px;
  background: #e6f4f1;
  color: #0f766e;
  font-size: 1.1rem;          /* más grande */
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 2;
}

.badge-icon {
  font-size: 0.9rem;
}
