/*
==========================================
==           MASTER CONFIG              ==
==========================================
*/

:root {
    /* how many colums in my grid */
    --columns: 4;
    
    /* colors */
    --background: rgb(0, 0, 0);
    --box-background: rgb(56, 56, 56);
    --box-hover: rgb(45, 45, 45);
    --text-color: rgb(230, 230, 230);
    --border-color: rgb(75, 10, 20);

    /* size */
    --box-radius: 10px;
    --box-gap: 35px;
    --box-height: 180px;
}

/*
==========================================
==                GENERAL               ==
==========================================
*/
* {
    box-sizing: border-box;
}

body {
    margin: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--background);
    color: var(--text-color);
    font-family: Arial, sans-serif;
}

/*
==========================================
==                HEADER                ==
==========================================
*/
.site-header {
    flex-shrink: 0;
    height: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.logo img {
    display: block;
    max-width: 100%;
    max-height: 110px;
    object-fit: contain;
}

/*
==========================================
==           MASTER CONTAINER           ==
==========================================
*/
.main-container {
    position: relative;
    flex: 1;
    min-height: 0;
    margin: 20px 4%;
    overflow: hidden;
}

/*
==========================================
==                 GRID                 ==
==========================================
*/
.content-grid {
    height: 100%;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(var(--columns), minmax(0, 1fr));
    grid-auto-rows: var(--box-height);
    gap: var(--box-gap);
    align-content: start;
    padding: 15px;
}

/*
==========================================
==                BOXES                 ==
==========================================
*/
.content-box {
    height: var(--box-height);
    min-width: 0;
    overflow: hidden;
    padding: 15px;
    background: var(--box-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--box-radius);
    text-align: left;
    cursor: pointer;
    transition:
        background 0.2s ease,
        border-color 0.2s ease;
}

.content-box:hover {
    background: var(--box-hover);
    border-color: var(--box-hover);
}

.content-box h2 {
    font-size: 22px;
    margin: 0 0 12px 0;
}

.content-box p {
    font-size: 16px;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 4;
    overflow: hidden;
}

/*
==========================================
==               OPEN BOX               ==
==========================================
*/
.content-detail {
    position: absolute;
    inset: 0;
    z-index: 10;
    padding: 35px 45px;
    overflow-y: auto;
    background: rgb(20, 20, 20);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: var(--box-radius);
}

.content-detail h1 {
    font-size: 32px;
    margin-top: 10px;
    margin-bottom: 30px;
}

.content-detail h2 {
    font-size: 24px;
    margin-top: 30px;
}

.content-detail p {
    font-size: 18px;
    line-height: 1.7;
}

/*
==========================================
==             BOX CLOSE BTN            ==
==========================================
*/
.close-button {
    position: sticky;
    top: 0;
    float: right;
    z-index: 20;
    margin-right: -20px;
    margin-top: -20px;
    width: 40px;
    height: 40px;
    background: var(--border-color);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
}

/*
==========================================
==             IN-BOX MENU              ==
==========================================
*/
.internal-menu {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 15px 0;
    margin-bottom: 25px;
    background: rgb(20, 20, 20);
    border-bottom: 1px solid var(--border-color);
}

.internal-menu button {
    padding: 10px 18px;
    background: var(--box-background);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 5px;
    cursor: pointer;
}

.internal-menu button:hover {
    background: var(--border-color);
}

/*
==========================================
==           INTERNAL PANELS            ==
==========================================
*/
.content-panel {
    display: none;
}

.content-panel.active {
    display: block;
}

.content-panel img {
    max-width: 100%;
    height: auto;
    border-radius: 5px;
}

.image-center {
    display: block;
    text-align: center;
    margin: 30px auto;
}

.image-center img {
    max-width: 85%;
}

.image-right {
    float: right;
    width: 40%;
    margin: 0 0 20px 25px;
}

.image-left {
    float: left;
    width: 40%;
    margin: 0 25px 20px 0;
}


figcaption {
    margin-top: 8px;
    font-size: 14px;
    color: rgb(170, 170, 170);
    font-style: italic;
}

.content-panel::after {
    content: "";
    display: block;
    clear: both;
}

/*
==========================================
==                FOOTER                ==
==========================================
*/
.site-footer {
    flex-shrink: 0;
    min-height: 80px;
    padding: 10px 4%;
    background: black;
    color: var(--text-color);
    text-align: center;
}

.site-footer p {
    margin: 5px;
}

.site-footer a {
    color: var(--text-color);
}

/*
==========================================
==          SMALL SCREEN SUPPORT        ==
==========================================
*/
@media (max-width: 1000px) {
    :root {
        --columns: 3;
    }
}

@media (max-width: 650px) {
    :root {
        --columns: 2;
        --box-gap: 15px;
    }

    .site-header {
        height: 110px;
    }

    .logo img {
        max-height: 75px;
    }

    .content-detail {
        padding: 25px;
    }
}

@media (max-width: 400px) {
    :root {
        --columns: 1;
    }
}
