/* ==========================================================================
   TPSC modern theme, loaded on every page by site/layout.blade.php:
   header, footer, feedback box and the shared inner-page components
   (page banner, sidebar, cards, lists, pagination, buttons).

   No colour values live in this file. Every colour comes from the BRAND
   COLOURS block at the top of master.min.css (--primary-color,
   --accent-color, --brand-gradient-*, ...), so change colours there.
   ========================================================================== */

@font-face {
    font-family: "TPOutfit";
    src: url("../fonts/outfit/Outfit-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

/* Non-colour tokens, plus shadows/gradients composed from the master palette */
:root {
    --tp-radius: 18px;
    --tp-ease: cubic-bezier(.2, .7, .2, 1);
    --tp-font: "TPOutfit", myFont, -apple-system, "Segoe UI", sans-serif;
    --tp-shadow: 0 1px 2px rgba(var(--shadow-rgb), .04), 0 12px 32px -14px rgba(var(--shadow-rgb), .22);
    --tp-shadow-lg: 0 34px 64px -24px rgba(var(--accent-color-dark-rgb), .38);
    /* accent bar used under every heading: deep blue segment + main blue segment */
    --tp-bar: linear-gradient(90deg, var(--accent-color) 0 58%, transparent 58% 66%, var(--primary-color) 66% 100%);
    --tp-bar-light: linear-gradient(90deg, var(--white) 0 58%, transparent 58% 66%, var(--primary-color-pale) 66% 100%);
    --tp-edge: linear-gradient(90deg, var(--accent-color) 0%, var(--primary-color) 100%);
}

/* ==========================================================================
   Header
   ========================================================================== */

header {
    background: var(--page-bg);
    font-family: var(--tp-font);
}

/* utility bar: the old site's shape, a centred tab hanging from the top with rounded bottom corners */
header .top-navbar {
    padding: 0;
    background: transparent;
}

header .top_nav {
    height: auto;
    min-height: 28px;
    font-size: .8rem;
}

/* The markup lays these out with floats, which wrapped onto a second line on narrower screens
   and showed the menu in reverse order. Lay the bar out with flexbox instead: one line always,
   links in the order set in the CMS, and the search / language / dark-mode group kept on the right. */
header .top_nav .top-innerrrr {
    display: flex !important;
    align-items: center;
    gap: 6px;
    min-width: 0;
    max-width: 100%;
}

header .top_nav .top-innerrrr > ul {
    margin: 0;
}

/* search + language + dark mode: fixed at the right, in that visual order */
header .top_nav .top-innerrrr > ul:first-child {
    order: 2;
    flex: none;
    display: flex !important;
    flex-direction: row-reverse;
    align-items: center;
}

@media (min-width: 992px) {
    /* menu links: take the remaining width and scroll sideways if they do not all fit.
       The mask fades the right edge instead of cutting a word in half. */
    header .top_nav .top-innerrrr > ul:last-child {
        order: 1;
        flex: 1 1 auto;
        display: flex !important;
        align-items: center;
        min-width: 0;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-mask-image: linear-gradient(90deg, #000 0 calc(100% - 26px), transparent 100%);
        mask-image: linear-gradient(90deg, #000 0 calc(100% - 26px), transparent 100%);
    }

    header .top_nav .top-innerrrr > ul:last-child::-webkit-scrollbar {
        display: none;
    }
}

/* one height for every item, content centred, so links, the language pill and the search box
   share a centre line. No !important on display, so d-none still hides the inactive language item. */
header .top_nav li {
    float: none;
    flex: none;
    display: flex;
    align-items: center;
    height: 28px;
    white-space: nowrap;
}

/* narrower screens: smaller links and search box so the whole bar still fits on one line */
@media (max-width: 1399.98px) {
    header .top_nav {
        font-size: .74rem;
    }

    header .top_nav li a,
    header .top-navbar a {
        padding: 7px 5px;
    }

    header .top_nav li .search-form .form-inline input.form-control {
        width: 8.5rem;
    }
}

header .top-navbar .top-innerrrr.bg-primary {
    padding-left: 28px !important;
    padding-right: 28px !important;
    background: var(--brand-gradient-bar) !important;
    border-radius: 0 0 18px 18px !important;
    box-shadow: 0 8px 18px -10px rgba(var(--accent-color-dark-rgb), .45);
}

header .top_nav li a,
header .top-navbar a {
    color: rgba(var(--white-rgb), .92);
    font-family: var(--tp-font);
    font-weight: 500;
    padding: 7px 6px;
    transition: color .2s;
}

header .top_nav li a:hover,
header .top-navbar a:hover {
    color: var(--white);
}

/* language switch as a small outlined pill */
header .top_nav li a[href*="/language/"] {
    margin: 0 4px;
    padding: 3px 11px;
    border: 1px solid rgba(var(--white-rgb), .3);
    border-radius: 999px;
    color: var(--white);
    font-weight: 600;
    letter-spacing: .04em;
}

header .top_nav li a[href*="/language/"]:hover {
    border-color: var(--primary-color);
    background: var(--primary-color);
}

header .top_nav li .search-form .form-inline input.form-control {
    height: 28px;
    width: 10rem;
    border: 1px solid rgba(var(--white-rgb), .18);
    background: rgba(var(--white-rgb), .1);
    color: var(--white);
    font-family: var(--tp-font);
}

header .top_nav li .search-form .form-inline input.form-control::placeholder {
    color: rgba(var(--white-rgb), .6);
}

header .top_nav li .search-form .form-inline input.form-control:focus {
    border-color: var(--primary-color);
    background: rgba(var(--white-rgb), .16);
    box-shadow: none;
}

header .top_nav li .search-form .search-icon i {
    color: rgba(var(--white-rgb), .8);
}

/* emblem / title / logo band */
header .top-middle {
    padding-top: 5px !important;
    padding-bottom: 5px !important;
    background: var(--page-bg);
}

/* emblem and logo: both are detailed seal/ring-style emblems with fine print
   (the "UHURU NA UMOJA" banner, the "TANZANIA PUBLIC SERVICE COLLEGE" ring text) that
   turns illegible below ~100px tall, so they get noticeably more room than a simple
   flat logo would need. img-fluid's max-width:100% still shrinks them to fit on
   narrow screens, so this is just the ceiling on larger ones — kept at the documented
   100px floor while trimming the padding around it for a shorter header overall. */
header .top-middle img {
    width: auto;
    max-height: 100px;
}

/* the markup gives these a flat col-2 / col-8 / col-2 split with no responsive variants,
   so on anything narrower than a full desktop that 2/12 column shrinks to a sliver
   (as little as ~27px on a phone) and clamps the logo down via img-fluid's max-width:100%
   regardless of the max-height above or how good the source image is. Let the logo
   columns size to their own content instead, and let the title column take what's left. */
header .top-middle .row > .col-2 {
    flex: 0 0 auto;
    width: auto;
    max-width: 42%;
    padding-left: 6px;
    padding-right: 6px;
}

header .top-middle .row > .col-8 {
    flex: 1 1 0;
    max-width: none;
    min-width: 0;
    padding-left: 6px;
    padding-right: 6px;
}

@media (max-width: 575.98px) {
    header .top-middle img {
        max-height: 64px;
    }
}

header .top-middle h5.font-16 {
    margin-bottom: 2px !important;
    color: var(--text-color) !important;
    font-family: var(--tp-font);
    font-size: .88rem;
    font-weight: 600;
    letter-spacing: .02em;
}

header .top-middle h3 {
    margin: 2px 0 0 !important;
    color: var(--heading-color) !important;
    font-family: var(--tp-font);
    font-size: 1.6rem;
    font-weight: 750 !important;
    letter-spacing: -.01em;
}

/* main navigation */
header .main-nav-container {
    border-top: 0 !important;
}

header .top-bottom.bg-primary {
    background: var(--brand-gradient-bar) !important;
}

header .top-bottom .navbar {
    border-top: 0;
}

header .top-bottom .navbar .navbar-nav > li {
    position: relative;
    padding: 0 .1em;
}

header .top-bottom .navbar .navbar-nav > li > a {
    position: relative;
    padding: 8px 14px !important;
    color: rgba(var(--white-rgb), .86);
    font-family: var(--tp-font);
    font-size: .92rem;
    font-weight: 500;
}

/* blue underline for active / hovered item */
header .top-bottom .navbar .navbar-nav > li > a::before {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 0;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background: var(--white);
    transform: scaleX(0);
    transition: transform .25s var(--tp-ease);
}

body header .top-bottom .navbar .navbar-nav > li.active,
body header .top-bottom .navbar .navbar-nav > li:hover,
body header .top-bottom .navbar .navbar-nav > li:focus,
body header .top-bottom .navbar .navbar-nav > li:active {
    background: rgba(var(--white-rgb), .07);
}

header .top-bottom .navbar .navbar-nav > li.active > a,
header .top-bottom .navbar .navbar-nav > li:hover > a {
    color: var(--white);
}

header .top-bottom .navbar .navbar-nav > li.active > a::before,
header .top-bottom .navbar .navbar-nav > li:hover > a::before {
    transform: scaleX(1);
}

/* dropdowns: white card with a blue top edge */
header .top-bottom .navbar .dropdown-menu {
    min-width: 15rem;
    margin-top: 0;
    padding: 8px !important;
    border: 0 !important;
    border-top: 3px solid var(--primary-color) !important;
    border-radius: 0 0 14px 14px !important;
    box-shadow: 0 24px 48px -16px rgba(var(--accent-color-dark-rgb), .35);
}

body header .top-bottom .navbar .navbar-nav > li a.dropdown-item,
body header .top-bottom .navbar .navbar-nav > li:hover a.dropdown-item,
body header .top-bottom .navbar .navbar-nav > li.active a.dropdown-item {
    padding: .6rem 1rem;
    border-radius: 10px !important;
    color: var(--text-color);
    background: transparent !important;
    font-family: var(--tp-font);
    font-size: .9rem;
    font-weight: 500;
    transition: background .2s, color .2s, padding .2s var(--tp-ease);
}

/* hovered / keyboard-focused submenu item: filled with the brand blue so it clearly stands out */
body header .top-bottom .navbar .navbar-nav > li a.dropdown-item:hover,
body header .top-bottom .navbar .navbar-nav > li:hover a.dropdown-item:hover,
body header .top-bottom .navbar .navbar-nav > li a.dropdown-item:focus-visible {
    padding-left: 1.3rem;
    color: var(--white) !important;
    background: var(--brand-gradient-light) !important;
}

header .navbar-toggler {
    padding: 10px 16px;
    color: var(--white);
}

/* Floating main menu (like ega.go.tz): once the page scrolls past the menu, the script in
   site/layout.blade.php adds .tp-floating and the bar detaches, dropping in as a rounded,
   see-through bar pinned near the top of the window. */
header .top-bottom.bg-primary.tp-floating {
    position: fixed !important;
    top: 8px;
    left: 0;
    right: 0;
    z-index: 1030;
    max-width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    border-radius: 16px;
    background: var(--nav-float-bg) !important;
    border: 1px solid rgba(var(--white-rgb), .08);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 16px 32px -14px rgba(var(--accent-color-dark-rgb), .55);
    animation: tpNavDrop .45s var(--tp-ease) both;
}

@keyframes tpNavDrop {
    from { opacity: 0; transform: translateY(-120%); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    header .top-bottom.bg-primary.tp-floating {
        animation: none;
    }
}

/* ==========================================================================
   Footer
   ========================================================================== */

footer.ega-footer {
    position: relative;
    font-family: var(--tp-font);
    background:
        var(--brand-gradient-deep) !important;
}

footer.ega-footer::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--tp-edge);
}

.ega-footer .footer-content {
    padding: 64px 0 24px;
    color: rgba(var(--white-rgb), .88);
    font-family: var(--tp-font);
}

.ega-footer .footer-content .footer-heading {
    color: var(--white);
    font-family: var(--tp-font);
    font-size: 1.1rem;
    font-weight: 650;
    line-height: 1.3;
}

.ega-footer .lines .bold-line {
    flex: 0 0 56px !important;
    max-width: 56px !important;
    height: 4px;
    padding: 0;
    border-radius: 4px;
    background: var(--tp-bar-light) !important;
}

.ega-footer a,
.ega-footer p {
    color: rgba(var(--white-rgb), .88);
}

.ega-footer a {
    transition: color .2s;
}

.ega-footer a:hover {
    color: var(--white);
}

.ega-footer .border-bottom {
    border-bottom-color: rgba(var(--white-rgb), .1) !important;
}

.ega-footer .footer-media {
    padding: 28px 0 32px !important;
}

.ega-footer .footer-media a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    margin: 0 5px;
    border-radius: 50%;
    background: rgba(var(--white-rgb), .08);
    transition: background .2s;
}

.ega-footer .footer-media a .icon {
    padding-left: 0 !important;
    padding-right: 0 !important;
    color: var(--white);
    font-size: 1rem;
}

.ega-footer .footer-media a:hover {
    background: var(--brand-gradient-light);
}

.ega-footer .site-info {
    border-top: 1px solid rgba(var(--white-rgb), .08) !important;
    background: rgba(var(--accent-color-rgb), .35);
}

.ega-footer .footer-links a {
    padding: 0 10px;
    color: rgba(var(--white-rgb), .88);
    font-size: .85rem;
}

.ega-footer .footer-links a:hover {
    color: var(--white);
}

.ega-footer .copyright,
.ega-footer .copyright .text-white-50 {
    color: rgba(var(--white-rgb), .78) !important;
    font-size: .82rem;
}

.ega-footer .copyright a {
    color: var(--primary-color-pale);
}

/* ==========================================================================
   Feedback box (bottom right)
   ========================================================================== */

.chatbot-container {
    font-family: var(--tp-font);
}

.chatbot-container .chatbot-header.bg-accent {
    background: var(--brand-gradient-bar) !important;
    border-radius: 14px 14px 0 0 !important;
    font-weight: 600;
    box-shadow: 0 -8px 24px -12px rgba(var(--accent-color-dark-rgb), .45);
}

.chatbot-container .chatbot-body {
    border-color: var(--border-color) !important;
}

.chatbot-container .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), .15);
}

