/*
 * Harbour Institute of Vocational Education — public theme (SPEC-0087 §7).
 *
 * Institutional, quiet and accessible (WCAG 2.1 AA): system fonts only (no
 * web-font or CDN request, CSP SPEC-0006), 4.5:1 text contrast, visible focus,
 * and a two-level menu that opens on hover and on keyboard focus without
 * script. Block styles are namespaced `hive-` so this sheet can also load in
 * the visual editor's canvas without touching other sites' blocks; the page
 * chrome is scoped to `.hive-page`.
 */

:root {
    --hive-navy: #0b2f4a;
    --hive-navy-2: #123f61;
    --hive-teal: #0b6e6e;
    --hive-gold: #f2b632;
    --hive-ink: #1b2430;
    --hive-muted: #4b5866;
    --hive-line: #d9dfe5;
    --hive-soft: #f3f6f8;
    --hive-link: #0a5a8c;
    --hive-paper: #fff;
    --hive-on-brand: #fff;
    --hive-radius: 10px;
    --hive-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, "Noto Sans HK", "Noto Sans TC", "Noto Sans CJK TC", "PingFang HK", "Microsoft JhengHei", sans-serif;
}

/* ---------- Page chrome ---------- */

.hive-page {
    margin: 0;
    background: var(--hive-paper);
    color: var(--hive-ink);
    font-family: var(--hive-font);
    font-size: 1.0625rem;
    line-height: 1.6;
}

.hive-page a {
    color: var(--hive-link);
}

.hive-page a:focus-visible,
.hive-page summary:focus-visible,
.hive-page [tabindex]:focus-visible {
    outline: 3px solid var(--hive-gold);
    outline-offset: 2px;
    box-shadow: 0 0 0 5px var(--hive-navy);
}

.hive-container {
    box-sizing: border-box;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

.hive-visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.hive-skip {
    position: absolute;
    inset-inline-start: 1rem;
    top: -4rem;
    z-index: 10;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    background: var(--hive-gold);
    color: var(--hive-navy) !important;
    font-weight: 700;
}

.hive-skip:focus {
    top: 1rem;
}

.hive-header__bar {
    background: var(--hive-navy);
    color: var(--hive-on-brand);
}

.hive-header__inner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.hive-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--hive-on-brand) !important;
    text-decoration: none;
}

.hive-brand__text {
    display: flex;
    flex-direction: column;
}

.hive-brand__name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.hive-brand__tagline {
    font-size: 0.85rem;
    color: #d4e2ec;
}

.hive-lang {
    padding: 0.4rem 0.9rem;
    border: 1px solid #8fb0c7;
    border-radius: 999px;
    color: var(--hive-on-brand) !important;
    font-size: 0.95rem;
    text-decoration: none;
    white-space: nowrap;
}

.hive-lang:hover {
    background: var(--hive-navy-2);
}

.hive-nav {
    background: var(--hive-paper);
    border-bottom: 1px solid var(--hive-line);
    box-shadow: 0 1px 0 rgba(11, 47, 74, 0.04);
}

.hive-nav__list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hive-nav__item {
    position: relative;
}

.hive-nav__link {
    display: block;
    padding: 0.9rem 1rem;
    color: var(--hive-ink) !important;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 3px solid transparent;
}

.hive-nav__item.is-active > .hive-nav__link,
.hive-nav__link:hover {
    border-bottom-color: var(--hive-gold);
    color: var(--hive-navy) !important;
}

.hive-nav__sub {
    position: absolute;
    inset-inline-start: 0;
    top: 100%;
    z-index: 5;
    display: none;
    min-width: 16rem;
    margin: 0;
    padding: 0.5rem 0;
    list-style: none;
    background: var(--hive-paper);
    border: 1px solid var(--hive-line);
    border-radius: 0 0 var(--hive-radius) var(--hive-radius);
    box-shadow: 0 12px 24px rgba(11, 47, 74, 0.12);
}

.hive-nav__item:hover > .hive-nav__sub,
.hive-nav__item:focus-within > .hive-nav__sub {
    display: block;
}

.hive-nav__sub a {
    display: block;
    padding: 0.5rem 1.1rem;
    color: var(--hive-ink) !important;
    text-decoration: none;
}

.hive-nav__sub a:hover,
.hive-nav__sub a[aria-current='page'] {
    background: var(--hive-soft);
    color: var(--hive-navy) !important;
}

