/* Root CSS Variables - Consolidated */
:root {
    /* Core palette */
    --Color-White: #ffffff;
    --Color-Primary: #005ca2; /* Brand primary */
    --Color-Primary-Dark: #012b73; /* Dark shade */
    --Color-Accent: #e6a82e; /* Gold */
    --Color-Accent-Soft: #f3c25f;
    --Color-Heading: #323232;
    --Color-Body: #323232;
    --Color-Muted: #532611bf;
    --Color-Border: #e3e3e3;
    --Color-Line: #dedede;
    --Color-FFF4E1: #fff4e1;
    /* Legacy aliases (keep for existing selectors) */
    --Color-291107: var(--Color-Primary);
    --Color-481F0D: var(--Color-Primary);
    --Color-E6A82E: var(--Color-Accent);
    --Color-944C2D: #944c2d;
    --Color-532611: #532611;
    --Color-532611BF: #532611bf;
    --Color-212121: #212121;
    --Color-323232: #323232;
    --Color-dedede: #dedede;
    --Color-000000: #000000;
    --Color-E3E3E3: #e3e3e3;
    --Color-4B2414: #4b2414;
    --Color-431E0D: #431e0d;
    --Color-012b73: #012b73;
    /* Typography */
    --FontFamily-primary: "Manrope", sans-serif;
    --FontFamily-secondary: "Montserrat", sans-serif;
    /* Motion & elevation */
    --Transition-2s: 0.2s all;
    --Transition-3s: 0.3s all;
    --BoxShadow-1: 0px 0px 42px #00000014;
    --BoxShadow-2: 0px 0px 42px #00000029;
    --BoxShadow-3: 0px -6px 32px #0000000d;
}

/* Complete hero slider fix */
.hero-section {
    height: 100vh !important;
    max-height: 100vh !important;
    overflow: hidden !important;
    position: relative;
}

.hero-slider-wrapper {
    width: 100% !important;
    height: 100vh !important;
    position: relative;
    overflow: hidden;
}

.hero-swiper {
    width: 100% !important;
    height: 100% !important;
}

.swiper-slide {
    position: relative;
    width: 100% !important;
    height: 100% !important;
    overflow: hidden;
}

.hero-slide-img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    object-position: center !important;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    transition: opacity 0.3s ease;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    opacity: 0;
}

/* Ensure first slide loads immediately */
.swiper-slide:first-child .hero-slide-img,
.hero-slide-img[data-loaded="true"] {
    opacity: 1;
}

/* Fallback for immediate display */
.hero-slide-img[src*="slide1"] {
    opacity: 1;
}

/* Image loading optimization */
.hero-slide-img[data-loading="lazy"] {
    filter: blur(5px);
    transition: filter 0.3s ease;
}

.hero-slide-img[data-loaded="true"] {
    filter: none;
}

/* Preload animation for images */
@keyframes imageLoad {
    from { opacity: 0; transform: scale(1.05); }
    to { opacity: 1; transform: scale(1); }
}

.hero-slide-img {
    animation: imageLoad 0.6s ease-out;
}

.hero-slide-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    background: linear-gradient(0deg, rgba(3,102,252,0.9) 0%, rgba(0,92,162,0.7) 50%, transparent 100%);
    color: #fff;
    padding: 2rem 1rem;
    text-align: center;
    backdrop-filter: blur(2px);
}

