/*
Theme Name: Finance Hub
Theme URI: https://FiniPot.com
Author: Automation
Description: A premium custom finance and news theme with a light, brand aesthetic.
Version: 1.2
*/

:root {
    /* Brand Colors - FiniPot Premium */
    --brand-primary: #0284c7;
    /* Vibrant Blue */
    --brand-dark: #0c4a6e;
    /* Deep Navy */
    --brand-light: #e0f2fe;
    /* Soft Sky Blue */
    --bg-main: #f8fafc;
    --bg-card: #ffffff;

    /* Text */
    --text-primary: #0f172a;
    /* Slate 900 */
    --text-muted: #475569;
    /* Slate 600 */
    --text-on-brand: #ffffff;

    --radius-lg: 16px;
    --radius-md: 12px;

    /* Semantic Mappings */
    --text-main: var(--text-primary);
    --accent: var(--brand-primary);
    --border: #e2e8f0;
    --border-light: #f1f5f9;
    --shadow-soft: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    --shadow-premium: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
}

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

body {
    background-color: var(--bg-main);
    color: var(--text-primary);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    line-height: 1.6;
}

a {
    color: var(--brand-primary);
    text-decoration: none;
    transition: all 0.2s ease;
}

a:hover {
    color: var(--brand-dark);
}

/* --- IPO Specialist Styles --- */
.ipo-details-box {
    background: #f8fafc;
    border: 2px solid #3b82f6;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.ipo-details-box h2 {
    color: #1e3a8a;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 0.5rem;
}

.ipo-details-box table td {
    padding: 10px;
}

.ipo-details-box table tr:last-child {
    border-bottom: none;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
}

th,
td {
    border: 1px solid #e2e8f0;
    padding: 12px;
    text-align: left;
}

th {
    background: #f1f5f9;
    font-weight: 700;
}

@media (max-width: 600px) {
    .ipo-details-box {
        padding: 1rem;
    }

    th,
    td {
        padding: 8px;
        font-size: 0.9rem;
    }
}

img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
}

/* Header & Navigation */
.site-header {
    background-color: #fff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* for mobile */
}

.site-title {
    font-family: 'Outfit', sans-serif;
    font-size: 1.85rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -1px;
}

/* Custom Logo Styling */
.site-branding .custom-logo-link {
    display: inline-block;
    vertical-align: middle;
}

.site-branding .custom-logo {
    max-height: 40px;
    width: auto;
    display: block;
    object-fit: contain;
    border-radius: 0;
}

@media (max-width: 768px) {
    .site-branding .custom-logo {
        max-height: 32px;
    }
    .header-inner {
        padding: 0.75rem 1rem;
    }
}

.site-title span {
    color: var(--brand-primary);
}

/* Mobile & Desktop Menu Styling */
.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
    margin: 0;
    padding: 0;
}

.main-navigation li {
    position: relative;
}

/* Dropdown logic */
.main-navigation ul ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-card);
    min-width: 200px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    border-radius: 8px;
    flex-direction: column;
    gap: 0;
    z-index: 200;
}

.main-navigation li:hover>ul {
    display: flex;
}

.main-navigation ul ul li {
    border-bottom: 1px solid var(--border);
}

.main-navigation ul ul li:last-child {
    border-bottom: none;
}

.main-navigation ul ul a {
    padding: 0.75rem 1rem;
    display: block;
}

.main-navigation a {
    color: var(--text-main);
    font-weight: 600;
    font-size: 0.95rem;
}

.main-navigation a:hover,
.main-navigation .current-menu-item>a {
    color: var(--accent);
}

@media (max-width: 768px) {
    .header-inner {
        flex-direction: column;
        gap: 1rem;
    }

    .main-navigation ul {
        flex-wrap: wrap;
        justify-content: center;
        gap: 1rem;
    }
}

/* TradingView Ticker Strip */
.tv-ticker-strip {
    background: #ffffff;
    border-bottom: 1px solid var(--border);
    height: 40px;
    overflow: hidden;
}

/* Main Layout */
.site-content {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1rem;
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
}

