/*
 * ZIMM Post Templates - Master Stylesheet
 * Version 1.0.0
 * Responsive, mobile-first design with sidebar
 */

/* ==========================================================================
   CSS Reset & Base
   ========================================================================== */

.zimm-post-wrapper *,
.zimm-post-wrapper *::before,
.zimm-post-wrapper *::after {
    box-sizing: border-box;
}

.zimm-post-wrapper {
    font-family: var(--zimm-font, 'Inter', -apple-system, BlinkMacSystemFont, sans-serif);
    line-height: 1.7;
    color: #1f2937;
    background: #f8fafc;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Layout Container - Desktop with Sidebar
   ========================================================================== */

.zimm-post-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 40px;
    align-items: start;
}

@media (max-width: 1024px) {
    .zimm-post-container {
        grid-template-columns: 1fr;
        max-width: 800px;
        padding: 20px 16px;
    }
}

/* ==========================================================================
   Main Article Content
   ========================================================================== */

.zimm-post-content {
    background: #ffffff;
    border-radius: 16px;
    padding: 48px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@media (max-width: 768px) {
    .zimm-post-content {
        padding: 24px 20px;
        border-radius: 12px;
    }
}

/* Typography */
.zimm-post-content h1 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    font-weight: 800;
    line-height: 1.2;
    margin: 0 0 24px 0;
    color: #0f172a;
    letter-spacing: -0.02em;
}