.chatbot-container .btn-primary {
    padding: .55rem 1.3rem;
    border-color: transparent;
    border-radius: 999px !important;
    background: var(--brand-gradient);
}

.chatbot-container .btn-primary:hover {
    border-color: transparent;
    background: var(--brand-gradient-light);
}

/* ==========================================================================
   Site-wide basics
   ========================================================================== */

body {
    font-family: var(--tp-font);
}

/* CMS content is stored as raw HTML, and content pasted in from Word/Outlook carries its
   own inline font-family (and face/span tags) that would otherwise override the site's
   type system on a per-element basis. Force every rich-text block back onto the site font. */
.rich-text,
.rich-text * {
    font-family: var(--tp-font) !important;
}

/* every "primary" surface uses the menu gradient */
.bg-primary {
    background: var(--brand-gradient) !important;
}

/* primary-coloured text uses the darker shade so it stays readable on white */
.text-primary {
    color: var(--primary-color-dark) !important;
}

.btn-primary {
    border-color: transparent;
    background: var(--brand-gradient);
    color: var(--white);
}

.btn-primary:hover,
.btn-primary:focus,
.btn-primary:not(:disabled):not(.disabled):active {
    border-color: transparent;
    background: var(--brand-gradient-light);
    color: var(--white);
}

/* ==========================================================================
   Inner pages: banner with breadcrumb and page title
   ========================================================================== */

