/* Container Perspective */
.flip-container {
    perspective: 1000px;
    position: relative;
    width: 100%;
    margin-top: 20px;
}

/* Flip logic */
.flip-container.flipped .flipper {
    transform: rotateY(180deg);
}

/* Inner wrapper */
.flipper {
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: relative;
    width: 100%;
    height: 100%;
}

.flip-container:hover .back {
    -webkit-transform: rotateY(0deg);
    transform: rotateY(0deg);
}

.flip-container:hover .front {
    -webkit-transform: rotateY(180deg);
    transform: rotateY(180deg);
}

/* Common front/back styles */
.front,
.back {
    backface-visibility: hidden;
    transition: transform 0.6s;
    transform-style: preserve-3d;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* Front side (default) */
.front {
    z-index: 2;
}

/* Back side (flipped) */
.back {
    transform: rotateY(180deg);
    z-index: 1;
    padding: 0;
}

/* Responsive height */
.flip-container,
.front,
.back {
    height: 320px;
}

@media (max-width: 1000px),
(max-width: 480px) {

    .flip-container,
    .front,
    .back {
        height: 325px;
    }
}

/* Accessibility: hide non-visible side */
.front[aria-hidden="true"],
.back[aria-hidden="true"] {
    pointer-events: none;
    visibility: hidden;
}

/* Back Links */
.back ul {
    margin: 0;
    padding: 0;
}

.back li {
    list-style: none;
    padding: 5px 0;
    transition: all 0.5s ease-out;
}

.back li:hover {
    background: #fff;
    transform: scale(1.025);
}

.back a {
    color: #fff;
    padding: 10px 20px;
}

.back li:hover a {
    color: #000;
}

/* Typography and ribbons */
.flipper .back h4,
.flipper .back a {
    font-family: "Fjalla One", sans-serif;
    color: #fff;
}

.back .topper {
    background: black;
    margin: 0;
    padding: 8px 0;
}

.flipper .back .topper a {
    font-size: 22px;
}

.flipper .back .topper span {
    float: right;
    margin-right: 10px;
}

.info-section {
    margin-top: 20px;
}

.narrow-collumn {
    border-bottom: 6px solid black;
    margin-bottom: 10px;
    padding-bottom: 10px;
}

/* Ribbon styling */
.services-box-flipped {
    border-style: solid;
    border-image: url("/images/assets/ribbon.png") 27 fill stretch;
    border-width: 20px;
}
