/* ==========================================================================
   TPSC modern homepage sections
   Only loaded by resources/views/site/home_modern.blade.php. No colour values
   live here: every colour is a variable from the :root palette at the top of
   master.min.css. Font, shadows and header/footer are in theme-modern.css
   (loaded just before). Everything here is namespaced with "tp-".
   ========================================================================== */

.tp-home {
    font-family: var(--tp-font);
    color: var(--text-body-color);
    background: var(--page-bg);
    overflow-x: hidden;
}

.tp-home a,
.tp-home a:hover,
.tp-home a:focus {
    text-decoration: none;
}

.tp-home a:focus-visible,
.tp-home button:focus-visible {
    outline: 3px solid rgba(var(--primary-color-rgb), .55);
    outline-offset: 3px;
}

.tp-home h2,
.tp-home h3 {
    font-family: inherit;
}

.tp-wrap {
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- shared bits ---------- */

.tp-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border-radius: 999px;
    background: var(--primary-color-soft);
    color: var(--primary-color-dark);
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
}

.tp-title {
    margin: 14px 0 0;
    font-size: clamp(1.65rem, 1.05rem + 1.5vw, 2.45rem);
    font-weight: 750;
    line-height: 1.15;
    letter-spacing: -.015em;
    color: var(--heading-color);
}

.tp-title--icon {
    display: flex;
    align-items: center;
    gap: 14px;
}

.tp-title__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    border-radius: 14px;
    color: var(--white);
    font-size: 1.1rem;
    background: var(--brand-gradient);
}

.tp-accentbar {
    display: block;
    width: 76px;
    height: 5px;
    margin-top: 16px;
    border-radius: 5px;
    background: var(--tp-bar);
}

.tp-sechead {
    margin-bottom: 32px;
    text-align: center;
}

.tp-sechead .tp-accentbar {
    margin-left: auto;
    margin-right: auto;
}

/* side-by-side columns: heading, body that stretches, button. Keeps both columns' headings,
   bodies and buttons on the same lines. */
.tp-columns {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 48px 32px;
    align-items: stretch;
}

.tp-columns--wide-left {
    grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
}

.tp-col {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.tp-col__body {
    flex: 1;
}

.tp-more {
    margin-top: 28px;
    text-align: center;
}

.tp-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color-dark);
    font-weight: 600;
    font-size: .92rem;
    white-space: nowrap;
}

.tp-link i {
    font-size: .8em;
    transition: transform .25s var(--tp-ease);
}

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

.tp-link:hover i {
    transform: translateX(4px);
}

.tp-btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: .95rem;
    line-height: 1;
    transition: background .25s, color .25s, box-shadow .25s, transform .25s var(--tp-ease);
}

.tp-btn--primary {
    background: var(--brand-gradient);
    color: var(--white);
    box-shadow: 0 12px 24px -10px rgba(var(--primary-color-rgb), .65);
}

.tp-btn--primary:hover {
    background: var(--brand-gradient-light);
    color: var(--white);
    transform: translateY(-2px);
}

.tp-btn--outline {
    border: 1.5px solid var(--primary-color);
    background: transparent;
    color: var(--primary-color-dark);
}

.tp-btn--outline:hover {
    border-color: transparent;
    background: var(--brand-gradient);
    color: var(--white);
    transform: translateY(-2px);
}

.tp-btn--sm {
    gap: 8px;
    padding: 9px 16px;
    font-size: .84rem;
}

.tp-btn--ghost {
    background: var(--card-bg);
    color: var(--emphasis-color);
    border: 1.5px solid var(--border-color);
}

.tp-btn--ghost:hover {
    border-color: var(--accent-color);
    color: var(--emphasis-color);
}

.tp-date {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: .76rem;
    font-weight: 600;
    color: var(--primary-color-dark);
}

.tp-date--light {
    padding: 5px 11px;
    border-radius: 999px;
    color: var(--white);
    background: rgba(var(--white-rgb), .16);
    backdrop-filter: blur(6px);
}

/* the "new" marker the old homepage showed on items younger than a week */
.tp-new {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 6px;
    color: var(--primary-color);
    font-size: .8rem;
    vertical-align: middle;
    animation: tpBlink 1.6s ease-in-out infinite;
}

.tp-new--corner {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 2;
    width: 30px;
    height: 30px;
    margin: 0;
    border-radius: 50%;
    background: var(--card-bg);
}

@keyframes tpBlink {
    50% { opacity: .35; }
}

/* ==========================================================================
   Hero
   ========================================================================== */

.tp-hero {
    position: relative;
    background: var(--accent-color);
}

