/**
 * mod_news24_categories - CSS
 * Griglia con hover a comparsa, sullo stesso stile di mod_news24_photogrid
 * ma indipendente (classi e variabili proprie, non condivise).
 */

.categories-wrapper {
    display: grid;
    grid-template-columns: repeat(var(--cat-columns, 5), 1fr);
    gap: 10px;
    height: 100%;
    align-content: center;
    position: relative;
}

.categories-item {
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 4px;
    text-decoration: none;
    color: #fff;
    cursor: pointer;
}

.categories-image {
    width: 100%;
    height: var(--cat-height, 140px);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    background-color: #222;
    transition: transform 0.4s ease;
}

/* Zoom opzionale */
.categories-zoom .categories-item:hover .categories-image {
    transform: scale(1.08);
}

/* Barra titolo in basso — sempre visibile */
.categories-title-bar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 6px 8px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.85));
    pointer-events: none;
}

.categories-title-short {
    display: block;
    font-size: var(--cat-font-size, 0.72rem);
    font-weight: 600;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6);
}

/* Overlay hover — titolo completo */
.categories-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: rgba(0, 0, 0, 0.75);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

.categories-item:hover .categories-overlay {
    opacity: 1;
}

/* Nascondo il titolo corto durante hover */
.categories-item:hover .categories-title-bar {
    opacity: 0;
}

.categories-title-full {
    font-size: calc(var(--cat-font-size, 0.72rem) + 0.08rem);
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
    text-align: center;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
}
