/* File for re-usable component CSS */

/* –––––––––––––––––––––––––––––– BUTTONS –––––––––––––––––––––––––––––––––*/
.btn {
    padding: 0.7em 1.5em;
    border-radius: var(--br-btn);
    font-size: var(--fs-s);
    font-weight: var(--fw-btn);
    text-align: center;
    text-decoration: none;
    display: inline-flex;
}

/* Colors */

.btn-blue {
    background-color: var(--trixie-blue);
    color: var(--trixie-red);
}

.btn-red {
  background-color: var(--trixie-red);
  color: var(--trixie-blue);
}

.btn-red:hover {
    background-color: var(--trixie-orange);
}

.btn-orange {
    background-color: var(--trixie-orange);
    color: var(--trixie-blue);
}

.btn-pink {
    background-color: var(--trixie-pink);
    color: var(--trixie-beige);
}

/* Sizes */
.btn-s {
    font-size: 1rem;
    padding: 0.5em 1.25em;
}

/* Icons */
.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
}

/* –––––––––––––––––––––––––––––– SHAPES –––––––––––––––––––––––––––––––––*/
.trixie-shape {
    --shape-offset-y: -0.35;
    --shape-offset-x: -0.35;
    --shape-rotate-init: 0deg;
    --shape-scale: 1;
    --background-color: transparent;
    position: absolute;
    font-family: var(--font-heading);
    letter-spacing: 0.05em;
    transform: rotate(var(--shape-rotate-final));
    --animation-delay: calc(var(--delay-index) * var(--stagger-base) + var(--stagger-base));
}

.trixie-shape[data-animate="true"] {
    --shape-scale-init: 0;
    opacity: 0;
}

.a-triggered .trixie-shape[data-animate="true"] {
    animation: trixie-shape-animate 1000ms var(--animation-delay) var(--cubic-bezier) forwards;
}

@keyframes trixie-shape-animate {
    0% {
        transform: rotate(var(--shape-rotate-init)) scale(var(--shape-scale-init));
        opacity: 0;
    }
    40%,48% {
        transform: rotate(var(--shape-rotate-2)) scale(1.3);
        opacity: 1;
    }
    80% {
        transform: rotate(var(--shape-rotate-3)) scale(0.975);
        opacity: 1;
    }
    100% {
        transform: rotate(var(--shape-rotate-final)) scale(1);
        opacity: 1;
    }
}

.trixie-shape[shape-tilt="left"] {
    --shape-rotate-init: 100deg;
    --shape-rotate-2: -20deg;
    --shape-rotate-3: -10deg;
    --shape-rotate-final: -15deg;
}

.trixie-shape[shape-tilt="right"] {
    --shape-rotate-init: -100deg;
    --shape-rotate-2: 20deg;
    --shape-rotate-3: 10deg;
    --shape-rotate-final: 15deg;
}

.trixie-shape[shape-fill="green"] {
    --background-color: var(--trixie-green);
}

.trixie-shape[shape-fill="pink"] {
    --background-color: var(--trixie-pink);
}

.trixie-shape[shape-fill="orange"] {
    --background-color: var(--trixie-orange);
}

.trixie-shape[shape-fill="red"] {
    --background-color: var(--trixie-red);
}

.trixie-shape[shape-color="green"] {
    color: var(--trixie-green);
}

.trixie-shape[shape-color="pink"] {
    color: var(--trixie-pink);
}

.trixie-shape[shape-color="blue"] {
    color: var(--trixie-blue);
}

.trixie-shape[shape-color="beige"] {
    color: var(--trixie-beige);
}

.trixie-shape[shape-color="orange"] {
    color: var(--trixie-orange);
}

.trixie-shape[shape-position="tl"] {
    top: calc(var(--shape-offset-y) * var(--e-height));
    left: calc(var(--shape-offset-x) * var(--e-width));
}

.trixie-shape[shape-position="tr"] {
    top: calc(var(--shape-offset-y) * var(--e-height));
    right: calc(var(--shape-offset-x) * var(--e-width));
}

.trixie-shape__inner {
    display: grid;
    place-items: center;
}

.trixie-shape__inner > * {
    grid-area: 1 / 1;
}

