/* ==========================================================================
   TCSC — Modern blue theme
   Companion stylesheet for Bootstrap 4.6.2.
   Load order:  bootstrap.min.css  ->  colors.min.css  ->  theme.css
   ========================================================================== */

:root {
    --blue-900: #001f5f;
    --blue-800: #01367a;   /* legacy .bg-new  */
    --blue-700: #006095;   /* legacy .bg-diff */
    --blue-600: #0074d9;   /* legacy .bg-blue */
    --blue-100: #dce8f8;
    --blue-50:  #eef4fc;

    --accent:      #ff851b; /* legacy .bg-orange — kept as the accent  */
    --accent-dark: #e06d00;

    --ink:   #1b2a3a;
    --muted: #5a6b7d;

    --radius:    1rem;
    --shadow-sm: 0 4px 14px rgba(1, 54, 122, .08);
    --shadow-md: 0 10px 30px rgba(1, 54, 122, .14);
    --pill:      50rem;
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

html { scroll-behavior: smooth; }

body {
    color: var(--ink);
    font-family: 'Source Sans Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--blue-50);
    background-image:
        linear-gradient(rgba(238, 244, 252, .94), rgba(238, 244, 252, .94)),
        url('/static/images/tcsc_bg.jpg');
    background-position: center top;
    background-size: cover;
    background-attachment: fixed;
    -webkit-font-smoothing: antialiased;
}

a { color: #0b5bb5; }
a:hover, a:focus { color: var(--blue-900); }

h1, h2, h3, h4, h5, .font-weight-bold { font-weight: 700; }

.skip-link {
    position: absolute;
    top: 0;
    left: -9999px;
    z-index: 2000;
    padding: .6rem 1rem;
    color: #fff;
    background: var(--blue-800);
    border-radius: 0 0 .5rem 0;
}
.skip-link:focus { left: 0; color: #fff; }

a:focus-visible,
.btn:focus-visible,
button:focus-visible {
    outline: 3px solid rgba(255, 133, 27, .65);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Full-width layout container
   Bootstrap's .container stops at 1140px, which leaves large empty margins on
   1920px displays. This one is edge-to-edge with responsive side padding.
   -------------------------------------------------------------------------- */

.container-wide {
    width: 100%;
    max-width: 100%;
    padding-right: 16px;
    padding-left: 16px;
    margin-right: auto;
    margin-left: auto;
}
@media (min-width: 576px) {
    .container-wide { padding-right: 24px; padding-left: 24px; }
}
@media (min-width: 1400px) {
    .container-wide { padding-right: 32px; padding-left: 32px; }
}

/* Bootstrap only applies its navbar flex layout to `.navbar > .container` /
   `.container-fluid`, so mirror it for the full-width container. */
.navbar > .container-wide {
    display: flex;
    flex-wrap: inherit;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

/* --------------------------------------------------------------------------
   Header banner
   -------------------------------------------------------------------------- */

.site-header { background: #fff; }
.site-banner  { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   Navbar
   -------------------------------------------------------------------------- */

#mainNav {
    padding: .35rem 0;
    background-image: linear-gradient(90deg, var(--blue-900) 0%, var(--blue-800) 45%, var(--blue-700) 100%);
    box-shadow: 0 4px 18px rgba(0, 31, 95, .22);
}

#mainNav .navbar-brand {
    font-weight: 700;
    letter-spacing: .08em;
    color: #fff;
}

#mainNav .navbar-toggler {
    padding: .35rem .7rem;
    font-size: .95rem;
    font-weight: 600;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .45);
    border-radius: var(--pill);
}
#mainNav .navbar-toggler:focus { outline: 0; box-shadow: 0 0 0 .2rem rgba(255, 255, 255, .25); }

#mainNav .navbar-nav .nav-link {
    padding: .5rem .8rem;
    font-size: .95rem;
    font-weight: 600;
    color: rgba(255, 255, 255, .88);
    border-radius: var(--pill);
    transition: background-color .18s ease, color .18s ease;
}
#mainNav .navbar-nav .nav-link:hover,
#mainNav .navbar-nav .nav-link:focus {
    color: #fff;
    background-color: rgba(255, 255, 255, .14);
}
#mainNav .navbar-nav .nav-item.active > .nav-link,
#mainNav .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, .2);
}

/* Desktop: items share the bar equally and their labels are centred, so the
   group reads as centred while still using the full width.
   (Kept in sync with the inline rules in navbar.html.) */
@media (min-width: 992px) {
    #mainNav .navbar-nav {
        width: 100%;
        flex-wrap: wrap;
        align-items: center;
        justify-content: center;
    }
    #mainNav .navbar-nav > .nav-item {
        flex: 1 1 auto;
        text-align: center;
    }
    #mainNav .navbar-nav .nav-link { padding: .5rem .9rem; text-align: center; }
}

#mainNav .dropdown-menu {
    margin-top: .35rem;
    padding: .4rem;
    border: 0;
    border-radius: .75rem;
    box-shadow: var(--shadow-md);
}