.hero-slide-content h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.hero-slide-content p {
    font-size: 1.1rem;
    color: #fff;
    margin-bottom: 1rem;
    text-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
/* Removed obsolete placeholder body background override */

/* Card layout fixes */
.mandate-card, .pub-type-card, .research-stat, .monitoring-stat, .activity-card, .facility-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
    padding: 2rem 1.5rem;
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.mandate-card:hover, .pub-type-card:hover, .research-stat:hover, .monitoring-stat:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.pub-type-card {
    min-height: 180px;
}

.pub-type-card h4, .pub-type-card h3 {
    margin: 0.5rem 0;
    font-weight: 600;
}

.pub-type-card p {
    margin: 0.5rem 0 0 0;
    font-size: 0.9rem;
    color: #666;
}

.research-stat, .monitoring-stat {
    min-height: 160px;
}

/* Center all grid rows */
.row.g-4.justify-content-center {
    display: flex;
    justify-content: center;
    align-items: stretch;
}

.row.g-4 > [class*="col-"] {
    display: flex;
    align-items: stretch;
}

header, .HeaderTop, .HeaderBottom, .HeaderMenu, .footer_area {
    background: #fff !important;
    color: #143642 !important;
    box-shadow: none !important;
}

/* Responsive image optimization */
@media (max-width: 768px) {
    .hero-slide-img {
        object-position: center center;
    }
    
    .hero-slide-content h1 {
        font-size: 2rem;
    }
    
    .hero-slide-content p {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-slide-content {
        padding: 1.5rem 0.8rem;
    }
    
    .hero-slide-content h1 {
        font-size: 1.8rem;
        margin-bottom: 0.8rem;
    }
}

/* High DPI display optimization */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .hero-slide-img {
        image-rendering: -webkit-optimize-contrast;
    }
}

/* Top blue bar */
.HeaderBottom.BG-black {
    background: var(--Color-Primary-Dark) !important;
    color: var(--Color-White) !important;
    font-size: 1.1rem;
    padding: 0.2rem 0 0.2rem 0;
    border-bottom: 1px solid var(--Color-Primary);
}
.HeaderBottom.BG-black .TopLink ul {
    margin-bottom: 0;
    padding-left: 0;
}
.HeaderBottom.BG-black .TopLink ul li {
    display: inline-block;
    margin-right: 0.7rem;
    margin-left: 0;
    color: #fff !important;
}
.HeaderBottom.BG-black .TopLink ul li a {
    color: var(--Color-White) !important;
    font-weight: 500;
    padding: 0 0.5rem;
    border-right: 1px solid rgba(255,255,255,0.25);
    text-decoration: none;
}
.HeaderBottom.BG-black .TopLink ul li:last-child a {
    border-right: none;
}

/* Logo and header area */
.HeaderTop {
    background: #fff !important;
    padding: 0.5rem 0 0.5rem 0;
    border-bottom: 1px solid #eaf6fa;
}
.LogoPartHeader img {
    max-height: 70px;
    width: auto;
    margin-right: 1rem;
}
.HeaderTop .col-lg-10, .HeaderTop .col-lg-2 {
    align-items: center;
    display: flex;
}
.HeaderTop .col-lg-2 {
    justify-content: flex-end;
}

/* Navigation bar (updated to variable palette) */
.HeaderMenu { background: var(--Color-Primary) !important; color: var(--Color-White) !important; padding: 0.35rem 0 0.35rem; border-bottom: 2px solid var(--Color-Primary-Dark); }
.HeaderMenu ul#nav {
    background: transparent !important;
    color: #fff !important;
    margin-bottom: 0;
    padding-left: 0;
}
.HeaderMenu ul#nav > li {
    display: inline-block;
    margin-right: 1.2rem;
    position: relative;
}
.HeaderMenu ul#nav > li > a {
    color: #fff !important;
    font-weight: 600;
    font-size: 1.1rem;
    padding: 0.7rem 0.2rem 0.5rem 0.2rem;
    border-bottom: 3px solid transparent;
    transition: border-bottom 0.2s, color 0.2s;
    text-decoration: none;
}
.HeaderMenu ul#nav > li > a.active,
.HeaderMenu ul#nav > li > a:hover {
    color: var(--Color-Accent) !important;
    border-bottom: 3px solid var(--Color-Accent);
}

/* Header utility (search + accessibility) */
.HeaderUtility { gap:10px; }
.HeaderUtility .SearchIcon, .HeaderUtility .AccessibilityIcon { width:38px; height:38px; }
.SearchBox { position:absolute; top:46px; right:0; background:var(--Color-White); padding:10px 12px; box-shadow:var(--BoxShadow-2); border-radius:6px; width:280px; }
.SearchBox form { display:flex; gap:6px; }
.SearchBox input.search { flex:1; border:1px solid var(--Color-Border); padding:6px 8px; font-size:0.85rem; border-radius:4px; }
.SearchBox input.submit { background:var(--Color-Primary); color:var(--Color-White); border:none; padding:6px 14px; font-size:0.8rem; border-radius:4px; cursor:pointer; }
.SearchBox input.submit:hover { background:var(--Color-Accent); color:var(--Color-Primary); }

