/* ==========================================================================
   Kishoreganj University — Campus Gallery — single photograph  (/campus-gallery/{slug})

   Scoped entirely under .kiu-photo 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-photo {
    /* 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-photo *,
.kiu-photo *::before,
.kiu-photo *::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-photo h1,
.kiu-photo h2,
.kiu-photo h3 {
    font-family: var(--rs-ff-body, "Inter", sans-serif);
    color: var(--kiu-heading, var(--kiu-ink));
    margin: 0;
    letter-spacing: -.02em;
}

/* This page has no dark band, so --kiu-heading keeps its light default. */

.kiu-photo p {
    margin: 0;
}

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

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

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

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

.kiu-photo .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-photo .kiu-eyebrow--accent {
    color: var(--kiu-accent);
}

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

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

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

.kiu-photo .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-photo .kiu-btn--accent {
    background: var(--kiu-accent);
    color: var(--kiu-navy-darker);
}

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

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

.kiu-photo .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-photo .kiu-breadcrumb {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 20px;
    font-size: 13px;
    font-weight: 500;
    color: var(--kiu-muted);
}

.kiu-photo .kiu-breadcrumb a:hover {
    color: var(--kiu-navy);
}

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

/* --------------------------------------------------------------------------
   Breadcrumb strip

   This page has no hero, so the first section carries the navbar clearance
   itself. See the note in classroom-lab.css for the measurements.
   -------------------------------------------------------------------------- */

.kiu-photo-top {
    padding-block: var(--kiu-nav-clear) 0;
    background: var(--kiu-surface);
}

.kiu-photo-top .kiu-breadcrumb {
    margin-bottom: 0;
    padding-bottom: 24px;
}

/* --------------------------------------------------------------------------
   The photograph
   -------------------------------------------------------------------------- */

.kiu-photo-main {
    padding-block: 0 48px;
    background: linear-gradient(180deg, var(--kiu-surface) 0%, var(--kiu-surface) 220px, var(--kiu-white) 220px);
}

.kiu-photo-figure {
    position: relative;
    margin: 0;
    overflow: hidden;
    border-radius: var(--kiu-radius-lg);
    background: var(--kiu-navy-darker);
    box-shadow: var(--kiu-shadow);
}

/* A fixed frame, so the page does not jump as pictures of different shapes
   are swapped in; `contain` shows each picture whole on the dark backdrop. */
.kiu-photo-figure img {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    max-height: 640px;
    object-fit: contain;
}

.kiu-photo-figure__arrow {
    position: absolute;
    top: 50%;
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .9);
    color: var(--kiu-navy-darker);
    font-size: 30px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .25);
    transform: translateY(-50%);
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease, transform .2s ease;
}

.kiu-photo-figure__arrow:hover,
.kiu-photo-figure__arrow:focus-visible {
    background: var(--kiu-accent);
    color: #fff;
    transform: translateY(-50%) scale(1.06);
}

.kiu-photo-figure__arrow--prev {
    left: 18px;
}

.kiu-photo-figure__arrow--next {
    right: 18px;
}

.kiu-photo-figure__count {
    position: absolute;
    right: 18px;
    bottom: 16px;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(13, 31, 60, .75);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
}

/* Thumbnail rail under the large picture, in upload order. */
.kiu-photo-rail {
    display: flex;
    gap: 12px;
    margin-top: 16px;
    padding: 4px 2px 8px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
}

.kiu-photo-rail__thumb {
    flex: 0 0 auto;
    width: 120px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 10px;
    overflow: hidden;
    background: var(--kiu-navy-darker);
    opacity: .6;
    cursor: pointer;
    scroll-snap-align: center;
    transition: opacity .2s ease, border-color .2s ease;
}

.kiu-photo-rail__thumb img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.kiu-photo-rail__thumb:hover,
.kiu-photo-rail__thumb:focus-visible {
    opacity: 1;
}

.kiu-photo-rail__thumb.is-active {
    border-color: var(--kiu-accent);
    opacity: 1;
}

@media (max-width: 700px) {
    .kiu-photo-figure img {
        aspect-ratio: 4 / 3;
    }

    .kiu-photo-figure__arrow {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }

    .kiu-photo-figure__arrow--prev {
        left: 10px;
    }

    .kiu-photo-figure__arrow--next {
        right: 10px;
    }

    .kiu-photo-rail__thumb {
        width: 84px;
    }
}

.kiu-photo-detail {
    margin-top: 28px;
}

/* Title on the left, the pager on the same line at the right. */
.kiu-photo-detail__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
}

.kiu-photo-detail__head > div {
    min-width: 0;
}

.kiu-photo-detail__head .kiu-eyebrow {
    margin-bottom: 8px;
}

.kiu-photo-detail__title {
    overflow-wrap: anywhere;
    font-size: clamp(26px, 3vw, 38px);
    font-weight: 700;
    line-height: 1.2;
}

.kiu-photo-detail__body {
    max-width: 90ch;
    margin-top: 14px;
    font-size: 16px;
    line-height: 1.7;
    overflow-wrap: anywhere; /* a long unbroken word must not widen the page */
}

/* --------------------------------------------------------------------------
   Previous / next
   -------------------------------------------------------------------------- */

.kiu-photo-pager {
    display: inline-flex;
    flex-shrink: 0;
    overflow: hidden;
    border: 1px solid var(--kiu-border);
    border-radius: 999px;
    background: var(--kiu-white);
}

.kiu-photo-pager__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    font-size: 14px;
    font-weight: 600;
    color: var(--kiu-navy);
    white-space: nowrap;
    transition: background-color var(--kiu-dur) var(--kiu-ease-out), color var(--kiu-dur) var(--kiu-ease-out);
}

.kiu-photo-pager__btn + .kiu-photo-pager__btn {
    border-left: 1px solid var(--kiu-border);
}

.kiu-photo-pager__btn i {
    font-size: 17px;
}

a.kiu-photo-pager__btn:hover,
a.kiu-photo-pager__btn:focus-visible {
    background: var(--kiu-navy);
    color: #fff;
}

.kiu-photo-pager__btn.is-disabled {
    color: var(--kiu-muted);
    opacity: .45;
    cursor: default;
}

/* --------------------------------------------------------------------------
   Related photographs
   -------------------------------------------------------------------------- */

/* Continues straight on from the photograph instead of sitting in its own
   band, so it reads as part of the same page. */
.kiu-photo .kiu-photo-related {
    padding-block: 0 var(--kiu-section-y);
    background: var(--kiu-white);
}

.kiu-photo-related .kiu-section__head {
    margin-bottom: 28px;
}

.kiu-photo-related .kiu-section__title {
    font-size: clamp(24px, 2.4vw, 30px);
}

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

.kiu-photo-related__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-photo-related__card:hover {
    transform: translateY(var(--kiu-lift-lg));
    box-shadow: var(--kiu-shadow-hover);
}

.kiu-photo-related__card img {
    display: block;
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
}

.kiu-photo-related__card span {
    padding: 18px 20px 20px;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.45;
    color: var(--kiu-ink);
}

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

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

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

    .kiu-photo .kiu-section__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
        margin-bottom: 24px;
    }

    .kiu-photo-detail__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }

    .kiu-photo-detail__body {
        margin-top: 18px;
    }

    .kiu-photo-related__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

    .kiu-photo-related__grid {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 479px) {
    .kiu-photo-pager {
        display: flex;
        width: 100%;
    }

    .kiu-photo-pager__btn {
        flex: 1;
        justify-content: center;
        padding: 10px 8px;
    }

    .kiu-photo .kiu-btn {
        width: 100%;
        justify-content: center;
    }
}

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

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

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

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