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

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

main {
    margin: var(--large) var(--x-large);
    padding-top: var(--x-large);
    padding-bottom: var(--x-large);

    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--small);
}

/* text */
main > article{
    display: flex;
    flex-direction: column;
    gap: var(--small);

    grid-column-start: 1;
    grid-column-end: 3;
}
main article #post_info {
    font-size: small;
    margin-bottom: var(--small);
}
main > article p:not(:first-of-type){
    margin: var(--small) 0 var(--small) 0;
}
article dt {
    margin-top: var(--medium);
}
article dd {
    margin-left: var(--large);
}
main > article section > div {
    height: fit-content;
    display: grid;
    grid-template-columns: auto auto;
    gap: var(--small);
    margin-bottom: var(--small);
}
main > article section > div:first-of-type p{
    grid-column-start: 1;
    grid-column-end: 2;
}
main > article section > div:first-of-type figure {
    grid-area: 1 / 2 / span 2 / span 1;
}
main > article section > div:nth-of-type(2) figure {
    grid-area: 1 / 1 / span 2 / span 1;
      
}
article figure {
    width: calc(2*var(--xx-large));
    height: fit-content;
    padding: var(--small);
    border: 1px solid #000;
    background-color: #fff;

    display: flex;
    flex-direction: column;
    justify-self: flex-end;
}
article figure img {
    max-height: calc(2*var(--xx-large));
    max-width: calc(2*var(--xx-large));
    background-color: var(--card-color);
}
article figure figcaption {
    text-align: center;
}

/* aside */
main > aside {
    padding: var(--large) var(--medium);
    background-color: var(--card-color);

    grid-column-start: 3;
    grid-column-end: 4;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--medium);
}
main > aside > section {
    display: flex;
    flex-direction: column;
    gap: var(--medium);
}
main aside article {
    text-align: left;
    font-size: calc(1em*0.8);
}
main aside > section:first-of-type article  *{
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    line-clamp: 1;
    -webkit-box-orient: vertical;
}
main aside article ul {
    list-style: none;
}
main aside > section:nth-of-type(2) article {
    display: flex;
    gap: var(--small);
}
main aside > section:nth-of-type(2) article img {
    padding-top: 1em;
    width: calc(1.25*var(--larger));
    height: calc(1.25*var(--larger));
    border-radius: 50%;
}
main aside > section:nth-of-type(2) article section{
    position: relative;
    display: flex;
    flex-direction: column;
    border-radius: 0 var(--medium) var(--medium);
}
/* disable the hover efect of the 'emphasis-card' class */
main aside > section:nth-of-type(2) article section:hover {
    transform: none; 
}
main aside > section:nth-of-type(2) article section p{
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
}
main aside > section:nth-of-type(2) article section p:not(:first-of-type) {
    display: none;
}
main aside > section:nth-of-type(2) article section small {
    position: absolute;
    bottom: -2px;
    align-self: flex-end;
}

/* fixed utility tools */
#util {
    position: fixed;
    right: var(--small);
    bottom: var(--medium);
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}
#anchor_top {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--card-color);
    height: calc(1.75*var(--large));
    width: calc(1.75*var(--large));
    border-radius: 50%;
}
#anchor_top img{
    transform: rotateZ(-90deg);
}
#reading_progress_info {
    font-size: small;
    max-width: calc(1.5*var(--x-large));
    
    display: flex;
    flex-direction: column;
}

@media screen and (max-width: 1050px) {
    main aside > section:first-of-type header {
        font-size: 80%;
    }
}
@media screen and (max-width: 990px) {
    main > article section > div p:first-of-type {
        grid-area: 1 / 1 / span 2 / span 2;
    }
    main > article section > div:first-of-type figure {
        align-self: center;
        grid-area: auto;
    }
    main > article section > div:nth-of-type(2) figure {
        align-self: center;
        grid-area: auto;
        order: -1;
    }
}
@media screen and (max-width: 900px) {
    main {
        display: flex;
        flex-direction: column;
    }
    main > aside {
        max-height: calc(5*var(--xx-large));
        overflow-y: scroll;
    }
    main > article section:nth-of-type(2) div{
        display: flex;
    }
}
@media screen and (max-width: 620px) {
    main {
        margin: var(--large);
    }
    article figure {
        width: calc(1.4*var(--xx-large));
    }
    #reading_progress_info {
        display: none;
    }
}
@media screen and (max-width: 480px) {
    article figure {
        width: calc(1.2*var(--xx-large));
    }
}

@media screen and (max-width: 440px) {
    main {
        margin: var(--medium);
    }
}