/* Full width, shape set by --tp-hero-ratio (width / height). Slides are 16:9 banners with
   text baked in, so a shorter slider trims their top and bottom. --tp-hero-focus decides where
   the trim goes: 30% keeps most of the top (banner headings) and trims more from the bottom.
   At 2.2 / 30% all current banners keep their text. Higher ratio = shorter slider but more of
   each banner is cut off; 1.7778 (16:9) shows banners uncropped. */
.tp-hero {
    --tp-hero-ratio: 2.8;
    --tp-hero-focus: 30%;
}

.tp-hero .carousel-inner {
    aspect-ratio: var(--tp-hero-ratio);
}

.tp-hero .carousel-item {
    height: 100%;
    overflow: hidden;
    background: var(--accent-color);
}


.tp-hero__link {
    display: block;
    width: 100%;
    height: 100%;
}

.tp-hero__img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 50% var(--tp-hero-focus);
}

.tp-hero__caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 64px;
    z-index: 3;
    /* spans the full width, but only the text/button inside should be clickable —
       blank space either side should fall through to the image link behind it */
    pointer-events: none;
}

.tp-hero__cta {
    position: relative;
    z-index: 1;
    display: inline-flex;
    pointer-events: auto;
    align-items: center;
    gap: 10px;
    margin-top: 18px;
    padding: 13px 26px;
    border-radius: 999px;
    background: var(--brand-gradient);
    color: var(--white);
    font-family: var(--tp-font);
    font-size: .95rem;
    font-weight: 700;
    letter-spacing: .01em;
    box-shadow: 0 14px 28px -10px rgba(var(--black-rgb), .45);
    transition: transform .25s var(--tp-ease), box-shadow .25s, background .25s;
}

.tp-hero__cta i {
    transition: transform .25s var(--tp-ease);
}

.tp-hero__cta:hover,
.tp-hero__cta:focus-visible {
    background: var(--brand-gradient-light);
    color: var(--white);
    transform: translateY(-3px);
    box-shadow: 0 18px 32px -10px rgba(var(--black-rgb), .55);
}

.tp-hero__cta:hover i,
.tp-hero__cta:focus-visible i {
    transform: translateX(4px);
}

.tp-hero__title {
    max-width: 760px;
    margin: 0 0 10px;
    color: var(--white);
    font-family: var(--tp-font);
    font-size: clamp(1.5rem, 1.05rem + 1.8vw, 2.6rem);
    font-weight: 800;
    line-height: 1.18;
    letter-spacing: -.01em;
    text-shadow: 0 4px 22px rgba(var(--black-rgb), .5);
}

/* blinking caret shown only while the title is being typed in (see the hero script) */
.tp-hero__title.is-typing::after {
    content: "";
    display: inline-block;
    width: 3px;
    height: .85em;
    margin-left: 3px;
    background: currentColor;
    vertical-align: -.05em;
    animation: tpCaret .85s steps(1) infinite;
}

@keyframes tpCaret {
    0%, 49% { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.tp-hero__desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    max-width: 620px;
    margin: 0;
    color: rgba(var(--white-rgb), .92);
    font-size: clamp(1rem, .88rem + .4vw, 1.15rem);
    font-weight: 500;
    line-height: 1.5;
    text-shadow: 0 2px 14px rgba(var(--black-rgb), .4);
}

@media (prefers-reduced-motion: reduce) {
    .tp-hero__title.is-typing::after {
        animation: none;
    }
}

.tp-hero__arrow {
    position: absolute;
    top: 50%;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    margin-top: -25px;
    border-radius: 50%;
    color: var(--white);
    background: rgba(var(--accent-color-dark-rgb), .45);
    border: 1px solid rgba(var(--white-rgb), .35);
    backdrop-filter: blur(8px);
    transition: background .25s, color .25s;
}

.tp-hero__arrow:hover {
    background: var(--white);
    color: var(--accent-color);
}

.tp-hero__arrow--prev { left: 24px; }
.tp-hero__arrow--next { right: 24px; }

/* progress-bar style slide indicators, on a small glass pill so they read on any banner */
.tp-hero .carousel-indicators.tp-hero__dots {
    right: auto;
    bottom: 16px;
    left: 50%;
    z-index: 4;
    margin: 0;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(var(--accent-color-dark-rgb), .38);
    backdrop-filter: blur(6px);
    transform: translateX(-50%);
}

.tp-hero .tp-hero__dots li {
    position: relative;
    width: 34px;
    height: 4px;
    margin: 0 4px;
    border: 0;
    border-top: 10px solid transparent;
    border-bottom: 10px solid transparent;
    background-clip: padding-box;
    background-color: rgba(var(--white-rgb), .35);
    border-radius: 0;
    opacity: 1;
    overflow: hidden;
    transition: width .4s var(--tp-ease);
}

.tp-hero .tp-hero__dots li.active {
    width: 60px;
}

.tp-hero .tp-hero__dots li.active::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--white);
    transform-origin: left center;
    animation: tpProgress 6s linear both;
}

