/* ============================================================
   PSBLOG – SEKCJA NA STRONIE GŁÓWNEJ (HOOK)
   Spacing: wszystkie wartości są wielokrotnością 4px
   ============================================================ */

/* --- Reset --- */
.psblog-container .container,
.psblog-container .container-fluid {
    margin-left: auto;
    margin-right: auto;
    padding: 0;
}

/* --- Blok główny --- */
.blog-block {
    overflow: hidden;
    margin-top: 32px !important;
    padding: 20px 0 32px;
    border-radius: 12px;
}

/* ============================================================
   NAGŁÓWEK SEKCJI
   ============================================================ */
.blog-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 24px;
    gap: 20px;
}

.blog-section-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #232323;
    margin: 0 0 8px 0;
    text-align: center;
}

.blog-section-header-text {
    flex: 1;
    text-align: center;
}

.blog-section-desc {
    font-size: 0.9rem;
    color: #666;
    margin: 0;
    line-height: 1.5;
}

.blog-section-see-all {
    white-space: nowrap;
    font-weight: 600;
    font-size: 0.95rem;
    color: #232323;
    text-decoration: none;
    transition: color 0.2s;
    flex-shrink: 0;
    margin-top: 4px;
    display:flex;
    align-items: center;
}

.blog-section-see-all:hover {
    color: var(--brown);
    text-decoration: none;
}

/* ============================================================
   GRID KART – DESKTOP (3 kolumny, statyczny)
   ============================================================ */
.blog-cards {
    display: flex;
    gap: 24px;
}

.blog-cards__container {
    display: flex;
    gap: 24px;
    width: 100%;
}

.blog-card {
    flex: 1 1 0%;
    min-width: 0;
}

/* ============================================================
   POJEDYNCZA KARTA
   ============================================================ */
.blog-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #eee;
}

.blog-card a {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: 100%;
}

/* --- Obrazek --- */
.blog-card-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: #f5f5f5;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}


.blog-card-no-image {
    width: 100%;
    height: 100%;
    background: #e9ecef;
}

/* --- Treść pod obrazkiem --- */
.blog-card-body {
    padding: 16px 12px 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.blog-card-date {
    font-size: 0.82rem;
    color: #999;
    font-weight: 400;
}

.blog-card-title {
    font-size: 1rem;
    font-weight: 600;
    color: #232323;
    margin: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ============================================================
   EMBLA CAROUSEL – DOTS (widoczne tylko na mobile)
   ============================================================ */
.blog-cards__dots {
    display: none;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.blog-cards__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background: #ccc;
    cursor: pointer;
    transition: background 0.2s;
}

.blog-cards__dot.is-active {
    background: #232323;
}

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

/* Tablet – 3 kolumny z mniejszym gapem */
@media (max-width: 992px) and (min-width: 769px) {
    .blog-cards,
    .blog-cards__container {
        gap: 16px;
    }

    .blog-card-title {
        font-size: 0.92rem;
    }
}

/* Mobile – Embla carousel przejmuje layout */
@media (max-width: 768px) {
    .blog-section-header {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 12px;
    }

    .blog-section-see-all {
        align-self: center;
    }

    .blog-section-title {
        font-size: 1.3rem;
    }

    .blog-section-desc {
        font-size: 0.85rem;
    }

    .blog-block {
        padding: 16px 12px 24px;
    }

    /* Embla: viewport */
    .blog-cards {
        overflow: hidden;
    }

    .blog-cards__container {
        display: flex;
        gap: 0;
    }

    /* Embla: slajdy */
    .blog-cards__slide {
        flex: 0 0 80%;
        min-width: 0;
        margin-right: 16px;
    }

    .blog-cards__dots {
        display: flex;
    }

    .blog-card-image {
        aspect-ratio: 4 / 3;
    }

    .blog-card-title {
        font-size: 0.95rem;
    }
}

@media (max-width: 400px) {
    .blog-cards__slide {
        flex: 0 0 88%;
    }

    .blog-card-body {
        padding: 12px 12px 16px;
    }

    .blog-card-date {
        font-size: 0.78rem;
    }

    .blog-card-title {
        font-size: 0.9rem;
    }
}

/* ============================================================
   POJEDYNCZY POST (WIDOK view.tpl)
   ============================================================ */
.blog-post-single {
    max-width: 800px;
    margin: 0 auto;
    padding: 0;
    background: transparent;
    width: 95vw;
}

.blog-post-single img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
    width:100%;
}

.blog-post-content-wrapper {
    background: #fff;
    padding: 32px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
}

/* Breadcrumb */
.blog-breadcrumb {
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
    padding: 12px 0;
}

.blog-breadcrumb a {
    color: var(--brown);
    text-decoration: none;
    transition: color 0.2s;
}

.blog-breadcrumb a:hover {
    color: var(--brown);
}

.blog-breadcrumb .separator {
    margin: 0 8px;
    color: #999;
}

.blog-breadcrumb .current-page {
    color: #333;
    font-weight: 500;
}

/* Nagłówek posta */
.post-header {
    margin-bottom: 40px;
    text-align: center;
}

.post-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #232323;
    margin-bottom: 20px;
    line-height: 1.2;
}

.post-date {
    display: flex;
    align-items: center;
    gap: 8px;
}

.date-icon {
    font-size: 14px;
}

.date-text {
    font-weight: 500;
}

/* Obraz główny */
.post-featured-image {
    margin: 40px 0;
    text-align: center;
}

.featured-img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

/* Treść posta */
.post-content {
    font-size: 18px;
    line-height: 1.7;
    color: #333;
    margin: 40px 0;
}

