/* ==========================================================================
   Kishoreganj University — a department's own site
   (/explore/department/{slug} and its About / Chairman / People / Contact
   pages)

   Loaded *after* explore.css, whose .kiu-explore-single scope supplies the
   palette, radii and shadows.

   The point of this file is that every department renders the same shapes.
   The old single-page template branched on which optional fields a department
   had filled in — slides, vision, mission, notices — so no two departments
   produced the same page. Sections here hold their structure and say when
   they are empty instead.

   main.css sets `html { font-size: 10px }`, so 1rem = 10px sitewide —
   every size below is declared in explicit px. Do not reintroduce rem here.
   ========================================================================== */

/* The hero repeats its own tokens instead of inheriting them from
   .kiu-dept-home, because it is used on pages that never carry that class —
   the Academics views root on `.kiu-explore-single .kiu-dept-academics`. The
   hero partial already pushes its own stylesheets, so keeping its colours
   self-contained is what makes it render identically on all ten pages.

   --kiu-heading is set here for the same reason home.css sets it on
   .kiu-notice-feature: `.kiu-home h1` (0,1,1) outranks .kiu-dept-hero__title
   (0,1,0), so on the Notices page — root `.kiu-home .kiu-listing
   .kiu-dept-home` — the hero title would otherwise render in dark ink. */
.kiu-dept-hero {
    --kiu-heading: var(--kiu-white);
}

.kiu-dept-home .kiu-section {
    padding: 64px 0;
}

.kiu-dept-home .kiu-eyebrow {
    display: inline-block;
    margin-bottom: 10px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--kiu-accent);
}

.kiu-dept-home .kiu-dept-section__title {
    margin: 0;
    font-size: clamp(22px, 2.4vw, 30px);
    font-weight: 800;
    line-height: 1.3;
    color: var(--kiu-ink);
    letter-spacing: -.01em;
}

.kiu-dept-home .kiu-dept-section__title--spaced {
    margin-top: 48px;
}

.kiu-dept-home .kiu-dept-section__head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 28px;
}

/* --------------------------------------------------------------------------
   Hero — one shape for every department, on every page
   -------------------------------------------------------------------------- */

.kiu-dept-hero {
    position: relative;
    display: flex;
    align-items: flex-end;
    min-height: 460px;
    overflow: hidden;
    background: var(--kiu-navy-darker);

    /* #kiu-navbar is `position: fixed` and out of flow, so content starts
       underneath it. The hero carries the clearance for the bar and for the
       hanging badge logo, exactly as components/page-hero.css does. */
    padding-top: 168px;
    padding-bottom: 56px;
}

.kiu-dept-hero__media {
    position: absolute;
    inset: 0;
}

/* Frames are stacked and cross-faded on opacity — nothing enters or leaves
   the DOM, so the title layer above never reflows between photographs. */
.kiu-dept-hero__frame {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 1.2s var(--kiu-ease-in-out);
}

.kiu-dept-hero__frame.is-active {
    opacity: 1;
}

/* A slide cropped per device is an <img> inside the frame rather than a
   background on it: only <source media> can hand a phone the phone-shaped
   file. `cover` here does the same job `background-size: cover` does above,
   and the residual is small because the file is already close to the frame's
   shape. See App\Support\HeroDevices. */
.kiu-dept-hero__pic,
.kiu-dept-hero__pic img {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
}

.kiu-dept-hero__pic img {
    object-fit: cover;
    object-position: center;
}

/* Two stops, not one flat wash: the copy sits at the bottom and needs the
   darkest part of the scrim there, while the top stays light enough that the
   photograph still reads as a photograph. */
.kiu-dept-hero__scrim {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(13, 31, 60, .45) 0%,
        rgba(13, 31, 60, .72) 55%,
        rgba(13, 31, 60, .92) 100%);
}

.kiu-dept-hero .container {
    position: relative;
    z-index: 2;
}

.kiu-dept-hero__content {
    max-width: 780px;
}

.kiu-dept-hero__crumbs ol {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    font-size: 13px;
    color: rgba(255, 255, 255, .72);
}

