.grid-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    width: 100%;
}

.grid-item {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border-radius: 8px;
    border: 2px solid rgb(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.3s ease;
}

.grid-item:hover,
.grid-item:focus-within {
    transform: translateY(-4px);
}

.grid-item-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    transition: opacity 0.3s ease;
}

.grid-item:hover .grid-item-bg,
.grid-item:focus-within .grid-item-bg {
    opacity: 0.3;
}

.grid-item-content {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    transition: opacity 0.3s ease;
    text-align: center;
}

.grid-item:hover .grid-item-content,
.grid-item:focus-within .grid-item-content {
    opacity: 1;
    background: rgb(82, 54, 147, 0.8);
}

.grid-item-title {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.grid-item-link {
    text-decoration: none;
    font-size: 0.8rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: all 0.2s ease;
    background: #fff;
    color: rgb(82, 54, 147);
}

.grid-item-link:hover {
    background: rgb(82, 54, 147);
    color: #fff;
}

/* Titled grid item variant — black overlay + centered title, darkens on hover */
.grid-item--titled {
    text-decoration: none;
    display: block;
}

.grid-item--titled .grid-item-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    transition: background 0.3s ease;
}

.grid-item--titled:hover .grid-item-overlay,
.grid-item--titled:focus-within .grid-item-overlay {
    background: rgba(0, 0, 0, 0.7);
}

.grid-item--titled .grid-item-title {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    color: #fff;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
}

/* Text-only grid item variant */
.grid-item--text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 1.25rem;
    text-align: center;
    background: #fff;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.grid-item--text:hover,
.grid-item--text:focus {
    background: rgb(82, 54, 147);
    transform: translateY(-4px);
}

.grid-item--text .grid-item-title {
    color: #182534;
    transition: color 0.3s ease;
}

.grid-item--text:hover .grid-item-title,
.grid-item--text:focus .grid-item-title {
    color: #fff;
}

/* Full-bleed: breaks out of the rvt-container-lg wrapper to span the full viewport */
@media screen and (min-width: 740px) {
    .rvt-c-full-bleed {
        position: relative;
        left: 50%;
        right: 50%;
        margin-left: -50vw;
        margin-right: -50vw;
        width: 100vw;
    }
}

/* 100vw includes the vertical scrollbar's width, so full-bleed sections end up
   ~15px wider than the visible page (sticking out ~7px each side) and cause a
   sideways scrollbar on desktop. clip (unlike hidden) cuts the overflow without
   making main a scroll container, so sticky positioning inside it is unaffected. */
main#main-content {
    overflow-x: clip;
}

/* Constrain hero content to match rvt-layout__content padding bounds
   while the full-bleed background remains viewport-wide.
   Mirrors rvt-p-lr-md (1rem) and rvt-p-lr-xxl-md-up (3rem) from the parent. */
.rvt-hero.rvt-c-full-bleed .rvt-container-lg {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
    box-sizing: border-box;
}

@media screen and (min-width: 740px) {
    .rvt-hero.rvt-c-full-bleed .rvt-container-lg {
        padding-left: 4rem;
        padding-right: 4rem;
    }
}

/* Rivet's .rvt-hero__media has no definite height of its own, so the
   height:100% on .rvt-hero__media img (in Rivet's CSS) has nothing
   reliable to resolve against — browsers can blow this up to an
   enormous height. Giving the wrapper its own aspect-ratio fixes that,
   and also normalizes our source images (which aren't all cropped to
   Rivet's expected 3:2) into a consistent box via object-fit: cover. */
.rvt-hero__media img {
    aspect-ratio: 3 / 2;
    overflow: hidden;
}

