/*
Theme Name: EMICalc Premium
Theme URI: https://emi-calculator.com/
Author: Sigaka Tech Solutions
Author URI: https://www.sigaka.com/
Description: A high-performance, ultra-lightweight theme designed specifically for financial calculator sites.
Version: 1.0.0
License: GPLv2 or later
Text Domain: emicalc
*/

:root {
    --emi-primary: #0f5b92;
    --emi-secondary: #42958b;
    --emi-bg: #f8fafc;
    --emi-text: #1e293b;
    --emi-text-muted: #64748b;
    --emi-white: #ffffff;
    --emi-border: #e2e8f0;
    --emi-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --emi-radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: var(--emi-bg);
    color: var(--emi-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    color: var(--emi-primary);
}

.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
}

#page {
    max-width: 1300px;
    margin: 0 auto;
    background: var(--emi-white);
    box-shadow: 0 0 60px rgba(0, 0, 0, 0.05);
    min-height: 100vh;
}

/* Header */
.site-header {
    background: var(--emi-white);
    border-bottom: 1px solid var(--emi-border);
    position: sticky;
    top: 0;
    z-index: 1000;
    max-width: 1300px;
    /* Keep sticky header within the box */
    margin: 0 auto;
}
hr {
	margin: 20px 0 25px 0;
	color: white !important;
	height: 1px !important;
	background: #dfdfdf !important;
	border: 0;
}
.header-top {
    padding: 1rem 0;
    background: var(--emi-white);
}

.header-top-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
}

.header-right-ad-wrap {
    max-width: 728px;
    flex-grow: 1;
    display: flex;
    justify-content: flex-end;
}

@media (max-width: 992px) {
    .header-top-flex {
        flex-direction: column;
        text-align: center;
    }
    
    .header-right-ad-wrap {
        justify-content: center;
        width: 100%;
        margin-top: 1rem;
    }
}

.site-logo a {
    font-family: 'Outfit', sans-serif;
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--emi-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
}

.logo-text {
    display: flex;
    flex-direction: column;
    line-height: 1;
}

.logo-main {
    font-size: 2.2rem;
    color: #b91c1c;
    /* Crimson Red from design */
}

.logo-sub {
    font-size: 1.2rem;
    color: var(--emi-primary);
    font-weight: 500;
}

.header-bottom {
    background: #f8fafc;
    /* Very light blue/grey from design */
    border-top: 1px solid #f1f5f9;
    padding: 0.75rem 0;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.main-navigation ul {
    display: flex;
    list-style: none;
    gap: 2.5rem;
}

.main-navigation a {
    text-decoration: none;
    color: #334155;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.2s;
    text-transform: capitalize;
}

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

/* Mobile Menu Toggle */
.menu-toggle {
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    gap: 8px;
    color: var(--emi-text);
    font-weight: 600;
    font-family: inherit;
}

@media (max-width: 768px) {
    .menu-toggle {
        display: flex;
    }

    .main-navigation ul {
        display: none;
        flex-direction: column;
        gap: 0;
        background: #ffffff;
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        z-index: 1000;
        box-shadow: 0 10px 15px rgba(0,0,0,0.05);
        border-top: 1px solid var(--emi-border);
    }

    .main-navigation ul.toggled {
        display: flex;
    }

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

    .main-navigation a {
        display: block;
        padding: 1.25rem 1.5rem;
    }
}

/* Hero/Calculator Area */
.page-hero {
    padding: 4rem 0;
    background: linear-gradient(135deg, #f1f5f9 0%, #ffffff 100%);
}

.hero-title {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-title p {
    color: var(--emi-text-muted);
    font-size: 1.1rem;
}

/* Main Content Layout */
.site-content {
    padding: 2rem;
}

.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 3rem;
}

/* Full width layout for Homepage/Calculator */
.is-home-calculator .content-grid {
    grid-template-columns: 1fr;
}

.is-home-calculator #secondary {
    display: none;
}

/* Premium Sidebar Styles */
#secondary .widget {
    margin-bottom: 3rem;
}

#secondary .widget-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--emi-text);
    margin-bottom: 1.5rem;
    padding-bottom: 0.85rem;
    border-bottom: 1px solid var(--emi-border);
    position: relative;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#secondary .widget-title::before {
    content: 'RECOMMENDED';
    display: block;
    font-size: 0.65rem;
    font-weight: 800;
    color: var(--emi-secondary);
    letter-spacing: 2px;
    margin-bottom: 0.5rem;
}

#secondary .widget-title::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--emi-primary);
}

/* Sidebar Post List Styling (Common for Recent Posts plugins) */
#secondary ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

#secondary li {
    display: flex;

    margin-bottom: 0.6rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid #e3e3e3;
    align-items: flex-start;
}

#secondary li:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

#secondary li img {
    width: 80px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

#secondary li a {
    text-decoration: none;
    color: var(--emi-text);
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.2s;
    display: block;
}

#secondary li a:hover {
    color: var(--emi-primary);
}

/* Taxonomy/Category Widget */
.widget_categories ul li,
.widget_archive ul li,
.widget_nav_menu ul li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #f8fafc;
    padding: 10px 0;
}

.widget_categories ul li a {
    font-weight: 500;
    color: var(--emi-text-muted);
}

.widget_categories ul li a:hover {
    color: var(--emi-primary);
    padding-left: 5px;
}

/* Breadcrumbs Styling */
.emicalc-breadcrumbs {
    padding: 1rem 0;
    font-size: 0.9rem;
    color: var(--emi-text-muted);
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.emicalc-breadcrumbs a {
    text-decoration: none;
    color: var(--emi-primary);
    transition: color 0.2s;
}

.emicalc-breadcrumbs a:hover {
    color: var(--emi-secondary);
}

.breadcrumb-sep {
    color: #cbd5e1;
}

.breadcrumb-item.current {
    color: var(--emi-text-muted);
    font-weight: 500;
}

/* FAQ Styles */
.faq-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--emi-border);
    padding-bottom: 1rem;
}

