/*
Theme Name: Insfinance Pro
Version: 1.1.0
Description: High-premium, edge-to-edge light mode architecture with desktop sidebar.
Author: Insfinance
*/

@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800;900&family=Merriweather:wght@400;700;900&display=swap');

/* --- 1. MINIMALIST VARIABLES & RESET --- */
:root { 
    /* Core Colors */
    --ink: #111111;               /* Deep black for primary text */
    --charcoal: #666666;          /* Gray for secondary text/meta */
    --apple-accent: #fa243c;      /* Primary Accent (Red) */
    
    /* Canvas & Surfaces */
    --border-soft: #f5f5f7; 
    --border-hard: #e5e5ea;       
    --border: #e5e5ea;            
    --bg: #ffffff;                /* Pure White Background */
    --surface: #ffffff;           /* Pure White Surface */
    --panel-bg: #f9f9f9;          /* Light gray for sidebars/panels */
    
    /* Typography System */
    --ui-font: 'Plus Jakarta Sans', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --reading-font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --editorial-font: 'Plus Jakarta Sans', sans-serif; 
    
    /* Physics & Micro-Interactions */
    --spring: cubic-bezier(0.16, 1, 0.3, 1); 
    --shadow-sm: 0 2px 8px rgba(0,0,0,0.04);
    --shadow-md: 0 8px 24px rgba(0,0,0,0.08);
    --button-radius: 8px;     
}

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

body { 
    background-color: var(--bg); 
    color: var(--ink); 
    font-family: var(--ui-font); 
    line-height: 1.5; 
    font-weight: 500;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6, .entry-title { word-wrap: break-word; overflow-wrap: break-word; hyphens: auto; color: var(--ink); }

/* Force tabular numbers for data/calculators */
.tabular-data, .mn-res-val, .mn-bmi-value, .pc-plan-price-display {
    font-variant-numeric: tabular-nums;
}


/* --- 2. THE NEW APP LAYOUT ARCHITECTURE (SIDEBAR + MAIN) --- */
.pc-app-layout {
    display: flex;
    width: 100%;
    min-height: 100vh;
    background: var(--bg);
}

/* Desktop Sidebar (Fixed Left) */
.pc-desktop-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 260px;
    height: 100vh;
    background: var(--panel-bg);
    border-right: 1px solid var(--border-hard);
    z-index: 999999 !important; /* Extremely high to ensure it covers join card on mobile */
    display: flex;
    flex-direction: column;
    padding: 30px 20px 80px 20px; /* Extra bottom padding for scroll */
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    
    /* Hide scrollbar by default (Firefox) */
    scrollbar-width: none;
    transition: scrollbar-color 0.3s ease;
}

/* Hide scrollbar by default (Webkit: Chrome, Safari, Edge) */
.pc-desktop-sidebar::-webkit-scrollbar {
    width: 6px;
    background-color: transparent;
}
.pc-desktop-sidebar::-webkit-scrollbar-thumb {
    background-color: transparent;
    border-radius: 10px;
}

/* Show scrollbar dynamically on hover */
.pc-desktop-sidebar:hover {
    scrollbar-width: thin; /* Firefox */
    scrollbar-color: #c7c7cc transparent; /* Firefox */
}
.pc-desktop-sidebar:hover::-webkit-scrollbar-thumb {
    background-color: #c7c7cc; /* Webkit */
}

/* Main Content Area (Pushed Right) */
.pc-main-content {
    flex: 1;
    margin-left: 260px; /* Offset for desktop sidebar */
    width: calc(100% - 260px);
    background: var(--bg);
    padding: 30px 40px 120px 40px; /* Bottom padding accounts for player + join card */
    min-height: 100vh;
}

/* Mobile Adjustments for Layout */
.pc-mobile-header {
    position: relative !important; /* Kills sticky header */
}

@media (max-width: 1024px) {
    .pc-desktop-sidebar {
        display: none; /* Handled by mobile slide panel in header.php */
    }
    .pc-main-content {
        margin-left: 0;
        width: 100%;
        padding: 20px 20px 120px 20px;
    }
}

/* --- 3. BRAND & DESKTOP SIDEBAR COMPONENTS --- */

/* Classic Logo Style Restored */
.logo a {
    font-family: 'Merriweather', serif; 
    font-weight: 900; 
    font-size: 24px; 
    letter-spacing: -0.5px; 
    color: var(--ink);
    text-decoration: none;
    line-height: 1;
    display: flex;
    align-items: baseline; /* Aligns the dot perfectly */
}