.post-content p {
    margin-bottom: 24px;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4 {
    margin-top: 40px;
    margin-bottom: 20px;
    color: #232323;
    font-weight: 600;
}

.post-content h2 {
    font-size: 1.8rem;
    border-bottom: 2px solid #f5f5f5;
    padding-bottom: 12px;
}

.post-content h3 {
    font-size: 1.5rem;
}

.post-content ul,
.post-content ol {
    margin: 20px 0;
    padding-left: 32px;
}

.post-content li {
    margin-bottom: 8px;
}

.post-content blockquote {
    border-left: 4px solid var(--brown);
    margin: 32px 0;
    padding: 20px 32px;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

.post-content code {
    background: #f1f1f1;
    padding: 4px 8px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
}

.post-content pre {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 4px;
    overflow-x: auto;
    margin: 20px 0;
}

/* Social share */
.social-share-section {
    background: transparent;
    padding: 32px 0;
    border-radius: 0;
    margin: 48px 0;
    text-align: center;
    border: none;
}

.share-title {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.2rem;
    font-weight: 600;
}

.share-buttons {
    display: flex;
    justify-content: center;
    gap: 16px;
    flex-wrap: wrap;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #e9ecef;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 120px;
    justify-content: center;
}

.share-btn:hover {
    text-decoration: none;
}

.share-icon {
    font-weight: bold;
    font-size: 16px;
}

.share-btn.facebook { background: #1877f2; color: white; }
.share-btn.facebook:hover { background: #166fe5; color: white; }
.share-btn.twitter { background: #1da1f2; color: white; }
.share-btn.twitter:hover { background: #1991db; color: white; }
.share-btn.whatsapp { background: #25d366; color: white; }
.share-btn.whatsapp:hover { background: #22c55e; color: white; }
.share-btn.email { background: #6c757d; color: white; }
.share-btn.email:hover { background: #5a6268; color: white; }

/* Powrót do bloga */
.back-to-blog {
    text-align: center;
    margin: 48px 0 32px 0;
    padding-top: 32px;
    border-top: 1px solid #eee;
}

/* ============================================================
   RESPONSIVE – WIDOK POJEDYNCZEGO POSTA
   ============================================================ */
@media (max-width: 768px) {
    .blog-post-single {
        padding: 16px 0;
    }

    .post-title {
        font-size: 1.4rem;
        text-align: left;
    }

    .post-content {
        font-size: 16px;
    }

    .share-buttons {
        flex-direction: column;
        align-items: center;
    }

    .share-btn {
        width: 200px;
    }

    .social-share-section {
        padding: 20px;
        margin: 32px 0;
    }
}

@media (max-width: 576px) {
    .post-meta {
        flex-direction: column;
        gap: 12px;
    }

    .blog-breadcrumb {
        font-size: 12px;
    }

    .blog-breadcrumb .current-page {
        display: block;
        margin-top: 4px;
    }
}

/* ============================================================
   LISTA POSTÓW (list.tpl) – zachowane style
   ============================================================ */
.psblog-container .blog-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 32px;
    margin: 0;
    padding: 20px 0;
}

.psblog-container .blog-post-item {
    width: 100%;
    padding: 0;
    max-width: 100%;
}

.psblog-container .blog-post-item article {
    height: 100%;
    display: flex;
    padding: 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    flex-wrap: wrap;
}

.psblog-container .blog-post-item article a {
    max-height: 88px;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
}

@media screen and (max-width: 400px) {
    .psblog-container .blog-post-item article a {
        flex-direction: column;
        max-height: fit-content;
    }
}

.psblog-container .blog-post-item article a img {
    max-height: 100%;
    object-fit: contain;
    width: auto;
}

.psblog-container .blog-post-item article:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.psblog-container .blog-post-item img {
    height: fit-content;
    border-radius: 4px;
    margin-bottom: 16px;
    max-height: 100%;
}

.psblog-container .blog-post-item h2 {
    font-size: 1.5rem;
    margin: 0 0 16px 0;
    color: #232323;
}

.psblog-container .post-excerpt {
    color: #666;
    flex-grow: 1;
}

.post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 16px;
    border-top: 1px solid #eee;
    color: #666;
    font-size: 0.9rem;
    width: 100%;
}

.read-more {
    color: var(--bs-link-hover-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease-in-out;
}

.read-more:hover {
    color: var(--bs-link-hover-color);
}

@media (max-width: 768px) {
    .psblog-container .blog-posts-grid {
        grid-template-columns: 100%;
    }

    .psblog-container .blog-post-item h2 {
        font-size: 18px;
    }

    .post-excerpt {
        font-size: 14px;
    }
}

/* ============================================================
   BLOG CARD – SHORT DESCRIPTION & AUTHOR (v1.3.0)
   ============================================================ */

/* --- Short description on homepage cards --- */
.blog-card-description {
    font-size: 0.82rem;
    color: #666;
    line-height: 1.45;
    margin: 6px 0 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Author badge on homepage cards --- */
.blog-card-author {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.78rem;
    color: #888;
    margin-top: 8px;
}

.blog-card-author-icon::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background: #bbb;
    border-radius: 50%;
    vertical-align: middle;
    /* simple person silhouette via CSS */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M12 14c-6 0-8 3-8 5v1h16v-1c0-2-2-5-8-5z'/%3E%3C/svg%3E");
    background-size: 10px;
    background-repeat: no-repeat;
    background-position: center;
}

/* --- Author on single post page --- */
.post-author {
    color: #555;
    font-size: 0.9rem;
}

.post-author-separator {
    margin: 0 8px;
    color: #ccc;
}

.post-author-name {
    font-weight: 500;
}

/* --- Author on list page --- */
.post-list-author {
    color: #777;
    font-size: 0.85rem;
    margin-left: 4px;
}