.kiu-dept-hero__crumbs li:not(:last-child)::after {
    content: "/";
    margin-left: 6px;
    color: rgba(255, 255, 255, .4);
}

.kiu-dept-hero__crumbs a {
    color: rgba(255, 255, 255, .82);
    text-decoration: none;
}

.kiu-dept-hero__crumbs a:hover,
.kiu-dept-hero__crumbs a:focus-visible {
    color: var(--kiu-white);
    text-decoration: underline;
}

.kiu-dept-hero__eyebrow {
    display: inline-block;
    margin-bottom: 12px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--kiu-accent-soft);
}

/* On a sub-page the department name is demoted to this kicker so the <h1>
   can be the section — no page carries two competing titles. */
.kiu-dept-hero__kicker {
    margin: 0 0 6px;
    font-size: 15px;
    font-weight: 600;
    color: rgba(255, 255, 255, .78);
}

.kiu-dept-hero__title {
    margin: 0;
    font-size: clamp(30px, 4.4vw, 52px);
    font-weight: 800;
    line-height: 1.12;
    letter-spacing: -.02em;
    color: var(--kiu-white);
}

/* Bengali glyphs carry marks above Latin cap height and clip in a tight line
   box, so this needs more leading than the Latin title. See
   docs/decisions_hridy.md D-7. */
.kiu-dept-hero__title-bn {
    margin: 10px 0 0;
    font-size: clamp(17px, 2vw, 22px);
    font-weight: 600;
    line-height: 1.7;
    color: rgba(255, 255, 255, .86);
}

.kiu-dept-hero__lead {
    max-width: 60ch;
    margin: 16px 0 0;
    font-size: 16px;
    line-height: 1.75;
    color: rgba(255, 255, 255, .84);
}

/* --------------------------------------------------------------------------
   Intro + chairman preview
   -------------------------------------------------------------------------- */

.kiu-dept-home .kiu-dept-intro__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

/* main.css sets `p { margin-bottom: 30px }` globally; every block here spaces
   itself deliberately instead. */
.kiu-dept-home .kiu-dept-intro__grid p,
.kiu-dept-home .kiu-dept-chairman p,
.kiu-dept-home .kiu-dept-message__author p {
    margin: 0;
}

.kiu-dept-home .kiu-dept-intro__lead {
    margin-top: 16px !important;
    font-size: 16px;
    line-height: 1.85;
    color: var(--kiu-body);
}

.kiu-dept-home .kiu-dept-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 22px;
    padding: 12px 22px;
    border-radius: var(--kiu-radius-pill);
    background: var(--kiu-navy);
    color: var(--kiu-white);
    font-size: 13.5px;
    font-weight: 700;
    text-decoration: none;
    transition: background-color var(--kiu-dur-fast) var(--kiu-ease-in-out);
}

.kiu-dept-home .kiu-dept-btn:hover,
.kiu-dept-home .kiu-dept-btn:focus-visible {
    background: var(--kiu-accent);
    color: var(--kiu-white);
}

.kiu-dept-home .kiu-dept-btn--ghost {
    margin-top: 0;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    background: var(--kiu-white);
    border: 1px solid var(--kiu-border, #E1E7F0);
    color: var(--kiu-navy, #1B3A6B);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
    white-space: nowrap;
    transition: background-color var(--kiu-dur-fast) var(--kiu-ease-out),
                border-color var(--kiu-dur-fast) var(--kiu-ease-out),
                color var(--kiu-dur-fast) var(--kiu-ease-out),
                box-shadow var(--kiu-dur-fast) var(--kiu-ease-out),
                transform var(--kiu-dur-press) var(--kiu-ease-out);
}

.kiu-dept-home .kiu-dept-btn--ghost:hover,
.kiu-dept-home .kiu-dept-btn--ghost:focus-visible {
    background: var(--kiu-navy, #1B3A6B);
    border-color: var(--kiu-navy, #1B3A6B);
    color: var(--kiu-white);
    transform: translateY(var(--kiu-lift));
    box-shadow: 0 4px 10px rgba(27, 58, 107, 0.15);
}

.kiu-dept-home .kiu-dept-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--kiu-navy);
    text-decoration: none;
    white-space: nowrap;
}

.kiu-dept-home .kiu-dept-link:hover,
.kiu-dept-home .kiu-dept-link:focus-visible {
    color: var(--kiu-accent);
}

.kiu-dept-home .kiu-dept-chairman {
    padding: 26px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-lg);
    background: var(--kiu-surface);
}

.kiu-dept-home .kiu-dept-chairman__head {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
}

.kiu-dept-home .kiu-dept-chairman__photo {
    width: 72px;
    height: 72px;
    flex: none;
    border-radius: 50%;
    object-fit: cover;
    background: var(--kiu-white);
    border: 1px solid var(--kiu-border);
}

.kiu-dept-home .kiu-dept-chairman__role {
    display: block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--kiu-accent);
}

