/**
 * PyziTheme - single-post.css (pyzitheme/assets/css/single-post.css)
 * 
 * Pojedynczy post, wpis blogowy
 *
 * @package     PyziTheme
 * @subpackage  Assets/CSS
 * @author      Patryk Kowalski <p.kowalski@kamikstudio.pl>
 * @copyright   2025 KamikStudio & PyziPyzi
 * @license     Proprietary
 * @version     1.0.0
 * @since       1.0.0
 * 
 * Client: PyziPyzi - Domowe wyroby cukiernicze
 * Website: https://pyzipyzi.pl
 * 
 * This file is part of PyziTheme.
 * Unauthorized copying or distribution is prohibited.
 */

/* =============================================
   PYZITHEME - POJEDYNCZY POST
   ============================================= */

.single-post-content {
    max-width: 900px;
    margin: 0 auto;
    padding: 60px 20px;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

/* === HEADER POSTA === */
.entry-header {
    text-align: center;
    margin-bottom: 40px;
}

.post-category-badge {
    display: inline-block;
    background: #ef6341;
    color: white;
    padding: 8px 20px;
    border-radius: 25px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 20px;
}

.entry-title {
    font-size: 42px;
    font-weight: 700;
    color: #5e341c;
    line-height: 1.2;
    margin-bottom: 25px;
}

.entry-meta {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 25px;
    flex-wrap: wrap;
    font-size: 14px;
    color: #666;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.meta-item svg {
    width: 18px;
    height: 18px;
    fill: #ef6341;
}

/* === MINIATURA === */
.entry-thumbnail {
    margin-bottom: 50px;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
}

.entry-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* === TREŚĆ POSTA === */
.entry-content {
    font-size: 16px;
    line-height: 1.8;
    color: #333;
}

.entry-content h2 {
    font-size: 30px;
    font-weight: 700;
    color: #5e341c;
    margin: 40px 0 20px;
    line-height: 1.3;
}

.entry-content h3 {
    font-size: 27px;
    font-weight: 600;
    color: #5e341c;
    margin: 35px 0 18px;
    line-height: 1.4;
}

.entry-content h4 {
    font-size: 22px;
    font-weight: 600;
    color: #5e341c;
    margin: 30px 0 15px;
}

.entry-content h5 {
    font-size: 20px;
    font-weight: 600;
    color: #5e341c;
    margin: 25px 0 12px;
}

.entry-content p {
    margin-bottom: 20px;
}

.entry-content a {
    color: #ef6341;
    text-decoration: underline;
    transition: opacity 0.3s;
}

.entry-content a:hover {
    opacity: 0.8;
}

.entry-content ul,
.entry-content ol {
    margin: 25px 0;
    padding-left: 30px;
}

.entry-content li {
    margin-bottom: 10px;
}

.entry-content blockquote {
    border-left: 4px solid #ef6341;
    padding: 20px 25px;
    margin: 30px 0;
    background: #f5f0e8;
    border-radius: 0 8px 8px 0;
    font-style: italic;
    color: #5e341c;
}

/* === OBRAZY I MULTIMEDIA === */

/* Obrazy standardowe */
.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    margin: 30px 0;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

/* ========================================
   KLUCZOWA POPRAWKA: EMOJI I EMOTIKONY
   ======================================== */

/* Emoji WordPress i standardowe emotikony */
.entry-content img.emoji,
.entry-content img.wp-smiley,
.entry-content img[style*="width: 1em"],
.entry-content img[style*="height: 1em"],
.entry-content img[src*="emoji"],
.entry-content img[src*="smilies"],
.entry-content img[class*="emoji"] {
    display: inline !important;
    width: 1.2em !important;
    height: 1.2em !important;
    max-width: 1.2em !important;
    max-height: 1.2em !important;
    margin: 0 0.15em 0 0.05em !important;
    padding: 0 !important;
    vertical-align: -0.1em !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: none !important;
}

/* Fix dla emoji w paragrafach */
.entry-content p img.emoji,
.entry-content p img.wp-smiley,
.entry-content p img[style*="width: 1em"],
.entry-content p img[src*="emoji"] {
    display: inline !important;
    margin: 0 0.15em 0 0.05em !important;
}

/* Fix dla emoji w nagłówkach */
.entry-content h1 img.emoji,
.entry-content h2 img.emoji,
.entry-content h3 img.emoji,
.entry-content h4 img.emoji,
.entry-content h5 img.emoji,
.entry-content h6 img.emoji,
.entry-content h1 img.wp-smiley,
.entry-content h2 img.wp-smiley,
.entry-content h3 img.wp-smiley,
.entry-content h4 img.wp-smiley,
.entry-content h5 img.wp-smiley,
.entry-content h6 img.wp-smiley {
    display: inline !important;
    margin: 0 0.15em 0 0.05em !important;
    vertical-align: -0.1em !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Fix dla emoji w listach */
.entry-content li img.emoji,
.entry-content li img.wp-smiley,
.entry-content li img[src*="emoji"] {
    display: inline !important;
    width: 1.2em !important;
    height: 1.2em !important;
    margin: 0 0.15em 0 0.05em !important;
    vertical-align: -0.1em !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* Gutenberg emoji support */
.entry-content .wp-block-image img.emoji,
.entry-content .wp-block-paragraph img.emoji,
.entry-content .wp-block-heading img.emoji {
    display: inline !important;
    margin: 0 0.15em 0 0.05em !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

/* ======================================== */

/* Figure (obrazy z podpisami) - pozostają jako blok */
.entry-content figure {
    margin: 30px 0;
}

.entry-content figure img {
    display: block !important;
    margin: 0 auto !important;
}

.entry-content figcaption {
    text-align: center;
    font-size: 14px;
    color: #999;
    margin-top: 10px;
    font-style: italic;
}

.entry-content pre {
    background: #2a2a2a;
    color: #f5f5f5;
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 25px 0;
    font-size: 14px;
    line-height: 1.6;
}

.entry-content code {
    background: #f5f0e8;
    color: #ef6341;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
}

.entry-content pre code {
    background: transparent;
    color: inherit;
    padding: 0;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 15px;
}

.entry-content table th,
.entry-content table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #f5f0e8;
}

.entry-content table th {
    background: #f5f0e8;
    color: #5e341c;
    font-weight: 600;
}

/* === FOOTER POSTA === */
.entry-footer {
    margin-top: 50px;
    padding-top: 30px;
    border-top: 2px solid #f5f0e8;
}

.post-tags {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-bottom: 25px;
}

.post-tags svg {
    fill: #ef6341;
}

.tag-link {
    display: inline-block;
    padding: 6px 16px;
    background: #f5f0e8;
    color: #5e341c;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s;
}

.tag-link:hover {
    background: #ef6341;
    color: white;
}

.post-share {
    display: flex;
    align-items: center;
    gap: 15px;
    font-size: 15px;
    font-weight: 600;
    color: #5e341c;
}

.share-link {
    width: 40px;
    height: 40px;
    background: #f5f0e8;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    text-decoration: none;
}

.share-link:hover {
    background: #ef6341;
    transform: translateY(-3px);
}

.share-link svg {
    width: 18px;
    height: 18px;
    fill: #5e341c;
    transition: fill 0.3s;
}

.share-link:hover svg {
    fill: white;
}

/* === PAGE LINKS (dla długich postów) === */
.page-links {
    margin: 40px 0;
    padding: 20px;
    background: #f5f0e8;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
}

.page-links a {
    display: inline-block;
    padding: 8px 16px;
    margin: 0 5px;
    background: white;
    color: #5e341c;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.3s;
}

.page-links a:hover {
    background: #ef6341;
    color: white;
}

/* ====================================
   SEKCJE PO ARTYKULE
   ==================================== */

/* === WRAPPER DLA WSZYSTKICH SEKCJI === */
.author-bio,
.related-posts,
.comments-wrapper,
.comments-area,
.comment-respond,
#respond {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* KRYTYCZNE: Comments wrapper dziedziczy szerokość */
.comments-wrapper {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Wszystko wewnątrz comments-wrapper też musi być ograniczone */
.comments-wrapper > * {
    max-width: 100%;
}

/* POPRAWKA: Dodatkowe elementy związane z komentarzami */
.single .comment-navigation,
.single .comments-title,
.single .comment-list,
.single .no-comments {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

/* === AUTHOR BIO === */
.author-bio {
    display: flex;
    gap: 25px;
    align-items: flex-start;
    padding: 30px;
    background: #f5f0e8;
    border-radius: 16px;
    margin-top: 60px;
    margin-bottom: 60px;
}

.author-avatar {
    flex-shrink: 0;
}

.author-avatar img {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid white;
}

.author-info {
    flex: 1;
}

.author-name {
    font-size: 20px;
    font-weight: 700;
    color: #5e341c;
    margin: 0 0 10px 0;
}

.author-description {
    font-size: 15px;
    line-height: 1.6;
    color: #666;
    margin: 0;
}

/* === RELATED POSTS (POWIĄZANE ARTYKUŁY) === */
.related-posts {
    margin-top: 60px;
    margin-bottom: 60px;
}

.related-title {
    font-size: 32px;
    font-weight: 700;
    color: #5e341c;
    margin-bottom: 35px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.related-post-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
}

.related-post-card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.related-thumbnail {
    width: 100%;
    height: 180px;
    overflow: hidden;
    position: relative;
}

.related-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-card:hover .related-thumbnail img {
    transform: scale(1.05);
}

.related-content {
    padding: 20px;
}

.related-content h3 {
    font-size: 18px;
    font-weight: 600;
    color: #5e341c;
    margin: 0 0 10px 0;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.related-post-card:hover .related-content h3 {
    color: #ef6341;
}

.related-date {
    font-size: 13px;
    color: #999;
    font-weight: 500;
}

/* ====================================
   COMMENTS (KOMENTARZE)
   ==================================== */

.comments-area {
    margin-top: 60px;
    margin-bottom: 60px;
    padding: 40px;
    background: #f5f0e8;
    border-radius: 16px;
    width: 100%;
    box-sizing: border-box;
}

/* POPRAWKA: Gdy komentarze są w wrapperze */
.comments-wrapper .comments-area {
    max-width: 100%;
    margin-left: 0;
    margin-right: 0;
}

.comments-title {
    font-size: 28px;
    font-weight: 700;
    color: #5e341c;
    margin: 0 0 30px 0;
}

/* === LISTA KOMENTARZY === */
.comment-list {
    list-style: none;
    padding: 0;
    margin: 0 0 30px 0;
}

.comment {
    background: white;
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.comment:last-child {
    margin-bottom: 0;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 15px;
}

.comment-author .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid #f5f0e8;
}

.comment-author .fn {
    font-size: 16px;
    font-weight: 600;
    color: #5e341c;
    font-style: normal;
}

.comment-metadata {
    font-size: 13px;
    color: #999;
    margin-bottom: 15px;
}

.comment-metadata a {
    color: #999;
    text-decoration: none;
}

.comment-metadata a:hover {
    color: #ef6341;
}

.comment-content {
    font-size: 15px;
    line-height: 1.6;
    color: #333;
}

.comment-content p {
    margin: 0 0 15px 0;
}

.comment-content p:last-child {
    margin-bottom: 0;
}

.reply {
    margin-top: 15px;
}

.comment-reply-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #ef6341;
    color: white;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.comment-reply-link:hover {
    background: #d94f2e;
    transform: translateY(-2px);
}

/* ====================================
   COMMENT FORM (FORMULARZ KOMENTARZA)
   ==================================== */

/* Główny kontener formularza - standalone */
#respond {
    max-width: 900px;
    margin: 40px auto 0;
    padding: 0 20px;
}

/* POPRAWKA: Gdy #respond jest WEWNĄTRZ .comments-area lub .comments-wrapper */
.comments-area #respond,
.comments-wrapper #respond {
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
}

/* KRYTYCZNA POPRAWKA: Główny kontener dla single post */
.single .site-main,
.single-post .site-main {
    width: 100%;
    margin: 0 auto;
    padding: 0; /* Bez paddingu - każdy element dziecko sam zarządza paddingiem */
}

/* Wszystkie bezpośrednie dzieci .site-main w single post mają max-width 900px */
.single .site-main > article,
.single .site-main > .author-bio,
.single .site-main > .related-posts,
.single .site-main > .comments-wrapper,
.single .site-main > .comments-area,
.single .site-main > #respond,
.single-post .site-main > article,
.single-post .site-main > .author-bio,
.single-post .site-main > .related-posts,
.single-post .site-main > .comments-wrapper,
.single-post .site-main > .comments-area,
.single-post .site-main > #respond {
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

/* MEGA WAŻNE: Jeśli comments-area jest w comments-wrapper */
.comments-wrapper .comments-area,
.comments-wrapper #respond {
    max-width: 100% !important;
    padding-left: 0 !important;
    padding-right: 0 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}

.comment-respond {
    padding-top: 40px;
    border-top: 2px solid rgba(94, 52, 28, 0.1);
}

.comment-reply-title {
    font-size: 24px;
    font-weight: 700;
    color: #5e341c;
    margin: 0 0 25px 0;
}

.comment-form {
    display: grid;
    gap: 20px;
}

.comment-form-author,
.comment-form-email,
.comment-form-url,
.comment-form-comment {
    margin: 0;
}

.comment-form label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #5e341c;
    margin-bottom: 8px;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: 'Plus Jakarta Sans', sans-serif;
    transition: border-color 0.3s ease;
}

.comment-form input:focus,
.comment-form textarea:focus {
    outline: none;
    border-color: #ef6341;
}

.comment-form textarea {
    min-height: 150px;
    resize: vertical;
}

.form-submit {
    margin: 0;
}

.submit {
    display: inline-block;
    padding: 14px 32px;
    background: #ef6341;
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.submit:hover {
    background: #d94f2e;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(239, 99, 65, 0.3);
}

/* ====================================
   RESPONSYWNOŚĆ
   ==================================== */

@media (max-width: 768px) {
    .single-post-content {
        padding: 40px 20px;
    }

    .entry-title {
        font-size: 32px;
    }

    .entry-content {
        font-size: 15px;
    }

    .entry-content h2 {
        font-size: 26px;
    }

    .entry-content h3 {
        font-size: 23px;
    }

    .entry-content h4 {
        font-size: 20px;
    }

    .entry-meta {
        gap: 15px;
        font-size: 13px;
    }

    .post-share {
        flex-direction: column;
        align-items: flex-start;
    }
    
    /* === RESPONSIVE: Sekcje po artykule === */
    .author-bio,
    .related-posts,
    .comments-wrapper,
    .comments-area,
    #respond,
    .single .site-main > * {
        max-width: 100%;
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .comments-wrapper {
        padding-left: 20px;
        padding-right: 20px;
    }
    
    .author-bio {
        flex-direction: column;
        text-align: center;
        padding: 25px 20px;
    }
    
    .author-avatar {
        margin: 0 auto;
    }
    
    .related-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .related-title {
        font-size: 26px;
        margin-bottom: 25px;
    }
    
    .comments-area {
        padding: 25px 20px;
    }
    
    .comments-title {
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .comment {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .entry-title {
        font-size: 28px;
    }

    .entry-content {
        font-size: 14px;
    }

    .entry-content table {
        font-size: 13px;
    }

    .entry-content table th,
    .entry-content table td {
        padding: 8px 10px;
    }
    
    .related-content h3 {
        font-size: 16px;
    }
    
    .comment-author {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
}