.logo-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: var(--apple-accent);
    margin-left: 4px;
    border-radius: 50%; 
}

/* Search Icon moved to the right */
.pc-sidebar-search {
    margin: 25px 0;
    position: relative;
}
.pc-sidebar-search input {
    width: 100%;
    background: #ebebf0;
    border: none;
    border-radius: 8px;
    padding: 10px 35px 10px 14px; /* Padding shifted right for icon */
    font-size: 13px;
    font-weight: 500;
    color: var(--ink);
    outline: none;
    font-family: var(--ui-font);
}
.pc-sidebar-search input::placeholder { color: #8e8e93; }
.pc-sidebar-search svg {
    position: absolute;
    right: 12px; /* Icon on the right */
    left: auto;
    top: 50%;
    transform: translateY(-80%);
    width: 16px;
    height: 16px;
    color: #8e8e93;
}

.pc-sidebar-nav { flex: 1; }
.pc-sidebar-nav ul { list-style: none; padding: 0; margin: 0; }
.pc-sidebar-nav li { margin-bottom: 4px; }
.pc-sidebar-nav a {
    display: flex; align-items: center; gap: 12px;
    padding: 8px 12px; border-radius: 6px;
    color: var(--ink); font-size: 14px; font-weight: 600;
    text-decoration: none; transition: background 0.2s;
}
.pc-sidebar-nav a svg, .pc-sidebar-nav a .dashicons { width: 18px; height: 18px; color: var(--apple-accent); font-size: 18px; }
.pc-sidebar-nav a:hover { background: #ebebf0; }
.pc-sidebar-nav h4 { font-size: 11px; text-transform: uppercase; color: #8e8e93; margin: 5px 0 10px 12px; letter-spacing: 0.5px; font-weight: 700; }


/* --- 4. MINIMALIST MEDIA GRIDS --- */
.pocalc-grid { 
    display: grid; 
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); 
    gap: 30px 20px; 
    margin-top: 20px;
}

.pc-grid-item {
    background: transparent; 
    border: none; 
    border-radius: 0; 
    overflow: hidden;
    transition: none;
    box-shadow: none;
}
.pc-grid-item:hover { transform: none; box-shadow: none; }

.pc-img-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1/1; /* Perfect Square */
    border-radius: 8px; /* Subtle corner radius */
    overflow: hidden;
    background: var(--border-soft);
    border: 1px solid rgba(0,0,0,0.04);
    box-shadow: var(--shadow-sm);
    cursor: pointer;
}

.pc-img { 
    width: 100%; 
    height: 100%;
    object-fit: cover;
    object-position: center; 
    transition: transform 0.4s var(--spring);
}

.pc-img-wrap:hover .pc-img {
    transform: scale(1.05); /* Slight zoom on hover */
}

/* Play Button on Bottom Left */
.pc-play-btn {
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink);
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    opacity: 0; /* Hidden by default */
    transform: translateY(5px);
    transition: all 0.3s var(--spring);
    z-index: 10;
}
.pc-img-wrap:hover .pc-play-btn {
    opacity: 1;
    transform: translateY(0);
}
.pc-play-btn .dashicons { font-size: 16px; margin-left: 2px; }

/* Grid Meta Typography */
.pc-meta { 
    padding: 10px 0 0 0; 
    text-align: left; 
}
.pc-meta h4 { 
    margin: 0; 
    font-size: 14px; 
    font-weight: 700; 
    color: var(--ink); 
    line-height: 1.3;
    white-space: normal; /* Full Title */
    overflow: visible; 
    text-overflow: clip; 
    display: block;
}
.pc-meta .pc-subtitle {
    font-size: 12px;
    color: var(--charcoal);
    margin-top: 2px;
}

@media (max-width: 768px) {
    .pocalc-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 15px; }
    .pc-play-btn { opacity: 1; transform: translateY(0); width: 28px; height: 28px; bottom: 6px; left: 6px;} /* Always show play button on mobile */
    .pc-meta h4 { font-size: 13px; }
}


