* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --min-container-width: 320px;
    --max-container-width: 1130px;
}

body {
    font-family: "Roboto", sans-serif;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-variation-settings: "wdth" 100;
}

main {
    width: 100%;
    min-width: var(--min-container-width);
    max-width: var(--max-container-width);
    min-height: calc(100vh - 300px);
    margin: auto;
    padding: 20px 15px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

a,
img,
button,
[tabindex] {
    outline: none;
    -webkit-tap-highlight-color: transparent;
    display: block;
}

/* @media (hover: none) {
    button:hover {
        background: none !important;
    }
} */

small {
    display: block;
    font-size: 14px;
    font-weight: 450;
    line-height: 15px;
    color: #666;
}

time,
.meta {
    display: inline-block;
    font-size: 14px;
    font-weight: 450;
    line-height: 15px;
    color: #666;
}

.meta-keywords {
    display: inline-block;
    color: #4b78a7;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    margin-right: 6px;
}

article a {
    text-decoration: none;
    transition: color 0.1s ease-in-out;
}

article h2 a,
article h3 a,
article .meta a {
    color: inherit;
    line-height: inherit;
    font-size: inherit;
    font-weight: inherit;
}

article h2 {
    color: #036;
    font-size: 18px;
    font-weight: 1000;
    line-height: 1.4;
}

article a:hover {
    color: #0066cc;
    /* text-decoration: underline; */
}

article h3 {
    color: #4b78a7;
    font-size: 12px;
    font-weight: 800;
    line-height: 1;
}

article p {
    color: #222;
    font-size: 16px;
    font-weight: 500;
    line-height: 1.4;
}

article img {
    width: 100%;
    aspect-ratio: 5 / 3;
    object-fit: cover;
    overflow: hidden;
    border-radius: 4px;
}

/* //////////////////////////////////////// Style Class Component //////////////////////////////////////// */
/* 
Using
<div class="container-title">
    <h1>Politics</h1>
    <div></div>
</div>
*/
.container-title {
    display: flex;
    gap: 2px;
    height: 50px;
    width: 100%;
    box-sizing: border-box;
    color: #fff;
    width: 100%;
    display: flex;
    align-items: center;
    background-color: #1f8bc9;
    border-radius: 2px;
}

.container-title h1 {
    background-color: #003366;
    color: #fff;
    height: 100%;
    font-size: 30px;
    font-weight: 1000;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-self: center;
    padding: 0 15px;
}

.container-title div {
    width: 30px;
    height: 100%;
    margin-left: -10px;
    background-color: #003366;
    clip-path: polygon(0% 0%, 46% 0, 100% 50%, 46% 100%, 0% 100%);
}

/* 
Using
<div class="section-title">
    <h1><a href="/topics/politics">POLITICS</a></h1>
    <div class="cover-right-title"></div>
</div>
*/

.section-title {
    display: flex;
    gap: 5px;
    width: 100%;
    box-sizing: border-box;
    color: #fff;
    width: 100%;
    display: flex;
    align-items: center;
    border-radius: 2px;
}

.section-title h1 {
    color: #003366;
    font-size: 26px;
    font-weight: 1000;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-self: center;
    padding: 5px 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    transition: color 0.1s ease-in-out, background 0.1s ease-in-out;
}

.section-title h1:hover {
    background: #003366;
    color: #fff;
}

.section-title h1 a {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.cover-right-title {
    width: 100%;
    height: 6px;
    border-top: 1px solid #ddd;
    border-bottom: 1px solid #ddd;
    border-right: 1px solid #ddd;
}

.more-title h1 {
    color: #003366;
    font-size: 26px;
    font-weight: 1000;
    line-height: 1;
}

/* /////////////////////////////// */
.topic-section-title {
    width: 100%;
    display: flex;
    align-items: center;
    position: relative;
    height: 30px;
}

.topic-section-title a {
    color: inherit;
    font-size: inherit;
    font-weight: inherit;
    text-decoration: none;
}

.topic-section-title h1 {
    position: relative;
    margin: 0;
    color: #003366;
    line-height: 30px;
    font-size: 26px;
    font-weight: 1000;
}

.topic-section-title::before {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #cedfef;
    background: #ddd;
}

.topic-section-title h1 a::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2px;
    background: #036;
}

.topic-section-title > div {
    flex: 1;
    position: relative;
    height: 30px;
}

.topic-section-title > div::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    height: 2px;
    width: 0;
    background: #036;
    transition: width 0.2s ease;
}

