/* ==========================================================================
   Finova Blog - High eCPM 2-Page Portal Stylesheet
   Modern, Ultra-clean Fintech Blog Aesthetic
   ========================================================================== */

:root {
  --primary: #2563EB;
  --primary-dark: #1D4ED8;
  --primary-light: #EFF6FF;
  --accent: #14B8A6;
  --accent-light: #F0FDFA;
  --bg-main: #F8FAFC;
  --bg-card: #FFFFFF;
  --text-main: #0F172A;
  --text-muted: #64748B;
  --text-light: #94A3B8;
  --border-color: #E2E8F0;
  --border-subtle: #F1F5F9;
  --dark-bg: #0F172A;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-heading: 'Plus Jakarta Sans', 'Inter', -apple-system, sans-serif;

  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.04);
  --shadow-md: 0 4px 16px -2px rgba(15, 23, 42, 0.08), 0 2px 6px -2px rgba(15, 23, 42, 0.04);
  --shadow-lg: 0 12px 28px -4px rgba(15, 23, 42, 0.12);

  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  --site-max-width: 1360px;
  --content-max-width: 820px;
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-main);
  line-height: 1.65;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s ease, opacity 0.2s ease;
}

img {
  max-width: 100%;
  display: block;
}

/* Container */
.container {
  width: 100%;
  max-width: var(--site-max-width);
  margin: 0 auto;
  padding: 0 24px;
}

/* Header & Navigation */
.site-header {
  background: #FFFFFF;
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}

.brand-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-icon {
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, var(--primary) 0%, #1D4ED8 100%);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-main);
  letter-spacing: -0.03em;
}

.brand-badge {
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  background: var(--accent-light);
  color: var(--accent);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  margin-left: 6px;
  letter-spacing: 0.05em;
}

.header-nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-muted);
  transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.nav-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: var(--primary);
  color: #FFFFFF;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-full);
  transition: background-color 0.2s, transform 0.2s;
}

.nav-cta-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

/* Ad Placement Containers */
.ad-slot-wrapper {
  width: 100%;
  margin: 24px auto;
  text-align: center;
  clear: both;
}

.ad-slot-wrapper.top-ad {
  margin: 20px auto 28px;
}

.ad-slot-wrapper.bottom-ad {
  margin: 36px auto 20px;
}

.ad-slot-wrapper.in-article-ad {
  margin: 32px auto;
  padding: 16px 0;
  border-top: 1px dashed var(--border-color);
  border-bottom: 1px dashed var(--border-color);
}

.ad-slot-wrapper ins.adsbygoogle {
  display: block;
  margin: 0 auto;
}

/* 3-Column Page Architecture (Left Space, Center Content, Right Space) */
.page-layout-grid {
  display: grid;
  grid-template-columns: 220px 1fr 220px;
  gap: 32px;
  align-items: start;
  padding: 24px 0 48px;
}

/* Left & Right Rails for Ads / Navigation */
.side-ad-rail {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.side-rail-box {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-sm);
  text-align: center;
}

.side-ad-slot {
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

.side-rail-title {
  font-family: var(--font-heading);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--text-light);
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.side-topics-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
  text-align: left;
}

.side-topic-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-main);
  transition: all 0.2s;
}

.side-topic-link:hover {
  background: var(--primary-light);
  color: var(--primary);
  transform: translateX(2px);
}

/* Main Center Content Column */
.center-content-col {
  max-width: var(--content-max-width);
  margin: 0 auto;
  width: 100%;
}

/* Hero Section */
.hero-box {
  background: linear-gradient(135deg, #1E293B 0%, #0F172A 100%);
  color: #FFFFFF;
  border-radius: var(--radius-xl);
  padding: 44px 36px;
  margin-bottom: 36px;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.hero-box::before {
  content: '';
  position: absolute;
  top: -50px;
  right: -50px;
  width: 250px;
  height: 250px;
  background: radial-gradient(circle, rgba(37, 99, 235, 0.35) 0%, rgba(37, 99, 235, 0) 70%);
  border-radius: 50%;
  pointer-events: none;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(37, 99, 235, 0.4);
  color: #93C5FD;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

.hero-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}

.hero-subtitle {
  font-size: 1.0625rem;
  color: #94A3B8;
  max-width: 640px;
  line-height: 1.6;
}

/* Article Cards (Homepage) */
.articles-stack {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.article-summary-card {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  position: relative;
}

.article-summary-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(37, 99, 235, 0.3);
}

.card-meta-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  flex-wrap: wrap;
  gap: 10px;
}

.topic-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 4px 12px;
  border-radius: var(--radius-full);
}

.topic-badge.real-estate {
  background: #EFF6FF;
  color: #1D4ED8;
  border: 1px solid #BFDBFE;
}

