/**
 * Blog Post Styling
 * Welt.de-inspired Paywall Design
 */

/* ===========================
   SITE NAVIGATION - NOW IN components.css
   =========================== */

/* ===========================
   BLOG POST CONTAINER
   =========================== */

.blog-post-container {
    padding: 60px 0;
    min-height: calc(100vh - 300px);
}

.blog-post {
    max-width: 800px;
    margin: 0 auto;
    background: var(--color-bg-section);
    padding: 60px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

@media (max-width: 768px) {
    .blog-post {
        padding: 30px 20px;
    }

    .blog-post-container {
        padding: 30px 0;
    }
}

/* ===========================
   POST HEADER
   =========================== */

.post-header {
    margin-bottom: 40px;
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 30px;
}

/* Header Banner Image */
.post-header-banner {
    width: 100%;
    max-height: 400px;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .post-header-banner {
        max-height: 250px;
        border-radius: 4px;
        margin-bottom: 20px;
    }
}

.post-meta {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.post-meta .separator {
    color: var(--color-border);
}

.post-header h1 {
    font-size: 2.5rem;
    line-height: 1.2;
    margin-bottom: 15px;
    color: var(--color-text-primary);
}

@media (max-width: 768px) {
    .post-header h1 {
        font-size: 1.8rem;
    }
}

.excerpt {
    font-size: 1.2rem;
    color: var(--color-text-secondary);
    font-style: italic;
    margin-bottom: 20px;
}

.post-tags {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.tag {
    background: rgba(196, 30, 58, 0.2);
    color: var(--color-accent-coral);
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    border: 1px solid rgba(196, 30, 58, 0.3);
}

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

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--color-text-primary);
}

.post-content h2 {
    font-size: 1.8rem;
    margin-top: 40px;
    margin-bottom: 20px;
    color: var(--color-secondary);
}

.post-content h3 {
    font-size: 1.4rem;
    margin-top: 30px;
    margin-bottom: 15px;
    color: var(--color-accent-coral);
}

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

.post-content strong {
    color: var(--color-text-primary);
    font-weight: 600;
}

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

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

.post-content hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 40px 0;
}

.post-content a {
    color: var(--color-secondary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.post-content a:hover {
    color: var(--color-accent-coral);
}

/* Teaser Section */
.post-content.teaser {
    margin-bottom: 0;
    position: relative;
}

/* ===========================
   PAYWALL (Welt.de-Style)
   =========================== */

.paywall {
    position: relative;
    margin: 0 -60px 60px -60px; /* Extend to full width of blog-post */
    padding: 0 60px;
}

@media (max-width: 768px) {
    .paywall {
        margin: 0 -20px 40px -20px;
        padding: 0 20px;
    }
}

/* Blur Gradient Overlay */
.blur-overlay {
    position: absolute;
    top: -180px;
    left: 0;
    right: 0;
    height: 280px;
    background: linear-gradient(
        to bottom,
        rgba(45, 10, 10, 0) 0%,
        rgba(45, 10, 10, 0.4) 30%,
        rgba(45, 10, 10, 0.85) 70%,
        rgba(45, 10, 10, 1) 100%
    );
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    pointer-events: none;
    z-index: 1;
}

/* Paywall Box */
.paywall-box {
    position: relative;
    z-index: 2;
    background: linear-gradient(
        135deg,
        rgba(196, 30, 58, 0.15) 0%,
        rgba(45, 10, 10, 0.95) 50%
    );
    border: 2px solid var(--color-secondary);
    border-radius: 12px;
    padding: 50px;
    max-width: 600px;
    margin: 80px auto 0 auto;
    text-align: center;
    box-shadow: 0 8px 32px rgba(196, 30, 58, 0.3);
    backdrop-filter: blur(10px);
}

@media (max-width: 768px) {
    .paywall-box {
        padding: 30px 20px;
        margin: 40px auto 0 auto;
    }
}

.paywall-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    filter: drop-shadow(0 4px 8px rgba(196, 30, 58, 0.5));
}

.paywall-box h3 {
    color: var(--color-secondary);
    font-size: 1.6rem;
    margin-bottom: 15px;
}

.paywall-box > p {
    color: var(--color-text-secondary);
    margin-bottom: 25px;
    font-size: 1rem;
}

/* Paywall Form */
#blog-unlock-form {
    margin: 30px 0;
}

#blog-unlock-form input[type="email"] {
    width: 100%;
    padding: 16px 20px;
    margin-bottom: 15px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    background: rgba(26, 0, 0, 0.6);
    color: var(--color-text-primary);
    font-size: 1rem;
    transition: border-color 0.3s ease, background 0.3s ease;
}

#blog-unlock-form input[type="email"]:focus {
    outline: none;
    border-color: var(--color-secondary);
    background: rgba(26, 0, 0, 0.8);
}

