/**
 * Public-facing CSS for Responsive Pricing Table "Components".
 */

/* --- Core Component Wrapper --- */
.rpt-component-wrapper {
    --rpt-card-bg: #ffffff;
    --rpt-card-border-radius: 4px;
    --rpt-text-color: #333333;
    --rpt-accent-color: #0073aa;
    --rpt-border-color: #dddddd;
    --rpt-border-width: 1px;
    --rpt-shadow-glow-color: rgba(0, 115, 170, 0.5);
    --rpt-grid-columns: 3;
    /* START: MODIFICATION - Changed display to block for Media Object */
    display: block !important;
    /* END: MODIFICATION */
}

/* **START: FIX (Final) - Aggressive, targeted reset for theme pseudo-element conflicts.** */
/* This rule specifically targets the problematic `::before` and `::after` pseudo-elements */
/* that the theme is adding to our wrapper div and neutralizes their layout-breaking properties. */
/* This is the definitive fix for the card offset issue. */
.rpt-component-wrapper div::before,
.rpt-component-wrapper div::after {
    content: none !important;
    display: none !important;
    width: auto !important;
}
/* **END: FIX** */

.rpt-component-wrapper *,
.rpt-component-wrapper *::before,
.rpt-component-wrapper *::after {
    box-sizing: border-box;
}


/* --- Card Matrix Grid Layout --- */
.rpt-component-wrapper.rpt-card-matrix {
    display: grid !important; /* Re-apply grid for card matrix only */
}
.rpt-card-matrix-grid {
    display: grid;
    grid-template-columns: repeat(var(--rpt-grid-columns), 1fr);
    gap: 30px;
    width: 100%;
}

/* --- Generic Card Styling --- */
.rpt-card {
    background-color: var(--rpt-card-bg);
    border-radius: var(--rpt-card-border-radius);
    color: var(--rpt-text-color);
    text-decoration: none;
    transition: all 0.3s ease;
    border: var(--rpt-border-width) solid transparent;
    overflow: hidden;
    position: relative;
    margin: 0 !important;
    padding: 25px !important;
    width: auto !important;
    float: none !important;
    clear: none !important;
}

/* --- Border Styles --- */
.rpt-border--solid .rpt-card {
    border-color: var(--rpt-border-color);
}
.rpt-border--dashed .rpt-card {
    border-style: dashed;
    border-color: var(--rpt-border-color);
}

/* --- Shadow Effects --- */
.rpt-shadow--subtle .rpt-card { box-shadow: 0 2px 4px rgba(0,0,0,0.05); }
.rpt-shadow--standard .rpt-card { box-shadow: 0 4px 8px rgba(0,0,0,0.1); }
.rpt-shadow--deep .rpt-card { box-shadow: 0 10px 20px rgba(0,0,0,0.15); }
.rpt-shadow--glow .rpt-card { box-shadow: 0 0 15px var(--rpt-shadow-glow-color); }

/* --- Hover Effects --- */
.rpt-hover--grow .rpt-card:hover { transform: scale(1.05); z-index: 10; }
.rpt-hover--lift .rpt-card:hover { transform: translateY(-10px); box-shadow: 0 15px 25px rgba(0,0,0,0.2); z-index: 10; }
.rpt-hover--highlight-border .rpt-card:hover { border-color: var(--rpt-accent-color); }
.rpt-hover--image-zoom .rpt-card:hover .rpt-card-image img { transform: scale(1.1); }
.rpt-hover--shine .rpt-card::after {
    content: ''; position: absolute; top: 0; left: -100%; width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.5) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-25deg); transition: left 0.6s ease;
}
.rpt-hover--shine .rpt-card:hover::after { left: 150%; }

/* --- Template: Feature Card --- */
.rpt-card-template--feature { text-align: center; }
.rpt-card-template--feature .rpt-card-icon .dashicons {
    font-size: 48px; width: 48px; height: 48px;
    color: var(--rpt-accent-color);
    margin-bottom: 15px;
}
.rpt-card-template--feature .rpt-card-title {
    font-size: 1.5em; margin: 0 0 10px 0;
}
.rpt-card-template--feature .rpt-card-description {
    font-size: 1em; line-height: 1.6; margin: 0; color: #555;
}