/* NOTE: the dropdown width / max-height that stops titles wrapping onto many
   lines and stops long menus running off screen is set in navbar.html's
   inline <style>, so it cannot be lost to a stale theme.css. */

#mainNav .dropdown-item {
    padding: .5rem .8rem;
    font-size: .92rem;
    line-height: 1.4;
    border-radius: .5rem;
    white-space: normal;
    overflow-wrap: break-word;
}
#mainNav .dropdown-item:hover,
#mainNav .dropdown-item:focus {
    color: #fff;
    background-color: var(--blue-700);
}
#mainNav .dropdown-divider { margin: .35rem .2rem; }

.user-chip {
    display: inline-block;
    padding: 0 .55rem;
    border: 1px solid rgba(255, 255, 255, .5);
    border-radius: var(--pill);
}

/* --------------------------------------------------------------------------
   Hero carousel
   -------------------------------------------------------------------------- */

.hero-carousel { background: var(--blue-900); }

.hero-carousel .carousel-item img {
    width: 100%;
    height: 60vh;
    min-height: 300px;
    object-fit: cover;
}

.hero-carousel .carousel-item::before {
    content: '';
    position: absolute;
    top: 0; right: 0; bottom: 0; left: 0;
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(180deg, rgba(0, 31, 95, 0) 45%, rgba(0, 31, 95, .78) 100%);
}

.hero-carousel .carousel-caption {
    right: 8%;
    bottom: 1.6rem;
    left: 8%;
    z-index: 2;
    font-size: 1.05rem;
    font-weight: 600;
    text-shadow: 0 2px 10px rgba(0, 0, 0, .55);
}