@keyframes tpProgress {
    from { transform: scaleX(0); }
    to { transform: scaleX(1); }
}

/* navy strip under the banner: holds the ticker, and the services card overlaps its lower half */
.tp-hero__band {
    position: relative;
    padding: 14px 0 70px;
    background:
        var(--brand-gradient-bar);
}

.tp-hero__band--end {
    padding-bottom: 18px;
}

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

.tp-ticker__inner {
    display: flex;
    align-items: center;
    gap: 14px;
    max-width: 1000px;
    margin: 0 auto;
    padding: 7px 8px;
    border-radius: 999px;
    color: var(--accent-color-dark);
    background: var(--white);
    border: 1px solid rgba(var(--white-rgb), .4);
    box-shadow: 0 10px 24px -12px rgba(var(--accent-color-dark-rgb), .55);
}

.tp-ticker__badge {
    flex: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 13px;
    border-radius: 999px;
    background: var(--accent-color);
    color: var(--white);
    font-size: .7rem;
    font-weight: 750;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.tp-ticker__pulse {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--white);
    animation: tpPulse 1.8s ease-out infinite;
}

@keyframes tpPulse {
    0% { box-shadow: 0 0 0 0 rgba(var(--white-rgb), .7); }
    100% { box-shadow: 0 0 0 9px rgba(var(--white-rgb), 0); }
}

.tp-ticker__items {
    position: relative;
    flex: 1;
    min-width: 0;
    height: 22px;
    overflow: hidden;
}

.tp-ticker__item {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    overflow: hidden;
    color: var(--accent-color-dark);
    font-size: .9rem;
    font-weight: 600;
    line-height: 22px;
    white-space: nowrap;
    text-overflow: ellipsis;
    opacity: 0;
    transform: translateY(100%);
    transition: opacity .45s var(--tp-ease), transform .45s var(--tp-ease);
}

.tp-ticker__item.is-active {
    opacity: 1;
    transform: none;
}

.tp-ticker__item.is-leaving {
    transform: translateY(-100%);
}

.tp-ticker__item:hover {
    color: var(--primary-color);
}

.tp-ticker__nav {
    flex: none;
    display: flex;
    gap: 4px;
}

.tp-ticker__nav button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: var(--accent-color-dark);
    font-size: .7rem;
    background: var(--primary-color-soft);
    cursor: pointer;
    transition: background .2s, color .2s;
}

.tp-ticker__nav button:hover {
    background: var(--accent-color);
    color: var(--white);
}

/* ==========================================================================
   Online services card (overlaps the bottom of the hero)
   ========================================================================== */

.tp-quick {
    position: relative;
    z-index: 6;
    margin-top: -52px;
}

.tp-quick--flat {
    margin-top: 40px;
}

.tp-quick__card {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
    padding: 16px 20px;
    overflow: hidden;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    box-shadow: 0 10px 24px -14px rgba(var(--shadow-rgb), .16);
    animation: tpRise .9s var(--tp-ease) .15s both;
}

@keyframes tpRise {
    from { opacity: 0; transform: translateY(28px); }
    to { opacity: 1; transform: none; }
}

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

.tp-quick__intro {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* "view all" sits at the right end of the heading row */
.tp-quick__intro .tp-btn {
    margin-left: auto;
}

.tp-quick__heading .tp-accentbar {
    width: 48px;
    height: 4px;
    margin-top: 8px;
}

.tp-quick__badge {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    color: var(--white);
    font-size: 1.15rem;
    background: var(--brand-gradient);
    box-shadow: 0 12px 22px -10px rgba(var(--primary-color-rgb), .8);
}

.tp-quick__title {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 750;
    line-height: 1.2;
    color: var(--heading-color);
}

.tp-quick__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 10px;
}

.tp-quick__tile {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid transparent;
    background: var(--surface-color);
    color: var(--text-color);
    transition: background .25s, border-color .25s, box-shadow .25s, transform .3s var(--tp-ease);
}

.tp-quick__tile:hover {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: rgba(var(--primary-color-rgb), .35);
    box-shadow: var(--tp-shadow);
    transform: translateY(-2px);
}

