@import url('https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;400&display=swap');

* {
    box-sizing: border-box;
}

html {
    --nav-height: 54px;
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
    scroll-padding-top: var(--nav-height); /* keep the fixed top bar clear of snap targets */
    overscroll-behavior: none;
}

body {
    background-color: rgb(15, 33, 62);
    border: 0;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    background-attachment: fixed;
    transition: background-image 0.5s ease-in-out;
    font-family: 'Open Sans', sans-serif;
}

/* Darkening scrim over the photo background, kept behind all content */
.cover {
    position: fixed;
    inset: 0;
    background-color: black;
    opacity: 0.45;
    z-index: 0;
}

/* Blur the background photo while the user is typing */
body:focus-within .cover {
    backdrop-filter: blur(8px);
}

a {
    cursor: pointer;
    text-decoration: none !important;
}

p {
    margin: 0;
    filter: drop-shadow(0px 0px 1px #222222);
}

/* ----------------------------------------------------------------------
 * Top menu bar: shortcuts to the intranet's own pages
 * -------------------------------------------------------------------- */
.topNav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 8px;
    min-height: var(--nav-height);
    padding: 8px 4vw;
}

.navLink {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: white;
    font-size: 14px;
    padding: 7px 14px 7px 7px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.12);
    transition: background-color 0.25s ease, transform 0.2s ease;
    white-space: nowrap;
}

.navLink:hover {
    background-color: rgba(255, 255, 255, 0.22);
    transform: translateY(-1px);
}

.navLink img {
    width: 26px;
    height: 26px;
    object-fit: contain;
    padding: 4px;
    border-radius: 7px;
    background-color: white;
    flex-shrink: 0;
}

/* ----------------------------------------------------------------------
 * Hero (first screen): logo + Google search
 * -------------------------------------------------------------------- */
.hero {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    scroll-snap-align: start;
}

.logo {
    margin-bottom: 2vh;
    background-image: url("images/logo.png");
    width: 40vmin;
    min-width: 350px;
    max-width: 80vw;
    aspect-ratio: 3.57 / 1;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
}

.searchArea {
    position: relative;
    width: 80vmin;
    min-width: 35vw;
    max-width: 90vw;
}

.searchBarBox {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: row;
    background-color: white;
    border-radius: 18px;
    padding: 8px;
    height: fit-content;
    width: 80vmin;
    min-width: 35vw;
    max-width: 90vw;
    transition: 0.3s ease-out;
}

.searchArea .searchBarBox {
    width: 100%;
    min-width: 0;
    max-width: none;
}

/* Search suggestions dropdown */
.suggestions {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px;
    list-style: none;
    background-color: white;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
    z-index: 5;
    text-align: left;
}

