/* ═══════════════════════════════════════════════════
   REUSABLE PAGE HERO BANNER  (.mtic-page-hero)
   Used on: Digital Library, Services & Apps, other inner pages.
   Background image set via inline style (dynamic URL from PHP).
   All other styles are here.
═══════════════════════════════════════════════════ */

.mtic-page-hero {
    position: relative;
    width: 100%;
    min-height: 280px;
    display: flex;
    align-items: center;
    overflow: hidden;
    background-color: var(--mtic-dark);       /* fallback if image fails */
    background-size: cover;
    background-position: center right;
    background-repeat: no-repeat;
}

/* Dark-navy → transparent gradient overlay: text readable left, image visible right */
.mtic-page-hero::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to right,
        var(--mtic-dark) 35%,
        rgba(3, 47, 60, 0.65) 60%,
        transparent 85%
    );
    z-index: 1;
}

.mtic-page-hero__inner {
    position: relative;
    z-index: 3;
    width: 100%;
    max-width: var(--mtic-container-max);
    margin: 0 auto;
    padding: 3rem var(--mtic-container-pad) 4rem;  /* extra bottom padding for curve overlap */
}

.mtic-page-hero__title {
    font-size: clamp(1.75rem, 4vw, 2.75rem);
    font-weight: 800;
    text-transform: uppercase;
    color: var(--mtic-white);
    line-height: 1.1;
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

/* Teal-highlighted word(s) inside the title, e.g. "MTIC" */
.mtic-page-hero__title--highlight {
    color: var(--mtic-primary);
}

.mtic-page-hero__subtitle {
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: 600;
    color: var(--mtic-primary);
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

.mtic-page-hero__desc {
    font-size: 0.9rem;
    color: var(--mtic-white);
    opacity: 0.85;
    max-width: 420px;
    line-height: 1.65;
}

/* ═══════════════════════════════════════════════════
   PAGE SEARCH BAR  (.mtic-page-search)
   Overlaps the hero bottom edge via negative margin-top.
   Centred, max-width 540px, rounded pill, drop shadow.
═══════════════════════════════════════════════════ */

.mtic-page-search {
    position: relative;
    z-index: 10;
    margin-top: -36px;           /* pulls up over the hero's bottom edge */
    margin-bottom: var(--mtic-spacing-lg);
    padding: 0 var(--mtic-container-pad);
}

.mtic-page-search__form {
    display: flex;
    align-items: stretch;
    max-width: 540px;
    margin: 0 auto;
    background: var(--mtic-white);
    border-radius: 50px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.14);
    overflow: hidden;
}

.mtic-page-search__input {
    flex: 1;
    border: none;
    outline: none;
    padding: 0.85rem 1.25rem;
    font-size: 0.95rem;
    font-family: var(--mtic-font-main);
    color: var(--mtic-text);
    background: transparent;
    min-height: 48px;            /* WCAG 2.1 AA touch target */
}

.mtic-page-search__input::placeholder {
    color: var(--mtic-text-light);
}

.mtic-page-search__btn {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    min-height: 48px;            /* WCAG 2.1 AA touch target */
    padding: 0 1rem;
    background: var(--mtic-primary);
    color: var(--mtic-white);
    border: none;
    border-radius: 0 50px 50px 0;
    cursor: pointer;
    transition: var(--mtic-transition);
    flex-shrink: 0;
}

.mtic-page-search__btn:hover,
.mtic-page-search__btn:focus-visible {
    background: var(--mtic-dark);
    outline: none;
}

.mtic-page-search__btn:focus-visible {
    box-shadow: 0 0 0 3px var(--mtic-primary);
}

@media screen and (max-width: 767px) {
    .mtic-page-hero {
        min-height: 220px;
    }

    /* Side gradient leaves text unreadable on narrow screens —
       switch to a full-width top-down overlay instead. */
    .mtic-page-hero::before {
        background: linear-gradient(
            180deg,
            rgba(3, 47, 60, 0.88) 0%,
            rgba(3, 47, 60, 0.55) 55%,
            rgba(3, 47, 60, 0.2) 100%
        );
    }

    .mtic-page-hero__inner {
        padding: 2rem var(--mtic-container-pad) 3.5rem;
        text-align: center;
    }

    .mtic-page-hero__desc {
        max-width: 100%;
        margin: 0 auto;
    }

    /* Less overlap on small screens */
    .mtic-page-search {
        margin-top: -22px;
    }

    .mtic-page-search__form {
        max-width: 100%;
    }
}