@media (max-width: 900px) {
    .site-content {
        grid-template-columns: 1fr;
    }
}

/* Post Grid - Impressive News Form */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.post-card {
    background: var(--bg-card);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-lg);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-soft);
}

.post-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-premium);
    border-color: var(--brand-primary);
}

.post-thumbnail img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    border-bottom: 1px solid var(--border-light);
}

.post-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.post-category {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--accent);
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: inline-block;
    background: var(--bg-main);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

.post-title {
    font-size: 1.25rem;
    line-height: 1.4;
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.post-title a {
    color: var(--text-main);
}

.post-title a:hover {
    color: var(--accent);
}

.post-excerpt {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.read-more-btn {
    display: inline-block;
    margin-top: 1rem;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
}

.read-more-btn:after {
    content: ' →';
}

/* Sidebar Widgets */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.widget {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--bg-main);
    color: var(--text-main);
}

/* Single Post Enhancements */
.single-post .entry-content p {
    margin-bottom: 1.5rem;
}

.single-post .entry-content h2,
.single-post .entry-content h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.nav-links {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
}

.nav-previous,
.nav-next {
    flex: 1;
}

.nav-subtitle {
    display: block;
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--text-muted);
}

.nav-title {
    font-weight: 700;
}

/* Footer */
.site-footer {
    background: var(--bg-card);
    border-top: 1px solid var(--border);
    padding: 3rem 1rem;
    text-align: center;
    color: var(--text-muted);
    margin-top: 4rem;
}

.footer-links {
    margin-bottom: 1rem;
    display: flex;
    justify-content: center;
    gap: 1.5rem;
}

.footer-links a {
    color: var(--text-main);
    font-weight: 500;
}

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

/* --- IPO GMP Table Premium Styles --- */
.ipo-gmp-wrapper {
    margin: 2rem 0;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    border: 1px solid #eef2f6;
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.ipo-gmp-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Inter', sans-serif;
    font-size: 0.95rem;
}

.ipo-gmp-table th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    padding: 1.25rem 1rem;
    text-align: left;
    border-bottom: 2px solid #eef2f6;
    white-space: nowrap;
}

.ipo-gmp-table td {
    padding: 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #1e293b;
}

.ipo-gmp-table tr:last-child td {
    border-bottom: none;
}

.ipo-gmp-table tr:hover {
    background-color: #f8fafc;
}

.ipo-name-cell a {
    color: #0284c7;
    text-decoration: none;
    transition: color 0.2s;
}

.ipo-name-cell a:hover {
    color: #0369a1;
    text-decoration: underline;
}

/* --- Category Specific Body Structure --- */
.ipo-quick-info {
    transition: transform 0.3s ease;
}

.ipo-quick-info:hover {
    transform: scale(1.01);
}

.ipo-quick-info small {
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
}

.ipo-quick-info strong {
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.5px;
}

.gmp-badge {
    display: inline-block;
    padding: 0.4rem 0.8rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.85rem;
    text-align: center;
    min-width: 80px;
}

.gmp-positive {
    background: #dcfce7;
    color: #166534;
    border: 1px solid #bbf7d0;
}

.gmp-negative {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.gmp-neutral {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #e2e8f0;
}

.gmp-no-posts {
    padding: 3rem;
    text-align: center;
    background: #f8fafc;
    border-radius: 12px;
    color: #64748b;
    border: 2px dashed #e2e8f0;
    font-size: 1.1rem;
}

@media (max-width: 768px) {

    .ipo-gmp-table th,
    .ipo-gmp-table td {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
}

/* --- Finance Calculator Styles --- */
.finance-calc-card {
    background: #fff;
    border-radius: 20px;
    padding: 2.5rem;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    border: 1px solid #eef2f6;
    max-width: 600px;
    margin: 2rem auto;
    font-family: 'Inter', sans-serif;
}

.finance-calc-card h3 {
    margin-top: 0;
    margin-bottom: 2rem;
    color: #1e293b;
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
}

.calc-inputs {
    margin-bottom: 2.5rem;
}

.input-group {
    margin-bottom: 1.5rem;
}

.input-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: #475569;
    margin-bottom: 0.75rem;
}

.input-group input[type="range"] {
    width: 100%;
    margin-bottom: 10px;
    cursor: pointer;
}

.input-group input[type="number"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    color: #0284c7;
    background: #f8fafc;
}

.calc-results {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 12px;
    border: 1px solid #eef2f6;
}

.res-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 0.95rem;
}