.tp-quick__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    color: var(--primary-color);
    font-size: .85rem;
    background: var(--card-bg);
    box-shadow: 0 4px 10px -4px rgba(var(--shadow-rgb), .18);
    transition: background .25s, color .25s;
}

.tp-quick__tile:hover .tp-quick__icon {
    color: var(--white);
    background: var(--brand-gradient-light);
}

.tp-quick__tile--extra {
    display: none;
}

.tp-quick__grid.is-expanded .tp-quick__tile--extra {
    display: flex;
}

.tp-quick__toggle {
    cursor: pointer;
    font-family: inherit;
}

.tp-quick__toggle i {
    transition: transform .25s var(--tp-ease);
}

.tp-quick__toggle[aria-expanded="true"] i {
    transform: rotate(180deg);
}

.tp-quick__name {
    overflow: hidden;
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* ==========================================================================
   Welcome note
   ========================================================================== */

.tp-welcome {
    position: relative;
    padding: 72px 0;
    background:
        radial-gradient(900px 420px at 100% 0%, rgba(var(--primary-color-rgb), .08), transparent 60%),
        radial-gradient(700px 380px at 0% 100%, rgba(var(--accent-color-rgb), .05), transparent 60%),
        var(--page-bg);
}

.tp-welcome__grid {
    display: grid;
    grid-template-columns: minmax(260px, 380px) minmax(0, 1fr);
    gap: clamp(48px, 7vw, 110px);
    align-items: center;
}

.tp-welcome__grid--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 860px;
}

.tp-welcome__portrait {
    position: relative;
    z-index: 0;
    margin: 0 0 0 18px;
    text-align: center;
}

.tp-welcome__frame {
    position: relative;
    padding: 14px;
    border-radius: 26px;
    background: var(--card-bg);
    box-shadow: var(--tp-shadow-lg);
}

/* offset colour block behind the photo */
.tp-welcome__frame::before {
    content: "";
    position: absolute;
    z-index: -1;
    top: 30px;
    right: 30px;
    bottom: -20px;
    left: -20px;
    border-radius: 28px;
    background: var(--brand-gradient);
}

/* gold dot grid peeking out top-right */
.tp-welcome__frame::after {
    content: "";
    position: absolute;
    z-index: -1;
    top: -26px;
    right: -26px;
    width: 104px;
    height: 104px;
    background-image: radial-gradient(rgba(var(--primary-color-rgb), .45) 1.6px, transparent 1.8px);
    background-size: 13px 13px;
}

.tp-welcome__frame img {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.05;
    object-fit: cover;
    object-position: center top;
    border-radius: 16px;
}

.tp-welcome__portrait figcaption {
    margin-top: 34px;
}

.tp-welcome__portrait figcaption strong {
    display: block;
    color: var(--emphasis-color);
    font-size: 1.18rem;
    font-weight: 700;
    line-height: 1.3;
}

.tp-welcome__portrait figcaption span {
    display: block;
    margin-top: 4px;
    color: var(--text-muted-color);
    font-size: .92rem;
}

.tp-welcome__text {
    position: relative;
    margin: 30px 0 0;
    padding: 0;
    border: 0;
}

.tp-welcome__text::before {
    content: "\201C";
    position: absolute;
    top: -46px;
    left: -10px;
    z-index: -1;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 8rem;
    line-height: 1;
    color: rgba(var(--primary-color-rgb), .13);
}

.tp-welcome__text p {
    margin: 0;
    color: var(--text-body-color);
    font-size: 1.06rem;
    line-height: 1.9;
}

.tp-welcome__body {
    position: relative;
    z-index: 0;
}

.tp-welcome__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 32px;
}

/* ==========================================================================
   News + announcements
   ========================================================================== */

.tp-updates {
    position: relative;
    padding: 72px 0;
    background: var(--surface-color);
}

/* faint concentric arcs in the corner */
.tp-updates::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 100% 0%, transparent 0 300px, rgba(var(--accent-color-rgb), .06) 301px 302px, transparent 303px),
        radial-gradient(circle at 100% 0%, transparent 0 440px, rgba(var(--accent-color-rgb), .05) 441px 442px, transparent 443px),
        radial-gradient(circle at 100% 0%, transparent 0 580px, rgba(var(--accent-color-rgb), .04) 581px 582px, transparent 583px);
}

.tp-news__layout {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 18px;
}

.tp-news__lead {
    position: relative;
    display: block;
    min-height: 460px;
    overflow: hidden;
    border-radius: 22px;
    background: var(--accent-color);
    box-shadow: var(--tp-shadow);
}

.tp-news__lead img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .8s var(--tp-ease);
}

