/**
 * Blog Single Post Styles
 *
 * Hero-Layout mit Featured Image, optimierter Typografie,
 * Author-Box und Related Posts.
 *
 * @package Yusuf-Theme
 * @since 1.0.0
 */

/* ========================================
   SINGLE POST CONTAINER
   ======================================== */

.single-post {
    background: var(--color-background);
}

.single-post-content {
    padding: var(--spacing-lg) var(--spacing-md);
    max-width: 680px;
    margin: 0 auto;
}

/* ========================================
   FEATURED IMAGE HERO
   ======================================== */

.single-post > .wp-block-post-featured-image,
.single-post .wp-block-post-featured-image.single-hero {
    margin-top: 80px;
    max-height: 500px;
    overflow: hidden;
    width: 100%;
}

.single-post > .wp-block-post-featured-image img,
.single-post .wp-block-post-featured-image.single-hero img {
    width: 100%;
    height: 100%;
    max-height: 500px;
    object-fit: cover;
}

/* Fallback wenn kein Featured Image */
.single-post-content.no-featured-image {
    padding-top: calc(80px + var(--spacing-lg));
}

/* ========================================
   POST META BAR
   ======================================== */

.post-meta-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem 1rem;
    margin-bottom: var(--spacing-md);
    font-family: var(--font-ui);
    font-size: 0.85rem;
    color: var(--color-text-light);
}

/* Kategorie-Tag */
.post-meta-bar .wp-block-post-terms,
.post-meta-bar .post-category-tag {
    margin: 0;
}

.post-meta-bar .wp-block-post-terms a,
.post-category-tag a {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: background 0.3s ease;
}

.post-meta-bar .wp-block-post-terms a:hover,
.post-category-tag a:hover {
    background: var(--color-primary-light);
    color: var(--color-white);
}

/* Datum */
.post-meta-bar .wp-block-post-date {
    margin: 0;
}

/* Lesezeit */
.post-meta-bar .reading-time {
    margin: 0;
}

/* Trennpunkte zwischen Meta-Elementen */
.post-meta-bar > *:not(:first-child):not(.wp-block-post-terms)::before {
    content: '•';
    margin-right: 1rem;
    color: var(--color-text-light);
}

/* ========================================
   POST TITLE
   ======================================== */

.single-post-content .wp-block-post-title,
.single-post-title {
    font-family: var(--font-heading);
    font-size: clamp(1.75rem, 5vw, 2.5rem);
    font-weight: 400;
    text-align: center;
    line-height: 1.3;
    letter-spacing: 0.02em;
    color: var(--color-primary);
    margin: 0 auto var(--spacing-md);
    max-width: 900px;
}

/* ========================================
   SEPARATOR
   ======================================== */

.single-post-content .wp-block-separator {
    border: none;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    margin: var(--spacing-md) auto;
    max-width: 200px;
    opacity: 1;
}

.single-post-content .wp-block-separator.is-style-wide {
    max-width: 100%;
}

/* ========================================
   POST CONTENT TYPOGRAPHY
   ======================================== */

.single-post-content .wp-block-post-content,
.single-post-content .entry-content {
    font-size: 1.125rem;
    line-height: 1.8;
}

.single-post-content .wp-block-post-content p,
.single-post-content .entry-content p {
    margin-bottom: 1.5rem;
}

/* Headings im Content */
.single-post-content .wp-block-post-content h2,
.single-post-content .entry-content h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2rem);
    margin-top: var(--spacing-lg);
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.single-post-content .wp-block-post-content h3,
.single-post-content .entry-content h3 {
    font-family: var(--font-heading);
    font-size: clamp(1.25rem, 3vw, 1.5rem);
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-sm);
    color: var(--color-primary);
}

.single-post-content .wp-block-post-content h4,
.single-post-content .entry-content h4 {
    font-family: var(--font-ui);
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: var(--spacing-md);
    margin-bottom: var(--spacing-xs);
    color: var(--color-primary);
}

/* Blockquote */
.single-post-content blockquote,
.single-post-content .wp-block-quote {
    border-left: 4px solid var(--color-primary);
    padding-left: var(--spacing-md);
    margin: var(--spacing-md) 0;
    font-style: italic;
    color: var(--color-text-light);
}

.single-post-content .wp-block-quote p {
    margin-bottom: 0.5rem;
}

