/* Global Styles */
:root {
    --bg-dark: #141516;
    /* Refidance Black */
    --text-color: #E8E6E3;
    /* Refidance Off-White */
    --text-muted: rgba(232, 230, 227, 0.7);

    --accent-blue: #3391FF;
    --accent-red-start: #8F3000;
    --accent-red-end: #940004;

    --card-bg: rgba(15, 16, 17, 0.6);
    --card-border: rgba(48, 52, 54, 0.5);
    /* Slightly more visible border */
    --card-shadow: 0px 8px 32px 0px rgba(0, 0, 0, 0.5);
    --card-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.2);

    --font-primary: 'Montserrat', sans-serif;

    --radius-btn: 50px;
    --radius-card: 16px;

    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);

    --navbar-bg: rgba(20, 21, 22, 0.85);
    /* Default Dark Navbar */
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-dark);
    /* Full page background image */
    background-image: url('../assets/bg_golden_hour.png');
    background-size: cover;
    background-attachment: fixed;
    background-position: center;
    background-repeat: no-repeat;

    color: var(--text-color);
    font-family: var(--font-primary);
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 24px;
    width: 100%;
    /* Ensure width is set */
}

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-primary);
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #fff;
}

/* Buttons */
/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 28px;
    /* Balanced sizing */
    border-radius: var(--radius-btn);
    font-weight: 600;
    font-size: 0.95rem;
    /* Matching balanced size */
    text-transform: capitalize;
    letter-spacing: 0px;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    gap: 10px;
}

.btn-primary {
    background: linear-gradient(90deg, #FF6B6B 0%, #FF8E53 100%);
    color: #fff;
    box-shadow: 0px 4px 15px 0px rgba(255, 107, 107, 0.4);
    font-size: 0.95rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0px 6px 20px 0px rgba(255, 107, 107, 0.6);
}

.btn-glass {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: #fff;
}

.btn-glass:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
}

.btn-accent {
    background-color: var(--accent-blue);
    color: #fff;
}

.btn-accent:hover {
    background-color: #2670cc;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: 80px;
    display: flex;
    align-items: center;
    z-index: 1000;
    background: var(--navbar-bg);
    /* Matches bg-dark with opacity */
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: border-bottom 0.3s;
}

.logo img {
    height: 32px;
    /* Balanced with compact button */
    width: auto;
}

.navbar .container {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.logo {
    font-family: var(--font-primary);
    font-size: 1.5rem;
    font-weight: 800;
    color: #fff;
    letter-spacing: -1px;
    text-transform: uppercase;
}

.logo .highlight {
    color: var(--accent-blue);
}

.navbar nav ul {
    display: flex;
    gap: 40px;
}

.navbar nav a {
    font-size: 1.02rem;
    /* 20% larger than 0.85rem */
    font-weight: 600;
    color: #fff;
    /* White color */
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.navbar nav a:hover,
.navbar nav a.active {
    color: #FF6B6B;
    /* Coral accent on hover */
}

/* Hide hamburger menu on desktop */
.mobile-menu-btn {
    display: none;
}

/* Blog Hero */
.blog-hero {
    position: relative;
    /* Force full viewport height */
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    /* Center content vertically */
    padding: 100px 0;
    /* Adjust padding since we use flex centering */

    /* Transparent background to let the body background show through */
    background: transparent;
    /* Hero is now just a container for content over the page background */
    min-height: 400px;
    height: auto;
    padding: 100px 0;
}

.blog-hero .hero-content {
    position: relative;
    z-index: 2;
    max-width: 900px;
}

.blog-hero .tag {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(51, 145, 255, 0.15);
    color: var(--accent-blue);
    border-radius: 30px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 24px;
    letter-spacing: 1px;
}

.blog-hero h1 {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
    /* Clean white, removed gradient text for better readability/premium feel on dark */
    color: #fff;
}

.blog-hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    margin-bottom: 40px;
    max-width: 650px;
    font-weight: 400;
}

.blog-hero .meta {
    display: flex;
    gap: 30px;
    margin-bottom: 40px;
    color: var(--text-muted);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.blog-hero .meta i {
    margin-right: 8px;
    color: var(--accent-blue);
}

/* Toolbar Styles */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 60px;
    flex-wrap: wrap;
    gap: 24px;

    /* Card Styling */
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    padding: 20px 24px;
    box-shadow: var(--card-shadow);

    /* Match logo-to-button width */
    width: calc(100% - 48px);
    margin-left: auto;
    margin-right: auto;
    box-sizing: border-box;
}

.search-bar {
    position: relative;
    width: 100%;
    max-width: 320px;
}

.search-bar input {
    width: 100%;
    padding: 14px 20px 14px 48px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-btn);
    color: #fff;
    outline: none;
    font-family: var(--font-primary);
    transition: var(--transition);
}

