/* Premium Layouts Core Variables */
:root {
    --upb-font-primary: 'Inter', -apple-system, sans-serif;
    --upb-accent: #6366f1;
    --upb-dark: #111827;
    --upb-light: #ffffff;
    --upb-gray: #f3f4f6;
    --upb-text-main: #1f2937;
    --upb-text-light: #6b7280;
    --upb-card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.02);
}

/* Wrapper for Elementor Widgets */
.upb-ui-content-wrapper {
    width: 100%;
    font-family: var(--upb-font-primary);
}

/* --- BLOG ARCHIVE LAYOUTS --- */
.upb-ui-content-wrapper { width: 100%; font-family: var(--upb-font-primary); overflow: visible; }

/* --- HERO SECTION (SINGLE POST) --- */
.upb-hero-section {
    position: relative;
    height: 50vh;
    min-height: 350px;
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    margin: -20px -20px 0 -20px;
    border-radius: 0 0 40px 40px;
    overflow: hidden;
}

.upb-dark-mode .upb-hero-section {
    background: linear-gradient(135deg, #0f172a 0%, #020617 100%);
}

.upb-hero-overlay {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.7) 100%);
    z-index: 1;
}

.upb-hero-header {
    position: relative;
    z-index: 2;
    padding: 0 20px;
    max-width: 900px;
}

.upb-hero-title {
    font-size: clamp(32px, 5vw, 72px);
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 20px;
    text-shadow: 0 4px 20px rgba(0,0,0,0.3);
}

.upb-hero-meta {
    font-size: 16px;
    opacity: 0.9;
    letter-spacing: 1px;
    text-transform: uppercase;
}

/* --- CONTENT CONTAINER & FLOATING CARD --- */
.upb-content-container {
    position: relative;
    z-index: 10;
    margin-top: -100px !important; /* Pull content up over hero */
    padding-bottom: 60px;
}

.upb-floating-card {
    background: var(--upb-light);
    border-radius: 30px;
    padding: 60px;
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.15);
}

.upb-dark-mode .upb-floating-card {
    background: #1e293b;
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.5);
}

/* Modern Grid Style */
.upb-grid-modern {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 30px;
}

.upb-grid-modern .post-card {
    background: var(--upb-light);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--upb-card-shadow);
    transition: transform 0.3s ease;
}

.upb-grid-modern .post-card:hover { transform: translateY(-8px); }

.upb-grid-modern .post-thumb { height: 220px; overflow: hidden; background: #eee; }
.upb-grid-modern .post-thumb img { width: 100%; height: 100%; object-fit: cover; }

.upb-grid-modern .post-info { padding: 24px; }
.upb-grid-modern .post-category { color: var(--upb-accent); font-size: 12px; font-weight: 700; text-transform: uppercase; margin-bottom: 10px; display: block; }
.upb-grid-modern .post-title { font-size: 20px; font-weight: 800; margin: 0 0 12px 0; color: var(--upb-dark); line-height: 1.3; }
.upb-grid-modern .post-excerpt { font-size: 14px; color: var(--upb-text-light); line-height: 1.6; margin-bottom: 20px; }
.upb-grid-modern .post-meta { font-size: 12px; color: #9ca3af; display: flex; gap: 15px; }

/* Magazine List Style */
.upb-magazine-list { display: flex; flex-direction: column; gap: 40px; }
.upb-magazine-list .post-card { display: flex; gap: 30px; align-items: center; }
.upb-magazine-list .post-thumb { flex: 0 0 400px; height: 280px; border-radius: 12px; overflow: hidden; }
.upb-magazine-list .post-info { flex: 1; }
@media (max-width: 768px) {
    .upb-magazine-list .post-card { flex-direction: column; }
    .upb-magazine-list .post-thumb { flex: none; width: 100%; }
}

/* Minimalist Style */
.upb-minimalist { max-width: 800px; margin: 0 auto; }
.upb-minimalist .post-card { border-bottom: 1px solid #eee; padding: 40px 0; }
.upb-minimalist .post-title { font-size: 32px; font-weight: 800; margin-bottom: 15px; }

/* --- SINGLE POST LAYOUTS --- */

/* Clean Magazine Single */
.upb-single-magazine { max-width: 900px; margin: 0 auto; }
.upb-single-magazine .entry-content { font-size: 20px; line-height: 1.8; color: var(--upb-text-main); }

/* Modern Sidebar Single */
.upb-single-modern-side { display: flex; gap: 50px; align-items: flex-start; max-width: 1100px; margin: 0 auto; }
.upb-single-modern-side .entry-card { flex: 1; }

/* Dark Immersion Enhancement */
.upb-dark-mode { 
    background: #0f172a; 
    color: #f8fafc; 
    padding: 80px 40px; 
    transition: all 0.5s ease;
    border-radius: 24px;
}
.upb-dark-mode .upb-ui-content-wrapper { color: #cbd5e1; }
.upb-dark-mode h1, .upb-dark-mode h2, .upb-dark-mode h3 { color: #f8fafc; }
.upb-dark-mode .entry-title { background: linear-gradient(90deg, #818cf8, #c084fc); -webkit-background-clip: text; -webkit-text-fill-color: transparent; }
.upb-dark-mode .entry-content { color: #94a3b8; font-size: 19px; }
.upb-dark-mode .entry-meta { color: #475569; }
.upb-dark-mode .read-more { background: #6366f1; }

/* Responsive Adjustments */
@media (max-width: 1024px) {
    .upb-single-modern-side { flex-direction: column; }
    .upb-single-magazine .entry-title { font-size: 36px; }
}

/* Helper classes */
.img-responsive { width: 100%; height: auto; display: block; }
.read-more { display: inline-block; padding: 8px 20px; background: var(--upb-accent); color: white; border-radius: 6px; text-decoration: none; font-weight: 600; font-size: 14px; }
.read-more:hover { opacity: 0.9; }
