/* ============================================================
   MAIN.CSS — Grid layout and card components
   ============================================================ */


/* Grid */

.grid-container {
    width: 100%;
}

.grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    column-gap: 10px;
    row-gap: 20px;
}

@media (min-width: 600px) {
    .grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 900px) {
    .grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.category-container {
    margin-bottom: 30px;
}


/* Card */

.card {
    display: flex;
    flex-direction: column;
    gap: 10px;
    justify-content: space-between;
    overflow: hidden;
    background-color: black;
    border: var(--border-gray) 1px solid;
}

.grid * {
    color: var(--text-gray);
}


/* Border radii */

.card,
.flip-button,
.article-button,
.card-bottom {
    border-radius: 6px;
}

.flip-button,
.article-button {
    border-top-right-radius: 0;
    border-top-left-radius: 0;
}

.article-button {
    border-bottom-right-radius: 0;
}

.flip-button {
    border-bottom-left-radius: 0;
}


/* Card top */

.card-top {
    margin-top: 15px;
}

.card-top,
.card-middle {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.card-top div,
.card-middle div {
    margin-left: 10px;
    margin-right: 10px;
}

.image-container img {
    width: 100%;
    border-radius: 3px;
    background-color: white;
}

.card-image {
    border: var(--border-gray) 1px solid;
}

.source-container {
    margin-top: 5px;
}

.title-container {
    border-bottom: var(--border-gray) 1px solid;
}

.card-top h1 {
    font-size: 22px;
    margin-bottom: 5px;
}

.card-top p {
    font-size: 16px;
}


/* Card middle */

.card-middle {
    transition: max-height 0.3s ease;
    border-top: var(--border-gray) 1px solid;
}

.card-middle.active {
    opacity: 1;
    max-height: 1000px;
}

.card-middle .icon-container {
    margin-top: 10px;
    align-self: center;
}


/* Card bottom */

.card-bottom {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    flex-grow: 1;
    gap: 0;
    border-top-left-radius: 0;
    border-top-right-radius: 0;
    border-top: var(--border-gray) 1px solid;
    background-color: black;
}

.link-container {
    width: 50%;
    height: 100%;
    border-right: var(--border-gray) 1px solid;
}

.article-link {
    width: 100%;
    height: 100%;
    text-decoration: none;
    text-align: center;
}

.button-container {
    width: 50%;
    height: 100%;
}

.card-button {
    width: 100%;
    height: 40px;
    cursor: pointer;
    background-color: inherit;
    color: inherit;
    transition: background-color 0.2s ease;
}

@media (min-width: 600px) {
    .card-button {
        height: 30px;
    }
}

@media (hover: hover) {
    .card-button:hover {
        background-color: #161616;
    }
}

.card-button.active-touch {
    background-color: #161616;
}

.flip-button.active {
    border: var(--orange) 1px solid;
}