.tp-news__lead::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(0deg, rgba(var(--accent-color-rgb), .94) 0%, rgba(var(--accent-color-rgb), .5) 40%, rgba(var(--accent-color-rgb), 0) 72%);
}

.tp-news__lead:hover img {
    transform: scale(1.06);
}

.tp-news__lead-body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    padding: 26px;
}

.tp-news__lead h3 {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 14px 0 0;
    color: var(--white);
    font-size: 1.22rem;
    font-weight: 650;
    line-height: 1.4;
}

.tp-news__list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.tp-news__item {
    flex: 1;
    display: grid;
    grid-template-columns: 108px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    padding: 12px;
    border-radius: 18px;
    background: var(--card-bg);
    border: 1px solid transparent;
    box-shadow: var(--tp-shadow);
    transition: border-color .25s, transform .3s var(--tp-ease);
}

.tp-news__item:hover {
    border-color: rgba(var(--primary-color-rgb), .35);
    transform: translateX(4px);
}

.tp-news__thumb {
    display: block;
    height: 92px;
    overflow: hidden;
    border-radius: 12px;
    background: var(--primary-color-soft);
}

.tp-news__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tp-news__meta {
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-width: 0;
}

.tp-news__title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: var(--text-color);
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.45;
}

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

/* list card: announcements and short courses */
.tp-listcard {
    display: flex;
    flex-direction: column;
    overflow: hidden;
    border-radius: 22px;
    background: var(--card-bg);
    box-shadow: var(--tp-shadow);
}

/* entries spread over the card's full height so it ends level with the column next to it */
.tp-listcard__list {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    margin: 0;
    padding: 10px 14px;
    list-style: none;
}

.tp-listcard__list li + li {
    border-top: 1px dashed var(--border-color);
}

.tp-entry {
    display: grid;
    grid-template-columns: 58px minmax(0, 1fr);
    gap: 16px;
    align-items: center;
    margin: 4px 0;
    padding: 12px;
    border-radius: 14px;
    color: var(--text-color);
    transition: background .2s;
}

.tp-entry:hover {
    background: var(--surface-color);
    color: var(--emphasis-color);
}

.tp-entry__date {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 9px 0 8px;
    border-radius: 14px;
    color: var(--primary-color-dark);
    background: var(--primary-color-soft);
    line-height: 1;
    transition: background .2s, color .2s;
}

.tp-entry:hover .tp-entry__date {
    color: var(--white);
    background: var(--brand-gradient);
}

.tp-entry__date b {
    font-size: 1.35rem;
    font-weight: 750;
}

.tp-entry__date small {
    margin-top: 5px;
    font-size: .62rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.tp-entry__title {
    font-size: .88rem;
    font-weight: 600;
    line-height: 1.45;
}

/* ==========================================================================
   Downloads
   ========================================================================== */

/* light grey, continuing from the gallery band above, so the white document cards stand out */
.tp-docs {
    padding: 32px 0 64px;
    background:
        radial-gradient(640px 280px at 90% 20%, rgba(var(--primary-color-rgb), .07), transparent 70%),
        var(--surface-color);
}

/* auto-fit: with fewer documents the cards stretch to fill the row instead of leaving gaps */
.tp-docs__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 16px;
}

/* compact card: icon on the left, title (2 lines) and date on the right.
   The whole card is the download link; a small arrow appears on hover. */
.tp-doc {
    position: relative;
    display: grid;
    grid-template-columns: 40px minmax(0, 1fr);
    grid-template-areas:
        "icon title"
        "icon date";
    align-items: center;
    gap: 4px 14px;
    padding: 14px 34px 14px 16px;
    border-radius: 14px;
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    color: var(--text-color);
    transition: border-color .25s, box-shadow .3s, transform .3s var(--tp-ease);
}

.tp-doc:hover {
    color: var(--text-color);
    border-color: transparent;
    box-shadow: var(--tp-shadow-lg);
    transform: translateY(-3px);
}

.tp-doc__icon {
    grid-area: icon;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 11px;
    color: var(--primary-color);
    font-size: 1.1rem;
    background: var(--primary-color-soft);
    transition: background .25s, color .25s;
}

.tp-doc:hover .tp-doc__icon {
    color: var(--white);
    background: var(--brand-gradient);
}

.tp-doc__title {
    grid-area: title;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: calc(1.4em * 2);
    font-size: .86rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color .25s;
}

.tp-doc:hover .tp-doc__title {
    color: var(--primary-color-dark);
}

.tp-doc__date {
    grid-area: date;
    color: var(--text-muted-color);
    font-size: .74rem;
    font-weight: 500;
}