.kiu-dept-home .kiu-dept-chairman__name {
    margin-top: 4px !important;
    font-size: 15.5px;
    font-weight: 700;
    line-height: 1.4;
    color: var(--kiu-ink);
}

.kiu-dept-home .kiu-dept-chairman__quote {
    margin: 0 0 14px;
    padding-left: 16px;
    border-left: 2px solid var(--kiu-border);
    font-size: 14.5px;
    font-style: italic;
    line-height: 1.8;
    color: var(--kiu-body);
}

.kiu-dept-home .kiu-dept-chairman__empty {
    font-size: 14px;
    font-style: italic;
    color: var(--kiu-muted);
}

/* --------------------------------------------------------------------------
   Academics cards
   -------------------------------------------------------------------------- */

.kiu-dept-home .kiu-dept-explore {
    background: var(--kiu-surface);
}

.kiu-dept-home .kiu-dept-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 20px;
}

.kiu-dept-home .kiu-dept-card {
    display: flex;
    flex-direction: column;
    padding: 26px 24px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-lg);
    background: var(--kiu-white);
    box-shadow: var(--kiu-shadow);
    text-decoration: none;
    transition: transform var(--kiu-dur) var(--kiu-ease-in-out), box-shadow var(--kiu-dur) var(--kiu-ease-in-out), border-color var(--kiu-dur) var(--kiu-ease-in-out);
}

.kiu-dept-home .kiu-dept-card:hover {
    transform: translateY(var(--kiu-lift-lg));
    border-color: var(--kiu-accent);
    box-shadow: var(--kiu-shadow-hover);
}

.kiu-dept-home .kiu-dept-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: 16px;
    border-radius: var(--kiu-radius);
    background: var(--kiu-surface);
    color: var(--kiu-navy);
    font-size: 22px;
    line-height: 1;
    transition: background-color var(--kiu-dur) var(--kiu-ease-in-out), color var(--kiu-dur) var(--kiu-ease-in-out);
}

.kiu-dept-home .kiu-dept-card:hover .kiu-dept-card__icon {
    background: var(--kiu-accent);
    color: var(--kiu-white);
}

.kiu-dept-home .kiu-dept-card__title {
    margin: 0 0 8px;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--kiu-ink);
}

.kiu-dept-home .kiu-dept-card__body {
    margin: 0 0 18px;
    font-size: 13.5px;
    line-height: 1.7;
    color: var(--kiu-body);
}

.kiu-dept-home .kiu-dept-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    font-size: 12.5px;
    font-weight: 700;
    color: var(--kiu-navy);
}

/* --------------------------------------------------------------------------
   Noticeboard + events
   -------------------------------------------------------------------------- */

.kiu-dept-home .kiu-dept-board__grid {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
    gap: 40px;
    align-items: start;
}

.kiu-dept-home .kiu-dept-events {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kiu-dept-home .kiu-dept-events a {
    display: grid;
    grid-template-columns: 84px minmax(0, 1fr);
    gap: 14px;
    align-items: center;
    padding: 12px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius);
    background: var(--kiu-white);
    text-decoration: none;
    transition: border-color var(--kiu-dur-fast) var(--kiu-ease-in-out), box-shadow var(--kiu-dur-fast) var(--kiu-ease-in-out);
}

.kiu-dept-home .kiu-dept-events a:hover {
    border-color: var(--kiu-accent);
    box-shadow: var(--kiu-shadow);
}