.hive-breadcrumb ol {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    margin: 0;
    padding: 1rem 0 0;
    list-style: none;
    font-size: 0.9rem;
}

.hive-breadcrumb li + li::before {
    content: "›";
    margin-inline-end: 0.35rem;
    color: var(--hive-muted);
}

.hive-body {
    min-height: 50vh;
}

.hive-footer {
    margin-top: 4rem;
    background: var(--hive-navy);
    color: #e6eef4;
    font-size: 0.95rem;
}

.hive-footer a {
    color: var(--hive-on-brand) !important;
}

.hive-footer__grid {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 2rem;
    padding-top: 2.5rem;
    padding-bottom: 2rem;
}

.hive-footer__name {
    margin: 0 0 0.75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--hive-on-brand);
}

.hive-footer__heading {
    margin: 0 0 0.25rem;
    font-weight: 600;
}

.hive-footer address {
    font-style: normal;
}

.hive-footer__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.4rem 1.5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hive-footer__legal {
    padding-top: 1rem;
    padding-bottom: 1.5rem;
    border-top: 1px solid #2c5574;
    color: #c9d8e3;
    font-size: 0.85rem;
}

.hive-footer__legal p {
    margin: 0.25rem 0;
}

/* ---------- Layout pages (the shared landing presentation) ---------- */

.hive-page .bn-official-site__content {
    max-width: 1200px;
    margin: 0 auto;
}

.hive-page .bn-official-site__content-heading {
    padding: 1.25rem 1.5rem 0;
}

.hive-page .bn-official-site__content-heading h1,
.hive-detail h1 {
    margin: 0.5rem 0 0;
    color: var(--hive-navy);
    font-size: clamp(1.9rem, 3.2vw, 2.6rem);
    line-height: 1.2;
}

.hive-page--home .bn-official-site__content-heading {
    position: absolute !important;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
}

.hive-page .bn-canvas__grid {
    padding: 1.5rem;
    gap: 1.75rem;
}

.hive-page .bn-canvas__block {
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    min-height: 0;
}

/* ---------- Blocks ---------- */

.hive-button {
    display: inline-block;
    margin-top: 1rem;
    padding: 0.7rem 1.3rem;
    border-radius: 999px;
    background: var(--hive-gold);
    color: var(--hive-navy) !important;
    font-weight: 700;
    text-decoration: none;
}

.hive-button:hover {
    background: #ffc94d;
}

.hive-banner {
    position: relative;
    overflow: hidden;
    min-height: 360px;
    border-radius: var(--hive-radius);
    background: var(--hive-navy);
    color: var(--hive-on-brand);
    font-family: var(--hive-font);
}

.hive-banner__image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hive-banner__panel {
    position: relative;
    box-sizing: border-box;
    max-width: 36rem;
    margin: 3rem 2rem;
    padding: 1.75rem 2rem;
    border-radius: var(--hive-radius);
    background: rgba(11, 47, 74, 0.92);
}

.hive-banner--plain .hive-banner__panel {
    margin: 0;
    background: transparent;
}

.hive-banner__eyebrow {
    margin: 0;
    color: var(--hive-gold);
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hive-banner__title {
    margin: 0.35rem 0 0;
    color: var(--hive-on-brand);
    font-size: clamp(1.8rem, 3.4vw, 2.6rem);
    line-height: 1.15;
}

.hive-banner__body {
    margin: 0.75rem 0 0;
    color: #e8f0f5;
}

.hive-section {
    font-family: var(--hive-font);
}

.hive-section__title {
    margin: 0 0 1rem;
    color: var(--hive-navy);
    font-size: 1.6rem;
}

.hive-muted {
    color: var(--hive-muted);
}

.hive-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1.25rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.hive-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--hive-line);
    border-radius: var(--hive-radius);
    background: var(--hive-paper);
    transition: box-shadow 0.15s ease;
}

.hive-card:hover,
.hive-card:focus-within {
    box-shadow: 0 10px 24px rgba(11, 47, 74, 0.12);
}

.hive-card__image {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 3 / 2;
    object-fit: cover;
    background: var(--hive-soft);
}

.hive-card__body {
    padding: 1rem 1.15rem 1.25rem;
}

.hive-card__meta {
    margin: 0;
    color: var(--hive-muted);
    font-size: 0.85rem;
}