/* --- 5. FLAT THEME BUTTONS --- */
.pocalc-play-btn, .pocalc-lib-btn, .pocalc-dl-btn, .pocalc-login-btn, .pc-danger-btn, .pc-cta-primary, .pc-cta-secondary {
    display: inline-flex; 
    align-items: center; 
    justify-content: center; 
    gap: 8px;
    width: auto;
    padding: 10px 20px !important; 
    border-radius: var(--button-radius) !important; 
    border: none !important;
    box-shadow: none !important;
    font-size: 13px; 
    font-weight: 600;
    font-family: var(--ui-font);
    cursor: pointer;
    text-decoration: none !important;
    transition: all 0.2s ease;
    line-height: 1.2;
}

.pocalc-play-btn:active, .pocalc-lib-btn:active, .pc-cta-primary:active, .pc-cta-secondary:active { transform: scale(0.97); }

.pocalc-play-btn, .pc-cta-primary, .pocalc-login-btn {
    background-color: var(--apple-accent); 
    color: #fff !important;
}
.pocalc-play-btn:hover, .pc-cta-primary:hover, .pocalc-login-btn:hover {
    background-color: #d81b2e; 
}

.pocalc-lib-btn, .pocalc-dl-btn, .pc-cta-secondary {
    background-color: #f2f2f7; 
    color: var(--ink);
}
.pocalc-lib-btn:hover, .pocalc-dl-btn:hover, .pc-cta-secondary:hover {
    background-color: #e5e5ea; 
}

/* --- 6. SINGLE POST / READER MINIMALIST VIEW --- */
.single-post-header {
    display: flex; flex-direction: column; align-items: flex-start; gap: 20px;
    margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid var(--border-hard);
}
.single-header-image { width: 100%; max-width: 300px; }
.apple-side-art { width: 100%; height: auto; border-radius: 12px; box-shadow: var(--shadow-sm); border: 1px solid rgba(0,0,0,0.05); aspect-ratio: 1/1; object-fit: cover; }

.single-header-content { text-align: left; }
.single-header-content .entry-title { font-size: 28px !important; margin: 0 0 10px 0 !important; font-weight: 800; letter-spacing: -0.5px; }

.post-content {
    font-family: var(--ui-font);
    font-size: 16px;
    line-height: 1.7; 
    color: #333333; 
    font-weight: 400;
}
.post-content p { margin-bottom: 24px; }
.post-content h2, .post-content h3, .post-content h4 { color: var(--ink); font-weight: 700; margin: 30px 0 15px; }

@media (min-width: 768px) {
    .single-post-header { flex-direction: row; align-items: center; gap: 40px; }
    .single-header-content .entry-title { font-size: 36px !important; }
}