.tp-doc__go {
    position: absolute;
    top: 50%;
    right: 14px;
    color: var(--primary-color);
    font-size: .8rem;
    opacity: 0;
    transform: translateY(-50%) translateY(-4px);
    transition: opacity .25s, transform .3s var(--tp-ease);
}

.tp-doc:hover .tp-doc__go {
    opacity: 1;
    transform: translateY(-50%);
}

/* ==========================================================================
   Photo galleries: sliding dark photo cards (like tcra.go.tz "Featured Services").
   The card in the middle is full size; the script sets --d (distance from the
   centre) on each card and the ones beside it shrink and fade.
   ========================================================================== */

.tp-gallery {
    --tp-gcols: 4;        /* photos visible at once */
    --tp-ggap: 20px;
    --tp-gcard-h: 240px;
    position: relative;
    padding: 56px 0 36px;
    overflow: hidden;
    /* soft blue tint fading into the light grey of the Downloads section below */
    background:
        radial-gradient(700px 320px at 15% 30%, rgba(var(--primary-color-rgb), .14), transparent 70%),
        radial-gradient(700px 320px at 85% 70%, rgba(var(--accent-color-rgb), .1), transparent 70%),
        linear-gradient(180deg, var(--primary-color-soft) 0%, var(--surface-color) 100%);
}

.tp-gallery .tp-sechead {
    margin-bottom: 16px;
}

/* Inside .tp-wrap, so the slider keeps the same side margins as every other section.
   The 12px negative margin + padding only gives the card shadows room; cards still line up
   with the content edges. Bottom padding is room for the shadows below the cards. */
.tp-gallery__track {
    position: relative;
    display: flex;
    align-items: center;
    gap: var(--tp-ggap);
    margin: 0 -12px;
    padding: 8px 12px 40px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    outline: none;
}

.tp-gallery__track::-webkit-scrollbar {
    display: none;
}

.tp-gallery__card {
    position: relative;
    flex: 0 0 calc((100% - (var(--tp-gcols) - 1) * var(--tp-ggap)) / var(--tp-gcols));
    height: var(--tp-gcard-h);
    overflow: hidden;
    border-radius: 20px;
    border: 1px solid rgba(var(--white-rgb), .06);
    background: var(--accent-color-dark);
    color: var(--white);
    scroll-snap-align: start;
    box-shadow: 0 18px 32px -20px rgba(var(--shadow-rgb), .5);
    transition: transform .35s var(--tp-ease), box-shadow .35s;
}

.tp-gallery__card:hover {
    color: var(--white);
    transform: translateY(-4px);
    box-shadow: 0 24px 40px -20px rgba(var(--primary-color-rgb), .55);
}

.tp-gallery__card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .7s var(--tp-ease);
}

.tp-gallery__card:hover img {
    transform: scale(1.06);
}

/* dark shade only behind the text at the bottom, so the top of the photo stays clear */
.tp-gallery__card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    background: linear-gradient(0deg, rgba(var(--accent-color-dark-rgb), .92) 0%, rgba(var(--accent-color-dark-rgb), .62) 32%, rgba(var(--accent-color-dark-rgb), 0) 62%);
}

.tp-gallery__count {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    border: 1px solid rgba(var(--white-rgb), .18);
    background: rgba(var(--white-rgb), .12);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    font-size: .72rem;
    font-weight: 600;
}

.tp-gallery__body {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-end;
    padding: 20px 70px 20px 20px;
    text-align: left;
}

.tp-gallery__title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: .98rem;
    font-weight: 750;
    line-height: 1.35;
    letter-spacing: -.005em;
    text-shadow: 0 1px 8px rgba(var(--black-rgb), .35);
}

/* thin line under the title that fills with the brand gradient on hover */
.tp-gallery__line {
    position: relative;
    width: 90px;
    height: 2px;
    margin-top: 10px;
    overflow: hidden;
    border-radius: 2px;
    background: rgba(var(--white-rgb), .15);
}

.tp-gallery__line::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 0;
    background: linear-gradient(90deg, var(--primary-color-pale), var(--primary-color), var(--primary-color-pale));
    transition: width .9s ease-in-out;
}

.tp-gallery__card:hover .tp-gallery__line::after,
.tp-gallery__card:focus-visible .tp-gallery__line::after {
    width: 100%;
}

/* round arrow button, bottom right; the label slides out on hover */
.tp-gallery__go {
    position: absolute;
    right: 16px;
    bottom: 16px;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    padding: 3px;
    border-radius: 999px;
    border: 1px solid rgba(var(--white-rgb), .15);
    background: rgba(var(--white-rgb), .1);
    transition: background .4s, border-color .4s;
}

