/* ==========================================================================
   Kishoreganj University — Campus Gallery  (/all-campus-gallery)

   Scoped entirely under .kiu-gallery so nothing leaks into other pages.
   main.css sets `html { font-size: 10px }`, so 1rem = 10px sitewide —
   every size below is declared in explicit px. Do not reintroduce rem here.
   ========================================================================== */

.kiu-gallery {
    /* Palette — mirrors home.css so every page reads as one site. */

    /* Rhythm */
    --kiu-section-y: 104px;

    /* Top clearance for the fixed navbar + hanging badge logo. */
    --kiu-nav-clear: 190px; /* ~40px under the hanging badge — see components/page-hero.css */

    font-family: var(--rs-ff-body, "Inter", sans-serif);
    color: var(--kiu-body);
    background: var(--kiu-white);
}

.kiu-gallery *,
.kiu-gallery *::before,
.kiu-gallery *::after {
    box-sizing: border-box;
}

/* Headings take their colour from a token, so dark sections flip them to white
   by redefining --kiu-heading rather than fighting this selector's specificity
   from a single-class rule. Same trap main.css sets on the home page. */
.kiu-gallery h1,
.kiu-gallery h2,
.kiu-gallery h3 {
    font-family: var(--rs-ff-body, "Inter", sans-serif);
    color: var(--kiu-heading, var(--kiu-ink));
    margin: 0;
    letter-spacing: -.02em;
}

.kiu-gallery-hero {
    --kiu-heading: var(--kiu-white);
}

.kiu-gallery p {
    margin: 0;
}

.kiu-gallery a {
    text-decoration: none;
}

/* Zero-specificity reset for Bootstrap's blue link colour — as a plain
   `.kiu-gallery a` rule it would outrank every single-class button rule and drag
   white button labels back to the grey body colour. */
:where(.kiu-gallery a) {
    color: inherit;
}

.kiu-gallery .kiu-section {
    padding-block: var(--kiu-section-y);
}

/* --------------------------------------------------------------------------
   Shared elements
   -------------------------------------------------------------------------- */

.kiu-gallery .kiu-eyebrow {
    display: inline-block;
    margin-bottom: 14px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--kiu-navy);
}

.kiu-gallery .kiu-eyebrow--accent {
    color: var(--kiu-accent);
}

.kiu-gallery .kiu-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 32px;
    margin-bottom: 48px;
}

.kiu-gallery .kiu-section__title {
    font-size: clamp(30px, 3.4vw, 44px);
    font-weight: 700;
    line-height: 1.15;
}

.kiu-gallery .kiu-section__lead {
    max-width: 46ch;
    font-size: 16px;
    line-height: 1.7;
    color: var(--kiu-body);
}

.kiu-gallery .kiu-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 28px;
    border: 1px solid transparent;
    border-radius: var(--kiu-radius-pill);
    font-size: 14px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: background var(--kiu-dur) var(--kiu-ease-out), color var(--kiu-dur) var(--kiu-ease-out),
                border-color var(--kiu-dur) var(--kiu-ease-out), transform var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-gallery .kiu-btn--accent {
    background: var(--kiu-accent);
    color: var(--kiu-navy-darker);
}

.kiu-gallery .kiu-btn--accent:hover {
    background: var(--kiu-accent-soft);
    transform: translateY(var(--kiu-lift));
}

.kiu-gallery .kiu-btn--outline {
    border-color: var(--kiu-border);
    background: var(--kiu-white);
    color: var(--kiu-navy);
}

.kiu-gallery .kiu-btn--outline:hover {
    border-color: var(--kiu-navy);
    background: var(--kiu-navy);
    color: var(--kiu-white);
    transform: translateY(var(--kiu-lift));
}

/* Scoped, so the pages cannot fight over a shared global rule. */
.kiu-gallery .kiu-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255, 255, 255, .72);
}

.kiu-gallery .kiu-breadcrumb a:hover {
    color: var(--kiu-accent-soft);
}

.kiu-gallery .kiu-breadcrumb [aria-current="page"] {
    color: var(--kiu-accent);
}

/* --------------------------------------------------------------------------
   Page header

   Clearance for the fixed navbar. The badge logo hangs BELOW the 76px
   mainbar — 100px tall from the top of the bar (92px at <=1340px), under a
   34px topbar — so hero content has to start below 134px or it collides with
   the crest. Topbar is hidden below 700px, leaving just the 76px bar.
   -------------------------------------------------------------------------- */

.kiu-gallery-hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 420px;
    padding-block: var(--kiu-nav-clear) 84px;
    overflow: hidden;
    isolation: isolate;
}