.search-bar input:focus {
    border-color: var(--accent-blue);
    background: rgba(255, 255, 255, 0.1);
}

.search-bar i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.categories {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 5px;
    scrollbar-width: none;
    /* Firefox */
}

.categories::-webkit-scrollbar {
    display: none;
}

/* Chrome/Safari */

.categories button {
    background: transparent;
    border: 1px solid var(--card-border);
    color: var(--text-muted);
    padding: 10px 24px;
    border-radius: var(--radius-btn);
    cursor: pointer;
    white-space: nowrap;
    font-family: var(--font-primary);
    font-weight: 600;
    transition: var(--transition);
    font-size: 0.9rem;
}

.categories button:hover,
.categories button.active {
    background: #fff;
    color: #000;
    border-color: #fff;
}

/* Content Grid */
.content-grid {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    gap: 40px;
    /* Reduced from 60px (approx 30%) */
    padding-bottom: 100px;
}

/* Article Cards */
.articles-list {
    display: grid;
    gap: 28px;
    /* Reduced from 40px (30%) */
}

.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    overflow: hidden;
    transition: var(--transition);
    box-shadow: var(--card-shadow);
    display: flex;
    flex-direction: column;
}

.card-image {
    height: 240px;
    background-size: cover;
    background-position: center;
    position: relative;
}

/* Desktop styles need to come AFTER base styles to override height */
@media (min-width: 768px) {
    .card {
        flex-direction: row;
        height: 300px;
        /* Increased from 260px */
        /* Slightly taller */
    }

    .card-image {
        width: 45%;
        height: 100%;
    }

    .card-content {
        width: 55%;
    }
}

/* Overlay on image for text readability if needed, or just stylistic */
.card-image::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to right, rgba(0, 0, 0, 0.4), transparent);
}

.category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: rgba(51, 145, 255, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    z-index: 2;
}

.card-content {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

@media (max-width: 768px) {
    .card-content {
        padding: 20px 20px 24px;
        /* Less padding on mobile to bring text closer to image */
    }
}

.card-content h3 {
    font-size: 1.6rem;
    margin-bottom: 12px;
    line-height: 1.2;
}

.card-content p {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 20px;
    flex-grow: 1;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 16px;
}

.read-more {
    color: var(--accent-blue);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    /* Reverted to smaller, stable size */
    letter-spacing: 0.5px;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 120px;
    height: fit-content;
}

.sidebar .widget {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-card);
    padding: 32px;
    margin-bottom: 30px;
    box-shadow: var(--card-shadow);
}

.sidebar h4 {
    font-size: 1.2rem;
    margin-bottom: 20px;
    border-left: 3px solid var(--accent-blue);
    /* Visual accent */
    padding-left: 12px;
}

/* Newsletter */
.newsletter-widget p {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.newsletter-widget input {
    width: 100%;
    padding: 14px;
    border-radius: 8px;
    /* Slightly squarer for inputs inside widgets? sticking to theme */
    border-radius: 12px;
    border: 1px solid var(--card-border);
    background: rgba(0, 0, 0, 0.2);
    color: #fff;
    margin-bottom: 12px;
    font-family: var(--font-primary);
}

.newsletter-widget button {
    width: 100%;
    background: var(--accent-blue);
    color: #fff;
}

.newsletter-widget button:hover {
    background: #1f77e0;
}

/* CTA Widget */
.cta-widget {
    background: linear-gradient(135deg, rgba(20, 21, 22, 0.95), rgba(40, 42, 44, 0.95));
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    position: relative;
    overflow: hidden;
}

/* Dynamic background for CTA */
.cta-widget::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(143, 48, 0, 0.15), transparent 60%);
    animation: rotate 20s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.cta-widget h3 {
    font-size: 1.8rem;
    margin-bottom: 8px;
    position: relative;
}

.cta-widget .stat {
    font-size: 1.1rem;
    color: var(--text-muted);
    margin-bottom: 24px;
    position: relative;
}

.cta-widget .stat span {
    color: #fff;
    /* White stats pop more */
    font-weight: 800;
    font-size: 1.5rem;
    display: block;
    margin-top: 5px;
}

.cta-widget .btn {
    width: 100%;
    position: relative;
}