.trixie-shape svg {
    width: 100%;
    width: -webkit-fill-available;
    height: 100%;
    z-index: -1;
    pointer-events: none;
}

.trixie-shape .object {
    fill: var(--background-color);
}

.trixie-shape__text {
    padding: 1em;
    text-align: center;
    white-space: nowrap;
}

.trixie-shape[shape-name="bar"] .trixie-shape__text {
    background-color: var(--background-color);
    border-radius: 100px;
}

.trixie-shape[shape-name="flower-3"] .trixie-shape__text {
    padding: 1.35em;
}

.trixie-shape[shape-name="squircle"] .trixie-shape__text {
    padding: 0.9em;
}

.trixie-shape[shape-name="bar"] .trixie-shape__text {
    padding: 0.4em 1em;
}

.trixie-shape[shape-size="s"] .trixie-shape__text {
    font-size: var(--fs-s);
}

.trixie-shape[shape-size="m"] .trixie-shape__text {
    font-size: var(--fs-l);
}

.trixie-shape[shape-size="l"] .trixie-shape__text {
    font-size: var(--fs-xl);
}

@media screen and (max-width: 749px) {    
    .trixie-shape[shape-size="m"] {
        --shape-offset-y: -0.2;
        --shape-offset-x: -0.2;
    }
    
    .trixie-shape[shape-size="s"] {
        --shape-offset-y: -0.2;
        --shape-offset-x: -0.2;
    }
}

/* –––––––––––––––––––––––––––––– CAROUSEL –––––––––––––––––––––––––––––––––*/
.trixie-carousel {
    position: relative;
    width: 350px;
    max-width: 100%;
}

.trixie-carousel__card-wrap {
    border-radius: 0 0 var(--br-card) var(--br-card);
    overflow: hidden;
}

.trixie-carousel__card {
    position: relative;
    width: 100%;
    height: 450px;
    border-radius: 99999px 99999px 0 0;
    transition: background-color var(--transition-normal) var(--cubic-bezier);
}

.trixie-carousel > .trixie-shape {
    --shape-offset-y: -0;
}

.trixie-carousel > .trixie-shape {
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal) var(--cubic-bezier);
}

.trixie-carousel > .trixie-shape.is-active {
    opacity: 1;
    pointer-events: auto;
}

.trixie-carousel__viewport {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    border-radius: 99999px 99999px 0 0;
}

.trixie-carousel__slide {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-m);
    opacity: 0;
    transform: translateX(0);
    pointer-events: none;
}

.trixie-carousel__slide.is-active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
    transition: transform var(--transition-slow) var(--cubic-bezier);
}

.trixie-carousel__slide.is-exiting {
    opacity: 1;
    transition: opacity var(--transition-normal) var(--cubic-bezier);
}

.trixie-carousel__slide.is-exiting.fade-out {
    opacity: 0;
}

.trixie-carousel__slide.enter-left {
    opacity: 0;
    transform: translateX(calc(-100% - var(--spacing-xl)));
}

.trixie-carousel__slide.enter-right {
    opacity: 0;
    transform: translateX(calc(100% + var(--spacing-xl)));
}

.trixie-carousel__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.trixie-carousel__dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-xs);
    padding-top: var(--spacing-m);
}

.trixie-carousel__dot {
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: none;
    padding: 0;
    background-color: var(--trixie-red);
    cursor: pointer;
    transition: transform var(--transition-fast) var(--cubic-bezier);
}

.trixie-carousel__dot.is-active {
    transform: scale(1.75);
}

/* Text */
.trixie-carousel__text {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-s);
    padding: var(--spacing-m) var(--spacing-l);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-fast) var(--cubic-bezier);
}

.trixie-carousel__card[data-active-color="green"] .trixie-carousel__text {
    color: var(--trixie-text-light);
}

.trixie-carousel__text.is-active {
    opacity: 1;
    pointer-events: auto;
}

.trixie-carousel__title {
    font-family: var(--font-body);
    font-size: var(--fs-s);
    line-height: var(--lh-body);
    font-weight: var(--fw-heading);
}

.trixie-carousel__category {
    font-size: var(--fs-s);
    line-height: var(--lh-body);
}

.trixie-carousel__meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0;
}

