/* ============================================================
   Home – Highlights Section (authoritative component file)

   Desktop/tablet structural styles currently live in
   assets/css/home/_highlight.css (handle: mtic-home-highlight),
   added by another developer. This file is enqueued AFTER it
   and holds the approved mobile/tablet layout (max-width: 1200px) plus
   the header View All link.

   Mobile/tablet design: featured item on top, then the next three
   news cards in a horizontal row (image above text within each card).
   ============================================================ */

/* Header View All — overrides the sr-only rule in _highlight.css */
.mtic-highlights__view-all {
    position: static;
    width: auto;
    height: auto;
    overflow: visible;
    clip-path: none;
    white-space: normal;
    display: inline-flex;
    align-items: center;
    gap: 0.625rem;
    flex-shrink: 0;
    min-height: 48px;
    color: var(--mtic-primary);
    text-decoration: none;
    transition: color 0.3s ease;
}

.mtic-highlights__heading {
    font-family: var(--mtic-font-heading);
    font-size: clamp(1.35rem, 2.5vw, 1.75rem);
    font-weight: 700;
    color: var(--mtic-dark);
    margin: 0;
    line-height: 1.3;
}

.mtic-highlights__heading:after {
    content: "";
    display: block;
    width: 2.5rem;
    height: 3px;
    margin-top: 6px;
    border-radius: 2px;
    background: var(--mtic-primary);
}

.mtic-highlights__view-all-text {
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
}