.AccessibilityPopUP { position:absolute; top:46px; right:0; background:var(--Color-White); color:var(--Color-Heading); width:360px; max-width:92vw; padding:14px 16px 18px; box-shadow:var(--BoxShadow-2); border-radius:8px; z-index:999; }
.AccessibilityPopUP .Heading { font-size:1rem; color:var(--Color-Primary); }
.AccessibilityPopUP ul { list-style:none; margin:10px 0 0; padding:0; gap:12px; }
.AccessibilityPopUP ul li { width:50%; padding:4px; }
.fontScalerGrp { display:flex; flex-direction:column; align-items:center; gap:6px; }
.fontScalerGrp input { background:var(--Color-Primary); color:var(--Color-White); border:none; padding:4px 6px; font-size:0.7rem; line-height:1; border-radius:4px; cursor:pointer; }
.fontScalerGrp input.current, .fontScalerGrp input:hover { background:var(--Color-Accent); color:var(--Color-Primary); }
.fontScalerGrp span { font-size:0.65rem; text-transform:uppercase; letter-spacing:0.5px; color:var(--Color-Primary-Dark); }

[hidden] { display:none !important; }

/* Top bar spacing & separators */
.HeaderBottom.BG-black .TopLink ul { display:flex; flex-wrap:wrap; align-items:center; }
.HeaderBottom.BG-black .TopLink ul li { position:relative; padding-right:0.6rem; margin-right:0.4rem; line-height:1.25; }
.HeaderBottom.BG-black .TopLink ul li:last-child { margin-right:0; padding-right:0; }
.TopLink ul li a i { margin-right:4px; font-size:0.85rem; }
/* Boxicons base adjustments */
.TopLink ul li a i.bx { font-size:1rem; line-height:1; vertical-align:middle; }
.TopLink ul li a i.bx + span, .TopLink ul li a i.bx + strong { margin-left:2px; }
.HeaderBottom .TopLink ul li a .bx { margin-right:4px; }

/* Generic icon spacing */
a .bx, button .bx { line-height:1; }
button.SearchIcon .bx, button.AccessibilityIcon .bx { font-size:1.2rem; color:var(--Color-Primary); }
button.SearchIcon:hover .bx, button.AccessibilityIcon:hover .bx { color:var(--Color-Primary-Dark); }

/* Social links using Boxicons */
.social-link { display:flex; width:32px; height:32px; background:var(--Color-White); color:var(--Color-Primary); align-items:center; justify-content:center; border-radius:50%; font-size:1.1rem; transition:var(--Transition-2s); }
.social-link:hover { background:var(--Color-Accent); color:var(--Color-Primary-Dark); }
.HeaderBottom.BG-black .social-link { background:rgba(255,255,255,0.15); color:var(--Color-White); }
.HeaderBottom.BG-black .social-link:hover { background:var(--Color-Accent); color:var(--Color-Primary-Dark); }

/* Footer social override to keep consistent sizing */
.footer_area .social-link { width:36px; height:36px; background:var(--Color-Accent); color:var(--Color-Primary); }
.footer_area .social-link:hover { background:var(--Color-Primary); color:var(--Color-White); }
.HeaderMenu ul.dropdown-content {
    background: #fff !important;
    color: #143642 !important;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.08);
    min-width: 220px;
    padding: 0.5rem 0;
    position: absolute;
    z-index: 1000;
    display: none;
}
.HeaderMenu ul#nav > li:hover > ul.dropdown-content {
    display: block;
}
.HeaderMenu ul.dropdown-content li {
    display: block;
    margin: 0;
}
.HeaderMenu ul.dropdown-content li a {
    color: #143642 !important;
    font-weight: 500;
    padding: 0.5rem 1.2rem;
    display: block;
    border-bottom: 1px solid #eaf6fa;
    text-decoration: none;
}
.HeaderMenu ul.dropdown-content li:last-child a {
    border-bottom: none;
}
.HeaderMenu ul.dropdown-content li a:hover {
    background: #f6f9fc;
    color: #0366fc !important;
}

/* Search and accessibility icons */
.SearchIcon, .AccessibilityIcon {
    background: #054a91;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.5rem;
    margin-right: 0.5rem;
    border: none;
}
.SearchIcon img, .AccessibilityIcon img {
    width: 22px;
    height: 22px;
}

/* Header Styling from Reference Design */
header {
    z-index: 99;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    transition: var(--Transition-2s);
    background: var(--Color-481F0D);
}

.HeaderBottom {
    background-color: var(--Color-481F0D) !important;
    border-top: 1px solid var(--Color-291107);
}

