/* =============================================================
 *  VEXONA CONTENT ROW & CARD STYLES
 * ============================================================= */
.vex-content-row-wrapper {
    margin-bottom: 48px;
}

/* Row Header Styles */
.vex-row-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}
.vex-row-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 0;
    color: var(--vexona-color-text-main);
}
.vex-row-view-all {
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    color: var(--vexona-color-text-subtle);
    padding: 4px 8px;
    border-radius: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.vex-row-view-all:hover {
    background-color: var(--vexona-color-surface);
    color: var(--vexona-color-text-inverted);
}

.vex-row-container {
    display: flex;
    gap: 16px;
}
.vex-row-container.is-carousel {
    overflow-x: auto;
    padding-bottom: 16px;
    padding-right: 24px;
    margin-right: -24px;
    scroll-snap-type: x mandatory;
}
.vex-row-container.is-carousel::-webkit-scrollbar {
    height: 8px;
}
.vex-row-container.is-carousel::-webkit-scrollbar-thumb {
    background-color: var(--vexona-color-text-subtle);
    border-radius: 4px;
}

/* --- VEXONA POST CARD STYLES --- */
.vex-card {
    position: relative; 
    flex-shrink: 0;
    scroll-snap-align: start;
    animation: fadeIn 0.4s ease-in-out;
}

.vex-card-link {
    display: block;
    text-decoration: none !important;
    border: none !important;
    color: var(--vexona-color-text-main);
    position: relative;
    z-index: 1;
}

.vex-card-thumbnail {
    position: relative;
    background-color: var(--vexona-color-surface);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 8px; 
}
.vex-card-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}
.vex-card-link:hover .vex-card-thumbnail img {
    transform: scale(1.05);
}
.vex-card-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    position: absolute;
    font-size: 48px;
    color: var(--vexona-color-text-inverted-subtle);
    opacity: 0.5;
}
.vex-card-details {
    min-height: 1px;
}

/* --- FINAL FIX for Title Spacing, Weight, and Size --- */
/* This hyper-specific rule with !important overrides every property from the problematic theme h3 style. */
.vex-card-grid-container .vex-card .vex-card-title {
    font-size: var(--vexona-card-title-size) !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    margin-top: 0 !important;
    margin-bottom: 4px !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--vexona-color-text-main);
}

/* Final fix for the meta text remains */
.entry-content .vex-card-grid-container .vex-card .vex-card-meta {
    font-size: var(--vexona-card-author-size) !important;
    font-style: normal !important; 
    color: var(--vexona-color-text-subtle);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- Card Remove Button --- */
.vex-remove-from-list-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2; 
    width: 32px;
    height: 32px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(20, 20, 20, 0.75);
    color: #ffffff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
    opacity: 0;
    transform: scale(0.8);
    visibility: hidden;
}

.vex-card:hover .vex-remove-from-list-btn,
.vex-card:focus-within .vex-remove-from-list-btn {
    opacity: 1;
    transform: scale(1);
    visibility: visible;
}

.vex-remove-from-list-btn:hover {
    background-color: #e53935;
    transform: scale(1.1);
}

/* --- CARD STYLE VARIATIONS --- */
.vex-card.is-style-default .vex-card-thumbnail,
.vex-card.is-style-video .vex-card-thumbnail {
    padding-bottom: 56.25%;
}
.vex-card.is-style-audiobook .vex-card-thumbnail {
    padding-bottom: 100%;
}
.vex-card-duration {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background-color: rgba(15, 15, 15, 0.8);
    color: #fff;
    padding: 2px 6px;
    font-size: 12px;
    font-weight: 500;
    border-radius: 4px;
    line-height: 1.4;
    z-index: 2; 
}

/* --- CARD SIZE VARIATIONS (Width Only) --- */
.vex-card.is-size-small { width: 150px; }
.vex-card.is-size-medium { width: 200px; }
.vex-card.is-size-large { width: 280px; }


/* =============================================================
 *  SKELETON LOADER STYLES
 * ============================================================= */
.vex-card-skeleton {
    flex-shrink: 0;
    scroll-snap-align: start;
    background-color: var(--vexona-color-background);
    border-radius: 12px;
    overflow: hidden;
    position: relative;
}
.vex-card-skeleton .vex-card-thumbnail-skeleton,
.vex-card-skeleton .vex-card-title-skeleton,
.vex-card-skeleton .vex-card-meta-skeleton {
    background-color: var(--vexona-color-surface);
}
.vex-card-skeleton .vex-card-thumbnail-skeleton {
    border-radius: 12px;
    margin-bottom: 12px;
}
.vex-card-skeleton .vex-card-details-skeleton { padding: 0 4px; }
.vex-card-skeleton .vex-card-title-skeleton,
.vex-card-skeleton .vex-card-meta-skeleton {
    border-radius: 4px;
    height: 16px;
    margin-bottom: 8px;
}
.vex-card-skeleton .vex-card-title-skeleton { width: 90%; height: 18px; }
.vex-card-skeleton .vex-card-meta-skeleton { width: 60%; }
.is-style-default .vex-card-thumbnail-skeleton,
.is-style-video .vex-card-thumbnail-skeleton { padding-bottom: 56.25%; }
.is-style-audiobook .vex-card-thumbnail-skeleton { padding-bottom: 100%; }
.is-size-small.vex-card-skeleton { width: 150px; }
.is-size-medium.vex-card-skeleton { width: 200px; }
.is-size-large.vex-card-skeleton { width: 280px; }