#blog-unlock-form button {
    width: 100%;
    padding: 16px 30px;
    background: var(--color-secondary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: bold;
    font-size: 1rem;
    transition: background 0.3s ease, transform 0.2s ease;
}

#blog-unlock-form button:hover {
    background: var(--color-accent-coral);
    transform: translateY(-2px);
}

#blog-unlock-form button:active {
    transform: translateY(0);
}

#blog-unlock-form button:disabled {
    background: #666;
    cursor: not-allowed;
    transform: none;
}

/* Paywall Help Text */
.paywall-help {
    margin: 25px 0;
    font-size: 0.95rem;
    color: var(--color-text-secondary);
}

.paywall-help a {
    color: var(--color-secondary);
    text-decoration: underline;
    transition: color 0.3s ease;
}

.paywall-help a:hover {
    color: var(--color-accent-coral);
}

/* Paywall Note */
.paywall-note {
    margin-top: 25px;
    padding: 20px;
    background: rgba(255, 215, 0, 0.1);
    border: 1px solid rgba(255, 215, 0, 0.3);
    border-radius: 6px;
    font-size: 0.9rem;
    line-height: 1.6;
    text-align: left;
    color: var(--color-text-secondary);
}

/* ===========================
   FULL CONTENT (Hidden by default)
   =========================== */

.full-content {
    display: none;
    animation: fadeIn 0.5s ease-in;
}

.full-content.unlocked {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===========================
   POST FOOTER
   =========================== */

.post-footer {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 2px solid var(--color-border);
}

/* Share Buttons */
.share-buttons {
    margin-bottom: 40px;
}

.share-buttons h4 {
    font-size: 1.1rem;
    margin-bottom: 15px;
    color: var(--color-text-secondary);
}

.share-btn {
    display: inline-block;
    padding: 10px 20px;
    margin-right: 10px;
    margin-bottom: 10px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.share-btn.linkedin {
    background: #0077B5;
    color: white;
}

.share-btn.twitter {
    background: #1DA1F2;
    color: white;
}

.share-btn.email {
    background: #666;
    color: white;
}

/* Newsletter CTA */
.newsletter-cta {
    background: linear-gradient(
        135deg,
        rgba(196, 30, 58, 0.15) 0%,
        rgba(45, 10, 10, 0.8) 100%
    );
    border: 2px solid var(--color-secondary);
    border-radius: 8px;
    padding: 30px;
    text-align: center;
}

.newsletter-cta h4 {
    font-size: 1.3rem;
    margin-bottom: 10px;
    color: var(--color-secondary);
}

.newsletter-cta p {
    margin-bottom: 20px;
    color: var(--color-text-secondary);
}

.btn-cta {
    display: inline-block;
    padding: 16px 32px;
    background: var(--color-secondary);
    color: white !important;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    z-index: 1;
}

.btn-cta:hover {
    background: var(--color-primary);
    color: white !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(196, 30, 58, 0.5);
}

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

.related-posts {
    margin-top: 60px;
    padding: 40px;
    background: rgba(45, 10, 10, 0.5);
    border-radius: 8px;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.related-posts h3 {
    font-size: 1.5rem;
    margin-bottom: 25px;
    color: var(--color-secondary);
}

.related-posts-grid {
    display: grid;
    gap: 20px;
}

.related-post-card {
    background: var(--color-bg-section);
    padding: 25px;
    border-radius: 6px;
    border: 1px solid var(--color-border);
    text-decoration: none;
    display: block;
    transition: border-color 0.3s ease, transform 0.2s ease;
}

.related-post-card:hover {
    border-color: var(--color-secondary);
    transform: translateY(-4px);
}

.related-post-card h4 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--color-text-primary);
}

.related-post-card p {
    color: var(--color-text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* ===========================
   UNLOCK SUCCESS MESSAGE
   =========================== */

.unlock-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #4CAF50;
    color: white;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .unlock-success {
        top: 10px;
        right: 10px;
        left: 10px;
        text-align: center;
    }
}

/* ===========================
   SUBSCRIBER STATE SYSTEM
   Clean CSS-based visibility control
   =========================== */

/**
 * ARCHITECTURE:
 * - body gets class "subscriber" when cookie exists
 * - All CTAs/paywalls tagged with .subscriber-only or .non-subscriber-only
 * - CSS handles ALL visibility automatically
 * - No JavaScript DOM manipulation needed!
 */

/* Default: Hide subscriber-only content */
.subscriber-only {
    display: none !important;
}

/* When user is subscriber: Hide all non-subscriber CTAs */
body.subscriber .non-subscriber-only {
    display: none !important;
}

/* When user is subscriber: Show subscriber-only content */
body.subscriber .subscriber-only {
    display: block !important;
}