.BG-black {
    background-color: var(--Color-012b73) !important;
}

.TopLink ul li a {
    color: var(--Color-White);
    font-size: 0.9375em;
    transition: var(--Transition-2s);
}

.TopLink ul li a:hover {
    color: var(--Color-E6A82E);
}

.HeaderMenu ul li a {
    color: var(--Color-White);
    font-weight: 600;
    padding: 15px 20px;
    transition: var(--Transition-2s);
}

.HeaderMenu ul li a:hover,
.HeaderMenu ul li a.active {
    color: var(--Color-E6A82E);
    background-color: rgba(230, 168, 46, 0.1);
}

.HeaderMenu ul li ul {
    background-color: var(--Color-FFF4E1);
    box-shadow: var(--BoxShadow-2);
    border-radius: 4px;
}

.HeaderMenu ul li ul li a {
    color: var(--Color-291107);
    padding: 10px 15px;
    border-bottom: 1px solid var(--Color-dedede);
}

.HeaderMenu ul li ul li a:hover {
    color: var(--Color-944C2D);
    background-color: rgba(230, 168, 46, 0.1);
}

.SearchIcon,
.AccessibilityIcon {
    background-color: var(--Color-White);
    border-radius: 50%;
    width: 25px;
    height: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--Transition-2s);
}

.SearchIcon:hover,
.AccessibilityIcon:hover {
    background-color: var(--Color-E6A82E);
}

/* Footer Styling from Reference Design */
footer, .footer_area {
    width: 100%;
    background-color: var(--Color-481F0D) !important;
    padding: 31px 0px;
    border-bottom: 10px solid var(--Color-E6A82E);
    margin-top: auto;
    color: var(--Color-White) !important;
}

/* ===== Timeline Light Theme Refinements ===== */
#timeline { background:#fafdff; position:relative; z-index:1; }
#timeline .timeline-cmc { margin: 20px auto 10px; }
#timeline .timeline__event { background:#ffffff; backdrop-filter: blur(2px); border:1px solid #e6f1f7; box-shadow:0 4px 18px rgba(0,0,0,0.05); }
#timeline .timeline__event:hover { box-shadow:0 6px 26px rgba(0,92,162,0.12); }
#timeline .timeline__event__icon { box-shadow:0 4px 14px rgba(0,0,0,0.12); border:3px solid #ffffff; }
#timeline .timeline__event--type1 .timeline__event__icon { background: linear-gradient(135deg, #0366fc 0%, #005ca2 100%); }
#timeline .timeline__event--type2 .timeline__event__icon { background: linear-gradient(135deg, #555ac0 0%, #7f53ac 100%); }
#timeline .timeline__event--type3 .timeline__event__icon { background: linear-gradient(135deg, #24b47e 0%, #43e97b 100%); }
#timeline .timeline__event__date { background:#eaf6fa; color:#005ca2; border:1px solid #d2e9f2; font-weight:600; letter-spacing:0.5px; }
#timeline .timeline__event__title { color:#005ca2; font-weight:700; letter-spacing:1px; }
#timeline .timeline__event--type2 .timeline__event__title { color:#555ac0; }
#timeline .timeline__event--type3 .timeline__event__title { color:#24b47e; }
#timeline .timeline__event__description { color:#425466; line-height:1.5; }
#timeline .timeline__event__content { background:#ffffff; }
@media (prefers-color-scheme: dark) {
    /* Keep timeline light even in dark mode for requested visualization */
    #timeline { background:#fafdff; }
    #timeline .timeline__event { background:#ffffff; border-color:#e6f1f7; }
    #timeline .timeline__event__date { background:#eaf6fa; color:#005ca2; border-color:#d2e9f2; }
    #timeline .timeline__event__title { color:#005ca2; }
    #timeline .timeline__event__description { color:#425466; }
}

/* Hard override safeguard (in case of later injected styles) */
#timeline .timeline__event, #timeline .timeline__event__content { background:#ffffff !important; }
#timeline .timeline__event__date { background:#eaf6fa !important; color:#005ca2 !important; }

footer a, .footer_area a {
    color: var(--Color-White) !important;
    text-decoration: none;
    transition: var(--Transition-2s);
    font-size: 0.9375em;
}

footer a:hover, .footer_area a:hover {
    color: var(--Color-E6A82E) !important;
    text-decoration: none;
}