.trixie-carousel__info {
    font-size: var(--fs-xs);
    line-height: var(--lh-body);
}

/* Size: l */
.trixie-carousel--l {
    width: 500px;
}

.trixie-carousel--l .trixie-carousel__card {
    height: 650px;
}

.trixie-carousel--l .trixie-carousel__slide {
    padding: var(--spacing-xl) var(--spacing-xl) var(--spacing-4xl) var(--spacing-xl);
}

@media screen and (min-width: 750px) {
    .trixie-carousel--l > .trixie-shape {
        --shape-offset-y: 0.3;
    }
}

@media screen and (max-width: 749px) {
    .trixie-carousel,
    .trixie-carousel--l {
        max-width: 90%;
    }

    .trixie-carousel__card {
        height: 50vh;
    }

    .trixie-carousel--l .trixie-carousel__card {
        max-height: 60vh;
    }

    .trixie-carousel--l .trixie-carousel__slide {
        padding: var(--spacing-xl) var(--spacing-xl) calc(var(--spacing-4xl) + var(--spacing-s)) var(--spacing-xl);
    }

    .trixie-carousel > .trixie-shape {
        --shape-offset-y: -0;
        --shape-offset-x: -0.275;
    }

    .trixie-carousel__dot {
        width: 12px;
        height: 12px;
    }

    .trixie-carousel__dot.is-active {
        transform: scale(1.6);
    }
}

/* –––––––––––––––––––– CAROUSEL IMAGES VARIANT –––––––––––––––––––––––––––*/
.trixie-carousel--images {
    width: auto;
}

.trixie-carousel--images .trixie-carousel__viewport {
    aspect-ratio: 1;
    height: auto;
    border-radius: 0;
    overflow: visible;
    max-height: 60vh;
}

.trixie-carousel--images .trixie-carousel__slide {
    padding: 0;
    transition: opacity var(--transition-normal) var(--cubic-bezier);
}

.trixie-carousel--images .trixie-carousel__slide.is-active {
    transition: opacity var(--transition-normal) var(--cubic-bezier);
}

.trixie-carousel--images .trixie-carousel__slide.enter-left,
.trixie-carousel--images .trixie-carousel__slide.enter-right {
    transform: translateX(0);
}

.trixie-carousel--images .trixie-carousel__image {
    object-fit: cover;
    max-height: 60vh;
    max-width: 100%;
    mask-image: url('/wp-content/themes/trixie/assets/vector/shapes/star.svg');
    -webkit-mask-image: url('/wp-content/themes/trixie/assets/vector/shapes/star.svg');
    mask-size: contain;
    -webkit-mask-size: contain;
    mask-repeat: no-repeat;
    -webkit-mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-position: center;
}

.trixie-carousel__clip-def {
    position: absolute;
    width: 0;
    height: 0;
    pointer-events: none;
}

/* –––––––––––––––––––––––––––––– ARCHIVE –––––––––––––––––––––––––––––––––*/
.trixie-archive__categories {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-l);
}

.trixie-archive__categories > span {
    margin-right: var(--spacing-xs);
}

.trixie-archive__cat-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    font: inherit;
    font-size: inherit;
    color: inherit;
    text-decoration: none;
    transition: text-decoration var(--transition-fast) var(--cubic-bezier);
}

.trixie-archive__cat-btn:hover,
.trixie-archive__cat-btn.is-active {
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 0.05em;
}

.trixie-archive__cat-btn:not(:last-child)::after {
    content: "/ ";
    text-decoration: none;
    display: inline-block;
    margin-left: var(--spacing-xs);
}

.trixie-archive__card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    opacity: 0;
    transition: opacity var(--transition-slow) var(--cubic-bezier);
}

.trixie-archive__card.is-visible {
    opacity: 1;
}

.trixie-archive__image-wrap {
    margin-right: 8px;
    position: relative;
    overflow: visible;
    width: 100%;
}

.trixie-archive__image-bg {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 100%;
    height: auto;
    aspect-ratio: 1.51;
    background-color: var(--trixie-beige);
}

.trixie-archive__image {
    position: relative;
    width: 100%;
    height: auto;
    aspect-ratio: 1.51;
    display: block;
    object-fit: cover;
}