.tp-gallery__go-label {
    max-width: 0;
    overflow: hidden;
    font-size: .68rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transition: max-width .45s var(--tp-ease), padding .45s var(--tp-ease), opacity .35s;
}

.tp-gallery__go-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    font-size: .78rem;
    background: rgba(var(--white-rgb), .12);
    transition: background .4s, transform .4s var(--tp-ease);
}

.tp-gallery__card:hover .tp-gallery__go {
    border-color: rgba(var(--white-rgb), .35);
    background: rgba(var(--white-rgb), .18);
}

.tp-gallery__card:hover .tp-gallery__go-label {
    max-width: 90px;
    padding: 0 10px 0 12px;
    opacity: 1;
}

.tp-gallery__card:hover .tp-gallery__go-icon {
    background: var(--brand-gradient);
    transform: rotate(-45deg);
}

.tp-gallery__controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: -12px;
}

.tp-gallery__nav {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--border-color);
    border-radius: 50%;
    background: var(--card-bg);
    color: var(--primary-color-dark);
    cursor: pointer;
    transition: background .25s, color .25s, border-color .25s;
}

.tp-gallery__nav:hover {
    border-color: transparent;
    background: var(--brand-gradient);
    color: var(--white);
}

@media (max-width: 1199.98px) {
    .tp-gallery {
        --tp-gcols: 3;
    }
}

@media (max-width: 767.98px) {
    .tp-gallery {
        --tp-gcols: 2;
    }
}

@media (max-width: 575.98px) {
    /* phones: one photo plus a peek of the next */
    .tp-gallery {
        --tp-gcols: 1.2;
        --tp-ggap: 14px;
        --tp-gcard-h: 230px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-gallery__card,
    .tp-gallery__card img {
        transition: none;
    }
}

/* ==========================================================================
   Campuses
   ========================================================================== */

/* light section so the only dark blocks on the page are the header strip and the footer */
/* white, so it does not merge with the grey Downloads section above */
.tp-campus {
    position: relative;
    padding: 72px 0 80px;
    overflow: hidden;
    background: var(--page-bg);
}

/* faint arcs, same motif as the news section */
.tp-campus::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 0% 100%, transparent 0 300px, rgba(var(--accent-color-rgb), .06) 301px 302px, transparent 303px),
        radial-gradient(circle at 0% 100%, transparent 0 440px, rgba(var(--accent-color-rgb), .05) 441px 442px, transparent 443px);
}

.tp-campus .tp-wrap {
    position: relative;
}

/* flex instead of grid: cards grow to fill their row, so a short last row (e.g. 7 cards = 4 + 3)
   stretches across the full width instead of leaving an empty gap */
.tp-campus__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.tp-campus__card {
    flex: 1 1 260px;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px 22px;
    border-radius: 18px;
    color: var(--text-color);
    background: var(--card-bg);
    border: 1px solid transparent;
    box-shadow: var(--tp-shadow);
    transition: border-color .25s, box-shadow .3s, transform .3s var(--tp-ease);
}

.tp-campus__card:hover {
    color: var(--emphasis-color);
    border-color: rgba(var(--primary-color-rgb), .35);
    box-shadow: var(--tp-shadow-lg);
    transform: translateY(-4px);
}

.tp-campus__pin {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: var(--primary-color);
    background: var(--primary-color-soft);
    transition: background .25s, color .25s;
}

.tp-campus__card:hover .tp-campus__pin {
    color: var(--white);
    background: var(--brand-gradient);
}

.tp-campus__name {
    flex: 1;
    min-width: 0;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.35;
}

.tp-campus__go {
    flex: none;
    font-size: .8rem;
    opacity: .45;
    transition: opacity .25s, transform .25s var(--tp-ease);
}

.tp-campus__card:hover .tp-campus__go {
    opacity: 1;
    transform: translateX(4px);
}

/* ==========================================================================
   Scroll reveal (only once JS has added .tp-js, so no-JS visitors see everything)
   ========================================================================== */

.tp-js .tp-reveal {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .8s var(--tp-ease), transform .8s var(--tp-ease);
    transition-delay: calc(var(--i, 0) * 80ms);
}

