@import "./fonts.css";

:root {
    /* --color-bg: linear-gradient(180deg, #ee5c87, #f1a4b5); */
    --color-bg: linear-gradient(180deg, #2156ff, #4ca7ff);
    --color-text: #f5f5f5;
    --color-title: #1f1f1f;
    --color-date: #ff4500;
    --color-description: #353535;
    --color-button: #c765ee;
    --color-button2: #cb48ff;
    --text-shadow: 1.75px 3.0625px 0 #191919,1.616825px .669725px 0 #191919,1.237425px 1.237425px 0 #191919,.669725px 1.616825px 0 #191919,3.0625px 1.75px 0 #191919,-.669725px 1.616825px 0 #191919,-1.237425px 1.237425px 0 #191919,-1.616825px .669725px 0 #191919,-1.75px 0 0 #191919,-1.616825px -.669725px 0 #191919,-1.237425px -1.237425px 0 #191919,-.669725px -1.616825px 0 #191919,0 -1.75px 0 #191919,.669725px -1.616825px 0 #191919,1.237425px -1.237425px 0 #191919,1.616825px -.669725px 0 #191919;
}

/* Base styles */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
}

body {
    background: var(--color-bg);
    color: var(--color-text);
    font-family: Comfortaa, sans-serif;
    font-size: 14px;
}

body.overlay {
    overflow: hidden;
}

.container {
    width: 100%;
    max-width: 1230px;
    min-height: 100vh;
    padding: 0 30px;
    margin: 0 auto;
    position: relative;
}

.menu-btn {
    width: 45px;
    position: absolute;
    top: 40px;
    right: 30px;
    z-index: 2;
    transition: all 0.2s ease-in;
    cursor: pointer;
}

.menu-btn:hover {
    transform: scale(1.1);
}

/* Logo styles */

.logo {
    width: 160px;
    position: absolute;
    top: 25px;
    left: 43.5%;
    z-index: 1;
    transition: 0.3s;
}

/* Main styles */

h1 {
    padding-top: 135px;
    padding-bottom: 38px;
    font-size: 45px;
    font-family: Roboto-Condensed, sans-serif;
    font-weight: 700;
    color: var(--color-text);
    text-align: left;
    text-shadow: var(--text-shadow);
    cursor: default;
}

.blog-box {
    display: grid;
    grid-template-columns: repeat(auto-fill, 31.3%);
    width: 100%;
    justify-content: center;
    justify-items: center;
    column-gap: 3%;
    row-gap: 40px;
    padding-bottom: 50px;
}

.article {
    width: 100%;
    max-height: max-content;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
    overflow: hidden;
    background-color: var(--color-text);
    cursor: default;
    transition: transform 0.2s ease-in;
}

.article:hover {
    transform: translate(-5px, -5px);
}

.article-top {
    width: 100%;
    height: auto;
}

.article-top img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.article-bottom {
    height: 100%;
    padding: 15px;
    display: flex;
    flex-direction: column;
    row-gap: 15px;
}

.article-date {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-date);
}

.article-title {
    font-size: 19px;
    font-weight: 700;
    color: var(--color-title);
}

.article-description {
    margin-bottom: 3px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 15px;
    font-weight: 400;
    color: var(--color-description);
}

.article-bottom button {
    height: 48px;
    padding: 12px 28px 14px 28px;
    margin-top: auto;
    border: 0;
    border-radius: 8px;
    background-color: var(--color-button);
    color: #ffffff;
    font-size: 18px;
    font-family: Comfortaa, sans-serif;
    font-weight: 700;
    transition: all 0.2s ease-in;
    cursor: pointer;
}

.article-bottom button:hover {
    background-color: var(--color-button2);
}

.article-bottom button:active {
    position: relative;
    top: 1px;
}

/* Modal article style */

.modal {
    width: 100%;
    height: 100%;
    display: none;
    justify-content: center;
    align-items: center;
    position: fixed;
    left: 0;
    top: 0;
    z-index: 3;
    background-color: rgba(0,0,0,0.5);
    animation-name: animateOpenBackground;
    animation-duration: 0.7s;
}

.modal.open {
    display: flex;
}

