@import url("https://fonts.googleapis.com/css2?family=Inter:wght@200;300;400;500;600;700&display=swap");

* {
    -webkit-tap-highlight-color: transparent;
    -webkit-focus-ring-color: transparent;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Inter"; /* font-family is inherited */
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
}

.main-container {
    box-sizing: border-box;
    padding: 60px 0 150px;
    margin: 0 auto 100px;
    width: 90%;
    max-width: 1190.4px;
}

.main-container > h1 {
    box-sizing: border-box;
    margin: 0;
    padding: 0 15px;
    text-align: center;
    font-size: 32px;
    font-weight: 500;
    line-height: 1.5em;
}

.software-container {
    box-sizing: border-box;
    margin: 60px 0 0;
    padding: 0;
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    row-gap: 35px;
    column-gap: 40px;
    justify-content: center;
}

.box {
    box-sizing: border-box;
    margin: 0;
    border: 1px solid rgba(11, 64, 8, 0.82);
    padding: 35px 20px 20px;
    width: 31%;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    gap: 10px;
    overflow: hidden; /* Important for containing content, but primarily for the card itself */
}

.box > .icon-box {
    box-sizing: border-box;
    width: 32%;
    aspect-ratio: 137.6896 / 137.6896;
    inset: 0;
    display: flex;
    align-items: center;
}

.icon-box > img {
    box-sizing: border-box;
    width: 100%;
    object-fit: cover;
    object-position: center;
}

.software-name {
    box-sizing: border-box;
    margin: 0;
    font-size: 18px;
    text-align: center;
    line-height: 1.5em;
}

.software-qty {
    box-sizing: border-box;
    text-align: center;
    font-size: 15px;
    letter-spacing: 0.01px;
}

.box ol {
    box-sizing: border-box;
    margin-top: 10px;
}

.box ol li {
    box-sizing: border-box;
    margin: 5px 0 0;
    font-size: 18px;
    line-height: 1.5em;
}

/* Hide the actual checkbox */
.card-toggle {
    display: none;
}

.card-content {
    /* Initial state: Truncated with ellipsis */
    max-height: 200px;
    overflow: hidden; /* Ensures content is hidden beyond max-height */

    display: -webkit-box; /* Required for -webkit-line-clamp */
    -webkit-box-orient: vertical; /* Required for -webkit-line-clamp */
    -webkit-line-clamp: 2; /* Limit to 3 lines initially */
    text-overflow: ellipsis; /* Adds the "..." for overflowed text */

    transition: max-height 1500ms ease; /* Smooth transition for expansion/collapse */
}

/* When the checkbox is checked, expand the content */
.card-toggle:checked ~ .card-content {          
    max-height: 1000px; /* A large enough value to show full content when expanded */
    -webkit-line-clamp: unset; /* Remove line clamping to show all text */
    text-overflow: clip; /* Remove the ellipsis when fully expanded */
    /* Do not change display or overflow here to maintain smooth transition */
}

.toggle-button-container {
    align-self: flex-end;
}

.toggle-button {
    font-size: 16px;
    color: rgba(11, 64, 8, 1);
    cursor: pointer;
    display: inline-block; /* Allows padding and alignment */
    user-select: none; /* Prevent text selection */
    margin: 5px 0 10px;
}

.read-more i {
    box-sizing: border-box;
    border: 2px solid rgba(11, 64, 8, 1);
    margin-left: 4px;
    padding: 7px 8px;
    border-radius: 50%;
}

.show-less i {
    box-sizing: border-box;
    color: white;
    background-color: rgba(11, 64, 8, 1);
    margin-left: 4px;
    padding: 7px 8px;
    border-radius: 50%;
}

/* Hide "Show Less" button initially */
.show-less {
    display: none;
}

/* When checked, hide "Read More" and show "Show Less" */
.card-toggle:checked ~ .toggle-button-container .read-more {
    display: none;
}
.card-toggle:checked ~ .toggle-button-container .show-less {
    display: inline-block; /* Show "Show Less" button */
}

/* When checked, set a fix height to some boxes */
.active-software-box {
    align-self: flex-start;
}

.software-blogs {
    box-sizing: border-box;
    padding: 0;
    margin: 70px auto 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    row-gap: 60px;
}

.s-blog {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    row-gap: 15px;
}

.s-blog h1 {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-size: 25px;
    font-weight: 500;
    line-height: 1.25em;
}

.s-blog p {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    font-size: 18px;
    line-height: 1.5em;
}

.s-blog-photos {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    width: 80%;
    align-self: center;
    display: flex;
    justify-content: center;
    column-gap: 20px;
    row-gap: 10px;
    flex-wrap: wrap;
}

.software-photo {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    width: 45%;
    aspect-ratio: 1919 / 1079;
}

.software-photo img {
    box-sizing: border-box;
    padding: 0;
    margin: 0;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.table-of-contents {
    box-sizing: border-box;
    margin: 30px 0 0;
    padding: 0;
    width: 95%;
    display: flex;
    flex-direction: column;
    row-gap: 15px;
}

.table-of-contents > p {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-size: 20px;
    font-weight: 500;
    font-family: "Inter";
}

.contents-buttons {
    box-sizing: border-box;
    margin: 0;
    padding: 10px 15px;
    border-left: 1px solid rgba(11, 64, 8, 0.4);
    display: flex;
    flex-direction: column;
    row-gap: 5px;
    align-items: flex-start;
}

.contents-buttons a {
    box-sizing: border-box;
    margin: 0;
    padding: 5px;
    font-family: "Inter";
    font-size: 16px;
    font-weight: 300;
    color: rgba(11, 64, 8, 1);
    cursor: pointer;
    line-height: 1.50em;
}


@media (max-width: 1344px) {
    .software-container {
        row-gap: 30px;
        column-gap: 35px;
    }
    .box {
        width: 30%;
    }
}

@media (max-width: 1128px) {
    .main-container {
        width: 95%;
        max-width: 1071.6px;
    }
    .main-container > h1 {
        font-size: 28px;
    }
    .software-name {
        font-size: 16px;
    }
    .software-qty {
        font-size: 14px;
    }
    .box ol li {
        font-size: 16px;
    }
    .toggle-button {
        font-size: 14px;
    }
    .box {
        border-radius: 10px;
    }
    .s-blog h1 {
        font-size: 20px;
    }
    .s-blog p {
        font-size: 16px;
    }
    .software-blogs {
        width: 95%;
    }
    .s-blog-photos {
        width: 100%;
        max-width: 570px;
    }
    .software-photo {
        width: 100%;
    }
    .software-blogs img {
        border-radius: 10px;
    }
    .table-of-contents {
        padding-left: 15px;
    }
}

@media (max-width: 971px) {
    .software-container {
        gap: 25px;
    }
    .box {
        width: 40%; /* set to 2 columns per row  */
    }
}

@media (max-width: 890px) {
    .software-container {
        row-gap: 20px;
        column-gap: 25px;
    }
    .box {
        width: 85%; /* set to 1 column per row  */
    }
}