.cta-widget .disclaimer {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 16px;
    position: relative;
    opacity: 0.6;
}

.popular-posts ul li {
    padding: 14px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.popular-posts ul li:last-child {
    border-bottom: none;
}

.popular-posts ul li a {
    color: var(--text-muted);
    font-size: 1rem;
    font-weight: 500;
    line-height: 1.4;
    display: block;
}

.popular-posts ul li a:hover {
    color: var(--accent-blue);
    transform: translateX(5px);
}

/* Footer */
footer {
    background: #050505;
    /* Even darker for footer */
    padding: 40px 0 20px;
    /* Reduced padding */
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-content,
.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1fr;
    gap: 40px;
    padding-top: 20px;
    padding-bottom: 40px;
    text-align: left;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 20px;
    text-align: center;
    color: #666;
    font-size: 0.85rem;
}

/* Article Page Styles */

/* Header adjustment for mobile */
.article-header {
    padding: 120px 0 60px;
    text-align: center;
    background-size: cover;
    background-position: center;
    position: relative;
}

@media (max-width: 768px) {
    .article-header {
        background-attachment: scroll;
        /* Fix for mobile parallax jitters */
        background-position: center center;
    }
}

.article-header h1 {
    font-size: 3rem;
    margin-bottom: 20px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.2;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    flex-wrap: wrap;
}

/* Article Content - Added background for readability */
.article-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px 24px;
    /* Default desktop padding */
    font-size: 1.1rem;
    line-height: 1.8;
    color: #e0e0e0;
    /* Background removed for desktop per request */
    background: transparent;
    position: relative;
    z-index: 2;
}

@media (max-width: 768px) {
    .article-content {
        padding: 40px 20px;
        background: rgba(20, 21, 22, 0.98);
        /* Dark background ONLY on mobile */
        box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.5);
    }
}

.footer-col h4 {
    color: #fff;
    font-size: 1.1rem;
    margin-bottom: 20px;
    font-weight: 600;
}

.footer-col a {
    display: block;
    color: var(--text-muted);
    margin-bottom: 12px;
    text-decoration: none;
    transition: var(--transition);
}

.footer-col a:hover {
    color: var(--accent-blue);
    padding-left: 5px;
}

.footer-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.footer-brand p {
    color: var(--text-muted);
    margin-top: 5px;
    font-size: 0.85rem;
}

.footer-links {
    display: flex;
    gap: 20px;
    /* Reduced gap */
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.footer-links a:hover {
    color: var(--accent-blue);
}

.social-links {
    display: flex;
    gap: 16px;
    /* Reduced gap */
}

.social-links a {
    color: var(--text-muted);
    font-size: 1.1rem;
    /* Smaller icon */
    background: rgba(255, 255, 255, 0.05);
    width: 36px;
    /* Smaller button */
    height: 36px;
    /* Smaller button */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition);
}

.social-links a:hover {
    color: #fff;
    background: var(--accent-blue);
    transform: translateY(-3px);
}

/* Responsiveness */
@media (max-width: 1024px) {
    .content-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .blog-hero h1 {
        font-size: 3rem;
    }

    .sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 20px;
    }

    /* Footer Mobile Stacking - Moved here for broader support */
    footer {
        padding: 40px 0;
        text-align: center;
    }

    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .footer-col {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-brand {
        align-items: center !important;
    }

    .footer-brand {
        align-items: center !important;
    }

    .footer-links {
        justify-content: center;
        gap: 15px;
        flex-direction: column;
    }

    .social-links {
        justify-content: center;
    }
}