@keyframes animateOpenBackground {
    from {background-color: rgba(0,0,0,0);}
    to {background-color: rgba(0,0,0,0.5);}
}

.hide-modal {
    animation-name: animateCloseBackground;
    animation-duration: 0.5s;
}

@keyframes animateCloseBackground {
    from {background-color: rgba(0,0,0,0.5);}
    to {background-color: rgba(0,0,0,0);}
}

.modal-content {
    width: 100%;
    max-width: 750px;
    max-height: 90vh;
    margin: 0 30px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 10px;
    background-color: var(--color-text);
    box-shadow: 0 4px 8px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19);
    animation-name: animateOpenModalZoom;
    animation-duration: 0.7s;
}

@keyframes animateOpenModalZoom {
    from {transform: scale(0)}
    to {transform: scale(1)}
}

.hide-modal-content {
    animation-name: animateCloseModalZoom;
    animation-duration: 0.5s;
}

@keyframes animateCloseModalZoom {
    from {transform: scale(1)}
    to {transform: scale(0)}
}

.modal-header {
    width: 100%;
    padding: 18px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    flex-wrap: nowrap;
    column-gap: 50px;
    row-gap: 10px;
    border-bottom: 1px solid #dee2e6;
    cursor: default;
}

.modal-title {
    font-size: 25px;
    line-height: 33px;
    font-weight: 700;
    color: var(--color-title);
}

.modal-date {
    font-size: 21px;
    font-weight: 500;
    color: var(--color-date);
}

.modal-body {
    width: 100%;
    padding: 25px 15px;
    overflow-y: auto;
}

.modal-img {
    width: 100%;
    border-radius: 10px;
}

.modal-description {
    font-size: 18px;
    font-weight: 500;
    color: var(--color-title);
}

.modal-description p {
    margin-top: 18px;
    line-height: 28px;
}

.modal-description a {
    color: var(--color-date);
}

.modal-footer {
    width: 100%;
    height: 70px;
    padding: 0 15px;
    display: flex;
    justify-content: flex-end;
    align-items: center;
    flex-shrink: 0;
    border-top: 1px solid #dee2e6;
}

.modal-close {
    height: 40px;
    padding: 10px 25px 12px 25px;
    border: 0;
    border-radius: 8px;
    background-color: var(--color-button);
    color: #ffffff;
    font-size: 18px;
    font-family: Comfortaa, sans-serif;
    font-weight: 700;
    transition: all 0.2s ease-in;
    cursor: pointer;
}

.modal-close:hover {
    background-color: var(--color-button2);
}

.modal-close:active {
    position: relative;
    top: 1px;
}

/* Media queries */

@media (max-width: 950px) {
    .logo {
        left: 30px;
    }
    h1 {
        text-align: right;
    }
    .blog-box {
        grid-template-columns: repeat(auto-fill, 48.5%);
        column-gap: 3%;
        row-gap: 35px;
    }
    .article:hover {
        transform: none;
    }
}

@media (max-width: 700px) {
    .blog-box {
        row-gap: 28px;
    }
}

@media (max-width: 580px) {
    .modal-content {
        margin: 0 15px;
    }
    .modal-header {
        padding: 15px;
        flex-direction: column;
        align-items: flex-start;
    }
    .modal-title {
        font-size: 18px;
        line-height: 28px;
    }
    .modal-date {
        font-size: 18px;
    }
    .modal-body {
        padding: 20px 15px;
    }
    .modal-footer {
        height: 55px;
    }
    .modal-close {
        height: 35px;
        padding: 8px 20px 10px 20px;
        border-radius: 5px;
        font-weight: 500;
    }
    .container {
        padding: 0 15px;
    }
    .blog-box {
        grid-template-columns: repeat(auto-fill, 100%);
        column-gap: 3%;
        row-gap: 30px;
    }
    .article-bottom button {
        align-self: flex-end;
    }
}

@media (max-width: 374px) {
    h1 {
        padding-top: 125px;
        padding-bottom: 25px;
        font-size: 35px;
    }
    .modal-description {
        font-size: 16px;
    }
    .modal-description p {
        margin-top: 12px;
        line-height: 25px;
    }
    .blog-box {
        row-gap: 25px;
    }
    .article-bottom button {
        align-self: normal;
    }
}