.hero-carousel .carousel-indicators { z-index: 3; }
.hero-carousel .carousel-indicators li {
    width: 22px;
    height: 5px;
    margin: 0 4px;
    background-color: rgba(255, 255, 255, .55);
    border: 0;
    border-radius: var(--pill);
    transition: width .2s ease, background-color .2s ease;
}
.hero-carousel .carousel-indicators .active { width: 36px; background-color: #fff; }

.hero-carousel .carousel-control-prev-icon,
.hero-carousel .carousel-control-next-icon {
    width: 2.4rem;
    height: 2.4rem;
    background-color: rgba(0, 31, 95, .45);
    background-size: 55% 55%;
    border-radius: 50%;
}
.hero-carousel .carousel-control-prev-icon:hover,
.hero-carousel .carousel-control-next-icon:hover { background-color: rgba(0, 31, 95, .75); }

@media (max-width: 991.98px) {
    .hero-carousel .carousel-item img { height: 42vh; }
}
@media (max-width: 575.98px) {
    .hero-carousel .carousel-item img { height: 32vh; min-height: 200px; }
    .hero-carousel .carousel-caption { bottom: .8rem; font-size: .9rem; }
}

/* --------------------------------------------------------------------------
   Section headings (blue pill, replaces the old inline-styled <p>)
   -------------------------------------------------------------------------- */

.section-title,
.section-header {
    margin-bottom: 1rem;
    padding: .55rem 1.25rem;
    color: #fff;
    font-weight: 700;
    text-align: center;
    letter-spacing: .01em;
    background-image: linear-gradient(90deg, var(--blue-800) 0%, var(--blue-700) 60%, var(--blue-600) 100%);
    border: 0;
    border-radius: var(--pill);
    box-shadow: var(--shadow-sm);
}

/* --------------------------------------------------------------------------
   Cards
   -------------------------------------------------------------------------- */

.card-modern {
    overflow: hidden;
    border: 0;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    transition: transform .2s ease, box-shadow .2s ease;
}
.card-modern:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
}
/* Large content cards keep a stable position (no hover lift) */
.card-modern.card-static:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}
.card-modern .card-header {
    margin-bottom: 0;
    padding: .65rem 1rem;
    font-weight: 700;
    text-align: center;
    border: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    background-image: linear-gradient(90deg, var(--blue-800) 0%, var(--blue-700) 100%);
    box-shadow: none;
}
.card-modern .card-img-top {
    height: 230px;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   Link lists (quick links, notices, results …)
   -------------------------------------------------------------------------- */

.link-list { margin-bottom: 0; }
.link-list > li { margin-bottom: .35rem; line-height: 1.35; }
.link-list a { font-weight: 600; }

.notice-meta {
    display: block;
    color: var(--muted);
    font-size: .82rem;
}

/* --------------------------------------------------------------------------
   News
   -------------------------------------------------------------------------- */

.news-card .card-img-wrap {
    height: 210px;
    overflow: hidden;
    background: var(--blue-100);
}
.news-card .card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* --------------------------------------------------------------------------
   Videos
   -------------------------------------------------------------------------- */

.video-card {
    overflow: hidden;
    background: #000;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
}
.video-card iframe { display: block; border: 0; }

/* --------------------------------------------------------------------------
   Logos
   -------------------------------------------------------------------------- */

.partner-logo,
.intl-logo {
    max-width: 100%;
    width: auto;
    object-fit: contain;
    transition: transform .2s ease, filter .2s ease;
}
.partner-logo { max-height: 90px; filter: grayscale(20%); }
.partner-logo:hover { transform: scale(1.04); filter: none; }
.intl-logo { max-height: 110px; }

/* App-store badges: keep them a sensible size now that the page is full width */
.store-badge {
    width: 100%;
    max-width: 250px;
    height: auto;
}

/* --------------------------------------------------------------------------
   Buttons & badges
   -------------------------------------------------------------------------- */

.btn {
    font-weight: 600;
    border-radius: var(--pill);
    transition: transform .15s ease, box-shadow .15s ease, background-color .15s ease;
}
.btn:hover { transform: translateY(-1px); }

/* Orange stays as the secondary/accent colour */
.btn.bg-orange,
.btn-accent {
    color: #fff;
    background-color: var(--accent);
    border-color: var(--accent);
    box-shadow: 0 4px 14px rgba(255, 133, 27, .35);
}
.btn.bg-orange:hover,
.btn.bg-orange:focus,
.btn-accent:hover,
.btn-accent:focus {
    color: #fff;
    background-color: var(--accent-dark);
    border-color: var(--accent-dark);
}

.badge {
    padding: .35em .7em;
    font-weight: 700;
    letter-spacing: .02em;
    border-radius: var(--pill);
}

/* --------------------------------------------------------------------------
   Alerts (flash messages)
   -------------------------------------------------------------------------- */

.alert {
    border: 0;
    border-left: 5px solid currentColor;
    border-radius: .65rem;
}
.alert .alert-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 22px;
    width: 22px;
    height: 22px;
    margin-top: .1rem;
    font-size: .8rem;
    font-weight: 700;
    line-height: 1;
    color: #fff;
    background: currentColor;
    border-radius: 50%;
}
.alert .alert-badge span { color: #fff; }

/* --------------------------------------------------------------------------
   Breadcrumb + page content (show_page.html)
   -------------------------------------------------------------------------- */

.breadcrumb {
    padding: .55rem 0;
    font-size: .92rem;
    background: transparent;
}
.breadcrumb-item + .breadcrumb-item::before { color: var(--blue-600); }

.page-content { font-size: 1.05rem; line-height: 1.75; }
.page-content img { max-width: 100%; height: auto; }
/* Wide screens: cap running text at a readable measure while images, tables
   and iframes from the CMS still use the full width. */
.page-content > p,
.page-content > ul,
.page-content > ol,
.page-content > blockquote { max-width: 85ch; }
.page-content table,
.page-content iframe { max-width: 100%; }
.page-content table td,
.page-content table th { padding: .5rem .65rem; border: 1px solid var(--blue-100); }
.page-content h2,
.page-content h3 { margin-top: 1.5rem; }

.sidebar-sticky { top: 5.5rem; }
@media (min-width: 992px) {
    .sidebar-sticky { position: sticky; }
}

/* Sidebar heading keeps the orange accent, as in the original design */
.sidebar-title { background-image: linear-gradient(90deg, var(--accent) 0%, var(--accent-dark) 100%); box-shadow: 0 4px 14px rgba(255, 133, 27, .3); }

.subpage-list .list-group-item {
    border-right: 0;
    border-left: 0;
    transition: background-color .18s ease, padding-left .18s ease;
}
.subpage-list .list-group-item:hover {
    padding-left: 1.6rem;
    background-color: var(--blue-50);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
    padding: 2.5rem 0 1.5rem;
    color: rgba(255, 255, 255, .82);
    background-image: linear-gradient(180deg, #012a5e 0%, var(--blue-900) 100%);
}
.site-footer .footer-heading { background-image: none; background-color: rgba(255, 255, 255, .1); }
.site-footer a { color: rgba(255, 255, 255, .82); }
.site-footer a:hover,
.site-footer a:focus { color: #fff; text-decoration: none; }
.site-footer .footer-links > li { margin-bottom: .45rem; }
.site-footer .footer-divider { border-top-color: rgba(255, 255, 255, .18); }
.site-footer .footer-copy { color: rgba(255, 255, 255, .6); font-size: .9rem; }

/* --------------------------------------------------------------------------
   Back-to-top
   -------------------------------------------------------------------------- */

#scrollTop {
    position: fixed;
    right: 1rem;
    bottom: 1rem;
    z-index: 1030;
    display: none;
    width: 46px;
    height: 46px;
    color: #fff;
    font-size: 1.2rem;
    background: var(--blue-800);
    border: 0;
    border-radius: 50%;
    box-shadow: var(--shadow-md);
}
#scrollTop.show { display: flex; align-items: center; justify-content: center; }
#scrollTop:hover { background: var(--blue-700); }

/* --------------------------------------------------------------------------
   Utilities
   -------------------------------------------------------------------------- */

.bg-brand      { background-color: var(--blue-800); }
.text-brand    { color: var(--blue-800); }
.shadow-soft   { box-shadow: var(--shadow-sm); }
.rounded-xl    { border-radius: var(--radius); }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .card-modern:hover, .btn:hover { transform: none; }
    .blink-me { animation: none; }
}