/* --- Template: Blog Post & Product --- */
.rpt-card-template--blog_post, .rpt-card-template--product {
    display: flex; flex-direction: column; padding-top: 0 !important;
}
.rpt-card-template--blog_post .rpt-card-image,
.rpt-card-template--product .rpt-card-image {
    overflow: hidden;
    margin: 0 -25px; /* Counteract parent padding */
    margin-bottom: 25px; /* Match parent padding */
}
.rpt-card-template--blog_post .rpt-card-image img { width: 100%; height: auto; transition: transform 0.3s ease; }
.rpt-card-template--blog_post .rpt-card-content, .rpt-card-template--product .rpt-card-content { padding: 0; flex-grow: 1; display: flex; flex-direction: column; }
.rpt-card-template--blog_post .rpt-card-title { font-size: 1.3em; margin: 0 0 10px 0; }
.rpt-card-template--blog_post .rpt-card-excerpt { margin: 0; flex-grow: 1; }
.rpt-card-template--blog_post .rpt-card-link-text { margin-top: 15px; font-weight: bold; color: var(--rpt-accent-color); }

/* --- Template: Profile --- */
.rpt-card-template--profile { text-align: center; }
.rpt-card-template--profile .rpt-card-photo img {
    border-radius: 50%; width: 100px; height: 100px;
    object-fit: cover; margin-bottom: 15px;
}
.rpt-card-template--profile .rpt-card-name { font-size: 1.4em; margin: 0 0 5px 0; }
.rpt-card-template--profile .rpt-card-job-title { margin: 0; color: #666; font-style: italic; }

/* --- Template: Testimonial --- */
.rpt-card-template--testimonial { text-align: center; }
.rpt-card-template--testimonial .rpt-card-quote { font-style: italic; font-size: 1.1em; margin-bottom: 20px; }
.rpt-card-template--testimonial .rpt-card-author-info { display: flex; align-items: center; justify-content: center; gap: 10px; }
.rpt-card-template--testimonial .rpt-card-author-photo img { width: 50px; height: 50px; border-radius: 50%; }
.rpt-card-template--testimonial .rpt-card-author-details { text-align: left; }
.rpt-card-template--testimonial .rpt-card-author-name { display: block; font-weight: bold; }
.rpt-card-template--testimonial .rpt-card-author-company { display: block; font-size: 0.9em; color: #777; }

/* --- Template: Product & CTA --- */
.rpt-card-template--cta { text-align: center; display: flex; flex-direction: column; }
.rpt-card-template--product .rpt-card-product-name, .rpt-card-template--cta .rpt-card-headline { font-size: 1.6em; margin: 0 0 10px 0; }
.rpt-card-template--product .rpt-card-price { font-size: 1.3em; font-weight: bold; color: var(--rpt-accent-color); margin: 0 0 20px 0; }
.rpt-card-template--product .rpt-card-button, .rpt-card-template--cta .rpt-card-button {
    display: inline-block; padding: 10px 20px; background-color: var(--rpt-accent-color);
    color: #fff; border-radius: 4px; text-decoration: none; margin-top: auto;
}

/* --- Template: Feature List --- */
.rpt-card-template--feature_list .rpt-card-plan-name { text-align: center; font-size: 1.6em; margin: 0 0 10px 0; }
.rpt-card-template--feature_list .rpt-card-price { text-align: center; font-size: 1.3em; font-weight: bold; margin: 0 0 20px 0; }
.rpt-card-template--feature_list .rpt-card-features { list-style: none; padding: 0; margin: 0; }
.rpt-card-template--feature_list .rpt-card-features li { padding: 8px 0; border-bottom: 1px solid #eee; }
.rpt-card-template--feature_list .rpt-card-features li:last-child { border-bottom: none; }
.rpt-card-template--feature_list .rpt-card-features li::before {
    content: '\f147'; font-family: 'dashicons'; color: #22c55e; margin-right: 10px;
}

/* --- Template: Logo --- */
.rpt-card-template--logo { display: flex; align-items: center; justify-content: center; }
.rpt-card-template--logo img { max-width: 80%; height: auto; }

/* --- Template: Flip Card --- */
.rpt-card-template--flip {
    perspective: 1000px;
    padding: 0 !important;
    overflow: visible !important;
}
.rpt-card-template--flip .rpt-card-flip-inner {
    position: relative;
    width: 100%;
    height: 100%;
    min-height: 200px;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}
.rpt-card-template--flip img {
    max-width: 100%;
    max-height: 100px;
    height: auto;
}
.rpt-card-template--flip:hover .rpt-card-flip-inner { transform: rotateY(180deg); }
.rpt-card-flip-front, .rpt-card-flip-back {
    position: absolute; width: 100%; height: 100%; -webkit-backface-visibility: hidden; backface-visibility: hidden;
    display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 25px;
    background: var(--rpt-card-bg); border-radius: var(--rpt-card-border-radius);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.rpt-card-flip-back { transform: rotateY(180deg); }

.rpt-card-template--stat_counter { text-align: center; }
.rpt-card-template--stat_counter .rpt-card-stat {
    font-size: 4em;
    font-weight: 700;
    line-height: 1.1;
    color: var(--rpt-accent-color);
    margin-bottom: 5px;
}
.rpt-card-template--stat_counter .rpt-card-label {
    font-size: 1.1em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #777;
}

/* --- Entrance Animations --- */
.rpt-animate .rpt-card {
    opacity: 0;
    transition: opacity 0.6s ease, transform 0.6s ease;
}
.rpt-card.is-visible { opacity: 1; transform: none !important; }
.rpt-animation--fade-in { opacity: 0; }
.rpt-animation--slide-up { opacity: 0; transform: translateY(50px); }
.rpt-animation--zoom-in { opacity: 0; transform: scale(0.8); }

/* START: NEW & UPDATED STYLES - Media Object Component */
.rpt-media-object-item {
    --rpt-item-bg: #ffffff;
    --rpt-image-border-radius: 4px;
    --rpt-heading-font-size: 24px;
    --rpt-heading-font-color: #333333;
    --rpt-description-font-size: 16px;
    --rpt-description-font-color: #555555;

    display: flex;
    align-items: center;
    gap: 30px;
    background-color: var(--rpt-item-bg);
    padding: 20px;
    border-radius: 4px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.05);
}
.rpt-media-object-item:not(:last-child) {
    margin-bottom: 30px;
}
.rpt-media-object-item.layout-reversed {
    flex-direction: row-reverse;
}
.rpt-media-object-media {
    /* START: FIX 1 - Changed flex-basis to 65% */
    flex: 1 1 65%;
    /* END: FIX 1 */
}
.rpt-media-object-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: var(--rpt-image-border-radius);
}
.rpt-media-object-icon {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: var(--rpt-accent-color);
    text-align: center;
    display: block;
    margin: 0 auto;
}
.rpt-media-object-image-placeholder {
    width: 100%;
    padding-bottom: 66.66%; /* 3:2 aspect ratio */
    background: #f0f0f1;
    border: 2px dashed #ddd;
    border-radius: var(--rpt-image-border-radius);
}
.rpt-media-object-content {
    /* START: FIX 1 & 2 - Update flex-basis and add flex layout to prevent overlap */
    flex: 1 1 35%;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    /* END: FIX 1 & 2 */
}
.rpt-media-object-serial {
    /* START: FIX 2 - Remove absolute positioning */
    font-size: 48px;
    font-weight: 700;
    color: #e0e0e0;
    line-height: 1;
    /* END: FIX 2 */
}
.rpt-media-object-heading {
    /* START: FIX 2 - Remove relative positioning */
    font-size: var(--rpt-heading-font-size);
    color: var(--rpt-heading-font-color);
    margin: 0 0 10px 0;
    /* END: FIX 2 */
}
.rpt-media-object-description {
    /* START: FIX 2 - Remove relative positioning */
    font-size: var(--rpt-description-font-size);
    color: var(--rpt-description-font-color);
    line-height: 1.6;
    margin: 0 0 20px 0;
    /* END: FIX 2 */
}
.rpt-media-object-button {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--rpt-accent-color);
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.rpt-media-object-button:hover {
    background-color: #005a87;
}
/* END: NEW & UPDATED STYLES */

/* --- Responsiveness --- */
@media (max-width: 960px) {
    .rpt-card-matrix-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
@media (max-width: 768px) {
    /* START: NEW STYLES */
    .rpt-media-object-item,
    .rpt-media-object-item.layout-reversed {
        flex-direction: column;
        text-align: center;
    }
    .rpt-media-object-serial {
        position: static;
        display: block;
        margin-bottom: 10px;
    }
    .rpt-media-object-content {
        width: 100%;
        /* START: FIX 2 - Adjust for stacked view */
        flex-direction: column;
        align-items: center;
        text-align: center;
        /* END: FIX 2 */
    }
    /* END: NEW STYLES */
}
@media (max-width: 600px) {
    .rpt-card-matrix-grid {
        grid-template-columns: 1fr;
    }
}