.breadcumb-banner {
    position: relative;
    z-index: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-start;
    gap: 8px 14px;
    padding: 26px 48px 24px !important;
    overflow: hidden;
    background-position: center !important;
    background-size: cover !important;
    font-family: var(--tp-font);
}

/* the banner photo stays, tinted with the brand gradient */
.breadcumb-banner::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: -1;
    background: var(--brand-gradient-deep);
    opacity: .9;
}

.breadcumb-banner br {
    display: none;
}

.breadcumb-banner .banner {
    margin: 0 !important;
    padding: 0 !important;
}

.breadcumb-banner .breadcrumb {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: center;
    margin: 0;
    padding: 6px 16px;
    border: 1px solid rgba(var(--white-rgb), .2);
    border-radius: 999px;
    background: rgba(var(--white-rgb), .12) !important;
    font-size: .82rem;
}

.breadcumb-banner .breadcrumb .breadcrumb-item,
.breadcumb-banner .breadcrumb .breadcrumb-item.active,
.breadcumb-banner .breadcrumb a,
.breadcumb-banner .breadcrumb a:focus {
    background: transparent !important;
    color: rgba(var(--white-rgb), .88) !important;
}

.breadcumb-banner .breadcrumb a:hover {
    color: var(--white) !important;
}

.breadcumb-banner .breadcrumb-item + .breadcrumb-item::before {
    color: rgba(var(--white-rgb), .5);
}