.kiu-dept-home .kiu-dept-events img {
    width: 84px;
    height: 64px;
    border-radius: var(--kiu-radius-sm);
    object-fit: cover;
}

.kiu-dept-home .kiu-dept-events time {
    display: block;
    margin-bottom: 4px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--kiu-accent);
}

.kiu-dept-home .kiu-dept-events h3 {
    margin: 0;
    font-size: 14.5px;
    font-weight: 700;
    line-height: 1.5;
    color: var(--kiu-ink);
}

/* --------------------------------------------------------------------------
   Long-form pages — About, Chairman
   -------------------------------------------------------------------------- */

.kiu-dept-home .kiu-dept-prose {
    max-width: 78ch;
}

.kiu-dept-home .kiu-dept-prose__body {
    margin-top: 18px;
    font-size: 16px;
    line-height: 1.9;
    color: var(--kiu-body);
}

.kiu-dept-home .kiu-dept-prose__body p {
    margin: 0 0 18px;
}

.kiu-dept-home .kiu-dept-prose__body p:last-child {
    margin-bottom: 0;
}

/* Vision and mission, always as a pair. */
.kiu-dept-home .kiu-dept-vm {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
    margin-top: 48px;
}

.kiu-dept-home .kiu-dept-vm__card {
    padding: 30px 28px;
    border: 1px solid var(--kiu-border);
    border-radius: var(--kiu-radius-lg);
    background: var(--kiu-surface);
}

.kiu-dept-home .kiu-dept-vm__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    margin-bottom: 14px;
    border-radius: var(--kiu-radius);
    background: var(--kiu-white);
    color: var(--kiu-accent);
    font-size: 21px;
    line-height: 1;
}

.kiu-dept-home .kiu-dept-vm__title {
    margin: 0 0 10px;
    font-size: 19px;
    font-weight: 800;
    color: var(--kiu-ink);
}

.kiu-dept-home .kiu-dept-vm__body {
    font-size: 15px;
    line-height: 1.85;
    color: var(--kiu-body);
}

.kiu-dept-home .kiu-dept-vm__body p {
    margin: 0 0 12px;
}

.kiu-dept-home .kiu-dept-notice-strip {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-top: 40px;
    padding: 20px 24px;
    border: 1px solid rgba(0, 163, 147, .25);
    border-radius: var(--kiu-radius);
    background: rgba(0, 163, 147, .07);
}

/* An office's announcement opens its Home page instead of closing About. */
.kiu-dept-home .kiu-dept-notice-strip--lead {
    margin-top: 0;
    margin-bottom: 40px;
}

.kiu-dept-home .kiu-dept-notice-strip i {
    font-size: 20px;
    line-height: 1.5;
    color: var(--kiu-accent);
}

.kiu-dept-home .kiu-dept-notice-strip p {
    margin: 0;
    font-size: 14.5px;
    line-height: 1.75;
    color: var(--kiu-ink);
}

/* --- chairman's message --- */

.kiu-dept-home .kiu-dept-message {
    display: grid;
    grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
    gap: 48px;
    align-items: start;
}

.kiu-dept-home .kiu-dept-message__author {
    position: sticky;
    top: 140px;
    text-align: center;
}

.kiu-dept-home .kiu-dept-message__photo {
    width: 180px;
    height: 180px;
    margin-bottom: 16px;
    border-radius: 50%;
    object-fit: cover;
    background: var(--kiu-surface);
    border: 1px solid var(--kiu-border);
}

.kiu-dept-home .kiu-dept-message__name {
    font-size: 17px;
    font-weight: 800;
    line-height: 1.4;
    color: var(--kiu-ink);
}

.kiu-dept-home .kiu-dept-message__role {
    margin-top: 4px !important;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--kiu-accent);
}

.kiu-dept-home .kiu-dept-message__dept {
    margin-top: 6px !important;
    margin-bottom: 14px !important;
    font-size: 13.5px;
    color: var(--kiu-muted);
}

.kiu-dept-home .kiu-dept-message__body {
    position: relative;
}

.kiu-dept-home .kiu-dept-message__mark {
    display: block;
    font-size: 64px;
    font-weight: 800;
    line-height: .7;
    color: rgba(0, 163, 147, .28);
}

