/**
 * Ads Box Under Post - Frontend Stylesheet
 * 1/3 Image & 2/3 Content Responsive Flexbox Layout
 */

/* Container */
.ads-box-container {
    margin: 2rem 0;
    width: 100%;
    box-sizing: border-box;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    overflow: hidden;
}

.ads-box-container *,
.ads-box-container *::before,
.ads-box-container *::after {
    box-sizing: border-box;
}

/* Wrapper Grid 1/3 - 2/3 */
.ads-box-wrapper {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    width: 100%;
}

/* Column 1/3: Image */
.ads-box-col-image {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Square Mode (Default 1:1) */
.ads-box-container.ads-img-square .ads-box-col-image {
    padding: 1.25rem 0 1.25rem 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

.ads-box-container.ads-img-square .ads-box-image-link {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.ads-box-container.ads-img-square .ads-box-col-image img {
    width: 100%;
    height: 100%;
    aspect-ratio: 1 / 1;
    display: block;
    transition: transform 0.5s ease;
}

.ads-box-container.ads-img-square .ads-box-image-placeholder {
    width: 100%;
    aspect-ratio: 1 / 1;
    min-height: auto;
    border-radius: 12px;
}

/* Full Stretch Mode */
.ads-box-container.ads-img-full .ads-box-col-image {
    align-self: stretch;
    min-height: 200px;
    background-color: #f1f5f9;
}

.ads-box-container.ads-img-full .ads-box-image-link {
    display: block;
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
}

.ads-box-container.ads-img-full .ads-box-col-image img {
    width: 100%;
    height: 100%;
    display: block;
    transition: transform 0.5s ease;
}

/* Object Fit Options */
.ads-box-container.ads-fit-cover .ads-box-col-image img {
    object-fit: cover;
    object-position: center;
}

.ads-box-container.ads-fit-contain .ads-box-col-image img {
    object-fit: contain;
    object-position: center;
    background-color: #f8fafc;
}

.ads-box-container:hover .ads-box-col-image img {
    transform: scale(1.05);
}

.ads-box-image-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f1f5f9;
    color: #94a3b8;
    min-height: 200px;
}

.ads-box-image-placeholder .placeholder-icon {
    width: 48px;
    height: 48px;
}

/* Column 2/3: Content */
.ads-box-col-content {
    flex: 0 0 66.666667%;
    max-width: 66.666667%;
    padding: 1.75rem 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Badge */
.ads-box-badge-wrap {
    margin-bottom: 0.6rem;
}

.ads-box-badge {
    display: inline-block;
    padding: 3px 10px;
    font-size: 0.725rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border-radius: 9999px;
    background-color: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
    line-height: 1.4;
}

/* Title */
.ads-box-title {
    margin: 0 0 0.65rem 0 !important;
    font-size: 1.35rem !important;
    font-weight: 700 !important;
    line-height: 1.35 !important;
    letter-spacing: -0.015em;
}

.ads-box-title a {
    text-decoration: none !important;
    color: inherit;
    transition: opacity 0.2s ease;
}

.ads-box-title a:hover {
    opacity: 0.85;
}

/* Description */
.ads-box-desc {
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
    word-break: break-word;
}

/* Action Button */
.ads-box-action {
    display: flex;
    align-items: center;
    margin-top: auto;
}

.ads-box-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0.65rem 1.4rem;
    font-size: 0.925rem;
    font-weight: 600;
    text-decoration: none !important;
    border-radius: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    cursor: pointer;
}

.ads-box-btn .btn-arrow-icon {
    transition: transform 0.25s ease;
}

.ads-box-btn:hover .btn-arrow-icon {
    transform: translateX(4px);
}

/* Responsive for Mobile Devices */
@media (max-width: 768px) {
    .ads-box-wrapper {
        flex-direction: column;
    }

    .ads-box-col-image,
    .ads-box-col-content {
        flex: 0 0 100%;
        max-width: 100%;
    }

    .ads-box-col-image {
        min-height: 220px;
        height: 220px;
        position: relative;
    }

    .ads-box-col-content {
        padding: 1.25rem 1.5rem;
    }

    .ads-box-title {
        font-size: 1.2rem !important;
    }

    .ads-box-desc {
        font-size: 0.9rem;
    }

    .ads-box-btn {
        width: 100%;
    }
}