/* breadcrumb (home icon + parent pages) sits on the same line, before the title. Its last item is the
   current page, i.e. the same text as the title, so it is hidden here instead of showing twice. */
.breadcumb-banner .breadcrumb .breadcrumb-item.active {
    display: none;
}

.breadcumb-banner > h5 {
    flex: 1 1 320px;
    min-width: 0;
    max-width: 980px;
    margin: 0 !important;
    padding: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: var(--white) !important;
    font-family: var(--tp-font);
    font-size: clamp(1.25rem, .9rem + 1vw, 1.75rem) !important;
    font-weight: 750 !important;
    line-height: 1.2;
    letter-spacing: -.01em;
    text-transform: none !important;
}

.breadcumb-banner > h5::after {
    content: "";
    display: block;
    width: 56px;
    height: 4px;
    margin-top: 10px;
    border-radius: 5px;
    background: var(--tp-bar-light);
}

/* ==========================================================================
   Inner pages: sidebar
   ========================================================================== */

#myTab.nav-tabs {
    height: auto !important;
    padding: 0 8px;
    border-bottom: 1px solid var(--border-color);
    background: var(--card-bg);
}

#myTab .nav-link,
#myTab .nav-link.active {
    border: 0;
    background: transparent;
    color: var(--text-muted-color) !important;
}