.single-post-content .wp-block-quote cite {
    display: block;
    font-size: 0.9rem;
    font-style: normal;
    color: var(--color-text-light);
    margin-top: 0.5rem;
}

/* Listen */
.single-post-content ul,
.single-post-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.single-post-content li {
    margin-bottom: 0.5rem;
    line-height: 1.7;
}

/* Links im Content */
.single-post-content .wp-block-post-content a,
.single-post-content .entry-content a {
    color: var(--color-primary);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color 0.3s ease;
}

.single-post-content .wp-block-post-content a:hover,
.single-post-content .entry-content a:hover {
    color: var(--color-primary-light);
}

/* Bilder im Content */
.single-post-content .wp-block-image {
    margin: var(--spacing-md) 0;
}

.single-post-content .wp-block-image img {
    border-radius: 8px;
}

.single-post-content .wp-block-image figcaption {
    font-size: 0.85rem;
    color: var(--color-text-light);
    text-align: center;
    margin-top: 0.5rem;
}

/* ========================================
   AUTHOR BOX
   ======================================== */

.author-box {
    background: var(--color-background-light);
    border-radius: 12px;
    padding: var(--spacing-md);
    margin: var(--spacing-lg) 0;
}

.author-box .wp-block-post-author {
    display: flex;
    align-items: flex-start;
    gap: var(--spacing-md);
}

.author-box .wp-block-post-author__avatar {
    flex-shrink: 0;
}

.author-box .wp-block-post-author__avatar img {
    border-radius: 50%;
    width: 80px;
    height: 80px;
    object-fit: cover;
}

.author-box .wp-block-post-author__content {
    flex: 1;
}

.author-box .wp-block-post-author__name {
    font-family: var(--font-ui);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    display: block;
}

.author-box .wp-block-post-author__name a {
    color: inherit;
    text-decoration: none;
}

.author-box .wp-block-post-author__name a:hover {
    color: var(--color-primary-light);
}

.author-box .wp-block-post-author__bio {
    font-size: 0.9rem;
    color: var(--color-text-light);
    line-height: 1.6;
    margin: 0;
}

/* Author Box Header */
.author-box-header {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text-light);
    margin-bottom: var(--spacing-sm);
}

/* ========================================
   RELATED POSTS
   ======================================== */

.related-posts {
    margin-top: var(--spacing-xl);
    padding-top: var(--spacing-lg);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.related-posts > h3,
.related-posts-title {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 4vw, 2rem);
    text-align: center;
    color: var(--color-primary);
    margin-bottom: var(--spacing-lg);
    letter-spacing: 0.02em;
}

/* Related Posts Grid */
.related-posts .wp-block-post-template,
.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Einzelne Related Post Card */
.related-posts .wp-block-post,
.related-post-card {
    background: var(--color-white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.related-posts .wp-block-post:hover,
.related-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 16px 40px rgba(2, 66, 107, 0.15);
}

/* Related Post Featured Image */
.related-posts .wp-block-post-featured-image,
.related-post-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    margin: 0;
    position: relative;
}

.related-posts .wp-block-post-featured-image::after,
.related-post-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.1) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
}

.related-post-card:hover .wp-block-post-featured-image::after,
.related-post-card:hover .related-post-image::after {
    opacity: 1;
}

.related-posts .wp-block-post-featured-image img,
.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.related-posts .wp-block-post:hover .wp-block-post-featured-image img,
.related-post-card:hover .wp-block-post-featured-image img,
.related-post-card:hover .related-post-image img {
    transform: scale(1.08);
}

/* Related Post Content Container */
.related-post-content {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    gap: 0.5rem;
}

/* Related Post Category Badge */
.related-post-category,
.related-posts .wp-block-post-terms {
    margin: 0;
}

.related-post-category a,
.related-posts .wp-block-post-terms a {
    display: inline-block;
    background: var(--color-primary);
    color: var(--color-white);
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-family: var(--font-ui);
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease;
}

.related-post-category a:hover,
.related-posts .wp-block-post-terms a:hover {
    background: var(--color-primary-light);
    transform: translateY(-1px);
}

/* Related Post Title */
.related-post-title,
.related-posts .wp-block-post-title {
    font-family: var(--font-ui);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0;
    flex-grow: 1;
}

