/**
 * RX Sheets Sync - Carousel Styles
 * 
 * Styles for the compound carousel and grid displays
 */

/* ===============================================
   Carousel Wrapper
   =============================================== */
.rxss-carousel-wrapper {
    position: relative;
    width: 100%;
    margin: 2rem 0;
}

/* ===============================================
   Swiper Carousel Overrides
   =============================================== */
.rxss-swiper {
    padding: 1rem 0 3rem;
}

.rxss-swiper .swiper-slide {
    height: auto;
    display: flex;
}

/* Navigation Buttons */
.rxss-swiper .swiper-button-next,
.rxss-swiper .swiper-button-prev {
    color: var(--rxss-primary-color, #0073aa);
    width: 44px;
    height: 44px;
}

.rxss-swiper .swiper-button-next:hover,
.rxss-swiper .swiper-button-prev:hover {
    opacity: 0.7;
}

/* Pagination Dots */
.rxss-swiper .swiper-pagination-bullet {
    background: var(--rxss-primary-color, #0073aa);
    opacity: 0.3;
}

.rxss-swiper .swiper-pagination-bullet-active {
    opacity: 1;
}

/* ===============================================
   Grid Layout
   =============================================== */
.rxss-grid {
    display: grid;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
    gap: 2rem;
    padding: 1rem 0;
}

/* Responsive grid */
@media (max-width: 1024px) {
    .rxss-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .rxss-grid {
        grid-template-columns: 1fr;
    }
}

.rxss-grid-item {
    display: flex;
}

/* ===============================================
   Compound Card
   =============================================== */
.rxss-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
    width: 100%;
    height: 100%;
}

.rxss-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

/* Card Image */
.rxss-card-image {
    position: relative;
    width: 100%;
    padding-top: 66.67%; /* 3:2 aspect ratio */
    background: #f5f5f5;
    overflow: hidden;
}

.rxss-card-image a {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: block;
}

.rxss-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.rxss-card:hover .rxss-card-image img {
    transform: scale(1.05);
}

/* Card Content */
.rxss-card-content {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* Category Badge */
.rxss-card-category {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--rxss-primary-color, #0073aa);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 4px;
    margin-bottom: 0.75rem;
    align-self: flex-start;
}

/* Card Title */
.rxss-card-title {
    margin: 0 0 1rem;
    font-size: 1.25rem;
    line-height: 1.4;
}

.rxss-card-title a {
    color: #333;
    text-decoration: none;
    transition: color 0.2s;
}

.rxss-card-title a:hover {
    color: var(--rxss-primary-color, #0073aa);
}

/* Card Excerpt */
.rxss-card-excerpt {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

/* Card Footer */
.rxss-card-footer {
    margin-top: auto;
    padding-top: 1rem;
}

.rxss-card-button {
    display: inline-block;
    padding: 0.5rem 1rem;
    background: var(--rxss-primary-color, #0073aa);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.2s;
    text-align: center;
}

.rxss-card-button:hover {
    background: var(--rxss-primary-hover, #005a87);
    color: #fff;
}

/* ===============================================
   Alternative Card Templates
   =============================================== */

/* Minimal Card */
.rxss-card-minimal {
    border: none;
    box-shadow: none;
    padding: 1rem;
}

.rxss-card-minimal:hover {
    transform: none;
    box-shadow: none;
}

.rxss-card-minimal .rxss-card-content {
    padding: 1rem 0;
}

/* List Card */
.rxss-card-list {
    flex-direction: row;
}

.rxss-card-list .rxss-card-image {
    width: 200px;
    padding-top: 0;
    height: auto;
    flex-shrink: 0;
}

.rxss-card-list .rxss-card-image a {
    position: relative;
    height: 150px;
}

/* ===============================================
   Empty State
   =============================================== */
.rxss-carousel-empty {
    text-align: center;
    padding: 3rem 1rem;
    color: #999;
    font-style: italic;
}

/* ===============================================
   Loading State
   =============================================== */
.rxss-carousel-loading {
    text-align: center;
    padding: 3rem 1rem;
}

.rxss-carousel-loading::after {
    content: '';
    display: inline-block;
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--rxss-primary-color, #0073aa);
    border-radius: 50%;
    animation: rxss-spin 1s linear infinite;
}

@keyframes rxss-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===============================================
   Theme Compatibility
   =============================================== */

/* Reset box-sizing for nested elements */
.rxss-carousel-wrapper *,
.rxss-carousel-wrapper *::before,
.rxss-carousel-wrapper *::after {
    box-sizing: border-box;
}

/* Clear theme link styles */
.rxss-card a {
    text-decoration: none;
}

.rxss-card a:focus {
    outline: 2px solid var(--rxss-primary-color, #0073aa);
    outline-offset: 2px;
}