#myTab .nav-link.active,
#myTab .nav-link:hover {
    color: var(--emphasis-color) !important;
}

#myTab .nav-link h5 {
    margin: 0;
    font-weight: 650;
}

/* site/includes/sidebar.blade.php: the "in this section" page menu + news/announcements
   switcher that rides along inner pages (news, campuses, pages, ...). */
.tp-side {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.tp-side__card {
    overflow: hidden;
    border-radius: var(--tp-radius);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: var(--tp-shadow);
}

/* --- "in this section" menu: markup comes from getParentId()/echoLinks() in
   app/Helpers/functions.php, shared and not itself worth rewriting, so it's reskinned
   here instead. Every row gets two <i> icons (a pointer + a meaning icon); the pointer
   is redundant once the row itself is styled as a link, so it's hidden. --- */
.tp-side__menu .col {
    padding: 0 !important;
    margin: 0 !important;
}

.tp-side__menu .col > div {
    height: auto !important;
    padding: 0 !important;
    background: transparent !important;
    border-bottom: 1px solid var(--border-color) !important;
}

.tp-side__menu .col:last-child > div {
    border-bottom: none !important;
}

.tp-side__menu a {
    display: flex !important;
    align-items: center;
    gap: 10px;
    padding: 13px 16px !important;
    font-family: var(--tp-font);
    font-size: .92rem;
    font-weight: 600 !important;
    color: var(--text-color) !important;
    transition: background .2s, color .2s, padding-left .2s;
}

.tp-side__menu a:hover {
    padding-left: 20px !important;
    background: var(--surface-color);
    color: var(--emphasis-color) !important;
}

/* the current section's own page (the "parent" row) reads as the card's header strip */
.tp-side__menu .bg-primary {
    background: var(--brand-gradient) !important;
}

.tp-side__menu .bg-primary a,
.tp-side__menu .bg-primary a:hover {
    color: var(--white) !important;
}

.tp-side__menu .fa-hand-point-right {
    display: none;
}

/* .pointer-hover (on the row, from the shared echoLinks() markup) is built for an unrelated
   hover-swap icon effect elsewhere on the site: it forces the 2nd <i> — this chip icon — to
   position:absolute with no inset, which pulls it out of flow and lets the title text run
   underneath it. Pin position/layout back to normal here. */
.tp-side__menu .fa-globe,
.tp-side__menu .fa-bullseye {
    position: static !important;
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 9px;
    font-size: .78rem;
    color: var(--primary-color);
    background: var(--primary-color-soft);
    opacity: 1 !important;
    transform: none !important;
}

.tp-side__menu .bg-primary .fa-globe {
    color: var(--white);
    background: rgba(var(--white-rgb), .18);
}

.tp-side__menu .dd-list {
    margin: 0;
    padding-left: 14px;
    list-style: none;
}

/* --- news / announcements switcher --- */
.tp-side__tablist {
    display: flex;
    gap: 6px;
    padding: 14px 14px 0;
}

.tp-side__tab {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    padding: 10px 6px;
    border: 0;
    border-radius: 999px;
    background: var(--surface-color);
    color: var(--text-muted-color);
    font-family: var(--tp-font);
    font-size: .84rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .2s, color .2s;
}

.tp-side__tab:hover {
    color: var(--emphasis-color);
}

.tp-side__tab.active {
    color: var(--white);
    background: var(--brand-gradient);
    box-shadow: 0 10px 20px -10px rgba(var(--primary-color-rgb), .6);
}

.tp-side__tabs .tab-content {
    padding: 6px 2px 2px;
}

#myTabContent {
    background: var(--card-bg);
}

