/**
 * @copyright Copyright (C) 2025 Matamata-Piako District Council. All rights reserved.
 * @license Proprietary
 * @author Matamata-Piako District Council <https://www.mpdc.govt.nz>
 * @link https://www.mpdc.govt.nz
 * 
 * Flip Links Module
 * 
 * This script handles the animation of flip links in the Joomla 5 module.
 * It initializes the module, checks if elements are in the viewport,
 * and starts the flip animation for each link item.
 * 
 */

.fliplink-item {
    position: relative;
}

.fliplink-item a {
    display: block;
    position: relative;
    text-decoration: none;
}

.fliplink-item a.not-started {
    width: 0;
    margin-left: 50%;
    margin-top: 50%;
}

.fliplink-overlay>i {
    border: 2px solid #fff;
    -webkit-border-radius: 50%;
    -moz-border-radius: 50%;
    border-radius: 50%;
    -webkit-box-sizing: border-box;
    -moz-box-sizing: border-box;
    box-sizing: border-box;
    color: #fff;
    /* content: "\f0c1"; */
    /* font-family: FontAwesome; */
    font-size: 22px;
    height: 52px;
    left: 50%;
    line-height: 50px;
    margin: -32px 0 0 -32px;
    opacity: 0;
    filter: alpha(opacity=0);
    position: absolute;
    text-align: center;
    top: 65%;
    -webkit-transition: all .2s ease-out;
    -moz-transition: all .3s ease-out;
    -ms-transition: all .3s ease-out;
    -o-transition: all .3s ease-out;
    transition: all .3s ease-out;
    width: 52px;
}

.fliplink-item .fliplink-overlay {
    display: inline;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    background: #7484FF;
    -webkit-transition: all .2s ease-out;
    -moz-transition: all .3s ease-out;
    -ms-transition: all .3s ease-out;
    -o-transition: all .3s ease-out;
    transition: all .3s ease-out;
}

.fliplink-item:hover .fliplink-overlay {
    opacity: 1;
    filter: alpha(opacity=100);
}

.fliplink-item:hover .fliplink-overlay>i {
    opacity: 1;
    top: 50%;
}

.fliplink-item.start a {
    width: 100%;
    -webkit-animation: fliplinks 0.3s ease-out forwards;
    -moz-animation: fliplinks 0.3s ease-out forwards;
    -ms-animation: fliplinks 0.3s ease-out forwards;
    -o-animation: fliplinks 0.3s ease-out forwards;
    animation: fliplinks 0.3s ease-out forwards;
}

@-moz-keyframes fliplinks {
    0% {
        width: 0px;
        margin-left: 50%;
        margin-top: 50%;
    }

    100% {
        width: 100%;
        margin-left: 0;
        margin-top: 0;
    }
}

@-webkit-keyframes fliplinks {
    0% {
        width: 0px;
        margin-left: 50%;
        margin-top: 50%;
    }

    100% {
        width: 100%;
        margin-left: 0;
        margin-top: 0;
    }
}