:root {
    /* MicroFeeder-inspirerede farver (Professionel mørkegrå og ren hvid/grå) */
    --mf-dark: #1a1a1a;
    --mf-text: #333333;
    --mf-bg: #f5f5f5;
    --card-bg: #f7f7f7;
    --border-color: #e0e0e0;
}

.testimonial-section {
    margin: 24px auto;
    position: relative;
    background: linear-gradient(180deg, #dadada 0%, #eceff2 100%);
    border: 1px solid #e0e0e0;
    padding: 36px 28px 36px 28px;
    color: var(--mf-text);
    overflow: hidden;
}

.testimonial-layout {
    display: grid;
    grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
}

/* Tablet: Intro takes 33%, carousel takes 66% */
@media (max-width: 1024px) {
    .testimonial-section {
        padding: 28px 20px 28px 20px;
    }

    .testimonial-layout {
        grid-template-columns: 1fr 2fr;
        gap: 20px;
    }
}

/* Mobile: Stack vertically */
@media (max-width: 768px) {
    .testimonial-section {
        padding: 24px 16px 24px 16px;
    }

    .testimonial-layout {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .testimonial-intro {
        position: relative !important;
        top: 0 !important;
    }

    .carousel-wrapper {
        width: 100%;
    }

    .testimonial-carousel {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .testimonial-section .headline h2,
    .testimonial-section .headline h2 span {
        font-size: 1.3em !important;
    }

    .testimonial-section p.subtitle {
        font-size: 0.9rem;
    }

    .testimonial-card::before {
        font-size: 5rem;
        top: -8px;
    }

}

/* Small mobile: Adjust padding */
@media (max-width: 480px) {
    .testimonial-section {
        padding: 20px 12px 20px 12px;
    }
}

.testimonial-intro {
    position: sticky;
    top: 24px;
    position: relative;
    z-index: 1;
}

.testimonial-intro > * {
    position: relative;
    z-index: 1;
}

.testimonial-section .headline h2,
.testimonial-section .headline h2 span {
    color: var(--mf-dark);
}

.testimonial-section p.subtitle {
    font-size: 1rem;
    color: #4f4f4f;
    margin-bottom: 0;
    text-align: left;
    line-height: 1.6;
}

.carousel-wrapper {
    position: relative;
    width: 100%;
    padding-top: 0;
}

.testimonial-carousel {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 18px;
    width: 100%;
    padding: 4px 0 10px;
    position: relative;
}

@media (max-width: 1024px) {
    .testimonial-carousel {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

@media (max-width: 768px) {
    .testimonial-carousel {
        gap: 12px;
    }
}

.testimonial-card {
    flex: none;
    width: 100%;
    min-width: unset;
    scroll-snap-align: none;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 0;
    padding: 24px;
    position: relative;
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 3s ease;
    z-index: 1;
}

.testimonial-card.is-hidden {
    display: none;
    opacity: 0;
    pointer-events: none;
    z-index: -1;
}

.testimonial-card.is-fading {
    position: absolute;
    top: 4px;
    width: calc(50% - 9px);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    display: flex;
    background: #ffffff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.12);
}

.testimonial-card.is-fading-left {
    left: 0;
    right: auto;
}

.testimonial-card.is-fading-right {
    right: 0;
    left: auto;
}

.testimonial-card.is-entering {
    position: relative;
    display: flex;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}

.testimonial-card.is-visible {
    position: relative;
    display: flex;
    opacity: 1;
    pointer-events: auto;
    z-index: 1;
}

@media (max-width: 1024px) {
    .testimonial-card.is-fading {
        width: 100%;
        left: 0;
        right: auto;
    }
}

.testimonial-card:hover {
    transform: translateY(-3px);
    box-shadow: 2px 4px 8px rgba(0, 0, 0, 0.16);
}

.testimonial-card::after {
    content: "";
    position: absolute;
    right: 12px;
    bottom: 14px;
    width: 120px;
    height: 24px;
    background-image: url('../images/MicroFeeder_logo_309x64_white_transparent.png');
    background-repeat: no-repeat;
    background-size: contain;
    background-position: center;
    opacity: 0.08;
    z-index: 0;
    pointer-events: none;
}

.testimonial-text {
    font-size: 0.96rem;
    line-height: 1.55;
    color: #2d2d2d;
    margin-bottom: 18px;
    position: relative;
    z-index: 1;
}

.testimonial-media {
    width: 100%;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
}

.testimonial-media .testimonial-work {
    margin-bottom: 12px;
    max-width: 100% !important;
    width: 100%;
}

.testimonial-media .testimonial-work .testimonial-work-trigger,
.testimonial-media .testimonial-work .thumbnail-img,
.testimonial-media .testimonial-work .overflow-hidden {
    position: relative;
    overflow: hidden;
    display: block;
    width: 100%;
    cursor: pointer;
    line-height: 0;
}

.testimonial-media .testimonial-work img {
    border: 1px solid #dddddd;
    width: 100% !important;
    display: block;
    height: auto;
    left: 0 !important;
    margin-left: 0 !important;
    transition: transform 0.8s ease-in-out;
    object-fit: cover;
}

/* Mobile/Tablet Portrait - Image Focusing Options */
@media (max-width: 768px) {
    .testimonial-media .testimonial-work .overflow-hidden {
        height: 300px; /* Set fixed height for mobile portrait */
    }

    .testimonial-media .testimonial-work img {
        height: 100%;
        object-fit: cover;
        object-position: center; /* Default focus */
    }

    /* INDIVIDUAL CARD FOCUS SETTINGS */
    /* Card 1 - Focus on Center */
    .testimonial-card:nth-child(1) .testimonial-work img {
        object-position: right;
    }

    /* Card 2 - Focus on Left */
    .testimonial-card:nth-child(2) .testimonial-work img {
        object-position: center;
    }

    /* Card 3 - Focus on Right */
    .testimonial-card:nth-child(3) .testimonial-work img {
        object-position: right;
    }

    /* Card 4 - Focus on Center */
    .testimonial-card:nth-child(4) .testimonial-work img {
        object-position: left;
    }

    /* Card 5 - Focus on Left */
    .testimonial-card:nth-child(5) .testimonial-work img {
        object-position: left;
    }

    /* Card 6 - Focus on Right */
    .testimonial-card:nth-child(6) .testimonial-work img {
        object-position: center;
    }

    /* Card 7 - Focus on Center */
    .testimonial-card:nth-child(7) .testimonial-work img {
        object-position: center;
    }
}

.testimonial-media .testimonial-work:hover img,
.testimonial-media .testimonial-work .overflow-hidden:hover img,
.testimonial-media .testimonial-work .overflow-hidden.is-active img {
    transform: scale(1.15) rotate(2deg);
}

.testimonial-media .testimonial-work .overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.28);
    opacity: 0;
    transition: opacity 0.25s ease;
    z-index: 5;
    pointer-events: none;
}

.testimonial-media .testimonial-work:hover .overlay,
.testimonial-media .testimonial-work .overflow-hidden:hover .overlay,
.testimonial-media .testimonial-work .overflow-hidden.is-active .overlay {
    opacity: 1;
}

.testimonial-media .testimonial-work .icon {
    color: #ffffff;
    font-size: 2rem;
    text-decoration: none;
    pointer-events: auto;
    z-index: 6;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 1;
    border-top: 1px solid #ececec;
    padding-top: 14px;
}

.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid #cdd9e2;
    flex-shrink: 0;
}

.user-details h4 {
    margin: 0;
    font-size: 1rem;
    color: var(--mf-dark);
    font-weight: 600;
}

.user-details p {
    margin: 2px 0 0 0;
    font-size: 0.82rem;
    color: #6f6f6f;
}

.carousel-btn {
    display: none !important;
}

body.modal-open {
    overflow: hidden;
    position: fixed;
}

/* Full-screen modal for testimonial images */
.modal.fade {
    background-color: rgba(0, 0, 0, 0.95);
}

.modal_wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1050;
}

.modal-dialog {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    margin: 0;
}

.modal-content {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    border: none;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.modal-content img:not(.modal-logo) {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    margin: 0;
    padding: 0;
}

.modal-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    padding: 12px;
    text-align: center;
    color: #fff;
    font-size: 1.2em;
    z-index: 2;
    backdrop-filter: blur(5px);
}

.modal-content .close i {
    display: none !important;
}

.modal-content .close + .close {
    display: none !important;
}

span[data-dismiss="modal"] {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    width: 52px !important;
    height: 52px !important;
    background-color: #555 !important;
    border-radius: 50% !important;
    cursor: pointer;
    z-index: 2 !important;
    opacity: 1;
    display: block !important;
    font-size: 2rem;
    line-height: 50px !important;
    text-align: center;
    color: #fff;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transition: background-color 0.3s ease;
}

span[data-dismiss="modal"]::before {
    content: "✕";
    font-weight: bold;
    color: #fff;
}

span[data-dismiss="modal"]:hover {
    background-color: #72c02c !important;
}

.modal-logo {
    position: absolute !important;
    top: 20px !important;
    left: 20px !important;
    width: 240px !important;
    z-index: 2 !important;
    opacity: 1;
    filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.55));
}

.modal-content .close:hover {
    background-color: #72c02c !important;
}