/* ==========================================================================
   Administration directory (site/administration/index.blade.php): the photo
   grid of a category's members, grouped into position tiers.
   ========================================================================== */

/* each tier (e.g. Director General, then Deputy Directors, ...) is its own
   centred row, so a tier with a single member reads as a header, not an
   orphaned card stuck on the left. */
.tp-admin__group {
    margin-top: 28px;
}

.tp-admin__group:first-child {
    margin-top: 0;
}

.tp-admin__group + .tp-admin__group {
    padding-top: 28px;
    border-top: 1px dashed var(--border-color);
}

.tp-admin__grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 22px;
}

.tp-admin__card {
    position: relative;
    display: block;
    flex: 1 1 190px;
    max-width: 210px;
    overflow: hidden;
    border-radius: var(--tp-radius);
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: var(--tp-shadow);
    text-align: center;
    cursor: pointer;
    transition: transform .3s var(--tp-ease), box-shadow .3s, border-color .3s;
}

/* coloured top edge, same brand bar used on other cards across the site */
.tp-admin__card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    z-index: 1;
    background: var(--tp-edge);
}

.tp-admin__card:hover,
.tp-admin__card:focus-visible {
    border-color: transparent;
    box-shadow: var(--tp-shadow-lg);
    transform: translateY(-5px);
}

.tp-admin__photo {
    position: relative;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    background: var(--surface-color);
}

.tp-admin__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    transition: transform .4s var(--tp-ease);
}

.tp-admin__card:hover .tp-admin__photo img,
.tp-admin__card:focus-visible .tp-admin__photo img {
    transform: scale(1.06);
}

/* "view biography" hint: hidden until hover/focus, then slides up over the photo */
.tp-admin__view {
    position: absolute;
    inset: auto 0 0 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 9px 6px;
    background: var(--brand-gradient);
    color: var(--white);
    font-size: .74rem;
    font-weight: 700;
    letter-spacing: .02em;
    text-transform: uppercase;
    transform: translateY(100%);
    transition: transform .3s var(--tp-ease);
}

.tp-admin__card:hover .tp-admin__view,
.tp-admin__card:focus-visible .tp-admin__view {
    transform: translateY(0);
}

.tp-admin__body {
    padding: 14px 12px 18px;
}

.tp-admin__name {
    margin: 0 0 4px;
    font-family: var(--tp-font);
    font-size: .95rem;
    font-weight: 750;
    color: var(--heading-color);
}

