:root {
    /* Color Palette - Metallic Blue & Silver */
    --color-primary: #1b3a57;
    /* Deep Metallic Blue */
    --color-primary-light: #3a6ea5;
    /* Steel Blue */
    --color-secondary: #f0f2f5;
    /* Silver/Light Gray */
    --color-accent: #a0a0a0;
    /* Silver Accent */

    /* Gradients */
    --gradient-brand: linear-gradient(135deg, #0f2027 0%, #203a43 50%, #2c5364 100%);
    /* Metallic Dark Blue */
    --gradient-hover: linear-gradient(135deg, #141e30 0%, #243b55 100%);
    --gradient-light: linear-gradient(to right, #ece9e6, #ffffff);

    /* Text Colors */
    --color-text-dark: #1a1a1a;
    --color-text-light: #ffffff;
    --color-text-muted: #666666;

    /* Typography */
    /* Using Outfit/Inter as proxies for Euclid Circular B */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    /* 8px */
    --spacing-sm: 1rem;
    /* 16px */
    --spacing-md: 2rem;
    /* 32px */
    --spacing-lg: 4rem;
    /* 64px */
    --spacing-xl: 8rem;
    /* 128px */

    /* Layout */
    --container-width: 1440px;
    --header-height: 90px;
    --border-radius-pill: 50px;
    --border-radius-card: 16px;

    /* Transitions */
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html,
body {
    font-family: var(--font-body);
    background-color: var(--color-secondary);
    color: var(--color-text-dark);
    line-height: 1.7;
    /* Airy line height */
    overflow-x: hidden !important;
    width: 100%;
    max-width: 100%;
    position: relative;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-primary);
    /* Default to deep blue unless overridden */
    line-height: 1.1;
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

h1 {
    font-size: 3.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 3rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 2rem;
}

p {
    margin-bottom: var(--spacing-sm);
    color: var(--color-text-dark);

}

.lead {
    font-size: 1.25rem;
    color: var(--color-text-muted);
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-fast);
}

ul {
    list-style: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--spacing-md);
}

.text-white {
    color: var(--color-text-light) !important;
}

.text-center {
    text-align: center;
}

/* Buttons - Pill Shaped */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    border-radius: var(--border-radius-pill);
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    border: 2px solid transparent;
    transition: var(--transition-smooth);
    text-transform: none;
    /* Modern style, not uppercase */
}

.btn-primary {
    background: var(--gradient-brand);
    color: var(--color-text-light);
    box-shadow: 0 4px 15px rgba(0, 40, 120, 0.3);
}

.btn-primary:hover {
    background: var(--gradient-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 40, 120, 0.4);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-outline:hover {
    background-color: var(--color-primary);
    color: var(--color-text-light);
}

.btn-arrow::after {
    content: "→";
    margin-left: 8px;
    transition: margin-left 0.2s;
}

.btn-arrow:hover::after {
    margin-left: 12px;
}

/* Header */
header {
    background-color: transparent;
    height: var(--header-height);
    position: absolute;
    width: 100%;
    top: 0;
    z-index: 1000;
    transition: background-color 0.3s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

/* Add a class via JS for scrolled state if needed later */
header.scrolled {
    background-color: var(--color-primary);
    position: fixed;
    border-bottom: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    color: var(--color-text-light);
    font-size: 1.8rem;
    font-weight: 700;
    font-family: var(--font-heading);
    letter-spacing: -0.03em;
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo img {
    height: 45px;
}

.nav-links {
    display: flex;
    gap: var(--spacing-md);
}

.nav-links a {
    color: var(--color-text-light);
    font-size: 1rem;
    font-weight: 500;
    position: relative;
    opacity: 0.9;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--color-secondary);
    transition: width 0.3s;
}

.nav-links a:hover {
    opacity: 1;
}

.nav-links a:hover::after {
    width: 100%;
}

/* Mobile Menu Trigger (Hidden on Desktop) */
.menu-trigger {
    display: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

/* Hero Section */
.hero {
    height: 90vh;
    min-height: 700px;
    background: linear-gradient(rgba(0, 32, 91, 0.6), rgba(0, 32, 91, 0.4)), url('../images/hero_bg.png') no-repeat center center/cover;
    display: flex;
    align-items: center;
    position: relative;
    clip-path: polygon(0 0, 100% 0, 100% 90%, 0 100%);
    /* Slight angle at bottom */
}

.hero-inner {
    height: 45vh !important;
    /* Force override of default hero height */
    min-height: 350px;
    /* Reduced min-height for inner pages */
    align-items: flex-end;
    /* Align text to bottom of hero area or center with padding */
    padding-bottom: var(--spacing-md);
    /* Add space at bottom */
    padding-top: 150px;
    /* Push content down from header */
}

.hero-content {
    color: var(--color-text-light);
    max-width: 900px;
    margin-left: 0;
    /* Align left */
    padding-left: var(--spacing-md);
}

.hero-content h1 {
    color: var(--color-text-light);
    font-size: 4.5rem;
    line-height: 1.1;
    margin-bottom: var(--spacing-md);
}

.hero-content p {
    font-size: 1.5rem;
    color: rgba(255, 255, 255, 0.9);
    max-width: 650px;
    margin-bottom: var(--spacing-lg);
    font-weight: 300;
}

/* Sections General */
section {
    padding: var(--spacing-xl) 0;
}

.section-title {
    margin-bottom: var(--spacing-lg);
}

.section-title p.subtitle {
    color: var(--color-primary-light);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.9rem;
    margin-bottom: var(--spacing-xs);
}

/* Asymmetric Layout (Image + Content) */
.module {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-lg);
    align-items: center;
    margin-bottom: var(--spacing-xl);
}

.module.reversed {
    direction: rtl;
    /* Simple way to swap, ensure text direction is reset inside */
}

.module.reversed>* {
    direction: ltr;
}

.module-img {
    border-radius: var(--border-radius-card);
    overflow: hidden;
    height: 100%;
    min-height: 400px;
}

.module-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.module-img:hover img {
    transform: scale(1.05);
}

.module-img.no-zoom:hover img {
    transform: none;
}

.module-content {
    padding: var(--spacing-md);
}

/* Stats / Highlights */
.bg-light {
    background-color: #f4f7fa;
}

/* Footer - Gradient */
footer {
    background: var(--gradient-brand);
    color: var(--color-text-light);
    padding: var(--spacing-lg) 0 var(--spacing-lg);
}

.footer-top {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-lg);
    padding-bottom: var(--spacing-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand h2 {
    color: white;
    font-size: 2rem;
    margin-bottom: var(--spacing-sm);
}

.footer-brand p {
    color: rgba(255, 255, 255, 0.85);
    /* Lighter/Brighter */
    font-weight: 300;
    margin-top: 10px;
}

.footer-brand img {
    width: 250px;
    /* Matching approx width of "ELPIS CAPITAL" heading */
    display: block;
    margin-top: 15px;
}

.footer-col h4 {
    color: rgba(255, 255, 255, 0.7);
    /* Slightly brighter */
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: var(--spacing-sm);
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col a {
    font-size: 1.1rem;
    font-weight: 500;
}

.footer-col a:hover {
    color: white;
    text-decoration: underline;
}

.footer-bottom {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.85);
    /* Lighter/Brighter */
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--spacing-xl);
}

.contact-card {
    background: white;
    padding: 40px;
    border-radius: var(--border-radius-card);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.05);
}


/* News Grid */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-xl);
}