.FooterLink li {
    border-right: 1px solid var(--Color-White);
    margin-right: 8px;
    padding-right: 8px;
    line-height: 1;
}

.FooterLink li:last-child {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
}

.SocialIcons ul { list-style:none; margin:0; padding:0; display:flex; flex-wrap:wrap; gap:10px; }
.SocialIcons li a { display:flex; width:36px; height:36px; background-color:var(--Color-Accent); justify-content:center; align-items:center; border-radius:50%; transition:var(--Transition-2s); color:var(--Color-Primary); font-size:0.9rem; }
.SocialIcons li a:hover { background-color:var(--Color-Primary); color:var(--Color-White); }

.Copyright, .Visitors {
    font-size: 0.9375em;
    color: var(--Color-White);
}

/* Button and Link Styling from Reference Design */
.Button, .btn-ocean {
    transition: var(--Transition-2s);
    position: relative;
    overflow: hidden;
    z-index: 1;
    border-radius: 4px;
    background-color: var(--Color-E6A82E);
    color: var(--Color-291107);
    font-weight: 700;
    padding: 13px 16px;
    line-height: 1;
    border: none;
    text-decoration: none;
    display: inline-block;
}

.Button:hover, .Button:focus, .btn-ocean:hover, .btn-ocean:focus {
    color: var(--Color-White) !important;
    background-color: var(--Color-291107);
    text-decoration: none;
}

.btn-outline-light {
    border: 2px solid var(--Color-White);
    color: var(--Color-White);
    background: transparent;
    font-weight: 600;
    padding: 11px 16px;
    transition: var(--Transition-2s);
}

.btn-outline-light:hover {
    background-color: var(--Color-White);
    color: var(--Color-291107);
    border-color: var(--Color-White);
}

.cta-link {
    position: relative;
    color: var(--Color-944C2D);
    font-weight: 600;
    text-decoration: none;
    transition: var(--Transition-2s);
}

.cta-link:hover {
    color: var(--Color-291107);
}

.cta-link:after {
    content: "\f061";
    font-family: "FontAwesome";
    margin-left: 7px;
    vertical-align: middle;
    position: relative;
    z-index: 1;
}

/* General link styling */
a {
    color: var(--Color-944C2D);
    display: inline-block;
    text-decoration: none;
    transition: var(--Transition-2s);
    line-height: 1.2;
}

a:hover, a:focus {
    color: var(--Color-E6A82E);
}

/* Typography and Section Styling from Reference Design */
body {
    background: var(--Color-White);
    color: var(--Color-Body);
    font-family: var(--FontFamily-primary);
    font-size: 100%;
    font-weight: 500;
    line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--Color-323232);
    font-weight: 600;
    margin-bottom: 15px;
    font-family: var(--FontFamily-secondary);
}

h1 {
    font-size: 4em;
    line-height: 1.1;
    font-weight: 700;
    color: var(--Color-White);
}

h2 {
    font-size: 3.125em;
    line-height: 1.3;
    font-weight: 700;
    color: var(--Color-White);
}

h3 {
    font-size: 2.5em;
    line-height: 1.2;
    font-weight: 600;
    color: var(--Color-323232);
}

h4 {
    font-size: 2em;
    line-height: 1.2;
    font-weight: 600;
    color: var(--Color-323232);
}

/* Section backgrounds */
.BG-FFF4E1, .section-bg-light {
    background-color: var(--Color-FFF4E1) !important;
}

.BG-White {
    background-color: var(--Color-White) !important;
}

.section-padding {
    padding: 80px 0px;
    width: 100%;
}

/* Card styling */
.ShadowBox {
    box-shadow: var(--BoxShadow-1);
    background-color: var(--Color-White);
    padding: 30px;
    border-radius: 20px;
}

/* Ocean theme colors */
.text-ocean-light {
    color: rgba(255, 255, 255, 0.8) !important;
}

.bg-ocean {
    background-color: var(--Color-291107) !important;
}

/* Stat cards styling */
.stat-card {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

@media (max-width: 991px) {
    .HeaderMenu ul#nav > li {
        display: block;
        margin-right: 0;
    }
    .HeaderMenu ul#nav {
        padding-left: 0.5rem;
    }
    .HeaderTop, .HeaderBottom.BG-black {
        padding: 0.3rem 0;
    }
}