.suggestion {
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    color: #222;
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggestion:hover,
.suggestion.active {
    background-color: #eef1f5;
}

.searchBarForm {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.logoSmall {
    background-image: url("images/logoSmall.jpeg");
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    height: 40px;
    width: 40px;
    flex-shrink: 0;
}

.searchBar {
    width: 96%;
    height: 40px;
    border: 0;
    border-radius: 10px;
    padding: 0;
    margin-left: 8px;
    transition: 0.5s;
    font-size: 16px;
}

.searchBar:focus {
    outline: none;
    padding-left: 5px;
}

label {
    display: none;
}

button {
    all: unset;
    cursor: pointer;
    width: 40px;
    border-radius: 10px;
    margin-left: 6px;
    transition: 0.5s;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-shrink: 0;
}

svg {
    color: #000;
    fill: currentColor;
    width: 40px;
    height: 40px;
    padding: 10px;
}

.scrollCue {
    margin-top: 5vh;
    color: white;
    font-weight: 400;
    letter-spacing: 1px;
    filter: drop-shadow(0px 0px 1px #222222);
    animation: bob 2s ease-in-out infinite;
}

@keyframes bob {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(6px); }
}

@media (prefers-reduced-motion: reduce) {
    .scrollCue { animation: none; }
    html {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }
}

/* Featured apps: small icon shortcuts under the search bar */
.featured {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: flex-start;
    gap: 18px;
    margin-top: 3vh;
    max-width: 90vw;
}

.featuredTile {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    width: 72px;
    color: white;
    text-align: center;
    transition: transform 0.2s ease;
}

.featuredTile:hover {
    transform: translateY(-3px);
}

.featuredTile img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    padding: 6px;
    border-radius: 12px;
    background-color: white;
}

.featuredTile p {
    font-size: 12px;
    line-height: 1.2;
}

/* Weather widget: current conditions + forecast, pinned bottom-left of hero. Press to expand. */
.weather {
    position: absolute;
    left: 24px;
    bottom: 22px;
    z-index: 1;
    color: white;
    filter: drop-shadow(0px 0px 1px #222222);
    max-width: min(440px, 92vw);
    cursor: pointer;
    transition: background 0.3s ease, box-shadow 0.3s ease;
}

/* Expanded state: lift the text-only shadow and sit the card on a glassy panel */
.weather.expanded {
    filter: none;
    background: rgba(18, 22, 31, 0.55);
    -webkit-backdrop-filter: blur(12px);
    backdrop-filter: blur(12px);
    border-radius: 16px;
    padding: 16px 18px;
    margin: -16px -18px; /* keep the current-conditions text anchored in place while the panel grows outward */
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
}

/* The pressable region (current conditions + chevron); reset native button styling */
.weatherToggle {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    background: none;
    border: 0;
    padding: 0;
    margin: 0;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
    border-radius: 12px;
}

.weatherToggle:focus-visible {
    outline: 2px solid rgba(255, 255, 255, 0.8);
    outline-offset: 4px;
}

.weatherChevron {
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    opacity: 0.85;
    transition: transform 0.3s ease;
}

.weather.expanded .weatherChevron {
    transform: rotate(180deg);
}

.weatherNow {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Detailed stats grid, collapsed until the card is expanded */
.weatherDetail {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px 18px;
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    margin-top: 0;
    transition: max-height 0.35s ease, opacity 0.25s ease, margin-top 0.35s ease;
}

.weather.expanded .weatherDetail {
    max-height: 220px;
    opacity: 1;
    margin-top: 12px;
}

.weatherStat {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-size: 13px;
}

.weatherStatLabel {
    opacity: 0.9;
}

.weatherStatValue {
    font-weight: 600;
    white-space: nowrap;
}

.weatherIcon {
    font-size: 42px;
    line-height: 1;
}
.weatherTemp {
    font-size: 26px;
    line-height: 1.1;
}

.weatherDesc {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 2px;
}

/* Clock widget: pinned bottom-right of hero */
.clock {
    position: absolute;
    right: 24px;
    bottom: 22px;
    z-index: 1;
    color: white;
    filter: drop-shadow(0px 0px 1px #222222);
    text-align: right;
}

.clockTime {
    font-size: 42px;
    line-height: 1;
    margin: 0;
}

.clockDate {
    font-size: 14px;
    opacity: 0.9;
    margin: 4px 0 0 0;
}

.weatherForecast {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
}

.forecastDay {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 3px;
    min-width: 46px;
}

.forecastName {
    font-size: 12px;
    opacity: 0.9;
}

.forecastIcon {
    font-size: 20px;
    line-height: 1;
}

.forecastTemp {
    font-size: 11px;
    white-space: nowrap;
}

/* ----------------------------------------------------------------------
 * Dashboard: filter + categorised app grid
 * -------------------------------------------------------------------- */
.dashboard {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    padding: 0 4vw 10vh;
    scroll-snap-align: start;
}

.filterBar {
    position: sticky;
    top: var(--nav-height);
    z-index: 2;
    display: flex;
    justify-content: center;
    padding: 18px 0;
}

.appFilter {
    width: min(520px, 92%);
    height: 46px;
    border: 0;
    border-radius: 12px;
    padding: 0 16px;
    font-family: inherit;
    font-size: 16px;
    background-color: white;
}

.appFilter:focus {
    outline: 2px solid rgba(255, 255, 255, 0.6);
    outline-offset: 2px;
}

.category {
    max-width: 1100px;
    margin: 0 auto 32px;
}

.category h2 {
    color: white;
    font-weight: 300;
    font-size: clamp(18px, 2.4vw, 24px);
    letter-spacing: 0.5px;
    margin: 18px 6px 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.25);
    filter: drop-shadow(0px 0px 1px #222222);
}

.appGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 14px;
}

.appTile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    padding: 16px 8px;
    border-radius: 15px;
    color: white;
    text-align: center;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.appTile:hover {
    background-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-3px);
}

.appTile img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    padding: 6px;
    border-radius: 12px;
    background-color: white;
}

.appTile p {
    font-size: 14px;
    line-height: 1.25;
}

.noResults {
    color: white;
    text-align: center;
    font-size: 16px;
    margin-top: 24px;
    filter: drop-shadow(0px 0px 1px #222222);
}

.credits {
    position: fixed;
    bottom: 1px;
    right: 10px;
    color: white;
    z-index: 2;
    font-size: 12px;
}

/* ----------------------------------------------------------------------
 * Responsive tweaks
 * -------------------------------------------------------------------- */
/* ----------------------------------------------------------------------
 * Key Staff & Contacts page (staff.html)
 * -------------------------------------------------------------------- */
.staffHeader {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    padding: 22px 4vw 6px;
    color: white;
}

.backLink {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: white;
    font-size: 15px;
    padding: 8px 14px;
    border-radius: 10px;
    background-color: rgba(255, 255, 255, 0.12);
    transition: background-color 0.25s ease;
    filter: drop-shadow(0px 0px 1px #222222);
}

.backLink:hover {
    background-color: rgba(255, 255, 255, 0.22);
}

.staffHeader .logoSmall {
    border-radius: 8px;
}

.staffTitle {
    color: white;
    font-weight: 300;
    font-size: clamp(22px, 3vw, 34px);
    letter-spacing: 0.5px;
    margin: 0;
    filter: drop-shadow(0px 0px 1px #222222);
}

.staffMain {
    position: relative;
    z-index: 1;
    min-height: 60vh;
    padding: 0 4vw 12vh;
}

.staffList {
    max-width: 1100px;
    margin: 0 auto;
}

.categoryNote {
    color: white;
    font-size: 14px;
    line-height: 1.5;
    opacity: 0.92;
    margin: -6px 6px 16px;
    filter: drop-shadow(0px 0px 1px #222222);
}

.categoryNote strong {
    font-weight: 600;
}

.staffGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
    gap: 14px;
}

.staffCard {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 16px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: white;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.staffCard:hover {
    background-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-3px);
}

.staffAvatar {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    letter-spacing: 0.5px;
    background: linear-gradient(135deg, #2c5da3, #14315e);
    color: white;
}

.staffInfo {
    min-width: 0;
    flex: 1;
}

.staffNameRow {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.staffName {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
}

.staffRole {
    font-size: 13px;
    opacity: 0.9;
    margin-top: 2px;
    line-height: 1.3;
}

.staffTag {
    font-size: 10.5px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    padding: 2px 8px;
    border-radius: 999px;
    background-color: #c0392b;
    color: white;
    filter: none;
}

.staffContacts {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
}

.staffContact {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    color: white;
    font-size: 13.5px;
    width: fit-content;
    max-width: 100%;
    opacity: 0.95;
    transition: opacity 0.2s ease;
    word-break: break-word;
}

.staffContact:hover {
    opacity: 1;
    text-decoration: underline !important;
}

.staffContact .icon {
    flex-shrink: 0;
    opacity: 0.85;
}

/* ----------------------------------------------------------------------
 * Computer Rooms & Software page (rooms.html)
 * -------------------------------------------------------------------- */
.roomsHint {
    max-width: 1100px;
    margin: -4px auto 18px;
    color: white;
    font-size: 14px;
    opacity: 0.85;
    text-align: center;
    filter: drop-shadow(0px 0px 1px #222222);
}

.roomGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 14px;
}

.roomCard {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px;
    border-radius: 15px;
    background-color: rgba(255, 255, 255, 0.1);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: white;
    transition: transform 0.25s ease, background-color 0.25s ease;
}

.roomCard:hover {
    background-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-3px);
}

.roomCardHeader {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}

.roomName {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
}

.roomCount {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    padding: 3px 9px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.16);
    white-space: nowrap;
}

.roomMeta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.3;
}

.roomMeta .icon {
    flex-shrink: 0;
    opacity: 0.85;
}

.appChips {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: 2px;
}

.appChip {
    font-size: 12.5px;
    line-height: 1.2;
    padding: 5px 11px;
    border-radius: 999px;
    background-color: rgba(255, 255, 255, 0.14);
    color: white;
    filter: none;
}

/* The app the user is searching for, highlighted within each room */
.appChip.match {
    background-color: #2c5da3;
    font-weight: 600;
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.5);
}

@media only screen and (max-width: 1500px) {
    .logo {
        min-width: 300px;
        width: 35vmin;
    }

    .logoSmall {
        width: 30px;
        height: 30px;
    }

    svg {
        width: 28px;
        height: 28px;
        padding: 6px;
    }

    .searchBar {
        height: 35px;
    }

    .credits {
        font-size: 10px;
    }
}

@media only screen and (max-width: 600px) {
    html {
        --nav-height: 48px;
    }

    .topNav {
        justify-content: center;
        gap: 6px;
        padding: 6px 3vw;
    }

    .navLink {
        font-size: 13px;
        padding: 6px 12px 6px 6px;
        gap: 6px;
    }

    .navLink img {
        width: 22px;
        height: 22px;
    }

    .appGrid {
        grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
        gap: 10px;
    }

    .appTile img {
        width: 48px;
        height: 48px;
    }

    .appTile p {
        font-size: 13px;
    }

    .featured {
        gap: 12px;
    }

    .featuredTile {
        width: 64px;
    }

    .featuredTile img {
        width: 42px;
        height: 42px;
    }

    .featuredTile p {
        font-size: 11px;
    }

    .weather {
        left: 12px;
        right: 12px;
        bottom: 12px;
        max-width: none;
    }

    .weather.expanded {
        padding: 12px;
        margin: -12px; /* stay within the 12px edge inset on small screens */
    }

    .weatherIcon {
        font-size: 34px;
    }

    .weatherTemp {
        font-size: 22px;
    }

    .weatherForecast {
        gap: 10px;
        margin-top: 8px;
    }

    .forecastDay {
        min-width: 40px;
    }

    .clock {
        display: none; /* Hide clock on very small screens to prevent overlap with weather */
    }
}