.mtic-highlights__view-all-arrow {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    flex-shrink: 0;
    border: 1px solid var(--mtic-primary);
    border-radius: 50%;
    background: var(--mtic-primary);
    color: var(--mtic-white);
    box-shadow: 0 8px 20px rgba(var(--mtic-teal-rgb, 1, 180, 150), 0.22);
    transform: translateZ(0);
    transition:
        background-color var(--mtic-petronas-hover-speed, 360ms) var(--mtic-petronas-hover-ease, cubic-bezier(0.16, 1, 0.3, 1)),
        border-color var(--mtic-petronas-hover-speed, 360ms) var(--mtic-petronas-hover-ease, cubic-bezier(0.16, 1, 0.3, 1)),
        box-shadow var(--mtic-petronas-hover-speed, 360ms) var(--mtic-petronas-hover-ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.mtic-highlights__view-all-arrow::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: var(--mtic-petronas-hover-width, 62%);
    border-radius: inherit;
    opacity: 0;
    pointer-events: none;
    filter: blur(var(--mtic-petronas-smoke-blur, 7px));
    background: var(--mtic-petronas-hover-gradient, linear-gradient(90deg,
        rgba(255, 255, 255, 0.30) 0%,
        rgba(255, 255, 255, 0.12) 18%,
        rgba(var(--mtic-dark-green-rgb), 0.62) 46%,
        rgba(var(--mtic-dark-green-rgb), 0.94) 100%
    ));
    transform: translateX(108%);
    transition:
        opacity var(--mtic-petronas-hover-speed, 360ms) var(--mtic-petronas-hover-ease, cubic-bezier(0.16, 1, 0.3, 1)),
        transform var(--mtic-petronas-hover-speed, 360ms) var(--mtic-petronas-hover-ease, cubic-bezier(0.16, 1, 0.3, 1));
}

.mtic-highlights__view-all-arrow svg {
    position: relative;
    z-index: 1;
}

.mtic-highlights__view-all:hover,
.mtic-highlights__view-all:focus-visible {
    color: var(--mtic-dark);
    outline: none;
}

.mtic-highlights__view-all:hover .mtic-highlights__view-all-arrow,
.mtic-highlights__view-all:focus-visible .mtic-highlights__view-all-arrow {
    border-color: var(--mtic-dark);
    box-shadow: 0 10px 24px rgba(var(--mtic-dark-green-rgb), 0.24);
}

.mtic-highlights__view-all:hover .mtic-highlights__view-all-arrow::before,
.mtic-highlights__view-all:focus-visible .mtic-highlights__view-all-arrow::before {
    opacity: 1;
    transform: translateX(0);
}

/* Featured excerpt — clamp to 3 lines so a long excerpt can't
   stretch the left column past the three stacked cards beside it */
.mtic-highlights__featured-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* News titles — clamp to two lines (overrides the 3-line / unclamped
   rules in _highlight.css; this file is enqueued after it) so card
   heights stay consistent on every viewport */
.mtic-highlights__featured-title,
.mtic-highlights__side-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Side summaries — two lines max (mobile unsets below) */
.mtic-highlights__side-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

@media (max-width: 1200px) {
    .mtic-highlights__layout {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        width: 100%;
    }

    .mtic-highlights__featured {
        grid-column: 1 / -1;
        width: 100%;
        max-width: none;
    }

    .mtic-highlights__featured-image-link {
        display: block;
        width: 100%;
        max-width: none;
    }

    .mtic-highlights__featured-image {
        width: 100%;
        max-width: none;
        height: auto;
        min-height: clamp(200px, 42vw, 420px);
        aspect-ratio: 16 / 9;
        border-radius: 10px;
        box-shadow: 0 5px 8px rgba(0, 0, 0, 0.25);
        overflow: hidden;
    }

    .mtic-highlights__featured-content,
    .mtic-highlights__featured-title,
    .mtic-highlights__featured-excerpt {
        max-width: none;
        width: 100%;
    }

    .mtic-highlights__scroll-list {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-rows: none;
        gap: 12px;
        width: 100%;
        min-width: 0;
    }

    .mtic-highlights__scroll-card {
        display: flex;
        flex-direction: column;
        grid-template-columns: unset;
        width: 100%;
        height: auto;
        min-height: 0;
    }

    .mtic-highlights__scroll-media {
        width: 100%;
        height: auto;
        aspect-ratio: 4 / 3;
        flex-shrink: 0;
    }

    .mtic-highlights__scroll-content {
        flex: 1 1 auto;
        gap: 6px;
        padding: 10px;
    }

    .mtic-highlights__side-title {
        font-size: 0.9375rem;
        line-height: 1.25;
        margin: 0;
    }

    .mtic-highlights__side-excerpt {
        font-size: 0.8125rem;
        line-height: 1.35;
        -webkit-line-clamp: 2;
    }
}

@media (max-width: 767px) {
    .mtic-highlights {
        padding: 40px 0 48px;
    }

    .mtic-highlights__header {
        flex-direction: row;
        align-items: flex-start;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 22px;
    }

    .mtic-highlights__heading {
        flex: 1;
        min-width: 0;
    }

    .mtic-highlights__layout {
        gap: 14px;
    }

    .mtic-highlights__scroll-list {
        gap: 10px;
    }

    .mtic-highlights__featured-image {
        min-height: clamp(180px, 56vw, 280px);
    }

    /* Featured: meta line (Category • Date) sits above the title */
    .mtic-highlights__featured-content {
        display: flex;
        flex-direction: column;
        padding-top: 12px;
    }

    .mtic-highlights__featured-content .mtic-highlights__meta {
        order: -1;
        margin-bottom: 8px;
    }

    .mtic-highlights__featured-title {
        font-size: 1.1875rem;
        line-height: 1.25;
        margin: 0 0 8px;
    }

    .mtic-highlights__featured-excerpt {
        margin: 0;
        font-size: 0.875rem;
        line-height: 1.5;
        text-align: left;
    }

    .mtic-highlights__scroll-content {
        padding: 8px;
    }

    .mtic-highlights__side-title {
        font-size: 0.8125rem;
    }

    .mtic-highlights__side-excerpt {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mtic-highlights__view-all-arrow,
    .mtic-highlights__view-all-arrow::before {
        transition: none;
    }
}