.news-card {
    background: #fff;
    border-radius: var(--border-radius-card);
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.news-img-frame {
    height: 220px;
    width: 100%;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.news-img-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-img-frame img {
    transform: scale(1.05);
}

.news-content {
    padding: 25px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.news-date {
    font-size: 0.85rem;
    color: var(--color-primary-light);
    margin-bottom: 10px;
    font-weight: 600;
}

.news-content h3 {
    font-size: 1.25rem;
    margin-bottom: 15px;
    line-height: 1.3;
    color: var(--color-text-dark);
}

.news-content p {
    font-size: 0.95rem;
    color: var(--color-text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Responsive */
@media (max-width: 992px) {
    h1 {
        font-size: 3.5rem;
    }

    .module {
        grid-template-columns: 1fr;
        gap: var(--spacing-md);
    }

    .module.reversed {
        direction: ltr;
    }

    .hero {
        height: auto;
        padding: 180px 0 100px;
    }

    .footer-top {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: fixed;
        top: var(--header-height);
        left: 0;
        right: 0;
        width: auto;
        background-color: var(--color-primary);
        flex-direction: column;
        padding: var(--spacing-md);
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
        max-height: calc(100vh - var(--header-height));
        overflow-y: auto;
    }

    * {
        max-width: 100vw;
        box-sizing: border-box;
        min-width: 0;
        /* Allow flex items to shrink below content size */
    }



    .nav-links.active {
        display: flex;
    }

    .nav-links a {
        font-size: 1.2rem;
        padding: 10px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        width: 100%;
        text-align: center;
    }

    /* Mobile menu implementation needed later */
    .menu-trigger {
        display: block;
    }

    h1 {
        font-size: 2.1rem;
        line-height: 1.2;
        overflow-wrap: break-word;
        word-wrap: break-word;
        -ms-word-break: break-all;
        word-break: break-word;
        hyphens: auto;
    }

    h2 {
        font-size: 1.75rem;
        line-height: 1.2;
        overflow-wrap: break-word;
        word-wrap: break-word;
        word-break: break-word;
    }

    .hero-content {
        padding-left: var(--spacing-sm);
    }

    .container {
        padding: 0 0.5rem;
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .footer-top {
        grid-template-columns: 1fr;
    }

    .footer-bottom {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    /* Override inline styles for images on mobile to use full width */
    .module-img {
        width: 100% !important;
        min-width: 0 !important;
        min-height: 0 !important;
        height: auto !important;
        display: block;
        overflow: visible !important;
        /* Disable clipping */
    }

    .module-img img {
        width: 100% !important;
        height: auto !important;
        min-height: 0 !important;
        max-height: none !important;
        /* Ensure no constraint */
        object-fit: contain !important;
    }

    /* Specific adjustment for Home Page Hero Banner - REDUCED SIZE */
    .hero-content h1 {
        font-size: 2.2rem;
        /* Reduced from 2.8rem to fix spacing */
        line-height: 1.2;
    }

    .contact-grid {
        gap: var(--spacing-md);
    }

    .contact-card {
        padding: 20px;
    }
}

@media (max-width: 768px) {

    .news-grid {
        grid-template-columns: 1fr;
        gap: 40px;
        /* Increased gap between cards */
    }

}

/* Clean View Utility - For Inline Articles */
body.clean-view {
    overflow: auto !important;
}

body.clean-view header,
body.clean-view .hero,
body.clean-view footer,
body.clean-view #news-grid-view {
    display: none !important;
}

body.clean-view section {
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    margin-top: 0 !important;
}

body.clean-view .container {
    padding-top: 0 !important;
    margin-top: 0 !important;
}

body.clean-view #news-article-view {
    display: block !important;
    padding-top: 20px !important;
    /* Minimal spacing from top of viewport */
    max-width: 800px;
    margin: 0 auto;
}

/* Hide images inside the clean view as requested */
body.clean-view #news-article-view img {
    display: none !important;
}

/* Remove internal module padding if needed */
body.clean-view .module-content {
    padding-top: 0 !important;
}

body.clean-view .section-title {
    margin-bottom: 20px !important;
}

/* Ensure wrapper padding is gone */
body.clean-view div[style*="padding: 40px"] {
    padding: 0 !important;
}

/* Clean View Utility - FULL SCREEN OVERLAY (NUCLEAR OPTION) */
body.clean-view {
    overflow: hidden;
    /* Prevent background scrolling */
}

body.clean-view header,
body.clean-view .hero,
body.clean-view footer,
body.clean-view #news-grid-view {
    display: none !important;
}

body.clean-view #news-article-view {
    display: block !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 9999 !important;
    background-color: #ffffff !important;
    padding: 20px !important;
    overflow-y: auto !important;
    /* Allow article itself to scroll */
    margin: 0 !important;
}

/* Internal adjustments for the overlay */
body.clean-view .module-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 !important;
}

body.clean-view #news-article-view img {
    display: none !important;
}