.tp-admin__role {
    margin: 0;
    font-size: .8rem;
    font-weight: 600;
    color: var(--text-muted-color);
}

/* ==========================================================================
   Inner pages: cards, lists, pagination
   ========================================================================== */

/* news / gallery cards */
.card-deck .zoom-container.border {
    overflow: hidden;
    border-color: var(--border-color) !important;
    border-radius: 16px;
    background: var(--card-bg);
    transition: border-color .25s, box-shadow .3s, transform .3s var(--tp-ease);
}

.card-deck .zoom-container.border:hover {
    border-color: transparent !important;
    box-shadow: var(--tp-shadow-lg);
    transform: translateY(-4px);
}

.card-deck .item-date {
    color: var(--primary-color-dark) !important;
}

/* document and link lists */
/* the whole row is the link, so the padding moves from the <li> onto the <a> */
.list-group-flush > .list-group-item {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    border-color: var(--border-color);
    background: transparent;
}

.list-group-flush > .list-group-item > a {
    display: flex;
    align-items: center;
    padding-top: 16px !important;
    padding-bottom: 16px !important;
    color: var(--text-color);
    font-weight: 500;
    transition: color .2s, padding .25s var(--tp-ease);
}

.list-group-flush > .list-group-item > a:hover {
    padding-left: 6px;
    color: var(--primary-color-dark);
}

.list-group-flush > .list-group-item > a > .fa {
    color: var(--primary-color);
}

.pagination {
    gap: 6px;
}

.pagination .page-item .page-link {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    margin: 0;
    border: 1px solid var(--border-color);
    border-radius: 10px !important;
    color: var(--emphasis-color);
    font-weight: 600;
}

.pagination .page-item .page-link:hover {
    background: var(--primary-color-soft);
    color: var(--emphasis-color);
}

.pagination .page-item.active .page-link {
    border-color: transparent;
    background: var(--brand-gradient);
    color: var(--white);
}

.pagination .page-item.disabled .page-link {
    background: var(--surface-color);
    color: var(--text-muted-color);
}

@media (max-width: 767.98px) {
    .breadcumb-banner {
        padding: 20px 16px 18px !important;
    }
}

/* ==========================================================================
   Light / dark mode switch (button in the header top bar)
   ========================================================================== */

header .tp-theme-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin: 0 4px;
    padding: 0;
    border: 1px solid rgba(var(--white-rgb), .3);
    border-radius: 50%;
    background: transparent;
    color: var(--white);
    font-size: .8rem;
    cursor: pointer;
    transition: background .2s, border-color .2s, transform .3s var(--tp-ease);
}

header .tp-theme-toggle:hover {
    border-color: rgba(var(--white-rgb), .6);
    background: rgba(var(--white-rgb), .15);
    transform: rotate(-15deg);
}

header .tp-theme-toggle:focus-visible {
    outline: 2px solid var(--white);
    outline-offset: 2px;
}

/* moon in light mode (switch to dark), sun in dark mode (switch to light) */
.tp-theme-toggle .fa-sun,
[data-theme="dark"] .tp-theme-toggle .fa-moon {
    display: none;
}

[data-theme="dark"] .tp-theme-toggle .fa-sun {
    display: inline-block;
}

/* ==========================================================================
   Dark mode (<html data-theme="dark">)
   The dark colours are the [data-theme="dark"] palette in master.min.css, which the
   whole modern design already follows. The rules below only cover older Bootstrap /
   master classes that have fixed light colours of their own.
   ========================================================================== */

[data-theme="dark"] {
    color-scheme: dark;
}

html[data-theme="dark"],
html[data-theme="dark"] body {
    background-color: var(--page-bg);
    color: var(--text-body-color);
}

/* ambient glow behind the whole page; stays put while scrolling. Sections and cards are
   see-through in dark mode, so the glow gives them depth instead of a flat black. */
html[data-theme="dark"] body {
    background:
        radial-gradient(900px 620px at 0% 0%, rgba(var(--primary-color-rgb), .18), transparent 62%),
        radial-gradient(820px 620px at 100% 35%, rgba(var(--accent-color-rgb), .38), transparent 62%),
        radial-gradient(900px 700px at 25% 100%, rgba(var(--primary-color-rgb), .12), transparent 62%),
        var(--page-bg);
    background-attachment: fixed;
}