.related-post-title a,
.related-posts .wp-block-post-title a {
    color: var(--color-text);
    text-decoration: none;
    transition: color 0.3s ease;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-post-title a:hover,
.related-posts .wp-block-post-title a:hover {
    color: var(--color-primary);
}

/* Related Post Date */
.related-post-date,
.related-posts .wp-block-post-date {
    font-family: var(--font-ui);
    font-size: 0.75rem;
    color: var(--color-text-light);
    margin: 0;
    padding-top: 0.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
    margin-top: auto;
}

/* ========================================
   BACK TO BLOG LINK
   ======================================== */

.back-to-blog {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
}

.back-to-blog a {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-ui);
    font-weight: 500;
    font-size: 0.95rem;
    color: var(--color-primary);
    text-decoration: none;
    transition: transform 0.3s ease, color 0.3s ease;
}

.back-to-blog a:hover {
    color: var(--color-primary-light);
    transform: translateX(-4px);
}

/* ========================================
   POST NAVIGATION (Prev/Next)
   ======================================== */

.post-navigation {
    display: flex;
    justify-content: space-between;
    gap: var(--spacing-md);
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-md);
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.post-navigation a {
    font-family: var(--font-ui);
    font-size: 0.9rem;
    color: var(--color-primary);
    text-decoration: none;
}

.post-navigation a:hover {
    color: var(--color-primary-light);
}

/* ========================================
   RESPONSIVE: TABLET (768px)
   ======================================== */

/* Tablet: 2 Spalten */
@media (max-width: 1024px) {
    .related-posts .wp-block-post-template,
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    /* Featured Image */
    .single-post > .wp-block-post-featured-image,
    .single-post .wp-block-post-featured-image.single-hero {
        max-height: 350px;
    }

    .single-post > .wp-block-post-featured-image img,
    .single-post .wp-block-post-featured-image.single-hero img {
        max-height: 350px;
    }

    /* Content */
    .single-post-content {
        padding: var(--spacing-md) var(--spacing-sm);
    }

    /* Related Posts: 1 Spalte */
    .related-posts .wp-block-post-template,
    .related-posts-grid {
        grid-template-columns: 1fr;
        max-width: 450px;
        margin: 0 auto;
        gap: var(--spacing-sm);
    }

    .related-posts-title {
        font-size: 1.5rem;
        margin-bottom: var(--spacing-md);
    }

    .related-post-card {
        border-radius: 10px;
    }

    .related-post-title,
    .related-posts .wp-block-post-title {
        font-size: 0.95rem;
    }

    /* Author Box: Vertikal */
    .author-box .wp-block-post-author {
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .author-box .wp-block-post-author__avatar {
        margin-bottom: var(--spacing-sm);
    }
}

/* ========================================
   RESPONSIVE: MOBILE (480px)
   ======================================== */

@media (max-width: 480px) {
    /* Featured Image */
    .single-post > .wp-block-post-featured-image,
    .single-post .wp-block-post-featured-image.single-hero {
        max-height: 250px;
        margin-top: 70px;
    }

    .single-post > .wp-block-post-featured-image img,
    .single-post .wp-block-post-featured-image.single-hero img {
        max-height: 250px;
    }

    /* Title */
    .single-post-content .wp-block-post-title,
    .single-post-title {
        font-size: 1.5rem;
    }

    /* Content Typography */
    .single-post-content .wp-block-post-content,
    .single-post-content .entry-content {
        font-size: 1rem;
    }

    /* Meta Bar */
    .post-meta-bar {
        font-size: 0.8rem;
    }

    /* Author Box */
    .author-box {
        padding: var(--spacing-sm);
    }

    .author-box .wp-block-post-author__avatar img {
        width: 60px;
        height: 60px;
    }

    .author-box .wp-block-post-author__name {
        font-size: 1rem;
    }

    .author-box .wp-block-post-author__bio {
        font-size: 0.85rem;
    }

    /* Related Posts Title */
    .related-posts > h3,
    .related-posts-title {
        font-size: 1.25rem;
    }
}

/* ========================================
   PRINT STYLES
   ======================================== */

@media print {
    .single-post > .wp-block-post-featured-image {
        max-height: 300px;
        margin-top: 0;
    }

    .author-box {
        border: 1px solid #ccc;
        background: none;
    }

    .related-posts,
    .back-to-blog {
        display: none;
    }
}