.res-item span {
    color: #64748b;
}

.res-item strong {
    color: #1e293b;
    font-weight: 700;
}

.res-item.total {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.res-item.total span {
    color: #1e293b;
    font-weight: 700;
}

.res-item.total strong {
    color: #0284c7;
    font-size: 1.25rem;
}

/* --- Finance Tools Hub Styles --- */
.finance-tools-grid {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    max-width: 600px;
    margin: 2rem auto;
}

.finance-tool-card-link {
    text-decoration: none !important;
}

.finance-tool-card {
    background: #fff;
    border: 1px solid #eef2f6;
    border-radius: 16px;
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
}

.finance-tool-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #0284c7;
}

.tool-icon {
    font-size: 1.75rem;
    margin-right: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tool-info {
    flex-grow: 1;
}

.tool-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 600;
    color: #0284c7;
}

.tool-arrow {
    color: #cbd5e1;
    font-size: 1.5rem;
    font-weight: 300;
    transition: transform 0.3s ease;
}

.finance-tool-card:hover .tool-arrow {
    transform: translateX(5px);
    color: #0284c7;
}

@media (max-width: 600px) {
    .finance-tool-card {
        padding: 1rem 1.25rem;
    }

    .tool-icon {
        font-size: 1.5rem;
        margin-right: 1rem;
    }

    .tool-title {
        font-size: 1.05rem;
    }
}

/* --- Sidebar Finance Tools Styling --- */
.sidebar .widget_finance_tools {
    background-color: #f8fafc;
    border-radius: 20px;
    padding: 1.5rem;
    border: 1px solid #eef2f6;
    margin-bottom: 2rem;
}

.sidebar .widget_finance_tools .widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 1.25rem;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.sidebar .finance-tools-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar .finance-tools-list li {
    margin-bottom: 0.75rem;
}

.sidebar .finance-tools-list li:last-child {
    margin-bottom: 0;
}

.sidebar .finance-tools-list a {
    display: flex;
    align-items: center;
    padding: 0.85rem 1rem;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #eef2f6;
    color: #0284c7;
    font-weight: 500;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    text-decoration: none !important;
}

.sidebar .finance-tools-list a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border-color: #0284c7;
}

.sidebar .finance-tools-list .tool-icon-small {
    font-size: 1.25rem;
    margin-right: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- IPO Pagination --- */
.ipo-pagination {
    margin-top: 2rem;
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.ipo-pagination .page-numbers {
    padding: 0.6rem 1.1rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    color: #475569;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.2s ease;
}

.ipo-pagination .page-numbers.current {
    background: #0284c7;
    color: #ffffff;
    border-color: #0284c7;
}

.ipo-pagination .page-numbers:hover:not(.current) {
    background: #f1f5f9;
    border-color: #cbd5e1;
    color: #0284c7;
}

/* --- FAQ Section --- */
/* FAQ Section */
.finance-faq-section {
    background: #ffffff;
    padding: 2rem;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
    margin-bottom: 3rem;
}

/* --- Refined Market Switcher --- */
.market-switcher select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23475569'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
    padding-right: 2.5rem !important;
}

@media (max-width: 768px) {
    .hero-content h1 {
        font-size: 2.5rem;
    }

    .hero-section {
        padding: 4rem 1rem;
    }
}

.faq-answer {
    line-height: 1.6;
}

/* --- Standard Pages (About, Contact) --- */
.finance-contact-box {
    background: #ffffff;
    padding: 3rem;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    max-width: 800px;
    margin: 2rem auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.05);
}

.finance-about-wrapper h3 {
    font-size: 1.4rem;
    margin-top: 0;
}