/* --- SHIMMER ANIMATION --- */
@keyframes shimmer { 100% { transform: translateX(100%); } }
.vex-card-skeleton::after {
    content: '';
    position: absolute;
    inset: 0;
    transform: translateX(-100%);
    background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0, rgba(255, 255, 255, 0.2) 20%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0));
    animation: shimmer 1.5s infinite;
}

/* Add a simple fade-in for newly loaded cards */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* =============================================================
 *  ARCHIVE PAGE GRID STYLES
 * ============================================================= */
.vex-archive-header { margin-bottom: 32px; }
.vex-archive-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--vexona-color-text-main);
}
.vex-archive-description {
    font-size: 16px;
    color: var(--vexona-color-text-subtle);
    max-width: 600px;
}
.vex-card-grid-container {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 16px;
    margin-bottom: 48px;
}
.vex-card-grid-container .vex-card { flex-shrink: 1; }

/* =============================================================
 *  ARCHIVE INFINITE SCROLL LOADER
 * ============================================================= */
#vex-infinite-scroll-trigger {
    display: flex;
    flex-wrap: wrap;
    gap: 32px 16px;
    width: 100%;
    min-height: 100px;
    margin-bottom: 48px;
}

/* =============================================================
 *  MOBILE-SPECIFIC ARCHIVE GRID OVERRIDES
 * ============================================================= */
@media (max-width: 767px) {
    .vex-card-grid-container .vex-card.is-size-large { width: 100%; }
    .vex-card-grid-container .vex-card.is-size-medium,
    .vex-card-grid-container .vex-card.is-size-small { width: calc(50% - 8px); }
    .vex-card-grid-container .vex-card-title { white-space: normal; }
    .vex-card-grid-container .vex-card-details { min-height: 64px; }
}




/* =============================================================
 *  VEXONA BANNER ROW STYLES
 * ============================================================= */
.vex-banner-row {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    padding: 32px;
    margin-bottom: 48px;
    background-color: var(--vexona-color-surface);
    color: var(--vexona-color-text-inverted);
}
.vex-banner-dismiss {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0,0,0,0.3);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.2s ease;
}
.vex-banner-dismiss:hover {
    background: rgba(0,0,0,0.6);
}

.vex-banner-content {
    position: relative;
    z-index: 2;
}

.vex-banner-title {
    font-size: 28px;
    font-weight: 700;
    margin: 0 0 8px 0;
    color: inherit;
}
.vex-banner-text {
    font-size: 16px;
    margin: 0 0 20px 0;
    max-width: 600px;
    opacity: 0.9;
}
.vex-banner-link {
    display: inline-block;
    background-color: var(--vexona-color-primary);
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: background-color 0.2s ease;
}
.vex-banner-link:hover {
    background-color: var(--vexona-color-primary-dark);
}

/* Template 1: Image Background */
.vex-banner-row.template-1 {
    background-size: cover;
    background-position: center center;
}
.vex-banner-row.template-1::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(45deg, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.3) 100%);
    z-index: 1;
}

/* Template 2: Image Left */
.vex-banner-row.template-2 {
    display: flex;
    align-items: center;
    gap: 32px;
    padding: 0;
}
.vex-banner-row.template-2 .vex-banner-image {
    flex: 0 0 300px;
    align-self: stretch;
}
.vex-banner-row.template-2 .vex-banner-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.vex-banner-row.template-2 .vex-banner-content {
    padding: 32px;
}
@media (max-width: 767px) {
    .vex-banner-row.template-2 { flex-direction: column; }
    .vex-banner-row.template-2 .vex-banner-image { width: 100%; flex-basis: 200px; }
}


/* Template 3: Text Only, Centered */
.vex-banner-row.template-3 {
    text-align: center;
}
.vex-banner-row.template-3 .vex-banner-text {
    margin-left: auto;
    margin-right: auto;
}

/* Template 4: Simple Text Line */
.vex-banner-row.template-4 {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}
.vex-banner-row.template-4 .vex-banner-text {
    margin: 0;
    font-size: 15px;
}
.vex-banner-row.template-4 .vex-banner-link {
    padding: 6px 14px;
    font-size: 14px;
}
@media (max-width: 767px) {
    .vex-banner-row.template-4 { flex-direction: column; gap: 12px; text-align: center; }
}


/* =============================================================
 *  VEXONA BANNER GRADIENTS
 * ============================================================= */

/*
 * This ensures that when a gradient is active, the text color is always
 * bright and readable, using the inverted color variable from the Customizer.
 * It also ensures the overlay for template-1 is removed so the gradient is visible.
 */
.vex-banner-row[class*="is-gradient-"] {
    color: var(--vexona-color-text-inverted);
}
.vex-banner-row[class*="is-gradient-"]::before {
    background: none !important; /* Remove overlay when gradient is used */
}

/* --- Gradient Definitions --- */
.vex-banner-row.is-gradient-sunset {
    background-image: linear-gradient(45deg, #ff9a9e 0%, #fad0c4 99%, #fad0c4 100%);
}
.vex-banner-row.is-gradient-ocean {
    background-image: linear-gradient(45deg, #21D4FD 0%, #B721FF 100%);
}
.vex-banner-row.is-gradient-royal {
    background-image: linear-gradient(45deg, #84329b 0%, #c765a2 100%);
}
.vex-banner-row.is-gradient-emerald {
    background-image: linear-gradient(45deg, #2af598 0%, #009efd 100%);
}
.vex-banner-row.is-gradient-midnight {
    background-image: linear-gradient(45deg, #2c3e50 0%, #4b6584 100%);
}