.trixie-archive__meta {
    padding-top: var(--spacing-s);
}

.trixie-archive__title {
    margin-top: var(--spacing-m);
    text-align: center;
}

.trixie-archive__excerpt {
    margin-top: var(--spacing-s);
    text-align: center;
    width: 75%;
}

.trixie-archive__btn-wrap {
    margin-top: var(--spacing-s);
}

/* Placeholders */
.trixie-archive__card--placeholder {
    opacity: 1;
    transform: translateY(0);
}

.trixie-archive__placeholder-img {
    width: 100%;
    padding-bottom: 75%;
    background: var(--trixie-beige);
    animation: trixie-pulse 1.2s ease-in-out infinite;
}

.trixie-archive__placeholder-line {
    display: block;
    height: 1em;
    border-radius: 4px;
    background: var(--trixie-beige);
    animation: trixie-pulse 1.2s ease-in-out infinite;
}

.trixie-archive__load-more {
    /* Unset browser default button styles */
    background: none;
    border: none;
    padding: 0;
    color: inherit;
    /* Custom styles */
    text-align: center;
    font-size: var(--fs-l);
    font-weight: var(--fw-body);
    text-decoration: none;
    color: var(--trixie-text-dark);
    opacity: 0.5;
    margin-top: var(--spacing-m);
    cursor: pointer;
}

.trixie-archive__load-more:hover {
    opacity: 0.75;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 0.05em;
}

.trixie-archive__slider-btn {
    display: none;
}

@media screen and (max-width: 749px) {
    .trixie-archive__categories {
        column-gap: calc(var(--spacing-xs) * 0.5);
        row-gap: 0;
        font-size: var(--fs-s);
        margin-top: var(--spacing-l);
    }


    .trixie-archive__categories > span {
        margin-right: calc(var(--spacing-xs) * 0.5);
    }

    .trixie-archive__cat-btn::after {
        margin: 0 !important;
    }

    .trixie-archive__image-wrap {
        margin-bottom: 10px;
    }

    .trixie-archive__meta {
        padding-top: var(--spacing-xs);
        font-size: var(--fs-xs);
    }

    .trixie-archive__title {
        font-size: var(--fs-xl);
    }

    .trixie-archive__excerpt {
        margin-top: var(--spacing-xs);
        width: 90%;
    }

    .trixie-archive__btn-wrap > .btn {
        font-size: var(--fs-xs);
    }

    .trixie-archive--slider .trixie-archive__grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        gap: 0;
        padding: 0;
    }

    .trixie-archive--slider .trixie-archive__grid::-webkit-scrollbar {
        display: none;
    }

    .trixie-archive--slider .trixie-archive__grid > .trixie-archive__card {
        flex: 0 0 100%;
        scroll-snap-align: start;
        padding: var(--spacing-l) var(--spacing-3xl) 0 var(--spacing-3xl);
    }

    .trixie-archive[data-mobile-layout="grid"] .trixie-archive__grid > .trixie-archive__card:nth-child(1),
    .trixie-archive[data-mobile-layout="grid"] .trixie-archive__grid > .trixie-archive__card:nth-child(2) {
        grid-column: span 2;
    }

    .trixie-archive[data-mobile-layout="grid"] .trixie-archive__grid > .trixie-archive__card:not(:nth-child(1)):not(:nth-child(2)) .trixie-shape {
        display: none;
    }

    .trixie-archive[data-mobile-layout="grid"] .trixie-archive__grid > .trixie-archive__card:not(:nth-child(1)):not(:nth-child(2)) .trixie-archive__image-bg {
        top: 5px;
        left: 5px;
    }

    .trixie-archive__slider-wrap {
        position: relative;
        display: flex;
        align-items: center;
    }

    .trixie-archive--slider .trixie-archive__slider-btn {
        position: absolute;
        top: 100px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
        width: 24px;
        height: 24px;
        border: none;
        background: none;
        cursor: pointer;
        padding: 0;
        z-index: 2;
    }

    .trixie-archive--slider .trixie-archive__slider-btn--prev {
        left: var(--spacing-s); 
    }

    .trixie-archive--slider .trixie-archive__slider-btn--next {
        right: var(--spacing-s);
    }

    .trixie-archive__slider-btn img {
        width: 16px;
        height: auto;
    }

    .trixie-archive__slider-btn--prev img {
        transform: rotate(180deg);
    }
}

