﻿/* Home page version 2 */
.home5-loading {
    display: flex;
    justify-content: center;
    padding: 120px 0;
}

.home5-sections {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 16px;
}

/* Section version 2: one large post plus compact rows */
.s5 {
    margin-top: 48px;
}

/* Heading: ◆ [ title ] ———— fading line ———— (see all)
   The diamond sits on the reading start (right in Kurdish, left in German). */
.s5-header {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-bottom: 24px;
}

    /* the line between the title and "see all", fading away from the title */
    .s5-header::before {
        content: "";
        order: 1;
        flex: 1;
        height: 2px;
        border-radius: 2px;
        background: linear-gradient(to right, var(--s5-color), color-mix(in srgb, var(--s5-color) 25%, transparent) 45%, transparent);
    }

.s5[dir="rtl"] .s5-header::before {
    background: linear-gradient(to left, var(--s5-color), color-mix(in srgb, var(--s5-color) 25%, transparent) 45%, transparent);
}

.s5-title {
    position: relative;
    order: 0;
    margin: 0;
    margin-inline-start: 10px;
    padding: 8px 20px 8px 20px;
    padding-inline-start: 26px;
    border: 1px solid color-mix(in srgb, var(--s5-color) 30%, transparent);
    border-bottom: 3px solid var(--s5-color);
    border-radius: 10px;
    background: color-mix(in srgb, var(--s5-color) 8%, var(--mud-palette-surface));
    box-shadow: 0 4px 14px color-mix(in srgb, var(--s5-color) 15%, transparent);
    color: color-mix(in srgb, var(--s5-color) 80%, #000);
    font-size: 1.4rem;
    font-weight: 800;
    line-height: 1.4;
    white-space: nowrap;
}

    /* the diamond on the start edge of the title box */
    .s5-title::before {
        content: "";
        position: absolute;
        top: 50%;
        inset-inline-start: -9px;
        width: 16px;
        height: 16px;
        border-radius: 3px;
        background: linear-gradient(135deg, color-mix(in srgb, var(--s5-color) 70%, #fff), var(--s5-color));
        box-shadow: 0 0 0 4px var(--v5-page-bg, #fff), 0 0 0 6px color-mix(in srgb, var(--s5-color) 35%, transparent);
        transform: translateY(-50%) rotate(45deg);
    }

.s5-more {
    order: 2;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border: 1px solid var(--s5-color);
    border-radius: 999px;
    color: var(--s5-color);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background-color 0.2s ease, color 0.2s ease;
}

    .s5-more:hover,
    .s5-more:focus-visible {
        background-color: var(--s5-color);
        color: #fff;
    }

.s5-body {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

/* Swap the columns so stacked sections alternate */
.s5-reverse .s5-lead {
    order: 2;
}

/* Only one post: it takes the full width with the image beside the text */
.s5-single {
    grid-template-columns: 1fr;
}

    .s5-single .s5-lead {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    }

        .s5-single .s5-lead .s5-lead-body {
            justify-content: center;
            border-top: none;
            border-inline-start: 4px solid var(--s5-color);
        }

/* large post */
.s5-lead {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 14px;
    background-color: var(--mud-palette-surface);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    color: inherit;
    text-decoration: none;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

    .s5-lead:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
    }

.s5-lead-image {
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background-color: #eee;
}

    .s5-lead-image img,
    .s5-item-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block;
        transition: transform 0.3s ease;
    }

.s5-lead:hover .s5-lead-image img,
.s5-item:hover .s5-item-image img {
    transform: scale(1.05);
}

.s5-lead-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px 20px;
    border-top: 4px solid var(--s5-color);
}

.s5-lead-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--mud-palette-text-primary);
}

.s5-lead:hover .s5-lead-title {
    color: var(--s5-color);
}

.s5-lead-excerpt {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.8;
    color: var(--mud-palette-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.s5-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 16px;
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

/* compact rows */
.s5-list {
    display: flex;
    flex-direction: column;
}

.s5-item {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    color: inherit;
    text-decoration: none;
}

    .s5-item:first-child {
        padding-top: 0;
    }

    .s5-item:last-child {
        border-bottom: none;
    }

.s5-item-image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 8px;
    background-color: #eee;
}

.s5-item-body {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.s5-item-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--mud-palette-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.s5-item:hover .s5-item-title {
    color: var(--s5-color);
}

.s5-item-meta {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}

.s5-lead:focus-visible,
.s5-item:focus-visible {
    outline: 2px solid var(--s5-color);
    outline-offset: 3px;
}

@media (max-width: 960px) {
    .s5-body {
        grid-template-columns: 1fr;
    }

    .s5-reverse .s5-lead {
        order: 0;
    }

    .s5-single .s5-lead {
        display: flex;
    }

        .s5-single .s5-lead .s5-lead-body {
            border-inline-start: none;
            border-top: 4px solid var(--s5-color);
        }
}

@media (max-width: 600px) {
    .s5 {
        margin-top: 36px;
    }

    .s5-title {
        font-size: 1.15rem;
        white-space: normal;
        padding: 6px 14px;
        padding-inline-start: 22px;
    }

    .s5-header {
        gap: 12px;
    }

    .s5-lead-title {
        font-size: 1.15rem;
    }

    .s5-item {
        grid-template-columns: 100px minmax(0, 1fr);
    }
}