.tp-js .tp-reveal.is-in {
    opacity: 1;
    transform: none;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 1199.98px) {
    .tp-quick__grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

@media (max-width: 991.98px) {
    .tp-welcome,
    .tp-updates,
    .tp-docs,
    .tp-campus {
        padding: 56px 0;
    }

    .tp-welcome__grid,
    .tp-columns--wide-left {
        grid-template-columns: minmax(0, 1fr);
    }

    .tp-welcome__portrait {
        max-width: 340px;
        margin: 0 auto;
    }
}

@media (max-width: 767.98px) {
    .tp-wrap {
        padding: 0 16px;
    }

    .tp-hero__arrow {
        display: none;
    }

    .tp-hero .carousel-indicators.tp-hero__dots {
        bottom: 8px;
    }

    .tp-hero__caption {
        bottom: 40px;
    }

    .tp-hero__band {
        padding: 12px 0 52px;
    }

    .tp-ticker__inner {
        gap: 10px;
        padding: 5px 6px;
    }

    .tp-ticker__nav {
        display: none;
    }

    .tp-quick {
        margin-top: -40px;
    }

    .tp-quick__card {
        padding: 22px 18px;
        border-radius: 20px;
    }

    .tp-quick__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tp-news__layout {
        grid-template-columns: minmax(0, 1fr);
    }

    .tp-news__lead {
        min-height: 320px;
    }

    .tp-news__item {
        grid-template-columns: 92px minmax(0, 1fr);
    }

    .tp-news__thumb {
        height: 78px;
    }

    .tp-welcome__frame::after {
        display: none;
    }

    .tp-doc {
        min-height: 0;
    }

    .tp-campus__card {
        flex-basis: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tp-js .tp-reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .tp-quick__card,
    .tp-hero .tp-hero__dots li.active::after,
    .tp-ticker__pulse,
    .tp-new {
        animation: none;
    }
}

/* ==========================================================================
   Dark mode (<html data-theme="dark">)
   Sections are see-through over the page glow (theme-modern.css), cards are
   frosted glass, titles get a soft gradient, and the slider is dimmed so even a
   white banner sits comfortably in the dark page.
   ========================================================================== */

[data-theme="dark"] .tp-home,
[data-theme="dark"] .tp-docs {
    background: transparent;
}

[data-theme="dark"] .tp-gallery {
    background:
        radial-gradient(700px 320px at 15% 30%, rgba(var(--primary-color-rgb), .12), transparent 70%),
        radial-gradient(700px 320px at 85% 70%, rgba(var(--accent-color-rgb), .3), transparent 70%);
}

[data-theme="dark"] .tp-gallery__card {
    border-color: rgba(var(--white-rgb), .1);
}

[data-theme="dark"] .tp-gallery__nav {
    border-color: rgba(var(--white-rgb), .1);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

[data-theme="dark"] .tp-welcome {
    background:
        radial-gradient(760px 420px at 100% 0%, rgba(var(--primary-color-rgb), .16), transparent 65%),
        radial-gradient(640px 380px at 0% 100%, rgba(var(--accent-color-rgb), .3), transparent 65%);
}

[data-theme="dark"] .tp-updates,
[data-theme="dark"] .tp-campus {
    background: linear-gradient(180deg, rgba(var(--glass-rgb), .35) 0%, rgba(var(--accent-color-rgb), .14) 100%);
}

/* section titles: soft white-to-blue gradient text, sized to the text so the gradient spans the words */
[data-theme="dark"] .tp-title {
    width: fit-content;
    max-width: 100%;
    background: linear-gradient(90deg, var(--text-color) 0%, var(--heading-color) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

[data-theme="dark"] .tp-sechead .tp-title {
    margin-left: auto;
    margin-right: auto;
}

/* frosted-glass cards with a fine light edge; blue glow on hover */
[data-theme="dark"] :is(.tp-quick__card, .tp-listcard, .tp-news__item, .tp-doc, .tp-campus__card) {
    border: 1px solid rgba(var(--white-rgb), .08);
    -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"] :is(.tp-listcard, .tp-news__item, .tp-doc, .tp-campus__card):hover {
    border-color: rgba(var(--primary-color-rgb), .45);
    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);
}

[data-theme="dark"] .tp-quick__tile {
    border-color: rgba(var(--white-rgb), .06);
}

[data-theme="dark"] .tp-quick__tile:hover {
    border-color: rgba(var(--primary-color-rgb), .45);
    background: rgba(var(--primary-color-rgb), .14);
}

[data-theme="dark"] .tp-btn--outline {
    background: rgba(var(--white-rgb), .04);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

/* slider: dim the banner a little and fade its edges into the dark page, so a white banner
   still reads as part of dark mode. Banner text stays readable (the fade is only at the edges). */
[data-theme="dark"] .tp-hero__img {
    filter: brightness(.82) contrast(1.05) saturate(1.05);
}