@keyframes trixie-pulse {
    0%, 100% { opacity: 0.4; }
    50% { opacity: 1; }
}

/* –––––––––––––––––––––––––––– MASKED IMAGE –––––––––––––––––––––––––––––––––*/
.masked-image-wrapper {
    position: relative;
    width: 100%;
}

.masked-image-wrapper .masked-image-container {
    position: absolute;
    overflow: hidden;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
}

.masked-image-wrapper .masked-image-clip {
    z-index: 2;
}

.masked-image-wrapper .masked-image {
    display: block;
    width: auto;
    height: 100%;
    object-fit: contain;
    object-position: bottom center;
}

.masked-image-wrapper .background-shape {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.masked-image-wrapper .mask-shape {
    position: absolute;
    width: 0;
    height: 0;
    overflow: hidden;
}

/* –––––––––––––––––––––––––––––– IMAGE BG OFFSET –––––––––––––––––––––––––––––––––*/
.image-bg-offset {
    position: relative;
    background-color: var(--trixie-beige);
    border-radius: var(--br-card);
}

.image-bg-offset > img {
    aspect-ratio: 1.51;
    object-fit: cover;
    object-position: center;
    border-radius: var(--br-card);
    transform: translate(-10px, -10px);
}

.image-bg-offset--lg > img {
    transform: translate(-15px, -15px);
}

/* –––––––––––––––––––––––––––––– FAQ –––––––––––––––––––––––––––––––––*/
.trixie-faq__search {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    margin-bottom: var(--spacing-m);
}

.trixie-faq__input {
    width: 100%;
    border: none;
    background: rgba(0, 0, 0, 0.04);
    border-radius: var(--br-btn);
    padding: var(--spacing-xs) var(--spacing-s);
    outline: none;
}

.trixie-faq__input::placeholder {
    color: rgba(0, 0, 0, 0.4);
}

.trixie-faq__search-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: none;
    background-color: var(--trixie-red);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

.trixie-faq__search-icon {
    width: 26px;
    height: 26px;
    filter: brightness(0) invert(1);
}

.trixie-faq__item {
    border-bottom: 2px solid var(--trixie-text-dark);
    overflow: hidden;
}

.trixie-faq__item.is-hidden {
    display: none;
}

.trixie-faq__question {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--spacing-m);
    padding: var(--spacing-s) 0;
    background: none;
    border: none;
    text-align: left;
    cursor: pointer;
    font-family: var(--font-body);
    font-size: var(--fs-xl);
}

.trixie-faq__question,
.trixie-faq__question span {
    color: var(--trixie-text-dark);
}

.trixie-faq__chevron {
    width: 12px;
    height: auto;
    flex-shrink: 0;
    transition: all var(--transition-fast) var(--cubic-bezier);
    transform: scale(1.75) translate(-50%, 0);
}

.trixie-faq__item.is-open .trixie-faq__chevron {
    transform: rotate(-90deg) scale(1.75) translate(4%, -33%);
}

.trixie-faq__answer {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-normal) var(--cubic-bezier);
}

.trixie-faq__answer-inner {
    padding: 0 0 var(--spacing-m) 0;
}

.trixie-faq__load-more-wrap {
    margin-top: var(--spacing-l);
}

.trixie-faq__load-more {
    background: none;
    border: none;
    padding: 0;
    font-size: var(--fs-l);
    font-weight: var(--fw-body);
    color: var(--trixie-text-dark);
    opacity: 0.5;
    cursor: pointer;
}

.trixie-faq__load-more:hover {
    opacity: 0.75;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-thickness: 0.05em;
}

@media screen and (max-width: 749px) {
    .trixie-faq__chevron {
        width: 12px;
        height: auto;
        flex-shrink: 0;
        transition: all var(--transition-fast) var(--cubic-bezier);
        transform: scale(1.25) translate(-50%, 0);
    }
    
    .trixie-faq__item.is-open .trixie-faq__chevron {
        transform: rotate(-90deg) scale(1.25) translate(4%, -33%);
    }
}