.faq-question {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--emi-primary);
    margin-bottom: 0.5rem;
}

.faq-answer {
    color: var(--emi-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

.faq-answer {
    color: var(--emi-text-muted);
    font-size: 0.95rem;
    line-height: 1.6;
}

/* Catchy Archive Hero Styles */
.archive-hero {
    padding: 1.5rem 3rem;
    background: #ffffff;
    border-left: 6px solid var(--emi-primary);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.04);
}

.archive-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.archive-badge {
    display: inline-block;
    background: rgba(15, 91, 146, 0.08);
    color: var(--emi-primary);
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    white-space: nowrap;
}

.archive-hero .page-title {
    font-size: 1.8rem;
    margin: 0;
    color: var(--emi-text);
    line-height: 1;
}

.search-highlight {
    color: var(--emi-secondary);
    font-style: italic;
}

.archive-meta {
    margin-left: auto;
    font-size: 0.9rem;
    color: var(--emi-text-muted);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.archive-meta::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--emi-secondary);
}

.archive-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background-image: radial-gradient(var(--emi-border) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.4;
    z-index: 1;
    pointer-events: none;
    mask-image: linear-gradient(to left, black, transparent);
}

.archive-meta::before {
    content: '';
    display: block;
    width: 20px;
    height: 2px;
    background: var(--emi-secondary);
}

.archive-pattern {
    position: absolute;
    top: 0;
    right: 0;
    width: 300px;
    height: 100%;
    background-image: radial-gradient(var(--emi-border) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.4;
    z-index: 1;
    pointer-events: none;
    mask-image: linear-gradient(to left, black, transparent);
}

/* Global Search Form Styles */
.search-form {
    width: 100%;
}

.search-input-group {
    display: flex;
    align-items: stretch;
    background: var(--emi-white);
    border: 1px solid var(--emi-border);
    border-radius: 10px;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.search-input-group:focus-within {
    border-color: var(--emi-primary);
    box-shadow: 0 0 0 3px rgba(15, 91, 146, 0.1);
}

.search-field {
    flex-grow: 1;
    border: none;
    padding: 0.85rem 1.25rem;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    background: transparent;
    color: var(--emi-text);
}

.search-submit {
    background: var(--emi-primary);
    border: none;
    padding: 0 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.search-submit:hover {
    background: var(--emi-secondary);
}

.search-submit svg {
    display: block;
}

/* Post Card Styles */
.post-card {
    display: flex;
    gap: 2rem;
    margin-bottom: 2.5rem;
    padding: 1.5rem !important;
    transition: transform 0.2s;
    align-items: center;
}

.post-card:hover {
    transform: translateY(-3px);
}

.post-thumbnail {
    flex: 0 0 320px;
}

.post-thumbnail img {
    width: 100%;
    height: 220px;
    border-radius: 12px;
    object-fit: cover;
    display: block;
}

.post-content {
    flex-grow: 1;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.85rem;
    color: var(--emi-text-muted);
    margin-bottom: 1rem;
}

.post-meta img {
    border-radius: 50%;
}

.post-title {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.post-title a {
    text-decoration: none;
    color: var(--emi-text);
    transition: color 0.2s;
}

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

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

.post-footer {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 500;
}

.post-footer a {
    text-decoration: none;
    color: var(--emi-primary);
}

.post-footer .sep {
    color: #cbd5e1;
}

.post-footer .reading-time {
    color: var(--emi-text-muted);
}

@media (max-width: 768px) {
    .post-card {
        flex-direction: column;
        align-items: stretch;
    }

    .post-thumbnail {
        flex: 0 0 auto;
    }
}

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

/* Cards & Content */
.card {
    background: var(--emi-white);
    border-radius: var(--emi-radius);
    padding: 2.5rem;
    box-shadow: var(--emi-shadow);
    border: 1px solid var(--emi-border);
}

.entry-content {
    font-size: 1.05rem;
}

.entry-content p {
    margin-bottom: 1.5rem;
}

/* Footer */
.site-footer {
    background: #0f172a;
    color: #94a3b8;
    padding: 4rem 0 2rem;
    margin-top: 5rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
    margin-bottom: 3rem;
}

.footer-widget h3 {
    color: var(--emi-white);
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.footer-widget ul {
    list-style: none;
}

.footer-widget li {
    margin-bottom: 0.75rem;
}

.footer-widget a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-widget a:hover {
    color: var(--emi-white);
}

.footer-bottom {
    border-top: 1px solid #334155;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.9rem;
}

.footer-disclaimer {
    font-size: 0.8rem;
    color: #cbcbcb;
    margin-top: 1rem;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Contact Form Styles */
.contact-form-container {
    background: #ffffff;
    padding: 2.5rem;
    border-radius: 12px;
    border: 1px solid var(--emi-border);
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    margin-top: 2rem;
}

.contact-form-row {
    margin-bottom: 1.5rem;
}

.contact-form-row label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: var(--emi-text);
}

.contact-form-row input[type="text"],
.contact-form-row input[type="email"],
.contact-form-row textarea {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.contact-form-row input:focus,
.contact-form-row textarea:focus {
    outline: none;
    border-color: var(--emi-primary);
    box-shadow: 0 0 0 3px rgba(15, 91, 146, 0.1);
}

.contact-submit-btn {
    background: var(--emi-primary);
    color: #ffffff;
    border: none;
    padding: 1rem 2rem;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    width: 100%;
}

.contact-submit-btn:hover {
    background: #0d4a75;
}