@media (max-width: 768px) {
    .finance-contact-box {
        padding: 2rem 1.5rem;
    }
}

/* 13. Global Market Switcher Styles */
.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.market-switcher select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%230284c7%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem top 50%;
    background-size: 0.65rem auto;
    padding: 0.5rem 2.5rem 0.5rem 1rem !important;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    transition: all 0.3s ease;
    background-color: #fff;
    font-size: 14px;
    font-weight: 500;
}

.market-switcher select:hover {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.1);
}

/* SEO FAQ Section Refinement */
.seo-faq-section {
    animation: fh_fadeIn 0.8s ease-out;
}

@keyframes fh_fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* 14. Mobile Navigation & Hamburger Styles */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 28px;
    /* Slightly smaller */
    height: 22px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 9999;
    transition: all 0.3s ease;
}

.menu-toggle.active {
    display: none;
    /* Hidden by default on desktop */
}

.hamburger-line {
    width: 100%;
    height: 3px;
    /* Thicker lines */
    background-color: #0284c7;
    /* Brand color blue */
    border-radius: 2px;
    transition: all 0.3s ease;
    display: block;
}

.menu-toggle.active .hamburger-line {
    height: 4px;
    width: 100%;
    background-color: #ef4444;
}

.menu-toggle.active .hamburger-line:nth-child(1) {
    transform: rotate(45deg);
}

.menu-toggle.active .hamburger-line:nth-child(2) {
    opacity: 0;
}

.menu-toggle.active .hamburger-line:nth-child(3) {
    transform: rotate(-45deg);
}

@media (max-width: 991px) {
    .header-inner {
        display: flex !important;
        flex-direction: row !important;
        /* Force side-by-side */
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0.8rem 1rem !important;
        flex-wrap: wrap !important;
        /* Allow switcher to drop below if needed */
    }

    .site-branding {
        margin: 0 !important;
        text-align: left !important;
        max-width: 60%;
    }

    .site-branding h1 {
        font-size: 1.5rem !important;
        /* Smaller logo for mobile */
        margin: 0 !important;
    }

    .market-switcher {
        width: 100% !important;
        /* Switcher takes full width on its own line */
        margin: 0.5rem 0 0 0 !important;
        order: 3;
        /* Push to bottom */
    }

    .menu-toggle {
        display: flex !important;
        order: 2;
        /* Put after logo */
    }

    .menu-toggle.active {
        display: flex !important;
        position: fixed;
        top: 55px;
        right: 20px;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        z-index: 10001;
    }

    .menu-toggle.active .hamburger-line {
        position: absolute;
        top: 14px;
        left: 0;
    }

    .main-navigation {
        position: fixed;
        top: 0;
        left: -100%;
        width: 80%;
        height: 100vh;
        background: #fff;
        padding: 5rem 2rem;
        box-shadow: 10px 0 30px rgba(0, 0, 0, 0.1);
        transition: all 0.4s ease;
        z-index: 1000;
        overflow-y: auto;
    }

    .main-navigation.toggled {
        left: 0;
    }

    .main-navigation ul {
        flex-direction: column;
        align-items: flex-start;
    }

    .main-navigation li {
        width: 100%;
        margin: 0.5rem 0;
    }

    .main-navigation .sub-menu {
        position: static;
        box-shadow: none;
        padding-left: 1.5rem;
        display: block;
        opacity: 1;
        visibility: visible;
        transform: none;
        border-left: 2px solid #e2e8f0;
        margin-top: 0.5rem;
    }

    .market-switcher {
        width: 100% !important;
        /* Switcher takes full width on its own line */
        margin: 0.5rem 0 0 0 !important;
        order: 3;
        /* Push to bottom */
    }
}
/* --- Custom UI --- */
.site-branding .custom-logo-link { display: inline-block; vertical-align: middle; }
.site-branding .custom-logo { max-height: 32px; width: auto; display: block; border-radius: 0; }
.hero-section { display: none !important; }
@media (max-width: 768px) { .site-branding .custom-logo { max-height: 28px; } }