.hive-card__title {
    margin: 0.35rem 0 0;
    font-size: 1.15rem;
    line-height: 1.35;
}

.hive-card__title a {
    color: var(--hive-navy) !important;
    text-decoration: none;
}

.hive-card__title a:hover {
    text-decoration: underline;
}

.hive-card__text {
    margin: 0.5rem 0 0;
    color: #36414d;
    font-size: 0.95rem;
}

.hive-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin: 0.85rem 0 0;
    padding: 0;
    list-style: none;
}

.hive-tags li {
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    background: var(--hive-soft);
    color: #2c3a47;
    font-size: 0.8rem;
}

.hive-tags .hive-tags__open {
    background: #e2f3ee;
    color: #075e45;
}

.hive-events {
    margin: 0;
    padding: 0;
    list-style: none;
    border-top: 1px solid var(--hive-line);
}

.hive-event {
    display: flex;
    align-items: flex-start;
    gap: 1.1rem;
    padding: 1rem 0;
    border-bottom: 1px solid var(--hive-line);
}

.hive-event__date {
    display: flex;
    flex: none;
    flex-direction: column;
    align-items: center;
    width: 4rem;
    margin: 0;
    padding: 0.45rem 0;
    border-radius: 8px;
    background: var(--hive-navy);
    color: var(--hive-on-brand);
    line-height: 1.1;
}

.hive-event__day {
    font-size: 1.5rem;
    font-weight: 700;
}

.hive-event__month {
    font-size: 0.8rem;
    text-transform: uppercase;
}

.hive-event__title {
    margin: 0;
    font-size: 1.1rem;
}

.hive-event__title a {
    color: var(--hive-navy) !important;
}

.hive-event__meta {
    margin: 0.25rem 0 0;
    color: var(--hive-muted);
    font-size: 0.92rem;
}

.hive-facts {
    padding: 1.75rem 2rem;
    border-radius: var(--hive-radius);
    background: var(--hive-soft);
    font-family: var(--hive-font);
}

.hive-facts__list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
    gap: 1.25rem;
    margin: 0;
}

.hive-facts__item {
    display: flex;
    flex-direction: column-reverse;
    padding-inline-start: 1rem;
    border-inline-start: 4px solid var(--hive-gold);
}

.hive-facts__item dd {
    margin: 0;
    color: var(--hive-navy);
    font-size: 2.1rem;
    font-weight: 800;
    line-height: 1.1;
}

.hive-facts__item dt {
    margin-top: 0.25rem;
    color: #36414d;
}

.hive-campus {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    overflow: hidden;
    border: 1px solid var(--hive-line);
    border-radius: var(--hive-radius);
    background: var(--hive-paper);
    font-family: var(--hive-font);
}

.hive-campus__image {
    width: 100%;
    height: 100%;
    min-height: 220px;
    object-fit: cover;
}

.hive-campus__body {
    padding: 1.25rem 1.5rem;
}

.hive-campus__name {
    margin: 0;
    color: var(--hive-navy);
    font-size: 1.35rem;
}

.hive-campus__name a {
    color: var(--hive-navy) !important;
}

.hive-campus__address {
    margin: 0.4rem 0 0;
    font-weight: 600;
}

.hive-campus__facts,
.hive-campus__transport {
    margin: 0.5rem 0 0;
    color: #36414d;
    font-size: 0.95rem;
}

.hive-campus__transport::before {
    content: "→ ";
    color: var(--hive-teal);
}

.hive-media-text {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    gap: 2rem;
    font-family: var(--hive-font);
}

.hive-media-text--plain {
    grid-template-columns: minmax(0, 1fr);
}

.hive-media-text__image {
    width: 100%;
    height: auto;
    border-radius: var(--hive-radius);
}

.hive-prose {
    max-width: 46rem;
}

.hive-prose h2 {
    margin: 0 0 0.75rem;
    color: var(--hive-navy);
    font-size: 1.5rem;
}

.hive-prose h3 {
    margin: 1.5rem 0 0.5rem;
    color: var(--hive-navy);
    font-size: 1.2rem;
}

.hive-prose p,
.hive-prose ul,
.hive-prose ol {
    margin: 0 0 1rem;
}

.hive-prose a {
    color: var(--hive-link);
}