@media (max-width: 768px) {

    /* Mobile Hamburger Menu */
    .mobile-menu-btn {
        display: flex;
        flex-direction: column;
        justify-content: space-around;
        width: 28px;
        height: 24px;
        background: transparent;
        border: none;
        cursor: pointer;
        padding: 0;
        z-index: 1010;
    }

    .mobile-menu-btn span {
        width: 100%;
        height: 3px;
        background: #fff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .mobile-menu-btn.active span:nth-child(1) {
        transform: rotate(45deg) translate(6px, 6px);
    }

    .mobile-menu-btn.active span:nth-child(2) {
        opacity: 0;
    }

    .mobile-menu-btn.active span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .navbar nav {
        display: none;
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        background: rgba(20, 21, 22, 0.98);
        backdrop-filter: blur(20px);
        padding: 20px;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    }

    .navbar nav.active {
        display: block;
    }

    .navbar nav ul {
        flex-direction: column;
        gap: 0;
    }

    .navbar nav ul li {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    }

    .navbar nav ul li:last-child {
        border-bottom: none;
    }

    .navbar nav a {
        display: block;
        padding: 16px 0;
        font-size: 1.1rem;
    }

    .navbar .btn-primary {
        display: none;
    }

    .sidebar {
        grid-template-columns: 1fr;
    }

    .card {
        flex-direction: column;
        height: auto;
    }

    .card-image {
        width: 100%;
        height: 220px;
    }

    .card-content {
        width: 100%;
        padding: 24px;
    }

    .blog-hero {
        min-height: 100vh;
        padding: 180px 0 100px;
        /* Increased top padding, pushed content down */
        display: flex;
        flex-direction: column;
        justify-content: flex-start;
        /* Align to top to enforce padding push */
        background-position: center !important;
        background-size: cover !important;
        text-align: center;
        position: relative;
        overflow: hidden;
    }

    /* Distinct Backgrounds for Mobile Redesign */
    .blog-hero.hero-news {
        background-image: url('../assets/news-market-analysis.png') !important;
    }

    .blog-hero.hero-blog {
        background-image: url('../assets/blog-hero.jpg') !important;
    }

    /* Gradient Overlay for Text Readability */
    .blog-hero::before {
        content: '';
        position: absolute;
        inset: 0;
        background: linear-gradient(to bottom,
                rgba(20, 21, 22, 0.5) 0%,
                rgba(20, 21, 22, 0.8) 60%,
                rgba(20, 21, 22, 0.95) 100%);
        z-index: 1;
    }

    .blog-hero h1 {
        font-size: 2.5rem;
        /* Increased from 2.2rem */
        line-height: 1.1;
        margin-bottom: 24px;
        text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
    }

    .blog-hero p {
        font-size: 1.1rem;
        line-height: 1.6;
        color: rgba(255, 255, 255, 0.95);
        text-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
    }



    .hero-content {
        margin: 0 auto;
    }

    .blog-hero .meta {
        justify-content: center;
        flex-wrap: wrap;
        font-size: 0.8rem;
    }

    /* Related Articles Grid - Mobile */
    .related-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .related-card {
        margin-bottom: 0;
    }

    /* Sub-nav adjustment for smaller navbar */
    .sub-nav-fixed {
        top: 60px;
    }

    /* Article content on mobile */
    .article-content {
        padding: 40px 16px !important;
    }

    .article-header h1 {
        font-size: 2rem !important;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 16px;
        width: 100%;
        max-width: 100vw;
        overflow-x: hidden;
    }

    .blog-hero h1 {
        font-size: 1.8rem;
        /* Smaller for mobile */
        word-wrap: break-word;
        /* Ensure long words break */
    }

    /* Transparent background for mobile hero too */
    .blog-hero {
        min-height: 60vh;
        /* Relax height constraint */
        height: auto;
        background: transparent;
        padding: 60px 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }

    .blog-hero p {
        font-size: 1rem;
    }

    /* General buttons on mobile */
    .btn {
        width: 100%;
        text-align: center;
        /* Full width buttons for content/hero */
        padding: 14px 24px;
        font-size: 1rem;
    }

    .navbar {
        height: 60px;
        /* Force smaller height */
    }

    /* Target the image directly and override inline styles */
    .logo img {
        height: 24px !important;
        width: auto !important;
    }

    .navbar .container {
        gap: 8px;
        /* Minimal gap */
        padding: 0 12px;
        /* Minimal container padding */
        justify-content: space-between;
        /* Ensure spreading */
    }

    .navbar .btn {
        width: auto !important;
        padding: 6px 12px !important;
        /* Smaller padding */
        font-size: 0.7rem !important;
        height: 32px;
        /* Fixed height */
        min-height: unset;
        white-space: nowrap;
    }

    /* Stack card content */
    .card {
        margin-bottom: 24px;
    }

    .sidebar .widget {
        padding: 20px;
    }

    .search-bar {
        max-width: 100%;
    }

    /* Footer styles moved to 768px media query */
    .social-links {
        justify-content: center;
    }

    /* Reset toolbar width on small screens */
    /* Reset toolbar width on small screens */
    .toolbar {
        width: 100%;
        max-width: 100%;
        /* Force max-width */
        padding: 20px;
        margin: 0 0 40px;
        border-radius: 0;
        /* Optional: remove radius if full width looks better */
    }
}

/* Extra small devices */
@media (max-width: 380px) {
    .navbar .container {
        padding: 0 8px;
    }

    .logo {
        font-size: 1.2rem;
    }
}