/* =========================================
   Finance Page Styles (Moved from internal)
   ========================================= */
.finance-grid {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 60px;
    align-items: start;
}

.finance-list {
    display: flex;
    flex-direction: column;
    gap: 50px;
}

.finance-item h2 {
    font-size: 2rem;
    margin-bottom: 15px;
    color: var(--color-primary);
}

/* Legal Pages - Fine Print Style */
.legal-content {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--color-text-dark);
}

.legal-content h3 {
    font-size: 1.25rem;
    margin-top: 2rem !important;
    margin-bottom: 0.75rem;
}

.legal-content p, 
.legal-content ul, 
.legal-content li {
    margin-bottom: 0.75rem;
}

.legal-content ul {
    margin-left: 20px;
    list-style-type: disc;
}

/* Ensure readability on smaller screens */
@media (max-width: 768px) {
    .legal-content {
        font-size: 0.95rem; /* Slightly larger on mobile for readability */
    }
}

.finance-item .subtitle {
    text-transform: uppercase;
    letter-spacing: 2px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-primary-light);
    margin-bottom: 5px;
    display: block;
}

.finance-image-col {
    position: sticky;
    top: 120px;
}

.finance-image-col img {
    width: 100%;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

@media (max-width: 992px) {
    .finance-grid {
        grid-template-columns: 1fr;
    }

    .finance-image-col {
        position: static;
        order: -1;
        margin-bottom: 40px;
    }
}

/* =========================================
   Mobile Optimization (Portrait & Landscape)
   ========================================= */
@media (max-width: 480px) {

    /* Finer typography control for small screens */
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    .section-title p.subtitle {
        font-size: 0.8rem;
    }

    /* Ensure container padding is sufficient but not wasteful */
    .container {
        padding: 0 15px;
    }

    /* Stack buttons on very small screens if needed */
    .btn {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Landscape Mode Tweak for Mobile */
@media (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        /* Ensure full cover */
        padding-top: 80px;
    }

    .nav-links {
        max-height: 80vh;
        overflow-y: auto;
    }
}

/* =========================================
   NUCLEAR OPTION - Force Mobile Layout Fixes
   ========================================= */
@media (max-width: 992px) {

    /* FIX 1: Overlapping Headings */
    .hero,
    .hero.hero-inner,
    section.hero {
        padding-top: 200px !important;
        /* Increased to 200px to be absolutely sure */
        height: auto !important;
        min-height: auto !important;
    }
}

@media (max-width: 768px) {

    /* FIX 2: Home Page Font Size */
    h1,
    .hero-content h1,
    .hero h1 {
        font-size: 2.0rem !important;
        line-height: 1.2 !important;
        margin-bottom: 20px !important;
        margin-top: 0 !important;
    }

    /* FIX 3: News Grid Spacing */
    .news-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 60px !important;
        /* Huge gap to force separation */
    }

    .news-card {
        margin-bottom: 0 !important;
    }

    /* Ensure no weird negative margins */
    .module,
    .module-content,
    .container {
        margin-top: 0 !important;
    }
}