/* ONEKH 1.1.6 — Recent Posts-inspired section headings.
   Heading font sizes intentionally match v1.1.4: 22px desktop / 19px mobile. */

.onekh-ymal,
.onekh-related {
    clear: both;
    width: 100%;
    margin: 32px 0 24px;
}

/* Recent Posts-style title bar: compact blue label + diagonal stripe fill. */
.onekh-ymal__heading,
.onekh-related__heading {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    box-sizing: border-box;
    min-height: 38px;
    margin: 0 0 18px;
    padding: 6px 12px;
    overflow: hidden;
    border: 1px solid #294a78;
    border-radius: 8px 8px 0 0;
    background: linear-gradient(180deg, #173967 0%, #0d2851 100%);
    color: #f2f5fb;
    font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
    font-size: 22px;
    line-height: 1.2;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: -0.35px;
}

.onekh-ymal__heading::after,
.onekh-related__heading::after {
    content: "";
    flex: 1 1 auto;
    align-self: stretch;
    min-width: 24px;
    margin: 1px 0 1px 2px;
    border-radius: 2px;
    background: repeating-linear-gradient(
        135deg,
        rgba(180, 199, 226, 0.34) 0,
        rgba(180, 199, 226, 0.34) 5px,
        rgba(180, 199, 226, 0.04) 5px,
        rgba(180, 199, 226, 0.04) 10px
    );
}

.onekh-ymal__grid,
.onekh-related__grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 20px 16px;
    width: 100%;
}

.onekh-ymal__item,
.onekh-related__card {
    display: block;
    min-width: 0;
    width: auto;
    max-width: 100%;
    margin: 0;
    float: none;
}

.onekh-ymal__link,
.onekh-related__link {
    display: block;
    color: inherit;
    text-decoration: none;
}

.onekh-ymal__thumb,
.onekh-related__thumb {
    display: block;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 16 / 9;
    background: #14284b;
    border-radius: 6px;
}

.onekh-ymal__thumb img,
.onekh-related__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .25s ease;
}

.onekh-ymal__link:hover .onekh-ymal__thumb img,
.onekh-related__link:hover .onekh-related__thumb img {
    transform: scale(1.04);
}

.onekh-ymal__no-image,
.onekh-related__no-image {
    display: block;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #1b3155, #30496d);
}

/* Keep the separate title sizes from v1.1.4. */
.onekh-ymal__title {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 9px;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.onekh-related__title {
    display: -webkit-box;
    overflow: hidden;
    margin-top: 10px;
    color: #f3d46b;
    font-size: 16px;
    line-height: 1.4;
    font-weight: 600;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.onekh-ymal__link:hover .onekh-ymal__title,
.onekh-related__link:hover .onekh-related__title {
    color: #d4af37;
}

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

@media (max-width: 599px) {
    .onekh-ymal,
    .onekh-related {
        margin-top: 26px;
    }

    .onekh-ymal__heading,
    .onekh-related__heading {
        min-height: 34px;
        margin-bottom: 14px;
        padding: 5px 10px;
        font-size: 19px;
    }

    .onekh-ymal__grid,
    .onekh-related__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .onekh-ymal__title,
    .onekh-related__title {
        font-size: 15px;
        line-height: 1.4;
    }
}

/* Guard against theme rules that override the Related Posts grid. */
body .entry-content .onekh-related .onekh-related__grid,
body .onekh-related .onekh-related__grid {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    align-items: start;
    width: 100%;
    max-width: 100%;
}

body .entry-content .onekh-related .onekh-related__card,
body .onekh-related .onekh-related__card {
    display: block;
    width: auto !important;
    max-width: 100%;
    min-width: 0;
    margin: 0;
    float: none !important;
}

@media (max-width: 599px) {
    body .entry-content .onekh-related .onekh-related__grid,
    body .onekh-related .onekh-related__grid {
        grid-template-columns: minmax(0, 1fr) !important;
    }
}


/* 1.1.8: keep the full Recent Posts-style title bar on mobile.
   Higher-specificity rules prevent mobile theme h2 styles from flattening it. */
@media (max-width: 767px) {
    body .entry-content section.onekh-ymal > h2.onekh-ymal__heading,
    body .entry-content section.onekh-related > h2.onekh-related__heading,
    body section.onekh-ymal > h2.onekh-ymal__heading,
    body section.onekh-related > h2.onekh-related__heading {
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        gap: 12px !important;
        box-sizing: border-box !important;
        width: 100% !important;
        min-height: 38px !important;
        margin: 0 0 14px !important;
        padding: 6px 12px !important;
        overflow: hidden !important;
        border: 1px solid #294a78 !important;
        border-radius: 8px 8px 0 0 !important;
        background: linear-gradient(180deg, #173967 0%, #0d2851 100%) !important;
        color: #f2f5fb !important;
        font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif !important;
        font-size: 20px !important;
        line-height: 1.2 !important;
        font-weight: 700 !important;
        text-transform: uppercase !important;
        letter-spacing: -0.35px !important;
        text-align: left !important;
        box-shadow: none !important;
    }

    body .entry-content section.onekh-ymal > h2.onekh-ymal__heading::after,
    body .entry-content section.onekh-related > h2.onekh-related__heading::after,
    body section.onekh-ymal > h2.onekh-ymal__heading::after,
    body section.onekh-related > h2.onekh-related__heading::after {
        content: "" !important;
        display: block !important;
        flex: 1 1 auto !important;
        align-self: stretch !important;
        min-width: 24px !important;
        margin: 1px 0 1px 2px !important;
        border: 0 !important;
        border-radius: 2px !important;
        background: repeating-linear-gradient(
            135deg,
            rgba(180, 199, 226, 0.34) 0,
            rgba(180, 199, 226, 0.34) 5px,
            rgba(180, 199, 226, 0.04) 5px,
            rgba(180, 199, 226, 0.04) 10px
        ) !important;
    }
}
