/**
 * Modern News Widget - Styly (UPRAVENÁ VERZE)
 * Soubor: assets/css/style.css
 */

/* Základní kontejner */
.modern-news-widget {
    width: 100%;
    position: relative;
}

/* Grid layout */
.mnw-grid {
    display: grid;
    gap: 20px;
}

.mnw-columns-1 .mnw-grid {
    grid-template-columns: 1fr;
}

.mnw-columns-2 .mnw-grid {
    grid-template-columns: repeat(2, 1fr);
}

.mnw-columns-3 .mnw-grid {
    grid-template-columns: repeat(3, 1fr);
}

.mnw-columns-4 .mnw-grid {
    grid-template-columns: repeat(4, 1fr);
}

/* Masonry layout */
.mnw-layout-masonry .mnw-grid {
    column-count: var(--mnw-columns, 2);
    column-gap: 20px;
    column-fill: balance;
}

.mnw-layout-masonry .mnw-card {
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 20px;
    display: inline-block;
    width: 100%;
}

/* Masonry columns */
.mnw-layout-masonry.mnw-columns-1 .mnw-grid {
    column-count: 1;
}

.mnw-layout-masonry.mnw-columns-2 .mnw-grid {
    column-count: 2;
}

.mnw-layout-masonry.mnw-columns-3 .mnw-grid {
    column-count: 3;
}

.mnw-layout-masonry.mnw-columns-4 .mnw-grid {
    column-count: 4;
}

/* Card */
.mnw-card {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    flex-direction: column;
    height: 100%;
    cursor: pointer;
}

.mnw-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.12);
}

/* Image */
.mnw-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

.mnw-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.mnw-card:hover .mnw-image img {
    transform: scale(1.05);
}

/* Category badge */
.mnw-category {
    position: absolute;
    top: 15px;
    left: 15px;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 25px;
    z-index: 2;
    transition: all 0.3s ease;
}

/* Default gradient style for category */
.mnw-category.mnw-gradient {
    background: linear-gradient(135deg, #667EEA, #764BA2);
}

.mnw-category,
.mnw-category a {
    color: #ffffff !important;
    text-decoration: none !important;
}

.mnw-category:hover,
.mnw-category a:hover {
    color: #ffffff !important;
}

.mnw-card:hover .mnw-category {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(118, 75, 162, 0.4);
}

/* Content */
.mnw-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.mnw-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 10px;
}

.mnw-title a {
    color: #333;
    text-decoration: none;
}

.mnw-title a:hover {
    color: #0066cc;
}

.mnw-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
    color: #999;
    font-size: 13px;
}

.mnw-meta .mnw-author,
.mnw-meta .mnw-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mnw-excerpt {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
}

/* Read more */
.mnw-read-more-wrapper {
    margin-top: auto;
    padding-top: 15px;
}

.mnw-read-more {
    display: inline-flex;
    align-items: center;
    color: #0066cc;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.mnw-read-more::after {
    content: '→';
    margin-left: 6px;
    font-size: 12px;
    transition: transform 0.2s ease;
}

.mnw-read-more:hover {
    color: #0052a3;
}

.mnw-read-more:hover::after {
    transform: translateX(3px);
}

