﻿/* Home page blocks (HomeBlock.razor); the heading bar comes from section.css */

.hb a {
    color: inherit;
    text-decoration: none;
}

.hb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.hb a:focus-visible {
    outline: 2px solid var(--s5-color);
    outline-offset: 3px;
}

/* ---- Cards: a row of cards with the date on the image ---- */
.hb-cards-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
}

.hb-card {
    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);
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

    .hb-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 12px 28px rgba(0, 0, 0, 0.14);
    }

        .hb-card:hover img {
            transform: scale(1.05);
        }

.hb-card-image {
    position: relative;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background-color: #eee;
}

.hb-card-date {
    position: absolute;
    inset-inline-start: 12px;
    top: 12px;
    padding: 4px 10px;
    border-radius: 999px;
    background-color: var(--s5-color);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    direction: ltr;
}

.hb-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 16px 16px;
    border-bottom: 4px solid var(--s5-color);
}

.hb-card-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;
}

.hb-card:hover .hb-card-title {
    color: var(--s5-color);
}

.hb-card-author {
    font-size: 0.8rem;
    color: var(--mud-palette-text-secondary);
}

/* ---- Quotes: a large quote and a numbered list, no pictures ---- */
.hb-quotes-body {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
    gap: 28px;
    align-items: stretch;
}

.hb-quote {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 36px 32px 28px;
    border-radius: 14px;
    background:
        linear-gradient(135deg, color-mix(in srgb, var(--s5-color) 12%, transparent) 0%, transparent 70%),
        var(--mud-palette-surface);
    border-inline-start: 6px solid var(--s5-color);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
}

.hb-quote-mark {
    position: absolute;
    top: -10px;
    inset-inline-end: 20px;
    font-family: Georgia, serif;
    font-size: 7rem;
    line-height: 1;
    color: var(--s5-color);
    opacity: 0.25;
}

.hb-quote-title {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.5;
    color: var(--mud-palette-text-primary);
}

.hb-quote:hover .hb-quote-title {
    color: var(--s5-color);
}

.hb-quote-text {
    margin: 0;
    font-size: 1rem;
    font-style: italic;
    line-height: 1.9;
    color: var(--mud-palette-text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hb-quote-author {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--s5-color);
}

.hb-numbered {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 0;
    list-style: none;
}

    .hb-numbered li {
        border-bottom: 1px dashed var(--mud-palette-lines-default);
    }

        .hb-numbered li:last-child {
            border-bottom: none;
        }

.hb-numbered-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 4px;
}

.hb-numbered-no {
    flex: none;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1;
    color: var(--s5-color);
    opacity: 0.45;
    transition: opacity 0.2s ease;
}

.hb-numbered-item:hover .hb-numbered-no {
    opacity: 1;
}

.hb-numbered-text {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hb-numbered-title {
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.6;
    color: var(--mud-palette-text-primary);
}

.hb-numbered-item:hover .hb-numbered-title {
    color: var(--s5-color);
}

.hb-numbered-author {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}

/* ---- Mosaic: one tall tile and four small ones ---- */
.hb-mosaic-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    grid-auto-rows: 210px;
    gap: 12px;
}

.hb-tile {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    background-color: #eee;
}

    .hb-tile:first-child {
        grid-column: span 2;
        grid-row: span 2;
    }

    .hb-tile:hover img {
        transform: scale(1.06);
    }

.hb-tile-caption {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 40px 14px 12px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
}

.hb-tile-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hb-tile:first-child .hb-tile-title {
    font-size: 1.35rem;
}

.hb-tile-author {
    font-size: 0.75rem;
    opacity: 0.85;
}

.hb-tile::after {
    content: "";
    position: absolute;
    inset: 0;
    border-bottom: 4px solid var(--s5-color);
    border-radius: inherit;
    pointer-events: none;
}

/* ---- Strip: tall cards in a coloured band that scrolls sideways ---- */
.hb-strip-band {
    padding: 24px 0 8px;
    border-radius: 18px;
    background:
        radial-gradient(circle at 90% 0%, color-mix(in srgb, var(--s5-color) 22%, transparent) 0%, transparent 55%),
        color-mix(in srgb, var(--s5-color) 9%, var(--mud-palette-surface));
}

.hb-strip-track {
    display: flex;
    gap: 18px;
    overflow-x: auto;
    padding: 0 24px 18px;
    scroll-snap-type: x mandatory;
    scrollbar-width: thin;
    scrollbar-color: var(--s5-color) transparent;
}

.hb-poster {
    flex: 0 0 200px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    scroll-snap-align: start;
}

.hb-poster-image {
    aspect-ratio: 3 / 4;
    overflow: hidden;
    border-radius: 12px;
    background-color: #eee;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.14);
}

.hb-poster:hover img {
    transform: scale(1.05);
}

.hb-poster-title {
    margin: 0;
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.5;
    color: var(--mud-palette-text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hb-poster:hover .hb-poster-title {
    color: var(--s5-color);
}

.hb-poster-author {
    font-size: 0.78rem;
    color: var(--mud-palette-text-secondary);
}

/* ---- smaller screens ---- */
@media (max-width: 960px) {
    .hb-cards-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .hb-quotes-body {
        grid-template-columns: 1fr;
    }

    .hb-mosaic-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-auto-rows: 170px;
    }
}

@media (max-width: 600px) {
    .hb-cards-grid {
        grid-template-columns: 1fr;
    }

    .hb-quote {
        padding: 28px 20px 22px;
    }

    .hb-quote-title {
        font-size: 1.2rem;
    }

    .hb-mosaic-grid {
        grid-auto-rows: 150px;
    }

    /* Strip: a stack of rows (small image beside the text) instead of sideways scrolling */
    .hb-strip-band {
        padding: 12px;
    }

    .hb-strip-track {
        flex-direction: column;
        gap: 12px;
        overflow-x: visible;
        padding: 0;
        scroll-snap-type: none;
    }

    .hb-poster {
        flex: none;
        display: grid;
        grid-template-columns: 90px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 14px;
        row-gap: 4px;
        align-content: center;
    }

    .hb-poster-image {
        grid-row: 1 / span 2;
        aspect-ratio: 4 / 3;
        box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);
    }

    .hb-poster-title {
        align-self: end;
    }

    .hb-poster-author {
        align-self: start;
    }
}