/* header band: soft blue tint at both ends instead of flat dark */
[data-theme="dark"] header {
    background: transparent;
}

[data-theme="dark"] header .top-middle {
    background:
        linear-gradient(90deg, rgba(var(--accent-color-rgb), .35) 0%, rgba(var(--glass-rgb), .55) 45%, rgba(var(--glass-rgb), .55) 55%, rgba(var(--primary-color-rgb), .22) 100%);
    border-bottom: 1px solid rgba(var(--white-rgb), .06);
}

/* frosted glass for panels, menus and inner-page cards */
[data-theme="dark"] :is(.card, .modal-content, .dropdown-menu, #myTab, #myTabContent, .card-deck .zoom-container.border, .box-shadow.border) {
    border-color: rgba(var(--white-rgb), .08) !important;
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    backdrop-filter: blur(16px) saturate(140%);
    box-shadow: inset 0 1px 0 rgba(var(--white-rgb), .06), 0 24px 48px -28px rgba(var(--shadow-rgb), .9);
}

[data-theme="dark"] .card-deck .zoom-container.border:hover {
    border-color: rgba(var(--primary-color-rgb), .45) !important;
    box-shadow: inset 0 1px 0 rgba(var(--white-rgb), .08), 0 0 0 1px rgba(var(--primary-color-rgb), .25), 0 24px 60px -24px rgba(var(--primary-color-rgb), .45);
}

html body {
    transition: background-color .3s, color .3s;
}

/* :where() keeps these at the lowest weight, so any styled link or heading keeps its own colour */
:where([data-theme="dark"]) a {
    color: var(--text-color);
}

:where([data-theme="dark"]) :is(h1, h2, h3, h4, h5, h6) {
    color: var(--text-color);
}

[data-theme="dark"] .bg-white,
[data-theme="dark"] .bg-light,
[data-theme="dark"] .bg-light-dark,
[data-theme="dark"] .bg-light-darker,
[data-theme="dark"] .card,
[data-theme="dark"] .modal-content,
[data-theme="dark"] .dropdown-menu,
[data-theme="dark"] .list-group-item {
    background-color: var(--card-bg) !important;
    color: var(--text-body-color);
}

/* the page-banner title carries .bg-white in the markup; keep it transparent over the banner */
[data-theme="dark"] .breadcumb-banner > h5 {
    background: transparent !important;
}

[data-theme="dark"] .text-dark {
    color: var(--text-color) !important;
}

[data-theme="dark"] .text-muted,
[data-theme="dark"] .text-gray,
[data-theme="dark"] .faded {
    color: var(--text-muted-color) !important;
}

[data-theme="dark"] .border,
[data-theme="dark"] .border-top,
[data-theme="dark"] .border-bottom,
[data-theme="dark"] .border-left,
[data-theme="dark"] .border-right,
[data-theme="dark"] hr {
    border-color: var(--border-color) !important;
}

[data-theme="dark"] .form-control,
[data-theme="dark"] .custom-select {
    border-color: var(--border-color);
    background-color: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .form-control::placeholder {
    color: var(--text-muted-color);
}

[data-theme="dark"] .table {
    color: var(--text-body-color);
}

[data-theme="dark"] .table td,
[data-theme="dark"] .table th {
    border-color: var(--border-color);
}

[data-theme="dark"] .table-striped tbody tr:nth-of-type(odd) {
    background-color: rgba(var(--white-rgb), .03);
}

[data-theme="dark"] .pagination .page-item .page-link {
    border-color: var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
}

[data-theme="dark"] .pagination .page-item.active .page-link {
    border-color: transparent;
    background: var(--brand-gradient);
    color: var(--white);
}

[data-theme="dark"] .rich-text {
    color: var(--text-body-color);
}

/* dropdown shadow in black, which reads better on dark */
[data-theme="dark"] header .top-bottom .navbar .dropdown-menu {
    box-shadow: 0 24px 48px -16px rgba(var(--shadow-rgb), .7);
}