/* --- 7. STICKY JOIN CARD (GUESTS) --- */
.pc-sticky-join-card {
    position: fixed;
    bottom: 0;
    left: 260px; /* Offset for desktop sidebar */
    width: calc(100% - 260px);
    height: 70px;
    background: #d60017;
    border-top: 1px solid #d60017;
    z-index: 999998; /* Just below player */
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-sizing: border-box;
}
.pc-join-card-text { font-size: 15px; font-weight: 500; color: #ffffff; }
.pc-join-card-text strong { font-weight: 700; }
.pc-join-card-btn {
    background: #ffffff; color: #000000; text-decoration: none;
    padding: 8px 16px; border-radius: 20px; font-size: 13px; font-weight: 600;
    transition: background 0.2s;
}
.pc-join-card-btn:hover { background: #eaeaea; }

@media (max-width: 1024px) {
    .pc-sticky-join-card { left: 0; width: 100%; padding: 0 15px; flex-direction: column; justify-content: center; gap: 5px; height: auto; padding: 10px 15px;}
    .pc-join-card-text { font-size: 13px; text-align: center; }
}


/* --- 8. UTILITIES & MISC --- */
.pc-repeat-wrapper { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pc-custom-repeat-input { width: 80px; padding: 8px; border: 1px solid var(--border-hard); border-radius: 6px; font-size: 13px; outline: none; background: #fff; }
.pc-custom-repeat-input:focus { border-color: var(--apple-accent); }
.pc-reset-repeat-btn, .pc-save-repeat-btn { background: #f2f2f7; border: none; width: 32px; height: 32px; border-radius: 50%; cursor: pointer; color: var(--charcoal); display: flex; align-items: center; justify-content: center; }
.pc-reset-repeat-btn:hover, .pc-save-repeat-btn:hover { background: #e5e5ea; color: var(--ink); }

#pc-toast {
    visibility: hidden; min-width: 250px; background-color: var(--apple-accent); backdrop-filter: blur(10px);
    color: #fff; text-align: center; border-radius: 8px; padding: 12px 20px;
    position: fixed; z-index: 9999999; left: 50%; transform: translateX(-50%); bottom: -50px;
    font-size: 13px; font-weight: 500; opacity: 0; transition: opacity 0.3s, bottom 0.3s;
}
#pc-toast.show { visibility: visible; opacity: 1; bottom: 100px; }
body.has-join-card #pc-toast.show { bottom: 170px; }

/* Global Input Styling */
input[type="text"], input[type="email"], input[type="password"], input[type="number"], textarea, select {
    width: 100%; background: #f5f5f7; border: 1px solid var(--border-hard); border-radius: 8px;
    padding: 12px 16px; font-size: 14px; color: var(--ink); outline: none; font-family: var(--ui-font); margin-bottom: 15px;
}
input:focus, textarea:focus, select:focus { border-color: var(--apple-accent); background: #fff; }

/* Pagination */
.pocalc-pagination ul { display: flex; justify-content: center; gap: 8px; list-style: none; margin: 30px 0; padding: 0; }
.pocalc-pagination a, .pocalc-pagination span {
    padding: 8px 12px; border-radius: 6px; text-decoration: none; color: var(--ink); font-weight: 500; font-size: 14px; background: transparent; transition: 0.2s;
}
.pocalc-pagination a:hover { background: #f2f2f7; }
.pocalc-pagination .current { background: var(--ink); color: #fff; }

/* ==========================================================================
   THE ABSOLUTE LAYOUT FIX FOR UNIFORM CARDS
   ========================================================================== */

/* 1. Force the parent grid items to align flush to prevent row line expansion */
.pocalc-grid {
    align-items: start !important;
}

/* 2. The Bulletproof 1:1 Pad Container */
.pc-img-wrap.pc-square-card {
    position: relative !important;
    width: 100% !important;
    height: 0 !important;
    padding-bottom: 100% !important; /* Locks container to an unshakeable 1:1 grid canvas */
    background: linear-gradient(135deg, #fdfbf7 0%, #f5f0e6 100%) !important;
    border: 1px solid #eae1d3 !important;
    border-radius: 8px !important;
    box-sizing: border-box !important;
    overflow: hidden !important; 
    display: block !important;   
}

/* 3. Absolute Coordinate Mapping */
.pc-square-icon {
    position: absolute !important;
    top: 25% !important; 
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    font-size: 26px !important;
    color: #b45309 !important;
    opacity: 0.8 !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    flex-shrink: 0 !important;
    z-index: 5 !important;
}

.pc-square-title {
    position: absolute !important;
    top: 60% !important; 
    left: 10% !important;
    width: 80% !important;
    transform: translateY(-50%) !important;
    font-family: "Merriweather", serif !important;
    font-size: 14px !important;
    font-weight: 700 !important; 
    color: var(--ink) !important;
    line-height: 1.4 !important;
    text-align: center !important;
    margin: 0 !important;
    padding: 0 !important;
    
    max-height: 50% !important;
    overflow-y: auto !important;
    scrollbar-width: none !important; 
    z-index: 5 !important;
}

.pc-square-title::-webkit-scrollbar {
    display: none !important; 
}

/* 4. Smooth Responsive Scaling for Small Screens */
@media (max-width: 768px) {
    .pc-square-title {
        font-size: 11px !important;
        line-height: 1.3 !important;
        width: 86% !important;
        left: 7% !important;
        top: 62% !important;
    }
    .pc-square-icon {
        font-size: 22px !important;
        top: 24% !important;
    }
}
.pc-region-card p {
    display: none;
}
/* ==========================================================================
   SMART AD COLLAPSER (Hides Blank Spaces for Unfilled Ads & AdBlockers)
   ========================================================================== */

/* 1. Hide the AdSense element itself when Google cannot fill it */
ins.adsbygoogle[data-ad-status="unfilled"] {
    display: none !important;
}

/* 2. Collapse the parent wrappers on Insfinance if the ad inside is unfilled */
.pc-ad-container:has(ins.adsbygoogle[data-ad-status="unfilled"]),
.pc-real-ad-container:has(ins.adsbygoogle[data-ad-status="unfilled"]) {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
}

/* 3. Catch-all for strict AdBlockers that completely strip the ad code out of the box */
.pc-ad-container:empty,
.pc-real-ad-container:empty {
    display: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-height: 0 !important;
    height: 0 !important;
}