/* CSS dla listy artykułów (ArticleListCategory, ArticleListDoubleCardComponent, ArticleListCardComponent) */
/* Plik globalny - komponenty potomne renderujące zagnieżdżone elementy nie otrzymują atrybutu CSS isolation rodzica, dlatego style muszą być globalne */

.news-grid {
    max-width: 1200px;
    margin: 20px auto;
    padding: 0 16px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(180px, 320px);
    grid-gap: 16px;
}
.news-index-grid {
    max-width: 100%;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    justify-content: space-evenly;
    justify-items: center;
    gap: 1em;
    background-color: var(--background-color);
    color: var(--shop-text-color);
    padding: min(2em, 4%);
    /*border: 5px solid #808080; */
    border-radius: 10px;
}
/* Karta bazowa */
.card {
    background: #fff;
    max-height: 300px;
    width:100%;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.12);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

    .card a {
        color: inherit;
        text-decoration: none;
        display: block;
        height: 100%;
    }

    .card:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 10px rgba(0,0,0,0.18);
    }

/* Obrazek */
.card-image {
    position: relative;
    width: 100%;
    overflow: hidden;
}

    .card-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
    }

/* Artykuł główny x2 */
.card-main {
    grid-column: span 2;
    grid-row: span 1;
}

    .card-main .card-image {
        height: 100%;
    }

/* Tytuł na zdjęciu (overlay) */
.card-title-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 16px;
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    color: #fff;
}

    .card-title-overlay h2 {
        margin: 0;
        font-size: clamp(1.2rem, 2vw, 1.6rem);
        line-height: 1.3;
    }

/* Małe karty */
.card-small .card-image {
    height: 100%;
}

.card-title {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: min(2em, 4%);
    background: linear-gradient(to top, rgba(0,0,0,0.7), rgba(0,0,0,0));
    color: #fff;
}

    .card-title h3 {
        margin: 0;
        font-size: clamp(1rem, 2vw, 1.2rem);
        line-height: 1.3;
    }
/*pojedynczy artykuł*/
.container-article {
    max-width: 100%;
    color: var(--text-article-color);
    background-color: var(--background-color);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 5fr);
    grid-template-rows: auto auto auto;
    grid-template-areas:
        "image title"
        "article article"
        "article-footer article-footer";
}

.article-image-header {
    grid-area: image;
    min-width: 0;
    overflow: hidden;
    padding: 16px;

}

    .article-image-header img {
        width: 100%;
        height: auto;
        object-fit: cover;
        border-radius: 6px;
    }

.article-title-header {
    grid-area: title;
    min-width: 0;
    padding: 16px;
    background-color: var(--background-color);
    display: flex;
    align-items: start;
    flex-direction: column;
    justify-content: space-around;
}
    .article-title-header h1 {
        margin: 0;
        font-size: clamp(1.5rem, 2vw, 2rem);
        line-height: 1.3;
        color: var(--text-article-color);
        background: linear-gradient(135deg, #0f172a 0%, #2563eb 35%, #7c3aed 70%, #0f172a 100%);
        background-clip: text;
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
    }

.article-content {
    grid-area: article;
    padding: 16px;
}
.article-category {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 1px;
}
.article-title-footer {
    font-size: 0.8rem;
    color: var(--text-color);
    margin-bottom: 1px;
}

.article-footer {
    grid-area: article-footer;
    display: flex;
    flex-direction:column;
    width:100%;
    min-width: 0;
}
.article-footer-title {
    font-size: clamp(1rem, 2vw, 1.5rem);
    color: var(--text-title-color);
    margin-bottom: 1px;
}
.article-galery-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
    gap: 8px;
    border-top: 2px solid;
    border-color: var(--text-color);
    padding: 2px 10px;
    margin-top: 5px;
    margin-bottom: 5px;
    min-width: 0;
}

.article-galery-image img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    aspect-ratio: 16/9;
}

    /* Responsywność */
    @media (max-width: 900px) {
        .news-grid {
            grid-template-columns: repeat(2, 1fr);
        }

        .card-main {
            grid-column: span 2;
            grid-row: span 1;
        }

            .card-main .card-image {
                height: 260px;
            }

        .container-article {
            max-width: 100%;
            color: var(--text-article-color);
            background-color: var(--background-color);
            display: grid;
            grid-template-columns: minmax(0, 1fr);
            grid-template-rows: auto auto auto auto;
            grid-template-areas:
                "title"
                "image"
                "article"
                "article-footer";
        }

        .article-title-header {
            grid-area: title;
            padding: 8px;
            background-color: var(--background-color);
            display: flex;
            align-items: center;
            justify-content: center;
        }
    }

    @media (max-width: 600px) {
        .news-grid {
            grid-template-columns: 1fr;
        }

        .card-main {
            grid-column: span 1;
            grid-row: span 1;
        }

            .card-main .card-image {
                height: 100%;
            }

        .card-small .card-image {
            height: 100%;
        }
    }

/* ===== Embed produktu w treści artykułu ===== */
.product-article-panel {
    display: grid;
    min-height: 300px;
    max-width: 100%; 
    min-width:280px;
    border-radius: 20px;
    border: 1px solid var(--text-color);
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    justify-items: center;
    gap: 1em;
    background-color: var(--background-color);
    align-items: center;
}
.product-embed-wrapper {
    max-width: 280px;
    margin-bottom: 12px;
}

    .product-embed-wrapper.product-embed-left {
        float: left;
        margin-right: 16px;
    }

    .product-embed-wrapper.product-embed-right {
        float: right;
        margin-left: 16px;
    }

    .product-embed-wrapper.product-embed-center {
        margin-left: auto;
        margin-right: auto;
        clear: both;

    }