/* --------------------------------------------------------------------------
   Contact
   -------------------------------------------------------------------------- */

.kiu-dept-home .kiu-contact-card__value--empty {
    font-size: 16px;
    font-weight: 600;
    font-style: italic;
    color: var(--kiu-muted);
}

/* A sub-page has only one section, so the hero already gives it its top
   spacing — a second full pad here left an empty band under the navbar. */
.kiu-dept-page .kiu-dept-contact {
    padding-top: 56px;
}

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

@media (max-width: 991px) {
    .kiu-dept-home .kiu-dept-intro__grid,
    .kiu-dept-home .kiu-dept-board__grid,
    .kiu-dept-home .kiu-dept-message {
        grid-template-columns: minmax(0, 1fr);
        gap: 32px;
    }

    /* Nothing to stick to once it is above the message rather than beside it. */
    .kiu-dept-home .kiu-dept-message__author {
        position: static;
        text-align: left;
    }

    .kiu-dept-hero {
        min-height: 380px;
    }
}

@media (max-width: 767px) {
    .kiu-dept-home .kiu-section {
        padding: 44px 0;
    }

    .kiu-dept-hero {
        min-height: 320px;
        /* Below 701px the navbar's hanging badge collapses to a bare crest
           with no overhang, so the clearance drops with it. */
        padding-top: 116px;
        padding-bottom: 36px;
    }

    .kiu-dept-home .kiu-dept-section__head {
        display: flex;
        flex-direction: row;
        align-items: flex-end;
        justify-content: space-between;
        gap: 12px;
        margin-bottom: 20px;
    }

    .kiu-dept-home .kiu-dept-section__head .kiu-dept-btn--ghost {
        padding: 6px 14px;
        font-size: 12px;
        flex-shrink: 0;
        margin-left: auto;
    }

    .kiu-dept-home .kiu-dept-vm {
        grid-template-columns: minmax(0, 1fr);
        margin-top: 32px;
    }

    .kiu-dept-home .kiu-dept-vm__card {
        padding: 24px 20px;
    }

    .kiu-dept-home .kiu-dept-message__photo {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 479px) {
    .kiu-dept-home .kiu-dept-events a {
        grid-template-columns: 64px minmax(0, 1fr);
    }

    .kiu-dept-home .kiu-dept-events img {
        width: 64px;
        height: 54px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kiu-dept-hero__frame,
    .kiu-dept-home .kiu-dept-card,
    .kiu-dept-home .kiu-dept-card__icon,
    .kiu-dept-home .kiu-dept-events a,
    .kiu-dept-home .kiu-dept-btn {
        transition: none;
    }

    .kiu-dept-home .kiu-dept-card:hover {
        transform: none;
    }
}

/* ==========================================================================
   Department hero, compact form
   When a real carousel sits above it, the hero stops being a photograph and
   becomes a title band: the carousel has already cleared the fixed navbar and
   already carried the imagery, so a second full-height photo frame would just
   push every department's content a screen further down.
   ========================================================================== */
.kiu-dept-hero.is-compact {
    min-height: 0;
    padding-top: 1.75rem;
    padding-bottom: 1.5rem;
}

.kiu-dept-hero.is-compact .kiu-dept-hero__media,
.kiu-dept-hero.is-compact .kiu-dept-hero__scrim {
    display: none;
}

/* Without the photograph behind it the white type has no scrim to sit on. */
.kiu-dept-hero.is-compact .kiu-dept-hero__crumbs,
.kiu-dept-hero.is-compact .kiu-dept-hero__crumbs a,
.kiu-dept-hero.is-compact .kiu-dept-hero__eyebrow,
.kiu-dept-hero.is-compact .kiu-dept-hero__kicker,
.kiu-dept-hero.is-compact .kiu-dept-hero__lead {
    color: var(--kiu-muted, #5B6B84);
}

.kiu-dept-hero.is-compact .kiu-dept-hero__title,
.kiu-dept-hero.is-compact .kiu-dept-hero__title-bn {
    color: var(--kiu-navy-deep, #0C1F3F);
}