.zimm-post-content h2 {
    font-size: clamp(1.35rem, 3vw, 1.75rem);
    font-weight: 700;
    line-height: 1.3;
    margin: 48px 0 20px 0;
    padding-bottom: 12px;
    color: #1e293b;
    border-bottom: 3px solid var(--zimm-primary, #2563eb);
    position: relative;
}

.zimm-post-content h2::before {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--zimm-accent, #3b82f6);
}

.zimm-post-content h3 {
    font-size: clamp(1.1rem, 2.5vw, 1.35rem);
    font-weight: 600;
    line-height: 1.4;
    margin: 32px 0 16px 0;
    color: #334155;
}

.zimm-post-content p {
    font-size: 1.05rem;
    margin: 0 0 20px 0;
    color: #475569;
}

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

.zimm-post-content li {
    margin-bottom: 8px;
    color: #475569;
}

.zimm-post-content a {
    color: var(--zimm-primary, #2563eb);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.zimm-post-content a:hover {
    color: var(--zimm-secondary, #1e40af);
    text-decoration: underline;
}

/* ==========================================================================
   ENHANCED AMAZON PRODUCT BOX - Premium Design
   ========================================================================== */

.zimm-product-box {
    position: relative;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 20px;
    padding: 0;
    margin: 40px 0;
    overflow: hidden;
    box-shadow:
        0 10px 40px -10px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.zimm-product-box:hover {
    transform: translateY(-4px);
    box-shadow:
        0 20px 60px -15px rgba(0, 0, 0, 0.2),
        0 0 0 1px rgba(0, 0, 0, 0.05);
}

/* Rank Badge */
.zimm-product-rank {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 10;
}

.zimm-rank-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.zimm-rank-1 { background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%); color: #78350f; }
.zimm-rank-2 { background: linear-gradient(135deg, #9ca3af 0%, #6b7280 100%); color: #ffffff; }
.zimm-rank-3 { background: linear-gradient(135deg, #34d399 0%, #10b981 100%); color: #064e3b; }
.zimm-rank-default { background: var(--zimm-gradient); color: #ffffff; }

/* Product Header */
.zimm-product-header {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 30px;
    padding: 30px;
    background: #ffffff;
    border-bottom: 1px solid #e2e8f0;
}

@media (max-width: 640px) {
    .zimm-product-header {
        grid-template-columns: 1fr;
        text-align: center;
        padding: 20px;
    }
}

.zimm-product-image {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 12px;
    padding: 16px;
    aspect-ratio: 1;
    overflow: hidden;
}

.zimm-product-image img {
    max-width: 100%;
    max-height: 180px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.zimm-product-box:hover .zimm-product-image img {
    transform: scale(1.05);
}

.zimm-product-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-top: 20px;
}

.zimm-product-title {
    font-size: 1.35rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.zimm-product-brand {
    font-size: 0.95rem;
    color: #64748b;
    margin: 0 0 16px 0;
}

.zimm-product-brand strong {
    color: #475569;
}

/* Rating Stars */
.zimm-product-rating {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.zimm-stars {
    display: flex;
    gap: 2px;
}

.zimm-star {
    width: 20px;
    height: 20px;
    color: #fbbf24;
}

.zimm-star-empty {
    color: #e2e8f0;
}

.zimm-rating-text {
    font-size: 0.9rem;
    color: #64748b;
}

.zimm-rating-score {
    font-weight: 700;
    color: #0f172a;
}

/* Price & CTA */
.zimm-product-pricing {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.zimm-price {
    font-size: 2rem;
    font-weight: 800;
    color: var(--zimm-primary, #2563eb);
}

.zimm-cta-button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--zimm-gradient);
    color: #ffffff !important;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    text-decoration: none !important;
    transition: all 0.3s ease;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.zimm-cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
    color: #ffffff !important;
    text-decoration: none !important;
}

.zimm-cta-button svg {
    width: 18px;
    height: 18px;
    transition: transform 0.3s ease;
}

.zimm-cta-button:hover svg {
    transform: translateX(4px);
}

/* Product Body - Features, Pros/Cons */
.zimm-product-body {
    padding: 30px;
}

@media (max-width: 640px) {
    .zimm-product-body {
        padding: 20px;
    }
}

/* Key Features */
.zimm-features {
    margin-bottom: 30px;
}

.zimm-features-title {
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--zimm-primary, #2563eb);
    margin: 0 0 16px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zimm-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 12px;
}

.zimm-feature-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #f1f5f9;
    border-radius: 10px;
    font-size: 0.9rem;
    color: #334155;
}

.zimm-feature-icon {
    width: 20px;
    height: 20px;
    color: var(--zimm-primary, #2563eb);
    flex-shrink: 0;
}

/* Pros & Cons Grid */
.zimm-pros-cons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

@media (max-width: 640px) {
    .zimm-pros-cons {
        grid-template-columns: 1fr;
    }
}

.zimm-pros, .zimm-cons {
    padding: 20px;
    border-radius: 14px;
}

.zimm-pros {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left: 4px solid #10b981;
}

.zimm-cons {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border-left: 4px solid #ef4444;
}

.zimm-pros-title, .zimm-cons-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.zimm-pros-title {
    color: #065f46;
}

.zimm-cons-title {
    color: #991b1b;
}

.zimm-pros ul, .zimm-cons ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.zimm-pros li, .zimm-cons li {
    position: relative;
    padding-left: 24px;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.zimm-pros li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: #10b981;
    font-weight: 700;
}

.zimm-cons li::before {
    content: '✗';
    position: absolute;
    left: 0;
    color: #ef4444;
    font-weight: 700;
}

.zimm-pros li {
    color: #065f46;
}

.zimm-cons li {
    color: #991b1b;
}

/* Bottom CTA Bar */
.zimm-product-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border-top: 1px solid #e2e8f0;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 640px) {
    .zimm-product-footer {
        flex-direction: column;
        text-align: center;
    }
}

.zimm-best-for {
    font-size: 0.9rem;
    color: #64748b;
}

.zimm-best-for strong {
    color: var(--zimm-primary, #2563eb);
}

.zimm-amazon-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: #64748b;
}

.zimm-prime-badge {
    background: #232f3e;
    color: #ffffff;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 700;
}

/* ==========================================================================
   Sidebar Styles
   ========================================================================== */

.zimm-sidebar {
    position: sticky;
    top: 100px;
}

@media (max-width: 1024px) {
    .zimm-sidebar {
        position: static;
    }
}

.zimm-sidebar-inner {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.zimm-sidebar-widget {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.zimm-widget-title {
    font-size: 1rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 16px 0;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--zimm-primary, #2563eb);
}

/* TOC Widget */
.zimm-toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zimm-toc-list li {
    margin-bottom: 8px;
}

.zimm-toc-list a {
    display: block;
    padding: 10px 14px;
    font-size: 0.9rem;
    color: #475569;
    background: #f8fafc;
    border-radius: 8px;
    border-left: 3px solid transparent;
    transition: all 0.2s ease;
}

.zimm-toc-list a:hover {
    background: #f1f5f9;
    border-left-color: var(--zimm-primary, #2563eb);
    color: var(--zimm-primary, #2563eb);
    text-decoration: none;
}

/* Newsletter Widget */
.zimm-newsletter-widget {
    background: var(--zimm-gradient);
    color: #ffffff;
    text-align: center;
}

.zimm-newsletter-widget .zimm-widget-title {
    color: #ffffff;
    border-bottom-color: rgba(255,255,255,0.3);
}

.zimm-newsletter-icon {
    font-size: 2.5rem;
    margin-bottom: 8px;
}

.zimm-newsletter-widget p {
    font-size: 0.9rem;
    margin-bottom: 16px;
    opacity: 0.9;
}

.zimm-newsletter-form input {
    width: 100%;
    padding: 12px 16px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.zimm-newsletter-form button {
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;
    color: var(--zimm-primary, #2563eb);
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
}

.zimm-newsletter-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

/* Popular Posts */
.zimm-popular-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.zimm-popular-list li {
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.zimm-popular-list li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.zimm-popular-list a {
    font-size: 0.9rem;
    color: #334155;
    line-height: 1.4;
}

.zimm-popular-list a:hover {
    color: var(--zimm-primary, #2563eb);
}

/* Disclosure */
.zimm-disclosure {
    background: #fffbeb;
    border: 1px solid #fcd34d;
}

.zimm-disclosure p {
    margin: 0;
    color: #92400e;
}

/* ==========================================================================
   Site-Specific Theme Variations
   ========================================================================== */

/* Mystical Dark Theme - Witchcraft */
.zimm-style-mystical-dark .zimm-post-wrapper {
    background: linear-gradient(180deg, #1e1b4b 0%, #0f0d21 100%);
}

.zimm-style-mystical-dark .zimm-post-content {
    background: linear-gradient(180deg, #1e1b4b 0%, #2e1065 100%);
    color: #e2e8f0;
}

.zimm-style-mystical-dark .zimm-post-content h1,
.zimm-style-mystical-dark .zimm-post-content h2,
.zimm-style-mystical-dark .zimm-post-content h3 {
    color: #e9d5ff;
}

.zimm-style-mystical-dark .zimm-post-content p,
.zimm-style-mystical-dark .zimm-post-content li {
    color: #c4b5fd;
}

.zimm-style-mystical-dark .zimm-sidebar-widget {
    background: rgba(30, 27, 75, 0.9);
    color: #e2e8f0;
}

.zimm-style-mystical-dark .zimm-widget-title {
    color: #e9d5ff;
}

/* Scholarly Ancient Theme - Mythology */
.zimm-style-scholarly-ancient .zimm-post-content {
    background: linear-gradient(180deg, #fffbeb 0%, #fef3c7 100%);
}

.zimm-style-scholarly-ancient .zimm-post-content h1,
.zimm-style-scholarly-ancient .zimm-post-content h2 {
    font-family: 'Cinzel', serif;
}

/* Creative Soft Theme - Bullet Journals */
.zimm-style-creative-soft .zimm-post-wrapper {
    background: linear-gradient(180deg, #fdf2f8 0%, #fce7f3 100%);
}

.zimm-style-creative-soft .zimm-product-box {
    border: 2px dashed #f9a8d4;
}

/* Fitness Bold Theme */
.zimm-style-fitness-bold .zimm-cta-button {
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 480px) {
    .zimm-product-header {
        padding: 16px;
        gap: 16px;
    }

    .zimm-product-title {
        font-size: 1.15rem;
    }

    .zimm-price {
        font-size: 1.5rem;
    }

    .zimm-cta-button {
        width: 100%;
        justify-content: center;
        padding: 16px 24px;
    }

    .zimm-features-grid {
        grid-template-columns: 1fr;
    }

    .zimm-product-footer {
        padding: 16px;
    }
}

/* Print Styles */
@media print {
    .zimm-sidebar {
        display: none;
    }

    .zimm-post-container {
        grid-template-columns: 1fr;
    }

    .zimm-product-box {
        break-inside: avoid;
    }
}