.kiu-gallery-hero__media {
    position: absolute;
    inset: 0;
    z-index: -2;
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    transform: scale(var(--kiu-scale-hover));
}

.kiu-gallery-hero__scrim {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        100deg,
        rgba(13, 31, 60, .93) 0%,
        rgba(18, 41, 77, .84) 48%,
        rgba(27, 58, 107, .62) 100%
    );
}

.kiu-gallery-hero__content {
    max-width: 720px;
}

.kiu-gallery-hero__title {
    font-size: clamp(34px, 4.6vw, 56px);
    font-weight: 700;
    line-height: 1.1;
}

.kiu-gallery-hero__lead {
    max-width: 60ch;
    margin-top: 20px;
    font-size: 17px;
    line-height: 1.75;
    color: rgba(255, 255, 255, .84);
}

/* --------------------------------------------------------------------------
   Grid
   -------------------------------------------------------------------------- */

.kiu-gallery-count {
    margin-bottom: 28px;
    font-size: 14px;
    color: var(--kiu-muted);
}

.kiu-gallery__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 24px;
}

.kiu-gallery-card {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius);
    background: var(--kiu-white);
    transition: transform var(--kiu-dur) var(--kiu-ease-out), box-shadow var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-gallery-card:hover {
    transform: translateY(var(--kiu-lift-lg));
    box-shadow: var(--kiu-shadow-hover);
}

.kiu-gallery-card__media {
    display: block;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    background: var(--kiu-surface-alt);
}

.kiu-gallery-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .5s var(--kiu-ease-out);
}

.kiu-gallery-card:hover .kiu-gallery-card__media img {
    transform: scale(var(--kiu-scale-hover));
}

.kiu-gallery-card__body {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 20px;
}

.kiu-gallery-card__caption {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--kiu-ink);
}

.kiu-gallery-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--kiu-surface);
    font-size: 16px;
    color: var(--kiu-navy);
    transition: background var(--kiu-dur) var(--kiu-ease-out), color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-gallery-card:hover .kiu-gallery-card__icon {
    background: var(--kiu-navy);
    color: var(--kiu-white);
}

.kiu-gallery__empty a {
    color: var(--kiu-navy);
    font-weight: 600;
    text-decoration: underline;
}

.kiu-gallery__empty {
    padding: 48px;
    border: 1px dashed var(--kiu-border);
    border-radius: var(--kiu-radius);
    background: var(--kiu-surface);
    font-size: 15px;
    color: var(--kiu-muted);
    text-align: center;
}

/* --------------------------------------------------------------------------
   Pagination

   Restyles Bootstrap's paginator markup, which AppServiceProvider selects
   via Paginator::useBootstrap(). Selectors stay inside the page scope.
   -------------------------------------------------------------------------- */

.kiu-gallery__pagination {
    display: flex;
    justify-content: center;
    margin-top: 56px;
}

.kiu-gallery__pagination .pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kiu-gallery__pagination .page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 14px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-sm);
    background: var(--kiu-white);
    font-size: 14px;
    font-weight: 600;
    color: var(--kiu-navy);
    transition: background var(--kiu-dur) var(--kiu-ease-out), color var(--kiu-dur) var(--kiu-ease-out), border-color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-gallery__pagination .page-link:hover {
    border-color: var(--kiu-navy);
    background: var(--kiu-navy);
    color: var(--kiu-white);
}

.kiu-gallery__pagination .page-item.active .page-link {
    border-color: var(--kiu-navy);
    background: var(--kiu-navy);
    color: var(--kiu-white);
}

.kiu-gallery__pagination .page-item.disabled .page-link {
    background: var(--kiu-surface);
    color: var(--kiu-muted);
    pointer-events: none;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 1199px) {
    .kiu-gallery {
        --kiu-section-y: 84px;
    }

    .kiu-gallery__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 991px) {
    .kiu-gallery {
        --kiu-section-y: 72px;
    }

    .kiu-gallery-hero {
        min-height: 340px;
        padding-block: var(--kiu-nav-clear) 60px;
    }

    .kiu-gallery__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 18px;
    }
}

@media (max-width: 767px) {
    .kiu-gallery {
        --kiu-section-y: 60px;
    }
}

@media (max-width: 479px) {
    .kiu-gallery__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 1340px) {
    .kiu-gallery {
        --kiu-nav-clear: 178px;
    }
}

@media (max-width: 700px) {
    .kiu-gallery {
        --kiu-nav-clear: 108px;
    }
}

/* --------------------------------------------------------------------------
   Motion preferences
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .kiu-gallery *,
    .kiu-gallery *::before,
    .kiu-gallery *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
}
