/* Annonse Carousel Styles */
.annonse-carousel-wrapper {
    position: relative;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    overflow: hidden;
}

.annonse-carousel {
    position: relative;
    display: flex;
    transition: transform 0.5s ease-in-out;
    width: 100%;
}

.annonse-slide {
    min-width: 100%;
    max-width: 100%;
    flex-shrink: 0;
    box-sizing: border-box;
    padding: 0 15px;
}

/* Link wrapper for entire slide */
.annonse-content-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.annonse-content-link:hover,
.annonse-content-link:focus {
    text-decoration: none;
    color: inherit;
}

.annonse-content {
    background: #fff;
    border: 1px solid #e5e5e5;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: grid;
    grid-template-columns: 1fr 1fr;

    /* Was min-height: 350px; -> this can create zoom-dependent cropping.
       Keep the card nice, but let content define height. */
    min-height: 0;
}

.annonse-content-link:hover .annonse-content {
    transform: translateY(-5px);
}

/* --- IMAGE: make it stable and predictable --- */
.annonse-image {
    width: 100%;
    height: 100%;
    min-height: 0;
    overflow: hidden;

    background: #f3f3f3;
}

.annonse-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Desktop: fill nicely */
    object-position: 50% 25%;
    /* Favor faces a bit higher (adjust if needed) */
    transition: transform 0.3s ease;
    display: block;
}

.annonse-content-link:hover .annonse-image img {
    transform: scale(1.05);
}

/* --- TEXT COLUMN --- */
.annonse-text {
    padding: 30px;
    display: flex;
    flex-direction: column;
    justify-content: center;

    /* Important for flex/grid overflow issues */
    min-width: 0;
}

.annonse-category {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 5px 15px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    width: fit-content;
}

/* Hide any duplicate category labels that might come from theme */
.annonse-text .annonse-category+.annonse-category,
.annonse-excerpt span[style],
.annonse-excerpt .category-label {
    display: none !important;
}

/* --- WRAP FIXES (title + excerpt) --- */
.annonse-title,
.annonse-excerpt {
    /* allow wrapping even with long words/urls and flex/grid quirks */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
    hyphens: auto;
}

.annonse-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 15px 0;
    color: #2c3e50;
    line-height: 1.3;
}

.annonse-excerpt {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    margin-bottom: 20px;

    /* Avoid huge overlay/overflow in some browsers */
    min-width: 0;
}

.annonse-excerpt p {
    margin: 0;
}

.annonse-link {
    display: inline-block;
    background: #000;
    color: #fff;
    padding: 12px 30px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.3s ease;
    width: fit-content;
}

.annonse-link:hover {
    background: #333;
}

.annonse-no-results {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    font-size: 16px;
}

/* Navigation Buttons */
.carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 30px;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    color: #2c3e50;
}

.carousel-nav:hover {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.carousel-nav.prev {
    left: 10px;
}

.carousel-nav.next {
    right: 10px;
}

.carousel-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* Carousel Dots */
.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 20px;
}

.carousel-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 0;
}

.carousel-dot.active {
    background: #8b6f8f;
    width: 30px;
    border-radius: 6px;
}

.carousel-dot:hover {
    background: #bbb;
}

/* Responsive Design */
@media (max-width: 768px) {
    .annonse-content {
        grid-template-columns: 1fr;
    }

    /* Mobile: show full image (no cut faces) */
    .annonse-image {
        aspect-ratio: 16 / 10;
        /* a bit taller looks better on mobile */
    }

    .annonse-image img {
        object-fit: contain;
        /* show whole image */
        object-position: center;
    }

    .annonse-text {
        padding: 20px;
    }

    .annonse-title {
        font-size: 20px;
    }

    .annonse-excerpt {
        font-size: 14px;
    }

    .carousel-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .carousel-nav.prev {
        left: 5px;
    }

    .carousel-nav.next {
        right: 5px;
    }
}

@media (max-width: 480px) {
    .annonse-slide {
        padding: 0 10px;
    }

    .annonse-image {
        aspect-ratio: 4 / 3;
        /* slightly taller on very small screens */
    }

    .annonse-text {
        padding: 15px;
    }

    .annonse-title {
        font-size: 18px;
    }
}