.topic-badge.loans {
  background: #F0FDF4;
  color: #15803D;
  border: 1px solid #BBF7D0;
}

.topic-badge.investing {
  background: #FAF5FF;
  color: #7E22CE;
  border: 1px solid #E9D5FF;
}

.read-time {
  font-size: 0.8125rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  gap: 6px;
}

.article-card-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.35;
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.article-card-title a:hover {
  color: var(--primary);
}

.article-excerpt {
  color: var(--text-muted);
  font-size: 0.96875rem;
  line-height: 1.7;
  margin-bottom: 22px;
}

.card-footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  flex-wrap: wrap;
  gap: 12px;
}

.author-chip {
  display: flex;
  align-items: center;
  gap: 10px;
}

.author-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3B82F6 0%, #1D4ED8 100%);
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.8125rem;
}

.author-info {
  display: flex;
  flex-direction: column;
}

.author-name {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
}

.publish-date {
  font-size: 0.75rem;
  color: var(--text-light);
}

.read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  background: var(--primary-light);
  color: var(--primary);
  font-weight: 700;
  font-size: 0.875rem;
  border-radius: var(--radius-full);
  transition: all 0.2s;
}

.read-btn:hover {
  background: var(--primary);
  color: #FFFFFF;
  transform: translateX(3px);
}

/* ==========================================================================
   2nd Page: Detailed Article Page Styles
   ========================================================================== */
.breadcrumbs-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.breadcrumbs-bar a {
  color: var(--text-muted);
}

.breadcrumbs-bar a:hover {
  color: var(--primary);
}

.article-header {
  margin-bottom: 32px;
}

.article-full-title {
  font-family: var(--font-heading);
  font-size: 2.25rem;
  font-weight: 800;
  color: var(--text-main);
  line-height: 1.25;
  letter-spacing: -0.03em;
  margin: 16px 0;
}

.article-lead-p {
  font-size: 1.125rem;
  line-height: 1.7;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.article-meta-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 16px 20px;
  margin-bottom: 32px;
}

.article-prose {
  font-size: 1.0625rem;
  line-height: 1.8;
  color: #334155;
}

.article-prose h2 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin: 36px 0 16px;
  letter-spacing: -0.02em;
}

.article-prose h3 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-main);
  margin: 28px 0 12px;
}

.article-prose p {
  margin-bottom: 20px;
}

.article-prose ul,
.article-prose ol {
  margin: 16px 0 24px 24px;
}

.article-prose li {
  margin-bottom: 10px;
}

.key-takeaways-box {
  background: #EFF6FF;
  border-left: 4px solid var(--primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: 24px 28px;
  margin: 28px 0;
}

.takeaways-title {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 1.0625rem;
  color: #1E40AF;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.strategy-table-wrap {
  width: 100%;
  overflow-x: auto;
  margin: 28px 0;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #FFFFFF;
}

.strategy-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 0.9375rem;
}

.strategy-table th {
  background: var(--bg-main);
  padding: 14px 18px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border-color);
}

.strategy-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-main);
}

/* Article Navigation Switcher */
.article-nav-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 40px 0;
  padding: 24px;
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.switch-nav-card {
  padding: 14px;
  border-radius: var(--radius-md);
  background: var(--bg-main);
  transition: all 0.2s;
}

.switch-nav-card:hover {
  background: var(--primary-light);
  transform: translateY(-2px);
}

.switch-nav-direction {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 4px;
}

.switch-nav-title {
  font-size: 0.9375rem;
  font-weight: 700;
  color: var(--text-main);
  line-height: 1.4;
}

/* ==========================================================================
   Footer & Legal Modals (Privacy Policy, Terms, Contact)
   ========================================================================== */
.site-footer {
  background: var(--dark-bg);
  color: #FFFFFF;
  padding: 48px 0 32px;
  margin-top: 64px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.footer-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 24px;
  padding-bottom: 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.footer-brand-title {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  font-weight: 800;
  color: #FFFFFF;
}

.footer-legal-links {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.footer-legal-btn {
  background: none;
  border: none;
  color: #94A3B8;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  transition: color 0.2s;
}

.footer-legal-btn:hover {
  color: #FFFFFF;
  text-decoration: underline;
}

.footer-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.8125rem;
  color: #64748B;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-disclaimer-text {
  font-size: 0.75rem;
  color: #64748B;
  line-height: 1.6;
}

/* Modal Popup System */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.modal-backdrop.is-active {
  opacity: 1;
  pointer-events: auto;
}

.modal-dialog {
  background: #FFFFFF;
  border-radius: var(--radius-xl);
  width: 100%;
  max-width: 680px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 36px 32px;
  position: relative;
  transform: translateY(20px);
  transition: transform 0.25s ease;
}

.modal-backdrop.is-active .modal-dialog {
  transform: translateY(0);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: var(--bg-main);
  border: 1px solid var(--border-color);
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-muted);
  transition: all 0.2s;
}