/* Scroll to Top Button */
.scroll-top-btn {
    position: fixed;
    bottom: 20px;
    /* Adjusted safe distance */
    right: 20px;
    width: 44px;
    /* Slightly smaller for mobile */
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(90deg, #FF6B6B 0%, #FF8E53 100%);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 999;
}

.scroll-top-btn.visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(255, 107, 107, 0.6);
}

/* Fixed Sub-Nav for Articles */
/* Fixed Sub-Nav for Articles */
.sub-nav-fixed {
    position: fixed;
    top: 80px;
    /* Below navbar */
    left: 0;
    width: 100%;
    background: #000;
    z-index: 990;
    padding: 6px 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sub-nav-fixed .container {
    padding: 0 24px;
    max-width: 1200px;
    margin: 0 auto;
}

@media (max-width: 1024px) {
    .sub-nav-fixed {
        top: 60px;
        /* Match mobile navbar height */
        height: 48px;
    }

    /* Ensure content spacer on mobile for fixed sub-nav */
    body:has(.sub-nav-fixed) .article-header {
        margin-top: 48px;
    }
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8rem;
    transition: color 0.3s ease;
}

.back-link i {
    font-size: 0.85rem;
}

.back-link:hover {
    color: #ccc;
}

/* Enhanced Calculator UI */
.calc-card {
    background: rgba(20, 22, 25, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.6), inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.input-group label {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    opacity: 0.8;
}

.range-slider {
    height: 6px;
    background: rgba(255, 255, 255, 0.05);
}

.range-slider::-webkit-slider-thumb {
    width: 24px;
    height: 24px;
    background: var(--accent-blue);
    box-shadow: 0 0 15px var(--accent-blue);
    border: 2px solid #fff;
    transition: transform 0.2s;
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.1);
}

/* Results Panel Gradient */
.results-panel {
    background: radial-gradient(circle at top right, rgba(46, 174, 255, 0.15), transparent 60%),
        radial-gradient(circle at bottom left, rgba(20, 22, 25, 1), rgba(30, 32, 35, 1));
    border: 1px solid rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
}

.result-value {
    color: var(--accent-blue);
    text-shadow: 0 0 30px rgba(46, 174, 255, 0.4);
}

.result-item {
    position: relative;
    z-index: 2;
}

/* Footer Fix for Calculator Page */
body>footer .container {
    max-width: 1200px;
    /* Ensure consistency with other pages */
}

/* Ensure main content doesn't push footer weirdly */
.calc-container {
    margin-bottom: 0;
    /* Let padding handle spacing */
    padding-bottom: 80px;
}

.calc-hero h1 {
    font-size: 3rem;
    margin-bottom: 20px;
}

.calc-container {
    max-width: 1000px;
    margin: -40px auto 80px;
    padding: 0 20px;
    position: relative;
    z-index: 2;
}

.calc-card {
    background: rgba(30, 32, 35, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
}

.input-group {
    margin-bottom: 30px;
}

.input-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 500;
    color: #ccc;
    font-size: 0.95rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 4px 16px;
}

.input-wrapper input {
    width: 100%;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.2rem;
    font-family: var(--font-primary);
    padding: 10px 0;
    outline: none;
}

.input-wrapper span {
    color: #888;
    margin-right: 8px;
}

/* Results Panel */
.results-panel {
    background: linear-gradient(135deg, rgba(255, 107, 107, 0.1), rgba(0, 0, 0, 0));
    border-radius: 16px;
    padding: 30px;
    border: 1px solid rgba(255, 107, 107, 0.2);
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.result-item {
    margin-bottom: 30px;
    text-align: center;
}

.result-item h3 {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #aaa;
    margin-bottom: 8px;
}

.result-value {
    font-size: 3rem;
    font-weight: 700;
    color: #FF6B6B;
    text-shadow: 0 0 20px rgba(255, 107, 107, 0.3);
}

.result-value.small {
    font-size: 1.8rem;
    color: #fff;
    text-shadow: none;
}

.result-sub {
    font-size: 0.9rem;
    color: #00cc7a;
    margin-top: 4px;
}

/* Range Slider */
.range-slider {
    width: 100%;
    margin-top: 10px;
    -webkit-appearance: none;
    height: 4px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 2px;
    outline: none;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    background: #fff;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

@media (max-width: 768px) {
    .calc-card {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 24px;
    }

    .calc-hero h1 {
        font-size: 2.2rem;
    }

    .result-value {
        font-size: 2.5rem;
    }
}