/* Responsive breakpoints */
@media (min-width: 1200px) {
    .grid-container {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (min-width: 768px) and (max-width: 1199px) {
    .grid-container {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (min-width: 576px) and (max-width: 767px) {
    .grid-container {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 575px) {
    .grid-container {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Hero header carousel: full-width horizontal cards, one per view */
.hero-carousel-container {
    position: relative;
    width: 100%;
    overflow: hidden;
    /* the slides sit side by side in a flex row; without this, a parent that
       sizes itself to its content (e.g. the ACI page's layout) counts all of
       them toward its minimum width and the page grows wider than the screen */
    contain: inline-size;
}

.hero-carousel-wrapper {
    display: flex;
    transition: transform 0.4s ease;
}

.hero-slide {
    position: relative;
    flex: 0 0 100%;
    min-width: 100%;
    min-height: 400px;
    background: #222;
    overflow: hidden;
}

.hero-slide__bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
}

.hero-slide__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 1;
}

.hero-slide__body {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    height: 100%;
    min-height: 400px;
    max-width: 40rem;
    padding: 2rem 5.5rem;
    color: #fff;
}

.hero-slide__body h2 {
    color: #fff;
    font-size: 2.25rem;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 0.75rem;
}

.hero-slide__body p {
    color: #fff;
    font-size: 1.05rem;
}

/* Rivet has no ghost/outline button variant, so define one scoped to these
   photo-background slides: transparent with a white border/text, inverting
   to a white fill with crimson text on hover/focus. */
.hero-slide__body .rvt-button,
.hero-slide__body .rvt-button--secondary {
    background-color: transparent;
    border-color: #fff;
    color: #fff;
}

.hero-slide__body .rvt-button:hover,
.hero-slide__body .rvt-button--secondary:hover,
.hero-slide__body .rvt-button:focus,
.hero-slide__body .rvt-button--secondary:focus {
    background-color: #fff;
    border-color: #fff;
    color: #900;
}

/* Utility slides (maintenance, events): informational rather than
   promotional, but still use the same photo+overlay treatment as the
   other slides — top-align text since content length varies. */
.hero-slide--utility .hero-slide__body {
    justify-content: flex-start;
    overflow-y: auto;
    padding-top: 3.5rem;
}

.hero-slide--utility .hero-slide__body a,
.hero-slide--utility .hero-slide__body button {
    color: #fff;
}

.hero-slide__eyebrow {
    color: #ffd6d6;
    font-size: 0.9rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    display: block;
    margin-bottom: 0.5rem;
}

.hero-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    /* above .hero-slide__body (z-index: 2), which covers the whole card and
       would otherwise swallow clicks/taps meant for the arrows */
    z-index: 3;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 50%;
    width: 2.75rem;
    height: 2.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 1.25rem;
}

.hero-carousel-arrow:disabled {
    opacity: 0.4;
    cursor: default;
}

.hero-carousel-arrow--prev {
    left: 1rem;
}

.hero-carousel-arrow--next {
    right: 1rem;
}

@media (max-width: 700px) {
    .hero-slide,
    .hero-slide__body {
        min-height: 320px;
    }

    .hero-slide__body {
        max-width: 100%;
        padding: 1.25rem 1.5rem 3.5rem;
    }

    .hero-slide__body h2 {
        font-size: 1.5rem;
    }

    .hero-slide--utility .hero-slide__body {
        padding-top: 2.5rem;
    }

    /* move arrows below the text instead of vertically centered over the
       whole card — slide heights vary with text length on mobile, so a
       centered arrow can land right on top of shorter slides' text */
    .hero-carousel-arrow {
        top: auto;
        bottom: 0.75rem;
        transform: none;
        width: 2.25rem;
        height: 2.25rem;
    }

    .hero-carousel-arrow--prev {
        left: 0.75rem;
    }

    .hero-carousel-arrow--next {
        right: 0.75rem;
    }
}

/* Highlight cards (Student Success / HPC Guide / Data Storage Finder) reuse
   source images with very different native aspect ratios — crop them to a
   consistent 4:3 so the row reads as one set, matching Rivet's own card
   examples elsewhere on the site. */
.ci-index-highlights .rvt-card__image {
    aspect-ratio: 4 / 3;
    overflow: hidden;
}

/* Same flat-border treatment as the Upcoming Events cards: drop the shadow
   .rvt-card--raised normally adds, use Rivet's own standard border grey
   (#e2e7e9, behind .rvt-border-all) instead. */
.ci-index-highlights .rvt-card--raised {
    box-shadow: none;
    border: 1px solid #e2e7e9;
}

.ci-index-highlights .rvt-card__image img {
    height: 100%;
    object-fit: cover;
}

/* .rvt-row stretches .rvt-cols-4-md columns to equal height by default
   (flex items), but .rvt-cols-4-md itself isn't display:flex — so .rvt-card's
   built-in flex-grow:1 has no flex context to grow into, and cards fall back
   to their own natural (unequal) content height. Making the column a flex
   container completes that chain so descriptions absorb the extra space. */
.ci-index-highlights .rvt-cols-4-md {
    display: flex;
}

/* Upcoming Events list: fetches its own event data directly (no longer
   shared with the carousel, which dropped its event slides), rendered as a
   stack of Rivet horizontal cards with the built-in .rvt-cal date badge. */
.ci-events-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ci-events-list__item {
    margin-bottom: 0.75rem;
}

.ci-events-list__item:last-child {
    margin-bottom: 0;
}

.ci-events-list__item .rvt-card--horizontal {
    align-items: center;
    gap: 1.25rem;
}

/* Drop the shadow .rvt-card--raised normally adds (keeping its background,
   radius, and padding) and use a light grey border instead — #e2e7e9 is
   Rivet's own standard border grey (see .rvt-border-all and the ~65 other
   places Rivet's own CSS uses it), not an arbitrary color. */
.ci-events-list__item .rvt-card--raised {
    box-shadow: none;
    border: 1px solid #e2e7e9;
}

.ci-events-list__item .rvt-cal {
    flex-shrink: 0;
}

/* Featured (starred) marker. #8a5a00 is a dark amber chosen for contrast: it is about 5.9:1 on white,
   above the 3:1 WCAG 1.4.11 asks of non-text graphics (a bright gold would fall well below it). */
.ci-events-list__star {
    color: #8a5a00;
    margin-right: 0.375rem;
    vertical-align: -0.125em;
}

.ci-events-list__time {
    color: #4c5a69;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

@media (max-width: 700px) {
    .ci-events-list__item .rvt-card--horizontal {
        gap: 0.75rem;
    }

    .ci-events-list__item .rvt-cal {
        padding: 0.5rem 0.75rem;
        font-size: 1.5rem;
    }
}