.modal-close-btn:hover {
  background: var(--border-color);
  color: var(--text-main);
}

.modal-title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-main);
  margin-bottom: 16px;
}

.modal-body {
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.7;
}

.modal-body h4 {
  color: var(--text-main);
  font-size: 1.0625rem;
  margin: 20px 0 8px;
}

.contact-form-group {
  margin-bottom: 16px;
  text-align: left;
}

.contact-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-main);
  margin-bottom: 6px;
}

.contact-input,
.contact-textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 16px;
  /* 16px prevents iOS zoom */
  background: #FFFFFF;
}

.contact-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--primary);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-md);
  font-weight: 700;
  cursor: pointer;
  margin-top: 10px;
  transition: background 0.2s;
}

.contact-submit-btn:hover {
  background: var(--primary-dark);
}

.formula-box {
  background: #FFFFFF;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  font-family: monospace;
  font-size: 0.9375rem;
  color: #1E40AF;
  margin: 18px 0;
  overflow-x: auto;
  word-break: break-word;
}

/* Ensure AdSense units always adapt to full mobile width without horizontal overflow */
.ad-slot-wrapper,
.side-ad-slot {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

ins.adsbygoogle {
  max-width: 100% !important;
  box-sizing: border-box;
}

/* ==========================================================================
   Responsive Breakpoints & Mobile Optimization
   ========================================================================== */
@media (max-width: 1120px) {
  .page-layout-grid {
    grid-template-columns: 190px 1fr 190px;
    gap: 20px;
  }
}

@media (max-width: 900px) {
  .page-layout-grid {
    display: flex;
    flex-direction: column;
    gap: 24px;
    padding: 16px 0 36px;
  }

  /* Primary content column is presented first on tablets/phones */
  .center-content-col {
    order: 1;
    width: 100%;
  }

  /* Side ad rails transition smoothly into vertical stack (NO display:none) */
  .side-ad-rail {
    position: static;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }

  .side-ad-rail[aria-label="Left Ad Rail"] {
    order: 2;
  }

  .side-ad-rail[aria-label="Right Ad Rail"] {
    order: 3;
  }

  .side-ad-slot {
    width: 100%;
    max-width: 100%;
    margin: 14px auto;
    text-align: center;
    overflow-x: hidden;
  }

  .side-rail-box {
    width: 100%;
    text-align: left;
  }
}

@media (max-width: 768px) {
  .site-header {
    height: auto;
    padding: 10px 0;
  }

  .header-inner {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .header-nav {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding: 4px 2px 6px;
    scrollbar-width: none;
  }

  .header-nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.8125rem;
    padding: 6px 12px;
    background: #FFFFFF;
    border-radius: var(--radius-full);
    border: 1px solid var(--border-color);
  }

  .nav-link.active {
    background: var(--primary-light);
    border-color: var(--primary);
    color: var(--primary);
  }

  .nav-cta-btn {
    font-size: 0.8125rem;
    padding: 6px 12px;
    white-space: nowrap;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 0 14px;
  }

  .hero-box {
    padding: 24px 16px;
    border-radius: var(--radius-lg);
  }

  .hero-title {
    font-size: 1.625rem;
    line-height: 1.25;
  }

  .hero-subtitle {
    font-size: 0.9375rem;
  }

  .article-summary-card {
    padding: 20px 16px;
    border-radius: var(--radius-lg);
  }

  .article-card-title {
    font-size: 1.25rem;
    line-height: 1.35;
  }

  .article-full-title {
    font-size: 1.45rem;
    line-height: 1.3;
  }

  .article-lead-p {
    font-size: 1rem;
    line-height: 1.65;
  }

  .article-meta-card {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
  }

  .card-footer-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .card-footer-row .read-btn {
    width: 100%;
    justify-content: center;
  }

  .article-nav-switcher {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 12px;
  }

  .footer-top-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .footer-legal-links {
    gap: 12px;
  }

  .footer-bottom-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }

  .modal-dialog {
    padding: 24px 16px;
    max-height: 90vh;
  }

  .ad-slot-wrapper.in-article-ad {
    margin: 24px auto;
    padding: 12px 0;
  }

  .formula-box {
    font-size: 0.8125rem;
    padding: 12px 14px;
  }
}

@media (max-width: 480px) {
  .brand-badge {
    display: none;
  }

  .brand-title {
    font-size: 1.25rem;
  }

  .hero-title {
    font-size: 1.45rem;
  }

  .article-full-title {
    font-size: 1.3rem;
  }
}