@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,600;0,700;1,400&family=Inter:wght@400;500;600;700&display=swap');

.va-container {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px 64px;
    font-family: 'Inter', system-ui, sans-serif;
}

.va-container h1, .va-container h2, .va-container h4, .va-container h5 {
    font-family: 'Playfair Display', Georgia, serif;
}

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

.va-fade-in { animation: vaFadeInUp 0.5s ease both; }

.va-hero { text-align: center; padding: 32px 0; }
.va-hero h1 { font-size: 2.4rem; font-weight: 700; margin-bottom: 8px; }
.va-hero p { color: #666; margin-bottom: 20px; }

.va-btn {
    display: inline-block;
    padding: 10px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    cursor: pointer;
    border: none;
    margin: 4px;
    font-size: 0.95rem;
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.va-btn-primary { background: #2563eb; color: #fff; }
.va-btn-primary:hover { background: #1d4ed8; color: #fff; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(37,99,235,.3); }
.va-btn-secondary { background: #e5e7eb; color: #111; }
.va-btn-secondary:hover { background: #d1d5db; transform: translateY(-2px); }
.va-btn-small { padding: 6px 12px; font-size: 0.85rem; }

.va-section-title { margin: 32px 0 16px; }

.va-dashboard { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 24px 0; }
@media (max-width: 700px) { .va-dashboard { grid-template-columns: 1fr; } }

.va-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.va-mini-list { list-style: none; padding: 0; margin: 0; }
.va-mini-list li {
    display: flex; justify-content: space-between; align-items: center;
    padding: 8px 0; border-bottom: 1px solid #eee;
}
.va-mini-list li:last-child { border-bottom: none; }
.va-mini-list li span:last-child { display: flex; align-items: center; gap: 10px; }

.va-muted { color: #888; font-size: 0.9rem; }

.va-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
}
.va-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .25s ease, transform .25s ease;
    animation: vaFadeInUp 0.5s ease both;
}
.va-card-link { display: block; text-decoration: none; color: inherit; }
.va-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.1); transform: translateY(-4px); }
.va-card-media { position: relative; width: 100%; height: 150px; overflow: hidden; background: #000; }
.va-card-media img, .va-card-media video {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s ease;
}
.va-card:hover .va-card-media img,
.va-card:hover .va-card-media video { transform: scale(1.08); }
.va-card-body { padding: 14px; }
.va-card-body h4 { margin: 0 0 6px; font-size: 1.05rem; font-weight: 700; }
.va-card-body p { margin: 0 0 8px; color: #666; font-size: 0.9rem; }

.va-grid .va-card:nth-child(1) { animation-delay: .02s; }
.va-grid .va-card:nth-child(2) { animation-delay: .08s; }
.va-grid .va-card:nth-child(3) { animation-delay: .14s; }
.va-grid .va-card:nth-child(4) { animation-delay: .2s; }
.va-grid .va-card:nth-child(5) { animation-delay: .26s; }
.va-grid .va-card:nth-child(6) { animation-delay: .32s; }

.va-play-badge {
    position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(0,0,0,.55); color: #fff;
    display: flex; align-items: center; justify-content: center; font-size: 1rem;
    pointer-events: none;
    transition: background .25s ease;
}
.va-card:hover .va-play-badge, .va-row-card:hover .va-play-badge { background: rgba(37,99,235,.85); }

.va-row-card-meta { display: flex; gap: 14px; font-size: 0.82rem; color: #777; }

/* List page: horizontal row cards, media left / info right */
.va-list-cards { display: flex; flex-direction: column; gap: 18px; }
.va-row-card {
    display: flex;
    flex-direction: column;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    overflow: hidden;
    background: #fff;
    transition: box-shadow .25s ease, transform .25s ease;
    animation: vaFadeInUp 0.5s ease both;
}
.va-row-card-link { display: flex; text-decoration: none; color: inherit; flex: 1; }
.va-list-cards .va-row-card:nth-child(1) { animation-delay: .02s; }
.va-list-cards .va-row-card:nth-child(2) { animation-delay: .08s; }
.va-list-cards .va-row-card:nth-child(3) { animation-delay: .14s; }
.va-list-cards .va-row-card:nth-child(4) { animation-delay: .2s; }
.va-list-cards .va-row-card:nth-child(5) { animation-delay: .26s; }
.va-list-cards .va-row-card:nth-child(6) { animation-delay: .32s; }

.va-row-card:hover { box-shadow: 0 10px 28px rgba(0,0,0,.1); transform: translateY(-4px); }
.va-row-card-media {
    position: relative;
    flex: 0 0 240px;
    background: #000;
    overflow: hidden;
    min-height: 150px;
}
.va-row-card-media img, .va-row-card-media video {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: transform .5s ease;
}
.va-row-card:hover .va-row-card-media img,
.va-row-card:hover .va-row-card-media video { transform: scale(1.08); }
.va-row-card-body { padding: 20px; flex: 1; }
.va-row-card-body h4 {
    margin: 0 0 10px;
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.25;
    color: #111827;
    transition: color .2s ease;
}
.va-row-card:hover .va-row-card-body h4 { color: #1d4ed8; }
.va-row-card-body p { margin: 0 0 12px; color: #666; font-size: 0.95rem; }
@media (max-width: 640px) {
    .va-row-card-link { flex-direction: column; }
    .va-row-card-media { flex: none; height: 180px; }
    .va-row-card-body h4 { font-size: 1.2rem; }
}

.va-badge {
    background: #fef3c7; color: #92400e; font-size: 0.7rem;
    padding: 2px 8px; border-radius: 12px; margin-left: 6px;
}

.va-list-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }

/* Detail page: main article + Explore More sidebar */
.va-detail-grid {
    max-width: 1200px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 32px;
    align-items: start;
}
@media (max-width: 900px) {
    .va-detail-grid { grid-template-columns: 1fr; }
}

/* Article detail / rendered blocks */
.va-article { min-width: 0; }
.va-article h1 { margin-bottom: 8px; font-size: 2.1rem; font-weight: 700; line-height: 1.25; }
.va-summary { color: #555; font-size: 1.1rem; margin-bottom: 20px; }
.va-owner-bar {
    display: flex; gap: 16px; align-items: center;
    background: #eef2ff; border-radius: 8px; padding: 10px 14px;
    margin-bottom: 20px; font-size: 0.9rem;
}
.va-detail-meta { margin-bottom: 18px; }
.va-detail-meta button { transition: transform .15s ease, background .15s ease; }
.va-detail-meta button:hover { transform: translateY(-2px); background: #d1d5db; }

.va-video-wrapper { margin-bottom: 24px; }
.va-video-wrapper video { width: 100%; border-radius: 10px; background: #000; }

.va-blocks .va-block { margin: 22px 0; animation: vaFadeInUp .5s ease both; }
.va-paragraph { line-height: 1.75; font-size: 1.08rem; color: #1f2937; }
.va-subtitle { font-size: 1.6rem; font-weight: 700; margin-top: 34px; }
.va-image-full img { width: 100%; border-radius: 10px; transition: transform .4s ease; }
.va-image-full img:hover { transform: scale(1.01); }
.va-line-break { border: none; border-top: 1px solid #e5e7eb; margin: 32px 0; }

.va-split { display: flex; gap: 20px; align-items: center; }
.va-split-reverse { flex-direction: row-reverse; }
.va-split-media, .va-split-text { flex: 1; }
.va-split-media img { width: 100%; border-radius: 10px; display: block; }
@media (max-width: 700px) { .va-split { flex-direction: column; } }

.va-two-image { display: flex; gap: 12px; }
.va-two-image img { flex: 1; width: 50%; border-radius: 10px; object-fit: cover; }

/* Centered half-width image with caption */
.va-image-caption {
    max-width: 60%;
    margin: 32px auto;
    text-align: center;
}
.va-image-caption img { width: 100%; border-radius: 10px; display: block; transition: transform .4s ease; }
.va-image-caption img:hover { transform: scale(1.02); }
.va-image-caption figcaption {
    margin-top: 10px; font-size: 0.9rem; color: #666; font-style: italic;
}
@media (max-width: 700px) { .va-image-caption { max-width: 100%; } }

/* Explore More sidebar: sticky + internally scrollable on desktop,
   collapses to a normal block at the bottom on small screens */
.va-explore-sidebar { position: sticky; top: 20px; }
.va-explore-inner {
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 18px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.va-explore-inner h3 {
    margin: 0 0 14px; font-size: 1rem; text-transform: uppercase;
    letter-spacing: .04em; color: #666;
}
.va-explore-list { display: flex; flex-direction: column; gap: 12px; }
.va-explore-item {
    display: flex; gap: 10px; text-decoration: none; color: inherit;
    border-radius: 8px; padding: 6px; transition: background .2s ease, transform .2s ease;
}
.va-explore-item:hover { background: #fff; transform: translateX(2px); box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.va-explore-thumb {
    position: relative; flex: 0 0 96px; height: 64px; border-radius: 6px;
    overflow: hidden; background: #000;
}
.va-explore-thumb img, .va-explore-thumb video {
    width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s ease;
}
.va-explore-item:hover .va-explore-thumb img,
.va-explore-item:hover .va-explore-thumb video { transform: scale(1.08); }
.va-play-badge-sm { width: 26px; height: 26px; font-size: 0.7rem; }
.va-explore-info { flex: 1; min-width: 0; }
.va-explore-info h5 {
    margin: 0 0 4px; font-size: 0.92rem; font-weight: 700; line-height: 1.3;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.va-explore-view-all { display: block; text-align: center; margin-top: 14px; padding-top: 12px; border-top: 1px solid #e5e7eb; }

@media (max-width: 900px) {
    .va-explore-sidebar { position: static; order: 2; }
    .va-explore-inner { max-height: none; }
    .va-explore-list { flex-direction: row; overflow-x: auto; padding-bottom: 6px; gap: 14px; }
    .va-explore-item { flex: 0 0 220px; }
}

/* Builder form */
.va-field { margin-bottom: 16px; }
.va-field label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.9rem; }
.va-field input[type=text], .va-field input[type=datetime-local],
.va-field textarea, .va-field select, .va-field input[type=file] {
    width: 100%; padding: 8px 10px; border: 1px solid #d1d5db; border-radius: 6px; font-size: 0.95rem;
}

.va-block-row {
    border: 1px solid #e5e7eb; border-radius: 8px; padding: 14px; margin-bottom: 14px; background: #fff;
}
.va-block-row.va-block-deleted { opacity: 0.35; }
.va-block-row.va-dragging { opacity: 0.4; border-style: dashed; }

.va-block-row-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.va-drag-handle { cursor: grab; font-size: 1.2rem; color: #999; }
.va-delete-label { display: flex; align-items: center; gap: 4px; font-size: 0.85rem; margin-left: auto; }
.va-move-up, .va-move-down { cursor: pointer; padding: 2px 8px; border: 1px solid #d1d5db; border-radius: 4px; }

.va-block-fields { display: flex; gap: 14px; flex-wrap: wrap; }
.va-block-fields .va-field { flex: 1; min-width: 200px; margin-bottom: 0; }

.va-add-block-bar { display: flex; gap: 10px; margin-top: 10px; }
.va-add-block-bar select { padding: 8px; border-radius: 6px; border: 1px solid #d1d5db; }

.va-actions { margin-top: 24px; display: flex; gap: 12px; }

template { display: none; }

/* Edit/Delete manage bar shown under a card the user is allowed to manage */
.va-card-manage {
    display: flex; gap: 8px; align-items: center;
    padding: 10px 16px; border-top: 1px solid #eee; background: #fafafa;
}
.va-inline-form { display: inline; margin: 0; }
.va-inline-form .va-btn { margin: 0; }

/* Search */
.va-search-form {
    display: flex; gap: 10px; margin: 0 0 20px;
}
.va-search-form input[type="search"] {
    flex: 1; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.va-search-form input[type="search"]:focus {
    outline: none; border-color: #2563eb; box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

/* Pagination */
.va-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 32px 0; }
.va-page-link {
    display: inline-block; padding: 8px 14px; border-radius: 6px; border: 1px solid #e5e7eb;
    text-decoration: none; color: #374151; font-size: 0.9rem; transition: all .2s ease;
}
.va-page-link:hover { background: #eef2ff; border-color: #c7d2fe; }
.va-page-link-active { background: #2563eb; border-color: #2563eb; color: #fff; font-weight: 600; }
.va-page-link-disabled { opacity: 0.4; pointer-events: none; }

.va-section-header { display: flex; justify-content: space-between; align-items: baseline; margin: 32px 0 16px; }
.va-view-all { font-size: 0.9rem; font-weight: 600; color: #2563eb; text-decoration: none; }
.va-view-all:hover { text-decoration: underline; }

/* List/Grid view toggle */
.va-view-toggle-bar { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.va-view-toggle { display: flex; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.va-view-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 36px; border: none; background: #fff; color: #6b7280;
    cursor: pointer; transition: background .2s ease, color .2s ease;
}
.va-view-btn + .va-view-btn { border-left: 1px solid #d1d5db; }
.va-view-btn:hover { background: #f3f4f6; }
.va-view-btn-active { background: #2563eb; color: #fff; }
.va-view-btn-active:hover { background: #1d4ed8; }

/* Grid mode: reuse the same row-card markup but lay it out like a vertical card */
.va-grid-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 20px;
}
.va-grid-cards .va-row-card-link { flex-direction: column; }
.va-grid-cards .va-row-card-media { flex: none; width: 100%; height: 170px; }
.va-grid-cards .va-row-card-body { padding: 14px; }
.va-grid-cards .va-row-card-body h4 { font-size: 1.1rem; }
.va-grid-cards .va-row-card-body p { font-size: 0.88rem; -webkit-line-clamp: 2; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

/* Flash messages */
.va-flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 0.9rem; }
.va-flash-success { background: #dcfce7; color: #166534; }
.va-flash-error { background: #fee2e2; color: #991b1b; }
.va-error { color: #b91c1c; font-size: 0.85rem; }

.va-btn-danger { background: #fee2e2; color: #991b1b; }
.va-btn-danger:hover { background: #fecaca; }

/* Two-pane build layout */
.va-build-wrap { max-width: 1280px; }
.va-build-grid {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 28px;
    align-items: start;
}
@media (max-width: 900px) {
    .va-build-grid { grid-template-columns: 1fr; }
}

.va-preview-sticky {
    position: sticky;
    top: 20px;
    background: #fafafa;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px;
}
.va-preview-sticky h3 { margin-top: 0; color: #666; font-size: 0.9rem; text-transform: uppercase; letter-spacing: .04em; }
.va-preview-card #va-preview-title { font-size: 1.6rem; margin: 10px 0 6px; }
.va-preview-card #va-preview-summary { color: #555; margin-bottom: 14px; }
.va-preview-card video { width: 100%; border-radius: 8px; background: #000; }

/* Block row states */
.va-block-buttons { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.va-block-saved-tag { color: #16a34a; font-size: 0.8rem; font-weight: 600; display: none; }
.va-block-row[data-saved="true"] .va-block-saved-tag { display: inline; }
.va-block-row[data-saved="true"] .va-block-edit-btn { display: inline-block; }
.va-block-row:not([data-saved="true"]) .va-block-edit-btn { display: none; }

.va-block-summary { color: #555; font-size: 0.9rem; font-style: italic; }
.va-block-collapsed .va-block-fields { display: none; }
.va-block-collapsed .va-block-summary { display: inline-block; }
.va-block-row:not(.va-block-collapsed) .va-block-summary { display: none; }

.va-field-image img.block-image-preview,
.va-field-image2 img.block-image2-preview {
    display: block; max-width: 160px; margin-top: 8px; border-radius: 6px;
}

/* ===================== Mobile responsiveness pass ===================== */

@media (max-width: 768px) {
    .va-container { padding: 16px 14px 48px; }

    .va-hero h1 { font-size: 1.8rem; }
    .va-hero p { font-size: 0.95rem; }

    .va-article h1 { font-size: 1.5rem; }
    .va-summary { font-size: 1rem; }

    .va-list-header { flex-direction: column; align-items: flex-start; gap: 10px; }
    .va-section-header { flex-direction: column; align-items: flex-start; gap: 6px; }

    .va-search-form { flex-wrap: wrap; }
    .va-search-form input[type="search"] { flex: 1 1 100%; }

    .va-owner-bar { flex-wrap: wrap; gap: 10px; }
    .va-detail-meta { flex-wrap: wrap; gap: 10px; }

    .va-card-manage { flex-wrap: wrap; }
    .va-mini-list li { flex-direction: column; align-items: flex-start; gap: 6px; }
    .va-mini-list li span:last-child { flex-wrap: wrap; }

    .va-two-image { flex-direction: column; }
    .va-two-image img { width: 100%; }

    .va-block-row-head { flex-wrap: wrap; row-gap: 8px; }
    .va-block-buttons { margin-left: 0; width: 100%; justify-content: flex-end; }

    .va-view-toggle-bar { flex-wrap: wrap; }

    .va-grid, .va-grid-cards { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }

    .va-actions { flex-wrap: wrap; }
    .va-actions .va-btn { flex: 1 1 auto; text-align: center; }
}

@media (max-width: 480px) {
    .va-hero h1 { font-size: 1.5rem; }
    .va-article h1 { font-size: 1.3rem; }
    .va-preview-card #va-preview-title { font-size: 1.25rem; }

    .va-grid, .va-grid-cards { grid-template-columns: 1fr 1fr; }

    .va-row-card-media { height: 140px; }
    .va-explore-item { flex: 0 0 180px; }

    .va-btn { padding: 9px 14px; font-size: 0.9rem; }
}
.va-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 20px;
}

.va-detail-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-top: 2rem;
}

.va-article {
    max-width: 100%;
}

/* Video Responsive */
.va-video-wrapper {
    position: relative;
    width: 100%;
    margin: 1.5rem 0;
}

.va-video-wrapper video {
    width: 100%;
    height: auto;
    max-height: 80vh;
    border-radius: 8px;
    background: #000;
}

/* Sidebar on Mobile - Stacked */
.va-explore-sidebar {
    order: 2; /* Ensures it comes after article on mobile */
}

/* Desktop Layout */
@media (min-width: 992px) {
    .va-detail-grid {
        grid-template-columns: 2.8fr 1.2fr;
        gap: 3rem;
    }
    
    .va-explore-sidebar {
        order: unset;
        position: sticky;
        top: 2rem;
        align-self: start;
    }
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    .va-container {
        padding: 0 15px;
    }
    
    .va-explore-list {
        display: flex;
        flex-direction: column;
        gap: 1rem;
    }
    
    .va-explore-item {
        flex-direction: row;
        gap: 1rem;
    }
    
    .va-explore-thumb {
        width: 120px;
        flex-shrink: 0;
    }
    
    .va-explore-thumb img,
    .va-explore-thumb video {
        width: 100%;
        height: 70px;
        object-fit: cover;
        border-radius: 6px;
    }
}

/* General Responsive Improvements */
img, video {
    max-width: 100%;
    height: auto;
    display: block;
}

.va-explore-thumb {
    position: relative;
    overflow: hidden;
    border-radius: 6px;
}