/* Tlačítko "Zobrazit více článků" */
.mnw-load-more-button,
.mnw-load-more-button:link,
.mnw-load-more-button:visited {
    color: #ffffff !important;  /* Bílý text */
    border-radius: 25px !important;  /* Zaoblení 25px */
    font-weight: 700 !important;  /* Tučný text */
    border: none !important;
    padding: 12px 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Gradient style pro tlačítko */
.mnw-load-more-button.mnw-gradient,
.mnw-load-more-button.mnw-gradient:link,
.mnw-load-more-button.mnw-gradient:visited {
    background: linear-gradient(135deg, #667EEA, #764BA2) !important;
}

.mnw-load-more-button.mnw-gradient:hover,
.mnw-load-more-button.mnw-gradient:focus {
    background: linear-gradient(135deg, #5a72e0, #6a4198) !important;
}

.mnw-load-more-button:hover,
.mnw-load-more-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    color: #ffffff !important;
}

.mnw-load-more-button:active {
    transform: translateY(0);
}

.mnw-load-more-button.loading {
    opacity: 0.8;
    pointer-events: none;
}

/* Wrapper pro tlačítko */
.mnw-load-more-wrapper {
    margin-top: 30px;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.mnw-load-more-wrapper.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Carousel */
.mnw-layout-carousel .mnw-grid {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    gap: 20px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mnw-layout-carousel .mnw-grid::-webkit-scrollbar {
    display: none;
}

.mnw-layout-carousel .mnw-card {
    flex: 0 0 calc(33.333% - 13.333px);
    min-width: 300px;
}

/* Carousel slides nastavení */
.mnw-layout-carousel .mnw-slides-1 .mnw-card {
    flex: 0 0 calc(100% - 20px);
}

.mnw-layout-carousel .mnw-slides-2 .mnw-card {
    flex: 0 0 calc(50% - 10px);
}

.mnw-layout-carousel .mnw-slides-3 .mnw-card {
    flex: 0 0 calc(33.333% - 13.333px);
}

.mnw-layout-carousel .mnw-slides-4 .mnw-card {
    flex: 0 0 calc(25% - 15px);
}

.mnw-carousel-wrapper {
    position: relative;
}

.mnw-carousel-track {
    display: flex;
    gap: 20px;
    scroll-behavior: smooth;
    overflow-x: auto;
    scrollbar-width: none;
}

.mnw-carousel-track::-webkit-scrollbar {
    display: none;
}

.mnw-carousel-item {
    min-width: calc(33.333% - 13.333px);
}

.mnw-carousel-nav {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
}

.mnw-carousel-nav button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: white;
    border: 2px solid #e0e0e0;
    cursor: pointer;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.mnw-carousel-nav button:hover:not(:disabled) {
    background: linear-gradient(135deg, #667EEA, #764BA2);
    color: white;
    border-color: transparent;
    transform: scale(1.1);
}

.mnw-carousel-nav button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Skeleton loading */
.mnw-skeleton {
    position: relative;
    overflow: hidden;
    background: #f2f2f2;
}

.mnw-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,.6) 50%, rgba(255,255,255,0) 100%);
    animation: mnw-shimmer 1.5s infinite;
}

@keyframes mnw-shimmer {
    100% {
        transform: translateX(100%);
    }
}

/* Cards variants */
.mnw-card.compact .mnw-title {
    font-size: 16px;
    margin-bottom: 8px;
}

.mnw-card.compact .mnw-excerpt {
    font-size: 13px;
    margin-bottom: 12px;
}

.mnw-card.no-excerpt .mnw-excerpt {
    display: none;
}

/* Alignment helpers */
.mnw-align-center .mnw-title,
.mnw-align-center .mnw-excerpt,
.mnw-align-center .mnw-meta {
    text-align: center;
}

.mnw-align-right .mnw-title,
.mnw-align-right .mnw-excerpt,
.mnw-align-right .mnw-meta {
    text-align: right;
}

/* Image aspect helpers */
.mnw-image.square img {
    aspect-ratio: 1 / 1;
}

.mnw-image.landscape img {
    aspect-ratio: 16 / 9;
}

.mnw-image.portrait img {
    aspect-ratio: 3 / 4;
}

/* Badges and overlays */
.mnw-badge {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0,0,0,.6);
    color: #fff;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
}

/* List layout */
.mnw-layout-list .mnw-grid {
    grid-template-columns: 1fr;
}

.mnw-layout-list .mnw-card {
    flex-direction: row;
}

.mnw-layout-list .mnw-image {
    width: 40%;
    max-height: 220px;
}

.mnw-layout-list .mnw-card-content {
    width: 60%;
}

/* Overlay layout */
.mnw-layout-overlay .mnw-card {
    position: relative;
    color: #fff;
}

.mnw-layout-overlay .mnw-image img {
    filter: brightness(0.75);
}

.mnw-layout-overlay .mnw-card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(180deg, rgba(0,0,0,0) 0%, rgba(0,0,0,.6) 100%);
    color: #fff;
}

.mnw-layout-overlay .mnw-title a {
    color: #fff;
}

/* Masonry helpers */
.mnw-masonry-item {
    break-inside: avoid;
}

/* Loading states */
.mnw-loading {
    position: relative;
    opacity: 0.7;
    pointer-events: none;
}

.mnw-loading::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.8);
    z-index: 99;
}

.mnw-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f0f0f0;
    border-top-color: #667EEA;
    border-radius: 50%;
    animation: mnw-spin 1s linear infinite;
    z-index: 100;
}

@keyframes mnw-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Utilities */
.mnw-hidden {
    display: none !important;
}

.mnw-center {
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Responsive */
@media (max-width: 1200px) {
    .mnw-columns-4 .mnw-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .mnw-layout-carousel .mnw-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mnw-carousel-item {
        min-width: calc(50% - 10px);
    }
}

@media (max-width: 992px) {
    .mnw-columns-3 .mnw-grid,
    .mnw-columns-4 .mnw-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .mnw-layout-list .mnw-image {
        width: 45%;
    }
    .mnw-layout-list .mnw-card-content {
        width: 55%;
    }
}

@media (max-width: 768px) {
    .mnw-columns-2 .mnw-grid,
    .mnw-columns-3 .mnw-grid,
    .mnw-columns-4 .mnw-grid {
        grid-template-columns: 1fr;
    }
    
    /* Masonry mobile */
    .mnw-layout-masonry.mnw-columns-2 .mnw-grid,
    .mnw-layout-masonry.mnw-columns-3 .mnw-grid,
    .mnw-layout-masonry.mnw-columns-4 .mnw-grid {
        column-count: 1;
    }
    
    /* List layout mobile */
    .mnw-layout-list .mnw-card {
        flex-direction: column;
    }
    .mnw-layout-list .mnw-image,
    .mnw-layout-list .mnw-card-content {
        width: 100%;
    }
    
    /* Carousel mobile */
    .mnw-layout-carousel .mnw-card {
        flex: 0 0 calc(100% - 20px);
        min-width: calc(100% - 20px);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .mnw-card,
    .mnw-image img,
    .mnw-read-more::after,
    .mnw-category,
    .mnw-carousel-track {
        transition: none !important;
        animation: none !important;
    }
}

/* Print */
@media print {
    .modern-news-widget {
        box-shadow: none;
    }
    .mnw-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
    .mnw-image img {
        filter: none !important;
        transform: none !important;
    }
    .mnw-read-more,
    .mnw-carousel-nav {
        display: none;
    }
    .mnw-layout-carousel .mnw-grid {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        overflow: visible;
    }
    .mnw-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}