.hive-page .bn-canvas-text,
.hive-page .bn-canvas-heading__text {
    font-family: var(--hive-font);
}

.hive-page .bn-canvas-heading__text {
    margin: 0;
    color: var(--hive-navy);
    font-size: 1.6rem;
}

.hive-sitemap ul {
    margin: 0;
    padding-inline-start: 1.25rem;
}

.hive-sitemap > ul {
    columns: 2;
    column-gap: 3rem;
}

.hive-sitemap li {
    margin: 0.25rem 0;
    break-inside: avoid;
}

/* ---------- Detail pages (programme, event, article) ---------- */

.hive-detail {
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 1.5rem 0;
}

.hive-detail__eyebrow {
    margin: 0;
    color: var(--hive-teal);
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.hive-detail__lead {
    max-width: 48rem;
    margin: 0.75rem 0 0;
    color: #36414d;
    font-size: 1.2rem;
}

.hive-detail__grid {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(16rem, 1fr);
    gap: 2.5rem;
    margin-top: 2rem;
}

.hive-detail__single {
    max-width: 50rem;
    margin-top: 2rem;
}

.hive-detail__image {
    display: block;
    width: 100%;
    height: auto;
    margin-bottom: 1.75rem;
    border-radius: var(--hive-radius);
}

.hive-detail__aside {
    align-self: start;
    padding: 1.5rem;
    border-radius: var(--hive-radius);
    background: var(--hive-soft);
}

.hive-detail__aside h2 {
    margin: 0 0 1rem;
    color: var(--hive-navy);
    font-size: 1.2rem;
}

.hive-facts-list {
    margin: 0;
}

.hive-facts-list div {
    padding: 0.55rem 0;
    border-bottom: 1px solid var(--hive-line);
}

.hive-facts-list dt {
    color: var(--hive-muted);
    font-size: 0.85rem;
}

.hive-facts-list dd {
    margin: 0;
    font-weight: 600;
}

.hive-status {
    display: inline-block;
    margin: 1rem 0 0;
    padding: 0.2rem 0.75rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 700;
}

.hive-status--open {
    background: #e2f3ee;
    color: #075e45;
}

.hive-status--closed {
    background: #f4e6e6;
    color: #8a1f1f;
}

@media (max-width: 860px) {
    .hive-detail__grid,
    .hive-media-text,
    .hive-campus,
    .hive-footer__grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .hive-nav__sub {
        position: static;
        display: none;
        box-shadow: none;
    }

    .hive-brand__tagline {
        display: none;
    }

    .hive-banner__panel {
        margin: 1.5rem 1rem;
        padding: 1.25rem;
    }

    .hive-sitemap > ul {
        columns: 1;
    }
}

/* Banyan's built-in structured template (types made in the content-type
   builder, SPEC-0088 §6) inside the HIVE shell: the same column as HIVE pages. */
.bn-page--structured {
    box-sizing: border-box;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 3rem;
    line-height: 1.6;
}

.bn-page--structured .bn-page__fact strong {
    font-weight: 600;
}

/* Search (SPEC-0096): the header box and the results page. */
.hive-search {
    display: flex;
    gap: 0.4rem;
    margin-inline-start: auto;
}

.hive-search input {
    width: 13em;
    min-width: 0;
    padding: 0.4rem 0.9rem;
    border: 1px solid #8fb0c7;
    border-radius: 999px;
    background: var(--hive-paper);
    color: var(--hive-navy, #0b2f4a);
    font: inherit;
    font-size: 0.95rem;
}

.hive-search button {
    padding: 0.4rem 0.9rem;
    border: 0;
    border-radius: 999px;
    background: #f2b632;
    color: #0b2f4a;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 700;
    cursor: pointer;
}

.hive-search input:focus-visible,
.hive-search button:focus-visible,
.bn-site-search input:focus-visible,
.bn-site-search button:focus-visible {
    outline: 3px solid #f2b632;
    outline-offset: 2px;
}

.bn-site-search {
    max-width: 72rem;
    margin: 2rem auto 3rem;
    padding-inline: 1.25rem;
}

.bn-site-search__form label {
    display: block;
    margin-bottom: 0.4rem;
    font-weight: 600;
}

.bn-site-search__row {
    display: flex;
    gap: 0.5rem;
    max-width: 40rem;
}

.bn-site-search__row input {
    flex: 1;
    padding: 0.6rem 1rem;
    border: 1px solid var(--hive-line, #cbd5e1);
    border-radius: 999px;
    font: inherit;
}

.bn-site-search__row button {
    padding: 0.6rem 1.2rem;
    border: 0;
    border-radius: 999px;
    background: var(--hive-navy, #0b2f4a);
    color: var(--hive-on-brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.bn-site-search__summary {
    margin: 1.5rem 0 0.5rem;
}

.bn-site-search__results {
    display: grid;
    gap: 1rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.bn-site-search__results h2 {
    margin: 0 0 0.25rem;
    font-size: 1.25rem;
}

.bn-site-search__url {
    margin: 0.25rem 0 0;
    color: #52677a;
    font-size: 0.85rem;
    overflow-wrap: anywhere;
}

.bn-site-search__pages {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 1.5rem;
}

@media (max-width: 720px) {
    .hive-search {
        order: 3;
        width: 100%;
    }

    .hive-search input {
        flex: 1;
        width: auto;
    }
}

/* A phone is too narrow for the 12-column canvas: "Latest news" (7) beside
   "Upcoming events" (5) squeezed the events to 126px and pushed the page wider
   than the screen. Below 480px every block takes the full row. */
@media (max-width: 480px) {
    .hive-page .bn-canvas__grid {
        padding: 1rem;
    }

    .hive-page .bn-canvas__block {
        grid-column: 1 / -1;
    }
}

/* Forms (SPEC-0106): the Form block's plain HTML, in the HIVE look. */
.bn-form {
    max-width: 44rem;
    margin-block: 2rem;
    padding: 1.5rem;
    border: 1px solid var(--hive-line);
    border-radius: var(--hive-radius);
    background: var(--hive-paper);
}

.bn-form__form {
    display: grid;
    gap: 1.1rem;
}

.bn-form__field,
.bn-form__group {
    display: grid;
    gap: 0.35rem;
    margin: 0;
    padding: 0;
    border: 0;
}

.bn-form__field label,
.bn-form__group legend {
    font-weight: 600;
    color: var(--hive-ink);
}

.bn-form input[type='text'],
.bn-form input[type='email'],
.bn-form input[type='tel'],
.bn-form input[type='number'],
.bn-form input[type='date'],
.bn-form select,
.bn-form textarea {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 0.55rem 0.75rem;
    border: 1px solid #6b7c8c;
    border-radius: 6px;
    background: var(--hive-paper);
    color: var(--hive-ink);
    font: inherit;
}

.bn-form input:focus-visible,
.bn-form select:focus-visible,
.bn-form textarea:focus-visible,
.bn-form__submit:focus-visible {
    outline: 3px solid var(--hive-gold);
    outline-offset: 2px;
}

.bn-form__field--consent {
    grid-template-columns: auto 1fr;
    align-items: start;
    column-gap: 0.6rem;
}

.bn-form__field--consent .bn-form__help,
.bn-form__field--consent .bn-form__error {
    grid-column: 2;
}

.bn-form__choice {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.bn-form__help {
    margin: 0;
    color: var(--hive-muted);
    font-size: 0.92rem;
}

.bn-form__pics {
    padding: 0.9rem 1rem;
    border-inline-start: 4px solid var(--hive-teal);
    background: var(--hive-soft);
    font-size: 0.92rem;
}

.bn-form__error {
    margin: 0;
    color: #a4161a;
    font-weight: 600;
}

.bn-form__field--error input,
.bn-form__field--error select,
.bn-form__field--error textarea {
    border: 2px solid #a4161a;
}

.bn-form__summary {
    padding: 1rem 1.2rem;
    border: 2px solid #a4161a;
    border-radius: 6px;
    background: #fdf2f2;
}

.bn-form__summary-title {
    margin: 0 0 0.4rem;
    font-size: 1.05rem;
}

.bn-form__summary a {
    color: #a4161a;
}

.bn-form__success {
    margin: 0;
    padding: 1rem 1.2rem;
    border-inline-start: 4px solid var(--hive-teal);
    background: var(--hive-soft);
    font-weight: 600;
}

.bn-form__submit {
    justify-self: start;
    padding: 0.65rem 1.4rem;
    border: 0;
    border-radius: 999px;
    background: var(--hive-navy);
    color: var(--hive-on-brand);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}
