/******************************************************************************
 * CSS TRIEDY PRE DCZA NEWSPAPERS (FRONTEND - REACT IMPLEMENTÁCIA)
 ******************************************************************************/


.newspapers-wrapper {
    max-width: 1280px;
    font-family: "Poppins", sans-serif;
    margin: 60px auto;
    padding: 0 20px;

}


.magazine-card:focus:not(:focus-visible) {
    outline: none !important;
}


.magazine-card:focus-visible {
    outline: 2px solid #007bff !important;
    outline-offset: 3px;
}


.newspapers-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 380px));
    gap: 40px;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.8s ease;
}

.newspapers-grid.is-loaded {
    opacity: 1;
}


.magazine-card {
    perspective: 1500px;
    width: 100%;
}


.magazine-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 380 / 532;
    background: #ffffff;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: rgba(0, 0, 0, 0.1) 0 4px 12px;
    transition: transform 0.5s cubic-bezier(0.165, 0.84, 0.44, 1), box-shadow 0.5s ease;
}


.magazine-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 15px;
    transform: scale(1.05);
    transition: transform 0.5s ease;
}

.magazine-card:hover .magazine-img {
    transform: scale(1.1);
}


.magazine-info-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7) !important;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    padding: 40px;
    text-align: left;
    opacity: 0;
    transition: all 0.4s ease;
    z-index: 10 !important;
    border-radius: 15px;
    backdrop-filter: blur(5px);
    box-sizing: border-box;
}

.magazine-info-content {
    color: #ffffff !important;
    transform: translateY(20px);
    transition: transform 0.4s ease;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-start;    /* Prvky pod sebou naľavo */
    pointer-events: auto;
}

.mag-info-title {
    width: 100%;
    font-size: clamp(1.1rem, 4vw, 1.45rem);
    font-weight: 700;
    margin: 0 0 12px 0;
    color: #ffffff !important;
    line-height: 1.2;
}

.mag-info-desc {
    width: 100%;
    max-width: 290px;
    font-size: clamp(0.85rem, 3vw, 0.92rem);
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.95) !important;
    margin: 0 0 25px 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;      /* Na desktope ukážeme viac textu */
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.mag-info-ean {
    display: block;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6); /* Jemnejšia biela ako title */
    margin-bottom: 8px;
    font-weight: 400;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.mag-info-btn {
    display: inline-block;
    padding: 12px 28px;
    background-color: #007bff;
    color: #ffffff !important;
    text-decoration: none !important;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.mag-info-btn:hover {
    transform: translateY(-2px);
    background-color: #0056b3;
    box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}


.magazine-card:hover .magazine-info-overlay,
.magazine-card:focus .magazine-info-overlay {
    opacity: 1;
}

.magazine-card:hover .magazine-info-content,
.magazine-card:focus .magazine-info-content {
    transform: translateY(0);
}

.no-img-placeholder {
    width: 100%;
    height: 100%;
    background: #f3f3f3;
}

.newspapers-loading {
    text-align: center;
    padding: 80px;
    color: #999;
    font-style: italic;
}

.mag-info-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: #fff;
}

.mag-info-btn .dashicons {
    width: auto;
    height: auto;
    color: #FFFFFF;
    line-height: inherit;
}

.link-container-nasa-dieceza {
    text-align: right;
    margin-right: 20px;
    margin-left: 20px;
    margin-top: 50px;
}

.link-container-nasa-dieceza p {
    color: var(--color-grey-500) !important;
}

.link-container-nasa-dieceza a {
    color: #0C4780;
    font-style: italic;
}

/* --- RESPONZIVITA (PREPNUTIE NA STRED) --- */

@media (max-width: 1200px) {
    .newspapers-grid {
        gap: 20px;
        justify-items: center;
    }
}

/* TABLET */
@media (max-width: 992px) {
    .newspapers-grid {
        gap: 20px;
        grid-template-columns: repeat(2, 1fr);
        max-width: 840px;
        justify-content: center;
    }

    .magazine-info-overlay {
        align-items: center;
        text-align: center;
        padding: 30px;
    }

    .magazine-info-content {
        align-items: center;
    }

    .mag-info-desc {
        max-width: 260px;
        -webkit-line-clamp: 4;
    }
}

/* MOBIL */
@media (max-width: 768px) {
    .newspapers-wrapper {
        margin: 20px auto;
    }

    .newspapers-grid {
        grid-template-columns: 1fr;
        max-width: 340px;
        margin: 0 auto;
        gap: 35px;
    }

    .magazine-info-overlay {
        background: rgba(0, 0, 0, 0.8) !important;
        padding: 25px;
    }

    .mag-info-title {
        font-size: 1.2rem;
        margin-bottom: 10px;
    }

    .mag-info-desc {
        -webkit-line-clamp: 6; /* Na mobile využijeme výšku karty */
        margin-bottom: 20px;
    }

    .mag-info-btn {
        width: 100%; /* Button cez celú šírku pre palce */
        padding: 15px;
        font-size: 0.9rem;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 3px;
        box-sizing: border-box;
    }

    .link-container-nasa-dieceza {
        text-align: center;
        margin-top: 10px;
    }
}

/* EXTRA MALÉ MOBILY */
@media (max-width: 400px) {
    .newspapers-grid {
        max-width: 300px;
    }

    .mag-info-title {
        font-size: 0.7rem;
    }

    .mag-info-desc {
        font-size: 0.6rem;
    }
}