.topic-section-title h1:hover + div::after {
    width: 100%;
}
/* /////////////////////////////// */

.bot-img-badge {
    max-width: 240px;
    position: absolute;
    bottom: 10px;
    left: 10px;
    color: #fff;
    text-transform: uppercase;
    font-size: clamp(15px, calc(20px + 6 * (100vw - var(--max-container-width)) / 200), 20px);
    /* font-size: 15px; */
    font-weight: 1000;
    padding: 6px 10px;
    background-color: rgb(0, 51, 102, 0.8);
    /* background-color: #c20017; */
    border-radius: 4px;
    margin: 0;
}

/* //////////////////////////////////////// Container //////////////////////////////////////// */
.main-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.sub-container {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 15px;
    padding-bottom: 20px;
}

.container-main-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.container-sub-col {
    display: flex;
    flex-direction: column;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

/* //////////////////////////////////////// Style Layout //////////////////////////////////////// */
.posts-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.flex-list {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.item-img {
    position: relative;
}

.item-text {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.article-info {
    display: flex;
    gap: 10px;
}

/* //////////////////////////////////////// Style Card Item //////////////////////////////////////// */
.card-item {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.card-item::after {
    content: "";
    position: absolute;
    right: -20px;
    top: 0;
    height: calc(100% - 0px);
    width: 1px;
    background-color: #ddd;
}

.card-item::before {
    content: "";
    position: absolute;
    left: 0px;
    bottom: -20px;
    height: 1px;
    width: calc(100% + 40px);
    background-color: #ddd;
}

.card-item:nth-child(2n)::after {
    display: none;
}

.card-item:nth-child(2n)::before {
    width: calc(100% - 0px);
}

.card-item:nth-last-child(-n + 2)::before {
    display: none;
}

.card-item h2 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* //////////////////////////////////////// Style Flex Item //////////////////////////////////////// */
.flex-item {
    display: grid;
    grid-template-columns: 150px 1fr;
    gap: 10px;
}

.flex-item h2 {
    order: 1;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
}

.flex-item {
    padding-bottom: 20px;
    border-bottom: 1px solid #cedfef;
}

.flex-item:last-child {
    padding-bottom: 0;
    border-bottom: none;
}

.flex-item .item-text {
    gap: 5px;
}

@media (max-width: 1024px) {
    .sub-container {
        grid-template-columns: 1fr;
    }

    .container-main-col {
        padding-bottom: 20px;
        border-bottom: 2px solid #ddd;
    }

    .container-sub-col {
        display: flex;
        flex-direction: column;
        gap: 20px;
        border-left: none;
        padding-left: 0;
    }
    article h2 {
        font-size: 22px;
        line-height: 1.25;
    }
}

@media (max-width: 768px) {
    .posts-list {
        grid-template-columns: 1fr 1fr;
    }

    article h2 {
        font-size: 18px;
        line-height: 1.4;
    }
}

@media (max-width: 576px) {
    main {
        padding: 10px 15px;
    }

    .posts-list {
        display: flex;
        flex-direction: column;
        gap: 20px;
    }

    .card-item {
        padding-bottom: 20px;
        border-bottom: 1px solid #ccc;
    }

    .card-item:last-child {
        padding-bottom: 0;
        border-bottom: none;
    }

    .card-item::after {
        display: none;
    }

    .card-item::before {
        display: none;
    }

    .card-item:nth-child(n)::after {
        display: none;
    }

    .card-item:nth-child(n)::before {
        display: none;
    }

    article h2 {
        font-size: 22px;
        line-height: 1.25;
    }
}

@media (max-width: 390px) {
    small,
    time,
    .meta {
        display: inline-block;
        font-size: 12px;
        line-height: 14px;
    }

    .meta-keywords {
        font-size: 12px;
        font-weight: 700;
    }

    /* article h2 {
        font-size: 14px;
        font-weight: 600;
    } */

    article h3 {
        font-size: 12px;
        font-weight: 500;
    }

    article p {
        color: #222;
        font-size: 14px;
        font-weight: 500;
    }

    .flex-item {
        grid-template-columns: 125px 1fr;
    }

    .flex-item h2 {
        font-size: 14px;
        font-weight: 500;
    }
}
