/* global */
@import url("../globals/global.css");

/* partials */
@import url("./partials/header.css");
@import url("./partials/footer.css");

main {
    margin: var(--large) var(--xx-large);
    padding-top: var(--x-large);
    padding-bottom: var(--x-large);
    display: grid;
    gap: var(--medium);
    grid-template-columns: 1fr 1fr;
}
main article {
    height: var(--xxx-large);
}

/* first card */
#discover-card {
    display: flex;
    flex-direction: column;
    align-items: center;
}
#carousel {
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: var(--medium);
}
#carousel > div {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--small);
}
#carousel > div .icon {
    cursor: pointer;
}
#carousel > div .icon:first-child {
    transform: rotateY(180deg);
}
#flag {
    height: var(--xx-large);
    width: calc(2 * var(--xx-large));
    background: var(--rainbow-color);
}

/* second card */
#understand-card{
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
}
#understand-card > section {
    width: 100%;
    height: 100%;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
}
#understand-card > section > a {
    min-height: calc(1.5 * var(--x-large));
    width: 100%;
    text-decoration: none;
    position: relative;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: var(--larger);
}
#understand-card ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: var(--medium);
}
#understand-card ul li {
    width: fit-content;
}
.understand-card-icon {
    height: var(--larger);
}
.understand-card-icon:first-child {
    height: calc(1.4 * var(--larger));
}

/* third card */
#explore-card {
    grid-column-start: 1;
    grid-column-end: 3;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: var(--larger);
    
    overflow-x: hidden;
    overflow-y: scroll;
}
#explore-card > section {
    width: 100%;
    height: fit-content;
    margin: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-evenly;
    gap: var(--larger);
    margin-bottom: var(--medium);
}
#explore-card > section > a {
    width: 100%;
    height: min-content;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--small);
}
#explore-card > section ul {
    list-style: none;
}
#explore-card > section ul li {
    width: fit-content;
}
#explore-card > section ul li h4, #explore-card > section ul li p {
   overflow: hidden;
   display: -webkit-box;
   -webkit-line-clamp: 1; /* number of lines to show */
    line-clamp: 1; 
   -webkit-box-orient: vertical;
}
#explore-card > section ul li div {
    display: flex;
    gap: var(--small);
}
#explore-card > section ul li span {
    position: absolute;
    right: calc(-1.5 * var(--x-large));
}

/* responsive design */
@media screen and (max-width: 1140px) {
    main {
        margin: var(--large) var(--large);
    }
}
@media screen and (max-width: 960px) {
    #understand-card > section > a {
        gap: var(--large);
    }
    #understand-card > section > a p{
        font-size: 80%;
    }
}
@media screen and (max-width: 860px) {
    main {
        margin: var(--small);
    }

    #understand-card > section > a {
        font-size: 80%;
    }

    #explore-card > section > a {
        padding-bottom: var(--large);
    }
    #explore-card > section ul li span {
        left: 0px;
        bottom: calc(-1.3 * var(--medium));
    }
}
@media screen and (max-width: 768px) {
    main {
        grid-template-columns: 1fr;
    }

    .card {
        height: 40vh;
        padding: var(--medium);
    }

    #carousel, #carousel > div, #flag {
        width: 100%;
    }
    #flag {
        max-width: calc(2 * var(--xx-large));
    }

    #understand-card > section > a {
        font-size: 100%;
        gap: var(--large);
    }
    .understand-card-icon:first-child {
        height: calc(1.3 * var(--large));
    }

    #explore-card {
        grid-column-start: 1;
        grid-column-end: 2;
    }

    .emphasis-card {
        padding-left: var(--medium);
        padding-right: var(--medium);
    }
}
@media screen and (max-width: 480px) {
    .card-icon {
        height: var(--large);
    }
    .card-icon:first-child {
        height: calc(1.4 * var(--large));
    }
}